<<< Date Index >>>     <<< Thread Index >>>

Re: [Slightly OT] Allow for choosing browser to follow a link



On Wed, Aug 29, 2007 at 07:55:18AM -0400, Patrick Shanahan wrote:

> * Kai Grossjohann <kai@xxxxxxxxxxxxxx> [08-29-07 07:36]:
> > Ctrl-b invokes urlview which provides a list of URLs in the current
> > message and allows me to choose one of them to view it.  This invokes
> > w3m or elinks.  This is good.
> > 
> > But from time to time I want to invoke other browsers.  Or just copy the
> > URL to the X11 clipboard.
> > 
> > Is there an alternative to urlview that would allow me to choose the
> > program to run on a case-by-case basis?
> 
> man urlview provides 
> 
>        REGEXP regexp
>                      urlview uses a regular expression to extract URLs
>                    from the specified text files.  \r, \t, \n and \f
>                    are all converted to their normal printf(3)
>                    meanings.  The default REGEXP is:
> 
> (((https?|ftp|gopher)://|(mailto|file|news):)[^' 
> \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>":]
> 
> <ctrl><b> from .muttrc
> 
>        macro   pager   \cb   |urlview\n   'call urlview to extract URLs out 
> of a message'
> 
> 
> write your own script putting the regex result into a variable and
> evoke the browser of your choice:  firefox %s
> 
> call the different scripts via different key combinations
> 
>        macro   pager   \cc  !script\n   'call firefox to view ...'

I don't understand :-(

  - Should the script search for the regex?  In that case, it would need
    to handle multiple occurrences -- which is exactly the job urlview
    was designed for...

  - Should I create different config files for urlview, then invoke
    urlview with the "w3m" for one key or with the "firefox" config file
    for the other key?

    urlview doesn't provide an argument for the config file; this will
    get messy.

Actually, what I want is a list of URLs just like that provided by
urlview, but when selecting an http or https URL I should be able to
choose a browser.  Or perhaps choose a browser globally before selecting
a URL to view.

Kai