Re: 2.99.3 beta and texdoc on macosx

Thomas Esser <[email protected]> Sun, 28 Nov 2004 13:26:37 +0100
Newsgroups gmane.comp.tex.tetex.beta
Message-ID <[email protected]>
On Fri, Nov 26, 2004 at 11:38:12PM +0100, Sven de Vries wrote:
> 1) it checks whether TEXDOCVIEW_dvi/ps is set the by the user and then
> using that,

That's already the case, since we are using these ${var=value} constructs
which do not change $var if the variable has been set before.

BTW, the script already has a comment which explains this:

    # Viewing programs, according to filename extension.  (You can
    # override or add to them by setting environment variables).
    # MacOS X: does not have X11 by default, so give dvi a low priority

> Otherwise:
> 	2) checking whether xdvi/gv is in the defaultpath
> 		(and perhaps whether X11 is running)
> 	otherwise
> 		3) using open

Something like this?

        if test "x$DISPLAY" != x && type -p xdvi >/dev/null 2>&1; then
          : ${TEXDOCVIEW_dvi='xdvi %s &'}
        else
          : ${TEXDOCVIEW_dvi='open %s'}
        fi
        if test "x$DISPLAY" != x && type -p gv >/dev/null 2>&1; then
          : ${TEXDOCVIEW_ps='gv %s &'}
        else
          : ${TEXDOCVIEW_ps='open %s'}
        fi

Thomas