From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: jari.aalto@cante.net (Jari Aalto+mail.emacs) Newsgroups: gmane.emacs.bugs Subject: [21.3] ls-lisp.el - Allow user configurable time format Date: Wed, 02 Mar 2005 00:22:08 +0200 Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1109716946 8083 80.91.229.2 (1 Mar 2005 22:42:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 1 Mar 2005 22:42:26 +0000 (UTC) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Mar 01 23:42:25 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D6G47-0002Xu-M0 for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Mar 2005 23:42:08 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6GMl-0004iU-5K for geb-bug-gnu-emacs@m.gmane.org; Tue, 01 Mar 2005 18:01:23 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1D6GEl-0008VE-VC for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2005 17:53:08 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1D6GCo-0007XS-0j for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2005 17:51:09 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D6GCi-0007Jk-K9 for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2005 17:51:01 -0500 Original-Received: from [193.229.0.35] (helo=fep31-app.kolumbus.fi) by monty-python.gnu.org with esmtp (Exim 4.34) id 1D6Fkl-000127-VU for bug-gnu-emacs@gnu.org; Tue, 01 Mar 2005 17:22:08 -0500 Original-Received: from cante.net ([81.197.3.110]) by fep31-app.kolumbus.fi with ESMTP id <20050301222207.NPEQ15813.fep31-app.kolumbus.fi@cante.net> for ; Wed, 2 Mar 2005 00:22:07 +0200 Original-To: bug-gnu-emacs@gnu.org User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (windows-nt) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org X-MailScanner-To: geb-bug-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.bugs:10841 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:10841 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 * 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"))))