diff options
| author | Stefan Monnier | 2005-02-27 23:42:14 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-02-27 23:42:14 +0000 |
| commit | fc88c2888fce5a5c82d9b97bc1ab7958a42c2b7e (patch) | |
| tree | 66d21899b77433e3f79cc5e60e1dc2a6aa9037a7 | |
| parent | 35c5f5d32f7449676262abe7333b3d12dc2bcbf9 (diff) | |
| download | emacs-fc88c2888fce5a5c82d9b97bc1ab7958a42c2b7e.tar.gz emacs-fc88c2888fce5a5c82d9b97bc1ab7958a42c2b7e.zip | |
(reveal-post-command): Don't try to reveal overlays which
have a non-nil `invisible' property but are actually visible.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/reveal.el | 34 |
2 files changed, 24 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fe9f2fb1930..ed7ab84dd81 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2005-02-27 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2005-02-27 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * reveal.el (reveal-post-command): Don't try to reveal overlays which | ||
| 4 | have a non-nil `invisible' property but are actually visible. | ||
| 5 | |||
| 3 | * progmodes/perl-mode.el (perl-imenu-generic-expression): Add entries | 6 | * progmodes/perl-mode.el (perl-imenu-generic-expression): Add entries |
| 4 | for perldoc sections. | 7 | for perldoc sections. |
| 5 | (perl-outline-regexp, perl-outline-level): New var and function. | 8 | (perl-outline-regexp, perl-outline-level): New var and function. |
diff --git a/lisp/reveal.el b/lisp/reveal.el index 04cc58893c9..4d2742a4810 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; reveal.el --- Automatically reveal hidden text at point | 1 | ;;; reveal.el --- Automatically reveal hidden text at point |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> | 5 | ;; Author: Stefan Monnier <monnier@cs.yale.edu> |
| 6 | ;; Keywords: outlines | 6 | ;; Keywords: outlines |
| @@ -93,16 +93,22 @@ | |||
| 93 | (overlays-at (point)))) | 93 | (overlays-at (point)))) |
| 94 | (push (cons (selected-window) ol) reveal-open-spots) | 94 | (push (cons (selected-window) ol) reveal-open-spots) |
| 95 | (setq old-ols (delq ol old-ols)) | 95 | (setq old-ols (delq ol old-ols)) |
| 96 | (let ((open (overlay-get ol 'reveal-toggle-invisible)) inv) | 96 | (let ((inv (overlay-get ol 'invisible)) open) |
| 97 | (when (or open | 97 | (when (and inv |
| 98 | (and (setq inv (overlay-get ol 'invisible)) | 98 | ;; There's an `invisible' property. Make sure it's |
| 99 | (symbolp inv) | 99 | ;; actually invisible. |
| 100 | (or (setq open (or (get inv 'reveal-toggle-invisible) | 100 | (or (not (listp buffer-invisibility-spec)) |
| 101 | (overlay-get ol 'isearch-open-invisible-temporary))) | 101 | (memq inv buffer-invisibility-spec) |
| 102 | (overlay-get ol 'isearch-open-invisible) | 102 | (assq inv buffer-invisibility-spec)) |
| 103 | (and (consp buffer-invisibility-spec) | 103 | (or (setq open |
| 104 | (assq inv buffer-invisibility-spec))) | 104 | (or (overlay-get ol 'reveal-toggle-invisible) |
| 105 | (overlay-put ol 'reveal-invisible inv))) | 105 | (and (symbolp inv) |
| 106 | (get inv 'reveal-toggle-invisible)) | ||
| 107 | (overlay-get ol 'isearch-open-invisible-temporary))) | ||
| 108 | (overlay-get ol 'isearch-open-invisible) | ||
| 109 | (and (consp buffer-invisibility-spec) | ||
| 110 | (cdr (assq inv buffer-invisibility-spec)))) | ||
| 111 | (overlay-put ol 'reveal-invisible inv)) | ||
| 106 | (if (null open) | 112 | (if (null open) |
| 107 | (overlay-put ol 'invisible nil) | 113 | (overlay-put ol 'invisible nil) |
| 108 | ;; Use the provided opening function and repeat (since the | 114 | ;; Use the provided opening function and repeat (since the |
| @@ -110,7 +116,8 @@ | |||
| 110 | (setq repeat t) | 116 | (setq repeat t) |
| 111 | (condition-case err | 117 | (condition-case err |
| 112 | (funcall open ol nil) | 118 | (funcall open ol nil) |
| 113 | (error (message "!!Reveal-show: %s !!" err) | 119 | (error (message "!!Reveal-show (funcall %s %s nil): %s !!" |
| 120 | open ol err) | ||
| 114 | ;; Let's default to a meaningful behavior to avoid | 121 | ;; Let's default to a meaningful behavior to avoid |
| 115 | ;; getting stuck in an infinite loop. | 122 | ;; getting stuck in an infinite loop. |
| 116 | (setq repeat nil) | 123 | (setq repeat nil) |
| @@ -147,7 +154,8 @@ | |||
| 147 | (overlay-get ol 'isearch-open-invisible-temporary))))) | 154 | (overlay-get ol 'isearch-open-invisible-temporary))))) |
| 148 | (condition-case err | 155 | (condition-case err |
| 149 | (funcall open ol t) | 156 | (funcall open ol t) |
| 150 | (error (message "!!Reveal-hide: %s !!" err))) | 157 | (error (message "!!Reveal-hide (funcall %s %s t): %s !!" |
| 158 | open ol err))) | ||
| 151 | (overlay-put ol 'invisible inv)))))))) | 159 | (overlay-put ol 'invisible inv)))))))) |
| 152 | (error (message "Reveal: %s" err))))) | 160 | (error (message "Reveal: %s" err))))) |
| 153 | 161 | ||