help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: how to generate a zip file (not a directory) within dired


From: Jean Louis
Subject: Re: how to generate a zip file (not a directory) within dired
Date: Sun, 20 Feb 2022 15:59:36 +0300
User-agent: Mutt/2.2.0 (2022-02-12)

* Uwe Brauer <oub@mat.ucm.es> [2022-02-20 15:01]:
> 
> Hi
> 
> sometime I need to generate a zip file of a single file
> 
> I checked dired-compress-file-suffixes
> and it unzip zip files, but it seems not to generate them.
> 
> In 
> https://stackoverflow.com/questions/27567019/how-to-zip-files-recursively-in-emacs
> 
> There is a solution posted, but again it does not allow me to generate a
> zip file on a single file only on a whole directory (as the title suggests), 
> and that I don't
> need.
> 
> Any ideas? Yes I could call  dired-do-shell-command, but I want a simpler
> solution.

Solution is Z.

1) Adapt `dired-compress-file-alist' for ZIP files;
   example:

   (setf (alist-get "\\.zip\\'" dired-compress-file-alist) "zip -9 %o %i")

   which may be placed in your init file.

2) Adapt `dired-compress-file-default-suffix' to be .ZIP

   or alternatively make a function that will adapt it on the fly.

Then press Z on the file. I don't know if it will work on multiple files.

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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