InsideDarkWeb.com

Force Emacs to start in text mode

[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?

Emacs Asked by DdC on November 15, 2021

1 Answers

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!

Related Questions

How to call `org-sparse-tree` from Lisp?

1  Asked on September 2, 2021 by user2567544

 

Flycheck – Eslint: ‘config file: missing or incorrect’

1  Asked on September 2, 2021 by ben-krck

 

Emacs fails to open gnuplot files with extension .gp

1  Asked on September 2, 2021 by paul-c

 

Automatically activating python virtual environments with pyvenv

1  Asked on September 2, 2021 by jacob-pavlock

   

How to check if a customize group exists in Emacs Lisp code?

1  Asked on September 2, 2021 by prouleau

 

encrypted password file with emacs & gpg

1  Asked on September 2, 2021 by user313032

 

How to pass an optional agrument to kill-emacs?

1  Asked on September 2, 2021 by ianinini

 

Ask a Question

Get help from others!

© 2021 InsideDarkWeb.com. All rights reserved.