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

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

Re: Run terminal command with output in current buffer


From: Felix Dietrich
Subject: Re: Run terminal command with output in current buffer
Date: Fri, 16 Jul 2021 17:14:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

lisa-asket@perso.be writes:

> I experience problem with read-from-minibuffer
>
>
> (cmd-excl (read-from-minibuffer "exclude: "))

Assign values to variables by using “setq”.  Values can be arbitrary
expressions:

    (setq cmd-excl "value")

    (setq cmd-excl (read-from-minibuffer "exclude: "))

If you write “(cmd-excl…” the lisp interpreter will try to call a
function “cmd-excl”.

You can declare local variables with “let”:

    (let (cmd-excl cmd-incl)
      (setq cmd-excl "value"))

Values can be declared and assigned to at the same time:

    (let ((cmd-excl "value")
          cmd-incl)
      cmd-excl)

There is also “let*”:

    (let ((cmd-excl "value")
          (cmd-incl cmd-excl)) ; can access cmd-excl here already
                               ; because of let*
      cmd-incl)

-- 
Felix Dietrich



reply via email to

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