help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Using called-interactively-p


From: uzibalqa
Subject: Re: Using called-interactively-p
Date: Wed, 05 Jul 2023 15:40:24 +0000

------- Original Message -------
On Thursday, July 6th, 2023 at 3:25 AM, Marcin Borkowski <mbork@mbork.pl> wrote:


> On 2023-07-05, at 15:35, uzibalqa uzibalqa@proton.me wrote:
> 
> > I have the following function that executes the command (do-this) when
> > the function skatpad is called interactively by the user, but executes
> > (do-that) if the function is called from elisp code.
> > 
> > The documentation suggests to use "called-interactively-p" instead of
> > (interactive-p).
> > 
> > Looking at the documentation, it is not quite clear whether KIND should be
> > a symbol or a string. This problem of distinguishing between a symbol and
> > a string, is something that occurs frequently in the documentation. A source
> > of constant deliberation for me.
> 
> 
> I would definitely bet on symbol. Using strings for things like this
> seems highly unusual for me (in Elisp, as opposed to e.g. JavaScript).
> 
> OTOH, you can check if you want to (do-this) or (do-that) using a simple
> trick with an optional parameter -- see
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Distinguish-Interactive.html
> 
> Hth,
> 
> --
> Marcin Borkowski
> http://mbork.pl

The examples are much clearer.  But the documentation with the preference on 
using
single quotes is confounding.   As the documentation is for the most part devoid
of examples, distinctions should be made explicit. 






reply via email to

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