]> git.eshelyaron.com Git - emacs.git/commitdiff
Support options with embedded whitespace in 'dired-listing-switches'
authorEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2017 10:02:55 +0000 (12:02 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Feb 2017 10:02:55 +0000 (12:02 +0200)
* lisp/dired.el (dired-listing-switches): Document how to quote
options with embedded whitespace.

* lisp/files.el (insert-directory): Use split-string-and-unquote
to support dired-listing-switches that specify command-line
options with embedded spaces.  (Bug#25485)

lisp/dired.el
lisp/files.el

index 350f6a7d2e3d36ff6a5271cc4f4b0928cd5b9282..2733372eb7b0575273c0b8a236d77dcc8f7f7054 100644 (file)
 May contain all other options that don't contradict `-l';
 may contain even `F', `b', `i' and `s'.  See also the variable
 `dired-ls-F-marks-symlinks' concerning the `F' switch.
+Options that include embedded whitespace must be quoted
+like this: \\\"--option=value with spaces\\\"; you can use
+`combine-and-quote-strings' to produce the correct quoting of
+each option.
 On systems such as MS-DOS and MS-Windows, which use `ls' emulation in Lisp,
 some of the `ls' switches are not supported; see the doc string of
 `insert-directory' in `ls-lisp.el' for more details."
index 2833ec5c12474329db41fec013d8d76c807c3979..03d6df4c037062545c56b81739a7303751904309 100644 (file)
@@ -6582,7 +6582,7 @@ normally equivalent short `-D' option is just passed on to
                              (unless (equal switches "")
                                ;; Split the switches at any spaces so we can
                                ;; pass separate options as separate args.
-                               (split-string switches)))
+                               (split-string-and-unquote switches)))
                            ;; Avoid lossage if FILE starts with `-'.
                            '("--")
                            (progn