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

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

[nongnu] elpa/helm 7fbed3bd0c 1/2: Display rsync progress bar in pixels


From: ELPA Syncer
Subject: [nongnu] elpa/helm 7fbed3bd0c 1/2: Display rsync progress bar in pixels
Date: Tue, 18 Jul 2023 04:06:35 -0400 (EDT)

branch: elpa/helm
commit 7fbed3bd0c72eed757b7e396f5fde7fc84f04dd9
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>

    Display rsync progress bar in pixels
    
    Now in mode-line we have [proc bar percentage].
---
 helm-files.el | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/helm-files.el b/helm-files.el
index c4021a123e..91450e6a0a 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -1012,8 +1012,8 @@ If you still want to use it, helm is still providing 
`helm-marked-files-in-dired
 
 (defface helm-ff-rsync-progress-1
   `((t ,@(and (>= emacs-major-version 27) '(:extend t))
-       :background "orange" :foreground "black"))
-  "Face used for rsync progress bar percentage."
+       :background "CadetBlue" :foreground "black"))
+  "Face used for rsync progress bar percentage and proc name."
   :group 'helm-files-faces)
 
 (defface helm-ff-rsync-progress-2
@@ -1390,7 +1390,7 @@ DEST must be a directory.  SWITCHES when unspecified 
default to
                        (buffer-substring-no-properties
                         (point) (point-at-eol))))))
       ;; Now format the string for the mode-line.
-      (let ((ml-str (helm-ff--rsync-mode-line-string progbar)))
+      (let ((ml-str (helm-ff--rsync-mode-line-string progbar proc)))
         (setq ml-str (propertize ml-str 'help-echo
                                  (format "%s->%s" (process-name proc) fname)))
         ;; Now associate the formatted
@@ -1401,9 +1401,9 @@ DEST must be a directory.  SWITCHES when unspecified 
default to
                 (push (cons proc ml-str) helm-rsync-progress-str-alist)))))
     ;; Finally update mode-line.
     (unless helm-rsync-no-mode-line-update
-      (force-mode-line-update))))
+      (force-mode-line-update t))))
 
-(defun helm-ff--rsync-mode-line-string (progbar)
+(defun helm-ff--rsync-mode-line-string (progbar proc)
   (let (percent) 
     (if (eq helm-ff-rsync-progress-bar-style 'text)
         (mapconcat 'identity
@@ -1415,12 +1415,13 @@ DEST must be a directory.  SWITCHES when unspecified 
default to
                    " ")
       (setq percent (and (string-match "\\([0-9]+\\)%" progbar)
                          (setq percent (string-to-number (match-string 1 
progbar)))))
-      (helm-aif (and percent (ceiling (/ percent 4)))
-          (format "%s%s%s"
-                  (propertize (format "%s%s" percent helm-rsync-percent-sign)
+      (helm-aif percent
+          (format "%s%s%s%s"
+                  (propertize (capitalize (process-name proc))
                               'face 'helm-ff-rsync-progress-1)
-                  (propertize (make-string it ? ) 'face 
'helm-ff-rsync-progress-2)
-                  (propertize (make-string (- 25 it) ? ) 'face 
'helm-ff-rsync-progress-3))
+                  (propertize " " 'display `(space :width ,(list it)) 'face 
'helm-ff-rsync-progress-2)
+                  (propertize " " 'display `(space :width ,(list (- 100 
percent))) 'face 'helm-ff-rsync-progress-3)
+                  (propertize (format "%s%s" percent helm-rsync-percent-sign) 
'face 'helm-ff-rsync-progress-1))
         ""))))
     
 (defun helm-ff-kill-rsync-process (process)



reply via email to

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