GNU bug report logs -
#57441
indent-according-to-mode indents incorrectly if previous line is blank
Previous Next
To reply to this bug, email your comments to 57441 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#57441
; Package
emacs
.
(Fri, 26 Aug 2022 23:26:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Lojze Gačnik <lojze.gacnik <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 26 Aug 2022 23:26:01 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
The documentation of indent-according-to-mode claims that, if
indent-line-function is set to indent-relative-first-indent-point, it
will indent the line the same as the previous non-blank line.
But this is not the case - it only works if the immediately preceding
line is non-blank. If line 1 is indented 4 spaces, and line 2 is
blank, then indent-according-to-mode on line 3 will indent 0 spaces,
instead of the expected 4.
Calling indent-according-to-line on line 2, or calling
indent-relative-first-indent-point directly on line 2 or 3, behaves
correctly.
I reproduced this issue on emacs 29.0.50, using the following init.el file:
(electric-indent-mode -1)
(defun my/plain-indent ()
(setq indent-line-function 'indent-relative-first-indent-point))
; Have to set it in a hook, otherwise it gets overrriden.
(add-hook 'prog-mode-hook 'my/plain-indent)
(add-hook 'text-mode-hook 'my/plain-indent)
Severity set to 'minor' from 'normal'
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Thu, 13 Oct 2022 13:48:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 2 years and 306 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.