aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1995-03-14 05:43:48 +0000
committerRichard M. Stallman1995-03-14 05:43:48 +0000
commit6e2fb845baf51bea7e8e40ed7f6dcf6a7b4de6b0 (patch)
tree93fc00002fa9f5e857352879e0751edb234f0727
parent5798cf155e7e928a7e3d8813e26598b6f762718a (diff)
downloademacs-6e2fb845baf51bea7e8e40ed7f6dcf6a7b4de6b0.tar.gz
emacs-6e2fb845baf51bea7e8e40ed7f6dcf6a7b4de6b0.zip
entered into RCS
-rw-r--r--lisp/textmodes/outline.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el
index 47194a1c52d..01e1c4d3905 100644
--- a/lisp/textmodes/outline.el
+++ b/lisp/textmodes/outline.el
@@ -248,14 +248,14 @@ See the command `outline-mode' for more information on this mode."
248 (make-local-variable 'line-move-ignore-invisible) 248 (make-local-variable 'line-move-ignore-invisible)
249 (setq line-move-ignore-invisible t) 249 (setq line-move-ignore-invisible t)
250 ;; Cause use of ellipses for invisible text. 250 ;; Cause use of ellipses for invisible text.
251 (setq buffer-invisibility-spec '((t . t)))) 251 (setq buffer-invisibility-spec '((t . t)))
252 (run-hooks 'outline-minor-mode-hook) 252 (run-hooks 'outline-minor-mode-hook))
253 (setq line-move-ignore-invisible nil) 253 (setq line-move-ignore-invisible nil)
254 ;; Cause use of ellipses for invisible text. 254 ;; Cause use of ellipses for invisible text.
255 (setq buffer-invisibility-spec t)) 255 (setq buffer-invisibility-spec t))
256 ;; When turning off outline mode, get rid of any invisible props. 256 ;; When turning off outline mode, get rid of any outline hiding.
257 (or outline-minor-mode 257 (or outline-minor-mode
258 (outline-flag-region (point-min) (point-max) nil)) 258 (show-all))
259 (set-buffer-modified-p (buffer-modified-p))) 259 (set-buffer-modified-p (buffer-modified-p)))
260 260
261(defvar outline-level 'outline-level 261(defvar outline-level 'outline-level
@@ -288,7 +288,7 @@ at the end of the buffer."
288(defun outline-next-heading () 288(defun outline-next-heading ()
289 "Move to the next (possibly invisible) heading line." 289 "Move to the next (possibly invisible) heading line."
290 (interactive) 290 (interactive)
291 (if (re-search-forward (concat "^\\(" outline-regexp "\\)") 291 (if (re-search-forward (concat "\n\\(" outline-regexp "\\)")
292 nil 'move) 292 nil 'move)
293 (goto-char (1+ (match-beginning 0))))) 293 (goto-char (1+ (match-beginning 0)))))
294 294
@@ -363,6 +363,11 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
363 (overlay-put o 'invisible flag) 363 (overlay-put o 'invisible flag)
364 (overlay-put o 'outline t)))))) 364 (overlay-put o 'outline t))))))
365 365
366;; Exclude from the region BEG ... END all overlays
367;; with a non-nil PROP property.
368;; Exclude them by shrinking them to exclude BEG ... END,
369;; or even by splitting them if necessary.
370;; Overlays without a non-nil PROP property are not touched.
366(defun outline-discard-overlays (beg end prop) 371(defun outline-discard-overlays (beg end prop)
367 (if (< end beg) 372 (if (< end beg)
368 (setq beg (prog1 end (setq end beg)))) 373 (setq beg (prog1 end (setq end beg))))
@@ -387,8 +392,10 @@ If FLAG is nil then text is shown, while if FLAG is t the text is hidden."
387 (setq overlays (cdr overlays)))) 392 (setq overlays (cdr overlays))))
388 (goto-char (next-overlay-change (point)))))) 393 (goto-char (next-overlay-change (point))))))
389 394
395;; Make a copy of overlay O, with the same beginning, end and properties.
390(defun outline-copy-overlay (o) 396(defun outline-copy-overlay (o)
391 (let ((o1 (make-overlay (overlay-start o) (overlay-end o))) 397 (let ((o1 (make-overlay (overlay-start o) (overlay-end o)
398 (overlay-buffer o)))
392 (props (overlay-properties o))) 399 (props (overlay-properties o)))
393 (while props 400 (while props
394 (overlay-put o1 (car props) (nth 1 props)) 401 (overlay-put o1 (car props) (nth 1 props))