From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: Hooks for new buffers? Date: Fri, 05 Apr 2013 10:47:02 +0200 Message-ID: <515E8F86.7090400@easy-emacs.de> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1365151568 30892 80.91.229.3 (5 Apr 2013 08:46:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Apr 2013 08:46:08 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 05 10:46:37 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 1UO2I6-0004Zz-3z for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Apr 2013 10:46:34 +0200 Original-Received: from localhost ([::1]:49345 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2Hg-0004bl-S4 for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Apr 2013 04:46:08 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2HH-0004Rw-1y for help-gnu-emacs@gnu.org; Fri, 05 Apr 2013 04:45:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UO2HB-00069r-83 for help-gnu-emacs@gnu.org; Fri, 05 Apr 2013 04:45:42 -0400 Original-Received: from moutng.kundenserver.de ([212.227.17.9]:49434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO2HA-000695-Gy for help-gnu-emacs@gnu.org; Fri, 05 Apr 2013 04:45:37 -0400 Original-Received: from [192.168.178.21] (brln-4db9a8f7.pool.mediaWays.net [77.185.168.247]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0MaE2a-1U4IUw0HbE-00Jwyy; Fri, 05 Apr 2013 10:45:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 In-Reply-To: X-Provags-ID: V02:K0:RZpHS2oY2Niw1gj7Ya2Yn8o80PDTsRtmMiHHYM9+ND9 GbWBM4/Dcrly3gFsZh9OIry1pbxVOf0MlW0vOEsJWJIcVGFjUA lP2851XF9eRmZ05bwlwm+GHCgSWkBhQ5MFUTv1nhy1QMVoSsx1 l5oyvz6ZOiDWLwKj0qFw9/cnn+FrEV2/9KhDUtYUzAYFayoKGh /3vFfJdCeisqRH56tnORHNRUOXPYrN14XKZ3lxq71Cg6HGTYqR Uv6cKoHZTAVEs72INcsi0aa+Pr6NASmLWpcJs+x3bmE+ted2Ar YF1S22VdrmbERc4IaUc+mt7WpPI/c/RxMH6zfbSBLuLDydL6w9 QlugFjkTjM15f7V9pNZ9TvyrqBuGCDXHgVt94TVNq X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.17.9 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:90005 Archived-At: Am 04.04.2013 22:12, schrieb Steven Degutis: > I wrote auto-dim-other-buffers.el ( > https://github.com/sdegutis/auto-dim-other-buffers.el) a few days ago, > which applies a "dimmed" face to non-current buffers. > > It adds to post-command-hook and after-change-major-mode-hook, the first as > a catch-all "something changed" and the second as a hacky way of saying "a > new buffer just got created". > > This mostly works. But sometimes new buffers are created that don't change > major modes. Hi Steven, AFAIU it's quite simple: there is only one buffer current, where all other will be subject to "dimmed". If right, solution will not be to look what others do, but run-with-idle timer a routine dimming everything except the current buffer. Just my thoght, Andreas For example, *magit-process* gets created at some point, and > when I show it via $ inside magit-status, it's not dimmed. So it's not > changing major modes. > > When I show the buffer via $, it probably triggers the post-command-hook, > but my hook tries to be efficient, by only looking at the previous > current-buffer and the new current-buffer. And this isn't either of those, > since it just shows up in a new window but isn't given focus. I'm sure > there are other situations like this. > > 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 >