diff options
author | Oleh Krehel <ohwoeowho@gmail.com> | 2016-08-29 10:35:34 +0200 |
---|---|---|
committer | Oleh Krehel <ohwoeowho@gmail.com> | 2016-08-29 10:35:34 +0200 |
commit | 67a01490934ba5a43b68b7141b20bc8e636ed7c5 (patch) | |
tree | 6186534b619bef44c4b732a9ae174ab9953c3815 | |
parent | 5214cc8e9d2a9cf461b8307daa2c15a5c9c69049 (diff) | |
download | emacs-67a01490934ba5a43b68b7141b20bc8e636ed7c5.tar.gz |
Make dired-do-compress understand files with spaces in them
* lisp/dired-aux.el (dired-compress-file): Add `shell-quote-argument'
and `literal' flag to `replace-regexp-in-string'.
-rw-r--r-- | lisp/dired-aux.el | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 4bdded35fe5..9e0943ac7f0 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -1049,10 +1049,12 @@ Return nil if no change in files." (prog1 (setq newname (file-name-as-directory newname)) (dired-shell-command (replace-regexp-in-string - "%o" newname + "%o" (shell-quote-argument newname) (replace-regexp-in-string - "%i" file - command)))) + "%i" (shell-quote-argument file) + command + nil t) + nil t))) ;; We found an uncompression rule. (when (not (dired-check-process @@ -1072,10 +1074,12 @@ Return nil if no change in files." (default-directory (file-name-directory file))) (dired-shell-command (replace-regexp-in-string - "%o" out-name + "%o" (shell-quote-argument out-name) (replace-regexp-in-string - "%i" (file-name-nondirectory file) - (cadr suffix)))) + "%i" (shell-quote-argument (file-name-nondirectory file)) + (cadr suffix) + nil t) + nil t)) out-name))) (let ((out-name (concat file ".gz"))) (and (or (not (file-exists-p out-name)) |