unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
To: "'Stefan Monnier'" <monnier@iro.umontreal.ca>
Cc: 9919@debbugs.gnu.org
Subject: bug#9919: 24.0.91; font-lock broken in dired
Date: Mon, 9 Jan 2012 16:04:19 -0800	[thread overview]
Message-ID: <7828076964A745E39311AEB941AD52F0@us.oracle.com> (raw)
In-Reply-To: <jwv8vlgpl7x.fsf-monnier+emacs@gnu.org>

> > (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.






  reply	other threads:[~2012-01-10  0:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 15:11 bug#9919: 24.0.91; font-lock broken in dired Drew Adams
2011-10-31 22:06 ` Drew Adams
2011-10-31 22:29   ` Drew Adams
2011-11-05  1:34 ` Christoph Scholtes
2011-11-05 15:30   ` Drew Adams
2012-01-09 15:52     ` Drew Adams
2012-01-09 17:04       ` Stefan Monnier
2012-01-09 18:59         ` Drew Adams
2012-01-09 22:36           ` Stefan Monnier
2012-01-10  0:04             ` Drew Adams [this message]
2012-01-10  1:26               ` Stefan Monnier
2012-01-10  1:35                 ` Drew Adams
2012-01-10  3:14                   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7828076964A745E39311AEB941AD52F0@us.oracle.com \
    --to=drew.adams@oracle.com \
    --cc=9919@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).