aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Xu2013-09-06 11:02:40 -0400
committerStefan Monnier2013-09-06 11:02:40 -0400
commit816244a2ab34d651371bf8045eac14320587beda (patch)
treed3c238bae68328539eac52f3a005c35adb89d43d
parent306d67bd4c0161521c465c64d9cf18d1c768e174 (diff)
downloademacs-816244a2ab34d651371bf8045eac14320587beda.tar.gz
emacs-816244a2ab34d651371bf8045eac14320587beda.zip
* lisp/arc-mode.el: Add support for 7za.
(archive-7z-program): New var. (archive-zip-extract, archive-zip-expunge, archive-zip-update) (archive-zip-update-case, archive-7z-extract, archive-7z-expunge) (archive-7z-update, archive-zip-extract, archive-7z-summarize): Use it. Fixes: debbugs:15264
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/arc-mode.el23
2 files changed, 22 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 03352a93e6f..3c1a97b34b9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12013-09-06 William Xu <william.xwl@gmail.com>
2
3 * arc-mode.el: Add support for 7za (bug#15264).
4 (archive-7z-program): New var.
5 (archive-zip-extract, archive-zip-expunge, archive-zip-update)
6 (archive-zip-update-case, archive-7z-extract, archive-7z-expunge)
7 (archive-7z-update, archive-zip-extract, archive-7z-summarize): Use it.
8
12013-09-06 Michael Albinus <michael.albinus@gmx.de> 92013-09-06 Michael Albinus <michael.albinus@gmx.de>
2 10
3 Remove URL syntax. 11 Remove URL syntax.
diff --git a/lisp/arc-mode.el b/lisp/arc-mode.el
index 5f001ad977b..a4f7015c844 100644
--- a/lisp/arc-mode.el
+++ b/lisp/arc-mode.el
@@ -218,9 +218,14 @@ Archive and member name will be added."
218;; ------------------------------ 218;; ------------------------------
219;; Zip archive configuration 219;; Zip archive configuration
220 220
221(defvar archive-7z-program (let ((7z (or (executable-find "7z")
222 (executable-find "7za"))))
223 (when 7z
224 (file-name-nondirectory 7z))))
225
221(defcustom archive-zip-extract 226(defcustom archive-zip-extract
222 (cond ((executable-find "unzip") '("unzip" "-qq" "-c")) 227 (cond ((executable-find "unzip") '("unzip" "-qq" "-c"))
223 ((executable-find "7z") '("7z" "x" "-so")) 228 (archive-7z-program `(,archive-7z-program "x" "-so"))
224 ((executable-find "pkunzip") '("pkunzip" "-e" "-o-")) 229 ((executable-find "pkunzip") '("pkunzip" "-e" "-o-"))
225 (t '("unzip" "-qq" "-c"))) 230 (t '("unzip" "-qq" "-c")))
226 "Program and its options to run in order to extract a zip file member. 231 "Program and its options to run in order to extract a zip file member.
@@ -239,7 +244,7 @@ be added."
239 244
240(defcustom archive-zip-expunge 245(defcustom archive-zip-expunge
241 (cond ((executable-find "zip") '("zip" "-d" "-q")) 246 (cond ((executable-find "zip") '("zip" "-d" "-q"))
242 ((executable-find "7z") '("7z" "d")) 247 (archive-7z-program `(,archive-7z-program "d"))
243 ((executable-find "pkzip") '("pkzip" "-d")) 248 ((executable-find "pkzip") '("pkzip" "-d"))
244 (t '("zip" "-d" "-q"))) 249 (t '("zip" "-d" "-q")))
245 "Program and its options to run in order to delete zip file members. 250 "Program and its options to run in order to delete zip file members.
@@ -252,7 +257,7 @@ Archive and member names will be added."
252 257
253(defcustom archive-zip-update 258(defcustom archive-zip-update
254 (cond ((executable-find "zip") '("zip" "-q")) 259 (cond ((executable-find "zip") '("zip" "-q"))
255 ((executable-find "7z") '("7z" "u")) 260 (archive-7z-program `(,archive-7z-program "u"))
256 ((executable-find "pkzip") '("pkzip" "-u" "-P")) 261 ((executable-find "pkzip") '("pkzip" "-u" "-P"))
257 (t '("zip" "-q"))) 262 (t '("zip" "-q")))
258 "Program and its options to run in order to update a zip file member. 263 "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."
266 271
267(defcustom archive-zip-update-case 272(defcustom archive-zip-update-case
268 (cond ((executable-find "zip") '("zip" "-q" "-k")) 273 (cond ((executable-find "zip") '("zip" "-q" "-k"))
269 ((executable-find "7z") '("7z" "u")) 274 (archive-7z-program `(,archive-7z-program "u"))
270 ((executable-find "pkzip") '("pkzip" "-u" "-P")) 275 ((executable-find "pkzip") '("pkzip" "-u" "-P"))
271 (t '("zip" "-q" "-k"))) 276 (t '("zip" "-q" "-k")))
272 "Program and its options to run in order to update a case fiddled zip member. 277 "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."
321;; 7z archive configuration 326;; 7z archive configuration
322 327
323(defcustom archive-7z-extract 328(defcustom archive-7z-extract
324 '("7z" "x" "-so") 329 `(,archive-7z-program "x" "-so")
325 "Program and its options to run in order to extract a 7z file member. 330 "Program and its options to run in order to extract a 7z file member.
326Extraction should happen to standard output. Archive and member name will 331Extraction should happen to standard output. Archive and member name will
327be added." 332be added."
@@ -333,7 +338,7 @@ be added."
333 :group 'archive-7z) 338 :group 'archive-7z)
334 339
335(defcustom archive-7z-expunge 340(defcustom archive-7z-expunge
336 '("7z" "d") 341 `(,archive-7z-program "d")
337 "Program and its options to run in order to delete 7z file members. 342 "Program and its options to run in order to delete 7z file members.
338Archive and member names will be added." 343Archive and member names will be added."
339 :version "24.1" 344 :version "24.1"
@@ -344,7 +349,7 @@ Archive and member names will be added."
344 :group 'archive-7z) 349 :group 'archive-7z)
345 350
346(defcustom archive-7z-update 351(defcustom archive-7z-update
347 '("7z" "u") 352 `(,archive-7z-program "u")
348 "Program and its options to run in order to update a 7z file member. 353 "Program and its options to run in order to update a 7z file member.
349Options should ensure that specified directory will be put into the 7z 354Options should ensure that specified directory will be put into the 7z
350file. Archive and member name will be added." 355file. 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."
1864 (cond 1869 (cond
1865 ((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip")) 1870 ((member-ignore-case (car archive-zip-extract) '("pkunzip" "pkzip"))
1866 (archive-*-extract archive name archive-zip-extract)) 1871 (archive-*-extract archive name archive-zip-extract))
1867 ((equal (car archive-zip-extract) "7z") 1872 ((equal (car archive-zip-extract) archive-7z-program)
1868 (let ((archive-7z-extract archive-zip-extract)) 1873 (let ((archive-7z-extract archive-zip-extract))
1869 (archive-7z-extract archive name))) 1874 (archive-7z-extract archive name)))
1870 (t 1875 (t
@@ -2088,7 +2093,7 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
2088 (file buffer-file-name) 2093 (file buffer-file-name)
2089 (files ())) 2094 (files ()))
2090 (with-temp-buffer 2095 (with-temp-buffer
2091 (call-process "7z" nil t nil "l" "-slt" file) 2096 (call-process archive-7z-program nil t nil "l" "-slt" file)
2092 (goto-char (point-min)) 2097 (goto-char (point-min))
2093 ;; Four dashes start the meta info section that should be skipped. 2098 ;; Four dashes start the meta info section that should be skipped.
2094 ;; Archive members start with more than four dashes. 2099 ;; Archive members start with more than four dashes.