From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: closing emacsclient always focuses another emacs window Date: Mon, 10 Mar 2014 22:03:45 +0200 Message-ID: <83r469om72.fsf@gnu.org> References: <83pplwq0s2.fsf@gnu.org> <83ob1gpw98.fsf@gnu.org> <9cc39d8d-e5ae-488b-9ba6-78dd71a2257f@googlegroups.com> <913ee34a-f81c-408f-afe4-6944a9c56430@googlegroups.com> <10020dec-82f2-41de-93d3-06d8984dcfba@googlegroups.com> <87pplv6omp.fsf@web.de> <831tyapvp6.fsf@gnu.org> <87wqg28ykt.fsf@web.de> <83y50inhn7.fsf@gnu.org> <87eh29zvtb.fsf@web.de> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1394481859 17136 80.91.229.3 (10 Mar 2014 20:04:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 10 Mar 2014 20:04:19 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 10 21:04:27 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WN6R1-0006E5-AB for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2014 21:04:27 +0100 Original-Received: from localhost ([::1]:51022 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN6R0-0003mG-T1 for geh-help-gnu-emacs@m.gmane.org; Mon, 10 Mar 2014 16:04:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42012) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN6Qi-0003bC-7A for help-gnu-emacs@gnu.org; Mon, 10 Mar 2014 16:04:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WN6Qa-0004Tk-TK for help-gnu-emacs@gnu.org; Mon, 10 Mar 2014 16:04:08 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:64114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WN6Qa-0004Tb-KW for help-gnu-emacs@gnu.org; Mon, 10 Mar 2014 16:04:00 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0N2800G00KS10J00@a-mtaout20.012.net.il> for help-gnu-emacs@gnu.org; Mon, 10 Mar 2014 22:03:59 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N2800FBJL2MX640@a-mtaout20.012.net.il>; Mon, 10 Mar 2014 22:03:59 +0200 (IST) In-reply-to: <87eh29zvtb.fsf@web.de> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.166 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:96408 Archived-At: > From: Michael Heerdegen > Date: Mon, 10 Mar 2014 20:40:32 +0100 > > > AFAIK, which frame becomes selected in this situation is determined by > > the window manager. > > I don't think that's what's happening. > > This is what is evaluated: > > (apply 'server-switch-buffer (server-done)) > > After `server-done' is evaluated, the client (e.g. the xterm) always has > input focus. The fact that > > (advice-add > 'server-switch-buffer :around > (lambda (f &rest args) > (when (car args) (apply f args)))) > > fixes the problem for the OP shows that this is also the case for him. > > Note: while (server-done) is evaluated, `server-delete-client' calls > `delete-frame', which implicitly selects another Emacs frame. > > Ok, after evaluating (server-done) now we have a different Emacs frame > selected, the server frame was deleted, and xterm has focus. > > Now, `server-switch-buffer' is evaluated (without any Emacs frame having > input focus), and, depending on the current selected frame, > `select-frame-set-input-focus'es it as I explained. > > So, the issue is completely independent from any window manager. I'm sorry, but you lost me. All I know is that I don't see on my system any Emacs frame being raised.