[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ‘read-string’ over ‘read-from-minibuffer’
From: |
Stefan Monnier |
Subject: |
Re: ‘read-string’ over ‘read-from-minibuffer’ |
Date: |
Tue, 20 Jul 2021 11:11:57 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Felix Dietrich [2021-07-20 14:05:03] wrote:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>> (let*((read-result (read-from-minibuffer "Prompt: "))
>> Please don't use `read-from-minibuffer` unless you're defining
>> a `read-<foo>` function.
>> Use `read-string` instead.
>
> Could you elaborate?
`read-from-minibuffer` is the function designed as the core of `read-string`,
`read-number`, `completing-read`, and friends.
If you want to write such a `read-<foo>` function, then
`read-from-minibuffer` is for you.
If you want to just read a *string*, then `read-string` is what you
should use. It doesn't behave very differently from
`read-from-minibuffer`, but it makes your code's intentions more clear.
Stefan
- terminal command with output in current buffer, (continued)
- terminal command with output in current buffer, lisa-asket, 2021/07/16
- Re: terminal command with output in current buffer, Felix Dietrich, 2021/07/16
- terminal command with output in current buffer, lisa-asket, 2021/07/17
- terminal command with output in current buff, lisa-asket, 2021/07/17
- terminal command with output in current buff, lisa-asket, 2021/07/17
- Re: terminal command with output in current buff, Felix Dietrich, 2021/07/17
- Re: terminal command with output in current buffer, Emanuel Berg, 2021/07/18
- Re: terminal command with output in current buffer, Stefan Monnier, 2021/07/19
- Re: terminal command with output in current buffer, Emanuel Berg, 2021/07/19
- ‘read-string’ over ‘read-from-minibuffer’, Felix Dietrich, 2021/07/20
- Re: ‘read-string’ over ‘read-from-minibuffer’,
Stefan Monnier <=
- Re: ‘read-string’ over ‘read-from-minibuffer’, Emanuel Berg, 2021/07/20
- Re: terminal command with output in current buffer, Felix Dietrich, 2021/07/20
- Re: terminal command with output in current buffer, Yuri Khan, 2021/07/20
- terminal command with output in current buffer, lisa-asket, 2021/07/20
- Re: Run terminal command with output in current buffer, Stefan Monnier, 2021/07/16
- Run terminal command with output in current buffer, lisa-asket, 2021/07/16
- Re: Run terminal command with output in current buffer, Stefan Monnier, 2021/07/16
- Run terminal command with output in current buffer, lisa-asket, 2021/07/16
- Run terminal command with output in current buffer, lisa-asket, 2021/07/16
- Re: Run terminal command with output in current buffer, Emanuel Berg, 2021/07/18