GNU bug report logs -
#63345
28.2; provided-mode-derived-p doesn't work when passed an alias in MODES
Previous Next
Reported by: Damien Cassou <damien <at> cassou.me>
Date: Sun, 7 May 2023 09:50:02 UTC
Severity: normal
Found in version 28.2
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 63345 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> What was the original scenario where you bumped into this problem?
The jinx package defines 'jinx-camel-modes [1], a list of major modes
for languages using camel case or pascal case. This variable is passed
to 'derived-mode-p. Before my PR #64 [2], this variable used to contain
'javascript-mode (the alias) instead of 'js-mode (the function). For a
file using 'js-mode, the equivalent of the code below was executed:
(derived-mode-p 'js-mode 'javascript-mode)
⇒ nil
I was expecting a non-nil value. My PR replaced 'javascript-mode with
'js-mode in 'jinx-camel-modes thus working around the problem.
[1] https://github.com/minad/jinx/blob/0.8/jinx.el#L96
[2] https://github.com/minad/jinx/pull/64
--
Damien Cassou
"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
This bug report was last modified 2 years and 72 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.