From 3cc114a60b665dbea5912b4751b0ddf580632a0e Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Mon, 6 Jan 2020 01:47:07 +0900 Subject: [PATCH] Use aunpack to unpack zip if available --- emacs.el | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/emacs.el b/emacs.el index 31b534f..452c945 100644 --- a/emacs.el +++ b/emacs.el @@ -2059,12 +2059,7 @@ ARG is num to show, or defaults to 7." '(file-readable-p file) (delete-file file))))) - (when (autoload-eval-lazily 'pack '(dired-do-pack-or-unpack pack-pack) - (defvar pack-program-alist) - (add-to-list 'pack-program-alist - '("\\.txz\\'" :pack "tar -cJf" :unpack "tar -xf"))) - (set-variable 'pack-silence - t) + (when (fboundp 'pack-dired-dwim) (with-eval-after-load 'dired (define-key dired-mode-map "P" 'pack-dired-dwim))) @@ -2101,6 +2096,22 @@ ARG is num to show, or defaults to 7." (defvar dired-mode-map (make-sparse-keymap)) (define-key dired-mode-map "G" 'my-dired-git-ls-files)) +(with-eval-after-load 'pack + (set-variable 'pack-silence + t) + (defvar pack-program-alist) + (add-to-list 'pack-program-alist + '("\\.txz\\'" :pack "tar -cJf" :unpack "tar -xf")) + + (when (executable-find "aunpack") + (add-to-list 'pack-program-alist + ' ("\\.zip\\'" + :pack ("zip" "-r" archive sources) + :pack-append ("zip" "-r" archive sources) + :unpack ("aunpack" archive)))) + ) + + ;; (define-minor-mode my-dired-glob-filter) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;