Subject: Re: bug#67034: 30.0.50; Make `derived-mode-p` take a single arg

From: Stefan Monnier <[email-masked]>
Date: Thu, 16 Nov 2023 17:38:00 -0500

> This change would affect many packages. I grepped through my elpa
> directory and found multiple uses of derived-mode-p and
> provided-mode-derived-p with multiple arguments as shortcuts:
>
> (derived-mode-p 'mode1 'mode2) instead of (or (derived-mode-p 'mode1)
> (derived-mode-p 'mode2)

With the new convention the code would be

    (derived-mode-p '(mode1 mode2))

which seems just as good.

> There are also multiple call sites with apply, but these would be
> arguably nicer if derived-mode-p takes a list argument as proposed.

Exactly.

> Still, do the benefits of this change outweigh the required changes?

I think they do, especially since we preserve backward compatibility, so
the change can be done progressively.

> I wonder if this extra allocation of &rest makes any difference in any
> benchmark, though.

I hope not, tho I've seen several situations where the cost of
apply+&rest dominates execution time (mostly because of the time
spent in the GC collecting the allocated cons cells), so it's within the
realm of possible.

Note that the recent introduction of `derived-mode-all-parents` should
already have made `derived-mode-p` faster (tho it wasn't the purpose).

        Stefan