[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: changing the display of formfeed characters
From: |
Eli Zaretskii |
Subject: |
Re: changing the display of formfeed characters |
Date: |
Mon, 03 Sep 2018 19:12:54 +0300 |
> Date: Sun, 2 Sep 2018 22:40:41 +0000 (UTC)
> From: Drew Adams <drew.adams@oracle.com>
>
> > AFAICT, those modes break whitespace-mode because they define their
> > own display table without copying the display table that was in effect
> > before the mode was switched on.
>
> FWIW, `pp-c-l.el' creates a display table only when
> `(window-display-table WINDOW)' is nil. Otherwise, it just sets the
> entry for ^L in that existing display table:
>
> (walk-windows
> (lambda (window)
> (let ((display-table (or (window-display-table window)
> (make-display-table))))
> (aset display-table ?\014 (and pretty-control-l-mode
> (pp^L-^L-display-table-entry window)))
> (set-window-display-table window display-table)))
> 'no-minibuf
> 'visible)
This creates a _window_ display-table, when the current window doesn't
have one. By contrast, whitespace.el creates a _buffer_
display-table. And window-specific display-table takes precedence
over the buffer-specific one. Thus, the effect of the above is to
effectively disable the settings made by whitespace-mode.
So if pp-c-l.el wants to be nice to whitespace.el and other similar
modes, it should check not only window-display-table, but also
buffer-display-table, and I think even standard-display-table if the
other two don't exist. If any one of these exists, pp-c-l.el should
copy it to the window-display-table, and then add its settings there.
Then I think pp-c-l.el will not break whitespace-mode.