From: Jean Louis <bugs@gnu.support>
To: help-gnu-emacs@gnu.org
Subject: Re: how to generate a zip file (not a directory) within dired
Date: Sun, 20 Feb 2022 15:59:36 +0300 [thread overview]
Message-ID: <YhI7OEwfZ0+KzSLo@protected.localdomain> (raw)
In-Reply-To: <87pmnhlwnr.fsf@mat.ucm.es>
* 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/
next prev parent reply other threads:[~2022-02-20 12:59 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-20 9:22 how to generate a zip file (not a directory) within dired Uwe Brauer
2022-02-20 12:59 ` Jean Louis [this message]
2022-02-20 13:16 ` Uwe Brauer
2022-02-20 13:32 ` [a directory is also created] (was: how to generate a zip file (not a directory) within dired) Uwe Brauer
2022-02-20 13:42 ` [works on the comman line] (was: [a directory is also created]) Uwe Brauer
2022-02-20 14:08 ` Jean Louis
2022-02-20 15:41 ` [works on the comman line] Uwe Brauer
2022-02-20 15:46 ` Uwe Brauer
2022-02-21 4:28 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-21 19:38 ` Uwe Brauer
2022-02-26 0:47 ` Emanuel Berg via Users list for the GNU Emacs text editor
2022-02-21 4:18 ` [works on the comman line] (was: [a directory is also created]) Emanuel Berg via Users list for the GNU Emacs text editor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YhI7OEwfZ0+KzSLo@protected.localdomain \
--to=bugs@gnu.support \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).