[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Detect window switches?
From: |
Eli Zaretskii |
Subject: |
Re: Detect window switches? |
Date: |
Thu, 26 Sep 2013 00:44:01 +0300 |
> From: Joost Kremers <joostkremers@yahoo.com>
> Date: 25 Sep 2013 21:30:37 GMT
>
> Pascal J. Bourguignon wrote:
> > Joost Kremers <joostkremers@yahoo.com> writes:
> >
> >> Is there a way in Emacs to detect a window switch? Basically, I'd like
> >> to perform an action when a window showing a particular buffer gains or
> >> loses focus. Is there a hook or something that exposes this to Elisp?
> >
> > have a look at: window-configuration-change-hook
> > I guess you will have to filter the exact condition yourself.
>
> Mmm, the documentation of that hook says that "[t]he buffer-local part
> of this hook is run once for each window on the affected frame,
> with the relevant window selected and its buffer current." That doesn't
> seem to leave much room for determining if the relevant window has just
> lost focus.
Instead of selecting a solution, all by yourself, to a problem you
don't describe, and asking details about that solution, I suggest to
step back one notch and describe the problem you are trying to solve.
It is quite possible that solutions other and better than "detect a
window switch" will be suggested.