From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: changing the display of formfeed characters Date: Mon, 03 Sep 2018 19:12:54 +0300 Message-ID: <83d0tuzhix.fsf@gnu.org> References: <83tvn91g20.fsf@gnu.org> <8f118419-b05e-4b04-860c-a0c2f2e89956@default> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1535991085 6653 195.159.176.226 (3 Sep 2018 16:11:25 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 3 Sep 2018 16:11:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 03 18:11:21 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fwrRh-0001Zh-5S for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Sep 2018 18:11:21 +0200 Original-Received: from localhost ([::1]:45991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwrTn-0006wo-N2 for geh-help-gnu-emacs@m.gmane.org; Mon, 03 Sep 2018 12:13:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwrTN-0006um-Pq for help-gnu-emacs@gnu.org; Mon, 03 Sep 2018 12:13:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fwrTK-0004SZ-HQ for help-gnu-emacs@gnu.org; Mon, 03 Sep 2018 12:13:05 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:47183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwrTK-0004SR-Bc for help-gnu-emacs@gnu.org; Mon, 03 Sep 2018 12:13:02 -0400 Original-Received: from [176.228.60.248] (port=4139 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fwrTJ-0007LD-VN for help-gnu-emacs@gnu.org; Mon, 03 Sep 2018 12:13:02 -0400 In-reply-to: <8f118419-b05e-4b04-860c-a0c2f2e89956@default> (message from Drew Adams on Sun, 2 Sep 2018 22:40:41 +0000 (UTC)) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:117822 Archived-At: > Date: Sun, 2 Sep 2018 22:40:41 +0000 (UTC) > From: Drew Adams > > > 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.