Re-open *scratch* buffer in Emacs?

后端 未结 16 1321
北海茫月
北海茫月 2020-12-12 10:29

If I accidentally closed the scratch buffer in Emacs, how do I create a new scratch buffer?

16条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-12 11:06

    This is what I use - I have this bound to a convenient keystroke. It sends you to the *scratch* buffer, regardless of whether or not it already exists, and sets it to be in lisp-interaction-mode

    (defun eme-goto-scratch () 
      "this sends you to the scratch buffer"
      (interactive)
      (let ((eme-scratch-buffer (get-buffer-create "*scratch*")))
        (switch-to-buffer eme-scratch-buffer)
        (lisp-interaction-mode)))
    

提交回复
热议问题