[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 29.0.60; keymap-local-set and keymap-global-set became less strict

From: Stefan Monnier
Subject: Re: 29.0.60; keymap-local-set and keymap-global-set became less strict
Date: Wed, 01 Feb 2023 17:42:04 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

>>> I think call-interactively-p would be better for this use case, but
>>> that's my opinion versus yours.
>> Have you ever looked at the implementation of `called-interactively-p`?
> I guess there is no doubt that we all agree that the implementation is
> not great.

The problem is that it's not the fault of the implementation.
The idea of having it as a function is fundamentally flawed, which is
why the function can be nothing but a mess.

> But I would not consider it prohibitively bad, such that it
> should never ever be used in new code.  If that is the case why is the
> function not officially deprecated?

`called-interactive-p` is in the same category as `advice-add`.
It's great that we have it, but you should only use it when there's no
other way.

> To be clear, I was aware of the recommendation to avoid
> `called-interactively-p' and iirc I have not used it in any of my
> packages.  It is a kludge to use it, but using "hidden arguments" and
> "advertised calling convention" seems as much a kludge in my eyes.

Maybe they're kludges, but at least they have a well defined meaning.
`called-interactively-p` is in a completely different category of kludges.

> The problem with the hidden INTERACTIVE (or ALLOW-VECTOR) argument is
> that it is still somewhat exposed to non-interactive callers. For

Emacs is not in the business of imposing The Right Way, instead we
prefer to encourage it while still allowing people to shoot themselves
in the foot in all kinds of fun ways.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]