Re: Advicing the `interactive' form of a command

Roland Winkler <[email protected]>
Newsgroups gmane.emacs.help
Message-ID <[email protected]>
On Sun, May 03 2026, Stéphane Marks wrote:
> If you put a print statement in your advice, you'll see
> it does work for sure.

For me, the print statement happens to late: from what I can tell,
the advice goes around the body of the adviced function.  So I can
print, in particular, the args passed to the body.

> But I sense that maybe you want to advise 'read-buffer-to-switch
> instead.  Give that a try and see if that does what you're looking
> for.

Thanks, this is indeed a clean solution for my particular problem
that works as expected.  However, this will not work for other commands
if the command uses a more sophisticated interactive spec without
delegating this work to a separate noninteractive function like
`read-buffer-to-switch'.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.