unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Alist remaining empty
@ 2024-09-27 22:50 Heime
  2024-09-28  5:26 ` tomas
  2024-09-28 15:16 ` Stefan Monnier via Users list for the GNU Emacs text editor
  0 siblings, 2 replies; 6+ messages in thread
From: Heime @ 2024-09-27 22:50 UTC (permalink / raw)
  To: Heime via Users list for the GNU Emacs text editor

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





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

end of thread, other threads:[~2024-09-28 15:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 22:50 Alist remaining empty Heime
2024-09-28  5:26 ` 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

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