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

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

RE: [External] : Re: Choosing invokation of list in an interactive claus


From: Drew Adams
Subject: RE: [External] : Re: Choosing invokation of list in an interactive clause
Date: Sat, 6 Apr 2024 21:56:35 +0000

> > [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 via email to

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