all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / 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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.