6

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?

  • 3
    Note 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 8 '18 at 23:21
11

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 in startup.el. Its value is lisp-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)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.