aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mackenzie2019-09-29 15:39:16 +0000
committerAlan Mackenzie2019-09-29 15:39:16 +0000
commit53b71fd4adf6de6b4d8b37e8ab3d56eb93e7ce92 (patch)
tree015dd662c638fa2b851000de2d1080e537179c23
parent2fa33eb6ee20e48a4c6488bb0d55b3c1c9a1f721 (diff)
downloademacs-53b71fd4adf6de6b4d8b37e8ab3d56eb93e7ce92.tar.gz
emacs-53b71fd4adf6de6b4d8b37e8ab3d56eb93e7ce92.zip
Remove the compilation-arrow-overlay on a major mode change/reinitialization
At the same time, remove the 2-character left margin. * lisp/progmodes/compile.el (compilation-set-up-arrow-spec-in-margin): put compilation-tear-down-arrow-spec-in-margin onto change-major-mode-hook.
-rw-r--r--lisp/progmodes/compile.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f0b34c702ca..d80fef3103e 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -2625,7 +2625,10 @@ Actual value is never used, only the text property.")
2625 (make-overlay overlay-arrow-position overlay-arrow-position)) 2625 (make-overlay overlay-arrow-position overlay-arrow-position))
2626 (overlay-put compilation-arrow-overlay 2626 (overlay-put compilation-arrow-overlay
2627 'before-string compilation--dummy-string) 2627 'before-string compilation--dummy-string)
2628 (set-window-margins (selected-window) (+ (or (car (window-margins)) 0) 2))) 2628 (set-window-margins (selected-window) (+ (or (car (window-margins)) 0) 2))
2629 ;; Take precautions against `compilation-mode' getting reinitialized.
2630 (add-hook 'change-major-mode-hook
2631 'compilation-tear-down-arrow-spec-in-margin nil t))
2629 2632
2630(defun compilation-tear-down-arrow-spec-in-margin () 2633(defun compilation-tear-down-arrow-spec-in-margin ()
2631 "Restore compilation-arrow-overlay to not using the margin, which is removed." 2634 "Restore compilation-arrow-overlay to not using the margin, which is removed."