emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vc-hgcmd d439b43 42/87: Running command indicator in ou


From: Stefan Monnier
Subject: [elpa] externals/vc-hgcmd d439b43 42/87: Running command indicator in output buffer mode line
Date: Sat, 5 Jun 2021 16:11:43 -0400 (EDT)

branch: externals/vc-hgcmd
commit d439b43ac3c9f0f2e16c89ca35201317ab184b75
Author: muffinmad <andreyk.mad@gmail.com>
Commit: muffinmad <andreyk.mad@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]