diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-03-31 20:56:14 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2003-03-31 20:56:14 +0000 |
commit | b8140f56339768222b3ed4976519d1bff1efbe10 (patch) | |
tree | 31684970ae2858bdfc8cbf9a84df11a51bdb9098 | |
parent | 1198a140fb9ab6a58d71331c724c1a900bcc2445 (diff) | |
download | emacs-b8140f56339768222b3ed4976519d1bff1efbe10.tar.gz |
(reveal-post-command): Better error handling and debugging.
-rw-r--r-- | lisp/reveal.el | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lisp/reveal.el b/lisp/reveal.el index 245c7a3c4a0..c30686e4e27 100644 --- a/lisp/reveal.el +++ b/lisp/reveal.el @@ -61,6 +61,8 @@ ;; Actual code +(defvar reveal-backtrace nil) + (defun reveal-post-command () ;; Refresh the spots that might have changed. ;; `Refreshing' here means to try and re-hide the corresponding text. @@ -107,7 +109,11 @@ (setq repeat t) (condition-case err (funcall open ol nil) - (error (message "!!Reveal-show: %s !!" err)))))))) + (error (setq reveal-backtrace (backtrace)) + (message "!!Reveal-show: %s !!" err) + ;; Let's default to a meaningful behavior to avoid + ;; getting stuck in an infinite loop. + (overlay-put ol 'invisible nil)))))))) ;; Close old overlays. (dolist (ol old-ols) (when (and (eq (current-buffer) (overlay-buffer ol)) @@ -128,9 +134,11 @@ (get ol 'isearch-open-invisible-temporary))))) (condition-case err (funcall open ol t) - (error (message "!!Reveal-hide: %s !!" err))) + (error (setq reveal-backtrace (backtrace)) + (message "!!Reveal-hide: %s !!" err))) (overlay-put ol 'invisible inv))))))) - (error (message "Reveal: %s" err))))) + (error (setq reveal-backtrace (backtrace)) + (message "Reveal: %s" err))))) ;;;###autoload (define-minor-mode reveal-mode |