GNU bug report logs - #41201
26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso

Previous Next

Package: emacs;

Reported by: trentbuck <at> gmail.com (Trent W. Buck)

Date: Tue, 12 May 2020 04:41:02 UTC

Severity: normal

Found in version 26.1

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41201 in the body.
You can then email your comments to 41201 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#41201; Package emacs. (Tue, 12 May 2020 04:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to trentbuck <at> gmail.com (Trent W. Buck):
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 12 May 2020 04:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: trentbuck <at> gmail.com (Trent W. Buck)
To: bug-gnu-emacs <at> gnu.org
Subject: 26.1; tar-mode-show-date prints middle-endian dates despite
 TIME_STYLE=long-iso
Date: Tue, 12 May 2020 14:40:02 +1000
This is a minor issue.

Middle-endian ("US style") dates confuse me.
I set TIME_STYLE=long-iso so I won't have to deal with them.
This works for GNU ls and GNU tar:

    bash5$ touch x; ls -l x; tar cf x.tar x; tar tvf x.tar
    -rw-r--r-- 1 twb twb 0 2020-05-12 14:32 x
    -rw-r--r-- twb/twb           0 2020-05-12 14:32 x

This doesn't work for tar-mode, because
it processes tarballs using native elisp:

    bash5$ emacs -Q -eval '(setq-default tar-mode-show-date t)' x.tar
     -rw-r--r--     twb/twb           0 May 12 14:33 2020 x

The responsible code appears to be tar-clip-time-string which appears to
munge the output of CURRENT-TIME-STRING:

    (defun tar-clip-time-string (time)
      (let ((str (current-time-string time)))
        (concat " " (substring str 4 16) (format-time-string " %Y" time))))

Where CURRENT-TIME-STRING appears to be hard-coded to a format.
That format matches neither
GNU "date --rfc-email" (little-endian) nor
GNU "date --rfc-3339=seconds" (big-endian).

Surely emacs already supports locale-appropriate timestamps somewhere?
Please hook up tar-mode to use that code.

PS: see also "locale -k date_fmt", which these days seems to be the same
for me (en_AU.UTF-8) and the default (C.UTF-8), hence why I use TIME_STYLE.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#41201; Package emacs. (Tue, 12 May 2020 15:52:01 GMT) Full text and rfc822 format available.

Message #8 received at 41201 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: trentbuck <at> gmail.com (Trent W. Buck)
Cc: 41201 <at> debbugs.gnu.org
Subject: Re: bug#41201: 26.1;
 tar-mode-show-date prints middle-endian dates despite
 TIME_STYLE=long-iso
Date: Tue, 12 May 2020 18:50:51 +0300
> From: trentbuck <at> gmail.com (Trent W. Buck)
> Date: Tue, 12 May 2020 14:40:02 +1000
> 
> Middle-endian ("US style") dates confuse me.
> I set TIME_STYLE=long-iso so I won't have to deal with them.
> This works for GNU ls and GNU tar:
> 
>     bash5$ touch x; ls -l x; tar cf x.tar x; tar tvf x.tar
>     -rw-r--r-- 1 twb twb 0 2020-05-12 14:32 x
>     -rw-r--r-- twb/twb           0 2020-05-12 14:32 x
> 
> This doesn't work for tar-mode, because
> it processes tarballs using native elisp:
> 
>     bash5$ emacs -Q -eval '(setq-default tar-mode-show-date t)' x.tar
>      -rw-r--r--     twb/twb           0 May 12 14:33 2020 x

This is already fixed in what will become Emacs 27.1: there we display
the date in the yy-mm-dd format.  You can find the latest pretest of
Emacs 27.1 on alpha.gnu.org.

Thanks.




Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Tue, 01 Sep 2020 14:51:02 GMT) Full text and rfc822 format available.

Notification sent to trentbuck <at> gmail.com (Trent W. Buck):
bug acknowledged by developer. (Tue, 01 Sep 2020 14:51:02 GMT) Full text and rfc822 format available.

Message #13 received at 41201-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "Trent W. Buck" <trentbuck <at> gmail.com>, 41201-done <at> debbugs.gnu.org
Subject: Re: bug#41201: 26.1; tar-mode-show-date prints middle-endian dates
 despite TIME_STYLE=long-iso
Date: Tue, 1 Sep 2020 07:50:31 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: trentbuck <at> gmail.com (Trent W. Buck)
>> Date: Tue, 12 May 2020 14:40:02 +1000
>>
>> Middle-endian ("US style") dates confuse me.
>> I set TIME_STYLE=long-iso so I won't have to deal with them.
>> This works for GNU ls and GNU tar:
>>
>>     bash5$ touch x; ls -l x; tar cf x.tar x; tar tvf x.tar
>>     -rw-r--r-- 1 twb twb 0 2020-05-12 14:32 x
>>     -rw-r--r-- twb/twb           0 2020-05-12 14:32 x
>>
>> This doesn't work for tar-mode, because
>> it processes tarballs using native elisp:
>>
>>     bash5$ emacs -Q -eval '(setq-default tar-mode-show-date t)' x.tar
>>      -rw-r--r--     twb/twb           0 May 12 14:33 2020 x
>
> This is already fixed in what will become Emacs 27.1: there we display
> the date in the yy-mm-dd format.  You can find the latest pretest of
> Emacs 27.1 on alpha.gnu.org.

Since this is already fixed, I'm closing this bug report now.

Please reopen the bug or open a new one if you can still reproduce this
on Emacs 27.1 or later.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Sep 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.