all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuri Khan <yuri.v.khan@gmail.com>
To: Suvayu Ali <fatkasuvayu+linux@gmail.com>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Using emacsclient -t as $EDITOR from within Emacs
Date: Fri, 6 Sep 2013 14:59:21 +0700	[thread overview]
Message-ID: <CAP_d_8XJDHm+PkZ_V-3F7e8cK+s3dbHH_HQYKD2+8oJ6Bx+qWQ@mail.gmail.com> (raw)
In-Reply-To: <20130906071015.GB20690@kuru.dyndns-at-home.com>

On Fri, Sep 6, 2013 at 2:10 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com> 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
load.

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	other threads:[~2013-09-06  7:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1318.1378327378.10748.help-gnu-emacs@gnu.org>
2013-09-05 23:36 ` Using emacsclient -t as $EDITOR from within Emacs Felix Dietrich
2013-09-06  6:02   ` Nikolai Weibull
2013-09-06  7:10     ` Suvayu Ali
2013-09-06  7:59       ` Yuri Khan [this message]
2013-09-06  8:57         ` Suvayu Ali
2013-09-06  9:08           ` Nikolai Weibull
2013-09-06  9:40             ` Suvayu Ali
2013-09-06  9:46               ` Nikolai Weibull
2013-09-06 10:05                 ` Suvayu Ali
2013-09-04 20:42 Nikolai Weibull
2013-09-05  0:26 ` Suvayu Ali
2013-09-05  6:36   ` Nikolai Weibull
2013-09-05  7:33     ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAP_d_8XJDHm+PkZ_V-3F7e8cK+s3dbHH_HQYKD2+8oJ6Bx+qWQ@mail.gmail.com \
    --to=yuri.v.khan@gmail.com \
    --cc=fatkasuvayu+linux@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.