GNU bug report logs - #70725
29.3; dired-do-touch completion

Previous Next

Package: emacs;

Reported by: Christopher Howard <christopher <at> librehacker.com>

Date: Thu, 2 May 2024 19:53:01 UTC

Severity: normal

Found in version 29.3

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


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

From: Thierry Volpiatto <thievol <at> posteo.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: christopher <at> librehacker.com, Eli Zaretskii <eliz <at> gnu.org>,
 70725 <at> debbugs.gnu.org
Subject: Re: bug#70725: 29.3; dired-do-touch completion
Date: Mon, 06 May 2024 10:18:18 +0000
[Message part 1 (text/plain, inline)]
Juri Linkov <juri <at> linkov.net> writes:

>> What I see and is wrong IMO is:
>>
>> - DEFAULT is the timestamp of the current file at point and prompt says
>> that DEFAULT is "now".
>>
>> - Pressing RET should use DEFAULT, but IIUC what you say, it returns
>> current-time timestamp, is it correct?
>> If so this is another inconsistency, RET should always return DEFAULT with an
>> empty prompt.
>
> The prompt of dired-do-touch with the default value "now" is a special case.
> This exception is required to solve the time paradox.  If the default value
> was a fixed value of some moment of time such as you proposed
>
>   (format-time-string "%Y%m%d%H%M.%S" (current-time))
>
> then after you press RET the timestamp of the file will be set
> to some moment of time in the past, because it takes time
> between you press 'T' (dired-do-touch) and then press 'RET'
> (exit-minibuffer).
>
> So the timestamp of the file will be wrong, not the time
> when you press 'RET'.  For example, I often use the moment
> of pressing 'RET' to ensure that the time of pressing 'RET'
> is the time that the file timestamp will be set to.

The timestamp will be set to a few milliseconds in the past, yes, but is
this really a problem? If it is you should fix this in a different way
because having a DEFAULT argument which is different of what you have
when you press RET is a real issue:

As a third party completion package maintainer, how do I know when a
completing-read use "foo" as default that when the user press RET he
will endup with "bar" ?

-- 
Thierry
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 1 year and 1 day ago.

Previous Next


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