What I must write in my .emacs
file so that the *scratch*
buffer is closed when I open Emacs?
Scratch buffer or scratch space is a term quite often used for pre-allocated memory (because startup time usally matters less than runtime performace) to be used for all kinds of stuff.
Just re-create the buffer by switching to it: C-x b *scratch* RET . Since Emacs 21.2, if you create a buffer called *scratch* , it's automatically put in Lisp Interaction mode. Why do you need a special function? For me, if I kill *scratch* and then switch back to it, it's set to lisp-interaction mode automatically.
(kill-buffer "*scratch*")
Not exactly the answer to your question, but you might like to know that you can choose to have a different buffer open on startup, or change the contents of the *scratch* buffer. For example:
;; Make *scratch* buffer blank.
(setq initial-scratch-message nil)
;; Make the buffer that opens on startup your init file ("~/.emacs" or
;; "~/.emacs.d/init.el").
(setq initial-buffer-choice user-init-file)
In the first example, the *scratch* buffer will be empty. In the second example, the *scratch* buffer will still exist, but user-init-file will be focused.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With