annotate lisp/hm--html-menus/hm--html.el @ 116:9f59509498e1 r20-1b10

Import from CVS: tag r20-1b10
author cvs
date Mon, 13 Aug 2007 09:23:06 +0200
parents a145efe76779
children 1856695b1fa9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1 ;;; $Id: hm--html.el,v 1.5 1997/03/28 02:28:42 steve Exp $
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2 ;;;
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
30 (defun hm--html-set-marker-at-position (&optional position)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
31 "Creates a new marker and set the marker at the POSITION.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
32 If POSITION is nil, then the marker is set at the current point.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
33 The return value is the marker."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
34 (let ((marker (make-marker)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
35 (if position
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
36 (set-marker marker position)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
57 inserts the sixth parameter (the middle-start-tag) between the start and the
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
74 &optional
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
75 function-insert-middle-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
152 (defun hm--html-add-basefont (size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
153 "Adds the HTML tag for a basefont."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
154 (interactive (list (hm--html-read-font-size t)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
155 (hm--html-add-tags 'hm--html-insert-start-tag
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
156 (concat "<BASEFONT SIZE=" size ">")))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
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
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
193 (defun hm--html-add-doctype ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
194 "Adds the tag with the doctype."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
195 (interactive)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
196 (goto-char (point-min))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
197 (hm--html-add-tags 'hm--html-insert-start-tag
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
198 (concat "<!DOCTYPE HTML PUBLIC \""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
199 hm--html-html-doctype-version
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
200 "\">"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
201 (newline))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
202
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
203 (defun hm--html-search-place-for-element-in-head (end-point)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
204 "Searches the point for inserting an element between the head tags."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
205 (let ((point (point)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
206 (if (and end-point (< (point) end-point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
207 (point)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
208 (goto-char (point-min))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
209 (if (re-search-forward
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
210 (concat ;"\\(<title\\)\\|\\(<head\\)\\|\\(<html\\)\\|"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
211 "\\(<title\\)\\|"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
212 "\\(<isindex\\)\\|\\(<base\\)\\|\\(<link\\)\\|"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
213 "\\(<meta\\)")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
214 end-point
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
215 t)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
216 (beginning-of-line)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
217 end-point))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
218
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
219 (defun hm--html-add-isindex (prompt)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
220 "Inserts the isindex tag. PROMPT is the value of the prompt attribute."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
221 (interactive "sPrompt: ")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
222 (save-excursion
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
223 (let ((point (point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
224 (case-fold-search t)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
225 (head-end-point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
226 (goto-char (point-min))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
227 (setq head-end-point (when (re-search-forward
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
228 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
229 (beginning-of-line)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
230 (point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
231 (goto-char (point-min))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
232 (cond ((re-search-forward "<isindex[^>]*>" head-end-point t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
233 (delete-region (match-beginning 0) (match-end 0)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
234 (t (goto-char point)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
235 (hm--html-search-place-for-element-in-head head-end-point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
236 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
237 (concat "<ISINDEX "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
238 (if (and prompt
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
239 (not (string= prompt "")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
240 (concat " PROMPT=\"" prompt "\">")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
241 ">"))))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
242
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
243 (defun hm--html-add-base (href)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
244 "Inserts the base tag. HREF is the value of the href attribute."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
245 (interactive (list (hm--html-read-url "URL of this document: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
246 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
247 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
248 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
249 nil)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
250 (save-excursion
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
251 (let ((point (point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
252 (case-fold-search t)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
253 (head-end-point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
254 (goto-char (point-min))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
255 (setq head-end-point (when (re-search-forward
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
256 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
257 (beginning-of-line)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
258 (point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
259 (goto-char (point-min))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
260 (cond ((re-search-forward "<base[^>]*>" head-end-point t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
261 (delete-region (match-beginning 0) (match-end 0)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
262 (t (goto-char point)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
263 (hm--html-search-place-for-element-in-head head-end-point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
264 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
265 (concat "<BASE "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
266 (if (and href
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
267 (not (string= href "")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
268 (concat " HREF=\"" href "\">")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
269 ">"))))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
270
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
271 (defun hm--html-add-meta (name content &optional name-instead-of-http-equiv)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
272 "Inserts the meta tag."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
273 (interactive (list (completing-read "Name: " hm--html-meta-name-alist)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
274 (read-string "Content: ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
275 (save-excursion
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
276 (let ((point (point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
277 (case-fold-search t)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
278 (head-end-point))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
279 (goto-char (point-min))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
280 (setq head-end-point (when (re-search-forward
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
281 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
282 (beginning-of-line)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
283 (point)))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
284 (goto-char point)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
285 (hm--html-search-place-for-element-in-head head-end-point)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
286 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
287 (concat "<META "
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
288 (if name-instead-of-http-equiv
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
289 "NAME=\""
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
290 "HTTP-EQUIV=\"")
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
291 name
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
292 "\" CONTENT=\""
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
293 content
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
294 "\">")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ;;; Functions which include something in HTML- documents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (defvar hm--html-url-history-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 "History list for the function 'hm--html-read-url'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (defun hm--html-read-url-predicate (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 "Predicatefunction for hm--html-read-url."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (hm--html-read-url-predicate-1 (cdr table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (defun hm--html-read-url-predicate-1 (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 "Internal function of hm--html-read-url-predicate."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (cond ((not table-element-list) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 ((eq (car table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 (t (hm--html-read-url-predicate-1 (cdr table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 usagesymbol))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (defun hm--html-read-url (prompt &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 "Function prompts for a URL string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 TABLE is an alist whose elements' cars are URL's.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 PREDICATE limits completion to a subset of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 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
325 the input is (or completes to) an element of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 INITIAL-CONTENTS is a string to insert in the minibuffer before reading.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 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
328 is used instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 (if table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (completing-read prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 hm--html-url-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (read-string prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (if initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (car hm--html-url-history-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 hm--html-url-history-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 (defun hm--html-read-altenate (url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 "Function reads the value for the \"ALT\"- attribute in IMG tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 URL will be used as the default URL for the external viewer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 (let ((alttype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 '(("0") ("1") ("2"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 "2"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (cond ((= alttype 0) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 ((= alttype 1) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 ((= alttype 2) (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 "Text for the ALT attribute: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (substring (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (string-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 "\\."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (file-name-nondirectory url)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
365 (defun hm--html-read-alignment (prompt)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
366 "Read the value for the align attribute."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
367 (upcase (completing-read prompt
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
368 '(("left") ("right") ("top") ("bottom") ("middle"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
369 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
370 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
371 "left")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
372
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
373 (defvar hm--html-shape-history nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
374 "History variable for reading the shape of an image map.")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
375
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
376 (defun hm--html-read-shape ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
377 "Reads the shap for an area element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
378 (upcase(completing-read "The shape of the area: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
379 '(("rect") ("circle") ("poly"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
380 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
381 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
382 (or (car hm--html-shape-history) "rect")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
383 'hm--html-shape-history)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
384
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
385 (defun hm--html-read-rect-coords ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
386 "Reads rectangle coordinates for the area element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
387 (concat (read-string "Left x position of the rectangle: ") ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
388 (read-string "Top y position of the rectangle: ") ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
389 (read-string "Right x position of the rectangle: ") ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
390 (read-string "Bottom y position of the rectangle: ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
391
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
392 (defun hm--html-read-circle-coords ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
393 "Reads circle coordinates for the area element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
394 (concat (read-string "x position of the center of the circle: ") ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
395 (read-string "y position of the center of the circle: ") ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
396 (read-string "Radius: ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
397
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
398 (defun hm--html-read-one-poly-coordinate (&optional empty-string-prompt)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
399 "Reads one poly coordinate pair."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
400 (let* ((x (read-string (concat "x coordinate"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
401 (or empty-string-prompt "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
402 ": ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
403 (y (unless (string= "" x)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
404 (read-string "y coordinate: "))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
405 (if (string= "" x)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
406 ""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
407 (concat x ", " y))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
408
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
409 (defun hm--html-read-more-poly-coordinates ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
410 "Reads poly coordinates until an empty string is given."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
411 (let ((coord (hm--html-read-one-poly-coordinate
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
412 " (Empty string for no further coords!)")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
413 (cond ((string= "" coord) "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
414 (t (concat ", " coord (hm--html-read-more-poly-coordinates))))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
415
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
416 (defun hm--html-read-poly-coords ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
417 "Reads poly coordinates for the area element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
418 (concat (hm--html-read-one-poly-coordinate) ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
419 (hm--html-read-one-poly-coordinate) ", "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
420 (hm--html-read-one-poly-coordinate)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
421 (hm--html-read-more-poly-coordinates)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
422
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
423 (defun hm--html-add-area (href alt shape coords)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
424 "Adds the tags for an area at the current point."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
425 (interactive (let* ((href (hm--html-read-url "Url for the image area: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
426 (alt (hm--html-read-altenate href))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
427 (shape (hm--html-read-shape))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
428 (coords (cond ((string= shape "RECT")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
429 (hm--html-read-rect-coords))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
430 ((string= shape "CIRCLE")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
431 (hm--html-read-circle-coords))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
432 ((string= shape "POLY")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
433 (hm--html-read-poly-coords))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
434 (t (error "No function to read \""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
435 shape
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
436 "\" coordinates!")))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
437 (list href alt shape coords)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
438 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
439 (concat "<AREA"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
440 " HREF=\"" href "\""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
441 (if alt
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
442 (concat "\nALT=\"" alt "\"")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
443 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
444 "\nSHAPE=" shape
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
445 "\nCOORDS=\"" coords "\""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
446 ">")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
447
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
448
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
449 (when (adapt-emacs19p)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
450 (defvar :ask ':ask))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
451
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
452 (defvar hm--html-use-image-as-map ':ask
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
453 "Internal variable of `hm--html-add-image'.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
454 nil => insert the image element without an usemap attribute.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
455 t => insert the image element with an usemap attribute.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
456 :ask => ask, if the image element should have an usemap attribute.")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
457
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
458 (defun hm--html-add-image (href alt alignment mapname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
459 "Add an image."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
460 (interactive (let* ((href (hm--html-read-url "Image URL: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
461 (alt (hm--html-read-altenate href))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
462 (alignment (hm--html-read-alignment
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
463 "Alignment of the image: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
464 (use-as-map (if (eq hm--html-use-image-as-map ':ask)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
465 (y-or-n-p
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
466 "Use the image as a map with links? ")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
467 hm--html-use-image-as-map))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
468 (mapname (and use-as-map (hm--html-read-mapname))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
469 (list href alt alignment mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
470 (hm--html-add-tags
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
471 'hm--html-insert-start-tag
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
472 (concat "<IMG ALIGN=" alignment
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
473 "\nHREF=\"" href "\""
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
474 (if alt
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
475 (concat "\nALT=\"" alt "\"")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
476 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
477 (if mapname
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
478 (concat "\nUSEMAP=\"#" mapname "\"")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
479 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
480 ">")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
481
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (defun hm--html-add-image-bottom (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 "Add an image, bottom aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
487 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
488 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
489 (concat "<IMG ALIGN=BOTTOM SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
490 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
491 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
492 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
493 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (defun hm--html-add-image-middle (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 "Add an image, middle aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
500 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
501 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
502 (concat "<IMG ALIGN=MIDDLE SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
503 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
504 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
505 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
506 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (defun hm--html-add-image-top (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 "Add an image, top aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
513 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
514 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
515 (concat "<IMG ALIGN=TOP SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
516 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
517 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
518 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
519 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
520
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
521
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
522 (defun hm--html-add-applet (name code width height)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
523 "Add an applet."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
524 (interactive (let ((name (read-string "Applet Name: " "applet"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
525 (code (read-file-name "Applet Class File: "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
526 (width (read-number "Width (i.e.: 100): " t))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
527 (height (read-number "Height (i.e.: 100): " t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
528 (list name code width height)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
529 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
530 (concat "<APPLET "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
531 (if (string= name "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
532 ""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
533 (concat "NAME=\"" name "\"\n"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
534 "CODE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
535 code
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
536 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
537 "WIDTH=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
538 width
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
539 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
540 "HEIGHT=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
541 height
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
542 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
543 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
544 "</APPLET>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
545
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
546 (defun hm--html-add-applet-parameter (name value)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
547 "Adds the tag for an applet parameter at the current point.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
548 This tag must be added between <APPLET> and </APPLET>."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
549 (interactive "sParameter Name: \nsParameter Value: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
550 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
551 (concat "<PARAM "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
552 "NAME=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
553 name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
554 "\" VALUE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
555 value
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
556 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
557
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 ;;; Functions, which adds tags of the form <starttag> ... </endtag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
562 (defun hm--html-add-big ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
563 "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
564 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
565 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
566 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
567 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
568 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
569
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
570
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
571 (defun hm--html-add-big-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
572 "Adds the HTML tags for Big to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
573 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
574 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
575 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
576 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
577 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
578
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
579
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
580 (defun hm--html-add-small ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
581 "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
582 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
583 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
584 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
585 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
586 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
587
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
588
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
589 (defun hm--html-add-small-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
590 "Adds the HTML tags for Small to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
591 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
592 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
593 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
594 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
595 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
596
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
597
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (defun hm--html-add-bold ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 "Adds the HTML tags for Bold at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (defun hm--html-add-bold-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 "Adds the HTML tags for Bold to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (defun hm--html-add-italic ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 "Adds the HTML tags for Italic at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (defun hm--html-add-italic-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 "Adds the HTML tags for Italic to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (defun hm--html-add-underline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 "Adds the HTML tags for Underline at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (defun hm--html-add-underline-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 "Adds the HTML tags for Underline to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (defun hm--html-add-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 "Adds the HTML tags for Definition at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (defun hm--html-add-definition-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 "Adds the HTML tags for Definition to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (defun hm--html-add-code ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 "Adds the HTML tags for Code at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (defun hm--html-add-code-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 "Adds the HTML tags for Code to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
688 (defun hm--html-add-citation ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
689 "Adds the HTML tags for Citation."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
690 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
691 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
692 "<CITE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
693 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
694 "</CITE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
695
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (defun hm--html-add-citation-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 "Adds the HTML tags for Citation to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 "<CITE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 "</CITE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
705 (defun hm--html-add-emphasized ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
706 "Adds the HTML tags for Emphasized."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
707 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
708 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
709 "<EM>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
710 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
711 "</EM>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
712
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
713
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (defun hm--html-add-emphasized-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 "Adds the HTML tags for Emphasized to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 "<EM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 "</EM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
723 (defun hm--html-add-fixed ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
724 "Adds the HTML tags for Fixed."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
725 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
726 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
727 "<TT>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
728 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
729 "</TT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
730
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
731
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (defun hm--html-add-fixed-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 "Adds the HTML tags for Fixed to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 "<TT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 "</TT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
741 (defun hm--html-add-keyboard ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
742 "Adds the HTML tags for Keyboard."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
743 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
744 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
745 "<KBD>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
746 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
747 "</KBD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
748
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
749
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 (defun hm--html-add-keyboard-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 "Adds the HTML tags for Keyboard to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 "<KBD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 "</KBD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
759 (defun hm--html-add-sample ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
760 "Adds the HTML tags for Sample."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
761 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
762 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
763 "<SAMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
764 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
765 "</SAMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
766
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 (defun hm--html-add-sample-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 "Adds the HTML tags for Sample to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 "<SAMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 "</SAMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
776 (defun hm--html-add-strong ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
777 "Adds the HTML tags for Strong."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
778 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
779 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
780 "<STRONG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
781 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
782 "</STRONG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
783
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
784
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (defun hm--html-add-strong-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 "Adds the HTML tags for Strong to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 "<STRONG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 "</STRONG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
794 (defun hm--html-add-variable ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
795 "Adds the HTML tags for Variable."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
796 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
797 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
798 "<VAR>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
799 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
800 "</VAR>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
801
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (defun hm--html-add-variable-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 "Adds the HTML tags for Variable to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 "<VAR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 "</VAR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (defun hm--html-add-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 "Adds the HTML tags for Comment at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (defun hm--html-add-comment-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 "Adds the HTML tags for Comment to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
829 (defun hm--html-add-document-division (alignment)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
830 "Adds the HTML tags for document division at the current point."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
831 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
832 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
833 (concat "<DIV ALIGN=\"" alignment "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
834 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
835 "</DIV>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
836
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
837
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
838 (defun hm--html-add-document-division-to-region (alignment)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
839 "Adds the HTML tags for document division to the region."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
840 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
841 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
842 (concat "<DIV ALIGN=\"" alignment "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
843 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
844 "</DIV>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
845
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (defun hm--html-add-preformated ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 "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
849 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (defun hm--html-add-preformated-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 "Adds the HTML tags for preformated text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
865 (defun hm--html-add-blockquote ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
866 "Adds the HTML tags for blockquote."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
867 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
868 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
869 "<BLOCKQUOTE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
870 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
871 "</BLOCKQUOTE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
872
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
873
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
882 (defun hm--html-add-script ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
883 "Adds the HTML tags for script."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
886 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 'hm--html-insert-end-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
888 "</SCRIPT>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
889
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
890
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
891 (defun hm--html-add-script-to-region ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
892 "Adds the HTML tags for script to the region."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
895 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 'hm--html-insert-end-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
897 "</SCRIPT>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
898
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
899 (defun hm--html-add-style ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
900 "Adds the HTML tags for style."
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
901 (interactive)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
902 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
903 "<STYLE>"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
904 'hm--html-insert-end-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
905 "</STYLE>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
906
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
907
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
908 (defun hm--html-add-style-to-region ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
909 "Adds the HTML tags for style to the region."
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
910 (interactive)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
911 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
912 "<STYLE>"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
913 'hm--html-insert-end-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
914 "</STYLE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (hm--html-add-tags 'hm--html-insert-start-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
920 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 'hm--html-insert-end-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
922 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
929 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 'hm--html-insert-end-tag
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
931 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
988 (defun hm--html-read-font-size (&optional only-absolute-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
989 "Reads the size for the FONT element.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
990 It returns nil, if the size should not be changed."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
991 (let ((size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
992 (if only-absolute-size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
993 (completing-read "The absolute font size (1 .. 7): "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
994 '(("7") ("6") ("5") ("4") ("3") ("2") ("1"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
995 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
996 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
997 "4")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
998 (completing-read "The relative (+/-) or absolute font size: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
999 '(("-7") ("-6") ("-5") ("-4") ("-3") ("-2") ("-1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1000 ("+7") ("+6") ("+5") ("+4") ("+3") ("+2") ("+1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1001 ("7") ("6") ("5") ("4") ("3") ("2") ("1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1002 ("use-basefont"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1003 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1004 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1005 "use-basefont-size"))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1006 (if (string= size "use-basefont-size")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1007 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1008 size)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1009
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1010 (defun hm--html-read-font-color ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1011 "Reads the size for the FONT element.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1012 It returns nil, if the color should not be changed."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1013 (let ((color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1014 (completing-read "The font color: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1015 '(("Black") ("Silver") ("Gray") ("White") ("Maroon")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1016 ("Green") ("Lime") ("Olive") ("Yellow") ("Navy")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1017 ("Red") ("Purple") ("Fuchsia") ("Blue") ("Teal")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1018 ("Aqua") ("dont-set-color"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1019 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1020 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1021 "dont-set-color")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1022 (if (string= color "dont-set-color")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1023 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1024 color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1025
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1026
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1027 (defun hm--html-add-font (size color)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1028 "Adds the HTML tags for Font at the point in the current buffer."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1029 (interactive (list (hm--html-read-font-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1030 (hm--html-read-font-color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1031 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1032 (concat "<FONT"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1033 (if size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1034 (concat " SIZE=" size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1035 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1036 (if color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1037 (concat " COLOR=" color)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1038 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1039 ">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1040 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1041 "</FONT>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1042
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1043
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1044 (defun hm--html-add-font-to-region (size color)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1045 "Adds the HTML tags for Font to the region."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1046 (interactive (list (hm--html-read-font-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1047 (hm--html-read-font-color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1048 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1049 (concat "<FONT"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1050 (if size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1051 (concat " SIZE=" size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1052 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1053 (if color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1054 (concat " COLOR=" color)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1055 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1056 ">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1057 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1058 "</FONT>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1064 (defun hm--html-add-center ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1065 "Adds the HTML tags for center at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1066 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1067 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1068 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1069 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1070 "</CENTER>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1071
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1072 (defun hm--html-add-center-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1073 "Adds the HTML tags for center to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1074 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1075 (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
1076 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1077 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1078 "</CENTER>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1080
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1081 (defvar hm--html-mapname-history nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1082 "The history variable for the function `hm--html-read-mapname'.")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1083
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1084 (defun hm--html-read-mapname ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1085 "Reads the name of an image map."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1086 (let ((name (read-string "The name of the image map: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1087 (or (car hm--html-mapname-history)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1088 "map")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1089 'hm--html-mapname-history)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1090 name))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1091
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1092 (defun hm--html-add-image-map ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1093 "Adds an image and a map element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1094 (interactive)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1095 (let* ((href (hm--html-read-url "Image URL: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1096 (alt (hm--html-read-altenate href))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1097 (alignment (hm--html-read-alignment
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1098 "Alignment of the image: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1099 (mapname (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1100 (hm--html-add-image href alt alignment mapname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1101 (newline)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1102 (hm--html-add-map mapname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1103 (call-interactively 'hm--html-add-area)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1104
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1105 (defun hm--html-add-map (name)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1106 "Adds the HTML tags for map at the current point."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1107 (interactive (list (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1108 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1109 (concat "<MAP NAME=\"" name "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1110 'hm--html-insert-end-tag
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1111 "</MAP>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1112 (end-of-line 0))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1113
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1114 (defun hm--html-add-map-to-region (name)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1115 "Adds the HTML tags for map to the region."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1116 (interactive (list (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1117 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1118 (concat "<MAP NAME=\"" name "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1119 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1120 "</MAP>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1121
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1122
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 "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
1125 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1131 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1132 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1133 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1141 "</OL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 "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
1146 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1152 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1153 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1154 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1162 "</DIR>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1165 (defun hm--html-add-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1166 "Adds the HTML tags for a (unnumbered) list to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1167 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1168 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1169 "<UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1170 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1171 "</UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1172 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1173 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1174 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1175 " </LI>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1176
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1177
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (defun hm--html-add-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 "Adds the HTML tags for a (unnumbered) list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1184 "</UL>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1185
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1186
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1187 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1188 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1189 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1190 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1191 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1192 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1193 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1194 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1195 "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1196 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1197 " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1198
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1199
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1206 "</MENU>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1207
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1208
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1209 (defun hm--html-add-description-title-and-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1210 "Adds a definition title and entry.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1211 Assumes we're at the end of a previous entry."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1212 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1213 (hm--html-add-description-title)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1214 (let ((position (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1215 (case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1216 (search-forward "</dt>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1217 (hm--html-add-description-entry)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1218 (goto-char position)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1219
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1220
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1221 (defun hm--html-add-description-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1222 "Adds the HTML tags for a description list.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1223 It also inserts a tag for the description title."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1224 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1225 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1226 "<DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1227 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1228 "</DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1229 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1230 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1231 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1232 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1233
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1242 "</DL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 (defun hm--html-add-description-title ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1246 "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
1247 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1248 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1249 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1250 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1251 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1252
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1253
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1254 (defun hm--html-add-description-title-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1255 "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
1256 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1257 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1258 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1259 'hm--html-insert-end-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
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1262
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1263 (defun hm--html-add-description-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1264 "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
1265 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1267 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1268 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1269 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1270
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1271
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1272 (defun hm--html-add-description-entry-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1273 "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
1274 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1275 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1276 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1277 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1278 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1279
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1280
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1281 (defun hm--html-add-address ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1282 "Adds the HTML tags for an address."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1283 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1284 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1285 "<ADDRESS>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1286 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1287 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1293 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 'hm--html-insert-end-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1295 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 "The signature reference name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 (defun hm--html-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (concat
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1305 "<A NAME=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 hm--html-signature-reference-name
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1307 "\"\nHREF=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 "\">"))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1310
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1316 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1317 (if (re-search-forward (concat "<address>[ \t\n]*"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1318 "<a[ \t\n]+name=[ \t\n]*\"?"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1319 hm--html-signature-reference-name
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1320 "\"?[ \t\n]+href=[ \t\n]*\"")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1321 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1322 t)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1323 (let ((signature-start (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1324 (signature-end (progn
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1325 (re-search-forward "</address>[ \t]*[\n]?"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1326 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1327 t)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1328 (point))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1329 (when (yes-or-no-p "Delete the old signature (yes or no) ?")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1330 (delete-region signature-start signature-end)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1331 (hm--html-indent-line)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 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
1337 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (goto-char (point-max))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1340 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1341 (cond ((search-backward "</body>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1342 (end-of-line 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1343 (if (> (current-column) 0)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1344 (newline 1)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1345 ((search-backward "</html>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1346 (end-of-line 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1347 (if (> (current-column) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1348 (newline 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1349 ((> (current-column) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1350 (newline 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1351 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 (defun hm--html-add-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 "Adds the owner's signature at the end of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (hm--html-set-point-for-signature)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1364 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1365 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 'hm--html-insert-end-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1367 "</A>\n</ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (error "ERROR: Define your hm--html-signature-file first !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 "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
1378 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 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
1405 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 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
1407 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
1408 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1410 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1411 (cond ((search-forward-regexp "<isindex[^>]*>" nil t) (newline))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1412 ((search-forward-regexp "<head[^>]*>" nil t) (newline))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1413 ((search-forward-regexp "<html[^>]*>" nil t) (newline))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1414 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1422 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1423 (if (search-forward "<title>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1424 (let ((point-after-start-tag (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1425 (if (not (search-forward "</title>" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1426 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1427 (goto-char (- (point) 8))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1428 (delete-backward-char (- (point) point-after-start-tag))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1429 (let ((start (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1430 (insert title " (" (hm--date) ")")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1431 (goto-char start))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1432 ;; Noch kein <TITLE> im Buffer vorhanden
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1433 (hm--html-set-point-for-title)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1434 (hm--html-add-tags 'hm--html-insert-start-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1435 "<TITLE>"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1436 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1437 "</TITLE>"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1438 'insert
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1439 (concat title " (" (hm--date) ")"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1440 (forward-char 8)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1441 (newline 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1442 ))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1448 (let ((title (buffer-substring (region-beginning) (region-end)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1449 (case-fold-search t))
0
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))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (insert title " (" (hm--date) ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 "Adds the HTML tags <HTML> and </HTML> in the buffer.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1474 The tag <HTML> will be inserted at the beginning (after the
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1475 <!DOCTYPE ...>, if it is already there.) and </HTML> at the
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1478 (let ((new-cursor-position nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
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 "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 (error "There is an old tag <HTML> in the current buffer !")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1484 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1499 The tags will be inserted after <HTML> or at the beginning
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1500 of the file after <DOCTYPE...> (if it is already there).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1503 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 (goto-char (point-min))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1505 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1538 "</HEAD>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 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
1553 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1554 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (forward-char -1)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1563 (let ((end-tag-position (set-marker (make-marker) (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (let ((cursor-position (point)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1571 (goto-char end-tag-position)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<BODY>"
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1579 'hm--html-insert-end-tag-with-newline "</BODY>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 "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
1593 (interactive "sTitle and Header String: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1594 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1595 (hm--html-add-title title)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1596 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1597 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1598 (search-forward "</title>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1599 (if (search-forward "</head>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1600 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1601 (search-forward "<body>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1602 (newline 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1603 (if (search-forward "<body>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1604 (newline 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1605 (if (string= (what-line) "Line 1")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1606 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1607 (end-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1608 (newline 1)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1609 (hm--html-add-header 1 title))))
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-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 "Adds the HTML tags for a title and a header 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 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 (interactive "sTitle and Header String: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1626 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1627 (hm--html-add-doctype)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1628 (hm--html-add-html)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1629 (hm--html-add-head)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1630 (hm--html-add-body)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1631 (hm--html-add-title-and-header title)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1632 (if hm--html-signature-file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1633 (hm--html-add-signature))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1634 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1635 (search-forward "</h1>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1636 (forward-line 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1637 (if hm--html-automatic-created-comment
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1638 (hm--html-insert-created-comment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 "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
1643 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (hm--html-add-title-and-header-to-region)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1648 (hm--html-add-doctype)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 (hm--html-add-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1657 (defun hm--html-add-link-target-to-region (name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1658 "Adds the HTML tags for a link target to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1659 (interactive "sName: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1660 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1661 (concat "<A NAME=\"" name "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1662 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1663 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1664
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 "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
1667 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 It returns the example extent."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1679 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1680 (if (hm--html-get-example-from-parameter-list parameter-list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1681 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1682 (search-forward (hm--html-get-example-from-parameter-list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1683 parameter-list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1684 (let ((extent (make-extent (match-beginning 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1685 (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1686 (set-extent-face extent 'hm--html-help-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1687 extent)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 (hm--html-write-alist-in-buffer (cdr alist)))))
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 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (cdr prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (t filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 hm--html-delete-wrong-path-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 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
1760 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 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
1764 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 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
1766 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 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
1771 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 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
1777 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 also nil it returns an empty string."
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 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 (make-face 'hm--html-help-face)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1835 (if hm--html-help-foreground
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1836 (set-face-foreground 'hm--html-help-face hm--html-help-foreground))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1837 (if hm--html-help-background
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1838 (set-face-background 'hm--html-help-face hm--html-help-background))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1839 (set-face-font 'hm--html-help-face hm--html-help-font)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (car parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (defun hm--html-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 (car (cdr 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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
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-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 (hm--html-get-example-from-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 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 path+file-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 host-name:port-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 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 construct the link."
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1948 ; (let ((point nil))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1949 (save-window-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1950 (let ((html-buffer (current-buffer))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1951 (html-help-buffer (hm--html-generate-add-link-help-buffer
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1952 scheme-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1953 host-name:port-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1954 servername:port-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1955 path+file-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1956 anchor-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1957 (scheme (hm--html-completing-read scheme-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1958 (hostname:port (hm--html-completing-read
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1959 host-name:port-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1960 (servername:port (hm--html-completing-read
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1961 servername:port-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1962 (path+file (hm--html-read-filename path+file-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1963 (anchor (hm--html-completing-read anchor-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1964 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1965 (anchor-seperator
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1966 (hm--html-get-anchor-seperator-from-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1967 anchor-parameter-list)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1968 (if (not (string= scheme ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1969 (if (string= hostname:port "")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1970 (setq scheme (concat scheme ":"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1971 (setq scheme (concat scheme "://"))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1972 (if (and (not (string= hostname:port ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1973 (not (string= servername:port ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1974 (not (string= (substring servername:port 0 1) "/")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1975 (setq servername:port (concat "/" servername:port)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1976 (if (and (not (string= path+file ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1977 (not (string= "/" (substring path+file 0 1))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1978 (setq path+file (concat "/" path+file)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1979 (if (not (string= anchor ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1980 (setq anchor (concat anchor-seperator anchor)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1981 (kill-buffer html-help-buffer)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1982 (pop-to-buffer html-buffer)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1983 (eval (list function-add-tags
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1984 ''hm--html-insert-start-tag
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1985 (concat "<A"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 ; hrefname
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1988 " HREF=\""
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1989 scheme
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1990 hostname:port
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1991 servername:port
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1992 path+file
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1993 anchor
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1994 "\">")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1995 ''hm--html-insert-end-tag
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1996 "</A>")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1997 ; (setq point (point))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1998 ; (goto-char (point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1999 ))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 "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
2003 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 "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
2045 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 hm--html-wais-hostname:port-default
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 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 "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
2093 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 "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
2099 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 ""
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 "wais"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 "wais")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 "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
2143 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 ""
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 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 (defun hm--html-add-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 "Adds the HTML tags for a link to an HTML file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 (hm--html-add-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 "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
2192 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 hm--html-ftp-hostname:port-default
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 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 "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
2288 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 "Subject%20Tree"
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 "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
2331 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 (defun hm--html-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 (let ((alist nil)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2341 (buffername (find-file-noselect proggate-allowed-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2342 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 (defun hm--html-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 The function looks at the environment variable NNTPSERVER.
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2476 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
2477 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (if (file-exists-p (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (let ((alist nil)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2497 (buffername (find-file-noselect newsrc-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2498 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 "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
2553 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 (defun hm--html-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 ""
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 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (defun hm--html-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 (interactive)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2596 (hm--html-add-mail-box-link-1 'hm--html-add-tags))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 "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
2601 (interactive)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2602 (hm--html-add-mail-box-link-1 'hm--html-add-tags-to-region))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (list ; servername:port
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2626 "Mailaddress: "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2651 (defun hm--html-add-relative-link (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2652 "Adds the HTML tags for a relative link at the current point."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2653 (interactive (list (file-relative-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2654 (read-file-name "Relative Filename: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2655 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2656 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2657 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2658 "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2659 default-directory)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2660 ))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2661 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2662 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2663 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2664 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2665 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2666 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2667
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2668 (defun hm--html-add-relative-link-to-region (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2669 "Adds the HTML tags for a relative link to the region."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2670 (interactive (list (file-relative-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2671 (read-file-name "Relative Filename: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2672 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2673 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2674 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2675 ""))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 (concat "<A HREF=\""
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2678 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2679 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2680 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2681 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2682
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2683 (defun hm--html-add-normal-link (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2684 "Adds the HTML tags for a normal general link.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2685 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2686 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2687 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2688 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2689 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2690 link-object
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2691 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2692 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2693 "</A>"))
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 (defun hm--html-add-normal-link-to-region (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2696 "Adds the HTML tags for a normal general link to region.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2697 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2698 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2699 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2700 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2701 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2702 link-object
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (read-string "Node Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 "Hook function which updates the date in the title line, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 'hm--html-automatic-new-date' is t and which inserts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 (if hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 (hm--html-new-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 (if hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 (hm--html-insert-changed-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 "\\((\\)"
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
2744 "\\([ \t]*[0-3]?[0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9][0-9]"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
2745 "[ \t]*\\)"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 noerror is nil."
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 (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 (error "ERROR: Please insert a title in the document !"))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2774 ; (let ((end-of-title-position (point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2775 (if (search-forward "<!-- Created by: " end-of-head t)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2776 (if (yes-or-no-p
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2777 "Replace the old comment \"<!-- Created by: \" ")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2778 (progn
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2779 (goto-char (match-beginning 0))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2780 (kill-line)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2781 (hm--html-add-comment)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2782 (insert "Created by: "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2783 (or hm--html-username (user-full-name))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2784 ", "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2785 (hm--date))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2786 (newline)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2787 (hm--html-add-comment)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2788 (insert "Created by: "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2789 (or hm--html-username (user-full-name))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2790 ", "
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2791 (hm--date)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2792 ))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 (defun hm--html-insert-changed-comment-1 (newline username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 "Internal function of 'hm--html-insert-changed-comment'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 Inserts a newline if NEWLINE is t, before the comment is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 USERNAME is the name to be inserted in the comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (insert "Changed by: " username ", " (hm--date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 "The function inserts a \"changed comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 The comment looks like <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 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
2811 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
2812 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 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
2814 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 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
2817 else in such a line !"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 (username (or hm--html-username (user-full-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 (goto-char end-of-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (if (search-backward "<!-- Changed by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 (if (string-match username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 (hm--html-insert-changed-comment-1 nil username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 (if (search-backward "<!-- Created by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 "ERROR: Insert at first a title in the document !"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (defvar hm--html-template-file-history nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2866 "Historyvariable for the template files in the `hm--html-mode'.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 (defun hm--html-insert-template (filename)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2869 "Inserts a templatefile.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2870 It uses `tmpl-insert-template-file' to insert
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2871 the templates. The variables `tmpl-template-dir-list',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2872 `tmpl-automatic-expand' and `tmpl-history-variable-name' are
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2873 overwritten by `hm--html-template-dir',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2874 `hm--html-automatic-expand-templates' and `hm--html-template-file-history'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2875 (interactive (list nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2876 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2877 hm--html-template-dir
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2878 (list hm--html-template-dir)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2879 (tmpl-automatic-expand hm--html-automatic-expand-templates)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2880 (tmpl-history-variable-name 'hm--html-template-file-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2881 (if filename
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2882 (tmpl-insert-template-file filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2883 (call-interactively 'tmpl-insert-template-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2884 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2885
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2886 (defun hm--html-insert-template-from-fixed-dirs (filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2887 "Inserts a templatefile.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2888 It uses `tmpl-insert-template-file-from-fixed-dirs' to insert
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2889 the templates. The variables `tmpl-template-dir-list',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2890 `tmpl-automatic-expand', `tmpl-filter-regexp' and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2891 `tmpl-history-variable-name' are overwritten by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2892 `hm--html-template-dir', `hm--html-automatic-expand-templates',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2893 `hm--html-template-filter-regexp' and `hm--html-template-file-history'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2894 (interactive (list nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2895 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2896 hm--html-template-dir
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2897 (list hm--html-template-dir)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2898 (tmpl-automatic-expand hm--html-automatic-expand-templates)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2899 (tmpl-filter-regexp hm--html-template-filter-regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2900 (tmpl-history-variable-name 'hm--html-template-file-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2901 (if filename
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2902 (tmpl-insert-template-file-from-fixed-dirs filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2903 (call-interactively 'tmpl-insert-template-file-from-fixed-dirs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2904 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2905
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2909 (if (adapt-emacs19p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 '(("POST") ("GET"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 (read-string "Symbolic name: " last-name))
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 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 (defun hm--html-form-add-input (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 "\""))
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 (hm--html-form-add-input "checkbox" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 "Name of the last radio button.")
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-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (hm--html-form-add-input "radio" name value checked nil nil))
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-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 (hm--html-form-add-input "submit" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 (defun hm--html-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (defun hm--html-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 (defun hm--html-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 "<OPTION> "))
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 (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 "</TEXTAREA>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 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
3282 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 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
3298 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 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
3312 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 (defun hm--html-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 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
3325 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370 (defun hm--html-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3379 (concat "<TR>"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3380 (mapconcat '(lambda (entry)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3381 (concat "<TH" entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3382 (hm--html-table-read-cell-entries-and-alignments
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3383 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3384 no-of-cells)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3385 " </TH>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3386 " </TH></TR>")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3398 (concat "<TR><TD"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3399 (car (hm--html-table-read-cell-entries-and-alignments 1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3400 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 (if (<= no-of-cells 1)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3402 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 2 no-of-cells)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3408 " </TD>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3409 " </TD></TR>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 (defun hm--html-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 (let* ((point-of-view (point))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3418 (case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3419 (end-of-last-row (search-backward "</tr>" (point-min) t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3420 (begin-of-last-row (progn (search-backward "<tr" (point-min) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3421 (re-search-forward "<t[dh]"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3422 point-of-view t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 (alignment-list nil))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3425 (goto-char begin-of-last-row)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3426 (if (not (re-search-forward "<t[dh]" end-of-last-row t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 from existing rows of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3458 (concat "<TR><TD" (car (hm--html-table-read-cell-entries-and-alignments
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3459 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3460 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3461 old-alignment-list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3462 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463 (if (<= no-of-cells 1)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3464 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 (cdr old-alignment-list))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3472 " </TD>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3473 " </TD></TR>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 (defun hm--html-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3492 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3494 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505 "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
3506 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 "<TR>"))
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-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 "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
3522 (interactive (list (completing-read "Alignment of the start 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-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 (concat "<TD"
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 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 (interactive "NNo of columns, spaned by this cell: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3540 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3541 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3542 (if (and (search-backward "<" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3543 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3544 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3545 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3546 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3547 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3548 (delete-region (match-beginning 2) (match-end 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3549 (insert (format "\"%d\"" columns)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3550 (insert (format " colspan=\"%d\"" columns)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3551 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3555 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3556 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 (interactive "NNo of rows, spaned by this cell: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3558 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3559 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3560 (if (and (search-backward "<" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3561 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3562 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3563 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3564 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3565 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3566 (delete-region (match-beginning 2) (match-end 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3567 (insert (format "\"%d\"" rows)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3568 (insert (format " rowspan=\"%d\"" rows)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3569 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3573 ;(setq buffer-invisibility-spec '(hm--html-iso-entity-invisible-flag))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3574
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3575 ;(defvar hm--html-iso-entity-invisible-flag t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3576 ; "Controls the visibility of the iso entities.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3577
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3578 ;(defvar hm--html-iso-glyph-invisible-flag nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3579 ; "Controls the visibility of the iso character glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3580
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3581 ;(defvar hm--html-glyph-cache nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3582 ; "Internal variable. An assoc list with the already created glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3583
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3584 ;(defun hm--html-create-glyph (string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3585 ; "Creates a glyph from the string or returns an existing one.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3586 ;The glyph is stored in `hm--html-glyph-cache'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3587 ; (if nil ;(assoc string hm--html-glyph-cache)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3588 ; (cdr (assoc string hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3589 ; (let ((glyph (make-glyph string)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3590 ; (setq hm--html-glyph-cache (cons (cons string glyph)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3591 ; hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3592 ; glyph)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3593
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3594 ;(defun hm--html-attach-glyph-to-region (start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3595 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3596 ; string
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3597 ; region-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3598 ; glyph-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3599 ; "Make the region invisible and attach a glyph STRING.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3600 ;The invisible flags could be used, to toggle the visibility."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3601 ; (mapcar 'delete-annotation (annotations-at end)) ; delete old anotations
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3602 ; ;; delete old extents
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3603 ; (let ((extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3604 ; (annotation nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3605 ; (set-extent-property extent 'invisible region-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3606 ; (set-extent-property extent 'end-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3607 ; (set-extent-property extent 'start-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3608 ; (set-extent-property extent 'intangible t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3609 ; (setq annotation (make-annotation "Hallo Du da" ;(hm--html-create-glyph string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3610 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3611 ; 'text))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3612 ; (goto-char end)))
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
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3615 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3616 ; "Inserts an iso char as html ENTITY and displays a glyph.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3617 ;The glyph is created from the string CHAR."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3618 ; (let ((start (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3619 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3620 ; (hm--html-attach-glyph-to-region start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3621 ; (point)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3622 ; char
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3623 ; 'hm--html-iso-entity-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3624 ; 'hm--html-iso-glyph-invisible-flag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3625
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3626 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3627 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3628 ; (hm--html-insert-iso-char-as-entity-and-glyph "ü" "&uuml;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3629
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3630
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3631 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3632 ; (let ((start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3633 ; (end nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3634 ; (extent nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3635 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3636 ; (setq end (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3637 ; (setq extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3638 ; (set-extent-begin-glyph extent char)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3639 ; (set-extent-property extent 'invisible t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3640
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3641 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3642 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3643 ; (hm--html-insert-iso-char-as-entity-and-glyph ?ü "&uuml;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3645 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3652 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3653 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3655 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3656 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3657 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3658 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3660 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3661 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3662 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3663 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3665 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3666 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3667 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3668 (insert "&Uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3670 (defun hm--html_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3671 "Insert the character 'Oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3672 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3673 (insert "&Ouml;"))
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_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3676 "Insert the character 'Ae'."
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 "&Auml;"))
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_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3681 "Insert the character 'Aa'."
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 "&Aring;"))
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_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3686 "Insert the character 'sz'."
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 "&szlig;"))
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_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3691 "Insert the character 'aacute'."
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 "&aacute;"))
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_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3696 "Insert the character 'eacute'."
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 "&eacute;"))
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_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3701 "Insert the character 'iacute'."
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 "&iacute;"))
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_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3706 "Insert the character 'oacute'."
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 "&oacute;"))
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_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3711 "Insert the character 'uacute'."
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 "&uacute;"))
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_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3716 "Insert the character 'Aacute'."
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 "&aacute;"))
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_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3721 "Insert the character 'Eacute'."
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 "&eacute;"))
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_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3726 "Insert the character 'Iacute'."
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 "&iacute;"))
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_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3731 "Insert the character 'Oacute'."
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 "&oacute;"))
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_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3736 "Insert the character 'Uacute'."
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 "&uacute;"))
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_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 "Insert the character 'agrave'."
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 "&agrave;"))
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_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 "Insert the character 'egrave'."
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 "&egrave;"))
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_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 "Insert the character 'igrave'."
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 "&igrave;"))
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_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 "Insert the character 'ograve'."
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 "&ograve;"))
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_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 "Insert the character 'ugrave'."
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 "&ugrave;"))
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_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 "Insert the character 'Agrave'."
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 "&Agrave;"))
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_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 "Insert the character 'Egrave'."
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 "&Egrave;"))
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_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776 "Insert the character 'Igrave'."
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 "&Igrave;"))
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_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 "Insert the character 'Ograve'."
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 "&Ograve;"))
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_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 "Insert the character 'Ugrave'."
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 "&Ugrave;"))
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_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 "Insert the character 'ccedilla'."
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 "&ccedilla;"))
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_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 "Insert the character 'Ccedilla'."
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 "&Ccedilla;"))
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_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 "Insert the character 'atilde'."
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 "&atilde;"))
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_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 "Insert the character 'otilde'."
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 "&otilde;"))
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_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 "Insert the character 'ntilde'."
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 "&ntilde;"))
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_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 "Insert the character 'Atilde'."
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 "&Atilde;"))
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_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 "Insert the character 'Otilde'."
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 "&Otilde;"))
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_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 "Insert the character 'Ntilde'."
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 "&Ntilde;"))
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_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 "Insert the character 'acircumflex'."
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 "&acircumflex;"))
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_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 "Insert the character 'ecircumflex'."
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 "&ecircumflex;"))
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_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 "Insert the character 'icircumflex'."
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 "&icircumflex;"))
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_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 "Insert the character 'ocircumflex'."
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 "&ocircumflex;"))
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_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 "Insert the character 'ucircumflex'."
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 "&ucircumflex;"))
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_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856 "Insert the character 'Acircumflex'."
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 "&Acircumflex;"))
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_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 "Insert the character 'Ecircumflex'."
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 "&Ecircumflex;"))
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_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 "Insert the character 'Icircumflex'."
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 "&Icircumflex;"))
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_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 "Insert the character 'Ocircumflex'."
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 "&Ocircumflex;"))
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_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876 "Insert the character 'Ucircumflex'."
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 "&Ucircumflex;"))
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_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 "Insert the character 'ediaeresis'."
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 "&euml;"))
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_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 "Insert the character 'idiaeresis'."
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 "&iuml;"))
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_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3891 "Insert the character 'Ediaeresis'."
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 "&Euml;"))
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_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 "Insert the character 'Idiaeresis'."
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 "&Iuml;"))
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_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901 "Insert the character 'thorn'."
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 "&thorn;"))
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_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 "Insert the character 'Thorn'."
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 "&THORN;"))
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_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 "Insert the character 'eth'."
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 "&eth;"))
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_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 "Insert the character 'Eth'."
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 "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3927
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3928 (defun hm--html-less-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3929 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3930 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3931 (insert "&lt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3932
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3933 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3934 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3936 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3937 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3940 (hm--html-less-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3942 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3945 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3947
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3948 (defun hm--html-greater-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3949 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3950 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3951 (insert "&gt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3952
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3957 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3958 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3959 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3960 (hm--html-greater-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3961 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3962 (insert ?>)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963 (setq hm--just-insert-greater-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3966 (defvar hm--just-insert-ampersand nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3967 "Internal variable.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3968
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3969 (defun hm--html-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3970 "Inserts the entity '&amp;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3971 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3972 (insert "&amp;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3973
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3974 (defun hm--html-smart-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3975 "Insert a '&' or the entity '&amp;' if you execute this command twice."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3976 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3977 (if (and (eq last-command 'hm--html-smart-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3978 hm--just-insert-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3979 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3980 (delete-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3981 (hm--html-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3982 (setq hm--just-insert-ampersand nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3983 (insert ?&)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3984 (setq hm--just-insert-ampersand t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3985
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3986
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3994 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
3995 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3996 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3997 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3998 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3999 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4000 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4001 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4002 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4003 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4004 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4005 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4006 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4010 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4011 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4012 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4014 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4015 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4016 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4017 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4018 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4019 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4020 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4021 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4023 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4024 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4025 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4026 (interactive)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4027 (w3-fetch (concat "http://www.tnt.uni-hannover.de"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4028 "/~muenkel/software/own/hm--html-menus/overview.html")))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4029
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4031 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4032 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4033 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4035 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4036 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4037 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4038 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4039 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4040 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4041 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4042 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4043 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4044 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4045 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4046 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4047 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4048 'hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4049 'hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4050 'hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4051 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4052 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4053 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4054 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4055 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4056 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4057 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4058 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4059 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4060 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4061 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4062 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4063 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4064 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4065 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4066 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4067 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4068 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4069 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4070 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4071 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4072 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4073 'hm--html-menu-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4074 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4075 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4076 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4077 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4078 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4079 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4080 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4081 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4082 'hm--html-user-config-file
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4083 'hm--html-site-config-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4084 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4085 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4086 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4087 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4088 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4089 'hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4090 'html-document-previewer
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4091 'hm--html-region-mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4092 'html-sigusr1-signal-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4093 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4094 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4095 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4096 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4097 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4099
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4100 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4101 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4102 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4104 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4105 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4106
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4107 (add-hook 'zmacs-activate-region-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4108 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4110 (add-hook 'zmacs-deactivate-region-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4111 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4113 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4115 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 (add-hook 'activate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4118 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 (add-hook 'deactivate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4121 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4123 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 ; Environment loading
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 (defun hm--html-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 First, the system config file (detemined by the environment variable
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4133 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4134 At second a site config file is loaded, if the environment variable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4135 HTML_SITE_CONFIG_FILE or the lisp variable `hm--html-site-config-file'
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4136 is set to such a file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4137 At least the user config file (determined by the environment variable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4138 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139 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
4140 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4141 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142 `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
4143 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
4144 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4145 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4147 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4148 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4149 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4150 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4151 (load-library "hm--html-configuration"))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4152
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4153 ;; at second the site config file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4154 (if (and (stringp (getenv "HTML_SITE_CONFIG_FILE"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4155 (file-exists-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4156 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4157 (getenv "HTML_SITE_CONFIG_FILE"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4158 (load-file (expand-file-name (getenv "HTML_SITE_CONFIG_FILE")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4159 (when (and (boundp 'hm--html-site-config-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4160 (stringp hm--html-site-config-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4161 (file-exists-p (expand-file-name hm--html-site-config-file)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4162 (load-file (expand-file-name hm--html-site-config-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4164 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4165 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4166 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4167 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4175 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4176 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4177 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4178 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4180 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4182 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4184
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4185 ;;; quotify href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4186
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4187 (defvar hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4188 "<[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
4189 "Regular expression used for searching hrefs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4190
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4191 (defun hm--html-quotify-hrefs ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4192 "Insert quotes around all HREF and NAME attribute value literals.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4193
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4194 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
4195 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
4196
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4197 Look also at the variable `hm--html-quotify-href-regexp'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4198 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4199 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4200 (goto-char (point-min))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4201 (while
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4202 (re-search-forward hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4203 (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4204 t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4205 (cond
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4206 ((null (looking-at "\""))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4207 (insert "\"")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4208 (re-search-forward "[ \t\n>]" (point-max) t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4209 (forward-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4210 (insert "\""))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4211
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4212
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4213
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4214 (provide 'hm--html)