From 7df7a90e2cd0487fa48600047398766b2882bd79 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 19 Oct 2025 20:56:30 +0300 Subject: [PATCH] * lisp/progmodes/compile.el (compilation--set-up-margin): Fix. Call 'set-window-margins' only on the compilation buffer where the hook 'window-buffer-change-functions' is set buffer-locally (bug#79640). --- lisp/progmodes/compile.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 8cfa793cfc6..01152328577 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -3062,7 +3062,8 @@ Actual value is never used, only the text property.") (defun compilation--set-up-margin (w) "Setup the margin for \"=>\" in window W if it isn't already set up." - (set-window-margins w (+ (or (car (window-margins w)) 0) 2))) + (when (eq (window-buffer w) (current-buffer)) + (set-window-margins w (+ (or (car (window-margins w)) 0) 2)))) (defun compilation--tear-down-margin (w) "Remove the margin for \"=>\" if it is setup in window W."