From: Heime <heimeborgia@protonmail.com>
To: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Handling optional argument with t value
Date: Sun, 04 Dec 2022 23:01:21 +0000 [thread overview]
Message-ID: <ZLirSnqURtzcLUuxl7E7uPdgU5w9vHpDiJdNzqp9CtOwzFdWUyfLqQsybeWNBWQzVAnBD4trjznM3emUmGU_X_nZ37lPWuLPTh_S9GnT0SI=@protonmail.com> (raw)
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"))))))
next reply other threads:[~2022-12-04 23:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-04 23:01 Heime [this message]
2022-12-05 19:16 ` Handling optional argument with t value Jean Louis
2022-12-05 20:09 ` Heime
2022-12-05 23:03 ` Emanuel Berg
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='ZLirSnqURtzcLUuxl7E7uPdgU5w9vHpDiJdNzqp9CtOwzFdWUyfLqQsybeWNBWQzVAnBD4trjznM3emUmGU_X_nZ37lPWuLPTh_S9GnT0SI=@protonmail.com' \
--to=heimeborgia@protonmail.com \
--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).