Mercurial > emacs
comparison lisp/dired.el @ 14107:5449183b1e7b
(dired-standard-move-to-filename-regexp): New variable.
(dired-insert-directory): Don't alter environment if would use the
C locale anyway, or if dired-move-to-filename-regexp has been
changed from the default value.
When changing the environment, avoid need for setenv.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Tue, 09 Jan 1996 23:15:52 +0000 |
parents | 490fe0437271 |
children | 36471d582fb2 |
comparison
equal
deleted
inserted
replaced
14106:4302535a19eb | 14107:5449183b1e7b |
---|---|
564 (let ((opoint (point)) | 564 (let ((opoint (point)) |
565 (process-environment (copy-sequence process-environment)) | 565 (process-environment (copy-sequence process-environment)) |
566 end) | 566 end) |
567 ;; This makes sure that month names come out in English | 567 ;; This makes sure that month names come out in English |
568 ;; so we can find the start of the file name. | 568 ;; so we can find the start of the file name. |
569 (setenv "LC_ALL" "C") | 569 ;; But if the user has customized the way of finding the file name, |
570 ;; this is not necessary. | |
571 (if (and (equal dired-move-to-filename-regexp | |
572 dired-standard-move-to-filename-regexp) | |
573 ;; It also isn't necessary if we'd use the C locale anyway. | |
574 (not (equal (or (getenv "LC_ALL") (getenv "LC_TIME") | |
575 (getenv "LANGUAGE") "C") | |
576 "C"))) | |
577 (setq process-environment (cons "LC_ALL=C" process-environment))) | |
570 (if (consp dir-or-list) | 578 (if (consp dir-or-list) |
571 ;; In this case, use the file names in the cdr | 579 ;; In this case, use the file names in the cdr |
572 ;; exactly as originally given to dired-noselect. | 580 ;; exactly as originally given to dired-noselect. |
573 (mapcar | 581 (mapcar |
574 (function (lambda (x) (insert-directory x switches wildcard full-p))) | 582 (function (lambda (x) (insert-directory x switches wildcard full-p))) |
1244 | 1252 |
1245 (defvar dired-move-to-filename-regexp | 1253 (defvar dired-move-to-filename-regexp |
1246 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] " | 1254 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] " |
1247 "Regular expression to match a month abbreviation followed by a number.") | 1255 "Regular expression to match a month abbreviation followed by a number.") |
1248 | 1256 |
1257 (defconst dired-standard-move-to-filename-regexp | |
1258 "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] " | |
1259 "Regular expression to match a month abbreviation followed by a number.") | |
1260 | |
1249 ;; Move to first char of filename on this line. | 1261 ;; Move to first char of filename on this line. |
1250 ;; Returns position (point) or nil if no filename on this line." | 1262 ;; Returns position (point) or nil if no filename on this line." |
1251 (defun dired-move-to-filename (&optional raise-error eol) | 1263 (defun dired-move-to-filename (&optional raise-error eol) |
1252 ;; This is the UNIX version. | 1264 ;; This is the UNIX version. |
1253 (or eol (setq eol (progn (end-of-line) (point)))) | 1265 (or eol (setq eol (progn (end-of-line) (point)))) |