[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/reveal.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/reveal.el |
Date: |
Wed, 11 Jan 2006 22:30:27 +0000 |
Index: emacs/lisp/reveal.el
diff -u emacs/lisp/reveal.el:1.22 emacs/lisp/reveal.el:1.23
--- emacs/lisp/reveal.el:1.22 Mon Jan 9 22:56:08 2006
+++ emacs/lisp/reveal.el Wed Jan 11 22:30:26 2006
@@ -85,7 +85,8 @@
;; a window which does not show this buffer any more.
(cond
((eq (car x) (selected-window)) (cdr x))
- ((not (eq (window-buffer (car x)) (current-buffer)))
+ ((not (and (window-live-p (car x))
+ (eq (window-buffer (car x))
(current-buffer))))
;; Adopt this since it's owned by a window that's
;; either not live or at least not showing this
;; buffer any more.
@@ -104,35 +105,37 @@
(overlays-at (mark)))
(overlays-at (point))))
(setq old-ols (delq ol old-ols))
- (let ((inv (overlay-get ol 'invisible)) open)
- (when (and inv
- ;; There's an `invisible' property. Make sure it's
- ;; actually invisible, and ellipsised.
- (and (consp buffer-invisibility-spec)
- (cdr (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))
- (push (cons (selected-window) ol) reveal-open-spots)
- (if (null open)
- (overlay-put ol 'invisible nil)
- ;; Use the provided opening function and repeat (since the
- ;; opening function might have hidden a subpart around point).
- (setq repeat t)
- (condition-case err
- (funcall open ol nil)
- (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-put ol 'invisible nil)))))))))
+ (when (overlay-start ol) ;Check it's still live.
+ (let ((inv (overlay-get ol 'invisible)) open)
+ (when (and inv
+ ;; There's an `invisible' property. Make sure it's
+ ;; actually invisible, and ellipsised.
+ (and (consp buffer-invisibility-spec)
+ (cdr (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))
+ (push (cons (selected-window) ol) reveal-open-spots)
+ (if (null open)
+ (overlay-put ol 'invisible nil)
+ ;; Use the provided opening function and repeat (since the
+ ;; opening function might have hidden a subpart around point
+ ;; or moved/killed some of the overlays).
+ (setq repeat t)
+ (condition-case err
+ (funcall open ol nil)
+ (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-put ol 'invisible nil))))))))))
old-ols)
(defun reveal-close-old-overlays (old-ols)