emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r104953: Add 7z operations to delete


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r104953: Add 7z operations to delete and save changed members.
Date: Tue, 05 Jul 2011 01:11:40 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 104953
fixes bug(s): http://debbugs.gnu.org/8968
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Tue 2011-07-05 01:11:40 +0300
message:
  Add 7z operations to delete and save changed members.
  * lisp/arc-mode.el (archive-7z-expunge, archive-7z-update):
  New defcustoms.
  (archive-7z-write-file-member): New function.
  (archive-7z-summarize): Fix the number of dashes in the
  listing output.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/arc-mode.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2011-07-02 04:27:41 +0000
+++ b/etc/NEWS  2011-07-04 22:11:40 +0000
@@ -485,7 +485,7 @@
 
 ** FIXME: xdg-open for browse-url and reportbug, 2010/08.
 
-** Archive Mode has basic support to browse 7z archives.
+** Archive Mode has basic support to browse and update 7z archives.
 
 ** browse-url has gotten a new variable that is used for mailto: URLs,
 `browse-url-mailto-function', which defaults to `browse-url-mail'.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-04 20:45:22 +0000
+++ b/lisp/ChangeLog    2011-07-04 22:11:40 +0000
@@ -1,3 +1,12 @@
+2011-07-04  Juri Linkov  <address@hidden>
+
+       Add 7z operations to delete and save changed members (bug#8968).
+       * arc-mode.el (archive-7z-expunge, archive-7z-update):
+       New defcustoms.
+       (archive-7z-write-file-member): New function.
+       (archive-7z-summarize): Fix the number of dashes in the
+       listing output.
+
 2011-07-04  Stefan Monnier  <address@hidden>
 
        * pcmpl-linux.el (pcomplete-pare-list): Re-add, from pcomplete.el

=== modified file 'lisp/arc-mode.el'
--- a/lisp/arc-mode.el  2011-04-19 13:44:55 +0000
+++ b/lisp/arc-mode.el  2011-07-04 22:11:40 +0000
@@ -55,9 +55,9 @@
 ;;                     --------------------------------------------
 ;; View listing                Intern  Intern  Intern  Intern  Y       Y
 ;; Extract member      Y       Y       Y       Y       Y       Y
-;; Save changed member Y       Y       Y       Y       N       N
+;; Save changed member Y       Y       Y       Y       N       Y
 ;; Add new member      N       N       N       N       N       N
-;; Delete member       Y       Y       Y       Y       N       N
+;; Delete member       Y       Y       Y       Y       N       Y
 ;; Rename member       Y       Y       N       N       N       N
 ;; Chmod               -       Y       Y       -       N       N
 ;; Chown               -       Y       -       -       N       N
@@ -323,9 +323,30 @@
 Extraction should happen to standard output.  Archive and member name will
 be added."
   :type '(list (string :tag "Program")
-               (repeat :tag "Options"
-                       :inline t
-                       (string :format "%v")))
+              (repeat :tag "Options"
+                      :inline t
+                      (string :format "%v")))
+  :group 'archive-7z)
+
+(defcustom archive-7z-expunge
+  '("7z" "d")
+  "Program and its options to run in order to delete 7z file members.
+Archive and member names will be added."
+  :type '(list (string :tag "Program")
+              (repeat :tag "Options"
+                      :inline t
+                      (string :format "%v")))
+  :group 'archive-7z)
+
+(defcustom archive-7z-update
+  '("7z" "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."
+  :type '(list (string :tag "Program")
+              (repeat :tag "Options"
+                      :inline t
+                      (string :format "%v")))
   :group 'archive-7z)
 
 ;; -------------------------------------------------------------------------
@@ -2037,7 +2058,9 @@
     (with-temp-buffer
       (call-process "7z" nil t nil "l" "-slt" file)
       (goto-char (point-min))
-      (re-search-forward "^-+\n")
+      ;; Four dashes start the meta info section that should be skipped.
+      ;; Archive members start with more than four dashes.
+      (re-search-forward "^-----+\n")
       (while (re-search-forward "^Path = \\(.*\\)\n" nil t)
         (goto-char (match-end 0))
         (let ((name (match-string 1))
@@ -2084,6 +2107,12 @@
          (message "%s" (buffer-string)))
        (delete-file tmpfile)))))
 
+(defun archive-7z-write-file-member (archive descr)
+  (archive-*-write-file-member
+   archive
+   descr
+   archive-7z-update))
+
 ;; -------------------------------------------------------------------------
 ;;; Section `ar' archives.
 


reply via email to

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