From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#43645: 26.3; emacsclient -c does not open to correct window Date: Tue, 29 Sep 2020 17:06:48 +0300 Message-ID: <83a6x8lls7.fsf@gnu.org> References: <87r1qmujmn.fsf@gnus.org> <837dsem2yv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30286"; mail-complaints-to="usenet@ciao.gmane.io" Cc: bluetrack121@gmail.com, larsi@gnus.org, 43645@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 29 16:11:23 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNGLi-0007mo-T4 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Sep 2020 16:11:22 +0200 Original-Received: from localhost ([::1]:42036 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNGLh-0008Vl-UH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Sep 2020 10:11:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNGIV-0004Ky-Vy for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 10:08:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNGIV-0005PR-Mi for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 10:08:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kNGIV-0000cL-IR for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 10:08:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Sep 2020 14:08:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43645 X-GNU-PR-Package: emacs Original-Received: via spool by 43645-submit@debbugs.gnu.org id=B43645.16013884302242 (code B ref 43645); Tue, 29 Sep 2020 14:08:03 +0000 Original-Received: (at 43645) by debbugs.gnu.org; 29 Sep 2020 14:07:10 +0000 Original-Received: from localhost ([127.0.0.1]:56763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNGHe-0000a5-0H for submit@debbugs.gnu.org; Tue, 29 Sep 2020 10:07:10 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNGHZ-0000ZZ-6c for 43645@debbugs.gnu.org; Tue, 29 Sep 2020 10:07:08 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:37830) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNGHT-0005Je-TH; Tue, 29 Sep 2020 10:06:59 -0400 Original-Received: from [176.228.60.248] (port=1703 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kNGHS-00035v-5v; Tue, 29 Sep 2020 10:06:59 -0400 In-Reply-To: (message from martin rudalics on Mon, 28 Sep 2020 17:02:13 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189253 Archived-At: > Cc: bluetrack121@gmail.com, 43645@debbugs.gnu.org > From: martin rudalics > Date: Mon, 28 Sep 2020 17:02:13 +0200 > > >> diff --git a/lisp/server.el b/lisp/server.el > >> index 436a6ca0c7..f24f8d2b7c 100644 > >> --- a/lisp/server.el > >> +++ b/lisp/server.el > >> @@ -1602,7 +1602,7 @@ server-switch-buffer > >> ;; OK, we know next-buffer is live, let's display and select it. > >> (if (functionp server-window) > >> (funcall server-window next-buffer) > >> - (let ((win (get-buffer-window next-buffer 0))) > >> + (let ((win (get-buffer-window next-buffer))) > >> (if (and win (not server-window)) > >> ;; The buffer is already displayed: just reuse the > >> ;; window. If FILEPOS is non-nil, use it to replace the > >> > > > > Martin, any comments on this? > > Wouldn't the "0" make sense when invoking emacsclient without an option > like -c or -t? IIUC, in that case we should try to reuse some existing > visible or iconified window. But ... I never use emacsclient. Lars, can you try Martin's proposal and see if it solves the problem without any adverse side effects on other use cases? Thanks.