branch: externals/vc-hgcmd commit d439b43ac3c9f0f2e16c89ca35201317ab184b75 Author: muffinmad <andreyk....@gmail.com> Commit: muffinmad <andreyk....@gmail.com>
Running command indicator in output buffer mode line --- vc-hgcmd.el | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vc-hgcmd.el b/vc-hgcmd.el index 3cd74e3..32c7e2e 100644 --- a/vc-hgcmd.el +++ b/vc-hgcmd.el @@ -246,9 +246,11 @@ Insert output to process buffer and check if amount of data is enought to parse (let ((output-buffer (vc-hgcmd--command-output-buffer current-command)) (callback (vc-hgcmd--command-callback current-command)) (args (vc-hgcmd--command-callback-args current-command))) - (when (and callback (or (stringp output-buffer) (buffer-live-p output-buffer))) + (when (or (stringp output-buffer) (buffer-live-p output-buffer)) (with-current-buffer output-buffer - (if args (funcall callback args) (funcall callback)))))) + (setq mode-line-process nil) + (when callback + (if args (funcall callback args) (funcall callback))))))) ;; TODO: cmdserver clients must handle I and L channels (t (error (format "Hgcmd unhandled channel %c" channel))))) t)))))))) @@ -344,8 +346,16 @@ Insert output to process buffer and check if amount of data is enought to parse (user-error "Hg command \"%s\" is active" (car (vc-hgcmd--command-command vc-hgcmd--current-command)))) (when (process-live-p process) (let ((tty (process-tty-name process)) - (command (vc-hgcmd--command-command cmd))) + (command (vc-hgcmd--command-command cmd)) + (output-buffer (vc-hgcmd--command-output-buffer cmd))) (setq vc-hgcmd--current-command cmd) + (when (or (stringp output-buffer) (buffer-live-p output-buffer)) + (with-current-buffer output-buffer + (setq mode-line-process + (propertize (format " [running %s...]" (car (vc-hgcmd--command-command cmd))) + 'face 'mode-line-emphasis + 'help-echo + "A command is in progress in this buffer")))) (process-send-string process (concat