From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Damien Cassou <damien@cassou.me>
Cc: Eli Zaretskii <eliz@gnu.org>, 63345@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 [thread overview]
Message-ID: <jwv8rdzq0ja.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87y1m0ryyt.fsf@cassou.me> (Damien Cassou's message of "Sun, 07 May 2023 16:35:38 +0200")
Damien Cassou [2023-05-07 16:35:38] wrote:
> Stefan Monnier <monnier@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
next prev parent reply other threads:[~2023-05-07 21:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-07 9:49 bug#63345: 28.2; provided-mode-derived-p doesn't work when passed an alias in MODES Damien Cassou
2023-05-07 10:52 ` Eli Zaretskii
2023-05-07 14:23 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-05-07 14:35 ` Damien Cassou
2023-05-07 21:45 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-05-08 4:56 ` Damien Cassou
2023-05-08 11:31 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jwv8rdzq0ja.fsf-monnier+emacs@gnu.org \
--to=bug-gnu-emacs@gnu.org \
--cc=63345@debbugs.gnu.org \
--cc=damien@cassou.me \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).