[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Disabling automatic reindentation of the current line after a newline
From: |
Jean Abou Samra |
Subject: |
Disabling automatic reindentation of the current line after a newline |
Date: |
Mon, 24 Oct 2022 11:16:29 +0200 |
Hi,
Suppose I am in Lisp mode and I write this:
(defun f (x)
(g x))
Note the extra spaces compared to standard indentation. If, after
writing the last parenthesis, I press RET, Emacs automatically
reindents the second line, changing the code to this:
(defun f (x)
(g x))
The same happens with other major modes.
I am aware that I can turn this off with M-x electric-indent-mode.
However, that also disables any automatic indentation for the next
line when I press RET. What I'd like is for Emacs to auto-insert
the number of spaces it deems necessary for the new, still blank
line whenever I press RET, without also reindenting the previous
line, where I might have changed the indentation if Emacs made
a mistake (e.g., if the major mode I am using is not 100% accurate,
or if I have a slightly different style for which no option exists
in that mode).
Is this possible?
Thanks,
Jean
- Disabling automatic reindentation of the current line after a newline, Jean Abou Samra, 2022/10/23
- Disabling automatic reindentation of the current line after a newline,
Jean Abou Samra <=
- Re: Disabling automatic reindentation of the current line after a newline, Stefan Monnier, 2022/10/24
- Re: Disabling automatic reindentation of the current line after a newline, Anders Munch, 2022/10/25
- Re: Disabling automatic reindentation of the current line after a newline, Stefan Monnier, 2022/10/25
- Re: Disabling automatic reindentation of the current line after a newline, Anders Munch, 2022/10/25
- Re: Disabling automatic reindentation of the current line after a newline, Stefan Monnier, 2022/10/25
- Re: Disabling automatic reindentation of the current line after a newline, Emanuel Berg, 2022/10/26
- Re: Disabling automatic reindentation of the current line after a newline, Jean Abou Samra, 2022/10/26
- Re: Disabling automatic reindentation of the current line after a newline, Eli Zaretskii, 2022/10/27
- Re: Disabling automatic reindentation of the current line after a newline, Stefan Monnier, 2022/10/27