unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: John Wiegley <jwiegley@gmail.com>
To: raman <raman@google.com>
Cc: Richard Stallman <rms@gnu.org>, emacs-devel@gnu.org
Subject: Re: HowTo: Run a hook when a buffer becomes "current"
Date: Tue, 22 Dec 2015 09:47:36 -0800	[thread overview]
Message-ID: <m2mvt2bcjr.fsf@newartisans.com> (raw)
In-Reply-To: <p91d1u4v153.fsf@google.com> (raman@google.com's message of "Thu,  17 Dec 2015 20:20:08 -0800")

>>>>> raman  <raman@google.com> 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



  parent reply	other threads:[~2015-12-22 17:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 16:37 HowTo: Run a hook when a buffer becomes "current" raman
2015-12-16 21:51 ` Nicolas Richard
2015-12-16 23:04   ` David Kastrup
2015-12-16 23:20     ` T.V Raman
2015-12-17  4:58 ` Richard Stallman
2015-12-17 16:15   ` raman
2015-12-18  4:04     ` Richard Stallman
2015-12-18  4:20       ` raman
2015-12-18  9:30         ` David Kastrup
2015-12-18 16:15           ` raman
2015-12-19  4:37         ` Richard Stallman
2015-12-19 16:43           ` raman
2015-12-19 17:07             ` Dmitry Gutov
2015-12-20  3:07               ` raman
2015-12-22 17:47         ` John Wiegley [this message]
2015-12-22 18:19           ` raman
2015-12-18  1:56 ` Karl Fogel
2015-12-18  3:19   ` raman
2015-12-18 12:14     ` Marcin Borkowski
2015-12-18 16:18       ` raman
2015-12-18 17:06         ` David Kastrup
2015-12-18 18:13           ` Marcin Borkowski
2015-12-18 18:28             ` T.V Raman
2015-12-18 20:12               ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2mvt2bcjr.fsf@newartisans.com \
    --to=jwiegley@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=raman@google.com \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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