masz opcji ...
rozpakować plik .zip, wystarczy dodać do zmiennej 'dired-compress-file-suffixes
(eval-after-load "dired-aux"
'(add-to-list 'dired-compress-file-suffixes
'("\\.zip\\'" ".zip" "unzip")))
Teraz kluczem w dired Z
rozpozna .zip rozszerz i rozpakuj archiwum .zip. Obsługiwane są teraz: gunzip
, bunzip2
, uncompress
i dictunzip
.
Jeśli chcesz zaznaczyć pliki i dodać je do archiwum .zip można użyć następujących aby z
związany zip zbiór oznakowanych pliki:
(eval-after-load "dired"
'(define-key dired-mode-map "z" 'dired-zip-files))
(defun dired-zip-files (zip-file)
"Create an archive containing the marked files."
(interactive "sEnter name of zip file: ")
;; create the zip file
(let ((zip-file (if (string-match ".zip$" zip-file) zip-file (concat zip-file ".zip"))))
(shell-command
(concat "zip "
zip-file
" "
(concat-string-list
(mapcar
'(lambda (filename)
(file-name-nondirectory filename))
(dired-get-marked-files))))))
(revert-buffer)
;; remove the mark on all the files "*" to " "
;; (dired-change-marks 42 ?\040)
;; mark zip file
;; (dired-mark-files-regexp (filename-to-regexp zip-file))
)
(defun concat-string-list (list)
"Return a string which is a concatenation of all elements of the list separated by spaces"
(mapconcat '(lambda (obj) (format "%s" obj)) list " "))
nie „Z” zrobić z -of-the-box? (lub zaznacz go za pomocą "m", a następnie naciśnij "Z"). Przypominam sobie, że trochę mi to pomogło. Widziałem to tutaj: http://xahlee.org/emacs/file_management.html – hatmatrix
'Z' skompresuje pliki, każdy z osobna. Nie dodaje ich do archiwum/zip. –
Wydaje concat-string-lista nie istnieje: Concat: Definicja Symbol Funkcja jest nieważna: concat-string-lista –