unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Michael Albinus <michael.albinus@gmx.de>,
	Heime via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: RE: [External] : Re: Choosing invokation of list in an interactive clause
Date: Sat, 6 Apr 2024 21:56:35 +0000	[thread overview]
Message-ID: <SJ0PR10MB5488AB692CBFAB5B6E89C184F3022@SJ0PR10MB5488.namprd10.prod.outlook.com> (raw)
In-Reply-To: <wuMqnNAL9590Bo7vjkGgu7r7mNhk5xKqx5mHyOXUZaFPA7UmF47iTpPBrK1LkoxtjJCTdIKWfxQo9m6hd57TigfQtBiKGlavoC1ZUv5XoAU=@protonmail.com>

> > [interactive] must provide all of
> > the required args. It can also
> > provide any or all of the optional args.
> 
> How would it work with optional arguments, for some of the
> optional arguments.  Would like to see examples some examples
> for illustration.

Whatever optional args _you want to pass_ when
the command is used interactively, you can pass.

Optional args that you don't want to pass, you
need not pass.

Obviously, if you pass the Nth arg (required or
optional) then you need to also pass args 1...
(N-1).  Passing nil for an arg is equivalent to
not passing it.

How the `interactive' spec reads or otherwise
comes up with the values of the optional args
you choose to pass is entirely up to you.

For any arg (required or optional) passed to
the function body by `interactive', you can
prompt for a value or code (calculate or
hard-code) a value.  Up to you.

There are hundreds of examples in the Lisp
source code in your Emacs sources.  Just
grep for "(interactive ".

Try reading the "Emacs Lisp Intro" manual
(or the Elisp manual) Emacs provides you.
Pretty much everything you ask is presented
clearly to you there.

(If you have difficulty reading, maybe you
can get manuals as audio books somewhere.)

People spent years writing the manuals.
Not doing your homework just makes people
(who are, so far, willing to help), redo
that work.  Over time fewer people might
be willing to continue spoon-feeding you.
Time to try biting into some solid food?

      reply	other threads:[~2024-04-06 21:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 14:19 Choosing invokation of list in an interactive clause Heime
2024-04-04 15:27 ` Yuri Khan
2024-04-04 15:30 ` Michael Albinus
2024-04-04 16:02   ` Heime
2024-04-06 14:52     ` Heime
2024-04-06 17:27       ` Michael Albinus
2024-04-06 17:34         ` [External] : " Drew Adams
2024-04-06 21:24           ` Heime
2024-04-06 21:56             ` Drew Adams [this message]

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=SJ0PR10MB5488AB692CBFAB5B6E89C184F3022@SJ0PR10MB5488.namprd10.prod.outlook.com \
    --to=drew.adams@oracle.com \
    --cc=heimeborgia@protonmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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).