From 6bb77e5c364e4627c7b12519aa95d097fa80ee96 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Sat, 22 Jul 2023 14:40:56 +0200 Subject: [PATCH] Fix dired mismatch on some filenames * lisp/files.el (directory-listing-before-filename-regexp): Look for the first five columns of a 'ls -l' entry instead of searching for a size pattern. --- lisp/files.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lisp/files.el b/lisp/files.el index f8867432000..6090327def0 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -30,6 +30,7 @@ (eval-when-compile (require 'pcase) + (require 'rx) (require 'easy-mmode)) ; For `define-minor-mode'. (defvar font-lock-keywords) @@ -7765,9 +7766,12 @@ directory-listing-before-filename-regexp ;; parentheses: ;; -rw-r--r-- (modified) 2005-10-22 21:25 files.el ;; This is not supported yet. - (purecopy (concat "\\([0-9][BkKMGTPEZYRQ]? " iso - "\\|.*[0-9][BkKMGTPEZYRQ]? " - "\\(" western "\\|" western-comma + (purecopy (concat "\\(" + ;; Five columns before modification time: mode, + ;; links, owner, group and size + (rx (repeat 5 (and (one-or-more graph) + (one-or-more space)))) + "\\(" iso "\\|" western "\\|" western-comma "\\|" DD-MMM-YYYY "\\|" east-asian "\\)" "\\) +"))) "Regular expression to match up to the file name in a directory listing. -- 2.40.0