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

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

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


From: Drew Adams
Subject: How to know what buffer was current when a command is invoked?
Date: Wed, 17 Nov 2021 22:08:59 +0000

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.

<<attachment: winmail.dat>>


reply via email to

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