From: Heime <heimeborgia@protonmail.com>
To: Heime via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org>
Subject: Calling a function within a pcase
Date: Thu, 17 Aug 2023 04:19:34 +0000 [thread overview]
Message-ID: <9KC3mtuwy2DblX9HMNL90WKUk4P2hsKlELXJFqAq0hLeWnthCRoa8ZGXU_roSH8LXZ9TegZjRi4r7fqCfiSrpYEJ58iV8-hsIX1Y24x3NAI=@protonmail.com> (raw)
Have written the following function to insert either
the command \bigoplus or the symbol ⨁︁.
But calling (imprint seltr "\\bigoplus" "⨁︁")
is not getting executed. Cannot see my mistake right now.
(defun imprint (selector kmstr &optional grapheme)
(message "Selector: %s" selector)
(if (equal selector "Command")
(insert kmstr)
;; Insert GRAPHEME if present, insert KMSTR otherwise.
(insert (if grapheme grapheme kmstr))))
;;-------------
(defun bigops (grafm seltr)
"Binary Operations."
(interactive
(let ( (csel '("Symbol" "Command"))
(cseq '("bigoplus ⨁︁" "bigotimes ⨂︁")) )
(list
(completing-read "Grapheme: " cseq nil t nil)
(completing-read "Selector: " csel nil t nil)) ))
(pcase (car (split-string grafm))
("bigoplus︁" (imprint seltr "\\bigoplus" "⨁︁"))
("bigotimes︁" (imprint seltr "\\bigotimes" "⨂︁")) ))
reply other threads:[~2023-08-17 4:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='9KC3mtuwy2DblX9HMNL90WKUk4P2hsKlELXJFqAq0hLeWnthCRoa8ZGXU_roSH8LXZ9TegZjRi4r7fqCfiSrpYEJ58iV8-hsIX1Y24x3NAI=@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).