diff options
author | Karl Heuer <kwzh@gnu.org> | 1996-01-09 23:15:52 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1996-01-09 23:15:52 +0000 |
commit | 8f273619c93b072d86c6ddba2e7764ee8a4ebbc5 (patch) | |
tree | 2c8ab963ef624c85d6690a074d171a6bcc0d89df /lisp/dired.el | |
parent | b7b92266cda782e4d73effb7fbe1a8f84fd731c3 (diff) | |
download | emacs-8f273619c93b072d86c6ddba2e7764ee8a4ebbc5.tar.gz |
(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.
Diffstat (limited to 'lisp/dired.el')
-rw-r--r-- | lisp/dired.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lisp/dired.el b/lisp/dired.el index 6bf16084c00..e8697cd0a78 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -566,7 +566,15 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh." end) ;; This makes sure that month names come out in English ;; so we can find the start of the file name. - (setenv "LC_ALL" "C") + ;; But if the user has customized the way of finding the file name, + ;; this is not necessary. + (if (and (equal dired-move-to-filename-regexp + dired-standard-move-to-filename-regexp) + ;; It also isn't necessary if we'd use the C locale anyway. + (not (equal (or (getenv "LC_ALL") (getenv "LC_TIME") + (getenv "LANGUAGE") "C") + "C"))) + (setq process-environment (cons "LC_ALL=C" process-environment))) (if (consp dir-or-list) ;; In this case, use the file names in the cdr ;; exactly as originally given to dired-noselect. @@ -1246,6 +1254,10 @@ Optional arg GLOBAL means to replace all matches." "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] " "Regular expression to match a month abbreviation followed by a number.") +(defconst dired-standard-move-to-filename-regexp + "\\(Jan\\|Feb\\|Mar\\|Apr\\|May\\|Jun\\|Jul\\|Aug\\|Sep\\|Oct\\|Nov\\|Dec\\)[ ]+[0-9]+ [ 0-9][0-9][:0-9][0-9][ 0-9] " + "Regular expression to match a month abbreviation followed by a number.") + ;; Move to first char of filename on this line. ;; Returns position (point) or nil if no filename on this line." (defun dired-move-to-filename (&optional raise-error eol) |