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: completing-read (and M-x) with pop-up-frames non-nil changes frame focus Date: Fri, 15 Jul 2005 03:35:34 -0400 Message-ID: <87zmsoh6a8.fsf-monnier+emacs@gnu.org> References: <87r7e0iqwh.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1121415507 6874 80.91.229.2 (15 Jul 2005 08:18:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 15 Jul 2005 08:18:27 +0000 (UTC) Cc: Emacs-Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 15 10:18:23 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DtLOH-0008Ss-Dv for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2005 10:17:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtLQ2-0006VW-8G for ged-emacs-devel@m.gmane.org; Fri, 15 Jul 2005 04:19:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DtLEm-0001V1-EM for emacs-devel@gnu.org; Fri, 15 Jul 2005 04:08:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DtLDC-0000GC-Uz for emacs-devel@gnu.org; Fri, 15 Jul 2005 04:06:24 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DtLCZ-0007W9-Pl for emacs-devel@gnu.org; Fri, 15 Jul 2005 04:05:44 -0400 Original-Received: from [209.226.175.110] (helo=tomts43-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DtKrc-0002Xc-Pf for emacs-devel@gnu.org; Fri, 15 Jul 2005 03:44:04 -0400 Original-Received: from alfajor ([70.48.83.137]) by tomts43-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050715073534.XRSD2981.tomts43-srv.bellnexxia.net@alfajor>; Fri, 15 Jul 2005 03:35:34 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 768F9D7571; Fri, 15 Jul 2005 03:35:34 -0400 (EDT) Original-To: "Drew Adams" In-Reply-To: <87r7e0iqwh.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Fri, 15 Jul 2005 01:27:08 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:40909 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40909 > So maybe Fdisplay_buffer should protect against it with something like the > patch below. Does it help? Sorry about the botched patch. Try this one instead, Stefan --- window.c 13 jui 2005 13:58:39 -0400 1.512 +++ window.c 15 jui 2005 03:30:07 -0400 @@ -3475,7 +3475,13 @@ we need to create a new frame. */ if (pop_up_frames || last_nonminibuf_frame == 0) { + Lisp_Object w = Fselected_window (); + struct gcpro gcpro1; + GCPRO1 (w); window = Fframe_selected_window (call0 (Vpop_up_frame_function)); + if (Fwindow_live_p (w)) + Fselect_window (w, Qt); + UNGCPRO; Fset_window_buffer (window, buffer, Qnil); return display_buffer_1 (window); }