From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Using emacsclient -t as $EDITOR from within Emacs Date: Fri, 6 Sep 2013 11:40:58 +0200 Message-ID: <20130906094058.GD20690@kuru.dyndns-at-home.com> References: <87ob86hmd4.fsf@sperrhaken.name> <20130906071015.GB20690@kuru.dyndns-at-home.com> <20130906085745.GC20690@kuru.dyndns-at-home.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1378460478 11427 80.91.229.3 (6 Sep 2013 09:41:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2013 09:41:18 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" , Yuri Khan To: Nikolai Weibull Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 06 11:41:21 2013 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 1VHsXY-00006U-0d for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 11:41:20 +0200 Original-Received: from localhost ([::1]:36207 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHsXX-0006Ws-I2 for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 05:41:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHsXM-0006Wn-38 for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 05:41:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHsXH-00082b-QM for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 05:41:08 -0400 Original-Received: from mail-ee0-x22d.google.com ([2a00:1450:4013:c00::22d]:60074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHsXH-00082K-I4 for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 05:41:03 -0400 Original-Received: by mail-ee0-f45.google.com with SMTP id c50so1476949eek.4 for ; Fri, 06 Sep 2013 02:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=RebIyuMHKFxgdAaS0Z0ifRibZxMl4YrWlPOReX0v6vY=; b=xt1SX3hKWFlZJmOL9jP1B1ZxMn3kMnwHjA1LsTolkXSgJMJtGOeUMaWX+MgQqDH21O 1V7dE4urMOGgneKuwZA1lCsN7Sn6h7QGa5ya8XhkDHNiKHZ7T9cUkpW6PGJJtsLxMrUD UBmcA5KdX5P65aNKl8d/di55YIRTl0lNZ6sPxnIJWKYrNzJLRZ7/YM3eUsdYZkFSCbm9 iIl3HjpwzxLivkxwh77gEA2DwazMZ1MP5Y9A/UzeUJU5JftHyiVnJUy/+xJTyFJ/x9SH IXMnBTl3JB029S9g2tKPhUA8dP3OpsWw5853NGCVXKBn+WF+/m4xYfWVGACmPVymVkAP ovJA== X-Received: by 10.14.122.132 with SMTP id t4mr2807896eeh.20.1378460462646; Fri, 06 Sep 2013 02:41:02 -0700 (PDT) Original-Received: from kuru.dyndns-at-home.com ([2001:610:120:3001:f2de:f1ff:fe37:c76c]) by mx.google.com with ESMTPSA id r48sm373771eev.14.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Sep 2013 02:41:01 -0700 (PDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22d 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:93282 Archived-At: Hi Nikolai, On Fri, Sep 06, 2013 at 11:08:20AM +0200, Nikolai Weibull wrote: > On Fri, Sep 6, 2013 at 10:57 AM, Suvayu Ali wrote: > > On Fri, Sep 06, 2013 at 02:59:21PM +0700, Yuri Khan wrote: > >> On Fri, Sep 6, 2013 at 2:10 PM, Suvayu Ali wrote: > > >> > I'm very curious, what does this offer you over simple C-x C-f. The way > >> > I see it, emacsclient is useful to have access to single Emacs instance > >> > whenever you want to edit something, so you can connect to the instance > >> > from anywhere. But if you are already in an emacs frame, how does this > >> > add anything? > > >> Many external programs, most notably version control systems such as > >> Subversion and Git, like to call an external editor when they need > >> some intermediate text that cannot be reasonably expected to be passed > >> via the command line or via a pre-authored file. > > > Yes I'm aware of that. That is why I myself use emacsclient most of the > > time. The OP however wants to call emacsclient from an emacs frame as > > an asynchronous command. I fail to see any usecase for that. If I want > > to edit something from an emacs frame, I would just open it. > > That wasn’t what I was asking for. I led with that case, as that’s > what it boiled down to, or so I thought, but I did explain that “I > want to be able to execute commands that invoke $EDITOR, which I’ve > set to a shell script that invokes emacsclient -t, from > within Emacs (for example, from Dired) that’s running as a server”. Almost all the cases I can think of where executing shell commands may call $EDITOR, I can also think of very nice emacs libraries that provide very mature integration. A few examples: - emails: Gnus, notmuch, vm, message-mode for simple composing, etc, - using version control: vc-*, magit, etc, - sudoedit/visudo: tramp The only one I can think of without a mode like that is when I call $EDITOR from my pager (less). But of course running a pager from Emacs does not make sense. From the above examples, I can't imagine I would call any of those from dired. So I'm still a bit confused about the use case. Could you please give an example of the command you are using? Sorry if I'm being a bit dense, I'm just very curious and would like to know. Thanks, -- Suvayu Open source is the future. It sets us free.