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

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

bug#24620: 26.0.50; In dired: 'dired-do-compress-to' fails when filename


From: José L . Doménech
Subject: bug#24620: 26.0.50; In dired: 'dired-do-compress-to' fails when filenames cotains space characters
Date: Thu, 27 Oct 2016 21:31:32 +0200
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/26.0.50 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

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





reply via email to

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