From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#23783: Emacs 25: Changing font-lock-maximum-decoration doesn't work. Date: Sat, 18 Jun 2016 17:19:03 +0000 Message-ID: <20160618171903.GB5796@acm.fritz.box> References: <20160617102500.GA3316@acm.fritz.box> <83ziqiakhx.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1466270369 15588 80.91.229.3 (18 Jun 2016 17:19:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jun 2016 17:19:29 +0000 (UTC) Cc: 23783@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 18 19:19:14 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bEJtq-0002v9-BO for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 19:19:14 +0200 Original-Received: from localhost ([::1]:35719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEJtp-0006vi-Il for geb-bug-gnu-emacs@m.gmane.org; Sat, 18 Jun 2016 13:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEJtj-0006uj-Dz for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:19:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEJte-0002b5-BH for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:19:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33004) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEJte-0002b1-82 for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bEJte-0001H3-54 for bug-gnu-emacs@gnu.org; Sat, 18 Jun 2016 13:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Jun 2016 17:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 23783 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 23783-submit@debbugs.gnu.org id=B23783.14662703344882 (code B ref 23783); Sat, 18 Jun 2016 17:19:02 +0000 Original-Received: (at 23783) by debbugs.gnu.org; 18 Jun 2016 17:18:54 +0000 Original-Received: from localhost ([127.0.0.1]:45341 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEJtW-0001Gf-5V for submit@debbugs.gnu.org; Sat, 18 Jun 2016 13:18:54 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:46493) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bEJtU-0001GX-AR for 23783@debbugs.gnu.org; Sat, 18 Jun 2016 13:18:52 -0400 Original-Received: (qmail 36504 invoked by uid 3782); 18 Jun 2016 17:18:51 -0000 Original-Received: from acm.muc.de (p548C67AF.dip0.t-ipconnect.de [84.140.103.175]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 18 Jun 2016 19:18:49 +0200 Original-Received: (qmail 5945 invoked by uid 1000); 18 Jun 2016 17:19:03 -0000 Content-Disposition: inline In-Reply-To: <83ziqiakhx.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:119739 Archived-At: Hello, Eli. On Sat, Jun 18, 2016 at 12:56:10PM +0300, Eli Zaretskii wrote: > > Date: Fri, 17 Jun 2016 10:25:00 +0000 > > From: Alan Mackenzie > > 1. emacs -Q > > 2. M-x customize-variable font-lock-maximum-decoration > > o - set the level to 1 (minimum decoration) and apply the new > > setting. > > 3. C-x C-f .../src/xdisp.c > > 4. Note that font locking is indeed at level 1. Note, indeed, how fast > > scrolling works. ;-) > > 5. M-x customize-variable font-lock-maximum-decoration > > o - set the level to t (maximum decoration) and apply. > > 6. (In the xdisp.c window) M-x font-lock-mode, twice. > > 7. Note that the font locking remains at level 1. > > This last is surely a bug. Enabling font locking in a buffer should use > > the current valid setting of font-lock-maximum-decoration. > It's quite clear from the code that this is the intended behavior. > The comments for font-lock-set-defaults (the function and the > variable) and for font-lock-refresh-defaults are especially revealing. I haven't read them yet, but I will. It is not user friendly to have to set an option before visiting a file. In this case, a natural use case would be to want to reduce the decoration level after finding things being too slow at the default level. > > There are no instructions in the Emacs manual which tell you how to > > change decoration levels. It merely states on page "Font Lock Mode" > > that "You can customize the variable `font-lock-maximum-decoration' to > > alter the amount of fontification applied by Font Lock mode, for major > > modes that support this feature.". This doesn't then say what is to be > > done after doing such customization, for it to take effect. > > There is a non-interactive function `font-lock-refresh-defaults' which > > works, but this function isn't called from anywhere in Emacs. > I have added to the Emacs manual explanation of how to make the > customization of font-lock-maximum-decoration effective in a file > buffer. In a nutshell, you need to either customize before visiting > the file, or kill the buffer and revisit the file after the > customization. Thanks! > I think this fixes this bug, so I'm closing it. OK. I'll think about trying to fix the code in the near future. > Thanks. -- Alan Mackenzie (Nuremberg, Germany).