[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: terminal command with output in current buffer
From: |
Felix Dietrich |
Subject: |
Re: terminal command with output in current buffer |
Date: |
Tue, 20 Jul 2021 14:55:24 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:
> Felix Dietrich wrote:
>
>> (let ((read-result (read-from-minibuffer "Prompt: ")))
>> (if (seq-empty-p read-result)
>> (setq read-result "default-value")))
>
> What? :P `setq' again...
>
> (let*((read-result (read-from-minibuffer "Prompt: "))
> (value (if (string= "" read-result)
> "default-value"
> read-result) ))
> value)
This is whatʼs bothering you the most? ;) I have reread the part of the
elisp manual about reading text from the minibuffer, and it suggests one
“do all minibuffer input as part of reading the arguments for a command,
in the ‘interactive’ specification.” [1] Not directly applicable to a
stand-alone let snippet but relevant in the context of the thread (which
involved reading user input for an interactive command).
Footnotes:
[1] (info "(elisp) Text from Minibuffer")
--
Felix Dietrich
- terminal command with output in current buffer, (continued)
- 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, 2021/07/20
- Re: ‘read-string’ over ‘read-from-minibuffer’, Emanuel Berg, 2021/07/20
- Re: terminal command with output in current buffer,
Felix Dietrich <=
- 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
- Re: Run terminal command with output in current buffer, Stefan Monnier, 2021/07/19
- Re: Run terminal command with output in current buffer, Emanuel Berg, 2021/07/19