From: Heime <heimeborgia@protonmail.com>
To: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Alist remaining empty
Date: Fri, 27 Sep 2024 22:50:21 +0000 [thread overview]
Message-ID: <E3MPkc69Uwger2jsCJJVFTowlV220mKY3r91hU64J4PvgrLT__z0Vj8e_2YaQZGlQ0puyX75PzplwCpW2SBqibhjZfEzt5iTKYwi9FiDEi4=@protonmail.com> (raw)
I have alist variable warn-alist, which I set to nil. I am supposed
to push some alist examples if the values have not been added yet.
But I find that with the following function, the warn-alist remains empty.
(defun warn-test ()
(interactive)
(setq warn-alist nil)
(let ( (qwpanel warn-alist)
;; Init flag to track if values have been added
(already-added nil) )
;; If the alist is empty, add the cons data
(unless qwpanel
(setq already-added t))
(unless already-added
(push (cons 'ques-string "Warning Message") qwpanel)
(push (cons 'ques-number 42) qwpanel)
(push (cons 'ques-symbol 'example-symbol) qwpanel)
(push (cons 'ques-list '(1 2 3)) qwpanel)
(push (cons 'ques-boolean t) qwpanel)
(push (cons 'ques-nil nil) qwpanel)
(push (cons 'ques-cons (cons 'nested "cell")) qwpanel)
(push (cons 'ques-function #'print) qwpanel)) ))
next reply other threads:[~2024-09-27 22:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-27 22:50 Heime [this message]
2024-09-28 5:26 ` Alist remaining empty tomas
2024-09-28 9:11 ` Heime
2024-09-28 9:14 ` tomas
2024-09-28 15:22 ` Heime
2024-09-28 15:16 ` Stefan Monnier via Users list for the GNU Emacs text editor
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='E3MPkc69Uwger2jsCJJVFTowlV220mKY3r91hU64J4PvgrLT__z0Vj8e_2YaQZGlQ0puyX75PzplwCpW2SBqibhjZfEzt5iTKYwi9FiDEi4=@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).