unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Making new named buffer with associated major-mode
@ 2022-06-27  9:28 carlmarcos--- via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; only message in thread
From: carlmarcos--- via Users list for the GNU Emacs text editor @ 2022-06-27  9:28 UTC (permalink / raw)
  To: Help Gnu Emacs


I want to make a new named buffer and associating with a major mode.  Would like the user to be able to supply the name or let emacs choose a unique filename, and assign the major mode for it.  

Have started with the following

(defun workspace (name mode)
  "Make a new buffer with unique name."
  (interactive
   (list
    (intern (completing-read "Bufrmode: "
      '("org-mode" "emacs-lisp-mode" "f90-mode"
        "c-mode" "sh-mode" "emacs-lisp-mode") nil t "org-mode"))))

  (let ( ($buf (generate-new-buffer "arktika")) )
    (switch-to-buffer $buf)
    (funcall (and mode))))



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

only message in thread, other threads:[~2022-06-27  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-27  9:28 Making new named buffer with associated major-mode 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).