From: Stefan Monnier Date: Sat, 27 Jul 2019 13:57:18 +0000 (-0400) Subject: * lisp/progmodes/compile.el: Fix bug#36803. X-Git-Tag: emacs-27.0.90~1817^2~73 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=13653483b7af500ebbbc503a0b54d0e25b53aac3;p=emacs.git * lisp/progmodes/compile.el: Fix bug#36803. Make sure all mode-lines are updated when compilation-in-progress is changed since it's visible globally. (compilation--update-in-progress-mode-line): New function. (compilation-start, compilation-sentinel): Use it. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index a7575b5a1a1..39b6134a91d 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1613,6 +1613,11 @@ If nil, ask to kill it." :type 'boolean :version "24.3") +(defun compilation--update-in-progress-mode-line () + ;; `compilation-in-progress' affects the mode-line of all + ;; buffers when it changes from nil to non-nil or vice-versa. + (unless compilation-in-progress (force-mode-line-update t))) + ;;;###autoload (defun compilation-start (command &optional mode name-function highlight-regexp) "Run compilation command COMMAND (low level interface). @@ -1806,8 +1811,8 @@ Returns the compilation buffer created." ;; The process may have exited already. (error nil))) (run-hook-with-args 'compilation-start-hook proc) - (setq compilation-in-progress - (cons proc compilation-in-progress))) + (compilation--update-in-progress-mode-line) + (push proc compilation-in-progress)) ;; No asynchronous processes available. (message "Executing `%s'..." command) ;; Fake mode line display as if `start-process' were run. @@ -2240,7 +2245,8 @@ commands of Compilation major mode are available. See ;; process is dead, we can delete it now. Otherwise it ;; will stay around until M-x list-processes. (delete-process proc))) - (setq compilation-in-progress (delq proc compilation-in-progress))))) + (setq compilation-in-progress (delq proc compilation-in-progress)) + (compilation--update-in-progress-mode-line)))) (defun compilation-filter (proc string) "Process filter for compilation buffers.