annotate lib-src/tm-html @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 0293115a14e9
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 #!/bin/sh
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2 #
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
3 # $Id: tm-html,v 1.4 1997/02/02 05:04:53 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4 #
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
5 # Copyright 1994,1995,1996,1997 Free Software Foundation, Inc.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
6
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
7 # This program is free software; you can redistribute it and/or modify
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
8 # it under the terms of the GNU General Public License as published by
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
9 # the Free Software Foundation; either version 2, or (at your option)
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
10 # any later version.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
11 #
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
12 # This program is distributed in the hope that it will be useful,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
15 # GNU General Public License for more details.
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
16 #
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
17 # You should have received a copy of the GNU General Public License
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
18 # along with GNU Emacs; see the file COPYING. If not, write to the
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
19 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
20 # Boston, MA 02111-1307, USA.
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
22 PATH=${PATH:-/usr/bin:/bin}:`dirname $0 2>/dev/null`; export PATH
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 10
diff changeset
23
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 if [ "$TM_TMP_DIR" = "" ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 TM_TMP_DIR=/tmp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26 export TM_TMP_DIR
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 if [ "$TM_WWW_BROWSER" = "" ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30 TM_WWW_BROWSER=netscape
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 export TM_WWW_BROWSER
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 if [ "$5" = "" ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 filename="$TM_TMP_DIR/mime$$.html"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 else
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 filename="$TM_TMP_DIR/$5"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 echo "$2; $3 -> $filename"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 tmdecode "$3" $1 $filename
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 case "$4" in
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45 "play")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 if [ `echo $TM_WWW_BROWSER | grep netscape` ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 echo netscape
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 if [ -h $HOME/.netscape/lock ]; then
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 netscape -remote "openURL(file:$filename,new-window)"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 else
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 netscape $filename
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 else
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 echo not netscape
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 $TM_WWW_BROWSER $filename
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56 fi
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 trap 'rm -f $filename' 0 1 2 3 13 15
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 "extract")
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 echo "extract to $filename"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 ;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62 esac