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

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

RE: [External] : Re: Functions with multiple optional arguments


From: Drew Adams
Subject: RE: [External] : Re: Functions with multiple optional arguments
Date: Mon, 17 Oct 2022 16:52:08 +0000

> 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))) ))

(defun mesgb (message &optional buffer actm)
  "Show MESSAGE, unless ACTM is the symbol `nogo'."
  (setq buffer  (or buffer  "*Gundit*")
        actm    (or actm  'go))
  (unless (eq 'actm 'nogo)
    (with-current-buffer (get-buffer-create buffer))
      (org-mode)
      (insert message)))) 

reply via email to

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