Re-open *scratch* buffer in Emacs?

后端 未结 16 1359
北海茫月
北海茫月 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:16

    I used to use dwj's solution, and I was quite happy about it, until the day I realized that it failed when you actually rename the scratch buffer (for example by saving it).

    Then I adopted this, which works well for me :

      (run-with-idle-timer 1 t
        '(lambda () (get-buffer-create "*scratch*")))
    

提交回复
热议问题