From: David Kastrup <dak@gnu.org>
To: git@vger.kernel.org
Subject: Interpreting EDITOR/VISUAL environment variables.
Date: Wed, 01 Aug 2007 15:36:48 +0200 [thread overview]
Message-ID: <86abtbnzpr.fsf@lola.quinscape.zz> (raw)
Whatever I have been able to Google, is completely silent on this
matter. If anybody has an idea where to find authoritative
information, holler.
In the meantime, in the Emacs manual there is the following bit of
information:
(info "(emacs) Invoking Emacsclient")
The option `-a COMMAND' or `--alternate-editor=COMMAND' specifies a
command to run if `emacsclient' fails to contact Emacs. This is useful
when running `emacsclient' in a script. For example, the following
setting for the `EDITOR' environment variable will always give you an
editor, even if no Emacs server is running:
EDITOR="emacsclient --alternate-editor emacs +%d %s"
That makes it likely that the way to call an editor should be via
system. However, there are certainly programs around which will not
interpret the +%d and %s thingies. My current setting is
EDITOR="emacsclient --alternate-editor vi"
and this seems to do the trick with most applications. Not so with
git-commit and other git scripts. The easiest way out will be to
create something like ~/bin/myemacsclient which does the respective
argument splicing. I am just not sure this is the "canonically
correct way" of interpreting $EDITOR.
Actually, splicing $EDITOR into a system command is a nuisance because
it means having to shell-quote its arguments. So the current
interpretation is likely easier to maintain.
Is it the correct one?
--
David Kastrup
next reply other threads:[~2007-08-01 13:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-01 13:36 David Kastrup [this message]
2007-08-01 17:12 ` Interpreting EDITOR/VISUAL environment variables Junio C Hamano
2007-08-01 18:50 ` Yann Dirson
2007-08-01 19:30 ` David Kastrup
2007-08-01 19:08 ` David Kastrup
2007-08-01 19:53 ` Junio C Hamano
2007-08-01 21:47 ` [PATCH] git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commands David Kastrup
2007-08-01 22:17 ` David Kastrup
2007-08-01 21:47 ` David Kastrup
2007-08-01 23:18 ` Junio C Hamano
2007-08-01 23:21 ` Junio C Hamano
2007-08-01 23:58 ` David Kastrup
2007-08-02 1:00 ` Junio C Hamano
2007-08-01 23:55 ` David Kastrup
2007-08-02 10:10 ` Interpreting EDITOR/VISUAL environment variables Matthias Lederhofer
2007-08-02 10:31 ` David Kastrup
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=86abtbnzpr.fsf@lola.quinscape.zz \
--to=dak@gnu.org \
--cc=git@vger.kernel.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox