changeset 19620:7fccc0f34e57

(text-mode-hook-identify): New function, put on text-mode-hook. Set text-mode-variant here. (text-mode): Don't set it here.
author Richard M. Stallman <rms@gnu.org>
date Fri, 29 Aug 1997 17:07:26 +0000
parents b033d0b34c71
children 74151390752c
files lisp/textmodes/text-mode.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/text-mode.el	Fri Aug 29 07:21:44 1997 +0000
+++ b/lisp/textmodes/text-mode.el	Fri Aug 29 17:07:26 1997 +0000
@@ -78,8 +78,6 @@
   (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 @@
       
 (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,