Do not set indent-line-function in text-mode

For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-03/msg01012.html
* lisp/textmodes/text-mode.el (text-mode): Do not reset
indent-line-function to its global default value of indent-relative.
* doc/lispref/modes.texi (Example Major Modes):
* etc/NEWS: Document change accordingly.
parent 4c9950d0
......@@ -1292,15 +1292,10 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
@end group
@group
(setq-local text-mode-variant t)
(setq-local require-final-newline mode-require-final-newline)
(setq-local indent-line-function #'indent-relative))
(setq-local require-final-newline mode-require-final-newline))
@end group
@end smallexample
@noindent
(The last line is redundant nowadays, since @code{indent-relative} is
the default value, and we'll delete it in a future version.)
@cindex @file{lisp-mode.el}
The three Lisp modes (Lisp mode, Emacs Lisp mode, and Lisp Interaction
mode) have more features than Text mode and the code is correspondingly
......
......@@ -1371,6 +1371,15 @@ ending character were silently omitted.
For example, '(rx (any "@z-a" (?9 . ?0)))' would match '@' only.
Now, such rx expressions generate an error.
+++
** 'text-mode' no longer sets the value of 'indent-line-function'.
The global value of 'indent-line-function', which defaults to
'indent-relative', will no longer be reset locally when turning on
'text-mode'.
To get back the old behavior, add a function to 'text-mode-hook' which
performs (setq-local indent-line-function #'indent-relative).
* Lisp Changes in Emacs 27.1
......
......@@ -105,8 +105,7 @@ You can thus get the full benefit of adaptive filling
\\{text-mode-map}
Turning on Text mode runs the normal hook `text-mode-hook'."
(setq-local text-mode-variant t)
(setq-local require-final-newline mode-require-final-newline)
(setq-local indent-line-function #'indent-relative))
(setq-local require-final-newline mode-require-final-newline))
(define-derived-mode paragraph-indent-text-mode text-mode "Parindent"
"Major mode for editing text, with leading spaces starting a paragraph.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment