unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* [21.3] ls-lisp.el - Allow user configurable time format
@ 2005-03-01 22:22 Jari Aalto+mail.emacs
  0 siblings, 0 replies; only message in thread
From: Jari Aalto+mail.emacs @ 2005-03-01 22:22 UTC (permalink / raw)



Your bug report will be posted to the bug-gnu-emacs AT gnu.org mailing list,
and to the gnu.emacs.bug news group.

In GNU Emacs 21.3.1 (i386-msvc-nt5.0.2195)
 of 2003-03-28 on buffy
configured using `configure --with-msvc (12.00)'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: FIN
  locale-coding-system: iso-latin-1
  default-enable-multibyte-characters: t

Here is dired listing from Win32 NTEmacs:

  drwxrwxrwx   2 Administrator root        0 maalis  1 22:53 .
  drwxrwxrwx   2 Administrator root        0 maalis  1 21:47 ..
  -rw-rw-rw-   1 Administrator root     4694 helmi 16 19:44 x.bongo
  -rw-rw-rw-   1 Administrator root     6229 helmi 18 15:51 x2.bongo
  drwxrwxrwx   2 Administrator root        0 helmi 11  2003 20.6
  drwxrwxrwx   2 Administrator root        0 tammi  5  2002 21.1
  drwxrwxrwx   2 Administrator root        0 elo 22  2002 21.2
  drwxrwxrwx   2 Administrator root        0 elo 15  2003 21.3
  drwxrwxrwx   2 Administrator root        0 elo  8  2003 other
  -rw-rw-rw-   1 Administrator root      876 kesä  3  2000 apropos-1.el.diff
  -rw-rw-rw-   1 Administrator root     1939 kesä  3  2000 apropos-2.el.diff

The problem is that the time format is displayed in national language and
the month names do not "line up". It would be good if user could set the
preference of the time format, as I prefer ISO 8601. Below patch is patch
to make the format customizable.

Jari

2005-03-02 Wed  Jari Aalto  <jari dot aalto A T cante dot net>

        * ls-lisp.el (ls-lisp-format-time-list): New user variable.
        (ls-lisp-format-time): Use `ls-lisp-format-time-list'.

--- 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:[~2005-03-01 22:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-01 22:22 [21.3] ls-lisp.el - Allow user configurable time format 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).