comparison lisp/dired.el @ 40818:1f2eaa535150

(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.
author Paul Eggert <eggert@twinsun.com>
date Wed, 07 Nov 2001 21:52:44 +0000
parents 7e0db9f5d524
children 4bc87462585c
comparison
equal deleted inserted replaced
40817:4ce7ef7fad3f 40818:1f2eaa535150
1503 ;;; Functions for finding the file name in a dired buffer line. 1503 ;;; Functions for finding the file name in a dired buffer line.
1504 1504
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
1541 ;; The "[kMGTPEZY]?" below supports "ls -alh" output. 1533 ;; The "[kMGTPEZY]?" below supports "ls -alh" output.
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.
1548 The default value is designed to recognize dates and times 1541 The default value is designed to recognize dates and times
1549 regardless of the language.") 1542 regardless of the language.")
1550 1543
1551 (defvar dired-permission-flags-regexp 1544 (defvar dired-permission-flags-regexp