Fix file-name detection in Dired under -F
authorEli Zaretskii <eliz@gnu.org>
Fri, 5 Jul 2024 10:58:11 +0000 (13:58 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 5 Jul 2024 10:58:11 +0000 (13:58 +0300)
* lisp/files.el (insert-directory-clean): Support all the symbols
appended to file names by the -F/--classify option of 'ls'.  See
https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg00366.html
for the details.

lisp/files.el

index 042b8e2d51559be3e1e3c99003d11e09418f7b6c..c518273bd2948d2dcc9f95d66e50cb5e65a60b53 100644 (file)
@@ -8087,8 +8087,8 @@ Valid wildcards are `*', `?', `[abc]' and `[a-z]'."
                  (end (insert-directory-adj-pos
                        (+ beg (read (current-buffer)))
                        error-lines)))
-             (if (memq (char-after end) '(?\n ?\s))
-                 ;; End is followed by \n or by " -> ".
+             (if (memq (char-after end) '(?\n ?\s ?/ ?* ?@ ?% ?= ?|))
+                 ;; End is followed by \n or by output of -F.
                  (put-text-property start end 'dired-filename t)
                ;; It seems that we can't trust ls's output as to
                ;; byte positions of filenames.