annotate lisp/hm--html-menus/hm--html.el @ 172:a38aed19690b

Added tag r20-3b12 for changeset 929b76928fce
author cvs
date Mon, 13 Aug 2007 09:47:55 +0200
parents 43dd3413c7c7
children 6075d714658b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
1 ;;; $Id: hm--html.el,v 1.8 1997/06/06 00:57:04 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
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
847 (defun hm--html-add-preformatted ()
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
848 "Adds the HTML tags for preformatted text at the current point."
0
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>"))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
854
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
855 (define-obsolete-function-alias 'hm--html-add-preformated
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
856 'hm--html-add-preformatted)
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
857
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
858 (defun hm--html-add-preformatted-to-region ()
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
859 "Adds the HTML tags for preformatted text to the region."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (hm--html-add-tags-to-region 'hm--html-insert-start-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 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 "</PRE>"))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
865
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
866 (define-obsolete-function-alias 'hm--html-add-preformated-to-region
142
1856695b1fa9 Import from CVS: tag r20-2b5
cvs
parents: 116
diff changeset
867 'hm--html-add-preformatted-to-region)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
869 (defun hm--html-add-blockquote ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
870 "Adds the HTML tags for blockquote."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
871 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
872 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
873 "<BLOCKQUOTE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
874 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
875 "</BLOCKQUOTE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
876
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
877
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
886 (defun hm--html-add-script ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
887 "Adds the HTML tags for script."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
890 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 'hm--html-insert-end-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
892 "</SCRIPT>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
893
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
894
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
895 (defun hm--html-add-script-to-region ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
896 "Adds the HTML tags for script to the region."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 (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
899 "<SCRIPT>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 'hm--html-insert-end-tag-with-newline
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
901 "</SCRIPT>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
902
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
903 (defun hm--html-add-style ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
904 "Adds the HTML tags for style."
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
905 (interactive)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
906 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
907 "<STYLE>"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
908 'hm--html-insert-end-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
909 "</STYLE>"))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
910
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
911
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
912 (defun hm--html-add-style-to-region ()
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
913 "Adds the HTML tags for style to the region."
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
914 (interactive)
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
915 (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
916 "<STYLE>"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
917 'hm--html-insert-end-tag-with-newline
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
918 "</STYLE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 (hm--html-add-tags 'hm--html-insert-start-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
924 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 'hm--html-insert-end-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
926 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
933 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 'hm--html-insert-end-tag
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
935 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
992 (defun hm--html-read-font-size (&optional only-absolute-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
993 "Reads the size for the FONT element.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
994 It returns nil, if the size should not be changed."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
995 (let ((size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
996 (if only-absolute-size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
997 (completing-read "The absolute font size (1 .. 7): "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
998 '(("7") ("6") ("5") ("4") ("3") ("2") ("1"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
999 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1000 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1001 "4")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1002 (completing-read "The relative (+/-) or absolute font size: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1003 '(("-7") ("-6") ("-5") ("-4") ("-3") ("-2") ("-1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1004 ("+7") ("+6") ("+5") ("+4") ("+3") ("+2") ("+1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1005 ("7") ("6") ("5") ("4") ("3") ("2") ("1")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1006 ("use-basefont"))
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 t
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1009 "use-basefont-size"))))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1010 (if (string= size "use-basefont-size")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1011 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1012 size)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1013
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1014 (defun hm--html-read-font-color ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1015 "Reads the size for the FONT element.
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1016 It returns nil, if the color should not be changed."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1017 (let ((color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1018 (completing-read "The font color: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1019 '(("Black") ("Silver") ("Gray") ("White") ("Maroon")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1020 ("Green") ("Lime") ("Olive") ("Yellow") ("Navy")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1021 ("Red") ("Purple") ("Fuchsia") ("Blue") ("Teal")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1022 ("Aqua") ("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 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1025 "dont-set-color")))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1026 (if (string= color "dont-set-color")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1027 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1028 color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1029
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1030
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1031 (defun hm--html-add-font (size color)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1032 "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
1033 (interactive (list (hm--html-read-font-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1034 (hm--html-read-font-color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1035 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1036 (concat "<FONT"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1037 (if size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1038 (concat " SIZE=" size)
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 (if color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1041 (concat " COLOR=" color)
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 ">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1044 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1045 "</FONT>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1046
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1047
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1048 (defun hm--html-add-font-to-region (size color)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1049 "Adds the HTML tags for Font to the region."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1050 (interactive (list (hm--html-read-font-size)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1051 (hm--html-read-font-color)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1052 (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
1053 (concat "<FONT"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1054 (if size
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1055 (concat " SIZE=" size)
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 (if color
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1058 (concat " COLOR=" color)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1059 "")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1060 ">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1061 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1062 "</FONT>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1068 (defun hm--html-add-center ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1069 "Adds the HTML tags for center at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1070 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1071 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1072 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1073 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1074 "</CENTER>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1075
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1076 (defun hm--html-add-center-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1077 "Adds the HTML tags for center to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1078 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1079 (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
1080 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1081 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1082 "</CENTER>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1084
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1085 (defvar hm--html-mapname-history nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1086 "The history variable for the function `hm--html-read-mapname'.")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1087
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1088 (defun hm--html-read-mapname ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1089 "Reads the name of an image map."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1090 (let ((name (read-string "The name of the image map: "
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1091 (or (car hm--html-mapname-history)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1092 "map")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1093 'hm--html-mapname-history)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1094 name))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1095
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1096 (defun hm--html-add-image-map ()
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1097 "Adds an image and a map element."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1098 (interactive)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1099 (let* ((href (hm--html-read-url "Image URL: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1100 (alt (hm--html-read-altenate href))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1101 (alignment (hm--html-read-alignment
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1102 "Alignment of the image: "))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1103 (mapname (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1104 (hm--html-add-image href alt alignment mapname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1105 (newline)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1106 (hm--html-add-map mapname)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1107 (call-interactively 'hm--html-add-area)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1108
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1109 (defun hm--html-add-map (name)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1110 "Adds the HTML tags for map at the current point."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1111 (interactive (list (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1112 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1113 (concat "<MAP NAME=\"" name "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1114 'hm--html-insert-end-tag
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1115 "</MAP>")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1116 (end-of-line 0))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1117
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1118 (defun hm--html-add-map-to-region (name)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1119 "Adds the HTML tags for map to the region."
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1120 (interactive (list (hm--html-read-mapname)))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1121 (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
1122 (concat "<MAP NAME=\"" name "\">")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1123 'hm--html-insert-end-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1124 "</MAP>"))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1125
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1126
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 "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
1129 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1135 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1136 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1137 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1145 "</OL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 "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
1150 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1156 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1157 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1158 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1166 "</DIR>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1169 (defun hm--html-add-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1170 "Adds the HTML tags for a (unnumbered) list to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1171 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1172 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1173 "<UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1174 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1175 "</UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1176 'hm--html-insert-start-tag
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1177 "<LI> "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1178 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1179 " </LI>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1180
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1181
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (defun hm--html-add-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 "Adds the HTML tags for a (unnumbered) list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1188 "</UL>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1189
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1190
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1191 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1192 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1193 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1194 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1195 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1196 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1197 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1198 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1199 "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1200 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1201 " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1202
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1203
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1210 "</MENU>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1211
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1212
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1213 (defun hm--html-add-description-title-and-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1214 "Adds a definition title and entry.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1215 Assumes we're at the end of a previous entry."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1216 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1217 (hm--html-add-description-title)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1218 (let ((position (point))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1219 (case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1220 (search-forward "</dt>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1221 (hm--html-add-description-entry)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1222 (goto-char position)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1223
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1224
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1225 (defun hm--html-add-description-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1226 "Adds the HTML tags for a description list.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1227 It also inserts a tag for the description title."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1228 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1229 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1230 "<DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1231 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1232 "</DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1233 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1234 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1235 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1236 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1237
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1246 "</DL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (defun hm--html-add-description-title ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1250 "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
1251 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1252 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1253 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1254 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1255 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1256
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1257
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1258 (defun hm--html-add-description-title-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1259 "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
1260 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1261 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1262 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1263 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1264 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1265
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1266
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1267 (defun hm--html-add-description-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1268 "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
1269 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1271 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1272 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1273 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1274
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1275
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1276 (defun hm--html-add-description-entry-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1277 "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
1278 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1279 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1280 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1281 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1282 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1283
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1284
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1285 (defun hm--html-add-address ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1286 "Adds the HTML tags for an address."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1287 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1288 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1289 "<ADDRESS>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1290 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1291 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1297 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 'hm--html-insert-end-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1299 "</ADDRESS>"))
0
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 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 "The signature reference name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (defun hm--html-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (concat
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1309 "<A NAME=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 hm--html-signature-reference-name
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1311 "\"\nHREF=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 "\">"))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1314
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1320 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1321 (if (re-search-forward (concat "<address>[ \t\n]*"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1322 "<a[ \t\n]+name=[ \t\n]*\"?"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1323 hm--html-signature-reference-name
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1324 "\"?[ \t\n]+href=[ \t\n]*\"")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1325 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1326 t)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1327 (let ((signature-start (match-beginning 0))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1328 (signature-end (progn
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1329 (re-search-forward "</address>[ \t]*[\n]?"
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1330 nil
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1331 t)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1332 (point))))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1333 (when (yes-or-no-p "Delete the old signature (yes or no) ?")
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1334 (delete-region signature-start signature-end)
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1335 (hm--html-indent-line)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 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
1341 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 (goto-char (point-max))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1344 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1345 (cond ((search-backward "</body>" 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)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1348 (newline 1)))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1349 ((search-backward "</html>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1350 (end-of-line 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1351 (if (> (current-column) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1352 (newline 2)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1353 ((> (current-column) 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1354 (newline 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1355 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 (defun hm--html-add-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 "Adds the owner's signature at the end of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (hm--html-set-point-for-signature)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1368 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1369 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 'hm--html-insert-end-tag
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1371 "</A>\n</ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (error "ERROR: Define your hm--html-signature-file first !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 "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
1382 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 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
1409 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 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
1411 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
1412 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1414 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1415 (cond ((search-forward-regexp "<isindex[^>]*>" nil t) (newline))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1416 ((search-forward-regexp "<head[^>]*>" nil t) (newline))
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1417 ((search-forward-regexp "<html[^>]*>" nil t) (newline))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1418 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (goto-char (point-min))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1426 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1427 (if (search-forward "<title>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1428 (let ((point-after-start-tag (point)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1429 (if (not (search-forward "</title>" nil t))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1430 nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1431 (goto-char (- (point) 8))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1432 (delete-backward-char (- (point) point-after-start-tag))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1433 (let ((start (point)))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1434 (if hm--html-automatic-create-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1435 (insert title " (" (hm--date) ")")
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1436 (insert title))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1437 (goto-char start))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1438 ;; Noch kein <TITLE> im Buffer vorhanden
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1439 (hm--html-set-point-for-title)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1440 (hm--html-add-tags 'hm--html-insert-start-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1441 "<TITLE>"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1442 'hm--html-insert-end-tag
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1443 "</TITLE>"
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1444 'insert
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1445 (if hm--html-automatic-create-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1446 (concat title " (" (hm--date) ")")
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1447 title))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1448 (forward-char 8)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1449 (newline 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1450 ))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1456 (let ((title (buffer-substring (region-beginning) (region-end)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1457 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 (goto-char (- (point) 8))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1465 (delete-backward-char (- (point) point-after-start-tag))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1466 (if hm--html-automatic-create-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1467 (insert title " (" (hm--date) ")")
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1468 (insert title))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 "</TITLE>"
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1475 'insert
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1476 (if hm--html-automatic-create-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1477 (concat title " (" (hm--date) ")")
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1478 title))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 "Adds the HTML tags <HTML> and </HTML> in the buffer.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1486 The tag <HTML> will be inserted at the beginning (after the
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1487 <!DOCTYPE ...>, if it is already there.) and </HTML> at the
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1490 (let ((new-cursor-position nil)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1491 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (error "There is an old tag <HTML> in the current buffer !")
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1496 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1511 The tags will be inserted after <HTML> or at the beginning
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1512 of the file after <DOCTYPE...> (if it is already there).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1515 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (goto-char (point-min))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1517 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 (hm--html-add-tags 'hm--html-insert-end-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 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1550 "</HEAD>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 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
1565 (interactive)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1566 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (forward-char -1)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1575 (let ((end-tag-position (set-marker (make-marker) (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 (let ((cursor-position (point)))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1583 (goto-char end-tag-position)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (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
1591 'hm--html-insert-end-tag-with-newline "</BODY>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 "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
1605 (interactive "sTitle and Header String: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1606 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1607 (hm--html-add-title title)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1608 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1609 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1610 (search-forward "</title>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1611 (if (search-forward "</head>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1612 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1613 (search-forward "<body>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1614 (newline 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1615 (if (search-forward "<body>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1616 (newline 1)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1617 (if (string= (what-line) "Line 1")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1618 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1619 (end-of-line)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1620 (newline 1)))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1621 (hm--html-add-header 1 title))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 (defun hm--html-add-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 "Adds the HTML tags for a title and a header to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 (interactive "sTitle and Header String: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1638 (let ((case-fold-search t))
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1639 (hm--html-add-doctype)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1640 (hm--html-add-html)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1641 (hm--html-add-head)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1642 (hm--html-add-body)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1643 (hm--html-add-title-and-header title)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1644 (when hm--html-signature-file
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1645 (hm--html-add-signature))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1646 (goto-char (point-min))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1647 (search-forward "</h1>" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1648 (forward-line 1)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1649 (when hm--html-automatic-created-comment
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1650 (hm--html-insert-created-comment))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1651 (when hm--html-automatic-create-modified-line
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1652 (hm--html-insert-modified-line))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 "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
1657 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (hm--html-add-title-and-header-to-region)
100
4be1180a9e89 Import from CVS: tag r20-1b2
cvs
parents: 98
diff changeset
1662 (hm--html-add-doctype)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 (hm--html-add-signature)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1667 (when hm--html-automatic-created-comment
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1668 (hm--html-insert-created-comment))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1669 (when hm--html-automatic-create-modified-line
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
1670 (hm--html-insert-modified-line)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1673 (defun hm--html-add-link-target-to-region (name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1674 "Adds the HTML tags for a link target to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1675 (interactive "sName: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1676 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1677 (concat "<A NAME=\"" name "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1678 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1679 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1680
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 "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
1683 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 "</A>"))
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 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 It returns the example extent."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1695 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1696 (if (hm--html-get-example-from-parameter-list parameter-list)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1697 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1698 (search-forward (hm--html-get-example-from-parameter-list
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1699 parameter-list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1700 (let ((extent (make-extent (match-beginning 0)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1701 (match-end 0))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1702 (set-extent-face extent 'hm--html-help-face)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
1703 extent)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 (hm--html-write-alist-in-buffer (cdr alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 (cdr prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 (t filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 hm--html-delete-wrong-path-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 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
1776 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 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
1780 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 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
1782 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 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
1787 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 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
1793 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 also nil it returns an empty string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 (make-face 'hm--html-help-face)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1851 (if hm--html-help-foreground
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1852 (set-face-foreground 'hm--html-help-face hm--html-help-foreground))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1853 (if hm--html-help-background
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1854 (set-face-background 'hm--html-help-face hm--html-help-background))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1855 (set-face-font 'hm--html-help-face hm--html-help-font)
0
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (car parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 (defun hm--html-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 (car (cdr parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 (defun hm--html-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 (insert (hm--html-get-example-from-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 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 construct the link."
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1964 ; (let ((point nil))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1965 (save-window-excursion
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1966 (let ((html-buffer (current-buffer))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1967 (html-help-buffer (hm--html-generate-add-link-help-buffer
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1968 scheme-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1969 host-name:port-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1970 servername:port-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1971 path+file-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1972 anchor-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1973 (scheme (hm--html-completing-read scheme-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1974 (hostname:port (hm--html-completing-read
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1975 host-name:port-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1976 (servername:port (hm--html-completing-read
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1977 servername:port-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1978 (path+file (hm--html-read-filename path+file-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1979 (anchor (hm--html-completing-read anchor-parameter-list))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1980 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1981 (anchor-seperator
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1982 (hm--html-get-anchor-seperator-from-parameter-list
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1983 anchor-parameter-list)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1984 (if (not (string= scheme ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1985 (if (string= hostname:port "")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1986 (setq scheme (concat scheme ":"))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1987 (setq scheme (concat scheme "://"))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1988 (if (and (not (string= hostname:port ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1989 (not (string= servername:port ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1990 (not (string= (substring servername:port 0 1) "/")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1991 (setq servername:port (concat "/" servername:port)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1992 (if (and (not (string= path+file ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1993 (not (string= "/" (substring path+file 0 1))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1994 (setq path+file (concat "/" path+file)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1995 (if (not (string= anchor ""))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1996 (setq anchor (concat anchor-seperator anchor)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1997 (kill-buffer html-help-buffer)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1998 (pop-to-buffer html-buffer)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
1999 (eval (list function-add-tags
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2000 ''hm--html-insert-start-tag
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2001 (concat "<A"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 ; hrefname
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2004 " HREF=\""
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2005 scheme
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2006 hostname:port
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2007 servername:port
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2008 path+file
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2009 anchor
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2010 "\">")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2011 ''hm--html-insert-end-tag
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2012 "</A>")))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2013 ; (setq point (point))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2014 ; (goto-char (point)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2015 ))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 "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
2019 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 "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
2061 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 "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
2109 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 "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
2115 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 "wais"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 "wais")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 "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
2159 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 (defun hm--html-add-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 "Adds the HTML tags for a link to an HTML file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 (hm--html-add-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 "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
2208 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 t
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 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 hm--html-ftp-hostname:port-default
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 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 ""
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 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 "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
2304 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 "Subject%20Tree"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 "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
2347 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 (defun hm--html-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 (let ((alist nil)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2357 (buffername (find-file-noselect proggate-allowed-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2358 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 t
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 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
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-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 The function looks at the environment variable NNTPSERVER.
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2492 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
2493 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 (if (file-exists-p (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 (let ((alist nil)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2513 (buffername (find-file-noselect newsrc-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2514 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 ""
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 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 "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
2569 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 (defun hm--html-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 hm--html-mail-hostname:port-default
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 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 ""
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 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 (defun hm--html-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 (interactive)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2612 (hm--html-add-mail-box-link-1 'hm--html-add-tags))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 "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
2617 (interactive)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2618 (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
2619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 ""
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 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 (list ; servername:port
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2642 "Mailaddress: "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2667 (defun hm--html-add-relative-link (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2668 "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
2669 (interactive (list (file-relative-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2670 (read-file-name "Relative Filename: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2671 nil
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 "")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2675 default-directory)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2676 ))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2677 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2678 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2679 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2680 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2681 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2682 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2683
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2684 (defun hm--html-add-relative-link-to-region (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2685 "Adds the HTML tags for a relative link to the region."
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2686 (interactive (list (file-relative-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2687 (read-file-name "Relative Filename: "
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2688 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2689 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2690 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2691 ""))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 (concat "<A HREF=\""
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2694 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2695 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2696 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2697 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2698
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2699 (defun hm--html-add-normal-link (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2700 "Adds the HTML tags for a normal general link.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2701 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2702 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2703 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2704 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2705 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2706 link-object
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2707 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2708 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2709 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2710
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2711 (defun hm--html-add-normal-link-to-region (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2712 "Adds the HTML tags for a normal general link to region.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2713 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2714 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2715 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2716 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2717 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2718 link-object
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (read-string "Node Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 "Hook function which updates the date in the title line, if
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2737 'hm--html-automatic-update-title-date' is t and which inserts a
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2739 (when hm--html-automatic-update-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2740 (hm--html-new-date))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2741 (when hm--html-automatic-changed-comment
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2742 (hm--html-insert-changed-comment t))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2743 (when hm--html-automatic-update-modified-line
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2744 (hm--html-insert-modified-line)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 "\\((\\)"
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
2762 "\\([ \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
2763 "[ \t]*\\)"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 noerror is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 (point)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2787 (point-max))))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2788 (comment-infix (or hm--html-comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2789 (concat (or hm--html-username (user-full-name))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2790 ", "))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (if (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 (error "ERROR: Please insert a title in the document !"))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2795 ; (let ((end-of-title-position (point)))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2796 (if (search-forward (concat "<!-- "
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2797 hm--html-created-comment-prefix)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2798 end-of-head
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2799 t)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2800 (if (yes-or-no-p
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2801 (concat "Replace the old comment \"<!-- "
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2802 hm--html-created-comment-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2803 "\" "))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2804 (progn
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2805 (goto-char (match-beginning 0))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2806 (kill-line)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2807 (hm--html-add-comment)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2808 (insert hm--html-created-comment-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2809 comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2810 ; (or hm--html-username (user-full-name))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2811 ; ", "
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2812 (hm--date))))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2813 (newline)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2814 (hm--html-add-comment)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2815 (insert hm--html-created-comment-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2816 comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2817 ; (insert "Created by: "
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2818 ; (or hm--html-username (user-full-name))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2819 ; ", "
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2820 (hm--date)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 102
diff changeset
2821 ))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2824 (defun hm--html-insert-changed-comment-1 (newline)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 "Internal function of 'hm--html-insert-changed-comment'.
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2826 Inserts a newline if NEWLINE is t, before the comment is inserted."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 (hm--html-add-comment)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2831 (insert hm--html-changed-comment-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2832 (or hm--html-comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2833 (concat (or hm--html-username (user-full-name)) ", "))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2834 (hm--date)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 "The function inserts a \"changed comment\".
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2838 The comment looks by default like
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2839 <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 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
2843 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
2844 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 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
2846 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2848 Look at the variables `hm--html-changed-comment-prefix' and
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2849 `hm--html-comment-infix', if you'd like to change the
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2850 inserted comments. You should not use different values for this
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2851 variables in the same HTML file.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2852
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2853 Attention: Don't write anything else in such a line!"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (point-max))))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2863 (comment-infix (or hm--html-comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2864 hm--html-username
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2865 (user-full-name))))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2866 ; (username (or hm--html-username (user-full-name))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 (goto-char end-of-head)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2868 ; (if (search-backward "<!-- Changed by: " nil t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2869 (if (search-backward (concat "<!-- "
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2870 hm--html-changed-comment-prefix)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2871 nil
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2872 t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2873 ; (if (string-match username
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2874 (if (string-match comment-infix
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 (point)))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2885 (hm--html-insert-changed-comment-1 nil))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (end-of-line)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2888 (hm--html-insert-changed-comment-1 t))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2889 ; (if (search-backward "<!-- Created by: " nil t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2890 (if (search-backward (concat "<!-- "
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2891 hm--html-created-comment-prefix)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2892 nil
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2893 t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (end-of-line)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2896 (hm--html-insert-changed-comment-1 t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (forward-char -1)))
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2904 (hm--html-insert-changed-comment-1 t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 "ERROR: Insert at first a title in the document !"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2909 (defun hm--html-insert-modified-line ()
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2910 "Inserts a modified line.
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2911 By default the line looks like:
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2912 <EM>Modified: 23-May-1997</EM>
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2913
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2914 Look at the variables `hm--html-automatic-create-modified-line',
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2915 `hm--html-automatic-update-modified-line', `hm--html-modified-prefix',
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2916 `hm--html-modified-start-tag', `hm--html-modified-end-tag' and
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2917 `hm--html-modified-insert-before' to change the behaviour of this
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2918 feature."
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2919 (interactive)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2920 (save-excursion
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2921 (goto-char (point-max))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2922 (if (search-backward-regexp (concat hm--html-modified-start-tag
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2923 "[ \t\n]*"
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2924 hm--html-modified-prefix)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2925 nil
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2926 t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2927 (progn ; old modified line exists
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2928 (goto-char (match-end 0))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2929 (if (search-forward-regexp (concat "\\([ \t\n]*\\)"
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2930 "\\([^ \t\n<]+\\)"
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2931 "\\([ \t\n]*"
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2932 hm--html-modified-end-tag
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2933 "\\)"))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2934 (progn
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2935 (delete-region (match-beginning 2) (match-end 2))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2936 (goto-char (match-beginning 2))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2937 (insert (hm--date)))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2938 ; (replace-match (concat "\\1" (hm--date)))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2939 (error "Destroyed \"Modified line\" found!")))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2940 (search-backward hm--html-modified-insert-before nil t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2941 (search-backward "</html>" nil t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2942 (search-backward "</body>" nil t)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2943 (newline)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2944 (indent-according-to-mode)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2945 (forward-line -1)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2946 (unless (= (util-return-end-of-line) (point))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2947 (end-of-line)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2948 (newline))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2949 (newline)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2950 (indent-according-to-mode)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2951 (insert hm--html-modified-start-tag
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2952 hm--html-modified-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2953 (hm--date)
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2954 hm--html-modified-end-tag))))
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
2955
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (defvar hm--html-template-file-history nil
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2960 "Historyvariable for the template files in the `hm--html-mode'.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 (defun hm--html-insert-template (filename)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2963 "Inserts a templatefile.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2964 It uses `tmpl-insert-template-file' to insert
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2965 the templates. The variables `tmpl-template-dir-list',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2966 `tmpl-automatic-expand' and `tmpl-history-variable-name' are
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2967 overwritten by `hm--html-template-dir',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2968 `hm--html-automatic-expand-templates' and `hm--html-template-file-history'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2969 (interactive (list nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2970 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2971 hm--html-template-dir
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2972 (list hm--html-template-dir)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2973 (tmpl-automatic-expand hm--html-automatic-expand-templates)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2974 (tmpl-history-variable-name 'hm--html-template-file-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2975 (if filename
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2976 (tmpl-insert-template-file filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2977 (call-interactively 'tmpl-insert-template-file))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2978 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2979
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2980 (defun hm--html-insert-template-from-fixed-dirs (filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2981 "Inserts a templatefile.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2982 It uses `tmpl-insert-template-file-from-fixed-dirs' to insert
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2983 the templates. The variables `tmpl-template-dir-list',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2984 `tmpl-automatic-expand', `tmpl-filter-regexp' and
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2985 `tmpl-history-variable-name' are overwritten by
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2986 `hm--html-template-dir', `hm--html-automatic-expand-templates',
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2987 `hm--html-template-filter-regexp' and `hm--html-template-file-history'."
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2988 (interactive (list nil))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2989 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2990 hm--html-template-dir
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2991 (list hm--html-template-dir)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2992 (tmpl-automatic-expand hm--html-automatic-expand-templates)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2993 (tmpl-filter-regexp hm--html-template-filter-regexp)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2994 (tmpl-history-variable-name 'hm--html-template-file-history))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2995 (if filename
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2996 (tmpl-insert-template-file-from-fixed-dirs filename)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2997 (call-interactively 'tmpl-insert-template-file-from-fixed-dirs))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2998 ))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
2999
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3003 (if (adapt-emacs19p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 '(("POST") ("GET"))
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 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 action
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 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 (read-string "Symbolic name: " last-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (read-string prompt initial-contents))
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 (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 src
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 (hm--html-form-add-input "checkbox" name value checked nil nil))
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 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 "Name of the last radio button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (defun hm--html-form-add-input-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241 (hm--html-form-add-input "radio" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 (defun hm--html-form-add-input-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 (hm--html-form-add-input "submit" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (defun hm--html-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 src))
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-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (defun hm--html-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 (defun hm--html-form-add-select-option (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 "</TEXTAREA>"))
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 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 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
3376 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 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
3392 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 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
3406 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 (defun hm--html-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 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
3419 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3462 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464 (defun hm--html-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3473 (concat "<TR>"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3474 (mapconcat '(lambda (entry)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3475 (concat "<TH" entry))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3476 (hm--html-table-read-cell-entries-and-alignments
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3477 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3478 no-of-cells)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3479 " </TH>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3480 " </TH></TR>")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3492 (concat "<TR><TD"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3493 (car (hm--html-table-read-cell-entries-and-alignments 1 1))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3494 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 (if (<= no-of-cells 1)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3496 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 2 no-of-cells)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3502 " </TD>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3503 " </TD></TR>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506 (defun hm--html-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 (let* ((point-of-view (point))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3512 (case-fold-search t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3513 (end-of-last-row (search-backward "</tr>" (point-min) t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3514 (begin-of-last-row (progn (search-backward "<tr" (point-min) t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3515 (re-search-forward "<t[dh]"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3516 point-of-view t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518 (alignment-list nil))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3519 (goto-char begin-of-last-row)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3520 (if (not (re-search-forward "<t[dh]" end-of-last-row t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3526 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546 from existing rows of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3548 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3549 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 'hm--html-insert-end-tag-with-newline
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3552 (concat "<TR><TD" (car (hm--html-table-read-cell-entries-and-alignments
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3553 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3554 1
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3555 old-alignment-list))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3556 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 (if (<= no-of-cells 1)
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3558 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565 (cdr old-alignment-list))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3566 " </TD>")
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3567 " </TD></TR>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3570 (defun hm--html-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3571 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3573 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3574 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3575 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3576 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3577 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3578 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3579 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3580 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3581 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3588 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3589 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3590 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3591 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3592 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3593 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3594 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3595 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3598 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3599 "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
3600 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3601 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3603 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3604 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3605 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3606 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3607 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3608 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3609 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3610 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3611 "<TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3614 (defun hm--html-add-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3615 "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
3616 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3617 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3618 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3619 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3620 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3621 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3622 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3623 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3624 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3625 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3626 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3627 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3630 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3631 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3632 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3633 (interactive "NNo of columns, spaned by this cell: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3634 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3635 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3636 (if (and (search-backward "<" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3637 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3638 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3639 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3640 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3641 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3642 (delete-region (match-beginning 2) (match-end 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3643 (insert (format "\"%d\"" columns)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3644 (insert (format " colspan=\"%d\"" columns)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3645 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 (interactive "NNo of rows, spaned by this cell: ")
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3652 (let ((case-fold-search t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3653 (save-excursion
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3654 (if (and (search-backward "<" nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3655 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3656 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3657 nil
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3658 t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3659 (progn
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3660 (delete-region (match-beginning 2) (match-end 2))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3661 (insert (format "\"%d\"" rows)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3662 (insert (format " rowspan=\"%d\"" rows)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
3663 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3666 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3667 ;(setq buffer-invisibility-spec '(hm--html-iso-entity-invisible-flag))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3668
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3669 ;(defvar hm--html-iso-entity-invisible-flag t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3670 ; "Controls the visibility of the iso entities.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3671
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3672 ;(defvar hm--html-iso-glyph-invisible-flag nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3673 ; "Controls the visibility of the iso character glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3674
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3675 ;(defvar hm--html-glyph-cache nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3676 ; "Internal variable. An assoc list with the already created glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3677
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3678 ;(defun hm--html-create-glyph (string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3679 ; "Creates a glyph from the string or returns an existing one.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3680 ;The glyph is stored in `hm--html-glyph-cache'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3681 ; (if nil ;(assoc string hm--html-glyph-cache)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3682 ; (cdr (assoc string hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3683 ; (let ((glyph (make-glyph string)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3684 ; (setq hm--html-glyph-cache (cons (cons string glyph)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3685 ; hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3686 ; glyph)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3687
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3688 ;(defun hm--html-attach-glyph-to-region (start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3689 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3690 ; string
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3691 ; region-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3692 ; glyph-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3693 ; "Make the region invisible and attach a glyph STRING.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3694 ;The invisible flags could be used, to toggle the visibility."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3695 ; (mapcar 'delete-annotation (annotations-at end)) ; delete old anotations
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3696 ; ;; delete old extents
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3697 ; (let ((extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3698 ; (annotation nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3699 ; (set-extent-property extent 'invisible region-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3700 ; (set-extent-property extent 'end-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3701 ; (set-extent-property extent 'start-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3702 ; (set-extent-property extent 'intangible t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3703 ; (setq annotation (make-annotation "Hallo Du da" ;(hm--html-create-glyph string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3704 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3705 ; 'text))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3706 ; (goto-char end)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3707
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3708
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3709 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3710 ; "Inserts an iso char as html ENTITY and displays a glyph.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3711 ;The glyph is created from the string CHAR."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3712 ; (let ((start (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3713 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3714 ; (hm--html-attach-glyph-to-region start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3715 ; (point)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3716 ; char
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3717 ; 'hm--html-iso-entity-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3718 ; 'hm--html-iso-glyph-invisible-flag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3719
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3720 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3721 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3722 ; (hm--html-insert-iso-char-as-entity-and-glyph "ü" "&uuml;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3723
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3724
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3725 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3726 ; (let ((start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3727 ; (end nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3728 ; (extent nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3729 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3730 ; (setq end (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3731 ; (setq extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3732 ; (set-extent-begin-glyph extent char)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3733 ; (set-extent-property extent 'invisible t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3734
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3735 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3736 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3737 ; (hm--html-insert-iso-char-as-entity-and-glyph ?ü "&uuml;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3754 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762 (insert "&Uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764 (defun hm--html_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765 "Insert the character 'Oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3767 (insert "&Ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769 (defun hm--html_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3770 "Insert the character 'Ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772 (insert "&Auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774 (defun hm--html_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3775 "Insert the character 'Aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777 (insert "&Aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3779 (defun hm--html_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3780 "Insert the character 'sz'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782 (insert "&szlig;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3784 (defun hm--html_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 "Insert the character 'aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789 (defun hm--html_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790 "Insert the character 'eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3792 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3793
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3794 (defun hm--html_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 "Insert the character 'iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3797 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799 (defun hm--html_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800 "Insert the character 'oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804 (defun hm--html_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805 "Insert the character 'uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809 (defun hm--html_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810 "Insert the character 'Aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814 (defun hm--html_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 "Insert the character 'Eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3817 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819 (defun hm--html_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820 "Insert the character 'Iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824 (defun hm--html_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 "Insert the character 'Oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829 (defun hm--html_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 "Insert the character 'Uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834 (defun hm--html_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835 "Insert the character 'agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837 (insert "&agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839 (defun hm--html_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 "Insert the character 'egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842 (insert "&egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844 (defun hm--html_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845 "Insert the character 'igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847 (insert "&igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849 (defun hm--html_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 "Insert the character 'ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3852 (insert "&ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3854 (defun hm--html_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3855 "Insert the character 'ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3857 (insert "&ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3859 (defun hm--html_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3860 "Insert the character 'Agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862 (insert "&Agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864 (defun hm--html_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 "Insert the character 'Egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867 (insert "&Egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869 (defun hm--html_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3870 "Insert the character 'Igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3872 (insert "&Igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3874 (defun hm--html_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 "Insert the character 'Ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877 (insert "&Ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879 (defun hm--html_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3880 "Insert the character 'Ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882 (insert "&Ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3884 (defun hm--html_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3885 "Insert the character 'ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887 (insert "&ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3889 (defun hm--html_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3890 "Insert the character 'Ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3891 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3892 (insert "&Ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3894 (defun hm--html_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3895 "Insert the character 'atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3897 (insert "&atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3899 (defun hm--html_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3900 "Insert the character 'otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3902 (insert "&otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3904 (defun hm--html_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3905 "Insert the character 'ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3907 (insert "&ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3909 (defun hm--html_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3910 "Insert the character 'Atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3912 (insert "&Atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3913
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3914 (defun hm--html_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3915 "Insert the character 'Otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3917 (insert "&Otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3918
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919 (defun hm--html_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920 "Insert the character 'Ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922 (insert "&Ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924 (defun hm--html_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 "Insert the character 'acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3927 (insert "&acirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3929 (defun hm--html_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3930 "Insert the character 'ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3931 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3932 (insert "&ecirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3934 (defun hm--html_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 "Insert the character 'icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3936 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3937 (insert "&icirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939 (defun hm--html_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3940 "Insert the character 'ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3942 (insert "&ocirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3944 (defun hm--html_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3945 "Insert the character 'ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3947 (insert "&ucirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3949 (defun hm--html_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3950 "Insert the character 'Acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3951 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3952 (insert "&Acirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954 (defun hm--html_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955 "Insert the character 'Ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3957 (insert "&Ecirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3959 (defun hm--html_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3960 "Insert the character 'Icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3961 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3962 (insert "&Icirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964 (defun hm--html_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965 "Insert the character 'Ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3966 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3967 (insert "&Ocirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3969 (defun hm--html_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3970 "Insert the character 'Ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3971 (interactive)
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
3972 (insert "&Ucirc;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3973
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3974 (defun hm--html_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3975 "Insert the character 'ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3976 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3977 (insert "&euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3978
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3979 (defun hm--html_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3980 "Insert the character 'idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3981 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3982 (insert "&iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3983
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3984 (defun hm--html_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3985 "Insert the character 'Ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3986 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987 (insert "&Euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989 (defun hm--html_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3990 "Insert the character 'Idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992 (insert "&Iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3994 (defun hm--html_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3995 "Insert the character 'thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3996 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3997 (insert "&thorn;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3999 (defun hm--html_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4000 "Insert the character 'Thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4001 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4002 (insert "&THORN;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4004 (defun hm--html_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4005 "Insert the character 'eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4006 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4007 (insert "&eth;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4008
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4009 (defun hm--html_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4010 "Insert the character 'Eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4011 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4012 (insert "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4015 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4016 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4017 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4019 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4020 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4021
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4022 (defun hm--html-less-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4023 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4024 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4025 (insert "&lt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4026
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4027 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4028 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4029 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4030 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4031 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4032 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4033 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4034 (hm--html-less-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4035 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4036 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4037 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4038
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4039 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4040 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4041
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4042 (defun hm--html-greater-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4043 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4044 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4045 (insert "&gt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4046
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4047 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4048 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4049 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4050 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4051 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4052 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4053 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4054 (hm--html-greater-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4055 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4056 (insert ?>)
155
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
4057 ;; Next line added by Bob Weiner, Altrasoft, 11/21/96.
43dd3413c7c7 Import from CVS: tag r20-3b4
cvs
parents: 153
diff changeset
4058 #+infodock (if id-html-auto-indent (indent-according-to-mode))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4059 (setq hm--just-insert-greater-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4061
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4062 (defvar hm--just-insert-ampersand nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4063 "Internal variable.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4064
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4065 (defun hm--html-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4066 "Inserts the entity '&amp;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4067 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4068 (insert "&amp;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4069
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4070 (defun hm--html-smart-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4071 "Insert a '&' or the entity '&amp;' if you execute this command twice."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4072 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4073 (if (and (eq last-command 'hm--html-smart-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4074 hm--just-insert-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4075 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4076 (delete-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4077 (hm--html-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4078 (setq hm--just-insert-ampersand nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4079 (insert ?&)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4080 (setq hm--just-insert-ampersand t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4081
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4082
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4083 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4084 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4085 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4086
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4087 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4088 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4089 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4090 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
4091 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4092 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4093 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4094 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4095 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4096 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4097 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4098 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4099 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4100 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4101 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4102 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4106 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4107 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4108 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4110 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4111 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4112 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4113 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4114 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4115 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4121 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122 (interactive)
102
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4123 (w3-fetch (concat "http://www.tnt.uni-hannover.de"
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4124 "/~muenkel/software/own/hm--html-menus/overview.html")))
a145efe76779 Import from CVS: tag r20-1b3
cvs
parents: 100
diff changeset
4125
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4128 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4129 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4133 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4134 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4135 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4136 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4137 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4138 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4140 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4141 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4143 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4144 'hm--html-automatic-created-comment
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4145 'hm--html-automatic-create-modified-line
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146 'hm--html-automatic-expand-templates
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4147 'hm--html-automatic-update-modified-line
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4148 'hm--html-automatic-update-title-date
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4149 'hm--html-changed-comment-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4150 'hm--html-comment-infix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4151 'hm--html-created-comment-prefix
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4152 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4153 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4154 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4155 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4156 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4157 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4158 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4159 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4160 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4161 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4162 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4163 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4164 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4165 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4166 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4167 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 'hm--html-menu-load-hook
153
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4175 'hm--html-modified-end-tag
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4176 'hm--html-modified-insert-before
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4177 'hm--html-modified-prefix
25f70ba0133c Import from CVS: tag r20-3b3
cvs
parents: 142
diff changeset
4178 'hm--html-modified-start-tag
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4180 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4182 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4183 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4184 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4185 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4186 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4187 'hm--html-user-config-file
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4188 'hm--html-site-config-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4189 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4190 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4191 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4192 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4193 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4194 'hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4195 'html-document-previewer
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4196 'hm--html-region-mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4197 'html-sigusr1-signal-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4198 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4199 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4200 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4201 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4202 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4205 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4206 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4207 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4209 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4210 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4211
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4212 (add-hook 'zmacs-activate-region-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4213 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4215 (add-hook 'zmacs-deactivate-region-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4216 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4217
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4218 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4220 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4222 (add-hook 'activate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4223 'hm--html-switch-region-modes-on)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4225 (add-hook 'deactivate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4226 'hm--html-switch-region-modes-off)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4228 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4231 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4232 ; Environment loading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4233 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4235 (defun hm--html-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4236 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4237 First, the system config file (detemined by the environment variable
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4238 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4239 At second a site config file is loaded, if the environment variable
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4240 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
4241 is set to such a file.
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4242 At least the user config file (determined by the environment variable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4243 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4244 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
4245 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4246 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4247 `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
4248 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
4249 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4250 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4251 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4252 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4253 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4254 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4255 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4256 (load-library "hm--html-configuration"))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4257
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4258 ;; at second the site config file
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4259 (if (and (stringp (getenv "HTML_SITE_CONFIG_FILE"))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4260 (file-exists-p
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4261 (expand-file-name
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4262 (getenv "HTML_SITE_CONFIG_FILE"))))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4263 (load-file (expand-file-name (getenv "HTML_SITE_CONFIG_FILE")))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4264 (when (and (boundp 'hm--html-site-config-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4265 (stringp hm--html-site-config-file)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4266 (file-exists-p (expand-file-name hm--html-site-config-file)))
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 70
diff changeset
4267 (load-file (expand-file-name hm--html-site-config-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4269 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4270 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4271 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4272 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4273 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4274 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4275 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4276 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4277 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4278 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4279 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4280 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4281 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4282 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4283 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4284 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4285 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4286 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4287 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4289
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4290 ;;; quotify href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4291
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4292 (defvar hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4293 "<[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
4294 "Regular expression used for searching hrefs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4295
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4296 (defun hm--html-quotify-hrefs ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4297 "Insert quotes around all HREF and NAME attribute value literals.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4298
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4299 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
4300 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
4301
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4302 Look also at the variable `hm--html-quotify-href-regexp'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4303 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4304 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4305 (goto-char (point-min))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4306 (while
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4307 (re-search-forward hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4308 (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4309 t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4310 (cond
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4311 ((null (looking-at "\""))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4312 (insert "\"")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4313 (re-search-forward "[ \t\n>]" (point-max) t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4314 (forward-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4315 (insert "\""))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4316
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4317
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4318
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4319 (provide 'hm--html)