[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Delete variables obsolete since Emacs 23
From: |
Stefan Kangas |
Subject: |
Re: Delete variables obsolete since Emacs 23 |
Date: |
Wed, 26 Aug 2020 20:51:50 -0700 |
Richard Stallman <rms@gnu.org> writes:
> > My commit bc5da2c3fb does basically the following:
>
> > - (help-setup-xref (list 'describe-symbols pattern) (interactive-p))
> > + (help-setup-xref (list 'describe-symbols pattern)
> > + (called-interactively-p 'interactive))
>
> That is not the recommend way to fix these calls.
> called-interactively-p does not give the correct results in all
> situations. The right way is to make the optional argument.
This was simply to not use the old deprecated name, which AFAIU is being
considered for removal.
Perhaps we could also expand the section in the Manual that explains why
using an optional argument is better, and make the wording stronger.
Here's what I read in `(info "(elisp) Distinguish Interactive")':
The above method with the additional argument is usually best,
because it allows callers to say “treat this call as interactive”. But
you can also do the job by testing ‘called-interactively-p’.
- Re: Delete variables obsolete since Emacs 23, (continued)
- Re: Delete variables obsolete since Emacs 23, Lars Ingebrigtsen, 2020/08/18
- Re: Delete variables obsolete since Emacs 23, Stefan Kangas, 2020/08/23
- Re: Delete variables obsolete since Emacs 23, Richard Stallman, 2020/08/24
- RE: Delete variables obsolete since Emacs 23, Drew Adams, 2020/08/25
- Re: Delete variables obsolete since Emacs 23, Richard Stallman, 2020/08/25
- Re: Delete variables obsolete since Emacs 23, Gregory Heytings, 2020/08/26
- Re: Delete variables obsolete since Emacs 23, Stefan Kangas, 2020/08/26
- Re: Delete variables obsolete since Emacs 23, Richard Stallman, 2020/08/26
- Re: Delete variables obsolete since Emacs 23,
Stefan Kangas <=
- RE: Delete variables obsolete since Emacs 23, Drew Adams, 2020/08/26
- Re: Delete variables obsolete since Emacs 23, Stefan Monnier, 2020/08/26