Subject: bug#50811: 28.0.50; Misleading Docstring for read-string function

From: Codruț Constantin Gușoi <[email-masked]>
Date: Mon, 27 Sep 2021 04:35:17 +0000

Hello Larsi

But why, I don't see the benefit?

That's exactly the behaviour I need for renaming a file, for example; a prompt pre-filled with the current filename. It's the same UX as in every other program that does this sort of functionality and the extra keypress makes it harder to use.

This is more like a styleguide for emacs lips development what you're describing, I hope you won't change the function behaviour in the future, it's working well as it is right now.

Cheers,
Codruț

www.codrut.pro

-------- Original Message --------
On 27 Sep 2021, 07:22, Lars Ingebrigtsen wrote:

> Codruț Constantin Gușoi <[email-masked]> writes:
>
>> If non-nil, second arg INITIAL-INPUT is a string to insert before reading.
>> This argument has been superseded by DEFAULT-VALUE and should normally be nil
>> in new code. It behaves as INITIAL-CONTENTS in `read-from-minibuffer' (which
>> see).
>> ```
>>
>> This is misleading since INITIAL-INPUT behaves differently from DEFAULT-VALUE:
>
> The doc string isn't claiming that INITIAL-INPUT behaves like
> DEFAULT-VALUE -- it says that you shouldn't use INITIAL-INPUT.
>
> The point is that we want to move away from pre-filled prompts in Emacs,
> and instead put the default in the "future history", i.e., say
>
> (read-string "PROMPT " nil nil "B")
>
> and then the user should `M-n' to edit the default.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
> bloggy blog: http://lars.ingebrigtsen.no