Subject: Re: bug#24176: Acknowledgement (Confusing interaction between define-derived-mode and font-lock-add-keywords)

From: Clément Pit--Claudel <[email-masked]>
Date: Sun, 7 Aug 2016 02:57:19 -0400

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.