changeset 17249:2dfc334bdc6f

(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 @.
author Richard M. Stallman <rms@gnu.org>
date Wed, 26 Mar 1997 07:30:26 +0000
parents cf25d78ebd75
children 68dcc3ebe342
files lisp/textmodes/outline.el
diffstat 1 files changed, 16 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/outline.el	Wed Mar 26 06:05:58 1997 +0000
+++ b/lisp/textmodes/outline.el	Wed Mar 26 07:30:26 1997 +0000
@@ -55,6 +55,7 @@
 (if outline-mode-prefix-map
     nil
   (setq outline-mode-prefix-map (make-sparse-keymap))
+  (define-key outline-mode-prefix-map "@" 'outline-mark-subtree)
   (define-key outline-mode-prefix-map "\C-n" 'outline-next-visible-heading)
   (define-key outline-mode-prefix-map "\C-p" 'outline-previous-visible-heading)
   (define-key outline-mode-prefix-map "\C-i" 'show-children)
@@ -363,6 +364,21 @@
   (interactive "p")
   (outline-next-visible-heading (- arg)))
 
+(defun outline-mark-subtree ()
+  "Mark the current subtree in an outlined document.
+This puts point at the start of the current subtree, and mark at the end."
+  (interactive)
+  (let ((beg))
+    (if (outline-on-heading-p)
+	;; we are already looking at a heading
+	(beginning-of-line)
+      ;; else go back to previous heading
+      (outline-previous-visible-heading 1))
+    (setq beg (point))
+    (outline-end-of-subtree)
+    (push-mark (point))
+    (goto-char beg)))
+
 (defun outline-flag-region (from to flag)
   "Hides or shows lines from FROM to TO, according to FLAG.
 If FLAG is nil then text is shown, while if FLAG is t the text is hidden."