From: Sean Whitton Date: Thu, 3 Apr 2025 08:44:10 +0000 (+0800) Subject: ; Add a check for liveness to last change X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bcddbeb935deee5a68bd8a15b11cd90b74da25e1;p=emacs.git ; Add a check for liveness to last change (cherry picked from commit 91a75c0d460efb7490c7901ff8572adb14cd50db) --- diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 1a9ca2de5c9..00aea22d563 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -205,8 +205,9 @@ Another is that undo information is not kept." ;; See bug#53626 and bug#77306. (setq default-directory olddir) (run-with-timer 0 nil (lambda () - (with-current-buffer buf - (setq default-directory olddir)))) + (when (buffer-live-p buf) + (with-current-buffer buf + (setq default-directory olddir))))) (let ((buffer-undo-list t) (inhibit-read-only t))