>From fa3f26d44c746fdf52520d18bded7e8b7987852a Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Tue, 26 Feb 2019 16:13:23 +0000 Subject: [PATCH 2/3] Do not set indent-line-function in text-mode * 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 | 11 +++++++++++ lisp/textmodes/text-mode.el | 3 +-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index 7b64a56b19..4315b70ed7 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi @@ -1292,15 +1292,10 @@ Example Major Modes @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 address@hidden -(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 afee1e1dca..69af0447b2 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -1233,6 +1233,17 @@ near the current column in Tabulated Lists (see variables 'tabulated-list-tty-sort-indicator-asc', and 'tabulated-list-tty-sort-indicator-desc'). +** Text mode + ++++ +*** '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). + * New Modes and Packages in Emacs 27.1 diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el index 90bb3eb3b5..6114490208 100644 --- a/lisp/textmodes/text-mode.el +++ b/lisp/textmodes/text-mode.el @@ -105,8 +105,7 @@ text-mode \\{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.20.1