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

From: Juri Linkov <[email-masked]>
Date: Sun, 05 May 2024 09:46:53 +0300

> 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":

			      (unless (or (string-equal new-attribute "")
					  ;; Use `eq' instead of `equal'
					  ;; to detect empty input (bug#12399).
					  (eq new-attribute default))
				(if (eq op-symbol 'touch)
				    (list "-t" new-attribute)
				  (list new-attribute)))