bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Lars Ingebrigtsen
Subject: bug#50811: 28.0.50; Misleading Docstring for read-string function
Date: Mon, 27 Sep 2021 06:22:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Codruț Constantin Gușoi <mail@codrut.pro> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]