[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 53b71fd: Remove the compilation-arrow-overlay on a
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] master 53b71fd: Remove the compilation-arrow-overlay on a major mode change/reinitialization |
Date: |
Sun, 29 Sep 2019 11:40:47 -0400 (EDT) |
branch: master
commit 53b71fd4adf6de6b4d8b37e8ab3d56eb93e7ce92
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
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.
---
lisp/progmodes/compile.el | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index f0b34c7..d80fef3 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -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."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 53b71fd: Remove the compilation-arrow-overlay on a major mode change/reinitialization,
Alan Mackenzie <=