summaryrefslogtreecommitdiff
path: root/lisp/ls-lisp.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2002-09-09 19:31:40 +0000
committerRichard M. Stallman <rms@gnu.org>2002-09-09 19:31:40 +0000
commit2686cdc0d05b4eaf663c804dacf05ccee43b9b26 (patch)
treec9c9ab849daa82c2079393cbdc67b0a7d4f9b833 /lisp/ls-lisp.el
parent2285bf9df70b403b5f961583c69f4ad99c43b052 (diff)
downloademacs-2686cdc0d05b4eaf663c804dacf05ccee43b9b26.tar.gz
(ls-lisp-format-time-list): New variable.
(ls-lisp-format-time): Use it.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r--lisp/ls-lisp.el22
1 files changed, 20 insertions, 2 deletions
diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el
index 28538a62721..6efc77b099e 100644
--- a/lisp/ls-lisp.el
+++ b/lisp/ls-lisp.el
@@ -144,6 +144,24 @@ Otherwise they are treated as Emacs regexps (for backward compatibility)."
:type 'boolean
:group 'ls-lisp)
+(defcustom ls-lisp-format-time-list
+ '("%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.
+
+Syntax: (EARLY-TIME-FORMAT OLD-TIME-FORMAT)
+
+The EARLY-TIME-FORMAT is used if file has been modified within the
+current year. The OLD-TIME-FORMAT is used for older files. To use ISO
+8601 dates, you could set:
+
+\(setq ls-lisp-format-time-list
+ '(\"%Y-%m-%d %H:%M\"
+ \"%Y-%m-%d \"))"
+ :type '(list string)
+ :group 'ls-lisp)
+
;; Remember the original insert-directory function
(or (featurep 'ls-lisp) ; FJW: unless this file is being reloaded!
(fset 'original-insert-directory (symbol-function 'insert-directory)))
@@ -557,8 +575,8 @@ 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" "%b %e %H:%M")
- (if locale "%Y-%m-%d " "%b %e %Y"))
+ (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)))
time))
(error "Unk 0 0000"))))