From 940df63d2daf50b899a66cd1542bec0c0f3eaebf Mon Sep 17 00:00:00 2001 From: Po Lu Date: Sun, 8 Oct 2023 10:42:47 +0800 Subject: [PATCH] Port arc to Android * lisp/arc-mode.el (archive-zip-extract): Default to -q and -p when the Android system unzip is being employed. --- lisp/arc-mode.el | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el index 81d3dfc3432..c861c835966 100644 --- a/lisp/arc-mode.el +++ b/lisp/arc-mode.el @@ -231,13 +231,27 @@ Archive and member name will be added." :group 'archive) (defcustom archive-zip-extract - (cond ((executable-find "unzip") '("unzip" "-qq" "-c")) + (cond ((executable-find "unzip") + (if (and (eq system-type 'android) + ;; Mind that the unzip provided by Android + ;; does not understand -qq or -c, their + ;; functions being assumed by -q and -p + ;; respectively. Furthermore, the user + ;; might install an unzip executable + ;; distinct from the system-provided unzip, + ;; and such situations must be detected as + ;; well. + (member (executable-find "unzip") + '("/bin/unzip" + "/system/bin/unzip"))) + '("unzip" "-q" "-p") + '("unzip" "-qq" "-c"))) (archive-7z-program `(,archive-7z-program "x" "-so")) ((executable-find "pkunzip") '("pkunzip" "-e" "-o-")) (t '("unzip" "-qq" "-c"))) "Program and its options to run in order to extract a zip file member. -Extraction should happen to standard output. Archive and member name will -be added." +Extraction should happen to standard output. Archive and member +name will be added." :type '(list (string :tag "Program") (repeat :tag "Options" :inline t -- 2.39.2