1 2 3 4 5 6 7 8 (defun create-scratch-buffer () "creates a scratch buffer of specified type" (interactive) (let (newbuffer mode-type) (setq mode-type (read-from-minibuffer "scratch mode: ")) (setq newbuffer (get-buffer-create (concat mode-type "-scratch"))) (switch-to-buffer newbuffer) (funcall (intern (concat mode-type "-mode")))))
There are probably many ways this function could be improved, but it sure is satisfying when I am able to improve my workflow using a tool that I wrote myself.
I bound this to
C-c C-s b, for Create Scratch Buffer, it may or may not be appropriate for your keymap setup. ↩