unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* make dired-do-compress to use zip instead of gzip
@ 2008-04-07 18:39 Xah Lee
  0 siblings, 0 replies; only message in thread
From: Xah Lee @ 2008-04-07 18:39 UTC (permalink / raw)
  To: help-gnu-emacs

is it possible to customize the Z shortcut in dired (dired-do-
compress) so that it uses zip instead of gzip?

i started to code the following:

(defun dired-do-zip ()
  "Zip or unzip marked (or next ARG) files."
  (interactive)
  (mapc 'zipit (dired-get-marked-files))
)

(defun zipit (fpath)
  "Zip the file."
  (let (suffix)
    (setq suffix (file-name-extension fpath))
    (if (eq suffix ".zip")
        (progn
          (shell-command (concat "unzip" fpath))
          )
      (progn
        (shell-command (concat "zip " fpath " " fpath ".zip") )
        ))))

but it's unsatisfactory for several reasons... it doesn't delete the
original (and if i add code to delete, it gets quite involved in
making sure the archive is complete), it doesn't update dired, it
doesn't check for overwritting files, ... etc.

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-07 18:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-07 18:39 make dired-do-compress to use zip instead of gzip Xah Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).