GNU bug report logs - #19720
24.4; minor mode's font-lock-add-keywords & auto-mode-alist problem

Previous Next

Package: emacs;

Reported by: Joost Kremers <joostkremers <at> fastmail.fm>

Date: Wed, 28 Jan 2015 22:56:02 UTC

Severity: minor

Found in version 24.4

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


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

From: Glenn Morris <rgm <at> gnu.org>
To: Joost Kremers <joostkremers <at> fastmail.fm>
Cc: 19720 <at> debbugs.gnu.org
Subject: Re: bug#19720: 24.4;
 minor mode's font-lock-add-keywords & auto-mode-alist problem
Date: Wed, 28 Jan 2015 21:42:40 -0500
Joost Kremers wrote:

> Font lock keywords added with `font-lock-add-keywords' in a minor mode's
> activation function do not work when the minor mode is activated in a
> major mode's hook and the major mode is activated through an entry in
> `auto-mode-alist'.

The minimal example works fine:

emacs-24.4 -Q -l foo.el foo.txt

where foo.el has contents:

  (define-minor-mode foobar-mode "blah" :initial-value nil
    (font-lock-add-keywords nil '(("foobar" . 'font-lock-warning-face))))

  (add-hook 'text-mode-hook 'foobar-mode)

and foo.txt contains:

  foobar

foobar gets font-lock-warning-face.

So your problem may be specific to your specific modes.




This bug report was last modified 5 years and 210 days ago.

Previous Next


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