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

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.