summaryrefslogtreecommitdiff
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1997-08-29 17:07:26 +0000
committerRichard M. Stallman <rms@gnu.org>1997-08-29 17:07:26 +0000
commitd5b73ebdd76e2ac114e49c405f4a15addc844099 (patch)
tree3bf377108401b16392dd0ed718db1f2519a8bd79 /lisp/textmodes
parent5b3b919f59b04ec05db7ea00c02e7f79d99e92cd (diff)
downloademacs-d5b73ebdd76e2ac114e49c405f4a15addc844099.tar.gz
(text-mode-hook-identify): New function,
put on text-mode-hook. Set text-mode-variant here. (text-mode): Don't set it here.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/text-mode.el10
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/textmodes/text-mode.el b/lisp/textmodes/text-mode.el
index eb06fdaeb5f..2a51f03e4b3 100644
--- a/lisp/textmodes/text-mode.el
+++ b/lisp/textmodes/text-mode.el
@@ -78,8 +78,6 @@ Turning on Text mode runs the normal hook `text-mode-hook'."
(setq paragraph-start (concat "[ \t]*$\\|" page-delimiter))
(make-local-variable 'paragraph-separate)
(setq paragraph-separate paragraph-start)
- (make-local-variable 'text-mode-variant)
- (setq text-mode-variant t)
(setq mode-name "Text")
(setq major-mode 'text-mode)
(run-hooks 'text-mode-hook))
@@ -103,6 +101,14 @@ Turning on Paragraph-Indent Text mode runs the normal hooks
(defalias 'indented-text-mode 'text-mode)
+(defun text-mode-hook-identify ()
+ "Mark that this mode has run `text-mode-hook'.
+This is how `toggle-text-mode-auto-fill' knows which buffers to operate on."
+ (make-local-variable 'text-mode-variant)
+ (setq text-mode-variant t))
+
+(add-hook 'text-mode-hook 'text-mode-hook-identify)
+
(defun toggle-text-mode-auto-fill ()
"Toggle whether to use Auto Fill in Text mode and related modes.
This command affects all buffers that use modes related to Text mode,