GNU bug report logs - #63345
28.2; provided-mode-derived-p doesn't work when passed an alias in MODES

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Damien Cassou <damien <at> cassou.me>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 63345 <at> debbugs.gnu.org
Subject: bug#63345: 28.2; provided-mode-derived-p doesn't work when passed an alias in MODES
Date: Sun, 07 May 2023 17:45:55 -0400
Damien Cassou [2023-05-07 16:35:38] wrote:
> 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 see, thanks.

> I was expecting a non-nil value. My PR replaced 'javascript-mode with
> 'js-mode in 'jinx-camel-modes thus working around the problem.

`js-mode` is the right value to use there, indeed.


        Stefan





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.