all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lowell Gilbert <lgusenet@be-well.ilk.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Hooks for new buffers?
Date: Fri, 05 Apr 2013 10:45:33 -0400	[thread overview]
Message-ID: <44mwtdm3xu.fsf@lowell-desk.lan> (raw)
In-Reply-To: mailman.23572.1365141815.855.help-gnu-emacs@gnu.org

wgreenhouse@riseup.net (W. Greenhouse) writes:

> Steven Degutis <sbdegutis@gmail.com> writes:
>
>> The easiest way to solve this is to find a hook that's called when
>> new buffers are created, even if that's not its official purpose.
>> Apparently after-change-major-mode-hook isn't enough, presumably
>> because these never changed major modes. So is there such a hook?
>>
>> And if not, is there at least some hook that happens whenever new
>> windows are opened?
>>
>> -Steven
>
> `window-configuration-change-hook', maybe?

I was going to suggest that, but I wanted to test it first because its
documentation is unclear on whether it gets run for a new buffer in an
existing window (and haven't gotten around to said testing). Another
possibility was buffer-list-update-hook, but you'd have to figure out on
your own whether there was a new buffer and if so, which it was.

'advice'ing get-buffer-create should catch all the cases, but that's a C
function, and it might be wandering into deep magic (and intractable
debugging).


      parent reply	other threads:[~2013-04-05 14:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 20:12 Hooks for new buffers? Steven Degutis
2013-04-05  6:03 ` W. Greenhouse
2013-04-05  8:47 ` Andreas Röhler
2013-04-05 11:09   ` Andreas Röhler
     [not found] ` <mailman.23572.1365141815.855.help-gnu-emacs@gnu.org>
2013-04-05 14:45   ` Lowell Gilbert [this message]

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

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

  git send-email \
    --in-reply-to=44mwtdm3xu.fsf@lowell-desk.lan \
    --to=lgusenet@be-well.ilk.org \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.