unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Using show-paren-style function in elisp code
@ 2022-06-20  8:00 carlmarcos--- via Users list for the GNU Emacs text editor
  2022-06-20  9:25 ` Rudolf Schlatte
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-06-20  8:00 UTC (permalink / raw)
  To: Help Gnu Emacs

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





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

end of thread, other threads:[~2022-06-21  4:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-20  8:00 Using show-paren-style function in elisp code carlmarcos--- via Users list for the GNU Emacs text editor
2022-06-20  9:25 ` 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

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