unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Handling optional argument with t value
@ 2022-12-04 23:01 Heime
  2022-12-05 19:16 ` Jean Louis
  0 siblings, 1 reply; 4+ messages in thread
From: Heime @ 2022-12-04 23:01 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

I have this function to which I am adding the capability to print a compact version 
that excludes the whitespace.  Thus I include an optional argument "kpact", so that
when it is set to t, the (insert " ") in excluded.  Is this a good strategy.  

Does the use of (unless kpact  (insert " ")) do the job or am I missing some possible
condition that might occur?

(defun ticker-hour (lampkl &optional kpact)
  "TODO."

  (interactive)

  (unless kpact  (insert " "))

  (cond
   ((eq 'magenta lampkl)
       (insert (propertize "⚒"
                 'font-lock-face '(:background "#FF29FF"
                                   :foreground "black"))))
   ((eq 'red lampkl)
       (insert (propertize "⚒"
                 'font-lock-face '(:background "#B30000"
                                   :foreground "black"))))))









^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-05 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-04 23:01 Handling optional argument with t value Heime
2022-12-05 19:16 ` Jean Louis
2022-12-05 20:09   ` Heime
2022-12-05 23:03     ` Emanuel Berg

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