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

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

bug#52023: [External] : Re: bug#52023: 27.2; Enhancement: `this-command-


From: Drew Adams
Subject: bug#52023: [External] : Re: bug#52023: 27.2; Enhancement: `this-command-invocation-(buffer|window)'
Date: Sun, 21 Nov 2021 21:36:49 +0000

> > Enhancement request: please consider adding functions
> > `this-command-invocation-buffer' and `this-command-invocation-window'.
> > (Other names OK.)
> >
> > They would return, respectively, the buffer that was current, and the
> > window that was selected, when the command that's the value of
> > `this-command' was invoked.
> >
> > Currently, to get this information a workaround would be to use a
> > `pre-command-hook' function that sets variables, and then to test those
> > variables.
> 
> Maybe these functions give what you need?
> 
>   (old-selected-window)
>   (window-buffer (old-selected-window))

Thanks for looking into this.  I wasn't
aware of that function.

But I don't see how it provides either of
the requested functions.

As for the second sexp you show: the buffer
that's current when a command is invoked
need not be displayed in any window.

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?

(The doc string for that `old-*' function
seems unclear to me.  What's the spec for
the "window selected the last time window
change functions were run"?  Is that the
`selected-window' just before those
functions were run?  Is it a window that
gets selected by running those functions?)





reply via email to

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