emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r114157: * lisp/arc-mode.el: Add support for 7za.


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r114157: * lisp/arc-mode.el: Add support for 7za.
Date: Fri, 06 Sep 2013 15:02:41 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114157
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15264
author: William Xu <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2013-09-06 11:02:40 -0400
message:
  * 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.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/arc-mode.el               arcmode.el-20091113204419-o5vbwnq5f7feedwu-877
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-09-06 08:23:30 +0000
+++ b/lisp/ChangeLog    2013-09-06 15:02:40 +0000
@@ -1,3 +1,11 @@
+2013-09-06  William Xu  <address@hidden>
+
+       * arc-mode.el: Add support for 7za (bug#15264).
+       (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.
+
 2013-09-06  Michael Albinus  <address@hidden>
 
        Remove URL syntax.

=== modified file 'lisp/arc-mode.el'
--- a/lisp/arc-mode.el  2013-06-20 11:45:45 +0000
+++ b/lisp/arc-mode.el  2013-09-06 15:02:40 +0000
@@ -218,9 +218,14 @@
 ;; ------------------------------
 ;; 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 @@
 
 (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 @@
 
 (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 @@
 
 (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 @@
 ;; 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 @@
   :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 @@
   :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 @@
   (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 @@
        (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]