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: Sat, 08 Mar 2014 19:38:36 +0200 Message-ID: <83ioropp43.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: ger.gmane.org 1394300342 10435 80.91.229.3 (8 Mar 2014 17:39:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Mar 2014 17:39:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 08 18:39:08 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 1WMLDH-00088j-K9 for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Mar 2014 18:39:07 +0100 Original-Received: from localhost ([::1]:41361 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMLDH-0006c6-9F for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Mar 2014 12:39:07 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45948) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMLD0-0006b7-VZ for help-gnu-emacs@gnu.org; Sat, 08 Mar 2014 12:38:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMLCt-0004eJ-Lr for help-gnu-emacs@gnu.org; Sat, 08 Mar 2014 12:38:50 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:39740) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMLCt-0004eA-Ek for help-gnu-emacs@gnu.org; Sat, 08 Mar 2014 12:38:43 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0N2400J00OM1B900@mtaout29.012.net.il> for help-gnu-emacs@gnu.org; Sat, 08 Mar 2014 19:42:03 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N2400E4PP637580@mtaout29.012.net.il> for help-gnu-emacs@gnu.org; Sat, 08 Mar 2014 19:42:03 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.185 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:96313 Archived-At: > Date: Sat, 8 Mar 2014 07:58:05 -0800 (PST) > From: trygve.flathen@gmail.com >=20 > kl. 14:26:37 UTC+1 l=F8rdag 8. mars 2014 skrev Eli Zaretskii f=F8lg= ende: > > Can you please clarify what focus change you'd like to avoid, exa= ctly? > > I couldn't understand that from your original message. When a fr= ame > > created by emacsclient is deleted, that frame no longer exists, s= o > > it's not clear to me how could Emacs _not_ switch the focus to so= me > > other frame. >=20 > That's right, the problem is _which_ other frame. >=20 > Example: > - I start with two windows: a terminal and an emacsclient for some = file named foo that I started yesterday. The emacsclient is minimized= and the terminal has focus. > - I do "emacsclient -c /tmp/bar". A second emacsclient window is cr= eated and focused. > - I do my work, save the bar file, and do C-x #. The bar window dis= appears. >=20 > What I now want: terminal gets the focus back. > What actually happens: The foo emacsclient is raised and gets focus= . Thanks, I understand the issue now. But I cannot reproduce what you describe on my machine: what I get is the behavior you want, i.e. the Emacs frame created by emacsclient disappears from the display, and the terminal window from which I invoked that emacsclient gets back the focus. So perhaps this is something related to your window manager? That's assuming that you see the same behavior when you start "emacs -Q", then start the server there, and finally do what you describe above. If in "emacs -Q" the problem doesn't happen, then look in your ~/.emacs for the culprit. If, OTOH, "emacs -Q" exhibits the same behavior, perhaps sharing your window manager and its customizations will reveal the reason(s) for the behavior you observe.