diff options
| author | Paul Eggert | 1997-12-11 06:58:17 +0000 |
|---|---|---|
| committer | Paul Eggert | 1997-12-11 06:58:17 +0000 |
| commit | 6a5c00da3f62d9e8ec23a8dded5a47fd2a8bb9c8 (patch) | |
| tree | a13e2f0339436954f804a5fea7635b1790f18f38 | |
| parent | fa4a3d4930cfa5000a2a93ee2319ae260e2795ae (diff) | |
| download | emacs-6a5c00da3f62d9e8ec23a8dded5a47fd2a8bb9c8.tar.gz emacs-6a5c00da3f62d9e8ec23a8dded5a47fd2a8bb9c8.zip | |
(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.
| -rw-r--r-- | lisp/dired.el | 17 |
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." | |||
| 1352 | 1352 | ||
| 1353 | (defvar dired-move-to-filename-regexp | 1353 | (defvar dired-move-to-filename-regexp |
| 1354 | (let* ((l "[A-Za-z\xa0-\xff]") | 1354 | (let* ((l "[A-Za-z\xa0-\xff]") |
| 1355 | ;; Letter or space. | 1355 | ;; In some locales, month abbreviations are as short as 2 letters, |
| 1356 | (ls "[ A-Za-z\xa0-\xff]") | 1356 | ;; and they can be padded on the right with spaces. |
| 1357 | (month (concat l l "\\(" ls "\\|" l l "\\)")) | 1357 | (month (concat l l "+ *")) |
| 1358 | ;; Recognize any non-ASCII character. | 1358 | ;; Recognize any non-ISO-8859 character. |
| 1359 | ;; The purpose is to match a Kanji character. | 1359 | ;; The purpose is to match a Kanji character. |
| 1360 | (k "[^\x00-\xff]") | 1360 | (k "[^\x00-\xff]") |
| 1361 | (s " ") | 1361 | (s " ") |
| @@ -1365,9 +1365,12 @@ DIR must be a directory name, not a file name." | |||
| 1365 | (HH:MM "[ 0-2][0-9]:[0-5][0-9]") | 1365 | (HH:MM "[ 0-2][0-9]:[0-5][0-9]") |
| 1366 | (western (concat "\\(" month s dd "\\|" dd s month "\\)" | 1366 | (western (concat "\\(" month s dd "\\|" dd s month "\\)" |
| 1367 | s "\\(" HH:MM "\\|" s yyyy "\\)")) | 1367 | s "\\(" HH:MM "\\|" s yyyy "\\)")) |
| 1368 | (japanese (concat mm k " " dd k s "\\(" s HH:MM "\\|" yyyy k "\\)"))) | 1368 | (japanese (concat mm k s dd k s "\\(" s HH:MM "\\|" yyyy k "\\)"))) |
| 1369 | (concat s "\\(" western "\\|" japanese "\\)" s)) | 1369 | ;; Require the previous column to end in a digit. |
| 1370 | "Regular expression to match a date and time in a directory listing. | 1370 | ;; This avoids recognizing `1 may 1997' as a date in the line: |
| 1371 | ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README | ||
| 1372 | (concat "[0-9]" s "\\(" western "\\|" japanese "\\)" s)) | ||
| 1373 | "Regular expression to match up to the file name in a directory listing. | ||
| 1371 | The default value is designed to recognize dates and times | 1374 | The default value is designed to recognize dates and times |
| 1372 | regardless of the language.") | 1375 | regardless of the language.") |
| 1373 | 1376 | ||