diff options
| author | Richard M. Stallman | 1997-08-29 17:07:26 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-08-29 17:07:26 +0000 |
| commit | d910f08cc1461bc7b6fd91668b4850787eb36795 (patch) | |
| tree | 92ae627139ff36456a7eaf5fa7ef029eca4113c2 | |
| parent | 57a5447071d8844fd5d6c251de0820827266735d (diff) | |
| download | emacs-d910f08cc1461bc7b6fd91668b4850787eb36795.tar.gz emacs-d910f08cc1461bc7b6fd91668b4850787eb36795.zip | |
(text-mode-hook-identify): New function,
put on text-mode-hook. Set text-mode-variant here.
(text-mode): Don't set it here.
| -rw-r--r-- | lisp/textmodes/text-mode.el | 10 |
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'." | |||
| 78 | (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) | 78 | (setq paragraph-start (concat "[ \t]*$\\|" page-delimiter)) |
| 79 | (make-local-variable 'paragraph-separate) | 79 | (make-local-variable 'paragraph-separate) |
| 80 | (setq paragraph-separate paragraph-start) | 80 | (setq paragraph-separate paragraph-start) |
| 81 | (make-local-variable 'text-mode-variant) | ||
| 82 | (setq text-mode-variant t) | ||
| 83 | (setq mode-name "Text") | 81 | (setq mode-name "Text") |
| 84 | (setq major-mode 'text-mode) | 82 | (setq major-mode 'text-mode) |
| 85 | (run-hooks 'text-mode-hook)) | 83 | (run-hooks 'text-mode-hook)) |
| @@ -103,6 +101,14 @@ Turning on Paragraph-Indent Text mode runs the normal hooks | |||
| 103 | 101 | ||
| 104 | (defalias 'indented-text-mode 'text-mode) | 102 | (defalias 'indented-text-mode 'text-mode) |
| 105 | 103 | ||
| 104 | (defun text-mode-hook-identify () | ||
| 105 | "Mark that this mode has run `text-mode-hook'. | ||
| 106 | This is how `toggle-text-mode-auto-fill' knows which buffers to operate on." | ||
| 107 | (make-local-variable 'text-mode-variant) | ||
| 108 | (setq text-mode-variant t)) | ||
| 109 | |||
| 110 | (add-hook 'text-mode-hook 'text-mode-hook-identify) | ||
| 111 | |||
| 106 | (defun toggle-text-mode-auto-fill () | 112 | (defun toggle-text-mode-auto-fill () |
| 107 | "Toggle whether to use Auto Fill in Text mode and related modes. | 113 | "Toggle whether to use Auto Fill in Text mode and related modes. |
| 108 | This command affects all buffers that use modes related to Text mode, | 114 | This command affects all buffers that use modes related to Text mode, |