Hi,

On Mon, Aug 11, 2008 at 02:25:04PM -0400, John J Foerch wrote:
> Hi Axel,

just a (not so short) pong after being offline for about ten days due
to being sailing. (My vacation program doesn't recognize mailing list
postings starting with "Hi Axel" yet, so you didn't get one of my
automatic replies. ;-)

>   Just curious if there has been any change of status on any of the bugs
> discussed in this thread.

Haven't noticed any changes yet, but also haven't explicitly looked
for any. I checkout the lasted version a day or two before going on
holiday and had the laptop with me, but didn't feel the urge to use
it. ;-)

> I think conkeror now does attach stdin of the editor to /dev/null/,
> though I haven't been following these issues closely.

Cool! I'll try to test it after a fresh checkout in the next days. I'm
currently just skimming through my inbox to see what I've missed since
end of July.

>   Now a philosophical question: should conkeror even use the EDITOR
> environment variable, or should it only use VISUAL?

A long time ago, I learned from somewhere (or at least remember it
that way) that programs that can spawn GUI editors as well as
text-mode editors (i.e. if $DISPLAY is set or it is an X program),
should first check $VISUAL and use that if set. Else they should check
$EDITOR and use that if set. If non is set, they should use a
reasonable default. Text-mode only programs should only check $EDITOR.

They worked for me[tm] that way for more than a decade and I never
thought about how the behaviour should be if there is no text-mode
available (e.g. because of being called through some desktop
environment menu, other GUI program, etc.), so I never verified these
rules of thumb.

I now tried to find some source for it:

The text at [1] seems to be some introduction to environment variables
controlling which other programs are used by some application if some
editor, pager, web browser, etc. is needed.

  [1] http://en.wikibooks.org/wiki/Guide_to_Unix/Environment_Variables#VISUAL

But then, the BSD man pages at [2][3][4] only mention $EDITOR, not
$VISUAL.

  [2] http://www.freebsd.org/cgi/man.cgi?query=environ&sektion=7
  [3] http://netbsd.gw.com/cgi-bin/man-cgi?environ+7
  [4] http://www.openbsd.org/cgi-bin/man.cgi?query=environ&sektion=7

And additionally, [1] doesn't interpret the "visual" notion as "needs
X or GUI" but refers to $EDITOR being historically a line editor like
ed and $VISUAL a "visual" text-mode editor like vi (vi as _not_ in "gvim").
Well, "man vi" tell's me, vi is a "screen-oriented (visual) display
editor".

I just looked at the code of /usr/bin/sensible-editor (which does not
much more than checking those variables and finding the "best" fit) in
Debian's current stable distribution: It doesn't seem to check the
terminal or $DISPLAY at all. If $VISUAL is set, call that program and
unless it works or is not found, check for $EDITOR. If that fails,
too, it tries some default editors unless it finds one or runs out of
"ideas".

Did I just not remember it the way I read it? Did I read a source
which was wrong? Or have times changed and all the sources above are
outdated regarding the current usage (and the usage about a decade
ago)?

Dug up some more views on this issue: There are programs[5][10][11]
which use $VISUAL only if $EDITOR is not set instead of vice versa and
articles[6] which mention only $VISUAL, but not $EDITOR. Others again
seem to use it the way[7] as I remember it. Again others[8] see mutt
as needing a "terminal with visual capabilitilies", but vi does not
seem to need these capabilitilies. Yet another guide[9] has only the
word "full-screen" as difference between the descriptions of the both
environment variables.

  [5] http://cvsman.com/cvs-1.12.12/cvs_207.php
  [6] http://www.peachpit.com/articles/article.aspx?p=31442&seqNum=3&rll=1
  [7] 
http://computerroriginaliascience.blogspot.com/2007/01/environment-variables-in-gnome.html
  [8] http://osdir.com/ml/mail.mutt.devel/2000-09/msg00001.html
  [9] http://www.ss64.com/osxsyntax/env_vars.html
 [10] http://www.foory.de/thw/slrn/manual/slrn-manual-4.html#SLRN_EDITOR
 [11] Book "Linux-Unix-Kurzreferenz" by Helmut Herold (German
      written), see http://ur1.ca/2ik (a Google Books Link)

So I'm probably not completely dumb, but _now_ I am confused. (Not
sure which of both is more dangerous. ;-)

So, although I would like the world to use $VISUAL only for GUI
editors to allow setting a GUI and a text-mode editor (since I'm some
kind of used to that ;-), I guess it doesn't. And although my request
for checking $VISUAL doesn't seem to be completely invalid, the
reasons seems so. Honoring $VISUAL just seems a convenience for
backwards compatibility, but the world seems to be discordant what the
correct precedence of $EDITOR and $VISUAL is.

> Using EDITOR at all seems too laden with assumptions about how well
> the machine is configured.

Well, checking $EDITOR means for me to honor the editor choice of the
user calling the program checking for this environment variable.

                Regards, Axel
-- 
Axel Beckert - [EMAIL PROTECTED], [EMAIL PROTECTED] - http://noone.org/abe/
_______________________________________________
Conkeror mailing list
Conkeror@mozdev.org
https://www.mozdev.org/mailman/listinfo/conkeror

Reply via email to