[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using emacsclient -t as $EDITOR from within Emacs

From: Yuri Khan
Subject: Re: Using emacsclient -t as $EDITOR from within Emacs
Date: Fri, 6 Sep 2013 14:59:21 +0700

On Fri, Sep 6, 2013 at 2:10 PM, Suvayu Ali <address@hidden> wrote:
> 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 “git commit”, it asks you for a commit message 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’re forced to think
about the issue (2): a conveniently configured Emacs is often slow to

The usual list response to issues of slow startup is “use server and
set emacsclient as your editor”. But if you run Emacs server on a
terminal, then shell in that Emacs, then “git commit” 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
“git commit”, 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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]