unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Changing buffer mode
@ 2022-07-20  3:55 carlmarcos--- via Users list for the GNU Emacs text editor
  2022-07-20 15:50 ` Emanuel Berg
  0 siblings, 1 reply; 15+ messages in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-07-20  3:55 UTC (permalink / raw)
  To: Help Gnu Emacs

With the following function I can change the mode of a buffer.  I would like to change it to use `completing-read` using a list composed of a selection of mode names.  How can I go about doing that? 

(defun mode-sweep ()
  "Cycle the buffer through three major modes (text, org, normal)."
  (interactive)

  (let* ( (modes (list #'org-mode #'text-mode #'normal-mode))
          (new-mode
              (or (cadr (member major-mode modes)) (car modes))) )
    (apply (list new-mode)) ))




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

end of thread, other threads:[~2022-07-22 18:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-20  3:55 Changing buffer mode carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-20 15:50 ` Emanuel Berg
2022-07-21 14:39   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-21 14:50     ` Emanuel Berg
2022-07-21 15:55       ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-21 18:41         ` Eduardo Ochs
2022-07-21 19:02           ` tomas
2022-07-22  0:21         ` Emanuel Berg
2022-07-22  3:22           ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-22  4:00           ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-22  4:13             ` Emanuel Berg
2022-07-22 18:11               ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-22 18:21                 ` Emanuel Berg
2022-07-22 18:36                   ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-07-21 16:52   ` Jean Louis

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