Git development
 help / color / mirror / Atom feed
* Interpreting EDITOR/VISUAL environment variables.
@ 2007-08-01 13:36 David Kastrup
  2007-08-01 17:12 ` Junio C Hamano
  0 siblings, 1 reply; 16+ messages in thread
From: David Kastrup @ 2007-08-01 13:36 UTC (permalink / raw)
  To: git


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

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-08-02 10:35 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-01 13:36 Interpreting EDITOR/VISUAL environment variables David Kastrup
2007-08-01 17:12 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox