]> git.eshelyaron.com Git - emacs.git/commitdiff
(outline-minor-mode): When turning off the mode, turn ^Ms back to \n's.
authorRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 04:47:13 +0000 (04:47 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 23 Dec 1993 04:47:13 +0000 (04:47 +0000)
(outline-mode): Set change-major-mode-hook.

lisp/textmodes/ooutline.el

index 2111c76ccd18a28d0436480c106c92febf1571bc..4f891e125eb3e6251d211279c37aa15be4f551bc 100644 (file)
@@ -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)))
 \f
 (defvar outline-level 'outline-level