** 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
;; --------------------------------------------
;; 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
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)
;; -------------------------------------------------------------------------
(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))
(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.