summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@twinsun.com>1997-12-11 06:58:17 +0000
committerPaul Eggert <eggert@twinsun.com>1997-12-11 06:58:17 +0000
commit2db8f30a7f4ba18b47e2abe37630f29c677da42e (patch)
treee53fcf0771cd6694eab1944ac2052fb2078b079c /lisp/dired.el
parenta14d5be1316a047d915cec460cfb4a88cd421306 (diff)
downloademacs-2db8f30a7f4ba18b47e2abe37630f29c677da42e.tar.gz
(dired-move-to-filename-regexp):
Fix the problem with misparsing `-r--r--r-- 1 may 1997' by requiring a digit before the date. (dired-move-to-filename-regexp): Allow any month name of 2 letters or more.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index c8d97f1dd01..b69bd24f517 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1352,10 +1352,10 @@ DIR must be a directory name, not a file name."
(defvar dired-move-to-filename-regexp
(let* ((l "[A-Za-z\xa0-\xff]")
- ;; Letter or space.
- (ls "[ A-Za-z\xa0-\xff]")
- (month (concat l l "\\(" ls "\\|" l l "\\)"))
- ;; Recognize any non-ASCII character.
+ ;; In some locales, month abbreviations are as short as 2 letters,
+ ;; and they can be padded on the right with spaces.
+ (month (concat l l "+ *"))
+ ;; Recognize any non-ISO-8859 character.
;; The purpose is to match a Kanji character.
(k "[^\x00-\xff]")
(s " ")
@@ -1365,9 +1365,12 @@ DIR must be a directory name, not a file name."
(HH:MM "[ 0-2][0-9]:[0-5][0-9]")
(western (concat "\\(" month s dd "\\|" dd s month "\\)"
s "\\(" HH:MM "\\|" s yyyy "\\)"))
- (japanese (concat mm k " " dd k s "\\(" s HH:MM "\\|" yyyy k "\\)")))
- (concat s "\\(" western "\\|" japanese "\\)" s))
- "Regular expression to match a date and time in a directory listing.
+ (japanese (concat mm k s dd k s "\\(" s HH:MM "\\|" yyyy k "\\)")))
+ ;; Require the previous column to end in a digit.
+ ;; This avoids recognizing `1 may 1997' as a date in the line:
+ ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README
+ (concat "[0-9]" s "\\(" western "\\|" japanese "\\)" s))
+ "Regular expression to match up to the file name in a directory listing.
The default value is designed to recognize dates and times
regardless of the language.")