From helmut@gmail.com Sun Nov 23 20:14:37 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.0 required=4.0 tests=AWL,BAYES_00,FOURLA, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at submit) by emacsbugs.donarmstrong.com; 24 Nov 2008 04:14:38 +0000 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAO4EYwd008043 for ; Sun, 23 Nov 2008 20:14:35 -0800 Received: from mx10.gnu.org ([199.232.76.166]:44284) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1L4Sq2-0007fk-Nb for emacs-pretest-bug@gnu.org; Sun, 23 Nov 2008 23:14:19 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1L4QXj-0001wO-BJ for emacs-pretest-bug@gnu.org; Sun, 23 Nov 2008 20:47:21 -0500 Received: from cgp1.rolmail.net ([195.254.252.190]:41602 helo=rolmail.net) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L3vrT-0007lC-Fc for emacs-pretest-bug@gnu.org; Sat, 22 Nov 2008 12:01:35 -0500 Received: from dummy.name; Sat, 22 Nov 2008 18:01:32 +0100 Received: from dummy.name; Sat, 22 Nov 2008 18:01:40 +0100 From: Helmut Eller To: emacs-pretest-bug@gnu.org Subject: 23.0.60; display-buffer doesn't honor NOT-THIS-WINDOW argument Date: Sat, 22 Nov 2008 18:01:37 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) I think that display-buffer returns sometimes the selected window even if the NOT-THIS-WINDOW argument is true. Here is a test case: (progn (defun display-buffer-checked (buffer) (let ((selected (selected-window)) (window (display-buffer buffer t))) (when (eq selected window) (error "display-buffer returned selected window")) window)) (let ((foo (get-buffer-create "foo")) (bar (get-buffer-create "bar"))) (select-window (get-buffer-window "*scratch*")) (save-selected-window (select-window (display-buffer-checked foo))) (save-selected-window (select-window (display-buffer-checked bar))))) display-buffer-checked just calls display-buffer and checks that the returned window isn't the selected window. From looking at the code of display-buffer, I would say that display-buffer returns the lru window even if that's the selected window. Helmut. In GNU Emacs 23.0.60.10 (i686-pc-linux-gnu, GTK+ Version 2.8.20) of 2008-11-22 on xaital Windowing system distributor `The X.Org Foundation', version 11.0.70101000 configured using `configure '--without-sound' '--without-pop' '--without-gif' '--without-tiff'' From rudalics@gmx.at Mon Nov 24 02:03:36 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.2 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MIXEDBDN,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1415) by emacsbugs.donarmstrong.com; 24 Nov 2008 10:03:36 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mAOA3Wpk003009 for <1415@emacsbugs.donarmstrong.com>; Mon, 24 Nov 2008 02:03:33 -0800 Received: (qmail invoked by alias); 24 Nov 2008 10:03:26 -0000 Received: from 62-47-54-167.adsl.highway.telekom.at (EHLO [62.47.54.167]) [62.47.54.167] by mail.gmx.net (mp062) with SMTP; 24 Nov 2008 11:03:26 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19GyNUOJY9GGKVs4bujh1lXngIkiGDEL+R16hM77m 8OQhv6+5vHJLNM Message-ID: <492A7B14.7060508@gmx.at> Date: Mon, 24 Nov 2008 10:59:48 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Helmut Eller CC: 1415@debbugs.gnu.org Subject: Re: bug#1415: 23.0.60; display-buffer doesn't honor NOT-THIS-WINDOW argument References: In-Reply-To: Content-Type: multipart/mixed; boundary="------------090005070809060503030509" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999,0.59 This is a multi-part message in MIME format. --------------090005070809060503030509 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > I think that display-buffer returns sometimes the selected window even > if the NOT-THIS-WINDOW argument is true. Here is a test case: > > (progn > (defun display-buffer-checked (buffer) > (let ((selected (selected-window)) > (window (display-buffer buffer t))) > (when (eq selected window) > (error "display-buffer returned selected window")) > window)) > > (let ((foo (get-buffer-create "foo")) > (bar (get-buffer-create "bar"))) > (select-window (get-buffer-window "*scratch*")) > (save-selected-window > (select-window (display-buffer-checked foo))) > (save-selected-window > (select-window (display-buffer-checked bar))))) > > > display-buffer-checked just calls display-buffer and checks that the > returned window isn't the selected window. From looking at the code of > display-buffer, I would say that display-buffer returns the lru window > even if that's the selected window. Nice bug. Thanks for the precise report and test case! Emacs 22 handled this, but I'm too lazy to figure out how. Please try the attached patch. martin --------------090005070809060503030509 Content-Type: text/plain; name="window.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.diff" *** window.el.~1.168.~ 2008-11-18 22:26:34.390625000 +0100 --- window.el 2008-11-24 10:31:29.953125000 +0100 *************** *** 1038,1051 **** (window--try-to-split-window (get-lru-window frame-to-use t)))) (window--display-buffer-2 buffer window-to-use))) ! ((setq window-to-use ! ;; Reuse an existing window. ! (or (get-lru-window frame-to-use) ! (get-buffer-window buffer 'visible) ! (get-largest-window 'visible nil) ! (get-buffer-window buffer 0) ! (get-largest-window 0 nil) ! (frame-selected-window (funcall pop-up-frame-function)))) (window--even-window-heights window-to-use) (window--display-buffer-2 buffer window-to-use))))) --- 1038,1063 ---- (window--try-to-split-window (get-lru-window frame-to-use t)))) (window--display-buffer-2 buffer window-to-use))) ! ((let ((window-to-undedicate ! ;; When NOT-THIS-WINDOW is non-nil, temporarily dedicate ! ;; the selected window to its buffer, to avoid that some of ! ;; the routines below choose it. (Bug#1415) ! (and not-this-window ! (not (window-dedicated-p (selected-window))) ! (set-window-dedicated-p (selected-window) t) ! (selected-window)))) ! (unwind-protect ! (setq window-to-use ! ;; Reuse an existing window. ! (or (get-lru-window frame-to-use) ! (get-buffer-window buffer 'visible) ! (get-largest-window 'visible) ! (get-buffer-window buffer 0) ! (get-largest-window 0) ! (frame-selected-window (funcall pop-up-frame-function)))) ! (when (window-live-p window-to-undedicate) ! ;; Restore dedicated status of selected window. ! (set-window-dedicated-p window-to-undedicate nil)))) (window--even-window-heights window-to-use) (window--display-buffer-2 buffer window-to-use))))) --------------090005070809060503030509-- From helmut@gmail.com Wed Nov 26 13:13:56 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-5.6 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_DRUGS_REL8,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1415) by emacsbugs.donarmstrong.com; 26 Nov 2008 21:13:56 +0000 Received: from rolmail.net (cgp1.rolmail.net [195.254.252.190]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id mAQLDqxZ022511 for <1415@emacsbugs.donarmstrong.com>; Wed, 26 Nov 2008 13:13:53 -0800 Received: from dummy.name; Wed, 26 Nov 2008 22:13:49 +0100 Received: from dummy.name; Wed, 26 Nov 2008 22:13:58 +0100 From: Helmut Eller To: martin rudalics Cc: 1415@debbugs.gnu.org Subject: Re: bug#1415: 23.0.60; display-buffer doesn't honor NOT-THIS-WINDOW argument References: <492A7B14.7060508@gmx.at> Date: Wed, 26 Nov 2008 22:13:58 +0100 In-Reply-To: <492A7B14.7060508@gmx.at> (martin rudalics's message of "Mon, 24 Nov 2008 10:59:48 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii * martin rudalics [2008-11-24 10:59+0100] writes: > > Nice bug. Thanks for the precise report and test case! > > Emacs 22 handled this, but I'm too lazy to figure out how. > > Please try the attached patch. I've used the patch now for two days and it seems to work well. Thank you for the quick fix. Helmut. From rudalics@gmx.at Thu Nov 27 05:46:51 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA, HAS_BUG_NUMBER,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 1415-done) by emacsbugs.donarmstrong.com; 27 Nov 2008 13:46:51 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id mARDklSq018819 for <1415-done@emacsbugs.donarmstrong.com>; Thu, 27 Nov 2008 05:46:49 -0800 Received: (qmail invoked by alias); 27 Nov 2008 13:46:41 -0000 Received: from 62-47-58-151.adsl.highway.telekom.at (EHLO [62.47.58.151]) [62.47.58.151] by mail.gmx.net (mp059) with SMTP; 27 Nov 2008 14:46:41 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1857FxVVGA5mIanlwZeTKUe5Ov2ZB0Rw58kGvubhG JIELqyoXNU0Rq8 Message-ID: <492EA377.40504@gmx.at> Date: Thu, 27 Nov 2008 14:41:11 +0100 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: 1415-done@debbugs.gnu.org CC: Helmut Eller Subject: Re: bug#1415: 23.0.60; display-buffer doesn't honor NOT-THIS-WINDOW argument References: <492A7B14.7060508@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.85 > I've used the patch now for two days and it seems to work well. I've checked in a slightly more restrictive version. Please try again and keep an eye on this. Thanks again for reporting, martin. From unknown Mon Aug 18 08:54:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: $requester Subject: Internal Control Message-Id: bug archived. Date: Thu, 25 Dec 2008 15:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A log time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator