> Date: Wed, 26 Mar 2003 16:47:28 -0500 (EST)
> From: Pavel Roskin <[EMAIL PROTECTED]>
> To: hugo vanwoerkom <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Subject: Re: mc 4.6.0 config check for mozilla
> 
> On Wed, 26 Mar 2003, hugo vanwoerkom wrote:
> 
> > mc 4.6.0 source ./configure checks for mozilla.
> > What is mozilla used for and how do you tell
> > where mozilla is? It is in its usual place
> > (/usr/local/mozilla) but he did not find it.
> > Thanks.
> 
> The idea is to associate HTML file with the best browser available at the
> compile time.  The check is incorrect.  mc needs a wrapper script for
> choosing the best browser at the run time.  It shouldn't be hard to write.
> 
> Red Hat's htmlview can be a good starting point, but it doesn't check if
> KDE is running and it doesn't convert filenames to the "file:" URLs for
> the browsers that need it.

Why not simply using the $BROWSER environment variable?
Normally a system correctly configured should use it (as $EDITOR
etc...).

I realise that it's surely not enough, as it may be undefined, but
it's IMHO a good starting point, a good way to "choose the best
browser".

Also, I think that determining whether "file:" is needed or not is the 
browser job, isn't it?

Konqueror, mozilla, (surely galeon too), dillo, lynx, links do it
correctly. 


Something like 

if [ ! "$BROWSER" ]; then
        if [ "`ps ux | grep kdeinit`" ] ; then 
                BROWSER=konqueror
        elif [ "`ps ux | grep gnome-session`" ] ; then 
                BROWSER=galeon
        elif
                BROWSER_LIST="mozilla konqueror galeon"
                for item in $BROWSER_LIST; do
                        bin_item=`which $item 2>&1`
                        if [ -x "$bin_item" ]; then
                                BROWSER=$bin_item;
                        fi
                done
        fi
fi 
$BROWSER $file


It would be easy if every environment correctly set the $BROWSER value, 
instead of only relying upon their very specific configuration
tool. Unless you cannot read their configuration, you cannot be sure
to pick the "the best browser".

Maybe you can mix htmlview with additionnal test for KDE.

Regards,


-- 
Mathieu Roy
 
 << Profile  << http://savannah.gnu.org/users/yeupou <<
 >> Homepage >> http://yeupou.coleumes.org           >>
 << GPG Key  << http://stock.coleumes.org/gpg        <<
_______________________________________________
Mc mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc

Reply via email to