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 #36 received at 9919 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Stefan Monnier'" <monnier <at> iro.umontreal.ca>
Cc: 9919 <at> debbugs.gnu.org
Subject: RE: bug#9919: 24.0.91; font-lock broken in dired
Date: Mon, 9 Jan 2012 16:04:19 -0800
> > (add-hook
> >   'dired-mode-hook
> >   (lambda ()
> >     (set (make-local-variable 'font-lock-defaults)
> >          (cons '(dired-font-lock-keywords 
> >                   diredp-font-lock-keywords-1)
> >                (cdr font-lock-defaults)))
> 
> Now after running the above code, the user adds
>   (add-hook 'dired-mode-hook (lambda () (font-lock-mode 1)))
> and suddenly the bug shows up even in Emacs-23.

OK, so Emacs broke it in 23 instead of 24. ;-)  That does not happen in Emacs
20-22 AFAICT.  What's the gotcha for Emacs 20-22?  What does a user need to do
in Emacs 20-22 to show that this code won't DTRT?

Let me put it this way: I've never seen the problem in Emacs 20-22, and I've
never received a report from anyone mentioning such a problem with that code.

Did you receive any Emacs 20-22 bug reports, for example, from users who, like
me, did not understand that such problematic behavior was inherent?

Not that such reports would have corresponded to real bugs, from what you say,
but presumably there would have been at least someone who was bitten by what you
say has always been an inherent gotcha/problem.

I'm just curious why this is manifested in 24 without doing anything, and in 23
if you do as you note above, but not at all (AFAICT) in 20-22.

> > What's the cause of this change/regression?
> 
> Nothing very deep.  The moment when font-lock-mode gets enabled
> has changed.  I'm not convinced the new time is really much 
> better, but I'm not convinced the old time was better either.

Was that change made in Emacs 23 or 24?  See my question above - just trying to
understand the differences between (a) 20-22, (b) 23, and (c) 24.

> Basically it used to be enabled after running the mode hook,
> which made it difficult to disable font-lock-mode via a
> mode-hook check, wherea now it gets enabled before, so you can just do
> 
>   (add-hook 'dired-mode-hook (lambda () (if foo (font-lock-mode -1))))

I see.  Thanks for the explanation.  Makes sense.





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

Previous Next


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