# 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

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

## Related Questions

### Keybindings with Shift key does not work when CAPS is on

1  Asked on September 2, 2021 by tian

### How to find a file recursively on Microsoft Windows with findutils (gnu find) installed?

1  Asked on September 2, 2021 by vasantha-ganesh

### 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

### Displaying some characters with all-icon instead of my current font

1  Asked on September 2, 2021 by lhooq

### Emacs fails to open gnuplot files with extension .gp

1  Asked on September 2, 2021 by paul-c

### Spacemacs kept repositioning the cursor when there’s unmatched parenthesis

1  Asked on September 2, 2021 by searene

### Automatically activating python virtual environments with pyvenv

1  Asked on September 2, 2021 by jacob-pavlock

### In a Python code is it possible to give a color to called functions?

1  Asked on September 2, 2021

### How can I more easily see interactively whether overwrite-mode is enabled?

2  Asked on September 2, 2021 by ruby_object

### How to exit emacs with q when man inside emacs is opened

1  Asked on September 2, 2021

### How to remove day grouping header for today’s date in Agenda View?

1  Asked on September 2, 2021 by fierycod

### Wrong type argument: undo-tree, [cl-struct-undo-tree [nil ([nil ([nil nil ]]]

1  Asked on September 2, 2021

### Magit deprecates magit-popup. Which of my packages depend on it?

1  Asked on September 2, 2021

### How to enable org mode and evil mode for untitled buffer when creating a new frame

1  Asked on September 2, 2021 by will-beethoven

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

1  Asked on September 2, 2021 by prouleau

### Is there a way to spread a list like in Typescript or Golang?

2  Asked on September 2, 2021 by shackra

### emacsclient unable to connect to daemon under snap installation of Emacs

1  Asked on September 2, 2021

### 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