emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master eca6c92 1/2: Protect compilation-auto-jump against code killing t


From: Lars Ingebrigtsen
Subject: master eca6c92 1/2: Protect compilation-auto-jump against code killing the buffer
Date: Sat, 5 Sep 2020 08:36:38 -0400 (EDT)

branch: master
commit eca6c9281f0506f9c8c866ae2025288c44ea994a
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Protect compilation-auto-jump against code killing the buffer
    
    * lisp/progmodes/compile.el (compilation-auto-jump): Something may
    have killed the buffer before the timer fired (bug#24585).
---
 lisp/progmodes/compile.el | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0dedde3..1b1920b 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1148,12 +1148,13 @@ POS and RES.")
            (setcdr l1 (cons (list ,key) l2)))))))
 
 (defun compilation-auto-jump (buffer pos)
-  (with-current-buffer buffer
-    (goto-char pos)
-    (let ((win (get-buffer-window buffer 0)))
-      (if win (set-window-point win pos)))
-    (if compilation-auto-jump-to-first-error
-       (compile-goto-error))))
+  (when (buffer-live-p buffer)
+    (with-current-buffer buffer
+      (goto-char pos)
+      (let ((win (get-buffer-window buffer 0)))
+        (if win (set-window-point win pos)))
+      (if compilation-auto-jump-to-first-error
+         (compile-goto-error)))))
 
 ;; This function is the central driver, called when font-locking to gather
 ;; all information needed to later jump to corresponding source code.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]