summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2007-01-27 13:21:19 +0000
committerEli Zaretskii <eliz@gnu.org>2007-01-27 13:21:19 +0000
commitea88e7752ecf1222f9950181b8fd7b447b06a243 (patch)
treea9f6e30025700b869e55d11b02c5286ad374301a /lisp/ls-lisp.el
parentbfe6997213af49b618bed3ec0f7ffa7d45f699da (diff)
downloademacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.tar.gz
emacs-ea88e7752ecf1222f9950181b8fd7b447b06a243.tar.bz2
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.
Diffstat (limited to 'lisp/ls-lisp.el')
-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)."
'("%b %e %H:%M"
"%b %e %Y")
"*List of `format-time-string' specs to display file time stamps.
-They are used whenever a locale is not specified to use instead.
+These specs are used ONLY if a valid locale can not be determined.
+
+If `ls-lisp-use-localized-time-format' is non-nil, these specs are used
+regardless of whether the locale can be determined.
Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT)
@@ -166,6 +169,15 @@ current year. The OLD-TIME-FORMAT is used for older files. To use ISO
(string :tag "Old time format"))
:group 'ls-lisp)
+(defcustom ls-lisp-use-localized-time-format nil
+ "*Non-nil causes ls-lisp to use `ls-lisp-format-time-list' even if
+a valid locale is specified.
+
+WARNING: Using localized date/time format might cause Dired columns
+to fail to lign up, e.g. if month names are not all of the same length."
+ :type 'boolean
+ :group 'ls-lisp)
+
(defvar original-insert-directory nil
"This holds the original function definition of `insert-directory'.")
@@ -567,8 +579,12 @@ All ls time options, namely c, t and u, are handled."
(setq locale nil))
(format-time-string
(if (and (<= past-cutoff diff) (<= diff 0))
- (if locale "%m-%d %H:%M" (nth 0 ls-lisp-format-time-list))
- (if locale "%Y-%m-%d " (nth 1 ls-lisp-format-time-list)))
+ (if (and locale (not ls-lisp-use-localized-time-format))
+ "%m-%d %H:%M"
+ (nth 0 ls-lisp-format-time-list))
+ (if (and locale (not ls-lisp-use-localized-time-format))
+ "%Y-%m-%d "
+ (nth 1 ls-lisp-format-time-list)))
time))
(error "Unk 0 0000"))))