emacs-diffs
[Top][All Lists]
Advanced

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

master 59698d9: Mention the problems with newlines in Dired


From: Lars Ingebrigtsen
Subject: master 59698d9: Mention the problems with newlines in Dired
Date: Mon, 22 Feb 2021 16:39:48 -0500 (EST)

branch: master
commit 59698d924e541b1768a61caafd0dfa40b5ed4b34
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Mention the problems with newlines in Dired
    
    * doc/emacs/dired.texi (Dired Enter): Mention newlines and what to
    do about them.
    
    * lisp/dired.el (dired-listing-switches): Mention newlines
    (bug#46705).
---
 doc/emacs/dired.texi | 6 ++++++
 lisp/dired.el        | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 34d12ac..f57606d 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -129,6 +129,12 @@ options (that is, single characters) requiring no 
arguments, and long
 options (starting with @samp{--}) whose arguments are specified with
 @samp{=}.
 
+  Dired does not handle files that have names with embedded newline
+characters well.  If you have many such files, you may consider adding
+@samp{-b} to @code{dired-listing-switches}.  This will quote all
+special characters and allow Dired to handle them better.  (You can
+also use the @kbd{C-u C-x d} command to add @samp{-b} temporarily.)
+
 @vindex dired-switches-in-mode-line
   Dired displays in the mode line an indication of what were the
 switches used to invoke @command{ls}.  By default, Dired will try to
diff --git a/lisp/dired.el b/lisp/dired.el
index 553fb64..4f1c3de 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -60,10 +60,15 @@
 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.
+
+If you have files with names with embedded newline characters, adding
+`b' to the switches will allow Dired to handle those files better.
+
 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."



reply via email to

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