diff lisp/ls-lisp.el @ 90743:f83d17e1ace6

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 615-621) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 197-199) - Merge from emacs--devo--0 - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-166
author Miles Bader <miles@gnu.org>
date Tue, 30 Jan 2007 22:22:43 +0000
parents 95d0cdf160ea 7b38b48667a7
children 31beec9ee600
line wrap: on
line diff
--- a/lisp/ls-lisp.el	Tue Jan 30 07:44:44 2007 +0000
+++ b/lisp/ls-lisp.el	Tue Jan 30 22:22:43 2007 +0000
@@ -151,7 +151,10 @@
   '("%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 @@
 	       (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 @@
 	      (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"))))