nmh-workers
[Top] [All Lists]

Re: [nmh-workers] Unnecessary dependency on vi???

2018-03-20 15:24:41


Andy Bradford wrote:
Thus said Ralph Corderoy on Tue, 20 Mar 2018 12:56:09 -0000:

For evermore, programs that only offer one means of invoking an editor
have had to checking first $VISUAL, falling back to $EDITOR.  :-)

You mean like the following chunk of code: :-)

http://www.fossil-scm.org/index.html/artifact?udc=1&ln=1180-1186+1196-1204&name=8d7c320c6bbe086b

here's how crontab(1) does it:

                        /* what editor to use if no EDITOR or VISUAL
                         * environment variable specified.
                         */
#if defined(_PATH_VI)
# define EDITOR _PATH_VI
#else
# define EDITOR "/usr/ucb/vi"
#endif

...

        if (((editor = getenv("VISUAL")) == NULL || *editor == '\0') &&
            ((editor = getenv("EDITOR")) == NULL || *editor == '\0')) {
                editor = EDITOR;
        }



--
P Vixie


--
nmh-workers
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>