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

[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: Fri, 16 Jul 2021 21:35:05 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

lisa-asket@perso.be writes:

> Many thanks, I just did not follow what asynchronously meant.

Fair enough.

> Can one assign default values when `read-from-minibuffer` in empty?

“read-from-minibuffer” as well as the functions suggested by Stefan
Monnier (“read-number”, “read-string”, …) have a parameter DEFAULT or
DEFAULT-VALUE (or similar) that you may use for that purpose; read their
documentation.

You may also check the return value of “read-from-minibuffer” or
“read-string” and act accordingly:

    (let ((read-result (read-from-minibuffer "Prompt: ")))
      (if (seq-empty-p read-result)
        (setq read-result "default-value")))

See also:

    <https://www.gnu.org/software/emacs/manual/html_node/eintr/if.html>

-- 
Felix Dietrich



reply via email to

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