* [patch] Emacs 21.2 ls-lisp does not allow custom time formats
@ 2002-08-19 10:05 Jari Aalto+mail.emacs
0 siblings, 0 replies; only message in thread
From: Jari Aalto+mail.emacs @ 2002-08-19 10:05 UTC (permalink / raw)
It's very unfortunate for ls-lisp.el to use localized time
strings, because this completely garbles the dired output to
unreadable "ragged" layout. In Finland (and in numerous other
countries) the month names cannot be abbreviated into 3 letters,
as in English.
Here is patch to allow custom time formats. Personally I use
ISO 8601. Why not set it default as well?
Jari
--- ls-lisp.el.orig 2002-08-19 12:55:28.000000000 +0300
+++ ls-lisp.el 2002-08-19 13:02:30.000000000 +0300
@@ -144,6 +144,26 @@
: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.
+
+Syntax:
+
+ '(EARLY-TIME-FORMAT
+ OLD-TIME-FORMAT)
+
+The EARLY-TIME-FORMAT is displayed, 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)))
@@ -532,8 +552,8 @@
;; Sanity check in case `diff' computation overflowed.
(<= (1- (ash past-cutoff -16)) diff16)
(<= diff16 (1+ (ash future-cutoff -16))))
- "%b %e %H:%M"
- "%b %e %Y")
+ (nth 0 ls-lisp-format-time-list)
+ (nth 1 ls-lisp-format-time-list))
time)
(error "Unk 0 0000"))))
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-08-19 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-08-19 10:05 [patch] Emacs 21.2 ls-lisp does not allow custom time formats Jari Aalto+mail.emacs
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).