]> code.delx.au - gnu-emacs/commitdiff
(reveal-post-command): Don't try to reveal overlays which
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 27 Feb 2005 23:42:14 +0000 (23:42 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sun, 27 Feb 2005 23:42:14 +0000 (23:42 +0000)
have a non-nil `invisible' property but are actually visible.

lisp/ChangeLog
lisp/reveal.el

index fe9f2fb1930a0533ebdc6838f635265b512ff5b4..ed7ab84dd811a6fa7019de26d6075bbf7b53f5dc 100644 (file)
@@ -1,5 +1,8 @@
 2005-02-27  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * 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.
index 04cc58893c99cdf0fadbd3c87786ec22c814fb54..4d2742a48101fbef0d9cee4eb82c3448cc4c144f 100644 (file)
@@ -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 <monnier@cs.yale.edu>
 ;; Keywords: outlines
                          (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
               (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)
                                           (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)))))