aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes/ooutline.el
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>1993-12-23 04:47:13 +0000
committerRichard M. Stallman <[email protected]>1993-12-23 04:47:13 +0000
commit85111db572aa43349446931242f239ee6f6e1126 (patch)
treefd50d736c33ba6046f212eb4f5a335ab65ac9a5c /lisp/textmodes/ooutline.el
parent7620dcc5bbcebe2bee80b9cab70777266c09d831 (diff)
(outline-minor-mode): When turning off the mode, turn ^Ms back to \n's.
(outline-mode): Set change-major-mode-hook.
Diffstat (limited to 'lisp/textmodes/ooutline.el')
-rw-r--r--lisp/textmodes/ooutline.el4
1 files changed, 4 insertions, 0 deletions
diff --git a/lisp/textmodes/ooutline.el b/lisp/textmodes/ooutline.el
index 2111c76ccd..4f891e125e 100644
--- a/lisp/textmodes/ooutline.el
+++ b/lisp/textmodes/ooutline.el
@@ -162,6 +162,7 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
(make-local-variable 'paragraph-separate)
(setq paragraph-separate (concat paragraph-separate "\\|^\\("
outline-regexp "\\)"))
+ (add-hooks 'change-major-mode-hook 'show-all)
(run-hooks 'text-mode-hook 'outline-mode-hook))
(defvar outline-minor-mode-prefix "\C-c"
@@ -195,6 +196,9 @@ See the command `outline-mode' for more information on this mode."
(setq selective-display t)
(run-hooks 'outline-minor-mode-hook))
(setq selective-display nil))
+ ;; When turning off outline mode, get rid of any ^M's.
+ (or outline-minor-mode
+ (outline-flag-region (point-min) (point-max) ?\n))
(set-buffer-modified-p (buffer-modified-p)))
(defvar outline-level 'outline-level