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: Confusing interaction between define-derived-mode and font-lock-add-keywords
Date: Sun, 7 Aug 2016 02:41:30 -0400
[Message part 1 (text/plain, inline)]
Hi bug-gnu-emacs,

Given the following mode definitions, I was expecting ~/a to have one keyword, ~/b to have two, and ~/c to have three:

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

This assumption is wrong, as can be easily verified by opening a new buffer, inserting "abc", and switching between ~/a, ~/b, ~/c.

What's going on? Is this a font-lock bug, a doc bug, or a user-got-confused issue?

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.