When I open Emacs, the *scratch*
buffer is in Lisp Interaction mode, but I don't want that. How can I make the buffer have a text mode instead of Lisp Interaction?
Asked
Active
Viewed 897 times
8

new Q Open Wid
- 185
- 1
- 12
-
3Note that for 99.99% of the users, the major mode of `*scratch*` is completely irrelevant because they never ever use that buffer. So my crystal ball tells me that this is an X/Y question where the answer is to use another buffer (one which will automatically have the mode you need) rather than try and change the mode used in the `*scratch*` buffer. – Stefan Jan 08 '18 at 23:21
2 Answers
15
You can customize the value of initial-major-mode
, which defaults to lisp-interaction-mode
. Here's the variable's docstring:
initial-major-mode
is a variable defined instartup.el
. Its value islisp-interaction-mode
Documentation:
Major mode command symbol to use for the initial
*scratch*
buffer.You can customize this variable.
For the customize interface you can follow the link from C-hv initial-major-mode
RET, or use M-x customize-option
RET initial-major-mode
RET to get there directly.
Alternatively you could put something like this in your init file:
(setq initial-major-mode 'text-mode)

new Q Open Wid
- 185
- 1
- 12

Dan
- 32,584
- 6
- 98
- 168
4
Rather than changing the mode of an Emacs stalwart Scratch, configure initial-buffer-choice.
C-h v initial-buffer-choice

RichieHH
- 848
- 4
- 9