|
From: | Juri Linkov |
Subject: | bug#52023: [External] : Re: bug#52023: 27.2; Enhancement: `this-command-invocation-(buffer|window)' |
Date: | Mon, 22 Nov 2021 10:06:10 +0200 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) |
>> Maybe these functions give what you need? >> >> (old-selected-window) >> (window-buffer (old-selected-window)) >... > As for the second sexp you show: the buffer > that's current when a command is invoked > need not be displayed in any window. It seems there is no such thing as `old-current-buffer' like there is `current-minibuffer-command'. > As for the first (function `old-*'), the > doc says ~ it's the window selected at the > time of (before? after?) the last window > change. > > It's not clear to me whether that's the > `selected-window' when this-command was > invoked. Is it? always? I don't know what `old-selected-window' returns when more window changes were performed by the same command. But in any case you can use `pre-command-hook' to store the original buffer and window.
[Prev in Thread] | Current Thread | [Next in Thread] |