From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lowell Gilbert Newsgroups: gmane.emacs.help Subject: Re: Hooks for new buffers? Date: Fri, 05 Apr 2013 10:45:33 -0400 Organization: A noiseless patient Spider Message-ID: <44mwtdm3xu.fsf@lowell-desk.lan> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365278510 28092 80.91.229.3 (6 Apr 2013 20:01:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 6 Apr 2013 20:01:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 06 22:01:51 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UOZIn-0007UX-BN for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 22:01:29 +0200 Original-Received: from localhost ([::1]:34162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOMgg-0007fJ-7w for geh-help-gnu-emacs@m.gmane.org; Sat, 06 Apr 2013 02:33:18 -0400 Original-Path: usenet.stanford.edu!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 Injection-Info: mx05.eternal-september.org; posting-host="987c50db848b35afff7deb022985ba62"; logging-data="12183"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+JmeAlMLILIrXD0x3M0P1Q" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) Cancel-Lock: sha1:Krfu+W3npNAoifYICKi8MQRrXDY= sha1:WdKJSPgbZrftrIeKiWv5ZI2Xq9s= Original-Xref: usenet.stanford.edu gnu.emacs.help:197749 X-Mailman-Approved-At: Sat, 06 Apr 2013 02:31:25 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90014 Archived-At: wgreenhouse@riseup.net (W. Greenhouse) writes: > Steven Degutis 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).