unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Jari Aalto <jari.aalto@cante.net>
To: 8440@debbugs.gnu.org
Subject: bug#8440: [PATCH] eshell - Display ls -l dates in ISO 8601 format
Date: Thu, 07 Apr 2011 19:11:31 +0300	[thread overview]
Message-ID: <87mxk2avnw.fsf@blue.sea.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1687 bytes --]

Package: emacs
Version: 23.2+1-7
Severity: wishlist

The use of locale for displaying dates is problematic outside of English;
An example using FI locale:

    eshell$ ls -l
    -rw-rw-rw-   1 user          users   39269 maalis  7 18:29 align.elc
    -rw-rw-rw-   1 user          users  297856 helmi 23 11:11 allout.el
    -rw-rw-rw-   1 user          users  213672 maalis  7 18:29 allout.elc
    -rw-rw-rw-   1 user          users   25176 tammi  8 11:45 ansi-color.el

The output appears rugged and is hard to read. The following patch make "ls
-l" use international ISO 8601 date format:

    -rw-rw-rw-   1 user          users   39269 2011-03-07 18:29 align.elc
    -rw-rw-rw-   1 user          users  297856 2011-02-23 11:11 allout.el
    -rw-rw-rw-   1 user          users  213672 2011-03-07 18:29 allout.elc
    -rw-rw-rw-   1 user          users   25176 2011-01-08 11:45 ansi-color.el

2011-04-07  Jari Aalto  <jari.aalto@cante.net>

        * eshell/em-ls.el
        (eshell-ls-date-format): New variable. Show dates in ISO 8601
        format by default.
        (eshell-ls-file): Use `eshell-ls-date-format'.

-- System Information
Debian Release: wheezy/sid
  APT Prefers testing
  APT policy: (990, testing) (500, unstable) (1, experimental)
Architecture: amd64
Kernel: Linux picasso 2.6.32-5-amd64 #1 SMP Wed Jan 12 03:40:32 UTC 2011 x86_64 GNU/Linux
Locale: LANG=en_US.UTF-8, LC_ALL=

-- Versions of packages `emacs depends on'.
Depends:
emacs23         23.2+1-7        GNU Emacs is the extensible self-documenting 
emacs23-lucid   23.2+1-7        GNU Emacs is the extensible self-documenting 
emacs23-nox     23.2+1-7        GNU Emacs is the extensible self-documenting 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-lisp-eshell-em-ls.el-use-ISO-8601-in-ls-l-output.patch --]
[-- Type: text/x-diff, Size: 1389 bytes --]

From 16f782c350b0e97cdf4b58e23797cd0607c82d5b Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aalto@cante.net>
Date: Thu, 7 Apr 2011 19:00:46 +0300
Subject: [PATCH] lisp/eshell/em-ls.el: use ISO 8601 in ls -l output
Organization: Private
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit


Signed-off-by: Jari Aalto <jari.aalto@cante.net>
---
 lisp/eshell/em-ls.el |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lisp/eshell/em-ls.el b/lisp/eshell/em-ls.el
index 4ef259d..c7da459 100644
--- a/lisp/eshell/em-ls.el
+++ b/lisp/eshell/em-ls.el
@@ -57,6 +57,13 @@ properties to colorize its output based on the setting of
   :type 'hook
   :group 'eshell-ls)
 
+(defcustom eshell-ls-date-format "%Y-%m-%d "
+  "*How to display time information in `eshell-ls-file'.
+For current locale, use \"%b \%e".
+See `format-time-string'."
+  :type 'string)
+  :group 'eshell-ls)
+
 (defcustom eshell-ls-initial-args nil
   "If non-nil, this list of args is included before any call to `ls'.
 This is useful for enabling human-readable format (-h), for example."
@@ -508,7 +515,7 @@ whose cdr is the list of file attributes."
 		    str))
 		" " (format-time-string
 		     (concat
-		      "%b %e "
+		      eshell-ls-date-format
 		      (if (= (nth 5 (decode-time (current-time)))
 			     (nth 5 (decode-time
 				     (nth (cond
-- 
1.7.4.1


             reply	other threads:[~2011-04-07 16:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-07 16:11 Jari Aalto [this message]
2011-06-27 21:48 ` bug#8440: [PATCH] eshell - Display ls -l dates in ISO 8601 format Chong Yidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mxk2avnw.fsf@blue.sea.net \
    --to=jari.aalto@cante.net \
    --cc=8440@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).