unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: uzibalqa <uzibalqa@proton.me>
To: uzibalqa via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Using button-label in pcase
Date: Mon, 24 Jul 2023 19:14:27 +0000	[thread overview]
Message-ID: <HpLE9qFeEkx9mnVyoJ60t6o5jYhs8A37d0mnqg-UkeryefTBuCZSxhE2Vm8ATdPAw9zAANGl7GBY1SN6F32ILzGscuHELwWiF6FDmn53EyY=@proton.me> (raw)

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




             reply	other threads:[~2023-07-24 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-24 19:14 uzibalqa [this message]
2023-07-24 20:07 ` Using button-label in pcase 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

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='HpLE9qFeEkx9mnVyoJ60t6o5jYhs8A37d0mnqg-UkeryefTBuCZSxhE2Vm8ATdPAw9zAANGl7GBY1SN6F32ILzGscuHELwWiF6FDmn53EyY=@proton.me' \
    --to=uzibalqa@proton.me \
    --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).