diff options
| -rw-r--r-- | lisp/textmodes/outline.el | 16 |
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. | ||
| 369 | This 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. |
| 368 | If FLAG is nil then text is shown, while if FLAG is t the text is hidden." | 384 | If FLAG is nil then text is shown, while if FLAG is t the text is hidden." |