The error messages are now displayed in a popped up buffer instead
of being output in the Dired buffer and signalling an error. The
file name bounds in Dired entries are now determined solely by the
offsets calculated by 'ls' with the --dired option and
consequently Dired now reliably recognizes file names that contain
a newline (bug#80499).
* etc/NEWS: Announce new Dired handling of errors from 'ls'.
* lisp/dired.el (dired-internal-noselect): Check Dired buffer for
file entries and if there are none kill the buffer to prevent
displaying a Dired buffer with no file entries.
(dired--ls-error-buffer): New variable.
(dired--display-ls-error): New function.
(dired, dired-other-window, dired-other-frame, dired-other-tab):
Use it to pop up buffer with error message emitted by 'ls'.
* lisp/files.el (insert-directory-clean): Remove the code that
treats lines beginning at column 0 in a Dired buffer as error
lines and consequently also remove the code using these lines to
adjust the offsets specifying the bounds of the file name in the
Dired entries. If the buffer contains a //DIRED-OPTIONS// line
output by --dired, delete this line even when it is at BOB.
(insert-directory): Remove the code that checks the return value
of 'ls' and signals an error based on that value. Write any error
message emitted by 'ls' to a temporary file and insert its content
into a buffer, which will be popped when invoking a Dired command
results in the 'ls' error. Adjust the comment above this function
to accommodate file names containing a newline in Dired entries.
(insert-directory-adj-pos): Remove this now unused function.
* test/lisp/dired-tests.el (dired-test-filename-with-newline-1)
(dired-test-filename-with-newline-2)
(dired-test-ls-error-message): New tests.
* test/lisp/files-tests.el
(files-tests-file-name-non-special-insert-directory): Adjust test
to use of 'ls' error buffer instead of signaling an error.
This directory contains source code for the parts of Emacs that are
written in Emacs Lisp. *.el files are Emacs Lisp source, and the
corresponding *.elc files are byte-compiled versions. Byte-compiled
files are architecture-independent.
The term subdirectory contains Lisp files that customize Emacs for
certain terminal types. When Emacs starts, it checks the TERM
environment variable to get the terminal type and loads
'term/${TERM}.el' if it exists.
The other subdirectories hold Lisp packages grouped by their general
purpose.