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

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

RE: [External] : Re: (interactive) and &optional


From: Drew Adams
Subject: RE: [External] : Re: (interactive) and &optional
Date: Mon, 27 Mar 2023 01:52:15 +0000

> `interactive' is the right place for everything interactive,
> so unless there is a specific reason why it is impractical to
> put it there, that's where one should put the
> interactive stuff.

At the risk of being pedantic...

`interactive' is the right place for code that
should _only_ affect interactive use, and that
should/can do so _only_ at the outset of the
function.

1. Putting that first "only" differently: if you
want some code to be run _both_ interactively
and non-interactively, then don't put it in the
`interactive' form.  (This one is obvious, but
it does conflict with the prescription to put
"everything" interactive in `interactive'.)

2. Putting that second "only" differently: if
something interactive needs to be done _after_
some code is run that isn't only for #1 (i.e.
isn't interactive-only at the outset), then
don't put it in `interactive'.  Instead do it
in the body conditionally, e.g., using a test
such as `called-interactively-p'.



reply via email to

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