annotate lisp/hm--html-menus/hm--html.el @ 42:8b8b7f3559a2 r19-15b104

Import from CVS: tag r19-15b104
author cvs
date Mon, 13 Aug 2007 08:54:51 +0200
parents 441bb1e64a06
children 6a22abad6937
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
42
8b8b7f3559a2 Import from CVS: tag r19-15b104
cvs
parents: 26
diff changeset
1 ;;; $Id: hm--html.el,v 1.5 1997/03/24 01:26:53 steve Exp $
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2 ;;;
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3 ;;; Copyright (C) 1993 - 1997 Heiko Muenkel
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; email: muenkel@tnt.uni-hannover.de
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; Description:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; Defines functions for the file hm--html-menu.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Installation:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Put this file in one of your load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
30 (defun hm--html-set-marker-at-position (&optional position)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
31 "Creates a new marker and set the marker at the POSITION.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
32 If POSITION is nil, then the marker is set at the current point.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
33 The return value is the marker."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
34 (let ((marker (make-marker)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
35 (if position
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
36 (set-marker marker position)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
37 (set-marker marker (point)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; Functions for adding html commands which consists of a start and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; end tag and some text between them. (Basicfunctions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (defun hm--html-add-tags (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
44 &optional
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
45 function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
46 end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
48 middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
49 function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50 middle-end-tag)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Adds the start and the end html tag at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 The second parameter is the string for the start tag and the fourth parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 is the string for the end tag. The third and fourth parameters are optional.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 The fifth parameter is optional. If it exists, it specifies a function which
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
57 inserts the sixth parameter (the middle-start-tag) between the start and the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
58 end tag."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (eval (list function-insert-start-tag start-tag))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60 (if function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61 (eval (list function-insert-middle-start-tag middle-start-tag)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
62 (let ((position (hm--html-set-marker-at-position (point))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 (if function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64 (eval (list function-insert-middle-end-tag middle-end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
65 (if function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
66 (eval (list function-insert-end-tag end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
67 (goto-char position)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defun hm--html-add-tags-to-region (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 end-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
74 &optional
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
75 function-insert-middle-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
76 middle-tag)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 "Adds the start and the end html tag to the active region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 The second parameter is the string for the start tag and the fourth parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 is the string for the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 The fifth parameter is optional. If it exists, it specifies a function which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 inserts the sixth parameter (the middle-tag) between the start and the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (save-window-excursion
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
86 (let ((start (hm--html-set-marker-at-position (region-beginning)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (eval (list function-insert-end-tag end-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (eval (list function-insert-start-tag start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (eval (list function-insert-middle-tag middle-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (defun hm--html-insert-start-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 "Inserts the HTML start tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 The parameter must be a string (i.e. \"<B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
102 (hm--html-indent-region start (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defun hm--html-insert-end-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 "Inserts the HTML end tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 The parameter must be a string (i.e. \"</B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
110 (hm--html-indent-region start (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (defun hm--html-insert-start-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 "Inserts the HTML start tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 The parameter must be a string (i.e. \"<PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
118 (hm--html-indent-region start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
119 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defun hm--html-insert-end-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 "Inserts the HTML end tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 The parameter must be a string (i.e. \"</PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
129 (hm--html-indent-region start (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;; Functions which add simple tags of the form <tag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
135 (defun hm--html-add-list-or-menu-item-separator ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
136 "Adds a list or menu item. Assume we're at the end of the last item."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
137 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
138 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
139
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
140 (defun hm--html-add-list-or-menu-item ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
141 "Adds the tags for a menu item at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
142 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
143 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
144 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
145
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
146 (defun hm--html-add-list-or-menu-item-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
147 "Adds the tags for a menu item to the region in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
148 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
149 (hm--html-add-tags-to-region 'hm--html-insert-start-tag "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
150 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
151
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
152 (defun hm--html-add-basefont (size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
153 "Adds the HTML tag for a basefont."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
154 (interactive (list (hm--html-read-font-size t)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
155 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
156 (concate "<BASEFONT SIZE=" size ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
157
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (defun hm--html-add-line-break ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 "Adds the HTML tag for a line break."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (hm--html-add-tags 'hm--html-insert-start-tag "<BR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defun hm--html-add-horizontal-rule ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 "Adds the HTML tag for a horizontal rule (line)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (hm--html-add-tags 'hm--html-insert-start-tag "<HR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (defun hm--html-add-paragraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 "Adds the HTML tags for a paragraph at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (defun hm--html-add-paragraph-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 "Adds the HTML tags for a paragraph to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defun hm--html-add-paragraph-separator ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 "Adds the tag for a paragraph seperator."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (hm--html-add-tags 'hm--html-insert-start-tag "<P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
193 (defun hm--html-add-doctype ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
194 "Adds the tag with the doctype."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
195 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
196 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
197 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
198 (concat "<!DOCTYPE HTML PUBLIC \""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
199 hm--html-html-doctype-version
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
200 "\">"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
201 (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
202
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
203 (defun hm--html-search-place-for-element-in-head (end-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
204 "Searches the point for inserting an element between the head tags."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
205 (let ((point (point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
206 (if (and end-point (< (point) end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
207 (point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
208 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
209 (if (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
210 (concat "\\(<title\\)\\|\\(<head\\)\\|\\(<html\\)\\|"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
211 "\\(<isindex\\)\\|\\(<base\\)\\|\\(<link\\)\\|"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
212 "\\(<meta")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
213 end-point
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
214 t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
215 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
216 point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
217
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
218 (defun hm--html-add-isindex (prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
219 "Inserts the isindex tag. PROMPT is the value of the prompt attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
220 (interactive "sPrompt: ")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
221 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
222 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
223 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
224 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
225 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
226 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
227 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
228 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
229 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
230 (cond ((re-search-forward "<isindex[^>]*>" head-end-point t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
231 (delete-region (match-beginning 0) (match-end 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
232 (t (goto-char point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
233 (hm--html-search-place-for-element-in-head head-end-point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
234 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
235 (concat "<ISINDEX "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
236 (if (and prompt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
237 (not (string= prompt "")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
238 (concat " PROMPT=\"" prompt "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
239 ">")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
240
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
241 (defun hm--html-add-base (href)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
242 "Inserts the base tag. HREF is the value of the href attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
243 (interactive (list (hm--html-read-url "URL of this document: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
244 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
245 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
246 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
247 nil)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
248 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
249 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
250 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
251 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
252 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
253 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
254 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
255 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
256 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
257 (cond ((re-search-forward "<base[^>]*>" head-end-point t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
258 (delete-region (match-beginning 0) (match-end 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
259 (t (goto-char point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
260 (hm--html-search-place-for-element-in-head head-end-point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
261 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
262 (concat "<BASE "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
263 (if (and href
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
264 (not (string= href "")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
265 (concat " HREF=\"" href "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
266 ">")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
267
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
268 (defun hm--html-add-meta (name content &optional name-instead-of-http-equiv)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
269 "Inserts the meta tag."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
270 (interactive (list (completing-read "Name: " hm--html-meta-name-alist)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
271 (read-string "Content: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
272 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
273 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
274 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
275 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
276 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
277 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
278 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
279 (beginning-of-line)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
280 (point)))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
281 (goto-char point)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
282 (hm--html-search-place-for-element-in-head head-end-point)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
283 (hm--html-add-tags 'hm--html-insert-start-tag
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
284 (concat "<META "
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
285 (if name-instead-of-http-equiv
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
286 "NAME=\""
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
287 "HTTP-EQUIV=\"")
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
288 name
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
289 "\" CONTENT=\""
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
290 content
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
291 "\">")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 ;;; Functions which include something in HTML- documents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (defvar hm--html-url-history-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 "History list for the function 'hm--html-read-url'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (defun hm--html-read-url-predicate (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 "Predicatefunction for hm--html-read-url."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (hm--html-read-url-predicate-1 (cdr table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (defun hm--html-read-url-predicate-1 (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 "Internal function of hm--html-read-url-predicate."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (cond ((not table-element-list) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ((eq (car table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (t (hm--html-read-url-predicate-1 (cdr table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 usagesymbol))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (defun hm--html-read-url (prompt &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 "Function prompts for a URL string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 TABLE is an alist whose elements' cars are URL's.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 PREDICATE limits completion to a subset of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 If REQUIRE-MATCH is non-nil, the user is not allowed to exit unless
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 the input is (or completes to) an element of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 INITIAL-CONTENTS is a string to insert in the minibuffer before reading.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 If INITIAL-CONTENTS is nil, the car of the 'hm--html-url-history-list'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 is used instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 (if table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (completing-read prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 hm--html-url-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (read-string prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (if initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (car hm--html-url-history-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 hm--html-url-history-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (defun hm--html-read-altenate (url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 "Function reads the value for the \"ALT\"- attribute in IMG tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 URL will be used as the default URL for the external viewer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (let ((alttype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 '(("0") ("1") ("2"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 "2"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (cond ((= alttype 0) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ((= alttype 1) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 ((= alttype 2) (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 "Text for the ALT attribute: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (substring (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (string-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 "\\."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (file-name-nondirectory url)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
362 (defun hm--html-read-alignment (prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
363 "Read the value for the align attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
364 (upcase (completing-read prompt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
365 '(("left") ("right") ("top") ("bottom") ("middle"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
366 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
367 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
368 "left")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
369
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
370 (defvar hm--html-shape-history nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
371 "History variable for reading the shape of an image map.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
372
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
373 (defun hm--html-read-shape ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
374 "Reads the shap for an area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
375 (upcase(completing-read "The shape of the area: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
376 '(("rect") ("circle") ("poly"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
377 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
378 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
379 (or (car hm--html-shape-history) "rect")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
380 'hm--html-shape-history)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
381
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
382 (defun hm--html-read-rect-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
383 "Reads rectangle coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
384 (concat (read-string "Left x position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
385 (read-string "Top y position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
386 (read-string "Right x position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
387 (read-string "Bottom y position of the rectangle: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
388
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
389 (defun hm--html-read-circle-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
390 "Reads circle coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
391 (concat (read-string "x position of the center of the circle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
392 (read-string "y position of the center of the circle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
393 (read-string "Radius: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
394
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
395 (defun hm--html-read-one-poly-coordinate (&optional empty-string-prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
396 "Reads one poly coordinate pair."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
397 (let* ((x (read-string (concat "x coordinate"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
398 (or empty-string-prompt "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
399 ": ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
400 (y (unless (string= "" x)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
401 (read-string "y coordinate: "))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
402 (if (string= "" x)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
403 ""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
404 (concat x ", " y))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
405
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
406 (defun hm--html-read-more-poly-coordinates ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
407 "Reads poly coordinates until an empty string is given."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
408 (let ((coord (hm--html-read-one-poly-coordinate
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
409 " (Empty string for no further coords!)")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
410 (cond ((string= "" coord) "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
411 (t (concat ", " coord (hm--html-read-more-poly-coordinates))))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
412
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
413 (defun hm--html-read-poly-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
414 "Reads poly coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
415 (concat (hm--html-read-one-poly-coordinate) ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
416 (hm--html-read-one-poly-coordinate) ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
417 (hm--html-read-one-poly-coordinate)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
418 (hm--html-read-more-poly-coordinates)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
419
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
420 (defun hm--html-add-area (href alt shape coords)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
421 "Adds the tags for an area at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
422 (interactive (let* ((href (hm--html-read-url "Url for the image area: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
423 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
424 (shape (hm--html-read-shape))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
425 (coords (cond ((string= shape "RECT")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
426 (hm--html-read-rect-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
427 ((string= shape "CIRCLE")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
428 (hm--html-read-circle-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
429 ((string= shape "POLY")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
430 (hm--html-read-poly-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
431 (t (error "No function to read \""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
432 shape
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
433 "\" coordinates!")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
434 (list href alt shape coords)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
435 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
436 (concat "<AREA"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
437 " HREF=\"" href "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
438 (if alt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
439 (concat "\nALT=\"" alt "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
440 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
441 "\nSHAPE=" shape
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
442 "\nCOORDS=\"" coords "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
443 ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
444
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
445 (defvar hm--html-use-image-as-map ':ask
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
446 "Internal variable of `hm--html-add-image'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
447 nil => insert the image element without an usemap attribute.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
448 t => insert the image element with an usemap attribute.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
449 :ask => ask, if the image element should have an usemap attribute.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
450
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
451 (defun hm--html-add-image (href alt alignment mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
452 "Add an image."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
453 (interactive (let* ((href (hm--html-read-url "Image URL: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
454 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
455 (alignment (hm--html-read-alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
456 "Alignment of the image: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
457 (use-as-map (if (eq hm--html-use-image-as-map ':ask)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
458 (y-or-n-p
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
459 "Use the image as a map with links? ")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
460 hm--html-use-image-as-map))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
461 (mapname (and use-as-map (hm--html-read-mapname))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
462 (list href alt alignment mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
463 (hm--html-add-tags
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
464 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
465 (concat "<IMG ALIGN=" alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
466 "\nHREF=\"" href "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
467 (if alt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
468 (concat "\nALT=\"" alt "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
469 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
470 (if mapname
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
471 (concat "\nUSEMAP=\"#" mapname "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
472 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
473 ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
474
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 (defun hm--html-add-image-bottom (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 "Add an image, bottom aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
480 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
481 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
482 (concat "<IMG ALIGN=BOTTOM SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
483 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
484 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
485 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
486 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (defun hm--html-add-image-middle (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 "Add an image, middle aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
493 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
494 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
495 (concat "<IMG ALIGN=MIDDLE SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
496 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
497 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
498 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
499 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (defun hm--html-add-image-top (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 "Add an image, top aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
506 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
507 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
508 (concat "<IMG ALIGN=TOP SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
509 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
510 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
511 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
512 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
513
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
514
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
515 (defun hm--html-add-applet (name code width height)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
516 "Add an applet."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
517 (interactive (let ((name (read-string "Applet Name: " "applet"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
518 (code (read-file-name "Applet Class File: "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
519 (width (read-number "Width (i.e.: 100): " t))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
520 (height (read-number "Height (i.e.: 100): " t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
521 (list name code width height)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
522 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
523 (concat "<APPLET "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
524 (if (string= name "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
525 ""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
526 (concat "NAME=\"" name "\"\n"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
527 "CODE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
528 code
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
529 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
530 "WIDTH=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
531 width
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
532 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
533 "HEIGHT=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
534 height
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
535 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
536 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
537 "</APPLET>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
538
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
539 (defun hm--html-add-applet-parameter (name value)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
540 "Adds the tag for an applet parameter at the current point.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
541 This tag must be added between <APPLET> and </APPLET>."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
542 (interactive "sParameter Name: \nsParameter Value: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
543 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
544 (concat "<PARAM "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
545 "NAME=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
546 name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
547 "\" VALUE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
548 value
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
549 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
550
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (defun hm--html-add-server-side-include-file (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 "This function adds a server side include file directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (interactive "FInclude File: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (if (string= file "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (error "ERROR: No filename specified !")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
559 (insert "<INC SRV \"" file "\">"))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (defun hm--html-add-server-side-include-command-with-isindex-parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 The include command uses the \"isindex\"- parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (hm--html-add-server-side-include-command command t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (defun hm--html-add-server-side-include-command (command &optional srvurl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 The directive is only supported by the NCSA http daemon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 If SRVURL is t, then the attribute srvurl instead of srv is used for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 include command. With srvurl, the include command uses the \"isindex\"-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (let ((start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (attribute (if srvurl "SRVURL" "SRV")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (insert "<INC " attribute" \"" command "\">")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
587 (insert "<INC " attribute " \"|" command "\">")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 ;;; Functions, which adds tags of the form <starttag> ... </endtag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
592 (defun hm--html-add-big ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
593 "Adds the HTML tags for Big at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
594 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
595 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
596 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
597 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
598 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
599
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
600
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
601 (defun hm--html-add-big-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
602 "Adds the HTML tags for Big to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
603 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
604 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
605 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
606 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
607 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
608
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
609
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
610 (defun hm--html-add-small ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
611 "Adds the HTML tags for Small at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
612 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
613 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
614 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
615 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
616 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
617
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
618
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
619 (defun hm--html-add-small-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
620 "Adds the HTML tags for Small to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
621 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
622 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
623 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
624 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
625 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
626
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
627
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (defun hm--html-add-bold ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 "Adds the HTML tags for Bold at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (defun hm--html-add-bold-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 "Adds the HTML tags for Bold to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (defun hm--html-add-italic ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 "Adds the HTML tags for Italic at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (defun hm--html-add-italic-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 "Adds the HTML tags for Italic to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (defun hm--html-add-underline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 "Adds the HTML tags for Underline at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (defun hm--html-add-underline-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 "Adds the HTML tags for Underline to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (defun hm--html-add-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 "Adds the HTML tags for Definition at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (defun hm--html-add-definition-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 "Adds the HTML tags for Definition to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (defun hm--html-add-code ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 "Adds the HTML tags for Code at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (defun hm--html-add-code-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 "Adds the HTML tags for Code to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
718 (defun hm--html-add-citation ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
719 "Adds the HTML tags for Citation."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
720 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
721 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
722 "<CITE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
723 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
724 "</CITE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
725
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (defun hm--html-add-citation-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 "Adds the HTML tags for Citation to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 "<CITE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 "</CITE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
735 (defun hm--html-add-emphasized ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
736 "Adds the HTML tags for Emphasized."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
737 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
738 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
739 "<EM>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
740 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
741 "</EM>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
742
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
743
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (defun hm--html-add-emphasized-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 "Adds the HTML tags for Emphasized to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 "<EM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 "</EM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
753 (defun hm--html-add-fixed ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
754 "Adds the HTML tags for Fixed."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
755 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
756 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
757 "<TT>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
758 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
759 "</TT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
760
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
761
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (defun hm--html-add-fixed-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 "Adds the HTML tags for Fixed to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 "<TT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 "</TT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
771 (defun hm--html-add-keyboard ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
772 "Adds the HTML tags for Keyboard."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
773 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
774 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
775 "<KBD>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
776 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
777 "</KBD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
778
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
779
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (defun hm--html-add-keyboard-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 "Adds the HTML tags for Keyboard to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 "<KBD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 "</KBD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
789 (defun hm--html-add-sample ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
790 "Adds the HTML tags for Sample."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
791 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
792 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
793 "<SAMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
794 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
795 "</SAMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
796
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 (defun hm--html-add-sample-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 "Adds the HTML tags for Sample to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 "<SAMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 "</SAMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
806 (defun hm--html-add-strong ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
807 "Adds the HTML tags for Strong."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
808 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
809 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
810 "<STRONG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
811 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
812 "</STRONG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
813
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
814
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 (defun hm--html-add-strong-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 "Adds the HTML tags for Strong to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 "<STRONG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 "</STRONG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
824 (defun hm--html-add-variable ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
825 "Adds the HTML tags for Variable."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
826 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
827 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
828 "<VAR>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
829 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
830 "</VAR>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
831
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (defun hm--html-add-variable-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 "Adds the HTML tags for Variable to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 "<VAR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 "</VAR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (defun hm--html-add-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 "Adds the HTML tags for Comment at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (defun hm--html-add-comment-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 "Adds the HTML tags for Comment to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
859 (defun hm--html-add-document-division (alignment)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
860 "Adds the HTML tags for document division at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
861 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
862 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
863 (concat "<DIV ALIGN=\"" alignment "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
864 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
865 "</DIV>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
866
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
867
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
868 (defun hm--html-add-document-division-to-region ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
869 "Adds the HTML tags for document division to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
870 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
871 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
872 (concat "<DIV ALIGN=\"" alignment "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
873 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
874 "</DIV>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
875
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (defun hm--html-add-preformated ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 "Adds the HTML tags for preformated text at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (defun hm--html-add-preformated-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 "Adds the HTML tags for preformated text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
895 (defun hm--html-add-blockquote ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
896 "Adds the HTML tags for blockquote."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
897 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
898 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
899 "<BLOCKQUOTE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
900 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
901 "</BLOCKQUOTE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
902
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
903
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
912 (defun hm--html-add-script ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
913 "Adds the HTML tags for script."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
916 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 'hm--html-insert-end-tag-with-newline
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
918 "</SCRIPT>"))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
919
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
920
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
921 (defun hm--html-add-script-to-region ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
922 "Adds the HTML tags for script to the region."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
925 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 'hm--html-insert-end-tag-with-newline
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
927 "</SCRIPT>"))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
928
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
929 (defun hm--html-add-style ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
930 "Adds the HTML tags for style."
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
931 (interactive)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
932 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
933 "<STYLE>"
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
934 'hm--html-insert-end-tag-with-newline
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
935 "</STYLE>"))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
936
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
937
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
938 (defun hm--html-add-style-to-region ()
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
939 "Adds the HTML tags for style to the region."
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
940 (interactive)
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
941 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
942 "<STYLE>"
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
943 'hm--html-insert-end-tag-with-newline
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
944 "</STYLE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (hm--html-add-tags 'hm--html-insert-start-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
950 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 'hm--html-insert-end-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
952 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
959 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 'hm--html-insert-end-tag
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
961 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1018 (defun hm--html-read-font-size (&optional only-absolute-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1019 "Reads the size for the FONT element.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1020 It returns nil, if the size should not be changed."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1021 (let ((size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1022 (if only-absolute-size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1023 (completing-read "The absolute font size (1 .. 7): "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1024 '(("7") ("6") ("5") ("4") ("3") ("2") ("1"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1025 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1026 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1027 "4")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1028 (completing-read "The relative (+/-) or absolute font size: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1029 '(("-7") ("-6") ("-5") ("-4") ("-3") ("-2") ("-1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1030 ("+7") ("+6") ("+5") ("+4") ("+3") ("+2") ("+1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1031 ("7") ("6") ("5") ("4") ("3") ("2") ("1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1032 ("use-basefont"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1033 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1034 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1035 "use-basefont-size"))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1036 (if (string= size "use-basefont-size")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1037 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1038 size)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1039
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1040 (defun hm--html-read-font-color ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1041 "Reads the size for the FONT element.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1042 It returns nil, if the color should not be changed."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1043 (let ((color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1044 (completing-read "The font color: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1045 '(("Black") ("Silver") ("Gray") ("White") ("Maroon")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1046 ("Green") ("Lime") ("Olive") ("Yellow") ("Navy")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1047 ("Red") ("Purple") ("Fuchsia") ("Blue") ("Teal")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1048 ("Aqua") ("dont-set-color"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1049 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1050 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1051 "dont-set-color")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1052 (if (string= color "dont-set-color")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1053 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1054 color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1055
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1056
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1057 (defun hm--html-add-font (size color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1058 "Adds the HTML tags for Font at the point in the current buffer."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1059 (interactive (list (hm--html-read-font-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1060 (hm--html-read-font-color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1061 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1062 (concat "<FONT"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1063 (if size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1064 (concat " SIZE=" size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1065 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1066 (if color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1067 (concat " COLOR=" color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1068 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1069 ">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1070 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1071 "</FONT>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1072
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1073
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1074 (defun hm--html-add-font-to-region ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1075 "Adds the HTML tags for Font to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1076 (interactive (list (hm--html-read-font-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1077 (hm--html-read-font-color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1078 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1079 (concat "<FONT"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1080 (if size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1081 (concat " SIZE=" size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1082 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1083 (if color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1084 (concat " COLOR=" color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1085 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1086 ">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1087 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1088 "</FONT>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1094 (defun hm--html-add-center ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1095 "Adds the HTML tags for center at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1096 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1097 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1098 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1099 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1100 "</CENTER>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1101
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1102 (defun hm--html-add-center-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1103 "Adds the HTML tags for center to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1104 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1105 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1106 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1107 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1108 "</CENTER>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1110
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1111 (defvar hm--html-mapname-history nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1112 "The history variable for the function `hm--html-read-mapname'.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1113
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1114 (defun hm--html-read-mapname ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1115 "Reads the name of an image map."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1116 (let ((name (read-string "The name of the image map: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1117 (or (car hm--html-mapname-history)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1118 "map")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1119 'hm--html-mapname-history)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1120 name))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1121
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1122 (defun hm--html-add-image-map ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1123 "Adds an image and a map element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1124 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1125 (let* ((href (hm--html-read-url "Image URL: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1126 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1127 (alignment (hm--html-read-alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1128 "Alignment of the image: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1129 (mapname (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1130 (hm--html-add-image href alt alignment mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1131 (newline)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1132 (hm--html-add-map mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1133 (call-interactively 'hm--html-add-area)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1134
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1135 (defun hm--html-add-map (name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1136 "Adds the HTML tags for map at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1137 (interactive (list (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1138 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1139 (concat "<MAP NAME=\"" name "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1140 'hm--html-insert-end-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1141 "</MAP>")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1142 (end-of-line 0))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1143
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1144 (defun hm--html-add-map-to-region (name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1145 "Adds the HTML tags for map to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1146 (interactive (list (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1147 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1148 (concat "<MAP NAME=\"" name "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1149 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1150 "</MAP>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1151
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1152
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 "Adds the HTML tags for a numbered list at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1161 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1162 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1163 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1171 "</OL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 "Adds the HTML tags for a directory list at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1182 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1183 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1184 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1192 "</DIR>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1195 (defun hm--html-add-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1196 "Adds the HTML tags for a (unnumbered) list to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1197 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1198 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1199 "<UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1200 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1201 "</UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1202 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1203 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1204 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1205 " </LI>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1206
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1207
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (defun hm--html-add-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 "Adds the HTML tags for a (unnumbered) list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1214 "</UL>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1215
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1216
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1217 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1218 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1219 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1220 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1221 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1222 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1223 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1224 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1225 "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1226 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1227 " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1228
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1229
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1236 "</MENU>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1237
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1238
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1239 (defun hm--html-add-description-title-and-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1240 "Adds a definition title and entry.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1241 Assumes we're at the end of a previous entry."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1242 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1243 (hm--html-add-description-title)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1244 (let ((position (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1245 (case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1246 (search-forward "</dt>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1247 (hm--html-add-description-entry)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1248 (goto-char position)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1249
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1250
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1251 (defun hm--html-add-description-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1252 "Adds the HTML tags for a description list.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1253 It also inserts a tag for the description title."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1254 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1255 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1256 "<DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1257 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1258 "</DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1259 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1260 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1261 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1262 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1263
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1272 "</DL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (defun hm--html-add-description-title ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1276 "Adds the HTML tags for a description title at current point in the buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1277 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1278 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1279 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1280 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1281 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1282
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1283
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1284 (defun hm--html-add-description-title-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1285 "Adds the HTML tags for a description title to the region in the buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1286 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1287 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1288 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1289 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1290 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1291
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1292
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1293 (defun hm--html-add-description-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1294 "Adds the HTML tags for a description entry at current point in the buffer."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1297 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1298 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1299 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1300
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1301
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1302 (defun hm--html-add-description-entry-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1303 "Adds the HTML tags for a description entry to the region in the buffer."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1305 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1306 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1307 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1308 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1309
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1310
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1311 (defun hm--html-add-address ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1312 "Adds the HTML tags for an address."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1313 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1314 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1315 "<ADDRESS>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1316 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1317 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1323 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 'hm--html-insert-end-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1325 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 "The signature reference name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (defun hm--html-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (concat
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1335 "<A NAME=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 hm--html-signature-reference-name
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1337 "\"\nHREF=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 "\">"))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1340
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1346 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1347 (if (re-search-forward (concat "<address>[ \t\n]*"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1348 "<a[ \t\n]+name=[ \t\n]*\"?"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1349 hm--html-signature-reference-name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1350 "\"?[ \t\n]+href=[ \t\n]*\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1351 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1352 t)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1353 (let ((signature-start (match-beginning 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1354 (signature-end (progn
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1355 (re-search-forward "</address>[ \t]*[\n]?"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1356 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1357 t)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1358 (point))))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1359 (when (yes-or-no-p "Delete the old signature (yes or no) ?")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1360 (delete-region signature-start signature-end)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1361 (hm--html-indent-line)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 It searches from the end to the beginning of the file. At first it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (goto-char (point-max))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1370 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1371 (cond ((search-backward "</body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1372 (end-of-line 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1373 (if (> (current-column) 0)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1374 (newline 1)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1375 ((search-backward "</html>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1376 (end-of-line 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1377 (if (> (current-column) 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1378 (newline 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1379 ((> (current-column) 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1380 (newline 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1381 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (defun hm--html-add-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 "Adds the owner's signature at the end of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (hm--html-set-point-for-signature)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1394 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1395 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 'hm--html-insert-end-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1397 "</A>\n</ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (error "ERROR: Define your hm--html-signature-file first !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 "Adds the HTML tags for a header at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434 for the HTML tag <ISINDEX>. If such a tag exists, the point is set to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 tag <HEAD> and sets the point after the tag, if it exists, or searches for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 the tag <HTML>. If this tag exists, the point is set to the position after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1440 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1441 (cond ((search-forward-regexp "<isindex[^>]*>" nil t) (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1442 ((search-forward-regexp "<head[^>]*>" nil t) (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1443 ((search-forward-regexp "<html[^>]*>" nil t) (newline))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1444 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1452 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1453 (if (search-forward "<title>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1454 (let ((point-after-start-tag (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1455 (if (not (search-forward "</title>" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1456 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1457 (goto-char (- (point) 8))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1458 (delete-backward-char (- (point) point-after-start-tag))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1459 (let ((start (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1460 (insert title " (" (hm--date) ")")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1461 (goto-char start))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1462 ;; Noch kein <TITLE> im Buffer vorhanden
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1463 (hm--html-set-point-for-title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1464 (hm--html-add-tags 'hm--html-insert-start-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1465 "<TITLE>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1466 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1467 "</TITLE>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1468 'insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1469 (concat title " (" (hm--date) ")"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1470 (forward-char 8)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1471 (newline 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1472 ))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1478 (let ((title (buffer-substring (region-beginning) (region-end)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1479 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (insert title " (" (hm--date) ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 "Adds the HTML tags <HTML> and </HTML> in the buffer.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1504 The tag <HTML> will be inserted at the beginning (after the
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1505 <!DOCTYPE ...>, if it is already there.) and </HTML> at the
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1508 (let ((new-cursor-position nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1509 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 (error "There is an old tag <HTML> in the current buffer !")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1514 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1529 The tags will be inserted after <HTML> or at the beginning
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1530 of the file after <DOCTYPE...> (if it is already there).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1533 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (goto-char (point-min))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1535 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1568 "</HEAD>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 The tags will be inserted before </HTML> or at the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1584 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 (forward-char -1)))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1593 (let ((end-tag-position (set-marker (make-marker) (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 (let ((cursor-position (point)))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1601 (goto-char end-tag-position)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<BODY>"
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1609 'hm--html-insert-end-tag-with-newline "</BODY>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 "Adds the HTML tags for a title and a header in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 (interactive "sTitle and Header String: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1624 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1625 (hm--html-add-title title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1626 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1627 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1628 (search-forward "</title>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1629 (if (search-forward "</head>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1630 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1631 (search-forward "<body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1632 (newline 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1633 (if (search-forward "<body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1634 (newline 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1635 (if (string= (what-line) "Line 1")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1636 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1637 (end-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1638 (newline 1)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1639 (hm--html-add-header 1 title))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 (defun hm--html-add-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 "Adds the HTML tags for a title and a header to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (interactive "sTitle and Header String: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1656 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1657 (hm--html-add-doctype)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1658 (hm--html-add-html)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1659 (hm--html-add-head)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1660 (hm--html-add-body)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1661 (hm--html-add-title-and-header title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1662 (if hm--html-signature-file
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1663 (hm--html-add-signature))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1664 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1665 (search-forward "</h1>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1666 (forward-line 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1667 (if hm--html-automatic-created-comment
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1668 (hm--html-insert-created-comment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 "Adds a full HTML frame to the current buffer with the use of a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 (hm--html-add-title-and-header-to-region)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1678 (hm--html-add-doctype)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (hm--html-add-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1687 (defun hm--html-add-link-target-to-region (name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1688 "Adds the HTML tags for a link target to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1689 (interactive "sName: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1690 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1691 (concat "<A NAME=\"" name "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1692 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1693 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1694
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 "Adds the HTML tags for a link target at point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 It returns the example extent."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1709 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1710 (if (hm--html-get-example-from-parameter-list parameter-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1711 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1712 (search-forward (hm--html-get-example-from-parameter-list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1713 parameter-list))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1714 (let ((extent (make-extent (match-beginning 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1715 (match-end 0))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1716 (set-extent-face extent 'hm--html-help-face)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1717 extent)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 (hm--html-write-alist-in-buffer (cdr alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 (cdr prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 (t filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 hm--html-delete-wrong-path-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 if PARAMETER-LIST is not nil. If the PARAMETER-LIST is nil, only an empty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 If the ALIST is nil and DEFAULT is nil, then the function only reads
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 If the ALIST isn't nil, the function lists the contents of the ALIST
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 If only ALIST is nil, or if you type a number which is not in the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 If REQUIRE-MATCH is t, the filename with path must match an existing file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 also nil it returns an empty string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 (make-face 'hm--html-help-face)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1865 (if hm--html-help-foreground
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1866 (set-face-foreground 'hm--html-help-face hm--html-help-foreground))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1867 (if hm--html-help-background
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1868 (set-face-background 'hm--html-help-face hm--html-help-background))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1869 (set-face-font 'hm--html-help-face hm--html-help-font)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 (car parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 (defun hm--html-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (car (cdr parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (defun hm--html-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 path+file-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 construct the link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 (let ((point nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 (let ((html-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 (html-help-buffer (hm--html-generate-add-link-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 (scheme (hm--html-completing-read scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 (hostname:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 (servername:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 (path+file (hm--html-read-filename path+file-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 (anchor (hm--html-completing-read anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 (anchor-seperator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 anchor-parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 (if (not (string= scheme ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 (if (string= hostname:port "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 (setq scheme (concat scheme ":"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 (setq scheme (concat scheme "://"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 (if (and (not (string= hostname:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 (not (string= servername:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 (not (string= (substring servername:port 0 1) "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 (setq servername:port (concat "/" servername:port)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 (if (and (not (string= path+file ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 (not (string= "/" (substring path+file 0 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 (setq path+file (concat "/" path+file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 (if (not (string= anchor ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 (setq anchor (concat anchor-seperator anchor)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 (kill-buffer html-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 (pop-to-buffer html-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 (eval (list function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 ''hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 (concat "<A"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 ; hrefname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 path+file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 ''hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 "</A>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 (setq point (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 (goto-char (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 "Internal function. Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 "Adds the HTML tags for a link on a GNU Info file to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 "Adds the HTML tags for a link to a WAIS server to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 "Internal function. Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 "wais"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 "wais")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 "Adds the HTML tags for a direct link to a WAIS server to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 (defun hm--html-add-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 "Adds the HTML tags for a link to an HTML file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 (hm--html-add-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 "Adds the HTML tags for a link to an HTML file to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 "Adds the HTML tags for a link to an FTP server to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 "Subject%20Tree"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 "Adds the HTML tags for a link to a gopher server to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 (defun hm--html-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 (let ((alist nil)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2371 (buffername (find-file-noselect proggate-allowed-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2372 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (defun hm--html-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 The function looks at the environment variable NNTPSERVER.
42
8b8b7f3559a2 Import from CVS: tag r19-15b104
cvs
parents: 26
diff changeset
2506 If this variable exists, it tries to open the file with the Name
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (if (file-exists-p (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 (let ((alist nil)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2527 (buffername (find-file-noselect newsrc-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2528 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 "Adds the HTML tags for a link to a news group to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 (defun hm--html-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 (defun hm--html-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 (hm--html-add-mail-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 "Adds the HTML tags for a link to a mail box to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 (hm--html-add-mail-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 (list ; servername:port
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2656 "Mailaddress: "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2681 (defun hm--html-add-relative-link (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2682 "Adds the HTML tags for a relative link at the current point."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2683 (interactive (list (file-relative-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2684 (read-file-name "Relative Filename: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2685 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2686 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2687 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2688 "")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2689 default-directory)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2690 ))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2691 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2692 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2693 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2694 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2695 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2696 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2697
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2698 (defun hm--html-add-relative-link-to-region (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2699 "Adds the HTML tags for a relative link to the region."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2700 (interactive (list (file-relative-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2701 (read-file-name "Relative Filename: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2702 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2703 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2704 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2705 ""))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 (concat "<A HREF=\""
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2708 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2709 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2710 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2711 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2712
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2713 (defun hm--html-add-normal-link (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2714 "Adds the HTML tags for a normal general link.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2715 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2716 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2717 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2718 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2719 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2720 link-object
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2721 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2722 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2723 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2724
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2725 (defun hm--html-add-normal-link-to-region (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2726 "Adds the HTML tags for a normal general link to region.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2727 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2728 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2729 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2730 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2731 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2732 link-object
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (read-string "Node Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 "Hook function which updates the date in the title line, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 'hm--html-automatic-new-date' is t and which inserts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (if hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (hm--html-new-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 (if hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (hm--html-insert-changed-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 "\\((\\)"
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
2774 "\\([ \t]*[0-3]?[0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9][0-9]"
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
2775 "[ \t]*\\)"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 noerror is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (if (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (error "ERROR: Please insert a title in the document !"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 (let ((end-of-title-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (if (search-forward "<!-- Created by: " end-of-head t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (if (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 "Replace the old comment \"<!-- Created by: \" ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 (kill-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (hm--date))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 (hm--date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (defun hm--html-insert-changed-comment-1 (newline username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 "Internal function of 'hm--html-insert-changed-comment'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 Inserts a newline if NEWLINE is t, before the comment is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 USERNAME is the name to be inserted in the comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 (insert "Changed by: " username ", " (hm--date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 "The function inserts a \"changed comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 The comment looks like <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 after the title line. If there is no title and NOERROR is nil, an error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 message is generated. The line is not inserted after the end of the head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 If the last \"changed line\" is from the same author, it is only replaced
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 Attention: Don't change the format of the lines and don't write anything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 else in such a line !"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (username (or hm--html-username (user-full-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (goto-char end-of-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (if (search-backward "<!-- Changed by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 (if (string-match username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 (hm--html-insert-changed-comment-1 nil username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 (if (search-backward "<!-- Created by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 "ERROR: Insert at first a title in the document !"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (defvar hm--html-template-file-history nil
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2896 "Historyvariable for the template files in the `hm--html-mode'.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (defun hm--html-insert-template (filename)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2899 "Inserts a templatefile.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2900 It uses `tmpl-insert-template-file' to insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2901 the templates. The variables `tmpl-template-dir-list',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2902 `tmpl-automatic-expand' and `tmpl-history-variable-name' are
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2903 overwritten by `hm--html-template-dir',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2904 `hm--html-automatic-expand-templates' and `hm--html-template-file-history'."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2905 (interactive (list nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2906 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2907 hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2908 (list hm--html-template-dir)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2909 (tmpl-automatic-expand hm--html-automatic-expand-templates)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2910 (tmpl-history-variable-name 'hm--html-template-file-history))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2911 (if filename
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2912 (tmpl-insert-template-file filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2913 (call-interactively 'tmpl-insert-template-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2914 ))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2915
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2916 (defun hm--html-insert-template-from-fixed-dirs (filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2917 "Inserts a templatefile.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2918 It uses `tmpl-insert-template-file-from-fixed-dirs' to insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2919 the templates. The variables `tmpl-template-dir-list',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2920 `tmpl-automatic-expand', `tmpl-filter-regexp' and
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2921 `tmpl-history-variable-name' are overwritten by
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2922 `hm--html-template-dir', `hm--html-automatic-expand-templates',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2923 `hm--html-template-filter-regexp' and `hm--html-template-file-history'."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2924 (interactive (list nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2925 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2926 hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2927 (list hm--html-template-dir)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2928 (tmpl-automatic-expand hm--html-automatic-expand-templates)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2929 (tmpl-filter-regexp hm--html-template-filter-regexp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2930 (tmpl-history-variable-name 'hm--html-template-file-history))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2931 (if filename
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2932 (tmpl-insert-template-file-from-fixed-dirs filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2933 (call-interactively 'tmpl-insert-template-file-from-fixed-dirs))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2934 ))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2935
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2939 (if (adapt-emacs19p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 '(("POST") ("GET"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 (read-string "Symbolic name: " last-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 (defun hm--html-form-add-input (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 ">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (hm--html-form-add-input "checkbox" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 "Name of the last radio button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 (defun hm--html-form-add-input-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 (hm--html-form-add-input "radio" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (defun hm--html-form-add-input-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (hm--html-form-add-input "submit" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (defun hm--html-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 (defun hm--html-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 (defun hm--html-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 (defun hm--html-form-add-select-option (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 "</TEXTAREA>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 If COMPACT is t, then the table should be drawn in a smaller size."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 If COMPACT is t, then the table should be drawn in a smaller size."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 If TOP is t, then the title will positioned at the top instead of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 (defun hm--html-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 If TOP is t, then the title will positioned at the top instead of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 (defun hm--html-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3409 (concat "<TR>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3410 (mapconcat '(lambda (entry)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3411 (concat "<TH" entry))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3412 (hm--html-table-read-cell-entries-and-alignments
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3413 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3414 no-of-cells)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3415 " </TH>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3416 " </TH></TR>")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3428 (concat "<TR><TD"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3429 (car (hm--html-table-read-cell-entries-and-alignments 1 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3430 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 (if (<= no-of-cells 1)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3432 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 2 no-of-cells)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3438 " </TD>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3439 " </TD></TR>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 (defun hm--html-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447 (let* ((point-of-view (point))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3448 (case-fold-search t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3449 (end-of-last-row (search-backward "</tr>" (point-min) t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3450 (begin-of-last-row (progn (search-backward "<tr" (point-min) t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3451 (re-search-forward "<t[dh]"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3452 point-of-view t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (alignment-list nil))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3455 (goto-char begin-of-last-row)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3456 (if (not (re-search-forward "<t[dh]" end-of-last-row t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3462 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3473 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482 from existing rows of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3488 (concat "<TR><TD" (car (hm--html-table-read-cell-entries-and-alignments
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3489 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3490 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3491 old-alignment-list))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3492 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 (if (<= no-of-cells 1)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3494 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 (cdr old-alignment-list))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3502 " </TD>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3503 " </TD></TR>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506 (defun hm--html-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3520 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3526 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535 "Adds the HTML tags for a table row start and end at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 "<TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550 (defun hm--html-add-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 "Adds the HTML tags for a table row start and end to the current region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3555 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3556 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3558 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3566 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3567 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569 (interactive "NNo of columns, spaned by this cell: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3570 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3571 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3572 (if (and (search-backward "<" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3573 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3574 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3575 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3576 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3577 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3578 (delete-region (match-beginning 2) (match-end 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3579 (insert (format "\"%d\"" columns)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3580 (insert (format " colspan=\"%d\"" columns)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3581 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 (interactive "NNo of rows, spaned by this cell: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3588 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3589 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3590 (if (and (search-backward "<" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3591 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3592 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3593 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3594 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3595 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3596 (delete-region (match-beginning 2) (match-end 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3597 (insert (format "\"%d\"" rows)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3598 (insert (format " rowspan=\"%d\"" rows)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3599 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3603 ;(setq buffer-invisibility-spec '(hm--html-iso-entity-invisible-flag))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3604
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3605 ;(defvar hm--html-iso-entity-invisible-flag t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3606 ; "Controls the visibility of the iso entities.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3607
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3608 ;(defvar hm--html-iso-glyph-invisible-flag nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3609 ; "Controls the visibility of the iso character glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3610
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3611 ;(defvar hm--html-glyph-cache nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3612 ; "Internal variable. An assoc list with the already created glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3613
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3614 ;(defun hm--html-create-glyph (string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3615 ; "Creates a glyph from the string or returns an existing one.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3616 ;The glyph is stored in `hm--html-glyph-cache'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3617 ; (if nil ;(assoc string hm--html-glyph-cache)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3618 ; (cdr (assoc string hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3619 ; (let ((glyph (make-glyph string)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3620 ; (setq hm--html-glyph-cache (cons (cons string glyph)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3621 ; hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3622 ; glyph)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3623
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3624 ;(defun hm--html-attach-glyph-to-region (start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3625 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3626 ; string
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3627 ; region-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3628 ; glyph-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3629 ; "Make the region invisible and attach a glyph STRING.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3630 ;The invisible flags could be used, to toggle the visibility."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3631 ; (mapcar 'delete-annotation (annotations-at end)) ; delete old anotations
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3632 ; ;; delete old extents
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3633 ; (let ((extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3634 ; (annotation nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3635 ; (set-extent-property extent 'invisible region-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3636 ; (set-extent-property extent 'end-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3637 ; (set-extent-property extent 'start-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3638 ; (set-extent-property extent 'intangible t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3639 ; (setq annotation (make-annotation "Hallo Du da" ;(hm--html-create-glyph string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3640 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3641 ; 'text))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3642 ; (goto-char end)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3643
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3644
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3645 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3646 ; "Inserts an iso char as html ENTITY and displays a glyph.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3647 ;The glyph is created from the string CHAR."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3648 ; (let ((start (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3649 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3650 ; (hm--html-attach-glyph-to-region start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3651 ; (point)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3652 ; char
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3653 ; 'hm--html-iso-entity-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3654 ; 'hm--html-iso-glyph-invisible-flag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3655
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3656 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3657 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3658 ; (hm--html-insert-iso-char-as-entity-and-glyph "ü" "&uuml;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3659
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3660
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3661 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3662 ; (let ((start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3663 ; (end nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3664 ; (extent nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3665 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3666 ; (setq end (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3667 ; (setq extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3668 ; (set-extent-begin-glyph extent char)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3669 ; (set-extent-property extent 'invisible t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3670
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3671 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3672 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3673 ; (hm--html-insert-iso-char-as-entity-and-glyph ?ü "&uuml;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3674
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3675 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3676 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3677 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3678 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3680 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3681 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3682 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3683 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3685 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3686 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3687 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3688 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3690 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3691 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3692 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3693 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3695 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3696 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3697 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3698 (insert "&Uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3700 (defun hm--html_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3701 "Insert the character 'Oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3702 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3703 (insert "&Ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3705 (defun hm--html_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3706 "Insert the character 'Ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3707 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3708 (insert "&Auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3710 (defun hm--html_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3711 "Insert the character 'Aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3712 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3713 (insert "&Aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3715 (defun hm--html_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3716 "Insert the character 'sz'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3717 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3718 (insert "&szlig;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3720 (defun hm--html_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3721 "Insert the character 'aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3722 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3723 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3725 (defun hm--html_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3726 "Insert the character 'eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3727 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3728 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3730 (defun hm--html_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3731 "Insert the character 'iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3732 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3733 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3735 (defun hm--html_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3736 "Insert the character 'oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3737 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 (defun hm--html_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 "Insert the character 'uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745 (defun hm--html_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 "Insert the character 'Aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750 (defun hm--html_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 "Insert the character 'Eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 (defun hm--html_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 "Insert the character 'Iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760 (defun hm--html_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 "Insert the character 'Oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765 (defun hm--html_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 "Insert the character 'Uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3767 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3768 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3770 (defun hm--html_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 "Insert the character 'agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3773 (insert "&agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3775 (defun hm--html_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776 "Insert the character 'egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778 (insert "&egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3780 (defun hm--html_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 "Insert the character 'igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783 (insert "&igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 (defun hm--html_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 "Insert the character 'ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3788 (insert "&ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790 (defun hm--html_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 "Insert the character 'ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3792 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3793 (insert "&ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 (defun hm--html_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 "Insert the character 'Agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3797 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798 (insert "&Agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800 (defun hm--html_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 "Insert the character 'Egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803 (insert "&Egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805 (defun hm--html_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 "Insert the character 'Igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808 (insert "&Igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810 (defun hm--html_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 "Insert the character 'Ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813 (insert "&Ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 (defun hm--html_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 "Insert the character 'Ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3817 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818 (insert "&Ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820 (defun hm--html_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 "Insert the character 'ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823 (insert "&ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 (defun hm--html_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 "Insert the character 'Ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828 (insert "&Ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 (defun hm--html_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 "Insert the character 'atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833 (insert "&atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835 (defun hm--html_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 "Insert the character 'otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838 (insert "&otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 (defun hm--html_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 "Insert the character 'ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843 (insert "&ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845 (defun hm--html_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 "Insert the character 'Atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848 (insert "&Atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 (defun hm--html_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 "Insert the character 'Otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3852 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3853 (insert "&Otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3855 (defun hm--html_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856 "Insert the character 'Ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3857 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3858 (insert "&Ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3860 (defun hm--html_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 "Insert the character 'acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863 (insert "&acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 (defun hm--html_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 "Insert the character 'ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868 (insert "&ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3870 (defun hm--html_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 "Insert the character 'icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3872 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873 (insert "&icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3874
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 (defun hm--html_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876 "Insert the character 'ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878 (insert "&ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3880 (defun hm--html_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 "Insert the character 'ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3883 (insert "&ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3885 (defun hm--html_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 "Insert the character 'Acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888 (insert "&Acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3890 (defun hm--html_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3891 "Insert the character 'Ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3892 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3893 (insert "&Ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3895 (defun hm--html_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 "Insert the character 'Icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3897 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3898 (insert "&Icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3900 (defun hm--html_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901 "Insert the character 'Ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3902 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3903 (insert "&Ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3904
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3905 (defun hm--html_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 "Insert the character 'Ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3907 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3908 (insert "&Ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3910 (defun hm--html_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 "Insert the character 'ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3912 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3913 (insert "&euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3915 (defun hm--html_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 "Insert the character 'idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3917 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3918 (insert "&iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920 (defun hm--html_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921 "Insert the character 'Ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923 (insert "&Euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 (defun hm--html_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926 "Insert the character 'Idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3927 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3928 (insert "&Iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3930 (defun hm--html_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3931 "Insert the character 'thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3932 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3933 (insert "&thorn;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 (defun hm--html_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3936 "Insert the character 'Thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3937 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938 (insert "&THORN;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3940 (defun hm--html_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 "Insert the character 'eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3942 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943 (insert "&eth;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3945 (defun hm--html_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946 "Insert the character 'Eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3947 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3948 (insert "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3949
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3951 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3952 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3957
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3958 (defun hm--html-less-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3959 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3960 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3961 (insert "&lt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3962
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3966 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3967 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3968 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3969 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3970 (hm--html-less-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3971 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3972 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3973 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3975 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3976 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3977
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3978 (defun hm--html-greater-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3979 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3980 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3981 (insert "&gt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3982
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3983 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3984 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3985 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3986 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3990 (hm--html-greater-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992 (insert ?>)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993 (setq hm--just-insert-greater-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3994
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3995
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3996 (defvar hm--just-insert-ampersand nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3997 "Internal variable.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3998
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3999 (defun hm--html-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4000 "Inserts the entity '&amp;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4001 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4002 (insert "&amp;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4003
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4004 (defun hm--html-smart-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4005 "Insert a '&' or the entity '&amp;' if you execute this command twice."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4006 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4007 (if (and (eq last-command 'hm--html-smart-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4008 hm--just-insert-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4009 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4010 (delete-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4011 (hm--html-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4012 (setq hm--just-insert-ampersand nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4013 (insert ?&)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4014 (setq hm--just-insert-ampersand t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4015
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4016
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4017 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4018 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4019 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4020
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4021 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4022 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4023 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4024 This should be changed in the fututure, so that it doesn't need vm."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4025 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4026 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4027 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4028 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4029 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4030 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4031 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4032 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4033 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4034 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4035 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4036 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4038
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4039
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4040 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4041 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4042 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4044 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4045 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4046 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4047 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4048 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4049 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4050 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4051 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4053 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4054 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4055 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4056 (interactive)
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
4057 (w3-fetch (concat "http://www.tnt.uni-hannover.de"
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
4058 "/~muenkel/software/own/hm--html-menus/overview.html")))
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 24
diff changeset
4059
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4061 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4062 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4063 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4065 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4066 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4067 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4068 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4069 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4070 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4071 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4072 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4073 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4074 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4075 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4076 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4077 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4078 'hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4079 'hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4080 'hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4081 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4082 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4083 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4084 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4085 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4086 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4087 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4088 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4089 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4090 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4091 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4092 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4093 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4094 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4095 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4096 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4097 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4098 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4099 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4100 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4101 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4102 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4103 'hm--html-menu-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4104 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4105 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4106 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4107 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4108 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4109 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4110 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4111 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4112 'hm--html-user-config-file
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4113 'hm--html-site-config-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4114 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4115 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4118 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119 'hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 'html-document-previewer
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4121 'hm--html-region-mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122 'html-sigusr1-signal-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4123 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4124 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4125 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4130 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4134 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4135 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4136
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4137 (add-hook 'zmacs-activate-region-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4138 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4140 (add-hook 'zmacs-deactivate-region-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4141 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4143 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4145 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4147 (add-hook 'activate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4148 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4150 (add-hook 'deactivate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4151 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4153 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4156 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4157 ; Environment loading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4158 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4160 (defun hm--html-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4161 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4162 First, the system config file (detemined by the environment variable
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4163 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4164 At second a site config file is loaded, if the environment variable
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4165 HTML_SITE_CONFIG_FILE or the lisp variable `hm--html-site-config-file'
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4166 is set to such a file.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4167 At least the user config file (determined by the environment variable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 If no HTML_CONFIG_FILE exists, then the file hm--html-configuration.el(c)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 `hm--html-user-config-file' is checked. If this variable is nil or the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 also doesn't exist, then the file ~/.hm--html-configuration.el(c) is used."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4175 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4176 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4177 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4178 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4180 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181 (load-library "hm--html-configuration"))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4182
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4183 ;; at second the site config file
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4184 (if (and (stringp (getenv "HTML_SITE_CONFIG_FILE"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4185 (file-exists-p
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4186 (expand-file-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4187 (getenv "HTML_SITE_CONFIG_FILE"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4188 (load-file (expand-file-name (getenv "HTML_SITE_CONFIG_FILE")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4189 (when (and (boundp 'hm--html-site-config-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4190 (stringp hm--html-site-config-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4191 (file-exists-p (expand-file-name hm--html-site-config-file)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4192 (load-file (expand-file-name hm--html-site-config-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4194 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4195 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4196 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4197 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4198 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4199 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4200 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4201 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4202 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4203 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4204 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4205 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4206 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4207 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4208 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4209 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4210 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4211 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4212 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4214
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4215 ;;; quotify href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4216
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4217 (defvar hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4218 "<[aA][ \t\n]+\\([nN][aA][mM][eE]=[a-zA-Z0-9]+[ \t\n]+\\)?[hH][rR][eE][fF]="
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4219 "Regular expression used for searching hrefs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4220
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4221 (defun hm--html-quotify-hrefs ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4222 "Insert quotes around all HREF and NAME attribute value literals.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4223
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4224 This remedies the problem with old HTML files that can't be processed
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4225 by SGML parsers. That is, changes <A HREF=foo> to <A HREF=\"foo\">.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4226
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4227 Look also at the variable `hm--html-quotify-href-regexp'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4228 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4229 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4230 (goto-char (point-min))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4231 (while
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4232 (re-search-forward hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4233 (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4234 t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4235 (cond
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4236 ((null (looking-at "\""))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4237 (insert "\"")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4238 (re-search-forward "[ \t\n>]" (point-max) t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4239 (forward-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4240 (insert "\""))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4241
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4242
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4243
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4244 (provide 'hm--html)