For example, we can open a new buffer with C-x b <new-buffer-name>, and by default, this new buffer opens in fundamental-mode, which is not very useful to me. I would like to change this to open all new buffers in org-mode. How can I do this?

2 Answers 2


You have to customize the major-mode variable (see also the emacs manual). C-h v:

Symbol for current buffer's major mode.

The default value (normally `fundamental-mode') affects new buffers. A value of nil means to use the current buffer's major mode, provided it is not marked as "special".

You can do this with M-x customize-variable major-mode or with something like (setq-default major-mode 'org-mode) somewhere in your init file.

See also initial-major-mode for the *scratch* buffer.

  • In my testing(Emacs 28.2), only the "M-x customize-variable major-mode" works, "(setq-default major-mode 'org-mode)" did not works for me. Nov 10, 2022 at 12:17

Add to your init.el one string:

(setq initial-major-mode (quote <major mode name>))

For example, I use markdown-mode as primary mode on my job:

(setq initial-major-mode (quote markdown-mode))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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