From: Heime <heimeborgia@protonmail.com>
To: Heime <heimeborgia@protonmail.com>
Cc: Jean Louis <bugs@gnu.support>,
"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Functions with multiple optional arguments
Date: Mon, 17 Oct 2022 16:24:19 +0000 [thread overview]
Message-ID: <V3IHX81egeeQsUx3WkEwni4ZK2onTVM7hoRGFJNcoTz1lI0WChPBlrkp9qofl8L4vrjbAKXL--el6nJQtNU7i6Mz_MgANpF369BnGdeWs3g=@protonmail.com> (raw)
In-Reply-To: <IayHA-0fjRn1MIJGkP10LMjCMxAKQatSUQynCeO1WGm9cbWod1EoDVAn_qivdKQnv6IuT0yCfoQQfEUqHiuJucXakwGD57HNSgZ51YYS-zU=@protonmail.com>
------- Original Message -------
On Monday, October 17th, 2022 at 5:42 AM, Heime <heimeborgia@protonmail.com> wrote:
> ------- Original Message -------
> On Monday, October 17th, 2022 at 4:05 AM, Jean Louis bugs@gnu.support wrote:
>
>
>
> > * Heime via Users list for the GNU Emacs text editor help-gnu-emacs@gnu.org [2022-10-17 00:06]:
> >
> > > Have been writing a function that has two optional arguments. It is
> > > turning out to be a difficult task in situations when one in missing
> > > an argument. Anybody has experience about this, as I have not seen
> > > much code with multiple optional arguments.
> >
> > If argument is optional but required by your function, I use this method:
> >
> > (defun my-fun (&optional title description)
> > (let ((title (or title "Best Movie"))
> > (description (or description "Description")))
> > (message "%s: %s" title description)))
> >
> > (my-fun)
I want the last argument to use a symbol. Would you be so kind to scrutinise
my implementation please.
(defun mesgb (mesg &optional bufr actm)
"Display message except on 'nogo symbol."
(let ((bfr (or bufr "*Gundit*"))
(acm (or actm 'go)))
(when (not (eq 'nogo acm))
(with-current-buffer (get-buffer-create bfr)
(org-mode)
(insert mesg))) ))
next prev parent reply other threads:[~2022-10-17 16:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-16 21:04 Functions with multiple optional arguments Heime via Users list for the GNU Emacs text editor
2022-10-17 1:48 ` Emanuel Berg
2022-10-17 4:05 ` Jean Louis
2022-10-17 4:18 ` Emanuel Berg
2022-10-17 21:12 ` Jean Louis
2022-10-17 21:36 ` Emanuel Berg
2022-10-20 21:00 ` Jean Louis
2022-10-21 3:29 ` Emanuel Berg
2022-10-23 4:47 ` Jean Louis
2022-10-24 3:07 ` Emanuel Berg
2022-10-25 5:25 ` Emanuel Berg
2022-10-17 5:42 ` Heime
2022-10-17 16:24 ` Heime [this message]
2022-10-17 16:52 ` [External] : " Drew Adams
2022-10-17 17:28 ` Heime
2022-10-17 17:38 ` Drew Adams
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='V3IHX81egeeQsUx3WkEwni4ZK2onTVM7hoRGFJNcoTz1lI0WChPBlrkp9qofl8L4vrjbAKXL--el6nJQtNU7i6Mz_MgANpF369BnGdeWs3g=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--cc=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.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).