aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorRichard M. Stallman1997-03-26 07:30:26 +0000
committerRichard M. Stallman1997-03-26 07:30:26 +0000
commit7e60d5d365e8965fe3db60e08208a28bf567cd42 (patch)
tree00cea64e1ceba29ae8b0a052aa58a27bb00f537c /lisp/textmodes
parent48cbe093bb7843d7ef1f19314fd7666a4688d460 (diff)
downloademacs-7e60d5d365e8965fe3db60e08208a28bf567cd42.tar.gz
emacs-7e60d5d365e8965fe3db60e08208a28bf567cd42.zip
(outline-discard-overlays): Fix the case
where an overlay extends on both sides of the region. (outline-mark-subtree): New function. (outline-mode-prefix-map): Put outline-mark-subtree on C-c @.
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/outline.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/textmodes/outline.el b/lisp/textmodes/outline.el
index 3b7ae6c076d..212705979b7 100644
--- a/lisp/textmodes/outline.el
+++ b/lisp/textmodes/outline.el
@@ -55,6 +55,7 @@ in the file it applies to.")
55(if outline-mode-prefix-map 55(if outline-mode-prefix-map
56 nil 56 nil
57 (setq outline-mode-prefix-map (make-sparse-keymap)) 57 (setq outline-mode-prefix-map (make-sparse-keymap))
58 (define-key outline-mode-prefix-map "@" 'outline-mark-subtree)
58 (define-key outline-mode-prefix-map "\C-n" 'outline-next-visible-heading) 59 (define-key outline-mode-prefix-map "\C-n" 'outline-next-visible-heading)
59 (define-key outline-mode-prefix-map "\C-p" 'outline-previous-visible-heading) 60 (define-key outline-mode-prefix-map "\C-p" 'outline-previous-visible-heading)
60 (define-key outline-mode-prefix-map "\C-i" 'show-children) 61 (define-key outline-mode-prefix-map "\C-i" 'show-children)
@@ -363,6 +364,21 @@ A heading line is one that starts with a `*' (or that
363 (interactive "p") 364 (interactive "p")
364 (outline-next-visible-heading (- arg))) 365 (outline-next-visible-heading (- arg)))
365 366
367(defun outline-mark-subtree ()
368 "Mark the current subtree in an outlined document.
369This puts point at the start of the current subtree, and mark at the end."
370 (interactive)
371 (let ((beg))
372 (if (outline-on-heading-p)
373 ;; we are already looking at a heading
374 (beginning-of-line)
375 ;; else go back to previous heading
376 (outline-previous-visible-heading 1))
377 (setq beg (point))
378 (outline-end-of-subtree)
379 (push-mark (point))
380 (goto-char beg)))
381
366(defun outline-flag-region (from to flag) 382(defun outline-flag-region (from to flag)
367 "Hides or shows lines from FROM to TO, according to FLAG. 383 "Hides or shows lines from FROM to TO, according to FLAG.
368If FLAG is nil then text is shown, while if FLAG is t the text is hidden." 384If FLAG is nil then text is shown, while if FLAG is t the text is hidden."