GNU bug report logs - #9919
24.0.91; font-lock broken in dired

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Mon, 31 Oct 2011 15:15:02 UTC

Severity: normal

Tags: notabug

Merged with 6662

Found in versions 24.0.50, 24.0.91

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Forwarded to http://lists.gnu.org/archive/html/emacs-devel/2010-07/msg01057.html

Full log


Message #11 received at 9919 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: <9919 <at> debbugs.gnu.org>
Subject: RE: bug#9919: 24.0.91; font-lock broken in dired
Date: Mon, 31 Oct 2011 15:29:05 -0700
> If this user-visible change is intended, then please (a) 
> update the doc to explain it, and (b) mention the change in NEWS.

Whatever the motivation behind this change (assuming it was intentional), the
effect is that font-locking now gets done _twice_ when someone modifies
`font-lock-defaults', because of the need to call `font-lock-refresh-defaults'.
In my case, this happens each time a Dired buffer is visited.  (Likewise buffer
menu and finder and...)

This is a waste of time.  It should be possible to simply update
`font-lock-defaults' (e.g. in a mode hook) and have font-locking be done only
once, using the updated defaults.  Why impose double font-locking?  Why should
any initial font-locking with the wrong defaults followed by "refreshing" to the
right ones be needed?  This apparently was not needed in the past.

It was such a simple idiom:

(set (make-local-variable 'font-lock-defaults)
     '(nil t nil nil nil
       (font-lock-fontify-region-function .
        browse-kill-ring-fontify-region)))

(setq font-lock-defaults  '(buffer-menu-font-lock-keywords t))

(setq font-lock-defaults '(finder-font-lock-keywords nil nil
                           (("+-*/.<>=!?$%_&~^:@" . "w")) nil))

(set (make-local-variable 'font-lock-defaults)
     '(compilation-mode-font-lock-keywords t))

...

On n'arrete pas le progres...





This bug report was last modified 13 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.