From 2e3deb09bd42d22a9b354937ce63b151fb493d8a Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Sun, 31 Mar 2019 19:39:54 +0100 Subject: [PATCH] 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. --- doc/lispref/modes.texi | 7 +------ etc/NEWS | 9 +++++++++ lisp/textmodes/text-mode.el | 3 +-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 7b64a56b199..4315b70ed72 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -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 diff --git a/etc/NEWS b/etc/NEWS index 7486d6bcfed..89e07a2f4df 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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 diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 90bb3eb3b53..61144902083 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -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. -- 2.39.2