branch: externals/timeout
commit d59ca149307182b20e9843db0dd1738e01504cf1
Merge: b524e3801f 366a1b821a
Author: karthink <karthikchikmaga...@gmail.com>
Commit: GitHub <nore...@github.com>

    timeout: Ensure live buffer when debouncing (#5)
    
    timeout.el (timeout--debounce-advice): Ensure buffer is
    live before making it current.
---
 timeout.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/timeout.el b/timeout.el
index 8617f169c8..2bf41b833d 100644
--- a/timeout.el
+++ b/timeout.el
@@ -79,7 +79,9 @@ This is intended for use as function advice."
                  (lambda (buf)
                    (cancel-timer debounce-timer)
                    (setq debounce-timer nil)
-                   (with-current-buffer buf
+                   (if (buffer-live-p buf)
+                       (with-current-buffer buf
+                         (apply orig-fn args))
                      (apply orig-fn args)))
                  (current-buffer))))))))
 

Reply via email to