GNU bug report logs -
#24620
26.0.50; In dired: 'dired-do-compress-to' fails when filenames cotains space characters
Previous Next
Reported by: José L. Doménech <j_l_domenech <at> yahoo.com>
Date: Wed, 5 Oct 2016 07:07:02 UTC
Severity: minor
Tags: fixed, patch
Found in version 26.0.50
Fixed in version 26
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
tags 24620 patch
quit
José L. Doménech <domenechjosel <at> gmail.com> writes:
> On Fri, 28 Oct 2016 01:14:49 +0200,
> npostavs <at> users.sourceforge.net wrote:
>>
>>
>> That looks pretty good. I think it would be even nicer to use the
>> `format-spec' function instead of calling `replace-regexp-in-string'
>> twice.
>>
>>
> Here are the changes:
>
> --- dired-aux.orig.el 2016-10-27 15:50:50.428634418 +0200
> +++ dired-aux.el 2016-10-28 09:01:08.413024427 +0200
> @@ -1012,11 +1012,15 @@
> (t
> (when (zerop
> (dired-shell-command
> - (replace-regexp-in-string
> - "%o" out-file
> - (replace-regexp-in-string
> - "%i" (mapconcat #'file-name-nondirectory in-files " ")
> - (cdr rule)))))
> + (format-spec
> + (cdr rule)
> + (list (cons ?o (shell-quote-argument out-file))
> + (cons ?i
> + (mapconcat
> + (lambda (filename)
> + (shell-quote-argument
> + (file-name-nondirectory filename)))
> + in-files " "))))))
> (message "Compressed %d file(s) to %s"
> (length in-files)
> (file-name-nondirectory out-file)))))))
>
> Diff finished. Fri Oct 28 09:01:25 2016
Looks good. Would you like to try writing a commit message too? (see
"Commit messages" in CONTRIBUTE).
Just a minor style suggestion: In cases like these, I like to use the
backquote syntax instead of explicit (list (cons ...)) because it saves
a bit of indentation.
Have you signed copyrigh assignment for Emacs? This patch is small
enough to merge anyway, but if you'll be writing more patches in the
future, consider filling out the form at
git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.program
to get the process started.
This bug report was last modified 8 years and 285 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.