[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/helm bbc6b36801 03/14: persistent compress/uncompress file
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/helm bbc6b36801 03/14: persistent compress/uncompress files from helm-ff |
Date: |
Fri, 15 Mar 2024 04:00:28 -0400 (EDT) |
branch: elpa/helm
commit bbc6b36801645a99801eaa1074b79b48e028b592
Author: Kiso Katsuyuki <katsuyuki2388@gmail.com>
Commit: Thierry Volpiatto <thievol@posteo.net>
persistent compress/uncompress files from helm-ff
---
helm-files.el | 36 ++++++++++++++++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/helm-files.el b/helm-files.el
index d55f5059e4..4cab674f18 100644
--- a/helm-files.el
+++ b/helm-files.el
@@ -5895,6 +5895,42 @@ and `dired-compress-files-alist'."
(cl-assert (string= base (substring subdir 0 (length base)))
nil "%s is not a subdirectory of %s" subdir base))))
+(defun helm-ff-quick-compress (_candidate)
+ "Compress or uncompress file CANDIDATE without quitting."
+ (with-helm-window
+ (let ((cfile))
+ (unwind-protect
+ (cl-loop for c in (helm-marked-candidates) do
+ (helm-preselect
+ (format helm-ff-last-expanded-candidate-regexp
+ (regexp-quote
+ (if (and helm-ff-transformer-show-only-basename
+ (not (helm-ff-dot-file-p c)))
+ (helm-basename c) c))))
+ (when (y-or-n-p
+ (format "Compress or uncompress file `%s'? "
+ (abbreviate-file-name c)))
+ ;; keep helm buffer
+ (setq cfile (save-window-excursion (dired-compress-file
c)))
+ (message nil)
+ (helm--remove-marked-and-update-mode-line c)))
+ (setq helm-marked-candidates nil
+ helm-visible-mark-overlays nil)
+ (helm-force-update
+ ;; select candidate before compress. If it can't, select candidate
after compress.
+ (let ((presel (helm-get-selection)))
+ (unless (file-exists-p presel)
+ (setq presel cfile))
+ (when presel
+ (format helm-ff-last-expanded-candidate-regexp
+ (regexp-quote (if (and
helm-ff-transformer-show-only-basename
+ (not (helm-ff-dot-file-p presel)))
+ (helm-basename presel) presel))))))))))
+
+(helm-make-persistent-command-from-action helm-ff-persistent-compress
+ "Compress or uncompress marked candidates without quitting."
+ 'quick-compress 'helm-ff-quick-compress)
+
;;; Delete and trash files
;;
;;
- [nongnu] elpa/helm 81dbbecd7c 02/14: compress/uncompress files from helm-ff, (continued)
- [nongnu] elpa/helm 81dbbecd7c 02/14: compress/uncompress files from helm-ff, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 03366cebc3 06/14: Fix uncompressing from persistent action and action, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 0d52f2d7bb 04/14: base-dir is modified, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 2c0436ff9e 05/14: Start making async compress actions, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 9cb7f35e9f 14/14: Notify compress keybindings in actions, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 392505b965 13/14: Remove comment (now fixed), ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 1573d28140 10/14: Fix mode-line message, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 167bccd65a 07/14: Prefer save-selected-window, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 753c2f46cc 01/14: compress files to archive from helm-ff, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 8e2aa5ba3f 09/14: Add compress marked file command from action, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm bbc6b36801 03/14: persistent compress/uncompress files from helm-ff,
ELPA Syncer <=
- [nongnu] elpa/helm 5c5fb8d5d3 08/14: Make helm-ff-compress-marked-files async as well, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 5652bf0fe7 11/14: Provide keybindings for compress commands, ELPA Syncer, 2024/03/15
- [nongnu] elpa/helm 8ebd1761d1 12/14: Use temporary-file-directory to setup error-file, ELPA Syncer, 2024/03/15