Mercurial > emacs
comparison lisp/textmodes/outline.el @ 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 | e6d5322b810c |
comparison
equal
deleted
inserted
replaced
17248:cf25d78ebd75 | 17249:2dfc334bdc6f |
---|---|
53 (defvar outline-mode-prefix-map nil) | 53 (defvar outline-mode-prefix-map nil) |
54 | 54 |
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) |
61 (define-key outline-mode-prefix-map "\C-s" 'show-subtree) | 62 (define-key outline-mode-prefix-map "\C-s" 'show-subtree) |
62 (define-key outline-mode-prefix-map "\C-d" 'hide-subtree) | 63 (define-key outline-mode-prefix-map "\C-d" 'hide-subtree) |
361 A heading line is one that starts with a `*' (or that | 362 A heading line is one that starts with a `*' (or that |
362 `outline-regexp' matches)." | 363 `outline-regexp' matches)." |
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." |
369 (let ((inhibit-read-only t)) | 385 (let ((inhibit-read-only t)) |
370 (save-excursion | 386 (save-excursion |