all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "José L. Doménech" <domenechjosel@gmail.com>
To: 24620@debbugs.gnu.org
Subject: bug#24620: 26.0.50; In dired: 'dired-do-compress-to' fails when filenames cotains space	characters
Date: Thu, 27 Oct 2016 16:03:47 +0200	[thread overview]
Message-ID: <878tt9zy64.wl-domenechjosel@gmail.com> (raw)
In-Reply-To: <87ponfi8ay.wl-j_l_domenech@yahoo.com>

[-- Attachment #1: Type: text/plain, Size: 374 bytes --]

I wrote a little patch to get a workaround around dired having some trouble compressing files with space characters in its name (bug #24620).

I am not sure if this will useful to someone. Please NOTE that I am using apostrophes to surround the file name's. While it works on my system (GNU/Linux) it could not work on other systems.

Best Regards:
José L. Doménech


[-- Attachment #2: dired-aux.el.patch --]
[-- Type: text/plain, Size: 1434 bytes --]

diff -u dired-aux.el dired-aux-mod.el
--- dired-aux.el	2016-10-27 15:50:50.428634418 +0200
+++ dired-aux-mod.el	2016-10-27 15:49:07.075635431 +0200
@@ -974,10 +974,10 @@
 ARGS are command switches passed to PROGRAM.")
 
 (defvar dired-compress-files-alist
-  '(("\\.tar\\.gz\\'" . "tar -c %i | gzip -c9 > %o")
-    ("\\.tar\\.bz2\\'" . "tar -c %i | bzip2 -c9 > %o")
-    ("\\.tar\\.xz\\'" . "tar -c %i | xz -c9 > %o")
-    ("\\.zip\\'" . "zip %o -r --filesync %i"))
+  '(("\\.tar\\.gz\\'" . "tar -c %i | gzip -c9 > '%o'")
+    ("\\.tar\\.bz2\\'" . "tar -c %i | bzip2 -c9 > '%o'")
+    ("\\.tar\\.xz\\'" . "tar -c %i | xz -c9 > '%o'")
+    ("\\.zip\\'" . "zip '%o' -r --filesync %i"))
   "Control the compression shell command for `dired-do-compress-to'.
 
 Each element is (REGEXP . CMD), where REGEXP is the name of the
@@ -1015,7 +1015,9 @@
                    (replace-regexp-in-string
                     "%o" out-file
                     (replace-regexp-in-string
-                     "%i" (mapconcat #'file-name-nondirectory in-files " ")
+                     "%i" (mapconcat (lambda (file-desc)
+                                       (concat "'"
+                                               (file-name-nondirectory file-desc) "'")) in-files " ")
                      (cdr rule)))))
              (message "Compressed %d file(s) to %s"
                       (length in-files)

Diff finished.  Thu Oct 27 15:53:44 2016

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



  reply	other threads:[~2016-10-27 14:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05  7:06 bug#24620: 26.0.50; In dired: 'dired-do-compress-to' fails when filenames cotains space characters José L. Doménech
2016-10-27 14:03 ` José L. Doménech [this message]
2016-10-27 17:19   ` Eli Zaretskii
2016-10-27 17:34   ` Michael Albinus
2016-10-27 18:39     ` José L. Doménech
2016-10-27 18:51       ` Noam Postavsky
2016-10-27 19:29         ` José L. Doménech
2016-10-27 23:14           ` npostavs
2016-10-28  7:06             ` José L. Doménech
2016-10-29  2:06               ` npostavs
2016-10-29  9:17                 ` José L. Doménech
2016-10-29 12:06                   ` npostavs
2016-10-29 18:40                     ` José L. Doménech
2016-10-29 19:42                       ` José L. Doménech
2016-10-30  1:39                       ` npostavs
2016-10-30  8:33                         ` José L. Doménech
2016-10-29 18:41                     ` José L. Doménech
2016-10-28  9:22             ` bug#24620: Forward: " José L. Doménech
2016-10-27 19:31         ` José L. Doménech

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878tt9zy64.wl-domenechjosel@gmail.com \
    --to=domenechjosel@gmail.com \
    --cc=24620@debbugs.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.