help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using initial input to completing-read


From: goncholden
Subject: Using initial input to completing-read
Date: Mon, 13 Jun 2022 15:19:16 +0000

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]