unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Using initial input to completing-read
@ 2022-06-13 15:19 goncholden via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; only message in thread
From: goncholden via Users list for the GNU Emacs text editor @ 2022-06-13 15:19 UTC (permalink / raw)
  To: goncholden via Users list for the GNU Emacs text editor

Have written the following function to disable electric-indent-mode.

Would like to use a initial input to `completing-read`, and am asking what I have to insert.

(defun myautoindent ()
"Disable or enable automatic re-indentation."
(interactive)

(let* ( (cseq '("Enable" "Disable"))
(csel (completing-read "Autoindent: " cseq nil t )) )

(pcase csel
("Enable"
(electric-indent-local-mode))
("Disable"
(electric-indent-local-mode 0))) ))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-13 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-13 15:19 Using initial input to completing-read goncholden 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).