[A documentation change similar to the one proposed here was checked in 5 Oct 1998. Removing VISUAL would restore the behavior of CVS 1.5 and earlier. I've enclosed a response from Greg Woods advocating retention of VISUAL. Personally, I don't see the analogy with mailx/Mail, because mailx has separate commands (e/v and ~e/~v) for invoking EDITOR and for invoking VISUAL. As for the Single Unix Specification, Greg's summary is correct; it specifies EDITOR and not VISUAL for more and crontab, and specifies mailx as summarized above. There may some more text in the separate POSIX User Portability Extension which as far as I know is not online; I'm not sure what became of that. My current proposed text (which goes in same place as in the diff below) is: In addition, @sc{cvs} checks the @code{$VISUAL} environment variable. Opinions vary on whether this behavior is desirable and whether future releases of @sc{cvs} should check @code{$VISUAL} or ignore it. You will be OK either way if you make sure that @code{$VISUAL} is either unset or set to the same thing as @code{$EDITOR}. To that Greg Woods says "Fine with me!". -kingdon] Date: Wed, 30 Sep 1998 14:52:19 -0400 From: Jim Kingdon To: devel-cvs@harvey.cyclic.com Subject: Get rid of VISUAL? What do people think of the following change? The status quo is very confusing. The common failure mode is that one sets EDITOR and it has no effect, because VISUAL is also set. 1998-09-30 Jim Kingdon * cvs.texinfo (Environment variables): Document VISUAL as deprecated. Index: cvs.texinfo =================================================================== RCS file: /home2/cvsroot/ccvs/doc/cvs.texinfo,v retrieving revision 1.426 diff -c -r1.426 cvs.texinfo *** cvs.texinfo 1998/09/27 13:27:19 1.426 --- cvs.texinfo 1998/09/30 18:46:36 *************** *** 555,560 **** --- 555,568 ---- @code{vi} for unix or @code{notepad} for Windows NT/95. + @cindex VISUAL, environment variable + In addition, @sc{cvs} checks the @code{$VISUAL} + environment variable. This behavior is deprecated; + future releases of @sc{cvs} may ignore this variable + instead. Make sure that @code{$VISUAL} is either unset + or set to the same thing as @code{$EDITOR}, and it + won't be a problem. + @c This probably should go into some new node @c containing detailed info on the editor, rather than @c the intro. In fact, perhaps some of the stuff with *************** *** 12190,12195 **** --- 12198,12204 ---- @item $EDITOR @itemx $CVSEDITOR + @itemx $VISUAL Specifies the program to use for recording log messages during commit. @code{$CVSEDITOR} overrides @code{$EDITOR}. See @ref{Committing your changes}. Date: Wed, 30 Sep 1998 23:09:08 -0400 (EDT) From: woods@most.weird.com (Greg A. Woods) To: devel-cvs@harvey.cyclic.com Subject: Re: Get rid of VISUAL? In-Reply-To: Jim Kingdon's message of "Wed, September 30, 1998 14:52:19 -0400" regarding "Get rid of VISUAL?" id <199809301852.OAA00627@harvey.cyclic.com> [ On Wed, September 30, 1998 at 14:52:19 (-0400), Jim Kingdon wrote: ] > Subject: Get rid of VISUAL? > > What do people think of the following change? > > The status quo is very confusing. The common failure mode is that one > sets EDITOR and it has no effect, because VISUAL is also set. Ever since Bill Joy introduced vi to the world there's been the concept of having both a $VISUAL and a $EDITOR, especially after the Berkeley "Mail" program came into wide use. I've always found the most succinct and accurate way to describe the proper handling of these two variables when there's no other way for the user to express a run-time editor preference (ala Mail/mailx) is the following simple Bourne Shell variable expansion expression: ${VISUAL:-$EDITOR} This expression is correct and functional for all versions of "sh" that I've ever encountered. The only program that I know of (other than ancient versions of CVS) that constantly screwed up this handling was/is vipw (eg. on SunOS-4). Now I fully realize that it's probably silly to want to use two different editors depending on one's current circumstances, but it's really not all that difficult to maintain the expected behaviour. (I personally set VISUAL=emacs (or VISUAL=emacsclient if on an X display) and EDITOR=vi, and when I want to do something quick and simple, say in a root window, I use my 'e' command alias, which invokes $EDITOR, and otherwise I'll use my 'v' alias which invokes ${VISUAL:-$EDITOR}. Although the Single UNIX Specification doesn't actually say generically (i.e. in the Base Definitions section about Environment Variables) what VISUAL and EDITOR are, or how they should be set or used, but it does mention them both in the list of commonly used environment variables that would be unwise to use for any other purpose than their already widely understood usage. All Unix standards do define the use of EDITOR and VISUAL for programs such as "mailx" and/or "Mail", and sometimes "crontab" and "more" (SUS says "crontab" and "more" use only EDITOR, but that's not true of some/most/all implementations). It's a darn good idea to document what CVS does with VISUAL so long as it really does do something. -- Greg A. Woods +1 416 218-0098 VE3TCP Planix, Inc. ; Secrets of the Weird