unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: Detect window switches?
@ 2013-09-27  5:48 martin rudalics
  0 siblings, 0 replies; 23+ messages in thread
From: martin rudalics @ 2013-09-27  5:48 UTC (permalink / raw)
  To: joostkremers; +Cc: help-gnu-emacs

 > What I'd like to
 > know is if it's possible to detect when a window goes from being
 > selected to being not selected and vice versa.
[...]
 > From what
 > I've been able to find on the internet, this isn't possible.

On current trunk try

(add-hook 'buffer-list-update-hook 'ding)

martin



^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: Detect window switches?
@ 2013-09-26 12:52 martin rudalics
  0 siblings, 0 replies; 23+ messages in thread
From: martin rudalics @ 2013-09-26 12:52 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: joostkremers

 > 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.

Did you try the "global" part?  If it doesn't work, please report a bug.

Thanks, martin



^ permalink raw reply	[flat|nested] 23+ messages in thread
* Detect window switches?
@ 2013-09-25  9:07 Joost Kremers
  2013-09-25  9:28 ` Pascal J. Bourguignon
  0 siblings, 1 reply; 23+ messages in thread
From: Joost Kremers @ 2013-09-25  9:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hi all,

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?

TIA

Joost



-- 
Joost Kremers                                   joostkremers@fastmail.fm
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2013-09-27 15:27 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.2910.1380199959.10748.help-gnu-emacs@gnu.org>
2013-09-26 16:54 ` Detect window switches? Joost Kremers
2013-09-26 17:49   ` Eli Zaretskii
     [not found]   ` <mailman.2942.1380217810.10748.help-gnu-emacs@gnu.org>
2013-09-26 18:22     ` Dan Espen
2013-09-26 18:37       ` Eli Zaretskii
     [not found]       ` <mailman.2950.1380220732.10748.help-gnu-emacs@gnu.org>
2013-09-26 19:22         ` Dan Espen
2013-09-26 19:48           ` Eli Zaretskii
2013-09-26 20:27             ` Stefan Monnier
2013-09-27  6:01               ` Eli Zaretskii
2013-09-27 13:13                 ` Stefan Monnier
     [not found]           ` <mailman.2957.1380224960.10748.help-gnu-emacs@gnu.org>
2013-09-26 20:15             ` Dan Espen
2013-09-27  5:57               ` Eli Zaretskii
     [not found]               ` <mailman.2973.1380261467.10748.help-gnu-emacs@gnu.org>
2013-09-27 15:27                 ` Dan Espen
2013-09-26 20:54           ` Joost Kremers
2013-09-26 20:51     ` Joost Kremers
2013-09-27  5:48 martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2013-09-26 12:52 martin rudalics
2013-09-25  9:07 Joost Kremers
2013-09-25  9:28 ` Pascal J. Bourguignon
2013-09-25 21:30   ` Joost Kremers
2013-09-25 21:44     ` Eli Zaretskii
     [not found]     ` <mailman.2884.1380145465.10748.help-gnu-emacs@gnu.org>
2013-09-26  2:50       ` Joost Kremers
2013-09-26  6:45         ` Eli Zaretskii
     [not found]         ` <mailman.2899.1380177976.10748.help-gnu-emacs@gnu.org>
2013-09-26 10:23           ` Joost Kremers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).