TransWikia.com

Force Emacs to start in text mode

Emacs Asked by DdC on November 15, 2021

[Have been using Emacs for at least 40 years, but still …]
What to put in .emacs so that Emacs opens in text mode?

I have tried:

(setq initial-major-mode #'text-mode)
(setq default-major-mode #'text-mode)
(setq-default major-mode #'text-mode)
(setq major-mode #'text-mode)

I use:
GNU Emacs 22.2.1
GNU Emacs 25.1.1

They open always with Lisp Interaction mode.
No need to tell me that I can use: M-x text-mode.
And opening a file with a .txt extension.
So?

One Answer

Put this at the end of your configuration file:

(setq initial-major-mode 'text-mode)

I see that you have tried putting it in your .emacs but it could be the case that it is somewhat dependent on where you put it. I tried putting this at either end of my .emacs and both worked. The *scratch* buffer is in text-mode. If you continue to have problems, try using the customisation system to change the value of initial-major-mode. Easy way to get there is C-h v initial-major-mode then take the option to customise this variable.

Answered by Aidan Schofield on November 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP