# HG changeset patch # User Stefan Monnier # Date 1137018626 0 # Node ID d47ecb3cad92085ebbac87742663e72e442e8898 # Parent ec4727559827c11b67028aa28ae8f3378b1360af (reveal-post-command): window-buffer signals an error on dead windows rather than returning nil. (reveal-open-new-overlays): An overlay might die while we open others. diff -r ec4727559827 -r d47ecb3cad92 lisp/ChangeLog --- a/lisp/ChangeLog Wed Jan 11 21:02:35 2006 +0000 +++ b/lisp/ChangeLog Wed Jan 11 22:30:26 2006 +0000 @@ -1,23 +1,29 @@ +2006-01-11 Stefan Monnier + + * reveal.el (reveal-post-command): window-buffer signals an error on + dead windows rather than returning nil. + (reveal-open-new-overlays): An overlay might die while we open others. + 2006-01-11 Bill Wohler * cus-dep.el (generated-custom-dependencies-file): Fix typo and phrasing in docstring. * Makefile.in (MH_E_SRC): Rename from MH-E-SRC since the dashes - can give some systems gas. Add new file mh-buffers.el. + can give some systems gas. Add new file mh-buffers.el. 2006-01-06 Masatake YAMATO * font-lock.el (cpp-font-lock-keywords): Font lock keywords for C preprocessor forward ported from GNU Emacs 21.2. - * progmodes/asm-mode.el (asm-font-lock-keywords): Use - `cpp-font-lock-keywords'. + * progmodes/asm-mode.el (asm-font-lock-keywords): + Use `cpp-font-lock-keywords'. * progmodes/ld-script.el (ld-script-font-lock-keywords): Ditto. * progmodes/ld-script.el (auto-mode-alist): Use \\> instead - of $ for "\\.ld[s]?". + of $ for "\\.ld[s]?". 2006-01-10 Stefan Monnier diff -r ec4727559827 -r d47ecb3cad92 lisp/reveal.el --- a/lisp/reveal.el Wed Jan 11 21:02:35 2006 +0000 +++ b/lisp/reveal.el Wed Jan 11 22:30:26 2006 +0000 @@ -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)