comparison lisp/textmodes/ooutline.el @ 5306:a2f8f9c4e29b

(outline-minor-mode): When turning off the mode, turn ^Ms back to \n's. (outline-mode): Set change-major-mode-hook.
author Richard M. Stallman <rms@gnu.org>
date Thu, 23 Dec 1993 04:47:13 +0000
parents a57b0b715c04
children e54c2697692b
comparison
equal deleted inserted replaced
5305:1a32c9c9cfbb 5306:a2f8f9c4e29b
160 (make-local-variable 'auto-fill-inhibit-regexp) 160 (make-local-variable 'auto-fill-inhibit-regexp)
161 (setq auto-fill-inhibit-regexp outline-regexp) 161 (setq auto-fill-inhibit-regexp outline-regexp)
162 (make-local-variable 'paragraph-separate) 162 (make-local-variable 'paragraph-separate)
163 (setq paragraph-separate (concat paragraph-separate "\\|^\\(" 163 (setq paragraph-separate (concat paragraph-separate "\\|^\\("
164 outline-regexp "\\)")) 164 outline-regexp "\\)"))
165 (add-hooks 'change-major-mode-hook 'show-all)
165 (run-hooks 'text-mode-hook 'outline-mode-hook)) 166 (run-hooks 'text-mode-hook 'outline-mode-hook))
166 167
167 (defvar outline-minor-mode-prefix "\C-c" 168 (defvar outline-minor-mode-prefix "\C-c"
168 "*Prefix key to use for Outline commands in Outline minor mode.") 169 "*Prefix key to use for Outline commands in Outline minor mode.")
169 170
193 (if outline-minor-mode 194 (if outline-minor-mode
194 (progn 195 (progn
195 (setq selective-display t) 196 (setq selective-display t)
196 (run-hooks 'outline-minor-mode-hook)) 197 (run-hooks 'outline-minor-mode-hook))
197 (setq selective-display nil)) 198 (setq selective-display nil))
199 ;; When turning off outline mode, get rid of any ^M's.
200 (or outline-minor-mode
201 (outline-flag-region (point-min) (point-max) ?\n))
198 (set-buffer-modified-p (buffer-modified-p))) 202 (set-buffer-modified-p (buffer-modified-p)))
199 203
200 (defvar outline-level 'outline-level 204 (defvar outline-level 'outline-level
201 "Function of no args to compute a header's nesting level in an outline. 205 "Function of no args to compute a header's nesting level in an outline.
202 It can assume point is at the beginning of a header line.") 206 It can assume point is at the beginning of a header line.")