From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Wrong window end reported after splitting window Date: Sun, 24 Feb 2008 10:34:21 -0500 Message-ID: References: <47C06B77.4040201@gmx.at> <47C09FFA.4040604@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1203867381 18053 80.91.229.12 (24 Feb 2008 15:36:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 24 Feb 2008 15:36:21 +0000 (UTC) Cc: Juanma Barranquero , Emacs Devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 24 16:36:46 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JTIu9-0001bo-WC for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 16:36:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTIte-0006Pz-28 for ged-emacs-devel@m.gmane.org; Sun, 24 Feb 2008 10:36:10 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JTIt2-00063O-Vm for emacs-devel@gnu.org; Sun, 24 Feb 2008 10:35:33 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JTIt0-000619-Bf for emacs-devel@gnu.org; Sun, 24 Feb 2008 10:35:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JTIt0-000612-2j for emacs-devel@gnu.org; Sun, 24 Feb 2008 10:35:30 -0500 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JTIsz-00028m-Lh for emacs-devel@gnu.org; Sun, 24 Feb 2008 10:35:29 -0500 Original-Received: from ceviche.home (vpn-132-204-232-101.acd.umontreal.ca [132.204.232.101]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id m1OFZS6I015511 for ; Sun, 24 Feb 2008 10:35:28 -0500 Original-Received: by ceviche.home (Postfix, from userid 20848) id C2425B41A8; Sun, 24 Feb 2008 10:34:21 -0500 (EST) In-Reply-To: <47C09FFA.4040604@gmx.at> (martin rudalics's message of "Sat, 23 Feb 2008 23:36:42 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-NAI-Spam-Score: -2.5 X-NAI-Spam-Rules: 2 Rules triggered BAYES_00=-2.5, HAS_X_HELO=0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90235 Archived-At: > I suppose what you want is to investigate all affected windows when the > corresponding configuration changes. This means we'd have to change > `delete-window', `enlarge-window', `shrink-window', > `adjust-window-trailing-edge' and `set-window-configuration' as to walk > all windows on the frame, check whether one of the associated buffers > has a non-nil local value for `window-configuration-change-hook', and > run that hook (in addition to a global hook). Indeed, it may be "too much work" but might be worth the trouble. Otherwise buffer-local settings for window-configuration-change-hook simply don't make any sense. > The question here is what > to do when the same buffer is shown in two or more windows on the > affected frame - should we call the hook twice in that case? The behavior of window-configuration-change-hook is clearly documented as being run "once per frame", so the hook function are currently responsible for cycling through the windows of the frame if/when needded. [ This doesn't rule out running the hook twice or more, tho, since we don't specifically say how careful Emacs should be in avoiding to run it redundantly. ] Looking at it again, maybe the right thing to do is to make the window-configuration-change-hook be treated differently for buffer-local vs global settings: the global settings are run like now, but we also cycle through the windows looking for buffer-local settings and we run each one of them "once per window". At least for image-mode and doc-view-mode's use of window-configuration-change-hook, this would do the right thing. Stefan