aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier <[email protected]>2005-02-27 23:42:14 +0000
committerStefan Monnier <[email protected]>2005-02-27 23:42:14 +0000
commitfc88c2888fce5a5c82d9b97bc1ab7958a42c2b7e (patch)
tree66d21899b77433e3f79cc5e60e1dc2a6aa9037a7 /lisp
parent35c5f5d32f7449676262abe7333b3d12dc2bcbf9 (diff)
(reveal-post-command): Don't try to reveal overlays which
have a non-nil `invisible' property but are actually visible.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/reveal.el34
2 files changed, 24 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index fe9f2fb193..ed7ab84dd8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2005-02-27 Stefan Monnier <[email protected]>
+ * reveal.el (reveal-post-command): Don't try to reveal overlays which
+ have a non-nil `invisible' property but are actually visible.
+
* progmodes/perl-mode.el (perl-imenu-generic-expression): Add entries
for perldoc sections.
(perl-outline-regexp, perl-outline-level): New var and function.
diff --git a/lisp/reveal.el b/lisp/reveal.el
index 04cc58893c..4d2742a481 100644
--- a/lisp/reveal.el
+++ b/lisp/reveal.el
@@ -1,6 +1,6 @@
;;; reveal.el --- Automatically reveal hidden text at point
-;; Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+;; Copyright (C) 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
;; Author: Stefan Monnier <[email protected]>
;; Keywords: outlines
@@ -93,16 +93,22 @@
(overlays-at (point))))
(push (cons (selected-window) ol) reveal-open-spots)
(setq old-ols (delq ol old-ols))
- (let ((open (overlay-get ol 'reveal-toggle-invisible)) inv)
- (when (or open
- (and (setq inv (overlay-get ol 'invisible))
- (symbolp inv)
- (or (setq open (or (get inv 'reveal-toggle-invisible)
- (overlay-get ol 'isearch-open-invisible-temporary)))
- (overlay-get ol 'isearch-open-invisible)
- (and (consp buffer-invisibility-spec)
- (assq inv buffer-invisibility-spec)))
- (overlay-put ol 'reveal-invisible inv)))
+ (let ((inv (overlay-get ol 'invisible)) open)
+ (when (and inv
+ ;; There's an `invisible' property. Make sure it's
+ ;; actually invisible.
+ (or (not (listp buffer-invisibility-spec))
+ (memq inv buffer-invisibility-spec)
+ (assq inv buffer-invisibility-spec))
+ (or (setq open
+ (or (overlay-get ol 'reveal-toggle-invisible)
+ (and (symbolp inv)
+ (get inv 'reveal-toggle-invisible))
+ (overlay-get ol 'isearch-open-invisible-temporary)))
+ (overlay-get ol 'isearch-open-invisible)
+ (and (consp buffer-invisibility-spec)
+ (cdr (assq inv buffer-invisibility-spec))))
+ (overlay-put ol 'reveal-invisible inv))
(if (null open)
(overlay-put ol 'invisible nil)
;; Use the provided opening function and repeat (since the
@@ -110,7 +116,8 @@
(setq repeat t)
(condition-case err
(funcall open ol nil)
- (error (message "!!Reveal-show: %s !!" err)
+ (error (message "!!Reveal-show (funcall %s %s nil): %s !!"
+ open ol err)
;; Let's default to a meaningful behavior to avoid
;; getting stuck in an infinite loop.
(setq repeat nil)
@@ -147,7 +154,8 @@
(overlay-get ol 'isearch-open-invisible-temporary)))))
(condition-case err
(funcall open ol t)
- (error (message "!!Reveal-hide: %s !!" err)))
+ (error (message "!!Reveal-hide (funcall %s %s t): %s !!"
+ open ol err)))
(overlay-put ol 'invisible inv))))))))
(error (message "Reveal: %s" err)))))