annotate lisp/hm--html-menus/hm--html.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children ac2d302a0011
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; hm--html.el:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; v6.00; 17 Feb 1996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;; Copyright (C) 1993, 1994, 1995, 1996 Heiko Muenkel
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (provide 'hm--html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (require 'hm--date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (require 'adapt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defconst hm--html-menus-package-maintainer "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (defconst hm--html-menus-package-name "hm--html-menus")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defconst hm--html-menus-package-version "4.16")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;; Functions for adding html commands which consists of a start and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; end tag and some text between them. (Basicfunctions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defun hm--html-add-tags (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 &optional function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 &optional end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 &optional function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 &optional middle-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "Adds the start and the end html tag at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 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
57 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
58 The fifth parameter is optional. If it exists, it specifies a function which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 inserts the sixth parameter (the middle-tag) between the start and the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ; (interactive "aFunction, which adds the HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;aFunction, which adds the HTML end tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;sThe HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;sThe HTML end tag: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (eval (list function-insert-start-tag start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (if function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (eval (list function-insert-middle-tag middle-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (if function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (let ((position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (eval (list function-insert-end-tag end-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (goto-char position))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (defun hm--html-add-tags-to-region (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 &optional function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 &optional middle-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 "Adds the start and the end html tag to the active region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 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
84 is the string for the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 The fifth parameter is optional. If it exists, it specifies a function which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 inserts the sixth parameter (the middle-tag) between the start and the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ; (interactive "aFunction, which adds the html start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;aFunction, which adds the html end tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;sThe HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;sThe HTML end tag: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (let ((start (region-beginning))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (eval (list function-insert-end-tag end-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (eval (list function-insert-start-tag start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (if function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (eval (list function-insert-middle-tag middle-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (defun hm--html-insert-start-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 "Inserts the HTML start tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 The parameter must be a string (i.e. \"<B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (insert tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (html-maybe-deemphasize-region start (- (point) 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (defun hm--html-insert-end-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 "Inserts the HTML end tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 The parameter must be a string (i.e. \"</B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (insert tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (html-maybe-deemphasize-region start (- (point) 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (defun hm--html-insert-start-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 "Inserts the HTML start tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 The parameter must be a string (i.e. \"<PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (insert tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (html-maybe-deemphasize-region start (- (point) 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (insert "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (defun hm--html-insert-end-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 "Inserts the HTML end tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 The parameter must be a string (i.e. \"</PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 (insert tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (html-maybe-deemphasize-region start (- (point) 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;;; Functions which add simple tags of the form <tag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (defun hm--html-add-line-break ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 "Adds the HTML tag for a line break."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (hm--html-add-tags 'hm--html-insert-start-tag "<BR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (defun hm--html-add-horizontal-rule ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "Adds the HTML tag for a horizontal rule (line)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (hm--html-add-tags 'hm--html-insert-start-tag "<HR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (defun hm--html-add-paragraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 "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
155 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (defun hm--html-add-paragraph-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "Adds the HTML tags for a paragraph to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defun hm--html-add-paragraph-separator ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 "Adds the tag for a paragraph seperator."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (hm--html-add-tags 'hm--html-insert-start-tag "<P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ;;; Functions which include something in HTML- documents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (defvar hm--html-url-history-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 "History list for the function 'hm--html-read-url'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (defun hm--html-read-url-predicate (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 "Predicatefunction for hm--html-read-url."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (hm--html-read-url-predicate-1 (cdr table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (defun hm--html-read-url-predicate-1 (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "Internal function of hm--html-read-url-predicate."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (cond ((not table-element-list) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 ((eq (car table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (t (hm--html-read-url-predicate-1 (cdr table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 usagesymbol))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defun hm--html-read-url (prompt &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 "Function prompts for a URL string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 TABLE is an alist whose elements' cars are URL's.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 PREDICATE limits completion to a subset of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 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
206 the input is (or completes to) an element of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 INITIAL-CONTENTS is a string to insert in the minibuffer before reading.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 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
209 is used instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (if table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (completing-read prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 hm--html-url-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (read-string prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (if initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (car hm--html-url-history-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 hm--html-url-history-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (defun hm--html-read-altenate (url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 "Function reads the value for the \"ALT\"- attribute in IMG tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 URL will be used as the default URL for the external viewer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (let ((alttype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ; "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text, 3: ALT=External Viewer: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 ; '(("0") ("1") ("2") ("3"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 '(("0") ("1") ("2"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 "2"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (cond ((= alttype 0) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ((= alttype 1) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ((= alttype 2) (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 "Text for the ALT attribute: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (substring (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (string-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 "\\."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (file-name-nondirectory url)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ; ((= alttype 3) (concat "<A HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ; url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ; "\">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ; (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ; "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (defun hm--html-add-image-bottom (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 "Add an image, bottom aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (list url (hm--html-read-altenate url))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (if alt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (insert "<IMG ALIGN=BOTTOM SRC=\"" href "\" ALT=\"" alt "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (insert "<IMG ALIGN=BOTTOM SRC=\"" href "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (html-maybe-deemphasize-region (1+ start) (1- (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (defun hm--html-add-image-middle (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 "Add an image, middle aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (list url (hm--html-read-altenate url))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (if alt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (insert "<IMG ALIGN=MIDDLE SRC=\"" href "\" ALT=\"" alt "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (insert "<IMG ALIGN=MIDDLE SRC=\"" href "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (html-maybe-deemphasize-region (1+ start) (1- (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (defun hm--html-add-image-top (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 "Add an image, top aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (list url (hm--html-read-altenate url))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (if alt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (insert "<IMG ALIGN=TOP SRC=\"" href "\" ALT=\"" alt "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (insert "<IMG ALIGN=TOP SRC=\"" href "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (html-maybe-deemphasize-region (1+ start) (1- (point)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (defun hm--html-add-server-side-include-file (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 "This function adds a server side include file directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (interactive "FInclude File: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (if (string= file "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (error "ERROR: No filename specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (insert "<INC SRV \"" file "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (html-maybe-deemphasize-region (1+ start) (1- (point))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (defun hm--html-add-server-side-include-command-with-isindex-parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 The include command uses the \"isindex\"- parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (hm--html-add-server-side-include-command command t))
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-add-server-side-include-command (command &optional srvurl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 The directive is only supported by the NCSA http daemon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 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
312 include command. With srvurl, the include command uses the \"isindex\"-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (let ((start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (attribute (if srvurl "SRVURL" "SRV")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (insert "<INC " attribute" \"" command "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (insert "<INC " attribute " \"|" command "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 ;(defun hm--html-add-server-side-include-command-with-parameter (command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 ; parameter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ; "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 ;The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 ; (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 ; (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 ; "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 ; hm--html-server-side-include-command-with-parameter-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 ; (read-string "Parameterlist sepearted by '?': ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 ; (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 ; (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 ; (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 ; (if (string= parameter "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 ; (error "ERROR: No parameter specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ; (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 ; (insert "<INC SRVURL \"" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 ; (insert "<INC SRVURL \"" command "?" parameter "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ; (insert "<INC SRVURL \"|" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 ; (insert "<INC SRVURL \"|" command "?" parameter "\">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 ; (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 ;;; Functions, which adds tags of the form <starttag> ... </endtag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (defun hm--html-add-bold ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 "Adds the HTML tags for Bold at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 (defun hm--html-add-bold-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 "Adds the HTML tags for Bold to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (defun hm--html-add-italic ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 "Adds the HTML tags for Italic at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (defun hm--html-add-italic-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 "Adds the HTML tags for Italic to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (defun hm--html-add-underline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 "Adds the HTML tags for Underline at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (defun hm--html-add-underline-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 "Adds the HTML tags for Underline to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (defun hm--html-add-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 "Adds the HTML tags for Definition at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (defun hm--html-add-definition-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 "Adds the HTML tags for Definition to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (defun hm--html-add-code ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 "Adds the HTML tags for Code at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (defun hm--html-add-code-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 "Adds the HTML tags for Code to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (defun hm--html-add-citation-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 "Adds the HTML tags for Citation to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 "<CITE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 "</CITE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (defun hm--html-add-emphasized-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 "Adds the HTML tags for Emphasized to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 "<EM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 "</EM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (defun hm--html-add-fixed-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 "Adds the HTML tags for Fixed to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 "<TT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 "</TT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (defun hm--html-add-keyboard-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 "Adds the HTML tags for Keyboard to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 "<KBD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 "</KBD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (defun hm--html-add-sample-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 "Adds the HTML tags for Sample to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 "<SAMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 "</SAMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (defun hm--html-add-strong-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 "Adds the HTML tags for Strong to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 "<STRONG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 "</STRONG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (defun hm--html-add-variable-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 "Adds the HTML tags for Variable to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 "<VAR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 "</VAR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (defun hm--html-add-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 "Adds the HTML tags for Comment at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (defun hm--html-add-comment-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 "Adds the HTML tags for Comment to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (defun hm--html-add-preformated ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 "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
528 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (defun hm--html-add-preformated-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 "Adds the HTML tags for preformated text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (defun hm--html-add-plaintext-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 "Adds the HTML tags for plaintext to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 "<XMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 "</XMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (defun hm--html-add-abstract ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 "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
563 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (defun hm--html-add-abstract-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 "Adds the HTML tags for abstract text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 "<S>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 "</S>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 "<S>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 "</S>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634 (defun hm--html-add-quote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 "Adds the HTML tags for Quote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 (defun hm--html-add-quote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 "Adds the HTML tags for Quote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652 (defun hm--html-add-person ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 "Adds the HTML tags for Person at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 (defun hm--html-add-person-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 "Adds the HTML tags for Person to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670 (defun hm--html-add-instance ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 "Adds the HTML tags for Instance at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 (defun hm--html-add-instance-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 "Adds the HTML tags for Instance to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 (defun hm--html-add-publication ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 "Adds the HTML tags for Publication at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 (defun hm--html-add-publication-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 "Adds the HTML tags for Publication to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 (defun hm--html-add-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 "Adds the HTML tags for Author at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 (defun hm--html-add-author-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 "Adds the HTML tags for Author to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 (defun hm--html-add-editor ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 "Adds the HTML tags for Editor at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 (defun hm--html-add-editor-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 "Adds the HTML tags for Editor to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 (defun hm--html-add-credits ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761 "Adds the HTML tags for Credits at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 (defun hm--html-add-credits-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770 "Adds the HTML tags for Credits to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 (defun hm--html-add-copyright ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 "Adds the HTML tags for Copyright at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 (defun hm--html-add-copyright-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 "Adds the HTML tags for Copyright to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 (defun hm--html-add-isbn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 "Adds the HTML tags for ISBN at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 (defun hm--html-add-isbn-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 "Adds the HTML tags for ISBN to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 (defun hm--html-add-acronym ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 "Adds the HTML tags for Acronym at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 (defun hm--html-add-acronym-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 "Adds the HTML tags for Acronym to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 (defun hm--html-add-abbrevation ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 "Adds the HTML tags for Abbrevation at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 "</ABBREV>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 (defun hm--html-add-abbrev-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 "Adds the HTML tags for Abbrev to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 "</ABBREV>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 (defun hm--html-add-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 "Adds the HTML tags for Command at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 (defun hm--html-add-command-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 "Adds the HTML tags for Command to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 (defun hm--html-add-argument ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 "Adds the HTML tags for Argument at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 (defun hm--html-add-argument-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 "Adds the HTML tags for Argument to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 (defun hm--html-add-literature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 "Adds the HTML tags for Literature at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 (defun hm--html-add-literature-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 "Adds the HTML tags for Literature to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 (defun hm--html-add-footnote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 "Adds the HTML tags for Footnote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 (defun hm--html-add-footnote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 "Adds the HTML tags for Footnote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 (defun hm--html-add-margin ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 "Adds the HTML tags for Margin at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 (defun hm--html-add-margin-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 "Adds the HTML tags for Margin to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (defun hm--html-add-listing-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 "Adds the HTML tags for listing to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 "<LISTING>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 "</LISTING>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 "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
957 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 "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
978 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 "<LI> "))
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-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 "Adds the HTML tags for a (unnumbered) list to the region."
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-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 "</UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 "</MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 "</DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 "<DT> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 (defun hm--html-add-description-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 "Adds the HTML tag for a description title at current point in the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 "<DT> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 (defun hm--html-add-only-description-entry ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 "Adds the HTML tag for a description entry at current point in the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 "<DD> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 "<ADDRESS> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 " </ADDRESS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 "The signature reference name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 (defun hm--html-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 hm--html-signature-reference-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 (if (search-forward (concat "<address> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 "<a name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 hm--html-signature-reference-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 " href=\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 (let ((signature-start (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 (signature-end (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 (search-forward "</address>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (if (yes-or-no-p "Delete the old signature (yes or no) ?")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 (delete-region signature-start signature-end))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 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
1089 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 (cond ((search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 (end-of-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 (if (> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095 (newline 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 ((search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (end-of-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 (if (> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (newline 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 ((> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 (newline 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 (t)))
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-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 "Adds the owner's signature at the end of the 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 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 (hm--html-set-point-for-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 "<ADDRESS> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 "</A></ADDRESS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 (error "ERROR: Define your hm--html-signature-file first !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 "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
1129 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155 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
1156 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 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
1158 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
1159 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161 (cond ((search-forward-regexp "<isindex>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 ((search-forward-regexp "<head>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 ((search-forward-regexp "<html>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164 (t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 (insert title " (" (hm--date) ")")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 (goto-char start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (insert title " (" (hm--date) ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221 "Adds the HTML tags <HTML> and </HTML> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 The tag <HTML> will be inserted at the beginning and </HTML> at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 end of the file."
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 (let ((new-cursor-position nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 (error "There is an old tag <HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 The tags will be inserted after <HTML> or at the beginning of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 "</HEAD>")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 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
1295 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 (let ((end-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311 (let ((cursor-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 (goto-char (+ end-tag-position 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320 'hm--html-insert-end-tag-with-newline "</BODY>"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 "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
1334 ; (interactive "sTitle and Header String: \nnHeader Size (1 .. 6): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335 ; (if (> size 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 ; (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 (interactive "sTitle and Header String: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338 (hm--html-add-title title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 (newline 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 (if (string= (what-line) "Line 1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 (newline 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352 (hm--html-add-header 1 title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 (defun hm--html-add-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 "Adds the HTML tags for a title and a header to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 ;The parameter 'size' spezifies the size of the header.";"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358 ; (interactive "nSize (1 .. 6): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 ; (if (> size 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 ; (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 (interactive "sTitle and Header String: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 (hm--html-add-title-and-header title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 (hm--html-add-signature))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (search-forward "</h1>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 "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
1388 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (hm--html-add-title-and-header-to-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 (hm--html-add-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 "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
1403 ; (interactive "sName (or RET for numeric): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 ; (and (string= name "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 ; (setq html-link-counter (1+ html-link-counter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 ; (setq name (format "%d" html-link-counter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 It returns the example extent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (if (hm--html-get-example-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (search-forward (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (let ((extent (make-extent (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 (set-extent-face extent 'hm--html-help-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 extent))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 ; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 ; ;; For the Emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 ; (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 ; "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 ;It returns the example extent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 ; (if (hm--html-get-example-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 ; (search-forward (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 ; parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 ; (put-text-property (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 ; (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 ; 'face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 ; 'hm--html-help-face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 ; (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 ; "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 ; t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460 (hm--html-write-alist-in-buffer (cdr alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 (cdr prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 (t filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 hm--html-delete-wrong-path-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 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
1519 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 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
1523 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 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
1525 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 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
1530 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 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
1536 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 ; (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 ; filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 ; (if (string-match hm--html-delete-wrong-path-prefix filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 ; (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 ; filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 also nil it returns an empty string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 ; (if (not hm--html-faces-exist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599 (make-face 'hm--html-help-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 (and hm--html-help-foreground
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 (set-face-foreground 'hm--html-help-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 hm--html-help-foreground))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 (and hm--html-help-background
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 (set-face-background 'hm--html-help-face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 hm--html-help-background))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (and hm--html-help-font
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 (set-face-font 'hm--html-help-face hm--html-help-font))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (car parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (defun hm--html-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (car (cdr parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (defun hm--html-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 path+file-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 construct the link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 (let ((point nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 (let ((html-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 (html-help-buffer (hm--html-generate-add-link-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 (scheme (hm--html-completing-read scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (hostname:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 (servername:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730 (path+file (hm--html-read-filename path+file-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 (anchor (hm--html-completing-read anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 (anchor-seperator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 anchor-parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 (if (not (string= scheme ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (if (string= hostname:port "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (setq scheme (concat scheme ":"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (setq scheme (concat scheme "://"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 (if (and (not (string= hostname:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 (not (string= servername:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (not (string= (substring servername:port 0 1) "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (setq servername:port (concat "/" servername:port)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 (if (and (not (string= path+file ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 (not (string= "/" (substring path+file 0 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 (setq path+file (concat "/" path+file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 (if (not (string= anchor ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 (setq anchor (concat anchor-seperator anchor)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (kill-buffer html-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (pop-to-buffer html-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 (eval (list function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 ''hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 (concat "<A"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 ; hrefname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 path+file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 ''hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 "</A>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 (setq point (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 (goto-char (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 "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
1771 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 "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
1813 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 "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
1861 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 "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
1867 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 "wais"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 "wais")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 "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
1911 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 "#")))
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-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 "Adds the HTML tags for a link to an HTML file."
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-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 "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
1960 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 "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
2056 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 "Subject%20Tree"
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 "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
2099 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 (defun hm--html-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 (let ((alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 (buffername (find-file-noselect proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184 ""
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 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 (defun hm--html-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 The function looks at the environment variable NNTPSERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 If this variable exists, it trys to open the file with the Name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 (if (file-exists-p (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 (let ((alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264 (buffername (find-file-noselect newsrc-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 "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
2319 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (defun hm--html-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 (defun hm--html-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (hm--html-add-mail-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 "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
2367 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 (hm--html-add-mail-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 "Mailadresse: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 (defun hm--html-add-normal-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 "Adds the HTML tags for a normal general link to region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (concat "<A HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (read-string "Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 (read-string "Node Link to: ")
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 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 "Hook function which updates the date in the title line, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 'hm--html-automatic-new-date' is t and which inserts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 (if hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 (hm--html-new-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 (if hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 (hm--html-insert-changed-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 "\\((\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "\\([ \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
2466 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480 noerror is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (if (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 (error "ERROR: Please insert a title in the document !"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 (let ((end-of-title-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 (if (search-forward "<!-- Created by: " end-of-head t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (if (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 "Replace the old comment \"<!-- Created by: \" ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 (kill-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 (hm--date))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 (hm--date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (defun hm--html-insert-changed-comment-1 (newline username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 "Internal function of 'hm--html-insert-changed-comment'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 Inserts a newline if NEWLINE is t, before the comment is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 USERNAME is the name to be inserted in the comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 ; (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 (insert "Changed by: " username ", " (hm--date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 "The function inserts a \"changed comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 The comment looks like <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 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
2532 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
2533 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 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
2535 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 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
2538 else in such a line !"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 (username (or hm--html-username (user-full-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 (goto-char end-of-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 (if (search-backward "<!-- Changed by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (if (string-match username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 (hm--html-insert-changed-comment-1 nil username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (if (search-backward "<!-- Created by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 "ERROR: Insert at first a title in the document !"))))))))
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 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 (defvar hm--html-template-file-history nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 "Historvariable for the template files.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (defun hm--html-insert-template (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 "Inserts a templatefile."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592 (let ((file-name-history hm--html-template-file-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (read-file-name "Templatefile: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 ; 'hm--html-template-file-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 (insert-file (expand-file-name filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 (if hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 (tmpl-expand-templates-in-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 (hm--html-insert-created-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 ;;; Functions for highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 ;(defun hm--html-toggle-use-highlighting ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 ; "Toggles the variable html-use-highlighting."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 ; (if html-use-highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 ; (setq html-use-highlighting nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 ; (setq html-use-highlighting t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 (if html-running-emacs-19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 ;; (setq font-lock-doc-string-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 ;(defun hm--html-set-font-lock-color ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 ; "Sets the color for the font lock mode in HTML mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 ;This color is used to highlight HTML expressions."
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 ; (setq hm--html-font-lock-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 ; (completing-read "Color: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 ; '(("grey80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 ; ("black")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 ; ("red")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 ; ("yellow")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 ; ("blue"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 ; nil
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 ; "black"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 ; (set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 ; (set-face-foreground 'font-lock-string-face hm--html-font-lock-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 ;;; Functions which determine if an active region exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 ;(defvar hm--region-active nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 ; "t : Region is active.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 ;nil: Region is inactive.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 ;(defun hm--set-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 ; (setq hm--region-active t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 ;(defun hm--unset-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 ; (setq hm--region-active nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 '(("POST") ("GET"))
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 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 nil
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 the METHOD must have one of the values \"GET\" or \"POST\"."
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 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 (read-string "Symbolic name: " last-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 (defun hm--html-form-add-input (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 "\""))
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2822 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 (hm--html-form-add-input "checkbox" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 "Name of the last radio button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 (defun hm--html-form-add-input-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2888 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2889 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2891 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892 (hm--html-form-add-input "radio" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2894
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (defun hm--html-form-add-input-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (hm--html-form-add-input "submit" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (defun hm--html-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 nil
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 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937 name
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 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 nil
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 src))
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-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2965 (defun hm--html-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2975
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 (defun hm--html-form-add-select-option (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 "</TEXTAREA>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026 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
3027 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 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
3043 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 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
3057 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 (defun hm--html-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 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
3070 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (defun hm--html-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (concat "<TH" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 (hm--html-table-read-cell-entries-and-alignments 1 no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129 " <TR>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 (concat "<TD" (car (hm--html-table-read-cell-entries-and-alignments 1 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 (if (<= no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 "<TR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 2 no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 " <TR>")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 (defun hm--html-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 (let* ((point-of-view (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 (end-of-last-row (search-backward "<tr>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (begin-of-last-row (progn (search-backward "<tr" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 (search-forward "<td" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 (alignment-list nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165 (if (not (search-forward "<td" end-of-last-row t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 from existing rows of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 (concat "<TD" (car (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 old-alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202 (if (<= no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 "<TR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210 (cdr old-alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 " <TR>"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (defun hm--html-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 "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
3245 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 "<TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (defun hm--html-add-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 "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
3261 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278 (interactive "NNo of columns, spaned by this cell: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 (if (and (search-backward "<" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 (insert (format "\"%d\"" columns)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 (insert (format " colspan=\"%d\"" columns)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 (error "ERROR: Point not in a table cell!"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 (interactive "NNo of rows, spaned by this cell: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 (if (and (search-backward "<" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 (insert (format "\"%d\"" rows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 (insert (format " rowspan=\"%d\"" rows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 (error "ERROR: Point not in a table cell!"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3321 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 (insert "&Uuml;"))
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_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 "Insert the character 'Oe'."
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 (insert "&Ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 (defun hm--html_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342 "Insert the character 'Ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 (insert "&Auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 (defun hm--html_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 "Insert the character 'Aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349 (insert "&Aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3351 (defun hm--html_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 "Insert the character 'sz'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 (insert "&szlig;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 (defun hm--html_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 "Insert the character 'aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 (defun hm--html_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 "Insert the character 'eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 (defun hm--html_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 "Insert the character 'iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371 (defun hm--html_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 "Insert the character 'oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376 (defun hm--html_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 "Insert the character 'uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 (defun hm--html_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 "Insert the character 'Aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3383 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 (defun hm--html_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 "Insert the character 'Eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 (defun hm--html_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 "Insert the character 'Iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 (defun hm--html_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 "Insert the character 'Oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3399 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 (defun hm--html_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 "Insert the character 'Uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 (defun hm--html_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 "Insert the character 'agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409 (insert "&agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 (defun hm--html_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 "Insert the character 'egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3413 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 (insert "&egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 (defun hm--html_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 "Insert the character 'igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 (insert "&igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421 (defun hm--html_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422 "Insert the character 'ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 (insert "&ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3426 (defun hm--html_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427 "Insert the character 'ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 (insert "&ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 (defun hm--html_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 "Insert the character 'Agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434 (insert "&Agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 (defun hm--html_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 "Insert the character 'Egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 (insert "&Egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441 (defun hm--html_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 "Insert the character 'Igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 (insert "&Igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446 (defun hm--html_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447 "Insert the character 'Ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 (insert "&Ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 (defun hm--html_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 "Insert the character 'Ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (insert "&Ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 (defun hm--html_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 "Insert the character 'ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 (insert "&ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 (defun hm--html_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3462 "Insert the character 'Ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464 (insert "&Ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 (defun hm--html_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 "Insert the character 'atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 (insert "&atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3471 (defun hm--html_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472 "Insert the character 'otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3473 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474 (insert "&otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 (defun hm--html_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477 "Insert the character 'ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 (insert "&ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 (defun hm--html_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482 "Insert the character 'Atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 (insert "&Atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486 (defun hm--html_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487 "Insert the character 'Otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489 (insert "&Otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491 (defun hm--html_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3492 "Insert the character 'Ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3494 (insert "&Ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 (defun hm--html_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 "Insert the character 'acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 (insert "&acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 (defun hm--html_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3502 "Insert the character 'ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3503 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504 (insert "&ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506 (defun hm--html_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 "Insert the character 'icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509 (insert "&icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 (defun hm--html_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 "Insert the character 'ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 (insert "&ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 (defun hm--html_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 "Insert the character 'ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3519 (insert "&ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3520
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 (defun hm--html_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 "Insert the character 'Acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 (insert "&Acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3526 (defun hm--html_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 "Insert the character 'Ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 (insert "&Ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531 (defun hm--html_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532 "Insert the character 'Icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 (insert "&Icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 (defun hm--html_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 "Insert the character 'Ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 (insert "&Ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541 (defun hm--html_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542 "Insert the character 'Ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 (insert "&Ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546 (defun hm--html_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 "Insert the character 'ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3548 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3549 (insert "&euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 (defun hm--html_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552 "Insert the character 'idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554 (insert "&iuml;"))
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_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 "Insert the character 'Ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3558 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 (insert "&Euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 (defun hm--html_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 "Insert the character 'Idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564 (insert "&Iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3566 (defun hm--html_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3567 "Insert the character 'thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569 (insert "&thorn;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3571 (defun hm--html_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572 "Insert the character 'Thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3573 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3574 (insert "&THORN;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3576 (defun hm--html_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3577 "Insert the character 'eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3578 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3579 (insert "&eth;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3580
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3581 (defun hm--html_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582 "Insert the character 'Eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584 (insert "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3588 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3589 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3591 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3592 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3594 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3595 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3596 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3597 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3598 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3599 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3600 (delete-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3601 (html-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3603 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3604 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3606 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3607 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3609 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3610 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3611 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3612 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3613 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3614 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3615 (delete-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3616 (html-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3617 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3618 (insert ?>)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3619 (setq hm--just-insert-greater-than t)))
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 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3623 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3624 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3626 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3627 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3628 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3629 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
3630 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3631 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3632 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3633 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3634 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3635 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3636 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3637 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3638 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3639 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3640 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3641 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3645 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3652 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3653 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3654 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3655 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3656 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3657
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3658 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3659 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3660 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3661 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3662 (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
3663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3664 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3665 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3666 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3668 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3669 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3670 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3671 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3672 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3673 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3674 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3675 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3676 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3677 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3678 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3679 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3680 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3681 'hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3682 'hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3683 'hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3684 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3685 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3686 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3687 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3688 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3689 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3690 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3691 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3692 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3693 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3694 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3695 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3696 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3697 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3698 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3699 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3700 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3701 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3702 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3703 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3704 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3705 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3706 'hm--html-menu-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3707 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3708 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3709 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3710 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3711 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3712 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3713 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3714 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3715 'hm--html-user-config-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3716 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3717 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3718 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3719 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3720 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3721 'hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3722 'html-deemphasize-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3723 'html-document-previewer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3724 'html-document-previewer-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3725 'html-emphasize-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3726 'html-quotify-hrefs-on-find
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3727 'html-region-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3728 'html-sigusr1-signal-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3729 'html-use-font-lock
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3730 'html-use-highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3731 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3732 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3733 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3734 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3735 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745 (add-hook 'zmacs-activate-region-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 (function (lambda () (html-region-mode t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748 (add-hook 'zmacs-deactivate-region-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749 (function (lambda () (html-region-mode nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 (add-hook 'activate-mark-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 (function (lambda () (html-region-mode t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758 (add-hook 'deactivate-mark-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759 (function (lambda () (html-region-mode nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764 (add-hook 'html-mode-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 (lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3767 (make-variable-buffer-local 'write-file-hooks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3768 (add-hook 'write-file-hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769 'hm--html-maybe-new-date-and-changed-comment))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 ;(add-hook 'zmacs-activate-region-hook 'hm--set-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3773 ;(add-hook 'zmacs-deactivate-region-hook 'hm--unset-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778 ; Environment loading
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-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783 First, the system config file (detemined by the environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3784 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 after that the user config file (determined by the environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787 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
3788 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790 `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
3791 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
3792 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3793 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3794 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3797 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799 (load-library "hm--html-configuration"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3817 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823 ;(hm--html-load-config-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 ;;; Definition of the minor mode html-region-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827 (defvar html-region-mode nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828 "*t, if the minor mode html-region-mode is on and nil otherwise.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 (make-variable-buffer-local 'html-region-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832 (defvar html-region-mode-map nil "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834 (hm--html-load-config-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 (if hm--html-use-old-keymap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839 ;(setq minor-mode-alist (cons '(html-region-mode " Region") minor-mode-alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 (or (assq 'html-region-mode minor-mode-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 (setq minor-mode-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842 (purecopy
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843 (append minor-mode-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844 '((html-region-mode " Region"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 (defun html-region-mode (on)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847 "Turns the minor mode html-region-mode on or off.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848 The function turns the html-region-mode on, if ON is t and off otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849 (if (string= mode-name "HTML")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 (if on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 ;; html-region-mode on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3852 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3853 (setq html-region-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3854 (use-local-map html-region-mode-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3855 ;; html-region-mode off
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856 (setq html-region-mode nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3857 (use-local-map html-mode-map))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3858
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 ; Set font lock color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867 ; (hm--html-font-lock-color should be defined in hm--html-configuration.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868 ; oder .hm--html-configuration.el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3870 (require 'font-lock)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 ;(load-library "font-lock")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3872 ;(set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3874
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 (hm--html-generate-help-buffer-faces)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3880 ;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 ;(setq hm--html-hostname-search-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882 ; "[-a-zA-Z0-9]*\\.[-a-zA-Z0-9]*\\.[-a-zA-Z0-9.]*")
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-get-next-hostname ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3885 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3886 ; (search-forward-regexp hm--html-hostname-search-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887 ; (buffer-substring (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888 ;