aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2001-11-07 21:52:44 +0000
committerPaul Eggert2001-11-07 21:52:44 +0000
commitb4bbe8889b20b7371686e32f002f61e1b202c671 (patch)
treea46a55555480bc124841ab17bfcad65cb2fb72bc
parent0c99b1392778ac128d78c14a1bd28b64d9f9d566 (diff)
downloademacs-b4bbe8889b20b7371686e32f002f61e1b202c671.tar.gz
emacs-b4bbe8889b20b7371686e32f002f61e1b202c671.zip
(dired-move-to-filename-regexp):
Do not distinguish between ASCII letters and non-ASCII characters. Don't allow comma except in the form "month day, year". Don't allow space between month name and comma. Clean up the code that checks for trailing period, comma, and space. Remove now-obsolete comments, and add more commentary about Japanese dates. Always gobble up trailing spaces, instead of doing it only sometimes.
-rw-r--r--lisp/dired.el39
1 files changed, 16 insertions, 23 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 5361bdd22bf..21aa49a866f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -1505,36 +1505,28 @@ DIR must be a directory name, not a file name."
1505(defvar dired-move-to-filename-regexp 1505(defvar dired-move-to-filename-regexp
1506 (let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)") 1506 (let* ((l "\\([A-Za-z]\\|[^\0-\177]\\)")
1507 ;; In some locales, month abbreviations are as short as 2 letters, 1507 ;; In some locales, month abbreviations are as short as 2 letters,
1508 ;; and they can be padded on the right with spaces. 1508 ;; and they can be followed by ".".
1509 ;; weiand: changed: month ends potentially with . or , or ., 1509 (month (concat l l "+\\.?"))
1510;;old (month (concat l l "+ *"))
1511 (month (concat l l "+[.]?,? *"))
1512 ;; Recognize any non-ASCII character.
1513 ;; The purpose is to match a Kanji character.
1514 (k "[^\0-\177]")
1515 ;; (k "[^\x00-\x7f\x80-\xff]")
1516 (s " ") 1510 (s " ")
1517 (yyyy "[0-9][0-9][0-9][0-9]") 1511 (yyyy "[0-9][0-9][0-9][0-9]")
1518 (mm "[ 0-1]?[0-9]") 1512 (dd "[ 0-3][0-9]")
1519;;old (dd "[ 0-3][0-9]")
1520 (dd "[ 0-3][0-9][.]?")
1521 (HH:MM "[ 0-2][0-9]:[0-5][0-9]") 1513 (HH:MM "[ 0-2][0-9]:[0-5][0-9]")
1522 (seconds "[0-6][0-9]\\([.,][0-9]+\\)?") 1514 (seconds "[0-6][0-9]\\([.,][0-9]+\\)?")
1523 (zone "[-+][0-2][0-9][0-5][0-9]") 1515 (zone "[-+][0-2][0-9][0-5][0-9]")
1524 (iso-mm-dd "[01][0-9]-[0-3][0-9]") 1516 (iso-mm-dd "[01][0-9]-[0-3][0-9]")
1525 (iso-time (concat HH:MM "\\(:" seconds "\\( ?" zone "\\)?\\)?")) 1517 (iso-time (concat HH:MM "\\(:" seconds "\\( ?" zone "\\)?\\)?"))
1526 (iso (concat "\\(\\(" yyyy "-\\)?" iso-mm-dd "[ T]" iso-time 1518 (iso (concat "\\(\\(" yyyy "-\\)?" iso-mm-dd "[ T]" iso-time
1527 "\\|" yyyy "-" iso-mm-dd " ?\\)")) 1519 "\\|" yyyy "-" iso-mm-dd "\\)"))
1528 (western (concat "\\(" month s dd "\\|" dd s month "\\)" 1520 (western (concat "\\(" month s "+" dd "\\|" dd "\\.?" s month "\\)"
1529 ;; weiand: changed: year potentially unaligned 1521 s "+"
1530;;old s "\\(" HH:MM "\\|" s yyyy "\\|" yyyy s "\\)")) 1522 "\\(" HH:MM "\\|" yyyy "\\)"))
1531 s "\\(" HH:MM 1523 (western-comma (concat month s "+" dd "," s "+" yyyy))
1532 "\\|" yyyy s s "?" 1524 ;; Japanese MS-Windows ls-lisp has one-digit months, and
1533 "\\|" s "?" yyyy 1525 ;; omits the Kanji characters after month and day-of-month.
1534 "\\)")) 1526 (mm "[ 0-1]?[0-9]")
1535 (japanese 1527 (japanese
1536 (concat mm k "?" s dd k "?" s "+" 1528 (concat mm l "?" s dd l "?" s "+"
1537 "\\(" HH:MM "\\|" yyyy k "?" "\\)"))) 1529 "\\(" HH:MM "\\|" yyyy l "?" "\\)")))
1538 ;; The "[0-9]" below requires the previous column to end in a digit. 1530 ;; The "[0-9]" below requires the previous column to end in a digit.
1539 ;; This avoids recognizing `1 may 1997' as a date in the line: 1531 ;; This avoids recognizing `1 may 1997' as a date in the line:
1540 ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README 1532 ;; -r--r--r-- 1 may 1997 1168 Oct 19 16:49 README
@@ -1542,8 +1534,9 @@ DIR must be a directory name, not a file name."
1542 ;; The ".*" below finds the last match if there are multiple matches. 1534 ;; The ".*" below finds the last match if there are multiple matches.
1543 ;; This avoids recognizing `jservice 10 1024' as a date in the line: 1535 ;; This avoids recognizing `jservice 10 1024' as a date in the line:
1544 ;; drwxr-xr-x 3 jservice 10 1024 Jul 2 1997 esg-host 1536 ;; drwxr-xr-x 3 jservice 10 1024 Jul 2 1997 esg-host
1545 (concat ".*[0-9][kMGTPEZY]?" 1537 (concat ".*[0-9][kMGTPEZY]?" s
1546 s "\\(" western "\\|" japanese "\\|" iso "\\)" s)) 1538 "\\(" western "\\|" western-comma "\\|" japanese "\\|" iso "\\)"
1539 s "+"))
1547 "Regular expression to match up to the file name in a directory listing. 1540 "Regular expression to match up to the file name in a directory listing.
1548The default value is designed to recognize dates and times 1541The default value is designed to recognize dates and times
1549regardless of the language.") 1542regardless of the language.")