aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2007-01-27 13:21:19 +0000
committerEli Zaretskii2007-01-27 13:21:19 +0000
commitea88e7752ecf1222f9950181b8fd7b447b06a243 (patch)
treea9f6e30025700b869e55d11b02c5286ad374301a
parentbfe6997213af49b618bed3ec0f7ffa7d45f699da (diff)
downloademacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.tar.gz
emacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.zip
(ls-lisp-use-localized-time-format): New defcustom.
(ls-lisp-format-time-list): Doc fix. Mention ls-lisp-use-localized-time-format. (ls-lisp-format-time): Use ls-lisp-format-time-list if ls-lisp-use-localized-time-format is non-nil, even if a valid locale is defined.
-rw-r--r--lisp/ls-lisp.el22
1 files changed, 19 insertions, 3 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 2b778db2387..20da227b010 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -151,7 +151,10 @@ Otherwise they are treated as Emacs regexps (for backward compatibility)."
151 '("%b %e %H:%M" 151 '("%b %e %H:%M"
152 "%b %e %Y") 152 "%b %e %Y")
153 "*List of `format-time-string' specs to display file time stamps. 153 "*List of `format-time-string' specs to display file time stamps.
154They are used whenever a locale is not specified to use instead. 154These specs are used ONLY if a valid locale can not be determined.
155
156If `ls-lisp-use-localized-time-format' is non-nil, these specs are used
157regardless of whether the locale can be determined.
155 158
156Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT) 159Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT)
157 160
@@ -166,6 +169,15 @@ current year. The OLD-TIME-FORMAT is used for older files. To use ISO
166 (string :tag "Old time format")) 169 (string :tag "Old time format"))
167 :group 'ls-lisp) 170 :group 'ls-lisp)
168 171
172(defcustom ls-lisp-use-localized-time-format nil
173 "*Non-nil causes ls-lisp to use `ls-lisp-format-time-list' even if
174a valid locale is specified.
175
176WARNING: Using localized date/time format might cause Dired columns
177to fail to lign up, e.g. if month names are not all of the same length."
178 :type 'boolean
179 :group 'ls-lisp)
180
169(defvar original-insert-directory nil 181(defvar original-insert-directory nil
170 "This holds the original function definition of `insert-directory'.") 182 "This holds the original function definition of `insert-directory'.")
171 183
@@ -567,8 +579,12 @@ All ls time options, namely c, t and u, are handled."
567 (setq locale nil)) 579 (setq locale nil))
568 (format-time-string 580 (format-time-string
569 (if (and (<= past-cutoff diff) (<= diff 0)) 581 (if (and (<= past-cutoff diff) (<= diff 0))
570 (if locale "%m-%d %H:%M" (nth 0 ls-lisp-format-time-list)) 582 (if (and locale (not ls-lisp-use-localized-time-format))
571 (if locale "%Y-%m-%d " (nth 1 ls-lisp-format-time-list))) 583 "%m-%d %H:%M"
584 (nth 0 ls-lisp-format-time-list))
585 (if (and locale (not ls-lisp-use-localized-time-format))
586 "%Y-%m-%d "
587 (nth 1 ls-lisp-format-time-list)))
572 time)) 588 time))
573 (error "Unk 0 0000")))) 589 (error "Unk 0 0000"))))
574 590