emacs-devel
[Top][All Lists]
Advanced

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

Re: HowTo: Run a hook when a buffer becomes "current"


From: John Wiegley
Subject: Re: HowTo: Run a hook when a buffer becomes "current"
Date: Tue, 22 Dec 2015 09:47:36 -0800
User-agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin)

>>>>> raman  <address@hidden> writes:

> I'm implementing myself something I'm calling "SoundScapes" --I'm building
> it within Emacspeak but it may well be useful more generally.

I really like the idea of soundscapes, Raman.

As a first approximation -- that is, before requiring a new hook to try out
the utility of your idea -- I'd recommend using a timer that checks the buffer
of the currently selected window is.

I doubt it's even desirable to change the music instantly whenever the buffer
changes; in some cases, that could become quite jarring. A timer not only
solves your problem quite simply, but allows for customization opportunities
like "cross-fading" after you know that the user has been in the new buffer
for X milliseconds. This would prevent quick Org capture buffers from
disrupting the music of my Gnus summary buffer, for example.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2



reply via email to

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