Commit 53b71fd4 authored by Alan Mackenzie's avatar Alan Mackenzie

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.
parent 2fa33eb6
Pipeline #3374 passed with stage
in 55 minutes and 58 seconds
......@@ -2625,7 +2625,10 @@ Actual value is never used, only the text property.")
(make-overlay overlay-arrow-position overlay-arrow-position))
(overlay-put compilation-arrow-overlay
'before-string compilation--dummy-string)
(set-window-margins (selected-window) (+ (or (car (window-margins)) 0) 2)))
(set-window-margins (selected-window) (+ (or (car (window-margins)) 0) 2))
;; Take precautions against `compilation-mode' getting reinitialized.
(add-hook 'change-major-mode-hook
'compilation-tear-down-arrow-spec-in-margin nil t))
(defun compilation-tear-down-arrow-spec-in-margin ()
"Restore compilation-arrow-overlay to not using the margin, which is removed."
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment