[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 79d9f3982f: Add derived-mode test for bug#24176
From: |
Lars Ingebrigtsen |
Subject: |
Re: master 79d9f3982f: Add derived-mode test for bug#24176 |
Date: |
Tue, 25 Jan 2022 13:16:36 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> (defvar mode-a-flk '(("a" 0 'font-lock-keyword-face)))
>>> (define-derived-mode mode-a fundamental-mode "mode-a"
>>> (setq-local font-lock-defaults '(mode-a-flk)))
>>> (define-derived-mode mode-b mode-a "mode-b"
>>> (font-lock-add-keywords nil `(("b" 0 'font-lock-builtin-face))))
>>> (defvar mode-c-flk '(("c" 0 'font-lock-keyword-face)))
>>> (define-derived-mode mode-c mode-b "mode-c"
>>> (setq-local font-lock-defaults '(mode-c-flk)))
>>
>> And font-lock-keywords should then be...
>> (t (("c" 0 'font-lock-keyword-face)))?
>
> I think so, yes, or maybe b+c, but it definitely should not be a+b.
Hm... do you see any obvious way to fix this? We could document that
you have to set font-lock-set-defaults to nil if you're setting
font-lock-defaults in a derived mode, but that's not very
satisfactory... or we could store the value of font-lock-defaults and
check whether it's changed (in font-lock-set-defaults)? Hm...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no