all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* A way for interactive to modify a let-bound variable?
@ 2016-02-12 16:41 Kaushal Modi
  2016-02-12 16:57 ` Drew Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Kaushal Modi @ 2016-02-12 16:41 UTC (permalink / raw)
  To: Help Gnu Emacs mailing list

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-02-12 19:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-12 16:41 A way for interactive to modify a let-bound variable? Kaushal Modi
2016-02-12 16:57 ` Drew Adams
2016-02-12 17:17   ` Michael Heerdegen
2016-02-12 18:18     ` Kaushal Modi
2016-02-12 18:38       ` Michael Heerdegen
2016-02-12 18:49         ` Kaushal Modi
2016-02-12 19:12           ` Michael Heerdegen
2016-02-12 19:20             ` Kaushal Modi
2016-02-12 19:30     ` Marcin Borkowski

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.