From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#51374: New options for emacsclient Date: Sat, 30 Oct 2021 22:31:25 +0000 Message-ID: <04203f39460e487da5bb@heytings.org> References: <90ba36dcccf5550a3348@heytings.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="JJuOV2B2pc" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11762"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51374@debbugs.gnu.org To: Stefan Kangas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 31 00:32:15 2021 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 1mgwtb-0002t3-4w for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Oct 2021 00:32:15 +0200 Original-Received: from localhost ([::1]:44744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgwta-0005im-1H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Oct 2021 18:32:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgwtO-0005gY-7X for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 18:32:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47032) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgwtN-000502-Qo for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 18:32:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgwtN-0004LI-Ia for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 18:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Oct 2021 22:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51374 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 51374-submit@debbugs.gnu.org id=B51374.163563308916650 (code B ref 51374); Sat, 30 Oct 2021 22:32:01 +0000 Original-Received: (at 51374) by debbugs.gnu.org; 30 Oct 2021 22:31:29 +0000 Original-Received: from localhost ([127.0.0.1]:58577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgwsq-0004KU-Rv for submit@debbugs.gnu.org; Sat, 30 Oct 2021 18:31:29 -0400 Original-Received: from heytings.org ([95.142.160.155]:42452) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgwsp-0004KL-E6 for 51374@debbugs.gnu.org; Sat, 30 Oct 2021 18:31:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1635633086; bh=fwVJ7rdb0MGfc1clPNkXhIt98CZ9A3uwTxklh4OicV0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=MxFQHdpkEK/XKJpDKA/lrd9QVIYvsuSTkiLtgeBv77Eg3CxiazHBnEx/Xi0HNuLP9 KqnMU2JFWMRlgu5egL02g8JGQLdkxuFtQhTJ8sM+evdVP+YXCYkwocUfDxwSpQlQN6 M0f1ldGG4ARe5iwDRbJSL5e1dJW+OSZFGAb+JsWcS/zjKOhkj2oIMPO457UZ25zADl p0brZLVfQSMrnFo7gKyuuOdcmvqw4WdcC1hb/mfnjbUejKsxQsIfBEEYJ0cDKAGz0Z F8v1PZM4YzGSOT33PZMr6xDg1+r1YDA5mDGnVFW5JwNSJAfzO1kpEl5s3pYRbkwbjL A45DZWceJNytA== In-Reply-To: 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:218643 Archived-At: --JJuOV2B2pc Content-Type: text/plain; format=flowed; charset=us-ascii >> When emacsclient is used in a terminal, emacsclient FILE opens a >> non-graphical Emacs frame, and emacsclient -c FILE always creates a new >> graphical Emacs frame. A third option, which creates a graphical frame >> if none exist and reuses a graphical frame is one exists, would be >> useful (see for example [1] and [2]). > > It seems like tons of users are using home-cooked solutions and scripts > to do this, so there is a clear need for it. I think we should add it. > Thanks for your comment! > Your patch LGTM, but it's missing a NEWS entry. > > (Perhaps we could also update the man page, but that's no requirement as > we don't really make an effort to maintain it.) > Updated patch attached. --JJuOV2B2pc Content-Type: text/x-diff; name=New-emacsclient-option-to-either-create-or-reuse-an-.patch Content-Transfer-Encoding: base64 Content-ID: <04203f3946923e4ead5c@heytings.org> Content-Description: Content-Disposition: attachment; filename=New-emacsclient-option-to-either-create-or-reuse-an-.patch RnJvbSBjMzY2ZTQ1OGY1NjdlMzdiM2I4NDQ4MDhiNTZlYWE5NTg2MWJlOWQ4 IE1vbiBTZXAgMTcgMDA6MDA6MDAgMjAwMQ0KRnJvbTogR3JlZ29yeSBIZXl0 aW5ncyA8Z3JlZ29yeUBoZXl0aW5ncy5vcmc+DQpEYXRlOiBTYXQsIDMwIE9j dCAyMDIxIDIyOjI5OjAwICswMDAwDQpTdWJqZWN0OiBbUEFUQ0hd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