all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: changing the display of formfeed characters
Date: Mon, 03 Sep 2018 19:12:54 +0300	[thread overview]
Message-ID: <83d0tuzhix.fsf@gnu.org> (raw)
In-Reply-To: <8f118419-b05e-4b04-860c-a0c2f2e89956@default> (message from Drew Adams on Sun, 2 Sep 2018 22:40:41 +0000 (UTC))

> 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.



  reply	other threads:[~2018-09-03 16:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 11:22 changing the display of formfeed characters Javier
2018-09-01 13:51 ` Eli Zaretskii
2018-09-02 22:40   ` Drew Adams
2018-09-03 16:12     ` Eli Zaretskii [this message]
     [not found] ` <mailman.262.1535809931.1284.help-gnu-emacs@gnu.org>
2018-09-02 20:47   ` Javier
2018-09-03 16:14     ` Eli Zaretskii
2018-09-03  0:30 ` Nick Helm
     [not found] ` <mailman.318.1535934620.1284.help-gnu-emacs@gnu.org>
2018-09-03 13:57   ` Javier
2018-09-03 17:23     ` Javier
2018-09-04  6:43       ` Javier
2018-09-04  6:50         ` Javier
2018-09-07  0:26           ` Nick Helm
2018-09-07  3:56           ` Nick Helm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83d0tuzhix.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.