[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm 65ee2e9709 5/9: Reorganize code by grouping all r5 mo
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm 65ee2e9709 5/9: Reorganize code by grouping all r5 mode-line code |
Date: |
Wed, 19 Jul 2023 13:02:13 -0400 (EDT) |
branch: elpa/helm
commit 65ee2e9709479cb27a39c506bb6e0ea9334caf8b
Author: Thierry Volpiatto <thievol@posteo.net>
Commit: Thierry Volpiatto <thievol@posteo.net>
Reorganize code by grouping all r5 mode-line code
---
helm-files.el | 60 +++++++++++++++++++++++++++++------------------------------
1 file changed, 30 insertions(+), 30 deletions(-)
diff --git a/helm-files.el b/helm-files.el
index f201e881e2..248c7b84f2 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -1303,6 +1303,36 @@ ACTION can be `rsync' or any action supported by
`helm-dired-action'."
;; nil) when process is not ready.
""))))))
+(defun helm-ff--rsync-mode-line-string (progbar proc)
+ ;; progbar == " 2,83G 92% 98,65MB/s 0:00:02 "
+ (let ((infos (split-string
+ (replace-regexp-in-string
+ "%" helm-rsync-percent-sign
+ progbar)
+ " " t))
+ percent info)
+ (if (eq helm-ff-rsync-progress-bar-style 'text)
+ (mapconcat 'identity infos " ")
+ (setq info
+ (cl-ecase helm-ff-rsync-progress-bar-info
+ (size (nth 0 infos))
+ (percent (nth 1 infos))
+ (speed (nth 2 infos))
+ (remain (nth 3 infos))))
+ (setq percent (and (string-match "\\([0-9]+\\)%" progbar)
+ (setq percent (string-to-number
+ (match-string 1 progbar)))))
+ (helm-aif percent
+ (format "%s%s%s%s"
+ (propertize (capitalize (process-name proc))
+ 'face 'helm-ff-rsync-progress-1)
+ (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 info 'face 'helm-ff-rsync-progress-1))
+ ""))))
+
(defun helm-rsync-mode-line (proc)
"Add Rsync progress to the mode line."
(or global-mode-string (setq global-mode-string '("")))
@@ -1416,36 +1446,6 @@ DEST must be a directory. SWITCHES when unspecified
default to
(unless helm-rsync-no-mode-line-update
(force-mode-line-update t))))
-(defun helm-ff--rsync-mode-line-string (progbar proc)
- ;; progbar == " 2,83G 92% 98,65MB/s 0:00:02 "
- (let ((infos (split-string
- (replace-regexp-in-string
- "%" helm-rsync-percent-sign
- progbar)
- " " t))
- percent info)
- (if (eq helm-ff-rsync-progress-bar-style 'text)
- (mapconcat 'identity infos " ")
- (setq info
- (cl-ecase helm-ff-rsync-progress-bar-info
- (size (nth 0 infos))
- (percent (nth 1 infos))
- (speed (nth 2 infos))
- (remain (nth 3 infos))))
- (setq percent (and (string-match "\\([0-9]+\\)%" progbar)
- (setq percent (string-to-number
- (match-string 1 progbar)))))
- (helm-aif percent
- (format "%s%s%s%s"
- (propertize (capitalize (process-name proc))
- 'face 'helm-ff-rsync-progress-1)
- (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 info 'face 'helm-ff-rsync-progress-1))
- ""))))
-
(defun helm-ff-kill-rsync-process (process)
"Kill rsync process PROCESS.
- [nongnu] elpa/helm updated (3dd059c9fb -> c0378b8574), ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm 4e1c515659 2/9: Fix helm-ff-rsync-progress-bar-style docstring, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm 2213caa435 4/9: Update helm-ff-rsync-progress-bar-info docstring, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm 3f71b2d3f9 1/9: Fix long lines, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm 64f96694ae 3/9: Use cl-ecase for helm-ff-rsync-progress-bar-info, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm bdd65f5e7f 7/9: Delete trailing white space, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm c0378b8574 9/9: Reindent, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm 65ee2e9709 5/9: Reorganize code by grouping all r5 mode-line code,
ELPA Syncer <=
- [nongnu] elpa/helm c36cddeb66 6/9: Rename helm-ff--rsync-progress-bar from helm-ff--rsync-mode-line-string, ELPA Syncer, 2023/07/19
- [nongnu] elpa/helm eae6cef0b6 8/9: Allow adding more infos at end of rsync prog bar, ELPA Syncer, 2023/07/19