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

From: Thierry Volpiatto <[email-masked]>
Date: Mon, 06 May 2024 05:40:36 +0000

Juri Linkov <[email-masked]> writes:

>> I didn't check carefully and I see now that the prompt says "now" for
>> DEFAULT but indeed the DEFAULT is the timestamp of the selected file and
>> not `current-time`, so to reflect what the prompt says (now) we have to
>> modify DEFAULT, maybe like this in `dired-do-chxxx`:
>>
>> @@ -437,4 +437,7 @@
>> -			   (format-time-string
>> -			    "%Y%m%d%H%M.%S"
>> -			    (file-attribute-modification-time
>> -			     (file-attributes default-file))))
>> +			   (list
>> +                            (format-time-string
>> +			     "%Y%m%d%H%M.%S" (current-time))
>> +                            (format-time-string
>> +			     "%Y%m%d%H%M.%S"
>> +			     (file-attribute-modification-time
>> +			      (file-attributes default-file)))))
>
> This breaks "now" that would not be "now" anymore because of
> special-handling that uses "-t":

Yes exactly like current code, see below.

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.

-- 
Thierry