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

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

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


From: Kaushal Modi
Subject: Re: A way for interactive to modify a let-bound variable?
Date: Fri, 12 Feb 2016 13:49:00 -0500

> FWIW, for the side effect you want, a :before advice is still
> sufficient.

I ended up using :around, because I need to call (message ..) *after*
(apply orig-fun args). I need my message to be displayed last in the echo
area after whatever orig-fun could be displaying.

> Well, `let' returns the result of the evaluation of the last form, so
> you have to arrange that this last form is your (apply ...), or evals to
> the result of it.

It's a bit tricky if I put let inside interactive. If I do that, the let
form has to return the list that interactive needs. But I also need the
let-bound msg variable after calling (apply orig-fun args). So that implies
that I would need something like (interactive (let (msg) .. (apply orig-fun
args) (message msg))), which does not look right (and also does not work).

> It may work, but that doesn't define an interactive spec for your
> function, so again you change the function you want to advice, which you
> wanted to avoid.

Exactly, that does not work at all. The (interactive ..) form in there is
as good as it not being there, because it doesn't do anything if it is
wrapped in (let ..).


reply via email to

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