annotate lisp/hm--html-menus/hm--html.el @ 24:4103f0995bd7 r19-15b95

Import from CVS: tag r19-15b95
author cvs
date Mon, 13 Aug 2007 08:51:03 +0200
parents 8fc7fe29b841
children 441bb1e64a06
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1 ;;; $Id: hm--html.el,v 1.3 1997/02/22 22:07:11 steve Exp $
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2 ;;;
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3 ;;; Copyright (C) 1993 - 1997 Heiko Muenkel
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; email: muenkel@tnt.uni-hannover.de
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; Description:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; Defines functions for the file hm--html-menu.el.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;; Installation:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;; Put this file in one of your load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
30 (defun hm--html-set-marker-at-position (&optional position)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
31 "Creates a new marker and set the marker at the POSITION.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
32 If POSITION is nil, then the marker is set at the current point.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
33 The return value is the marker."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
34 (let ((marker (make-marker)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
35 (if position
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
36 (set-marker marker position)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
37 (set-marker marker (point)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; Functions for adding html commands which consists of a start and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; end tag and some text between them. (Basicfunctions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (defun hm--html-add-tags (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
44 &optional
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
45 function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
46 end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
48 middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
49 function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50 middle-end-tag)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 "Adds the start and the end html tag at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 The second parameter is the string for the start tag and the fourth parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 is the string for the end tag. The third and fourth parameters are optional.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 The fifth parameter is optional. If it exists, it specifies a function which
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
57 inserts the sixth parameter (the middle-start-tag) between the start and the
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
58 end tag."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (eval (list function-insert-start-tag start-tag))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60 (if function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61 (eval (list function-insert-middle-start-tag middle-start-tag)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
62 (let ((position (hm--html-set-marker-at-position (point))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 (if function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64 (eval (list function-insert-middle-end-tag middle-end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
65 (if function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
66 (eval (list function-insert-end-tag end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
67 (goto-char position)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defun hm--html-add-tags-to-region (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 end-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
74 &optional
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
75 function-insert-middle-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
76 middle-tag)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 "Adds the start and the end html tag to the active region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 The second parameter is the string for the start tag and the fourth parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 is the string for the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 The fifth parameter is optional. If it exists, it specifies a function which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 inserts the sixth parameter (the middle-tag) between the start and the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (save-window-excursion
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
86 (let ((start (hm--html-set-marker-at-position (region-beginning)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (eval (list function-insert-end-tag end-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (goto-char start)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
91 ; (backward-char (+ (length end-tag) (- end start)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (eval (list function-insert-start-tag start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (if function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (eval (list function-insert-middle-tag middle-tag)))
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defun hm--html-insert-start-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 "Inserts the HTML start tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 The parameter must be a string (i.e. \"<B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
103 (hm--html-indent-region start (point))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
104 ; (html-maybe-deemphasize-region start (- (point) 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defun hm--html-insert-end-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 "Inserts the HTML end tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 The parameter must be a string (i.e. \"</B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
112 (hm--html-indent-region start (point))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
113 ; (html-maybe-deemphasize-region start (- (point) 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (defun hm--html-insert-start-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 "Inserts the HTML start tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 The parameter must be a string (i.e. \"<PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
121 (hm--html-indent-region start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
122 )
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (defun hm--html-insert-end-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 "Inserts the HTML end tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 The parameter must be a string (i.e. \"</PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
132 (hm--html-indent-region start (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;;; Functions which add simple tags of the form <tag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
138 (defun hm--html-add-list-or-menu-item-separator ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
139 "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
140 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
141 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
142
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
143 (defun hm--html-add-list-or-menu-item ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
144 "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
145 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
146 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
147 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
148
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
149 (defun hm--html-add-list-or-menu-item-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
150 "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
151 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
152 (hm--html-add-tags-to-region 'hm--html-insert-start-tag "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
153 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
154
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
155 (defun hm--html-add-basefont (size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
156 "Adds the HTML tag for a basefont."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
157 (interactive (list (hm--html-read-font-size t)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
158 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
159 (concate "<BASEFONT SIZE=" size ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
160
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 (defun hm--html-add-line-break ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "Adds the HTML tag for a line break."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (hm--html-add-tags 'hm--html-insert-start-tag "<BR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (defun hm--html-add-horizontal-rule ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 "Adds the HTML tag for a horizontal rule (line)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (hm--html-add-tags 'hm--html-insert-start-tag "<HR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (defun hm--html-add-paragraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 "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
175 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (defun hm--html-add-paragraph-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "Adds the HTML tags for a paragraph to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (defun hm--html-add-paragraph-separator ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 "Adds the tag for a paragraph seperator."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (hm--html-add-tags 'hm--html-insert-start-tag "<P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
196 (defun hm--html-add-doctype ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
197 "Adds the tag with the doctype."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
198 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
199 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
200 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
201 (concat "<!DOCTYPE HTML PUBLIC \""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
202 hm--html-html-doctype-version
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
203 "\">"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
204 (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
205
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
206 (defun hm--html-search-place-for-element-in-head (end-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
207 "Searches the point for inserting an element between the head tags."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
208 (let ((point (point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
209 (if (and end-point (< (point) end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
210 (point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
211 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
212 (if (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
213 (concat "\\(<title\\)\\|\\(<head\\)\\|\\(<html\\)\\|"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
214 "\\(<isindex\\)\\|\\(<base\\)\\|\\(<link\\)\\|"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
215 "\\(<meta")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
216 end-point
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
217 t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
218 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
219 point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
220
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
221 (defun hm--html-add-isindex (prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
222 "Inserts the isindex tag. PROMPT is the value of the prompt attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
223 (interactive "sPrompt: ")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
224 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
225 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
226 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
227 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
228 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
229 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
230 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
231 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
232 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
233 (cond ((re-search-forward "<isindex[^>]*>" head-end-point t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
234 (delete-region (match-beginning 0) (match-end 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
235 (t (goto-char point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
236 (hm--html-search-place-for-element-in-head head-end-point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
237 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
238 (concat "<ISINDEX "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
239 (if (and prompt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
240 (not (string= prompt "")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
241 (concat " PROMPT=\"" prompt "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
242 ">")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
243
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
244 (defun hm--html-add-base (href)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
245 "Inserts the base tag. HREF is the value of the href attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
246 (interactive (list (hm--html-read-url "URL of this document: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
247 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
248 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
249 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
250 nil)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
251 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
252 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
253 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
254 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
255 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
256 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
257 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
258 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
259 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
260 (cond ((re-search-forward "<base[^>]*>" head-end-point t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
261 (delete-region (match-beginning 0) (match-end 0)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
262 (t (goto-char point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
263 (hm--html-search-place-for-element-in-head head-end-point)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
264 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
265 (concat "<BASE "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
266 (if (and href
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
267 (not (string= href "")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
268 (concat " HREF=\"" href "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
269 ">")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
270
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
271 (defun hm--html-add-meta (name content &optional name-instead-of-http-equiv)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
272 "Inserts the meta tag."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
273 (interactive (list (completing-read "Name: " hm--html-meta-name-alist)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
274 (read-string "Content: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
275 (save-excursion
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
276 (let ((point (point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
277 (case-fold-search t)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
278 (head-end-point))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
279 (goto-char (point-min))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
280 (setq head-end-point (when (re-search-forward
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
281 "\\(</head\\)\\|\\(<body\\)\\|\\(</html\\)")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
282 (beginning-of-line)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
283 (point))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
284 (goto-char point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
285 (hm--html-search-place-for-element-in-head head-end-point)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
286 (hm--html-add-tags 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
287 (concat "<META "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
288 (if name-instead-of-http-equiv
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
289 "NAME=\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
290 "HTTP-EQUIV=\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
291 name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
292 "\" CONTENT=\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
293 content
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
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
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
365 (defun hm--html-read-alignment (prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
366 "Read the value for the align attribute."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
367 (upcase (completing-read prompt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
368 '(("left") ("right") ("top") ("bottom") ("middle"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
369 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
370 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
371 "left")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
372
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
373 (defvar hm--html-shape-history nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
374 "History variable for reading the shape of an image map.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
375
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
376 (defun hm--html-read-shape ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
377 "Reads the shap for an area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
378 (upcase(completing-read "The shape of the area: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
379 '(("rect") ("circle") ("poly"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
380 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
381 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
382 (or (car hm--html-shape-history) "rect")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
383 'hm--html-shape-history)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
384
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
385 (defun hm--html-read-rect-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
386 "Reads rectangle coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
387 (concat (read-string "Left x position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
388 (read-string "Top y position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
389 (read-string "Right x position of the rectangle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
390 (read-string "Bottom y position of the rectangle: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
391
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
392 (defun hm--html-read-circle-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
393 "Reads circle coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
394 (concat (read-string "x position of the center of the circle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
395 (read-string "y position of the center of the circle: ") ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
396 (read-string "Radius: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
397
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
398 (defun hm--html-read-one-poly-coordinate (&optional empty-string-prompt)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
399 "Reads one poly coordinate pair."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
400 (let* ((x (read-string (concat "x coordinate"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
401 (or empty-string-prompt "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
402 ": ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
403 (y (unless (string= "" x)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
404 (read-string "y coordinate: "))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
405 (if (string= "" x)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
406 ""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
407 (concat x ", " y))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
408
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
409 (defun hm--html-read-more-poly-coordinates ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
410 "Reads poly coordinates until an empty string is given."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
411 (let ((coord (hm--html-read-one-poly-coordinate
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
412 " (Empty string for no further coords!)")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
413 (cond ((string= "" coord) "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
414 (t (concat ", " coord (hm--html-read-more-poly-coordinates))))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
415
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
416 (defun hm--html-read-poly-coords ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
417 "Reads poly coordinates for the area element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
418 (concat (hm--html-read-one-poly-coordinate) ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
419 (hm--html-read-one-poly-coordinate) ", "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
420 (hm--html-read-one-poly-coordinate)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
421 (hm--html-read-more-poly-coordinates)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
422
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
423 (defun hm--html-add-area (href alt shape coords)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
424 "Adds the tags for an area at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
425 (interactive (let* ((href (hm--html-read-url "Url for the image area: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
426 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
427 (shape (hm--html-read-shape))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
428 (coords (cond ((string= shape "RECT")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
429 (hm--html-read-rect-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
430 ((string= shape "CIRCLE")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
431 (hm--html-read-circle-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
432 ((string= shape "POLY")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
433 (hm--html-read-poly-coords))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
434 (t (error "No function to read \""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
435 shape
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
436 "\" coordinates!")))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
437 (list href alt shape coords)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
438 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
439 (concat "<AREA"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
440 " HREF=\"" href "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
441 (if alt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
442 (concat "\nALT=\"" alt "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
443 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
444 "\nSHAPE=" shape
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
445 "\nCOORDS=\"" coords "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
446 ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
447
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
448 (defvar hm--html-use-image-as-map ':ask
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
449 "Internal variable of `hm--html-add-image'.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
450 nil => insert the image element without an usemap attribute.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
451 t => insert the image element with an usemap attribute.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
452 :ask => ask, if the image element should have an usemap attribute.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
453
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
454 (defun hm--html-add-image (href alt alignment mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
455 "Add an image."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
456 (interactive (let* ((href (hm--html-read-url "Image URL: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
457 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
458 (alignment (hm--html-read-alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
459 "Alignment of the image: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
460 (use-as-map (if (eq hm--html-use-image-as-map ':ask)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
461 (y-or-n-p
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
462 "Use the image as a map with links? ")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
463 hm--html-use-image-as-map))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
464 (mapname (and use-as-map (hm--html-read-mapname))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
465 (list href alt alignment mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
466 (hm--html-add-tags
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
467 'hm--html-insert-start-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
468 (concat "<IMG ALIGN=" alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
469 "\nHREF=\"" href "\""
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
470 (if alt
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
471 (concat "\nALT=\"" alt "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
472 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
473 (if mapname
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
474 (concat "\nUSEMAP=\"#" mapname "\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
475 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
476 ">")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
477
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 (defun hm--html-add-image-bottom (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 "Add an image, bottom aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
483 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
484 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
485 (concat "<IMG ALIGN=BOTTOM SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
486 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
487 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
488 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
489 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (defun hm--html-add-image-middle (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 "Add an image, middle aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
496 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
497 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
498 (concat "<IMG ALIGN=MIDDLE SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
499 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
500 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
501 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
502 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (defun hm--html-add-image-top (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 "Add an image, top aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
509 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
510 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
511 (concat "<IMG ALIGN=TOP SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
512 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
513 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
514 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
515 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
516
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
517
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
518 (defun hm--html-add-applet (name code width height)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
519 "Add an applet."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
520 (interactive (let ((name (read-string "Applet Name: " "applet"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
521 (code (read-file-name "Applet Class File: "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
522 (width (read-number "Width (i.e.: 100): " t))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
523 (height (read-number "Height (i.e.: 100): " t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
524 (list name code width height)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
525 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
526 (concat "<APPLET "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
527 (if (string= name "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
528 ""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
529 (concat "NAME=\"" name "\"\n"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
530 "CODE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
531 code
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
532 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
533 "WIDTH=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
534 width
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
535 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
536 "HEIGHT=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
537 height
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
538 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
539 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
540 "</APPLET>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
541
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
542 (defun hm--html-add-applet-parameter (name value)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
543 "Adds the tag for an applet parameter at the current point.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
544 This tag must be added between <APPLET> and </APPLET>."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
545 (interactive "sParameter Name: \nsParameter Value: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
546 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
547 (concat "<PARAM "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
548 "NAME=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
549 name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
550 "\" VALUE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
551 value
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
552 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
553
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (defun hm--html-add-server-side-include-file (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 "This function adds a server side include file directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (interactive "FInclude File: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (if (string= file "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (error "ERROR: No filename specified !")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
562 (insert "<INC SRV \"" file "\">"))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
563 ; (html-maybe-deemphasize-region (1+ start) (1- (point))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (defun hm--html-add-server-side-include-command-with-isindex-parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 The include command uses the \"isindex\"- parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (hm--html-add-server-side-include-command command t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (defun hm--html-add-server-side-include-command (command &optional srvurl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 The directive is only supported by the NCSA http daemon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 If SRVURL is t, then the attribute srvurl instead of srv is used for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 include command. With srvurl, the include command uses the \"isindex\"-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (let ((start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 (attribute (if srvurl "SRVURL" "SRV")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 (insert "<INC " attribute" \"" command "\">")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
591 (insert "<INC " attribute " \"|" command "\">")))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
592 ; (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 ;(defun hm--html-add-server-side-include-command-with-parameter (command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 ; parameter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 ; "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 ; (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 ; (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 ; "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 ; hm--html-server-side-include-command-with-parameter-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 ; (read-string "Parameterlist sepearted by '?': ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 ; (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 ; (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 ; (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 ; (if (string= parameter "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 ; (error "ERROR: No parameter specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 ; (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 ; (insert "<INC SRVURL \"" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 ; (insert "<INC SRVURL \"" command "?" parameter "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 ; (insert "<INC SRVURL \"|" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 ; (insert "<INC SRVURL \"|" command "?" parameter "\">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 ; (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 ;;; Functions, which adds tags of the form <starttag> ... </endtag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
622 (defun hm--html-add-big ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
623 "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
624 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
625 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
626 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
627 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
628 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
629
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
630
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
631 (defun hm--html-add-big-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
632 "Adds the HTML tags for Big to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
633 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
634 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
635 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
636 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
637 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
638
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
639
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
640 (defun hm--html-add-small ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
641 "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
642 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
643 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
644 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
645 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
646 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
647
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
648
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
649 (defun hm--html-add-small-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
650 "Adds the HTML tags for Small to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
651 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
652 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
653 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
654 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
655 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
656
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
657
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (defun hm--html-add-bold ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 "Adds the HTML tags for Bold at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 (defun hm--html-add-bold-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 "Adds the HTML tags for Bold to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (defun hm--html-add-italic ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 "Adds the HTML tags for Italic at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (defun hm--html-add-italic-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 "Adds the HTML tags for Italic to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (defun hm--html-add-underline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 "Adds the HTML tags for Underline at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 (defun hm--html-add-underline-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 "Adds the HTML tags for Underline to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (defun hm--html-add-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 "Adds the HTML tags for Definition at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 (defun hm--html-add-definition-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 "Adds the HTML tags for Definition to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (defun hm--html-add-code ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 "Adds the HTML tags for Code at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 (defun hm--html-add-code-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 "Adds the HTML tags for Code to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
748 (defun hm--html-add-citation ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
749 "Adds the HTML tags for Citation."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
750 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
751 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
752 "<CITE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
753 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
754 "</CITE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
755
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 (defun hm--html-add-citation-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 "Adds the HTML tags for Citation to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 "<CITE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 "</CITE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
765 (defun hm--html-add-emphasized ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
766 "Adds the HTML tags for Emphasized."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
767 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
768 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
769 "<EM>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
770 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
771 "</EM>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
772
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
773
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 (defun hm--html-add-emphasized-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 "Adds the HTML tags for Emphasized to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 "<EM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 "</EM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
783 (defun hm--html-add-fixed ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
784 "Adds the HTML tags for Fixed."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
785 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
786 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
787 "<TT>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
788 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
789 "</TT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
790
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
791
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 (defun hm--html-add-fixed-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 "Adds the HTML tags for Fixed to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 "<TT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 "</TT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
801 (defun hm--html-add-keyboard ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
802 "Adds the HTML tags for Keyboard."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
803 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
804 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
805 "<KBD>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
806 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
807 "</KBD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
808
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
809
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 (defun hm--html-add-keyboard-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 "Adds the HTML tags for Keyboard to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 "<KBD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 "</KBD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
819 (defun hm--html-add-sample ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
820 "Adds the HTML tags for Sample."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
821 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
822 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
823 "<SAMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
824 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
825 "</SAMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
826
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (defun hm--html-add-sample-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 "Adds the HTML tags for Sample to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 "<SAMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 "</SAMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
836 (defun hm--html-add-strong ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
837 "Adds the HTML tags for Strong."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
838 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
839 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
840 "<STRONG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
841 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
842 "</STRONG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
843
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
844
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (defun hm--html-add-strong-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 "Adds the HTML tags for Strong to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 "<STRONG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 "</STRONG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
854 (defun hm--html-add-variable ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
855 "Adds the HTML tags for Variable."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
856 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
857 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
858 "<VAR>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
859 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
860 "</VAR>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
861
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (defun hm--html-add-variable-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 "Adds the HTML tags for Variable to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 "<VAR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 "</VAR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (defun hm--html-add-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 "Adds the HTML tags for Comment at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (defun hm--html-add-comment-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 "Adds the HTML tags for Comment to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
889 (defun hm--html-add-document-division (alignment)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
890 "Adds the HTML tags for document division at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
891 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
892 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
893 (concat "<DIV ALIGN=\"" alignment "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
894 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
895 "</DIV>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
896
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
897
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
898 (defun hm--html-add-document-division-to-region ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
899 "Adds the HTML tags for document division to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
900 (interactive (list (hm--html-read-alignment "Alignment of the division: ")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
901 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
902 (concat "<DIV ALIGN=\"" alignment "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
903 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
904 "</DIV>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
905
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (defun hm--html-add-preformated ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 "Adds the HTML tags for preformated text at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 (defun hm--html-add-preformated-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 "Adds the HTML tags for preformated text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
925 (defun hm--html-add-plaintext ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
926 "Adds the HTML tags for plaintext."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
927 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
928 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
929 "<XMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
930 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
931 "</XMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
932
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
933
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (defun hm--html-add-plaintext-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 "Adds the HTML tags for plaintext to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 "<XMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 "</XMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
943 (defun hm--html-add-blockquote ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
944 "Adds the HTML tags for blockquote."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
945 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
946 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
947 "<BLOCKQUOTE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
948 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
949 "</BLOCKQUOTE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
950
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
951
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 (defun hm--html-add-abstract ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 "Adds the HTML tags for abstract text at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 (defun hm--html-add-abstract-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 "Adds the HTML tags for abstract text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (hm--html-add-tags 'hm--html-insert-start-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
983 "<STRIKE>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 'hm--html-insert-end-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
985 "</STRIKE>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 "<S>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 "</S>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (defun hm--html-add-quote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 "Adds the HTML tags for Quote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 (defun hm--html-add-quote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 "Adds the HTML tags for Quote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 (defun hm--html-add-person ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 "Adds the HTML tags for Person at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 (defun hm--html-add-person-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 "Adds the HTML tags for Person to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 (defun hm--html-add-instance ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 "Adds the HTML tags for Instance at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 (defun hm--html-add-instance-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 "Adds the HTML tags for Instance to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 (defun hm--html-add-publication ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 "Adds the HTML tags for Publication at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (defun hm--html-add-publication-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 "Adds the HTML tags for Publication to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (defun hm--html-add-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 "Adds the HTML tags for Author at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 (defun hm--html-add-author-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 "Adds the HTML tags for Author to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 (defun hm--html-add-editor ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 "Adds the HTML tags for Editor at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 (defun hm--html-add-editor-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 "Adds the HTML tags for Editor to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 (defun hm--html-add-credits ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 "Adds the HTML tags for Credits at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 (defun hm--html-add-credits-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 "Adds the HTML tags for Credits to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (defun hm--html-add-copyright ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 "Adds the HTML tags for Copyright at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 (defun hm--html-add-copyright-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 "Adds the HTML tags for Copyright to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 (defun hm--html-add-isbn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 "Adds the HTML tags for ISBN at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (defun hm--html-add-isbn-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 "Adds the HTML tags for ISBN 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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 (defun hm--html-add-acronym ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 "Adds the HTML tags for Acronym at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 (defun hm--html-add-acronym-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 "Adds the HTML tags for Acronym to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 (defun hm--html-add-abbrevation ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 "Adds the HTML tags for Abbrevation at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 "</ABBREV>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 (defun hm--html-add-abbrev-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 "Adds the HTML tags for Abbrev to the region."
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 "</ABBREV>"))
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-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 "Adds the HTML tags for Command at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 (defun hm--html-add-command-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 "Adds the HTML tags for Command to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 (defun hm--html-add-argument ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 "Adds the HTML tags for Argument at the point in the current buffer."
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-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 (defun hm--html-add-argument-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 "Adds the HTML tags for Argument to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (defun hm--html-add-literature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 "Adds the HTML tags for Literature at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 (defun hm--html-add-literature-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 "Adds the HTML tags for Literature to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (defun hm--html-add-footnote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 "Adds the HTML tags for Footnote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (defun hm--html-add-footnote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 "Adds the HTML tags for Footnote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 (defun hm--html-add-margin ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 "Adds the HTML tags for Margin at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (defun hm--html-add-margin-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 "Adds the HTML tags for Margin to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1338 (defun hm--html-read-font-size (&optional only-absolute-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1339 "Reads the size for the FONT element.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1340 It returns nil, if the size should not be changed."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1341 (let ((size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1342 (if only-absolute-size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1343 (completing-read "The absolute font size (1 .. 7): "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1344 '(("7") ("6") ("5") ("4") ("3") ("2") ("1"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1345 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1346 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1347 "4")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1348 (completing-read "The relative (+/-) or absolute font size: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1349 '(("-7") ("-6") ("-5") ("-4") ("-3") ("-2") ("-1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1350 ("+7") ("+6") ("+5") ("+4") ("+3") ("+2") ("+1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1351 ("7") ("6") ("5") ("4") ("3") ("2") ("1")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1352 ("use-basefont"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1353 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1354 t
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1355 "use-basefont-size"))))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1356 (if (string= size "use-basefont-size")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1357 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1358 size)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1359
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1360 (defun hm--html-read-font-color ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1361 "Reads the size for the FONT element.
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1362 It returns nil, if the color should not be changed."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1363 (let ((color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1364 (completing-read "The font color: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1365 '(("Black") ("Silver") ("Gray") ("White") ("Maroon")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1366 ("Green") ("Lime") ("Olive") ("Yellow") ("Navy")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1367 ("Red") ("Purple") ("Fuchsia") ("Blue") ("Teal")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1368 ("Aqua") ("dont-set-color"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1369 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1370 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1371 "dont-set-color")))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1372 (if (string= color "dont-set-color")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1373 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1374 color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1375
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1376
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1377 (defun hm--html-add-font (size color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1378 "Adds the HTML tags for Font at the point in the current buffer."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1379 (interactive (list (hm--html-read-font-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1380 (hm--html-read-font-color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1381 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1382 (concat "<FONT"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1383 (if size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1384 (concat " SIZE=" size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1385 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1386 (if color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1387 (concat " COLOR=" color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1388 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1389 ">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1390 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1391 "</FONT>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1392
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1393
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1394 (defun hm--html-add-font-to-region ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1395 "Adds the HTML tags for Font to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1396 (interactive (list (hm--html-read-font-size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1397 (hm--html-read-font-color)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1398 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1399 (concat "<FONT"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1400 (if size
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1401 (concat " SIZE=" size)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1402 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1403 (if color
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1404 (concat " COLOR=" color)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1405 "")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1406 ">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1407 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1408 "</FONT>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1414 (defun hm--html-add-listing ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1415 "Adds the HTML tags for listing."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1416 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1417 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1418 "<LISTING>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1419 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1420 "</LISTING>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1421
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1422
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (defun hm--html-add-listing-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 "Adds the HTML tags for listing to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 "<LISTING>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 "</LISTING>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1431 (defun hm--html-add-center ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1432 "Adds the HTML tags for center at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1433 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1434 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1435 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1436 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1437 "</CENTER>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1438
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1439 (defun hm--html-add-center-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1440 "Adds the HTML tags for center to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1441 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1442 (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
1443 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1444 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1445 "</CENTER>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1447
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1448 (defvar hm--html-mapname-history nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1449 "The history variable for the function `hm--html-read-mapname'.")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1450
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1451 (defun hm--html-read-mapname ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1452 "Reads the name of an image map."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1453 (let ((name (read-string "The name of the image map: "
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1454 (or (car hm--html-mapname-history)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1455 "map")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1456 'hm--html-mapname-history)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1457 name))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1458
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1459 (defun hm--html-add-image-map ()
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1460 "Adds an image and a map element."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1461 (interactive)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1462 (let* ((href (hm--html-read-url "Image URL: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1463 (alt (hm--html-read-altenate href))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1464 (alignment (hm--html-read-alignment
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1465 "Alignment of the image: "))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1466 (mapname (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1467 (hm--html-add-image href alt alignment mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1468 (newline)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1469 (hm--html-add-map mapname)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1470 (call-interactively 'hm--html-add-area)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1471
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1472 (defun hm--html-add-map (name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1473 "Adds the HTML tags for map at the current point."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1474 (interactive (list (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1475 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1476 (concat "<MAP NAME=\"" name "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1477 'hm--html-insert-end-tag
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1478 "</MAP>")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1479 (end-of-line 0))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1480
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1481 (defun hm--html-add-map-to-region (name)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1482 "Adds the HTML tags for map to the region."
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1483 (interactive (list (hm--html-read-mapname)))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1484 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1485 (concat "<MAP NAME=\"" name "\">")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1486 'hm--html-insert-end-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1487 "</MAP>"))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1488
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1489
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 "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
1492 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1498 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1499 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1500 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1508 "</OL>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 "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
1513 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1519 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1520 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1521 " </LI>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1529 "</DIR>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1532 (defun hm--html-add-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1533 "Adds the HTML tags for a (unnumbered) list to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1534 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1535 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1536 "<UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1537 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1538 "</UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1539 'hm--html-insert-start-tag
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1540 "<LI> "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1541 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1542 " </LI>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1543
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1544
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (defun hm--html-add-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 "Adds the HTML tags for a (unnumbered) list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1551 "</UL>"))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1552
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1553
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1554 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1555 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1556 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1557 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1558 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1559 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1560 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1561 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1562 "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1563 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1564 " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1565
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1566
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1573 "</MENU>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1574
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1575
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1576 (defun hm--html-add-description-title-and-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1577 "Adds a definition title and entry.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1578 Assumes we're at the end of a previous entry."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1579 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1580 (hm--html-add-description-title)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1581 (let ((position (point))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1582 (case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1583 (search-forward "</dt>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1584 (hm--html-add-description-entry)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1585 (goto-char position)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1586
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1587
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1588 (defun hm--html-add-description-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1589 "Adds the HTML tags for a description list.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1590 It also inserts a tag for the description title."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1591 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1592 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1593 "<DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1594 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1595 "</DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1596 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1597 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1598 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1599 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1600
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1609 "</DL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1610
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1611 ; 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1612 ; "<DT> "))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 (defun hm--html-add-description-title ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1616 "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
1617 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1618 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1619 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1620 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1621 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1622
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1623
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1624 (defun hm--html-add-description-title-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1625 "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
1626 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1627 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1628 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1629 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1630 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1631
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1632
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1633 (defun hm--html-add-description-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1634 "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
1635 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1637 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1638 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1639 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1640
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1641
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1642 (defun hm--html-add-description-entry-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1643 "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
1644 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1645 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1646 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1647 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1648 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1649
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1650
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1651 (defun hm--html-add-address ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1652 "Adds the HTML tags for an address."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1653 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1654 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1655 "<ADDRESS>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1656 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1657 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1663 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 'hm--html-insert-end-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1665 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 "The signature reference name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 (defun hm--html-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 (concat
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1675 "<A NAME=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 hm--html-signature-reference-name
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1677 "\"\nHREF=\""
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 "\">"))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1680
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1686 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1687 (if (re-search-forward (concat "<address>[ \t\n]*"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1688 "<a[ \t\n]+name=[ \t\n]*\"?"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1689 hm--html-signature-reference-name
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1690 "\"?[ \t\n]+href=[ \t\n]*\"")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1691 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1692 t)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1693 (let ((signature-start (match-beginning 0))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1694 (signature-end (progn
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1695 (re-search-forward "</address>[ \t]*[\n]?"
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1696 nil
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1697 t)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1698 (point))))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1699 (when (yes-or-no-p "Delete the old signature (yes or no) ?")
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1700 (delete-region signature-start signature-end)
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1701 (hm--html-indent-line)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 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
1707 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 (goto-char (point-max))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1710 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1711 (cond ((search-backward "</body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1712 (end-of-line 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1713 (if (> (current-column) 0)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1714 (newline 1)))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1715 ((search-backward "</html>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1716 (end-of-line 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1717 (if (> (current-column) 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1718 (newline 2)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1719 ((> (current-column) 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1720 (newline 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1721 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 (defun hm--html-add-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 "Adds the owner's signature at the end of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 (hm--html-set-point-for-signature)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1734 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1735 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 'hm--html-insert-end-tag
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1737 "</A>\n</ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (error "ERROR: Define your hm--html-signature-file first !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 "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
1748 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 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
1775 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 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
1777 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
1778 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1780 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1781 (cond ((search-forward-regexp "<isindex[^>]*>" nil t) (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1782 ((search-forward-regexp "<head[^>]*>" nil t) (newline))
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1783 ((search-forward-regexp "<html[^>]*>" nil t) (newline))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1784 (t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 (goto-char (point-min))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1792 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1793 (if (search-forward "<title>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1794 (let ((point-after-start-tag (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1795 (if (not (search-forward "</title>" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1796 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1797 (goto-char (- (point) 8))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1798 (delete-backward-char (- (point) point-after-start-tag))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1799 (let ((start (point)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1800 (insert title " (" (hm--date) ")")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1801 (goto-char start))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1802 ;; Noch kein <TITLE> im Buffer vorhanden
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1803 (hm--html-set-point-for-title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1804 (hm--html-add-tags 'hm--html-insert-start-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1805 "<TITLE>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1806 'hm--html-insert-end-tag
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1807 "</TITLE>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1808 'insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1809 (concat title " (" (hm--date) ")"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1810 (forward-char 8)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1811 (newline 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1812 ))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1818 (let ((title (buffer-substring (region-beginning) (region-end)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1819 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (insert title " (" (hm--date) ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 ))))
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 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 "Adds the HTML tags <HTML> and </HTML> in the buffer.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1844 The tag <HTML> will be inserted at the beginning (after the
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1845 <!DOCTYPE ...>, if it is already there.) and </HTML> at the
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1848 (let ((new-cursor-position nil)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1849 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 (error "There is an old tag <HTML> in the current buffer !")
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1854 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1869 The tags will be inserted after <HTML> or at the beginning
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1870 of the file after <DOCTYPE...> (if it is already there).
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1873 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 (goto-char (point-min))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1875 (re-search-forward "<!DOCTYPE[^>]*>[ \t\n]*" nil t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1908 "</HEAD>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 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
1923 (interactive)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1924 (let ((case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 (if (search-backward "</html>" nil t)
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 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (forward-char -1)))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1933 (let ((end-tag-position (set-marker (make-marker) (point))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 (let ((cursor-position (point)))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1941 (goto-char end-tag-position)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<BODY>"
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1949 'hm--html-insert-end-tag-with-newline "</BODY>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 "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
1963 (interactive "sTitle and Header String: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1964 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1965 (hm--html-add-title title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1966 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1967 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1968 (search-forward "</title>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1969 (if (search-forward "</head>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1970 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1971 (search-forward "<body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1972 (newline 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1973 (if (search-forward "<body>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1974 (newline 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1975 (if (string= (what-line) "Line 1")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1976 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1977 (end-of-line)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1978 (newline 1)))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1979 (hm--html-add-header 1 title))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 (defun hm--html-add-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 "Adds the HTML tags for a title and a header to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 (interactive "sTitle and Header String: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1996 (let ((case-fold-search t))
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
1997 (hm--html-add-doctype)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1998 (hm--html-add-html)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
1999 (hm--html-add-head)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2000 (hm--html-add-body)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2001 (hm--html-add-title-and-header title)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2002 (if hm--html-signature-file
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2003 (hm--html-add-signature))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2004 (goto-char (point-min))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2005 (search-forward "</h1>" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2006 (forward-line 1)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2007 (if hm--html-automatic-created-comment
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2008 (hm--html-insert-created-comment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 "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
2013 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 (hm--html-add-title-and-header-to-region)
24
4103f0995bd7 Import from CVS: tag r19-15b95
cvs
parents: 22
diff changeset
2018 (hm--html-add-doctype)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 (hm--html-add-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2027 (defun hm--html-add-link-target-to-region (name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2028 "Adds the HTML tags for a link target to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2029 (interactive "sName: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2030 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2031 (concat "<A NAME=\"" name "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2032 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2033 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2034
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 "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
2037 ; (interactive "sName (or RET for numeric): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 ; (and (string= name "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 ; (setq html-link-counter (1+ html-link-counter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 ; (setq name (format "%d" html-link-counter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 It returns the example extent."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2054 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2055 (if (hm--html-get-example-from-parameter-list parameter-list)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2056 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2057 (search-forward (hm--html-get-example-from-parameter-list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2058 parameter-list))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2059 (let ((extent (make-extent (match-beginning 0)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2060 (match-end 0))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2061 (set-extent-face extent 'hm--html-help-face)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2062 extent)))))
0
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-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 ; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 ; ;; For the Emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 ; (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 ; "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 ;It returns the example extent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 ; (if (hm--html-get-example-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 ; (search-forward (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 ; parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 ; (put-text-property (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 ; (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 ; 'face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 ; 'hm--html-help-face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 ; (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 ; "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 ; t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 (hm--html-write-alist-in-buffer (cdr alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (cdr prefix-list)
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 filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 hm--html-delete-wrong-path-prefix))
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 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
2154 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 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
2158 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 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
2160 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 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
2165 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 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
2171 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 ; (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 ; filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 ; (if (string-match hm--html-delete-wrong-path-prefix filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 ; (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 ; filename)))
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 also nil it returns an empty string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 ; (if (not hm--html-faces-exist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 (make-face 'hm--html-help-face)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2235 (if hm--html-help-foreground
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2236 (set-face-foreground 'hm--html-help-face hm--html-help-foreground))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2237 (if hm--html-help-background
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2238 (set-face-background 'hm--html-help-face hm--html-help-background))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2239 (set-face-font 'hm--html-help-face hm--html-help-font)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 (car parameter-list))
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-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 (car (cdr parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 (defun hm--html-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 path+file-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 construct the link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 (let ((point nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 (let ((html-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 (html-help-buffer (hm--html-generate-add-link-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 (scheme (hm--html-completing-read scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 (hostname:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 (servername:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (path+file (hm--html-read-filename path+file-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 (anchor (hm--html-completing-read anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 (anchor-seperator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367 anchor-parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 (if (not (string= scheme ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 (if (string= hostname:port "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 (setq scheme (concat scheme ":"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 (setq scheme (concat scheme "://"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 (if (and (not (string= hostname:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 (not (string= servername:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 (not (string= (substring servername:port 0 1) "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 (setq servername:port (concat "/" servername:port)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (if (and (not (string= path+file ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (not (string= "/" (substring path+file 0 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 (setq path+file (concat "/" path+file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (if (not (string= anchor ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 (setq anchor (concat anchor-seperator anchor)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 (kill-buffer html-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 (pop-to-buffer html-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 (eval (list function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 ''hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 (concat "<A"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 ; hrefname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 path+file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 ''hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 "</A>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 (setq point (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 (goto-char (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 "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
2403 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 "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
2445 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 "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
2493 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 "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
2499 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 "wais"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 "wais")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 "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
2543 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 "Anchor: "
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 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (defun hm--html-add-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 "Adds the HTML tags for a link to an HTML file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 (hm--html-add-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 "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
2592 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 "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
2688 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 "Subject%20Tree"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 "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
2731 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
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-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740 (let ((alist nil)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2741 (buffername (find-file-noselect proggate-allowed-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2742 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (defun hm--html-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 The function looks at the environment variable NNTPSERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 If this variable exists, it trys to open the file with the Name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 (if (file-exists-p (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 (let ((alist nil)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2897 (buffername (find-file-noselect newsrc-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
2898 (case-fold-search t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2945 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 "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
2953 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 (defun hm--html-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 (defun hm--html-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 (hm--html-add-mail-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 "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
3001 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 (hm--html-add-mail-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 (list ; servername:port
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3026 "Mailaddress: "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3051 (defun hm--html-add-relative-link (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3052 "Adds the HTML tags for a relative link at the current point."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3053 (interactive (list (file-relative-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3054 (read-file-name "Relative Filename: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3055 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3056 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3057 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3058 "")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3059 default-directory)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3060 ))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3061 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3062 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3063 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3064 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3065 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3066 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3067
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3068 (defun hm--html-add-relative-link-to-region (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3069 "Adds the HTML tags for a relative link to the region."
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3070 (interactive (list (file-relative-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3071 (read-file-name "Relative Filename: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3072 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3073 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3074 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3075 ""))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (concat "<A HREF=\""
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3078 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3079 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3080 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3081 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3082
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3083 (defun hm--html-add-normal-link (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3084 "Adds the HTML tags for a normal general link.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3085 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3086 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3087 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3088 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3089 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3090 link-object
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3091 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3092 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3093 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3094
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3095 (defun hm--html-add-normal-link-to-region (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3096 "Adds the HTML tags for a normal general link to region.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3097 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3098 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3099 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3100 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3101 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3102 ; (read-string "Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3103 link-object
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 (read-string "Node Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 "Hook function which updates the date in the title line, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 'hm--html-automatic-new-date' is t and which inserts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (if hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (hm--html-new-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (if hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 (hm--html-insert-changed-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 "\\((\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 "\\([ \t]*[0-3]?[0-9]-[A-Z][a-z][a-z]-[0-9][0-9][0-9][0-9][ \t]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 noerror is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 (if (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 (error "ERROR: Please insert a title in the document !"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 (let ((end-of-title-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 (if (search-forward "<!-- Created by: " end-of-head t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (if (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 "Replace the old comment \"<!-- Created by: \" ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (kill-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (hm--date))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (hm--date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 (defun hm--html-insert-changed-comment-1 (newline username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 "Internal function of 'hm--html-insert-changed-comment'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 Inserts a newline if NEWLINE is t, before the comment is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 USERNAME is the name to be inserted in the comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 ; (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 (insert "Changed by: " username ", " (hm--date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 "The function inserts a \"changed comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 The comment looks like <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 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
3212 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
3213 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 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
3215 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 Attention: Don't change the format of the lines and don't write anything
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 else in such a line !"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228 (username (or hm--html-username (user-full-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 (goto-char end-of-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 (if (search-backward "<!-- Changed by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 (if (string-match username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 (hm--html-insert-changed-comment-1 nil username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 (if (search-backward "<!-- Created by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 "ERROR: Insert at first a title in the document !"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 (defvar hm--html-template-file-history nil
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3267 "Historyvariable for the template files in the `hm--html-mode'.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 (defun hm--html-insert-template (filename)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3270 "Inserts a templatefile.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3271 It uses `tmpl-insert-template-file' to insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3272 the templates. The variables `tmpl-template-dir-list',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3273 `tmpl-automatic-expand' and `tmpl-history-variable-name' are
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3274 overwritten by `hm--html-template-dir',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3275 `hm--html-automatic-expand-templates' and `hm--html-template-file-history'."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3276 (interactive (list nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3277 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3278 hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3279 (list hm--html-template-dir)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3280 (tmpl-automatic-expand hm--html-automatic-expand-templates)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3281 (tmpl-history-variable-name 'hm--html-template-file-history))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3282 (if filename
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3283 (tmpl-insert-template-file filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3284 (call-interactively 'tmpl-insert-template-file))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3285 ; (if hm--html-automatic-created-comment ; better in the template files
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3286 ; (hm--html-insert-created-comment t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3287 ))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3288
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3289 (defun hm--html-insert-template-from-fixed-dirs (filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3290 "Inserts a templatefile.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3291 It uses `tmpl-insert-template-file-from-fixed-dirs' to insert
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3292 the templates. The variables `tmpl-template-dir-list',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3293 `tmpl-automatic-expand', `tmpl-filter-regexp' and
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3294 `tmpl-history-variable-name' are overwritten by
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3295 `hm--html-template-dir', `hm--html-automatic-expand-templates',
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3296 `hm--html-template-filter-regexp' and `hm--html-template-file-history'."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3297 (interactive (list nil))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3298 (let ((tmpl-template-dir-list (if (listp hm--html-template-dir)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3299 hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3300 (list hm--html-template-dir)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3301 (tmpl-automatic-expand hm--html-automatic-expand-templates)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3302 (tmpl-filter-regexp hm--html-template-filter-regexp)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3303 (tmpl-history-variable-name 'hm--html-template-file-history))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3304 (if filename
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3305 (tmpl-insert-template-file-from-fixed-dirs filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3306 (call-interactively 'tmpl-insert-template-file-from-fixed-dirs))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3307 ; (if hm--html-automatic-created-comment ; better in the template files
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3308 ; (hm--html-insert-created-comment t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3309 ))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3310
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3311 ;(defun hm--html-insert-template (filename)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3312 ; "Inserts a templatefile."
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3313 ; (interactive
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3314 ; (list (tmpl-read-template-filename hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3315 ; hm--html-automatic-expand-templates
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3316 ; hm--html-template-filter-regexp
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3317 ; 'hm--html-template-file-history)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3318 ; (interactive (list
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3319 ; (let ((file-name-history hm--html-template-file-history))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3320 ; (read-file-name "Templatefile: "
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3321 ; hm--html-template-dir
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3322 ; nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3323 ; t
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3324 ; nil))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3325 ;; 'hm--html-template-file-history)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3326 ; (insert-file (expand-file-name filename))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3327 ; (if hm--html-automatic-expand-templates
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3328 ; (tmpl-expand-templates-in-buffer))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3329 ; (if hm--html-automatic-created-comment
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3330 ; (hm--html-insert-created-comment t)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 ;;; Functions for highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 ;(defun hm--html-toggle-use-highlighting ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 ; "Toggles the variable html-use-highlighting."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 ; (if html-use-highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 ; (setq html-use-highlighting nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 ; (setq html-use-highlighting t)))
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 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3346 (if (adapt-emacs19p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 ;; (setq font-lock-doc-string-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 ;(defun hm--html-set-font-lock-color ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 ; "Sets the color for the font lock mode in HTML mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 ;This color is used to highlight HTML expressions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 ; (setq hm--html-font-lock-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 ; (completing-read "Color: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370 ; '(("grey80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371 ; ("black")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 ; ("red")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 ; ("yellow")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 ; ("blue"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375 ; nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376 ; nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 ; "black"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 ; (set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 ; (set-face-foreground 'font-lock-string-face hm--html-font-lock-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 ;;; Functions which determine if an active region exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 ;(defvar hm--region-active nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385 ; "t : Region is active.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 ;nil: Region is inactive.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 ;(defun hm--set-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 ; (setq hm--region-active t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 ;(defun hm--unset-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 ; (setq hm--region-active nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 '(("POST") ("GET"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 action
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 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 (read-string "Symbolic name: " last-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3494 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3502 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3503 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 (defun hm--html-form-add-input (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3519 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3520 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3526 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535 ">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3548 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3549 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3556 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3558 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3566 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3567 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3570 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3571 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3573
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3574 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3575 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3576 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3577 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3578 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3579 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3580 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3588 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3589 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3592 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3593 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3594 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3595 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3596 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3597 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3598 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3601 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3603 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3604 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3605 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3606 (hm--html-form-add-input "checkbox" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3609 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3610 "Name of the last radio button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3613 (defun hm--html-form-add-input-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3614 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3615 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3616 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3617 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3618 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3619 (hm--html-form-add-input "radio" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3622 (defun hm--html-form-add-input-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3623 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3624 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3625 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3626 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3627 (hm--html-form-add-input "submit" nil value nil nil nil))
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-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3631 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3632 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3633 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3634 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3635 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3636 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3637 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3638 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3639 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3640 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3641 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3642 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3643 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3644 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3645 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3652 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3653 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3654 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3655 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3656 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3657 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3658 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3659 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3660 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3661 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3662 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3663 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3664 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3665 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3666 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3667 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3668 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3669 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3672 (defun hm--html-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3673 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3674 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3675 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3676 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3677 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3680 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3681 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3682 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3683 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3684 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3685 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3686 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3687 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3688 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3689 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3692 (defun hm--html-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3693 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3694 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3695 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3696 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3697 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3698 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3699 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3700 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3702
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3703 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3704 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3705 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3706 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3707 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3708 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3709 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3710 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3711 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3712 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3713 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3714 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3715 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3716 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3717 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3718 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3719 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3722 (defun hm--html-form-add-select-option (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3723 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3724 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3725 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3726 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3727 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3728 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3731 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3732 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3733 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3734 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3735 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3736 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3737 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745 "</TEXTAREA>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753 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
3754 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3767 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3768 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769 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
3770 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3773 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3775 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3780
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783 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
3784 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3788 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3792
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-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 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
3797 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3817 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842 (defun hm--html-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3851 (concat "<TR>"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3852 (mapconcat '(lambda (entry)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3853 (concat "<TH" entry))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3854 (hm--html-table-read-cell-entries-and-alignments
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3855 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3856 no-of-cells)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3857 " </TH>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3858 " </TH></TR>")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3859
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3870 (concat "<TR><TD"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3871 (car (hm--html-table-read-cell-entries-and-alignments 1 1))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3872 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873 (if (<= no-of-cells 1)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3874 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879 2 no-of-cells)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3880 " </TD>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3881 " </TD></TR>")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882
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-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3885 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3889 (let* ((point-of-view (point))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3890 (case-fold-search t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3891 (end-of-last-row (search-backward "</tr>" (point-min) t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3892 (begin-of-last-row (progn (search-backward "<tr" (point-min) t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3893 (re-search-forward "<t[dh]"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3894 point-of-view t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3895 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 (alignment-list nil))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3897 (goto-char begin-of-last-row)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3898 (if (not (re-search-forward "<t[dh]" end-of-last-row t))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3899 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3900 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3902 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3903 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3904 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3905 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3907 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3908 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3909 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3910 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3912 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3913 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3914 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3915 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3917 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3918 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924 from existing rows of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3927 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3928 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3929 'hm--html-insert-end-tag-with-newline
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3930 (concat "<TR><TD" (car (hm--html-table-read-cell-entries-and-alignments
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3931 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3932 1
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3933 old-alignment-list))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3934 " </TD>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 (if (<= no-of-cells 1)
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3936 "</TR>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3937 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3940 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3942 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943 (cdr old-alignment-list))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3944 " </TD>")
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
3945 " </TD></TR>"))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3948 (defun hm--html-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3949 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3950 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3951 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3952 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3957 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3958 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3959 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3962 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3966 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3967 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3968 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3969 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3970 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3971 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3972 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3973 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3976 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3977 "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
3978 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3979 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3980 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3981 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3982 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3983 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3984 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3985 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3986 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989 "<TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3990
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992 (defun hm--html-add-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993 "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
3994 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3995 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3996 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3997 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3998 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3999 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4000 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4001 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4002 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4003 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4004 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4005 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4008 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4009 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4010 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4011 (interactive "NNo of columns, spaned by this cell: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4012 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4013 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4014 (if (and (search-backward "<" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4015 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4016 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4017 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4018 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4019 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4020 (delete-region (match-beginning 2) (match-end 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4021 (insert (format "\"%d\"" columns)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4022 (insert (format " colspan=\"%d\"" columns)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4023 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4026 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4027 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4028 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4029 (interactive "NNo of rows, spaned by this cell: ")
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4030 (let ((case-fold-search t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4031 (save-excursion
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4032 (if (and (search-backward "<" nil t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4033 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4034 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4035 nil
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4036 t)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4037 (progn
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4038 (delete-region (match-beginning 2) (match-end 2))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4039 (insert (format "\"%d\"" rows)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4040 (insert (format " rowspan=\"%d\"" rows)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4041 (error "ERROR: Point not in a table cell!")))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4042
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4044 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4045 ;(setq buffer-invisibility-spec '(hm--html-iso-entity-invisible-flag))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4046
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4047 ;(defvar hm--html-iso-entity-invisible-flag t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4048 ; "Controls the visibility of the iso entities.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4049
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4050 ;(defvar hm--html-iso-glyph-invisible-flag nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4051 ; "Controls the visibility of the iso character glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4052
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4053 ;(defvar hm--html-glyph-cache nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4054 ; "Internal variable. An assoc list with the already created glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4055
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4056 ;(defun hm--html-create-glyph (string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4057 ; "Creates a glyph from the string or returns an existing one.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4058 ;The glyph is stored in `hm--html-glyph-cache'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4059 ; (if nil ;(assoc string hm--html-glyph-cache)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4060 ; (cdr (assoc string hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4061 ; (let ((glyph (make-glyph string)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4062 ; (setq hm--html-glyph-cache (cons (cons string glyph)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4063 ; hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4064 ; glyph)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4065
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4066 ;(defun hm--html-attach-glyph-to-region (start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4067 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4068 ; string
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4069 ; region-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4070 ; glyph-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4071 ; "Make the region invisible and attach a glyph STRING.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4072 ;The invisible flags could be used, to toggle the visibility."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4073 ; (mapcar 'delete-annotation (annotations-at end)) ; delete old anotations
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4074 ; ;; delete old extents
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4075 ; (let ((extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4076 ; (annotation nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4077 ; (set-extent-property extent 'invisible region-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4078 ; (set-extent-property extent 'end-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4079 ; (set-extent-property extent 'start-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4080 ; (set-extent-property extent 'intangible t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4081 ; (setq annotation (make-annotation "Hallo Du da" ;(hm--html-create-glyph string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4082 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4083 ; 'text))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4084 ; (goto-char end)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4085
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4086
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4087 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4088 ; "Inserts an iso char as html ENTITY and displays a glyph.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4089 ;The glyph is created from the string CHAR."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4090 ; (let ((start (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4091 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4092 ; (hm--html-attach-glyph-to-region start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4093 ; (point)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4094 ; char
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4095 ; 'hm--html-iso-entity-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4096 ; 'hm--html-iso-glyph-invisible-flag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4097
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4098 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4099 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4100 ; (hm--html-insert-iso-char-as-entity-and-glyph "ü" "&uuml;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4101
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4102
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4103 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4104 ; (let ((start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4105 ; (end nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4106 ; (extent nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4107 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4108 ; (setq end (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4109 ; (setq extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4110 ; (set-extent-begin-glyph extent char)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4111 ; (set-extent-property extent 'invisible t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4112
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4113 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4114 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4115 ; (hm--html-insert-iso-char-as-entity-and-glyph ?ü "&uuml;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4118 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4123 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4124 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4125 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4128 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4129 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4130 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4133 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4134 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4135 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4137 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4138 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4140 (insert "&Uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142 (defun hm--html_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4143 "Insert the character 'Oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4144 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4145 (insert "&Ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4147 (defun hm--html_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4148 "Insert the character 'Ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4149 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4150 (insert "&Auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4152 (defun hm--html_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4153 "Insert the character 'Aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4154 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4155 (insert "&Aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4157 (defun hm--html_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4158 "Insert the character 'sz'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4159 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4160 (insert "&szlig;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4162 (defun hm--html_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4163 "Insert the character 'aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4164 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4165 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4167 (defun hm--html_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 "Insert the character 'eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 (defun hm--html_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 "Insert the character 'iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4175 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4177 (defun hm--html_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4178 "Insert the character 'oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4180 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4182 (defun hm--html_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4183 "Insert the character 'uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4184 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4185 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4187 (defun hm--html_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4188 "Insert the character 'Aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4189 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4190 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4192 (defun hm--html_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4193 "Insert the character 'Eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4194 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4195 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4197 (defun hm--html_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4198 "Insert the character 'Iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4199 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4200 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4202 (defun hm--html_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4203 "Insert the character 'Oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4204 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4205 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4207 (defun hm--html_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4208 "Insert the character 'Uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4209 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4210 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4212 (defun hm--html_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4213 "Insert the character 'agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4214 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4215 (insert "&agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4217 (defun hm--html_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4218 "Insert the character 'egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4219 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4220 (insert "&egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4222 (defun hm--html_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4223 "Insert the character 'igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4224 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4225 (insert "&igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4227 (defun hm--html_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4228 "Insert the character 'ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4229 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4230 (insert "&ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4232 (defun hm--html_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4233 "Insert the character 'ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4234 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4235 (insert "&ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4237 (defun hm--html_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4238 "Insert the character 'Agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4239 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4240 (insert "&Agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4242 (defun hm--html_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4243 "Insert the character 'Egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4244 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4245 (insert "&Egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4247 (defun hm--html_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4248 "Insert the character 'Igrave'."
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 (insert "&Igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4252 (defun hm--html_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4253 "Insert the character 'Ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4254 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4255 (insert "&Ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4257 (defun hm--html_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4258 "Insert the character 'Ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4259 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4260 (insert "&Ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4262 (defun hm--html_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4263 "Insert the character 'ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4264 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4265 (insert "&ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4267 (defun hm--html_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4268 "Insert the character 'Ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4269 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4270 (insert "&Ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4272 (defun hm--html_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4273 "Insert the character 'atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4274 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4275 (insert "&atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4277 (defun hm--html_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4278 "Insert the character 'otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4279 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4280 (insert "&otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4282 (defun hm--html_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4283 "Insert the character 'ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4284 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4285 (insert "&ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4287 (defun hm--html_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4288 "Insert the character 'Atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4289 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4290 (insert "&Atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4292 (defun hm--html_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4293 "Insert the character 'Otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4294 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4295 (insert "&Otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4297 (defun hm--html_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4298 "Insert the character 'Ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4299 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4300 (insert "&Ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4302 (defun hm--html_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4303 "Insert the character 'acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4304 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4305 (insert "&acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4306
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4307 (defun hm--html_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4308 "Insert the character 'ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4309 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4310 (insert "&ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4312 (defun hm--html_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4313 "Insert the character 'icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4314 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4315 (insert "&icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4317 (defun hm--html_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4318 "Insert the character 'ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4319 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4320 (insert "&ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4322 (defun hm--html_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4323 "Insert the character 'ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4324 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4325 (insert "&ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4327 (defun hm--html_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4328 "Insert the character 'Acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4329 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4330 (insert "&Acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4332 (defun hm--html_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4333 "Insert the character 'Ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4334 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4335 (insert "&Ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4336
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4337 (defun hm--html_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4338 "Insert the character 'Icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4339 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4340 (insert "&Icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4342 (defun hm--html_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4343 "Insert the character 'Ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4344 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4345 (insert "&Ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4347 (defun hm--html_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4348 "Insert the character 'Ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4349 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4350 (insert "&Ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4352 (defun hm--html_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4353 "Insert the character 'ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4354 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4355 (insert "&euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4357 (defun hm--html_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4358 "Insert the character 'idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4359 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4360 (insert "&iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4362 (defun hm--html_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4363 "Insert the character 'Ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4364 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4365 (insert "&Euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4367 (defun hm--html_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4368 "Insert the character 'Idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4369 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4370 (insert "&Iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4372 (defun hm--html_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4373 "Insert the character 'thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4374 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4375 (insert "&thorn;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4377 (defun hm--html_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4378 "Insert the character 'Thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4379 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4380 (insert "&THORN;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4381
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4382 (defun hm--html_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4383 "Insert the character 'eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4384 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4385 (insert "&eth;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4387 (defun hm--html_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4388 "Insert the character 'Eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4389 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4390 (insert "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4393 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4394 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4395 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4397 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4398 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4399
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4400 (defun hm--html-less-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4401 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4402 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4403 (insert "&lt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4404
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4405 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4406 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4407 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4408 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4409 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4410 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4411 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4412 (hm--html-less-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4413 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4414 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4415 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4417 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4418 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4419
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4420 (defun hm--html-greater-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4421 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4422 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4423 (insert "&gt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4424
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4425 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4426 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4427 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4428 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4429 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4430 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4431 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4432 (hm--html-greater-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4433 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4434 (insert ?>)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4435 (setq hm--just-insert-greater-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4437
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4438 (defvar hm--just-insert-ampersand nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4439 "Internal variable.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4440
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4441 (defun hm--html-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4442 "Inserts the entity '&amp;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4443 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4444 (insert "&amp;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4445
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4446 (defun hm--html-smart-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4447 "Insert a '&' or the entity '&amp;' if you execute this command twice."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4448 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4449 (if (and (eq last-command 'hm--html-smart-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4450 hm--just-insert-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4451 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4452 (delete-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4453 (hm--html-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4454 (setq hm--just-insert-ampersand nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4455 (insert ?&)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4456 (setq hm--just-insert-ampersand t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4457
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4458
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4459 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4460 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4461 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4463 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4464 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4465 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4466 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
4467 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4468 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4469 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4470 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4471 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4472 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4473 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4474 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4475 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4476 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4477 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4478 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4482 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4483 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4484 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4486 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4487 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4488 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4489 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4490 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4491 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4492 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4493 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4495 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4496 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4497 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4498 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4499 (w3-fetch "http://www.tnt.uni-hannover.de:80/data/info/www/tnt/soft/info/www/html-editors/hm--html-menus/overview.html"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4501 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4502 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4503 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4505 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4506 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4507 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4508 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4509 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4510 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4511 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4512 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4513 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4514 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4515 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4516 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4517 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4518 'hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4519 'hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4520 'hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4521 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4522 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4523 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4524 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4525 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4526 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4527 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4528 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4529 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4530 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4531 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4532 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4533 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4534 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4535 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4536 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4537 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4538 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4539 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4540 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4541 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4542 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4543 'hm--html-menu-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4544 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4545 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4546 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4547 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4548 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4549 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4550 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4551 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4552 'hm--html-user-config-file
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4553 'hm--html-site-config-file
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4554 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4555 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4556 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4557 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4558 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4559 'hm--html-wais-servername:port-default
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4560 ; 'html-deemphasize-color
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4561 'html-document-previewer
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4562 ; 'html-document-previewer-args
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4563 ; 'html-emphasize-color
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4564 ; 'html-quotify-hrefs-on-find
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4565 'hm--html-region-mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4566 'html-sigusr1-signal-value
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4567 ; 'html-use-font-lock
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4568 ; 'html-use-highlighting
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4569 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4570 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4571 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4572 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4573 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4576 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4577 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4578 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4580 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4581 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4582
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4583 (add-hook 'zmacs-activate-region-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4584 'hm--html-switch-region-modes-on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4585 ; (function (lambda () (hm--html-region-mode 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4587 (add-hook 'zmacs-deactivate-region-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4588 'hm--html-switch-region-modes-off)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4589 ; (function (lambda () (hm--html-region-mode -1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4591 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4593 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4595 (add-hook 'activate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4596 'hm--html-switch-region-modes-on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4597 ; (function (lambda () (hm--html-region-mode t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4599 (add-hook 'deactivate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4600 'hm--html-switch-region-modes-off)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4601 ; (function (lambda () (hm--html-region-mode nil))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4603 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4605
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4606 ;(add-hook 'hm--html-mode-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4607 ; (function
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4608 ; (lambda ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4609 ; (make-variable-buffer-local 'write-file-hooks)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4610 ; (add-hook 'write-file-hooks
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4611 ; 'hm--html-maybe-new-date-and-changed-comment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4612
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4613 ;(add-hook 'zmacs-activate-region-hook 'hm--set-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4614 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4615 ;(add-hook 'zmacs-deactivate-region-hook 'hm--unset-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4619 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4620 ; Environment loading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4621 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4623 (defun hm--html-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4624 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4625 First, the system config file (detemined by the environment variable
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4626 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4627 At second a site config file is loaded, if the environment variable
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4628 HTML_SITE_CONFIG_FILE or the lisp variable `hm--html-site-config-file'
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4629 is set to such a file.
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4630 At least the user config file (determined by the environment variable
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4631 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4632 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
4633 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4634 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4635 `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
4636 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
4637 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4638 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4639 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4640 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4641 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4642 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4643 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4644 (load-library "hm--html-configuration"))
22
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4645
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4646 ;; at second the site config file
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4647 (if (and (stringp (getenv "HTML_SITE_CONFIG_FILE"))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4648 (file-exists-p
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4649 (expand-file-name
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4650 (getenv "HTML_SITE_CONFIG_FILE"))))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4651 (load-file (expand-file-name (getenv "HTML_SITE_CONFIG_FILE")))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4652 (when (and (boundp 'hm--html-site-config-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4653 (stringp hm--html-site-config-file)
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4654 (file-exists-p (expand-file-name hm--html-site-config-file)))
8fc7fe29b841 Import from CVS: tag r19-15b94
cvs
parents: 2
diff changeset
4655 (load-file (expand-file-name hm--html-site-config-file))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4657 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4658 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4659 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4660 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4661 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4662 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4663 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4664 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4665 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4666 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4667 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4668 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4669 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4670 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4671 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4672 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4673 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4674 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4675 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4676
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4679 ;(hm--html-load-config-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4681 ;;; Definition of the minor mode html-region-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4682
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4683 ;(defvar html-region-mode nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4684 ; "*t, if the minor mode html-region-mode is on and nil otherwise.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4685
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4686 ;(make-variable-buffer-local 'html-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4687
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4688 ;(defvar html-region-mode-map nil "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4689
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4690 ;(hm--html-load-config-files)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4691
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4692 ;(if hm--html-use-old-keymap
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4693 ; (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4694
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4695 ;;(setq minor-mode-alist (cons '(html-region-mode " Region") minor-mode-alist))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4696 ;(or (assq 'html-region-mode minor-mode-alist)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4697 ; (setq minor-mode-alist
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4698 ; (purecopy
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4699 ; (append minor-mode-alist
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4700 ; '((html-region-mode " Region"))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4701
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4702 ;(defun html-region-mode (on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4703 ; "Turns the minor mode html-region-mode on or off.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4704 ;The function turns the html-region-mode on, if ON is t and off otherwise."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4705 ; (if (string= mode-name "HTML")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4706 ; (if on
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4707 ; ;; html-region-mode on
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4708 ; (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4709 ; (setq html-region-mode t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4710 ; (use-local-map html-region-mode-map))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4711 ; ;; html-region-mode off
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4712 ; (setq html-region-mode nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4713 ; (use-local-map html-mode-map))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4714
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4715 ;))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4721 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4722 ; Set font lock color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4723 ; (hm--html-font-lock-color should be defined in hm--html-configuration.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4724 ; oder .hm--html-configuration.el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4725 ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4726 ;(require 'font-lock)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4727 ;(load-library "font-lock")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4728 ;(set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4730
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4731 ;(hm--html-generate-help-buffer-faces)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4734
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4736 ;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4737 ;(setq hm--html-hostname-search-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4738 ; "[-a-zA-Z0-9]*\\.[-a-zA-Z0-9]*\\.[-a-zA-Z0-9.]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4739 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4740 ;(defun hm--html-get-next-hostname ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4741 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4742 ; (search-forward-regexp hm--html-hostname-search-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4743 ; (buffer-substring (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4744 ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4745
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4746 ;;; Announce the feature hm--html-configuration
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4747
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4748 ;;; quotify href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4749
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4750 (defvar hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4751 "<[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
4752 "Regular expression used for searching hrefs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4753
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4754 (defun hm--html-quotify-hrefs ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4755 "Insert quotes around all HREF and NAME attribute value literals.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4756
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4757 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
4758 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
4759
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4760 Look also at the variable `hm--html-quotify-href-regexp'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4761 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4762 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4763 (goto-char (point-min))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4764 (while
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4765 (re-search-forward hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4766 (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4767 t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4768 (cond
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4769 ((null (looking-at "\""))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4770 (insert "\"")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4771 (re-search-forward "[ \t\n>]" (point-max) t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4772 (forward-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4773 (insert "\""))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4774
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4775
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4776
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4777 (provide 'hm--html)