all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* completing-read to set the mode for a buffer
@ 2022-07-09  0:52 carlmarcos--- via Users list for the GNU Emacs text editor
  2022-07-09  1:51 ` Emanuel Berg
  0 siblings, 1 reply; 4+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-07-09  0:52 UTC (permalink / raw)
  To: Help Gnu Emacs

Am using completing-read to set the mode for a buffer.  What would be the advantage of defining modes in the following way, rather than with a normal list with "emacs-lisp-mode", "org-mode", and "sh-script" ?

I use (funcall (intern mode)) to set the mode for the buffer.

(defvar modes
  '( ("emacs-lisp-mode" . "el")
     ("org-mode" . "org")
     ("sh-script" . "sh")))

(completing-read " Mode: " (map-keys modes) nil t)




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

end of thread, other threads:[~2022-07-10  4:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-09  0:52 completing-read to set the mode for a buffer carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-09  1:51 ` Emanuel Berg
2022-07-09  3:42   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-10  4:20     ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.