all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Using button-label in pcase
@ 2023-07-24 19:14 uzibalqa
  2023-07-24 20:07 ` Stephen Berman
  0 siblings, 1 reply; 9+ messages in thread
From: uzibalqa @ 2023-07-24 19:14 UTC (permalink / raw)
  To: uzibalqa via Users list for the GNU Emacs text editor

Want to print some text as a result of clicking a button.  With the code below
I end up with

(wrong-type-argument integer-or-marker-p nil)
  buffer-substring-no-properties(nil nil)
  button-label(#<overlay in no buffer>)
  (let* ((val (button-label button))) (if (equal val '"[FA]") (let nil (insert qrh-c))))
  (closure ((button . #<overlay in no buffer>)) nil (let* ((val (button-label button))) (if (equal val '"[FA]") (let nil (insert qrh-c)))))()
  help--window-setup("*Help*" (closure ((button . #<overlay in no buffer>)) nil (let* ((val (button-label button))) (if (equal val '"[FA]") (let nil (insert qrh-c))))))
  qrh-b(#<overlay in no buffer>)
  button-activate(#<overlay in no buffer> t)
  push-button(3 t)

What is going on.  Is there a fix?

(defconst qrh-c "[FA] Some Text")

(defun qrh-b (button)
  "Prints information about how to install emacs."
  (with-help-window (help-buffer)
    (pcase (button-label button)
      ("[FA]" (insert qrh-c))) ))

(defun qrh-a ()
  "Prints information about how to install emacs."
  (interactive)
  (with-help-window (help-buffer)
    (insert-button "[FC]"
      'action 'qrh-b 'follow-link t) ))




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

end of thread, other threads:[~2023-07-24 23:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-24 19:14 Using button-label in pcase uzibalqa
2023-07-24 20:07 ` Stephen Berman
2023-07-24 21:35   ` uzibalqa
2023-07-24 21:51     ` Stephen Berman
2023-07-24 22:24       ` uzibalqa
2023-07-24 22:36         ` Stephen Berman
2023-07-24 22:40           ` uzibalqa
2023-07-24 22:53             ` Stephen Berman
2023-07-24 23:40               ` uzibalqa

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.