# HG changeset patch # User Richard M. Stallman # Date 872874446 0 # Node ID 7fccc0f34e57db4ad206ffb0189dc9c2a8d10ee1 # Parent b033d0b34c715d34088a0ca1e35904ddf1f35f91 (text-mode-hook-identify): New function, put on text-mode-hook. Set text-mode-variant here. (text-mode): Don't set it here. diff -r b033d0b34c71 -r 7fccc0f34e57 lisp/textmodes/text-mode.el --- 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,