From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#1237: 23.0.60; `switch-to-buffer-other-window' sometimes uses selected window Date: Sat, 25 Oct 2008 15:08:10 -0400 Message-ID: References: <20081024102730.972E2B43B34@mt-computer.local> <4901BF54.6020908@gmx.at> <4901DFA1.2010503@gmx.at> Reply-To: Stefan Monnier , 1237@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1224963052 15173 80.91.229.12 (25 Oct 2008 19:30:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2008 19:30:52 +0000 (UTC) Cc: 1237@emacsbugs.donarmstrong.com To: Markus Triska Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 25 21:31:52 2008 connect(): Connection refused Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KtorX-0005EB-2D for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 21:31:51 +0200 Original-Received: from localhost ([127.0.0.1]:44967 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KtoqQ-0003ko-QW for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 15:30:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ktopy-0003NW-RZ for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 15:30:14 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ktopu-0003K0-FQ for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 15:30:12 -0400 Original-Received: from [199.232.76.173] (port=35026 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktopu-0003JU-7I for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 15:30:10 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:55010) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ktopt-00028a-Ae for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 15:30:09 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9PJU2HJ001328; Sat, 25 Oct 2008 12:30:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9PJF36t030356; Sat, 25 Oct 2008 12:15:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Stefan Monnier Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 25 Oct 2008 19:15:03 +0000 Resent-Message-ID: Resent-Sender: don@donarmstrong.com X-Emacs-PR-Message: report 1237 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 1237-submit@emacsbugs.donarmstrong.com id=B1237.122496170029024 (code B ref 1237); Sat, 25 Oct 2008 19:15:03 +0000 Original-Received: (at 1237) by emacsbugs.donarmstrong.com; 25 Oct 2008 19:08:20 +0000 Original-Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m9PJ8HDJ029017 for <1237@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 12:08:18 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEADMLA0lFxLrB/2dsb2JhbACBdb5qg0+BDQ X-IronPort-AV: E=Sophos;i="4.33,484,1220241600"; d="scan'208";a="28859198" Original-Received: from 69-196-186-193.dsl.teksavvy.com (HELO pastel.home) ([69.196.186.193]) by ironport2-out.teksavvy.com with ESMTP; 25 Oct 2008 15:08:11 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id AC1078E6C; Sat, 25 Oct 2008 15:08:10 -0400 (EDT) In-Reply-To: (Markus Triska's message of "Fri, 24 Oct 2008 17:42:54 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 25 Oct 2008 15:30:12 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:21911 Archived-At: > I constructed the following self-contained case that I hope helps you: > (defun my-walk () (walk-windows 'identity)) > (add-hook 'window-configuration-change-hook 'my-walk nil t) > (split-window) > (switch-to-buffer-other-window "test") In Emacs-22, window-configuration-change-hook did not work correctly with buffer-local hooks, but in some cases you could make it work somewhat by using `walk-window' in your hook to try and cover all the affected windows. With the code I installed to properly support buffer-local hooks on window-configuration-change-hook, the walk-window should be unnecessary, so the patch below should not break linum and might remove the problem. This said, walk-windows should probably use `norecord', what do people think? Stefan === modified file 'lisp/linum.el' --- lisp/linum.el 2008-08-31 19:46:54 +0000 +++ lisp/linum.el 2008-10-25 19:06:30 +0000 @@ -82,17 +82,22 @@ 'linum-update-current) nil t) (add-hook 'after-change-functions 'linum-after-change nil t)) (add-hook 'window-scroll-functions 'linum-after-scroll nil t) + ;; FIXME: using both window-size-change-functions and + ;; window-configuration-change-hook seems redundant. (add-hook 'window-size-change-functions 'linum-after-size nil t) (add-hook 'change-major-mode-hook 'linum-delete-overlays nil t) (add-hook 'window-configuration-change-hook - 'linum-after-config nil t) + ;; FIXME: If the buffer is shows in N windows, this + ;; will be called N times rather than once. We should use + ;; something like linum-update-window instead. + 'linum-update-current nil t) (linum-update-current)) (remove-hook 'post-command-hook 'linum-update-current t) (remove-hook 'post-command-hook 'linum-schedule t) (remove-hook 'window-size-change-functions 'linum-after-size t) (remove-hook 'window-scroll-functions 'linum-after-scroll t) (remove-hook 'after-change-functions 'linum-after-change t) - (remove-hook 'window-configuration-change-hook 'linum-after-config t) + (remove-hook 'window-configuration-change-hook 'linum-update-current t) (remove-hook 'change-major-mode-hook 'linum-delete-overlays t) (linum-delete-overlays)))