Commit 65c1b8a1 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(outline-mode): Use `add-to-invisibility-spec' and

set the invisible property to `outline'.
(outline-minor-mode): Likewise.
Also, use `remove-from-invisibility-spec'.
(outline-flag-region): Set `outline' as the invisible property.
parent c4cd8760
...@@ -214,7 +214,7 @@ Turning on outline mode calls the value of `text-mode-hook' and then of ...@@ -214,7 +214,7 @@ Turning on outline mode calls the value of `text-mode-hook' and then of
(make-local-variable 'line-move-ignore-invisible) (make-local-variable 'line-move-ignore-invisible)
(setq line-move-ignore-invisible t) (setq line-move-ignore-invisible t)
;; Cause use of ellipses for invisible text. ;; Cause use of ellipses for invisible text.
(setq buffer-invisibility-spec '((t . t))) (add-to-invisibility-spec '(outline . t))
(make-local-variable 'paragraph-start) (make-local-variable 'paragraph-start)
(setq paragraph-start (concat paragraph-start "\\|\\(" (setq paragraph-start (concat paragraph-start "\\|\\("
outline-regexp "\\)")) outline-regexp "\\)"))
...@@ -270,11 +270,11 @@ See the command `outline-mode' for more information on this mode." ...@@ -270,11 +270,11 @@ See the command `outline-mode' for more information on this mode."
(make-local-variable 'line-move-ignore-invisible) (make-local-variable 'line-move-ignore-invisible)
(setq line-move-ignore-invisible t) (setq line-move-ignore-invisible t)
;; Cause use of ellipses for invisible text. ;; Cause use of ellipses for invisible text.
(setq buffer-invisibility-spec '((t . t))) (add-to-invisibility-spec '(outline . t))
(run-hooks 'outline-minor-mode-hook)) (run-hooks 'outline-minor-mode-hook))
(setq line-move-ignore-invisible nil) (setq line-move-ignore-invisible nil)
;; Cause use of ellipses for invisible text. ;; Cause use of ellipses for invisible text.
(setq buffer-invisibility-spec t)) (remove-from-invisibility-spec '(outline . t)))
;; When turning off outline mode, get rid of any outline hiding. ;; When turning off outline mode, get rid of any outline hiding.
(or outline-minor-mode (or outline-minor-mode
(show-all)) (show-all))
...@@ -402,7 +402,7 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden." ...@@ -402,7 +402,7 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
(outline-discard-overlays (point) to 'outline) (outline-discard-overlays (point) to 'outline)
(if flag (if flag
(let ((o (make-overlay (point) to))) (let ((o (make-overlay (point) to)))
(overlay-put o 'invisible flag) (overlay-put o 'invisible 'outline)
(overlay-put o 'outline t))))) (overlay-put o 'outline t)))))
(run-hooks 'outline-view-change-hook)) (run-hooks 'outline-view-change-hook))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment