Mercurial > emacs
comparison lisp/textmodes/outline.el @ 45429:5d3b861665f0
(outline-reveal-toggle-invisible): Reverse the meaning of the second arg.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Mon, 20 May 2002 18:32:07 +0000 |
parents | eea433180987 |
children | 0d2e42a6fd1c |
comparison
equal
deleted
inserted
replaced
45428:ac7e0cc03aed | 45429:5d3b861665f0 |
---|---|
80 (define-key map "\C-k" 'show-branches) | 80 (define-key map "\C-k" 'show-branches) |
81 (define-key map "\C-q" 'hide-sublevels) | 81 (define-key map "\C-q" 'hide-sublevels) |
82 (define-key map "\C-o" 'hide-other) | 82 (define-key map "\C-o" 'hide-other) |
83 (define-key map "\C-^" 'outline-promote) | 83 (define-key map "\C-^" 'outline-promote) |
84 (define-key map "\C-v" 'outline-demote) | 84 (define-key map "\C-v" 'outline-demote) |
85 ;; Where to bind toggle and insert-heading ? | |
85 map)) | 86 map)) |
86 | 87 |
87 (defvar outline-mode-menu-bar-map | 88 (defvar outline-mode-menu-bar-map |
88 (let ((map (make-sparse-keymap))) | 89 (let ((map (make-sparse-keymap))) |
89 | 90 |
495 (overlay-put o 'invisible 'outline) | 496 (overlay-put o 'invisible 'outline) |
496 (overlay-put o 'isearch-open-invisible 'outline-isearch-open-invisible))) | 497 (overlay-put o 'isearch-open-invisible 'outline-isearch-open-invisible))) |
497 ;; Seems only used by lazy-lock. I.e. obsolete. | 498 ;; Seems only used by lazy-lock. I.e. obsolete. |
498 (run-hooks 'outline-view-change-hook)) | 499 (run-hooks 'outline-view-change-hook)) |
499 | 500 |
500 (defun outline-reveal-toggle-invisible (o revealp) | 501 (defun outline-reveal-toggle-invisible (o hidep) |
501 (save-excursion | 502 (save-excursion |
502 (goto-char (overlay-start o)) | 503 (goto-char (overlay-start o)) |
503 (if (null revealp) | 504 (if hidep |
504 ;; When hiding the area again, we could just clean it up and let | 505 ;; When hiding the area again, we could just clean it up and let |
505 ;; reveal do the rest, by simply doing: | 506 ;; reveal do the rest, by simply doing: |
506 ;; (remove-overlays (overlay-start o) (overlay-end o) | 507 ;; (remove-overlays (overlay-start o) (overlay-end o) |
507 ;; 'invisible 'outline) | 508 ;; 'invisible 'outline) |
508 ;; | 509 ;; |
520 | 521 |
521 ;; When revealing, we just need to reveal sublevels. If point is | 522 ;; When revealing, we just need to reveal sublevels. If point is |
522 ;; inside one of the sublevels, reveal will call us again. | 523 ;; inside one of the sublevels, reveal will call us again. |
523 ;; But we need to preserve the original overlay. | 524 ;; But we need to preserve the original overlay. |
524 (let ((o1 (copy-overlay o))) | 525 (let ((o1 (copy-overlay o))) |
525 (overlay-put o1 'invisible 'outline) ;We rehide some of the text. | 526 (overlay-put o 'invisible nil) ;Show (most of) the text. |
526 (while (progn | 527 (while (progn |
527 (show-entry) | 528 (show-entry) |
528 (show-children) | 529 (show-children) |
529 ;; Normally just the above is needed. | 530 ;; Normally just the above is needed. |
530 ;; But in odd cases, the above might fail to show anything. | 531 ;; But in odd cases, the above might fail to show anything. |