Subject: bug#24620: 26.0.50; In dired: 'dired-do-compress-to' fails when filenames cotains space characters

From: José L. Doménech<[email-masked]>
Date: Thu, 27 Oct 2016 21:31:32 +0200

On Thu, 27 Oct 2016 20:51:15 +0200,
Noam Postavsky wrote:
>  
> Does passing non-nil for the LITERAL parameter to replace-regexp-in-string help?
> 
Yes indeed!

So the patch becomes something like:

diff -u /usr/local/share/emacs/26.0.50/lisp/dired-aux.orig.el /usr/local/share/emacs/26.0.50/lisp/dired-aux.el
--- /usr/local/share/emacs/26.0.50/lisp/dired-aux.orig.el	2016-10-27 15:50:50.428634418 +0200
+++ /usr/local/share/emacs/26.0.50/lisp/dired-aux.el	2016-10-27 21:24:29.022566630 +0200
@@ -1013,10 +1013,13 @@
            (when (zerop
                   (dired-shell-command
                    (replace-regexp-in-string
-                    "%o" out-file
+                    "%o" (shell-quote-argument out-file)
                     (replace-regexp-in-string
-                     "%i" (mapconcat #'file-name-nondirectory in-files " ")
-                     (cdr rule)))))
+                     "%i" (mapconcat (lambda (file-desc)
+                                       (shell-quote-argument
+                                        (file-name-nondirectory file-desc)))
+                                     in-files " ")
+                     (cdr rule) nil t) nil t)))
              (message "Compressed %d file(s) to %s"
                       (length in-files)
                       (file-name-nondirectory out-file)))))))

Diff finished.  Thu Oct 27 21:24:43 2016