From: William Xu <william.xwl@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 15264@debbugs.gnu.org
Subject: bug#15264: 7z-Archive mode doesn't support 7za?
Date: Fri, 6 Sep 2013 11:29:41 +0800 [thread overview]
Message-ID: <CACzMC-DqGNj0dpzdyLQAKrB8wjMzXyvVakFDWwuiSyeuKaAfSg@mail.gmail.com> (raw)
In-Reply-To: <jwv1u54cppi.fsf-monnier+emacs@gnu.org>
[-- Attachment #1.1: Type: text/plain, Size: 334 bytes --]
2013/9/5 Stefan Monnier <monnier@iro.umontreal.ca>
> >> From man page:
> > 7za is a stand-alone executable. 7za handles less archive formats
> > than 7z, but does not need any others.
> > So it is possible where there is only 7za. Can we add 7za support?
>
> I don't see why not. Patch welcome.
>
Patch attached.
-William
[-- Attachment #1.2: Type: text/html, Size: 776 bytes --]
[-- Attachment #2: 0001-arc-mode.el-Add-7za-support.-bug-15264.patch --]
[-- Type: application/octet-stream, Size: 4335 bytes --]
From 155fc37402217e0784f2d93ed4775bab9626723e Mon Sep 17 00:00:00 2001
From: William Xu <william.xwl@gmail.com>
Date: Fri, 6 Sep 2013 11:24:11 +0800
Subject: [PATCH] arc-mode.el: Add 7za support. (bug #15264)
---
lisp/arc-mode.el | 23 ++++++++++++++---------
1 file changed, 14 insertions(+), 9 deletions(-)
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 5f001ad..a4f7015 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -218,9 +218,14 @@ Archive and member name will be added."
;; ------------------------------
;; Zip archive configuration
+(defvar archive-7z-program (let ((7z (or (executable-find "7z")
+ (executable-find "7za"))))
+ (when 7z
+ (file-name-nondirectory 7z))))
+
(defcustom archive-zip-extract
(cond ((executable-find "unzip") '("unzip" "-qq" "-c"))
- ((executable-find "7z") '("7z" "x" "-so"))
+ (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.
@@ -239,7 +244,7 @@ be added."
(defcustom archive-zip-expunge
(cond ((executable-find "zip") '("zip" "-d" "-q"))
- ((executable-find "7z") '("7z" "d"))
+ (archive-7z-program `(,archive-7z-program "d"))
((executable-find "pkzip") '("pkzip" "-d"))
(t '("zip" "-d" "-q")))
"Program and its options to run in order to delete zip file members.
@@ -252,7 +257,7 @@ Archive and member names will be added."
(defcustom archive-zip-update
(cond ((executable-find "zip") '("zip" "-q"))
- ((executable-find "7z") '("7z" "u"))
+ (archive-7z-program `(,archive-7z-program "u"))
((executable-find "pkzip") '("pkzip" "-u" "-P"))
(t '("zip" "-q")))
"Program and its options to run in order to update a zip file member.
@@ -266,7 +271,7 @@ file. Archive and member name will be added."
(defcustom archive-zip-update-case
(cond ((executable-find "zip") '("zip" "-q" "-k"))
- ((executable-find "7z") '("7z" "u"))
+ (archive-7z-program `(,archive-7z-program "u"))
((executable-find "pkzip") '("pkzip" "-u" "-P"))
(t '("zip" "-q" "-k")))
"Program and its options to run in order to update a case fiddled zip member.
@@ -321,7 +326,7 @@ Archive and member name will be added."
;; 7z archive configuration
(defcustom archive-7z-extract
- '("7z" "x" "-so")
+ `(,archive-7z-program "x" "-so")
"Program and its options to run in order to extract a 7z file member.
Extraction should happen to standard output. Archive and member name will
be added."
@@ -333,7 +338,7 @@ be added."
:group 'archive-7z)
(defcustom archive-7z-expunge
- '("7z" "d")
+ `(,archive-7z-program "d")
"Program and its options to run in order to delete 7z file members.
Archive and member names will be added."
:version "24.1"
@@ -344,7 +349,7 @@ Archive and member names will be added."
:group 'archive-7z)
(defcustom archive-7z-update
- '("7z" "u")
+ `(,archive-7z-program "u")
"Program and its options to run in order to update a 7z file member.
Options should ensure that specified directory will be put into the 7z
file. Archive and member name will be added."
@@ -1864,7 +1869,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(cond
((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
(archive-*-extract archive name archive-zip-extract))
- ((equal (car archive-zip-extract) "7z")
+ ((equal (car archive-zip-extract) archive-7z-program)
(let ((archive-7z-extract archive-zip-extract))
(archive-7z-extract archive name)))
(t
@@ -2088,7 +2093,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(file buffer-file-name)
(files ()))
(with-temp-buffer
- (call-process "7z" nil t nil "l" "-slt" file)
+ (call-process archive-7z-program nil t nil "l" "-slt" file)
(goto-char (point-min))
;; Four dashes start the meta info section that should be skipped.
;; Archive members start with more than four dashes.
--
1.8.1.2
next prev parent reply other threads:[~2013-09-06 3:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-15 7:06 bug#15264: 7z-Archive mode doesn't support 7za? William Xu
2013-09-04 20:11 ` Stefan Monnier
2013-09-06 3:29 ` William Xu [this message]
2013-09-06 15:03 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACzMC-DqGNj0dpzdyLQAKrB8wjMzXyvVakFDWwuiSyeuKaAfSg@mail.gmail.com \
--to=william.xwl@gmail.com \
--cc=15264@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.