From: Drew Adams <drew.adams@oracle.com>
To: Emanuel Berg <incal@dataswamp.org>,
"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: (interactive) and &optional
Date: Mon, 27 Mar 2023 01:52:15 +0000 [thread overview]
Message-ID: <SJ0PR10MB54886ED48052CE9A221FD5B7F38B9@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <87tty9x3hp.fsf@dataswamp.org>
> `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'.
next prev parent reply other threads:[~2023-03-27 1:52 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-23 19:10 (interactive) and &optional Dr Rainer Woitok
2023-03-23 19:20 ` Philip Kaludercic
2023-03-25 12:35 ` Dr Rainer Woitok
2023-03-25 13:12 ` Philip Kaludercic
2023-03-25 14:33 ` [External] : " Drew Adams
2023-03-25 15:36 ` Dr Rainer Woitok
2023-03-25 16:58 ` Philip Kaludercic
2023-03-23 20:01 ` Emanuel Berg
2023-03-24 9:23 ` Jean Louis
2023-03-24 20:52 ` Philip Kaludercic
2023-03-24 21:07 ` Emanuel Berg
2023-03-27 1:52 ` Drew Adams [this message]
2023-03-27 2:40 ` [External] : " John Yates
2023-03-24 21:42 ` Jean Louis
2023-03-26 1:04 ` Emanuel Berg
2023-03-30 19:04 ` Jean Louis
2023-03-25 12:05 ` Dr Rainer Woitok
2023-03-25 14:32 ` Jean Louis
2023-03-25 15:41 ` Dr Rainer Woitok
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR10MB54886ED48052CE9A221FD5B7F38B9@SJ0PR10MB5488.namprd10.prod.outlook.com \
--to=drew.adams@oracle.com \
--cc=help-gnu-emacs@gnu.org \
--cc=incal@dataswamp.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).