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

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

A way for interactive to modify a let-bound variable?


From: Kaushal Modi
Subject: A way for interactive to modify a let-bound variable?
Date: Fri, 12 Feb 2016 11:41:07 -0500

Hi,

The below snippet will of course not work but I would like to achive
something like that:

(defun my-dummy-fn ()
  (let (msg)
    (interactive (progn
                   (if (use-region-p)
                       (setq msg "Region")
                     (setq msg "No region"))
                   nil))
    (message msg)))


This is a very simplified example. But I need to change a let-bound
variable in the interactive form based on some condition and then use that
variable in the defun body.

Is that possible?

--
Kaushal Modi


reply via email to

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