]> git.eshelyaron.com Git - emacs.git/commitdiff
In compilation-tear-down-arrow-spec-in-margin, test compilation-arrow-overlay
authorAlan Mackenzie <acm@muc.de>
Sun, 13 Oct 2019 13:15:35 +0000 (13:15 +0000)
committerAlan Mackenzie <acm@muc.de>
Sun, 13 Oct 2019 13:18:00 +0000 (13:18 +0000)
* lisp/progmodes/compile.el (compilation-tear-down-arrow-spec-in-margin): Make
sure compilation-arrow-overlay is an overlay before performing overlay
operations on it.  This fixes bug #37733.

lisp/progmodes/compile.el

index 505e0917dcb153a647f87ed83f4c729ca3ec9617..7d7a1b99d970f6de22974ce0fc737756de0c6d8f 100644 (file)
@@ -2670,10 +2670,11 @@ Actual value is never used, only the text property.")
 
 (defun compilation-tear-down-arrow-spec-in-margin ()
   "Restore compilation-arrow-overlay to not using the margin, which is removed."
-  (overlay-put compilation-arrow-overlay 'before-string nil)
-  (delete-overlay compilation-arrow-overlay)
-  (setq compilation-arrow-overlay nil)
-  (set-window-margins (selected-window) (- (car (window-margins)) 2)))
+  (when (overlayp compilation-arrow-overlay)
+    (overlay-put compilation-arrow-overlay 'before-string nil)
+    (delete-overlay compilation-arrow-overlay)
+    (setq compilation-arrow-overlay nil)
+    (set-window-margins (selected-window) (- (car (window-margins)) 2))))
 
 (defun compilation-set-overlay-arrow (w)
   "Set up, or switch off, the overlay-arrow for window W."