]> code.delx.au - gnu-emacs/blobdiff - lisp/foldout.el
(comint-postoutput-scroll-to-bottom): Cope with unset
[gnu-emacs] / lisp / foldout.el
index f89c9c2877180a79a7f2dab91561cb830e34038d..cf337e7e7e5eb634091443139aaa27f0689d2356 100644 (file)
@@ -5,7 +5,7 @@
 ;; Author: Kevin Broadey <KevinB@bartley.demon.co.uk>
 ;; Created: 27 Jan 1994
 ;; Version: foldout.el 1.10 dated 94/05/19 at 17:09:12
-;; Keywords: folding, outline
+;; Keywords: folding, outlines
 
 ;; This file is part of GNU Emacs.
 
@@ -236,6 +236,15 @@ An end marker of NIL means the fold ends after (point-max).")
       ;; slip our fold announcement into the list
       (setcdr outl-entry (nconc foldout-entry (cdr outl-entry)))
       ))
+
+;; outline-flag-region has different `flag' values in outline.el and
+;; noutline.el for hiding and showing text.
+
+(defconst foldout-hide-flag
+  (if (featurep 'noutline) t ?\^M))
+
+(defconst foldout-show-flag
+  (if (featurep 'noutline) nil ?\n))
 \f
 
 (defun foldout-zoom-subtree (&optional exposure)
@@ -358,12 +367,13 @@ exited and text is left visible."
                                  (point-max))))
            ;; hide the subtree
            (if hide-fold
-               (outline-flag-region start-marker end-of-subtree ?\^M))
+               (outline-flag-region start-marker end-of-subtree
+                                    foldout-hide-flag))
 
            ;; make sure the next heading is exposed
            (if end-marker
-               (outline-flag-region end-of-subtree
-                                    beginning-of-heading ?\n))
+               (outline-flag-region end-of-subtree beginning-of-heading
+                                    foldout-show-flag))
            ))
 
       ;; zap the markers so they don't slow down editing