From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Markus Triska Newsgroups: gmane.emacs.bugs Subject: bug#1237: 23.0.60; `switch-to-buffer-other-window' sometimes uses selected window Date: Sat, 25 Oct 2008 18:09:28 +0200 Message-ID: References: <20081024102730.972E2B43B34@mt-computer.local> <4901BF54.6020908@gmx.at> <4901DFA1.2010503@gmx.at> <490207D7.3010100@gmx.at> <49031EEC.7020809@gmx.at> Reply-To: Markus Triska , 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 1224952258 15246 80.91.229.12 (25 Oct 2008 16:30:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Oct 2008 16:30:58 +0000 (UTC) Cc: 1237@emacsbugs.donarmstrong.com To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Oct 25 18:31:59 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 1Ktm3T-0003kC-5r for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 18:31:59 +0200 Original-Received: from localhost ([127.0.0.1]:39385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktm2N-0002oG-93 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Oct 2008 12:30:51 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ktm1k-0002Hv-Bm for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 12:30:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ktm1g-0002GS-Je for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 12:30:11 -0400 Original-Received: from [199.232.76.173] (port=58012 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ktm1g-0002GM-Ds for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 12:30:08 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:34572) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ktm1g-0003AH-5e for bug-gnu-emacs@gnu.org; Sat, 25 Oct 2008 12:30:08 -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 m9PGU28e021321; Sat, 25 Oct 2008 09:30:03 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id m9PGF3ER017747; Sat, 25 Oct 2008 09:15:03 -0700 X-Loop: don@donarmstrong.com Resent-From: Markus Triska Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 25 Oct 2008 16: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.122495098416368 (code B ref 1237); Sat, 25 Oct 2008 16:15:03 +0000 Original-Received: (at 1237) by emacsbugs.donarmstrong.com; 25 Oct 2008 16:09:44 +0000 Original-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 m9PG9enu016362 for <1237@emacsbugs.donarmstrong.com>; Sat, 25 Oct 2008 09:09:42 -0700 Original-Received: (qmail invoked by alias); 25 Oct 2008 16:09:34 -0000 Original-Received: from chello062178240212.3.14.tuwien.teleweb.at (EHLO mt-computer.local) [62.178.240.212] by mail.gmx.net (mp057) with SMTP; 25 Oct 2008 18:09:34 +0200 X-Authenticated: #4064391 X-Provags-ID: V01U2FsdGVkX1+VJadkNUqVPSkMYPCTLGN54I88RwSpfdFsShGFpV VcMZjWasS1ZlQn Original-Received: by mt-computer.local (Postfix, from userid 502) id EBA67B45BEC; Sat, 25 Oct 2008 18:09:28 +0200 (CEST) In-Reply-To: <49031EEC.7020809@gmx.at> (martin rudalics's message of "Sat, 25 Oct 2008 15:28:12 +0200") X-Y-GMX-Trusted: 0 X-FuHaFi: 0.62 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Sat, 25 Oct 2008 12:30:11 -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:21893 Archived-At: martin rudalics writes: > (set-frame-selected-window (car elt) (cdr elt)))) ; <--- here > (if (window-live-p save-selected-window-window) > (select-window save-selected-window-window)))))) <--- and here > > Fixing these two fixes the bug. I have to find out how to do this in an > unobtrusive way though. Would it suffice if `run_window_configuration_change_hook' re-selected the selected window at the end? i.e., 2008-10-25 Markus Triska * window.c (run_window_configuration_change_hook): Re-select the selected window, to get the most recently used window right. diff --git a/src/window.c b/src/window.c index 5931955..28e089a 100644 --- a/src/window.c +++ b/src/window.c @@ -3382,6 +3382,9 @@ run_window_configuration_change_hook (struct frame *f) } } + /* Make sure that the selected window remains most recently used. */ + Fselect_window (Fselected_window (), Qnil); + run_funs (global_wcch); unbind_to (count, Qnil); }