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

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

Making new named buffer with associated major-mode


From: carlmarcos
Subject: Making new named buffer with associated major-mode
Date: Mon, 27 Jun 2022 11:28:11 +0200 (CEST)

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



reply via email to

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