From: carlmarcos--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Using show-paren-style function in elisp code
Date: Mon, 20 Jun 2022 10:00:33 +0200 (CEST) [thread overview]
Message-ID: <N5-79NL--3-2@tutanota.com> (raw)
Have written the following function to set `show-paren-style`. Would it be possible to modify
the code in a way that also allows a user to use the style as an argument so that the function
can be used in elisp code.
Is there a standard way for a function to be used in elisp code, or is my plan viable in the way
described?
(defun view-parens ()
"Visualise parentheses and expressions."
(interactive)
(let* ( (cseq '("bracemk" "expression" "mixed"))
(csel (completing-read "Visualise: " cseq nil t "mixed")) )
(pcase csel
("bracemk"
(setq 'show-paren-style 'parenthesis))
("expression"
(setq 'show-paren-style 'expression))
("mixed"
(setq 'show-paren-style 'mixed)) )))
next reply other threads:[~2022-06-20 8:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-20 8:00 carlmarcos--- via Users list for the GNU Emacs text editor [this message]
2022-06-20 9:25 ` Using show-paren-style function in elisp code Rudolf Schlatte
2022-06-20 17:51 ` Bruno Barbier
[not found] ` <N51E0wj--3-2@missing-mail-id>
2022-06-21 4:58 ` carlmarcos--- via Users list for the GNU Emacs text editor
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=N5-79NL--3-2@tutanota.com \
--to=help-gnu-emacs@gnu.org \
--cc=carlmarcos@tutanota.com \
/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).