How can I store the selected value in a let
variable when using completing-read
?
(let ( (selc '("Lower-Skeleton" "Upper-Skeleton")) )
(completing-read "Vista: " selc nil t "Upper-Skeleton")
You use setq
just like with any other variable:
(let (foo)
(setq foo (completing-read ....))
;; do something with `foo'
...
)
foo
's scope is limited to the body of the let
form: it's a local variable. Other than that, it's just like any other variable.
let
in the question, other than in the title. And it's unclear what you mean by a "selected value".completing-read
will direct the user to make a selection. The user selection will then be used at a later stage, so I need to store the selected value.selection
is about selecting text (e.g. an active region).