From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Using emacsclient -t as $EDITOR from within Emacs Date: Fri, 6 Sep 2013 14:59:21 +0700 Message-ID: References: <87ob86hmd4.fsf@sperrhaken.name> <20130906071015.GB20690@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: quoted-printable X-Trace: ger.gmane.org 1378454377 10099 80.91.229.3 (6 Sep 2013 07:59:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Sep 2013 07:59:37 +0000 (UTC) Cc: "help-gnu-emacs@gnu.org" To: Suvayu Ali Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Sep 06 09:59:41 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 1VHqxA-0006bU-LH for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 09:59:40 +0200 Original-Received: from localhost ([::1]:35674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHqxA-0006Wo-AM for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Sep 2013 03:59:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46312) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHqww-0006WU-Qt for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 03:59:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHqwt-0001MB-DP for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 03:59:26 -0400 Original-Received: from mail-lb0-x235.google.com ([2a00:1450:4010:c04::235]:64436) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHqwt-0001Lw-4t for help-gnu-emacs@gnu.org; Fri, 06 Sep 2013 03:59:23 -0400 Original-Received: by mail-lb0-f181.google.com with SMTP id u14so2551622lbd.40 for ; Fri, 06 Sep 2013 00:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=/ZyPOjfBQ106jIRR/WhvS/FX/eENg6cASsvXXj9WQpk=; b=nRpyyS5HtbSngF7qMntR3mmr9ynJrI7vG/VbiBcwVOMCUxcMK+E3SiovHOo9/oKfNu dfrpeq7/BgC4aLEtzF3ys/KwgLHsZAzNGbFLFaJXiae+0jDy478VA5T8uQiuN2loo1vq BFRk9GJIHFDH9fL6cDjIfv+aL9mjlfb4vJUY8vOigSRYITS111qPyXc6xxIlby6jqLAA hFt0Hfl/eHkvZ4zXapLP2y8eHRYQHgtfTfsA3lFN0LvYBVzjDkznO1EFR8gegumfFGwR Ptx6ZhktFpNoHEKNsNFMb4QHOwX2NgYKjOCwl4AroJwnT26Lrk7kvQFsN2YJCGR9KZbo zgSQ== X-Received: by 10.112.14.102 with SMTP id o6mr1811536lbc.28.1378454361209; Fri, 06 Sep 2013 00:59:21 -0700 (PDT) Original-Received: by 10.114.185.101 with HTTP; Fri, 6 Sep 2013 00:59:21 -0700 (PDT) In-Reply-To: <20130906071015.GB20690@kuru.dyndns-at-home.com> X-Google-Sender-Auth: -q_EjaFig0WoHKGRv0uyAAXlxMo X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::235 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:93279 Archived-At: On Fri, Sep 6, 2013 at 2:10 PM, Suvayu Ali wr= ote: > Hi Nikolai, > 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. E.g. when you say =E2=80=9Cgit commit=E2=80=9D, it asks you for a commit me= ssage by opening an external editor with some temporary file. It then expects that you will compose your message, save it into the same file, and exit the editor. After that, it proceeds to store your modifications in a commit along with the message you wrote. The external editor used in Git must have two desirable properties: (1) it must be convenient for you to use, and (2) it must start up quickly. If (1) leads you to use Emacs, then you=E2=80=99re forced to think about the issue (2): a conveniently configured Emacs is often slow to load. The usual list response to issues of slow startup is =E2=80=9Cuse server an= d set emacsclient as your editor=E2=80=9D. But if you run Emacs server on a terminal, then shell in that Emacs, then =E2=80=9Cgit commit=E2=80=9D from = that shell, it calls emacsclient which tries to create a frame but cannot determine the terminal type (because it actually runs in emacs shell which in fact lacks any terminal capabilities), which leads to frustration due to interrupted flow (you are either forced to use a different editor, or to pass a short commit message via the command line, or to first compose a message, then pass the message file to =E2=80=9Cgit commit=E2=80=9D, then delete that file). It might be possible using term instead of shell in Emacs, but probably weird (Emacs running on a terminal emulated by a window in an Emacs running on a terminal).