--- Begin Message ---
Subject: |
24.2.50; dired-do-touch doesn't recognize empty input in minibuffer |
Date: |
Mon, 10 Sep 2012 01:43:14 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) |
`dired-do-touch' used to get the current time for empty input.
Its prompt says that the default value is "now".
But currently its default value is the file modification time,
not the current time. Thus `T RET' has no effect in dired.
The problem is that `dired-mark-read-string' now uses `completing-read'
(to be able to provide completion) instead of `read-from-minibuffer'.
These functions differ in how they handle defaults:
`read-from-minibuffer' returns the empty string for empty input, but
`completing-read' returns the default value and can't recognize
empty input.
This requires a new function that provides completion like
`completing-read-default' but without these two lines:
(when (and (equal result "") def)
(setq result (if (consp def) (car def) def)))
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#12399: 24.2.50; dired-do-touch doesn't recognize empty input in minibuffer |
Date: |
Fri, 14 Sep 2012 02:42:53 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (x86_64-pc-linux-gnu) |
>> There's another way to do that: check (eq val default), since the
>> returned value will be `eq' to the `default' if the minibuffer was
>> empty, whereas if it comes from a non-empty minibuffer it will at best
>> be `equal'.
>
> I tried this in the following patch and it works.
Installed.
--- End Message ---