From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: closing emacsclient always focuses another emacs window Date: Sun, 09 Mar 2014 19:54:00 +0100 Message-ID: <8761nn8apj.fsf@web.de> References: <83pplwq0s2.fsf@gnu.org> <83ob1gpw98.fsf@gnu.org> <9cc39d8d-e5ae-488b-9ba6-78dd71a2257f@googlegroups.com> <913ee34a-f81c-408f-afe4-6944a9c56430@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1394391270 7095 80.91.229.3 (9 Mar 2014 18:54:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2014 18:54:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 09 19:54:39 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 1WMirv-0007kI-9A for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Mar 2014 19:54:39 +0100 Original-Received: from localhost ([::1]:45133 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMiru-0008V4-Vs for geh-help-gnu-emacs@m.gmane.org; Sun, 09 Mar 2014 14:54:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMirb-0008Uu-H7 for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 14:54:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WMirU-0005LX-7v for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 14:54:19 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:43157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WMirU-0005LS-0h for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 14:54:12 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WMirS-0007Or-VV for help-gnu-emacs@gnu.org; Sun, 09 Mar 2014 19:54:10 +0100 Original-Received: from ip-90-187-97-239.web.vodafone.de ([90.187.97.239]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Mar 2014 19:54:10 +0100 Original-Received: from michael_heerdegen by ip-90-187-97-239.web.vodafone.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Mar 2014 19:54:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 41 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ip-90-187-97-239.web.vodafone.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:JciCBY5IxJg0cHvrNdP31HRDOmg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:96354 Archived-At: trygve.flathen@gmail.com writes: > > When I first start emacs (emacs -Q), and do M-x start-server, and > > follow > > the recipe, I get the desired behavior. > > > > OTOH, when I start up with emacs -Q --daemon, and follow the recipe, I > > see what trygve.flathen sees. > > Both of these methods give me the same undesired behaviour, with or > without server-start in init.el. Interesting. And you used the -c flag for emacsclient in both cases, yes? > > Does evaluating the following change the behavior for you? > > Seems like I am missing something: > > Debugger entered--Lisp error: (void-function advice-add) > (advice-add (quote server-switch-buffer) :around (lambda (f &rest > args) (when (car args) (apply f args)))) > eval((advice-add (quote server-switch-buffer) :around (lambda (f > &rest args) (when (car args) (apply f args)))) nil) > eval-last-sexp-1(nil) > eval-last-sexp(nil) > call-interactively(eval-last-sexp nil nil) Ok, let's try with the old advice mechanism: (defadvice server-switch-buffer (around test activate) (when (ad-get-arg 0) ad-do-it)) You can (with a newly started server) also M-x debug-on-entry select-frame-set-input-focus. If you get a popping up debugger after hitting C-x #, please send us the backtrace. Regards, Michael.