git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Interpreting EDITOR/VISUAL environment variables.

From
David Kastrup <dak@gnu.org>
Date
Aug 1, 2007, 19:30 UTC
Message-ID
<85ir7zrr0u.fsf@lola.goethe.zz>
In-Reply-To
<20070801185042.GB30277@nan92-1-81-57-214-146.fbx.proxad.net>
Yann Dirson <ydirson@altern.org> writes:
Show 10 quoted lines
> On Wed, Aug 01, 2007 at 10:12:13AM -0700, Junio C Hamano wrote:
>> We recently normalized the script callers not to splice at all
>> (the scripts were hand-rolling "the VISUAL or EDITOR or vi" and
>> slightly differently).  It obviously has negative (i.e. setting
>> EDITOR to "emacsclient --alternate-editor vi" does not work) as
>> well as positive side (i.e. "/home/dak/My Programs/editor" would
>> work).
>
> And, indeed, --alternate-editor could be supplemented by another
> envvar to be able to work in our situation.

It is already. But if git is pretty much alone in breaking a setup that is working everywhere else, is having a workaround available really a good excuse for not doing the right thing?

> Maybe the various emacsen vendors would be willing to integrate such
> a patch ?

Actually, it is a nuisance because nobody remembers this variable. It is called (looking in the Emacs manual, using the index to find emacsclient, following a link after two pages to the invocation, going down two pages again) ALTERNATE_EDITOR. It does not even _mention_ Emacs or emacsclient in its name. The "-a" option is easier to remember.

So yes, emacsclient has an environment hook making it possible to work around git's idiosyncratic behavior here. But should it really be necessary?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Yann DirsonNext: David Kastrup
Message 4 of 16 in “Interpreting EDITOR/VISUAL environment variables.”
  1. David KastrupAug 1, 2007
  2. Junio C HamanoAug 1, 2007
  3. Yann DirsonAug 1, 2007
  4. David KastrupAug 1, 2007
  5. David KastrupAug 1, 2007
  6. Junio C HamanoAug 1, 2007
  7. git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commandsDavid Kastrup, Aug 1, 2007
  8. David KastrupAug 1, 2007
  9. git-sh-setup.sh: make GIT_EDITOR/core.editor/VISUAL/EDITOR accept commandsDavid Kastrup, Aug 1, 2007
  10. Junio C HamanoAug 1, 2007
  11. Junio C HamanoAug 1, 2007
  12. David KastrupAug 1, 2007
  13. Junio C HamanoAug 2, 2007
  14. David KastrupAug 1, 2007
  15. Matthias LederhoferAug 2, 2007
  16. David KastrupAug 2, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.