bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9919: 24.0.91; font-lock broken in dired


From: Drew Adams
Subject: 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...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]