Commit ac89b32c authored by Juri Linkov's avatar Juri Linkov
Browse files

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.

Fixes: debbugs:8968
parent d66fef2b
......@@ -485,7 +485,7 @@ Just set shell-dir-cookie-re to an appropriate regexp.
** 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'.
......
2011-07-04 Juri Linkov <juri@jurta.org>
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 <monnier@iro.umontreal.ca>
* pcmpl-linux.el (pcomplete-pare-list): Re-add, from pcomplete.el
......
......@@ -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 @@ 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
(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 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(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 @@ This doesn't recover lost files, it just undoes changes in the buffer itself."
(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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment