diff options
| author | Stefan Monnier | 2019-07-27 09:57:18 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2019-07-27 09:57:18 -0400 |
| commit | 13653483b7af500ebbbc503a0b54d0e25b53aac3 (patch) | |
| tree | cd2b5c299451e69480a01eac3368d5807fecbc3c | |
| parent | 2f646633e0e29201c8fa0e39f4baec3a14491639 (diff) | |
| download | emacs-13653483b7af500ebbbc503a0b54d0e25b53aac3.tar.gz emacs-13653483b7af500ebbbc503a0b54d0e25b53aac3.zip | |
* 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.
| -rw-r--r-- | lisp/progmodes/compile.el | 12 |
1 files changed, 9 insertions, 3 deletions
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." | |||
| 1613 | :type 'boolean | 1613 | :type 'boolean |
| 1614 | :version "24.3") | 1614 | :version "24.3") |
| 1615 | 1615 | ||
| 1616 | (defun compilation--update-in-progress-mode-line () | ||
| 1617 | ;; `compilation-in-progress' affects the mode-line of all | ||
| 1618 | ;; buffers when it changes from nil to non-nil or vice-versa. | ||
| 1619 | (unless compilation-in-progress (force-mode-line-update t))) | ||
| 1620 | |||
| 1616 | ;;;###autoload | 1621 | ;;;###autoload |
| 1617 | (defun compilation-start (command &optional mode name-function highlight-regexp) | 1622 | (defun compilation-start (command &optional mode name-function highlight-regexp) |
| 1618 | "Run compilation command COMMAND (low level interface). | 1623 | "Run compilation command COMMAND (low level interface). |
| @@ -1806,8 +1811,8 @@ Returns the compilation buffer created." | |||
| 1806 | ;; The process may have exited already. | 1811 | ;; The process may have exited already. |
| 1807 | (error nil))) | 1812 | (error nil))) |
| 1808 | (run-hook-with-args 'compilation-start-hook proc) | 1813 | (run-hook-with-args 'compilation-start-hook proc) |
| 1809 | (setq compilation-in-progress | 1814 | (compilation--update-in-progress-mode-line) |
| 1810 | (cons proc compilation-in-progress))) | 1815 | (push proc compilation-in-progress)) |
| 1811 | ;; No asynchronous processes available. | 1816 | ;; No asynchronous processes available. |
| 1812 | (message "Executing `%s'..." command) | 1817 | (message "Executing `%s'..." command) |
| 1813 | ;; Fake mode line display as if `start-process' were run. | 1818 | ;; Fake mode line display as if `start-process' were run. |
| @@ -2240,7 +2245,8 @@ commands of Compilation major mode are available. See | |||
| 2240 | ;; process is dead, we can delete it now. Otherwise it | 2245 | ;; process is dead, we can delete it now. Otherwise it |
| 2241 | ;; will stay around until M-x list-processes. | 2246 | ;; will stay around until M-x list-processes. |
| 2242 | (delete-process proc))) | 2247 | (delete-process proc))) |
| 2243 | (setq compilation-in-progress (delq proc compilation-in-progress))))) | 2248 | (setq compilation-in-progress (delq proc compilation-in-progress)) |
| 2249 | (compilation--update-in-progress-mode-line)))) | ||
| 2244 | 2250 | ||
| 2245 | (defun compilation-filter (proc string) | 2251 | (defun compilation-filter (proc string) |
| 2246 | "Process filter for compilation buffers. | 2252 | "Process filter for compilation buffers. |