unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41201: 26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso
@ 2020-05-12  4:40 Trent W. Buck
  2020-05-12 15:50 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Trent W. Buck @ 2020-05-12  4:40 UTC (permalink / raw)
  To: 41201

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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41201: 26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso
  2020-05-12  4:40 bug#41201: 26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso Trent W. Buck
@ 2020-05-12 15:50 ` Eli Zaretskii
  2020-09-01 14:50   ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Eli Zaretskii @ 2020-05-12 15:50 UTC (permalink / raw)
  To: Trent W. Buck; +Cc: 41201

> From: trentbuck@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#41201: 26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso
  2020-05-12 15:50 ` Eli Zaretskii
@ 2020-09-01 14:50   ` Stefan Kangas
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Kangas @ 2020-09-01 14:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Trent W. Buck, 41201-done

Eli Zaretskii <eliz@gnu.org> writes:

>> From: trentbuck@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-01 14:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12  4:40 bug#41201: 26.1; tar-mode-show-date prints middle-endian dates despite TIME_STYLE=long-iso Trent W. Buck
2020-05-12 15:50 ` Eli Zaretskii
2020-09-01 14:50   ` Stefan Kangas

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).