GNU bug report logs - #24176
Confusing interaction between define-derived-mode and font-lock-add-keywords

Previous Next

Package: emacs;

Reported by: Clément Pit--Claudel <clement.pitclaudel <at> live.com>

Date: Sun, 7 Aug 2016 06:42:01 UTC

Severity: minor

Tags: confirmed

Found in version 25.1

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Clément Pit--Claudel <clement.pitclaudel <at> live.com>
To: 24176 <at> debbugs.gnu.org
Subject: bug#24176: Acknowledgement (Confusing interaction between define-derived-mode and font-lock-add-keywords)
Date: Sun, 7 Aug 2016 02:57:19 -0400
[Message part 1 (text/plain, inline)]
Sorry, the original report had a confusing example; here is a fixed copy.

(define-derived-mode ~/a fundamental-mode "~/a"
  (font-lock-add-keywords nil `(("a" 0 'font-lock-keyword-face))))
(define-derived-mode ~/b ~/a "~/b"
  (font-lock-add-keywords nil `(("b" 0 'font-lock-builtin-face))))
(define-derived-mode ~/c ~/b "~/c"
  (font-lock-add-keywords nil `(("c" 0 'font-lock-constant-face))))

Explicitly calling (setq font-lock-major-mode major-mode) before calling font-lock-add-keywords yields the expected behaviour.

Clément.

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 3 years and 121 days ago.

Previous Next


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