Subject: bug#70725: 29.3; dired-do-touch completion

From: Juri Linkov <[email-masked]>
Date: Mon, 06 May 2024 09:50:17 +0300

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