[sylpheed:35536] Re: Make URI clickable

Craig freecycle01 at pisquared.net
Mon Jan 21 01:32:00 JST 2013


On Sun, 20 Jan 2013 17:01:45 +0100 Ricardo Mones <mones at debian.org> wrote:

>   Hi Frank,
> 
> On Sun, 20 Jan 2013 15:52:22 +0100
> Frank Elsner <Frank.Elsner at TU-Berlin.DE> wrote:
> > 
> > my current config doesn't mark URIs and I can't click them.
> > 
> > Where in the configuration can I enable this. I can't find it.
> 
>   IIRC this is already enabled by default. Make sure you have checked
> "Enable coloration of message" (Common preferences, Display tab,
> Message sub-tab) and set a different color for URIs (Edit... button).
> 
>   Also you must set a valid browser to launch them (Common preferences,
> Details tab, External commands sub-tab, Web browser combobox/textbox).

I found that just entering the web browser in the Web browser box didn't
do what I wanted on Linux, so I wrote a script
/usr/local/bin/seamonkey.fixurl and put that in the Web browser box as

             seamonkey.fixurl %s

That script is:

================================================================
#!/bin/sh
#
# /usr/local/bin/seamonkey.fixurl
#
# A script to pre-pend "file://" to local file URLs so SeaMonkey will
# open both them and Internet URLs correctly.
#
#	27 Sep 2006		Craig McCluskey
#		- Written.
#	28 Sep 2006		Craig McCluskey
#		- Changed to look for sylpheed and if not present
#	(because it's not a local file), look for ://. If that's not
#		  present, pre-pend http:// .
#	24 Jun 2009		Craig McCluskey
#		- Had problems with some emails having URLs that were
#		  written as "http:// www...." causing $1 to be "http://"
#		  and $2 to be the rest of the URL. Changed definition of
#		  L to $* to concatenate all of the input parameters,
#	thus ignoring the spaces.
#	20 Feb 2010		Craig McCluskey
#		- If the URL has an ampersand in it, like URLs from the
#		  APS careers site, seamonkey opens a new, blank window
#		  instead of a new tab with the URL displayed.
#		- Added definition of $N, which takes the first part of
#		  the URL before an ampersand.
#	22 Feb 2010		Craig McCluskey
#		- Changed cut statement in definition of $N from & to , .
#	10 Jun 2012		Craig McCluskey
#		- Changed grep of $L so files in .sylpheed-2.0 directory
#		  and web pages at sylpheed.saross.jp will both be
#		  rendered correctly.
#		- Changed to calling seamonkey with $M instead of $N. I
#	          have forgotten what $N was supposed to solve. I presume
#	          I'll run into a problem again and relearn the reason.
#

L=$*

echo $L | grep .sylpheed-2.0  > /dev/null
retval1=$?

if test $retval1 -eq 0
  then
    M="file://$L"
  else
    echo $L | grep :// > /dev/null
    retval2=$?
    if test $retval2 -eq 0
      then
        M="$L"
      else
        M="http://$L"
    fi
fi

N=`echo $M | cut -d"," -f1`	# What does this do? When is it used?

WHO=`whoami`
date > /tmp/0.url.$WHO
echo "retval: $retval1" >> /tmp/0.url.$WHO
echo "L: $L" >> /tmp/0.url.$WHO
echo "M: $M" >> /tmp/0.url.$WHO
echo "N: $N" >> /tmp/0.url.$WHO


#/usr/local/bin/seamonkey -remote "openURL($N, new-tab)"
/usr/local/bin/seamonkey -remote "openURL($M, new-tab)"
#/usr/local/bin/seamonkey -remote "openURL("$M")"
#/usr/local/bin/seamonkey -remote "openURL($M)"
#/usr/local/bin/seamonkey openURL($M)"
#/usr/local/bin/seamonkey -remote "$M"
#/usr/local/bin/seamonkey -remote "openURL('$M', new-tab)"

=================================================================


Craig


More information about the Sylpheed mailing list