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

From: Stefan Monnier <[email-masked]>
Date: Sun, 07 May 2023 17:45:55 -0400

Damien Cassou [2023-05-07 16:35:38] wrote:
> Stefan Monnier <[email-masked]> 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