From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: save-frame-excursion? Date: Sun, 26 Jul 2009 10:00:33 -0700 Message-ID: <0D4474D473D44485A0B6D5692ABF6405@us.oracle.com> References: <87ocrb8fy0.fsf@bzg.ath.cx> <4A691B47.1050102@sift.info> <4A692A6A.4080601@sift.info> <871vo5c7lj.fsf@bzg.ath.cx> <87y6qcbeg6.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1248627651 1472 80.91.229.12 (26 Jul 2009 17:00:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 26 Jul 2009 17:00:51 +0000 (UTC) Cc: 'Robert Goldman' , 'Carsten Dominik' , emacs-devel@gnu.org To: "'Stefan Monnier'" , "'Bastien'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 26 19:00:43 2009 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 1MV75V-0000uz-4p for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2009 19:00:41 +0200 Original-Received: from localhost ([127.0.0.1]:45339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV75U-0003oj-If for ged-emacs-devel@m.gmane.org; Sun, 26 Jul 2009 13:00:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MV75P-0003nP-74 for emacs-devel@gnu.org; Sun, 26 Jul 2009 13:00:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MV75K-0003j1-QQ for emacs-devel@gnu.org; Sun, 26 Jul 2009 13:00:34 -0400 Original-Received: from [199.232.76.173] (port=47713 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MV75K-0003iy-JV for emacs-devel@gnu.org; Sun, 26 Jul 2009 13:00:30 -0400 Original-Received: from rcsinet11.oracle.com ([148.87.113.123]:21789 helo=rgminet11.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MV75K-0003GU-18 for emacs-devel@gnu.org; Sun, 26 Jul 2009 13:00:30 -0400 Original-Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6QH2ERw016823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 26 Jul 2009 17:02:16 GMT Original-Received: from abhmt005.oracle.com (abhmt005.oracle.com [141.146.116.14]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n6QH0aAp011342; Sun, 26 Jul 2009 17:00:36 GMT Original-Received: from dradamslap1 (/141.144.232.119) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 26 Jul 2009 10:00:24 -0700 X-Priority: 1 (Highest) X-MSMail-Priority: High X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcoN/SJ9/7/jI0+NRPakePCbEHm7WQAEy8Yw Importance: High X-Message-Flag: Follow up X-Source-IP: abhmt005.oracle.com [141.146.116.14] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090205.4A6C8BAA.0188:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:113171 Archived-At: > so the problem is not just that focus switches to some > other frame, but that a new frame is created. > Note also that make-frame's docstring says: > > This function itself does not make the new frame the > selected frame. The previously selected frame > remains selected. However, the window system may > select the new frame for its own reasons, for > instance if the frame appears under the mouse pointer > and your setup is for focus to follow the pointer. > > So the really better fix would be to make sure make-frame > doesn't change the focus (especially since the above note > is not quite correct: even for click-to-focus WMs, the new > frames may get selected just by virtue of being new, which > is most likely what you're seeing). 1. Yes, please do make sure that `make-frame' does not change the focus. That fix is long overdue. Thx. 2. In addition, please make `display-buffer' also DTRT in this regard. `display-buffer' should never cause display of the buffer in another frame to select the buffer (with its frame receiving the focus). But that is what happens, on MS Windows for instance: emacs -Q (setq pop-up-frames t) (display-buffer "*scratch*") ; with another buffer selected The frame with *scratch* is raised and receives the focus - buffer *scratch* is selected. This contradicts the documented behavior of `display-buffer', and it has done so since day one AFAIK. This is the case not only when *scratch*'s frame is created; it happens each time `display-buffer' is called. That is, fixing `make-frame' will not fix the problem of focus changing whenever a buffer is displayed. There are two fixes that are needed.