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

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

Re: [works on the comman line]


From: Emanuel Berg
Subject: Re: [works on the comman line]
Date: Mon, 21 Feb 2022 05:28:46 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Uwe Brauer wrote:

> (defun rcd-zip-file ()
>   "ZIP single file within Dired."
>   (interactive)
>   (let* ((file (car (dired-get-marked-files t)))
>        (zip-file (concat file ".zip")))
>     (when file
>       (start-process "ZIP" "ZIP" "zip" "-9" "-j" zip-file file)
>       (revert-buffer))))

But here -j (the short --junk-paths) doesn't don't add
anything (?) since the `t' in (dired-get-marked-files t) has
already removed the path ... so then why doesn't _that_ work?
Hm ...

But this works for me:

(defun dired-zip-files ()
  (interactive)
    (dolist (f (dired-get-marked-files))
      (start-process "zip" nil "zip" "-9" "--junk-path" (concat f ".zip") f)
      (revert-buffer) ))

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

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