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: save-frame-excursion? Date: Mon, 27 Jul 2009 13:49:50 -0400 Message-ID: References: <87ocrb8fy0.fsf@bzg.ath.cx> <4A691B47.1050102@sift.info> <4A692A6A.4080601@sift.info> <871vo5c7lj.fsf@bzg.ath.cx> <87y6qcbeg6.fsf@bzg.ath.cx> <87skgilrkr.fsf@bzg.ath.cx> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248717026 14222 80.91.229.12 (27 Jul 2009 17:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 27 Jul 2009 17:50:26 +0000 (UTC) Cc: emacs-devel@gnu.org To: Bastien Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 27 19:50:19 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 1MVUL2-0005Pw-Hv for ged-emacs-devel@m.gmane.org; Mon, 27 Jul 2009 19:50:16 +0200 Original-Received: from localhost ([127.0.0.1]:59547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVUL2-0004U8-0u for ged-emacs-devel@m.gmane.org; Mon, 27 Jul 2009 13:50:16 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVUKi-0004De-Se for emacs-devel@gnu.org; Mon, 27 Jul 2009 13:49:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVUKe-000494-5g for emacs-devel@gnu.org; Mon, 27 Jul 2009 13:49:56 -0400 Original-Received: from [199.232.76.173] (port=59462 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVUKe-00048t-0o for emacs-devel@gnu.org; Mon, 27 Jul 2009 13:49:52 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:27070) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVUKd-0001zY-MM for emacs-devel@gnu.org; Mon, 27 Jul 2009 13:49:51 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AigFAOOFbUpFxJuZ/2dsb2JhbACBUdAvhAwFhxU X-IronPort-AV: E=Sophos;i="4.43,277,1246852800"; d="scan'208";a="42303629" Original-Received: from 69-196-155-153.dsl.teksavvy.com (HELO pastel.home) ([69.196.155.153]) by ironport2-out.teksavvy.com with ESMTP; 27 Jul 2009 13:49:50 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 649367F56; Mon, 27 Jul 2009 13:49:50 -0400 (EDT) In-Reply-To: <87skgilrkr.fsf@bzg.ath.cx> (Bastien's message of "Mon, 27 Jul 2009 11:42:28 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.94 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:113238 Archived-At: > This patch makes sure that `make-frame' gives the focus back to the > previously selected frame. > Shall I apply this? Don't know. Here are some comments: - does it work (as in "with Metacity/W32/macosx/xmonad/addyourfavoriteWMhere")? - as Stephen pointed out, it should be run before the hook. - it's not clear that it does the right thing if the selected-frame is not the frame with focus (basically we'd need a focussed-frame function to figure it out). - it brings us back to this problem of "focus via activation". - is x-focus-frame always defined when this code is run (i.e. can't this code be run also on emacs-nox)? - x-focus-frame should really be renamed (so as to get rid of the "x-" prefix at least). Stefan > --- frame.el.~1.300.~ 2009-07-27 03:20:02.000000000 +0800 > +++ frame.el 2009-07-27 11:40:23.000000000 +0800 > @@ -749,7 +749,8 @@ > instance if the frame appears under the mouse pointer and your > setup is for focus to follow the pointer." > (interactive) > - (let* ((w (cond > + (let* ((f (selected-frame)) > + (w (cond > ((assq 'terminal parameters) > (let ((type (terminal-live-p (cdr (assq 'terminal parameters))))) > (cond > @@ -777,6 +778,7 @@ > (let ((val (frame-parameter oldframe param))) > (when val (set-frame-parameter frame param val))))) > (run-hook-with-args 'after-make-frame-functions frame) > + (x-focus-frame f) > frame)) > (defun filtered-frame-list (predicate) > -- > Bastien