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

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

Re: How to know what buffer was current when a command is invoked?


From: TRS-80
Subject: Re: How to know what buffer was current when a command is invoked?
Date: Tue, 05 Apr 2022 20:43:56 -0400
User-agent: Roundcube Webmail/1.4.12

On 2021-11-17 17:08, Drew Adams wrote:
I want to give an arbitrary command some buffer-local
behavior without advising it.  (I can do it by advising,
of course, but I want to also be able to do it without
advising.)

E.g., just looking at some property on a command symbol,
I want to then do something only in the buffer that was
current when the command was invoked (however it was
invoked).

Checking the property value can happen any time (and
any number of times) after the command is invoked.
The buffer-local behavior needs to change to reflect
the current value of the property.

(It's OK to limit this to buffers that are displayed.
I tried looking at `window-buffer-change-functions'
etc., but didn't notice anything that might help.)

Anyone have an idea how to do this?  I'm guessing, so
far, that it's not possible from Lisp.  But I'm hoping
someone knows better, or at least knows for sure.  Thx.

I suppose you consider a wrapper function as 'advising'? That's the approach that comes to my mind first. Alas, I am but a low (to mid level, at best) wizard at the end of the day.

That's assuming I am following you in the first place. I had to think a lot harder (and read the post several times), due to the generalization.

Well, this was some months ago anyway, I guess you figured it out by now.

Cheers,
TRS-80



reply via email to

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