annotate lisp/hm--html-menus/hm--html.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 8fc7fe29b841
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1 ;;; $Id: hm--html.el,v 1.1.1.2 1996/12/18 03:46:47 steve Exp $
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2 ;;;
0
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
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
30 ;(require 'hm--date)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
31 ;(require 'adapt)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
34 ;;; Indentation
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
35
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
36 (defun hm--html-indent-region (begin end)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
37 "Indents the region between BEGIN and END according to the major mode."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
38 (when (< end begin)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 (let ((a end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
40 (setq end start)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
41 (setq start a)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
42 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
43 (goto-char begin)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
44 (let ((old-point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
45 (while (and (<= (point) end)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
46 (not (eq (point) old-point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
47 (setq old-point (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
48 (indent-according-to-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
49 (forward-line)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50 ))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
51
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;;; Functions for adding html commands which consists of a start and a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;; end tag and some text between them. (Basicfunctions)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (defun hm--html-add-tags (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
58 &optional
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
59 function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60 end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
61 function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
62 middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
63 function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
64 middle-end-tag)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 "Adds the start and the end html tag at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 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
69 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
70 The fifth parameter is optional. If it exists, it specifies a function which
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
71 inserts the sixth parameter (the middle-start-tag) between the start and the end
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ; (interactive "aFunction, which adds the HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;aFunction, which adds the HTML end tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;sThe HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;sThe HTML end tag: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (eval (list function-insert-start-tag start-tag))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
78 (if function-insert-middle-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
79 (eval (list function-insert-middle-start-tag middle-start-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
80 (let ((position (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
81 (if function-insert-middle-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
82 (eval (list function-insert-middle-end-tag middle-end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
83 (if function-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
84 (eval (list function-insert-end-tag end-tag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
85 (goto-char position)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (defun hm--html-add-tags-to-region (function-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 function-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 &optional function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 &optional middle-tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 "Adds the start and the end html tag to the active region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 The first parameter specifies the funtion which insert the start tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 and the third parameter specifies the function which insert the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 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
98 is the string for the end tag.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 The fifth parameter is optional. If it exists, it specifies a function which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 inserts the sixth parameter (the middle-tag) between the start and the end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ; (interactive "aFunction, which adds the html start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;aFunction, which adds the html end tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;sThe HTML start tag: \n\
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;sThe HTML end tag: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (let ((start (region-beginning))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (end (region-end)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (goto-char end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (eval (list function-insert-end-tag end-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (goto-char start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (eval (list function-insert-start-tag start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (if function-insert-middle-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (eval (list function-insert-middle-tag middle-tag)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defun hm--html-insert-start-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 "Inserts the HTML start tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 The parameter must be a string (i.e. \"<B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
123 (hm--html-indent-region start (point))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
124 ; (html-maybe-deemphasize-region start (- (point) 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (defun hm--html-insert-end-tag (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 "Inserts the HTML end tag 'tag' without a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 The parameter must be a string (i.e. \"</B>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
132 (hm--html-indent-region start (point))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
133 ; (html-maybe-deemphasize-region start (- (point) 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (defun hm--html-insert-start-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 "Inserts the HTML start tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 The parameter must be a string (i.e. \"<PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
141 (hm--html-indent-region start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
142 )
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
143 ; (html-maybe-deemphasize-region start (- (point) 1)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (insert "\n"))
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-insert-end-tag-with-newline (tag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "Inserts the HTML end tag 'tag' with a Newline.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 The parameter must be a string (i.e. \"</PRE>\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (insert tag)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
153 (hm--html-indent-region start (point))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
154 ; (html-maybe-deemphasize-region start (- (point) 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;; Functions which add simple tags of the form <tag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
160 (defun hm--html-add-list-or-menu-item-separator ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
161 "Adds a list or menu item. Assume we're at the end of the last item."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
162 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
163 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
164
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
165 (defun hm--html-add-list-or-menu-item ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
166 "Adds the tags for a menu item at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
167 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
168 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
169 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
170
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
171 (defun hm--html-add-list-or-menu-item-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
172 "Adds the tags for a menu item to the region in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
173 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
174 (hm--html-add-tags-to-region 'hm--html-insert-start-tag "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
175 'hm--html-insert-end-tag " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
176
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defun hm--html-add-line-break ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 "Adds the HTML tag for a line break."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (hm--html-add-tags 'hm--html-insert-start-tag "<BR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defun hm--html-add-horizontal-rule ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 "Adds the HTML tag for a horizontal rule (line)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (hm--html-add-tags 'hm--html-insert-start-tag "<HR>"))
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-add-paragraph ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 "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
191 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (defun hm--html-add-paragraph-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 "Adds the HTML tags for a paragraph to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 "<P>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 "</P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defun hm--html-add-paragraph-separator ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 "Adds the tag for a paragraph seperator."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (hm--html-add-tags 'hm--html-insert-start-tag "<P>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ;;; Functions which include something in HTML- documents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (defvar hm--html-url-history-list nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 "History list for the function 'hm--html-read-url'")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (defun hm--html-read-url-predicate (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 "Predicatefunction for hm--html-read-url."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (hm--html-read-url-predicate-1 (cdr table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (defun hm--html-read-url-predicate-1 (table-element-list usagesymbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 "Internal function of hm--html-read-url-predicate."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (cond ((not table-element-list) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ((eq (car table-element-list) usagesymbol))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (t (hm--html-read-url-predicate-1 (cdr table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 usagesymbol))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (defun hm--html-read-url (prompt &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 "Function prompts for a URL string.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 TABLE is an alist whose elements' cars are URL's.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 PREDICATE limits completion to a subset of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 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
242 the input is (or completes to) an element of TABLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 INITIAL-CONTENTS is a string to insert in the minibuffer before reading.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 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
245 is used instead."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (if table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (completing-read prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 hm--html-url-history-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (read-string prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (if initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 initial-contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (car hm--html-url-history-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 hm--html-url-history-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (defun hm--html-read-altenate (url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 "Function reads the value for the \"ALT\"- attribute in IMG tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 URL will be used as the default URL for the external viewer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (let ((alttype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (string-to-int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ; "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text, 3: ALT=External Viewer: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 "0: No ALT atribute, 1: ALT=\"\", 2: ALT=Text: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 ; '(("0") ("1") ("2") ("3"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 '(("0") ("1") ("2"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 "2"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (cond ((= alttype 0) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ((= alttype 1) "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 ((= alttype 2) (read-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 "Text for the ALT attribute: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (substring (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (string-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 "\\."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (file-name-nondirectory url)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ; ((= alttype 3) (concat "<A HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ; url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 ; "\">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ; (file-name-nondirectory url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 ; "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (defun hm--html-add-image-bottom (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 "Add an image, bottom aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
294 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
295 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
296 (concat "<IMG ALIGN=BOTTOM SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
297 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
298 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
299 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
300 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (defun hm--html-add-image-middle (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 "Add an image, middle aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
307 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
308 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
309 (concat "<IMG ALIGN=MIDDLE SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
310 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
311 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
312 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
313 "\">")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (defun hm--html-add-image-top (href alt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 "Add an image, top aligned."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (interactive (let ((url (hm--html-read-url "Image URL: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (list url (hm--html-read-altenate url))))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
320 (hm--html-add-tags
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
321 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
322 (concat "<IMG ALIGN=TOP SRC=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
323 href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
324 (when alt
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
325 (concat "\" ALT=\"" alt))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
326 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
327
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
328
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
329 (defun hm--html-add-applet (name code width height)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
330 "Add an applet."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
331 (interactive (let ((name (read-string "Applet Name: " "applet"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
332 (code (read-file-name "Applet Class File: "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
333 (width (read-number "Width (i.e.: 100): " t))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
334 (height (read-number "Height (i.e.: 100): " t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
335 (list name code width height)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
336 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
337 (concat "<APPLET "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
338 (if (string= name "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
339 ""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
340 (concat "NAME=\"" name "\"\n"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
341 "CODE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
342 code
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
343 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
344 "WIDTH=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
345 width
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
346 "\"\n"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
347 "HEIGHT=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
348 height
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
349 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
350 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
351 "</APPLET>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
352
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
353 (defun hm--html-add-applet-parameter (name value)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
354 "Adds the tag for an applet parameter at the current point.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
355 This tag must be added between <APPLET> and </APPLET>."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
356 (interactive "sParameter Name: \nsParameter Value: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
357 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
358 (concat "<PARAM "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
359 "NAME=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
360 name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
361 "\" VALUE=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
362 value
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
363 "\">")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
364
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 (defun hm--html-add-server-side-include-file (file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 "This function adds a server side include file directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (interactive "FInclude File: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (if (string= file "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (error "ERROR: No filename specified !")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
373 (insert "<INC SRV \"" file "\">"))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
374 ; (html-maybe-deemphasize-region (1+ start) (1- (point))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (defun hm--html-add-server-side-include-command-with-isindex-parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 The include command uses the \"isindex\"- parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (hm--html-add-server-side-include-command command t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (defun hm--html-add-server-side-include-command (command &optional srvurl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 The directive is only supported by the NCSA http daemon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 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
391 include command. With srvurl, the include command uses the \"isindex\"-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 parameter for the specified command."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 (completing-read "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 hm--html-server-side-include-command-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (let ((start (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (attribute (if srvurl "SRVURL" "SRV")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (insert "<INC " attribute" \"" command "\">")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
402 (insert "<INC " attribute " \"|" command "\">")))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
403 ; (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 ;(defun hm--html-add-server-side-include-command-with-parameter (command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 ; parameter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 ; "This function adds a server side include command directive in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 ;The directive is only supported by the NCSA http daemon."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 ; (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ; (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 ; "Include Command: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 ; hm--html-server-side-include-command-with-parameter-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 ; (read-string "Parameterlist sepearted by '?': ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ; (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ; (if (string= command "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ; (error "ERROR: No command specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 ; (if (string= parameter "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 ; (error "ERROR: No parameter specified !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 ; (if (= ?| (string-to-char command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 ; (insert "<INC SRVURL \"" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 ; (insert "<INC SRVURL \"" command "?" parameter "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 ; (if (= ?? (string-to-char parameter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 ; (insert "<INC SRVURL \"|" command parameter "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 ; (insert "<INC SRVURL \"|" command "?" parameter "\">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 ; (html-maybe-deemphasize-region (1+ start) (1- (point)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ;;; Functions, which adds tags of the form <starttag> ... </endtag>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
433 (defun hm--html-add-big ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
434 "Adds the HTML tags for Big at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
435 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
436 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
437 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
438 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
439 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
440
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
441
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
442 (defun hm--html-add-big-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
443 "Adds the HTML tags for Big to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
444 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
445 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
446 "<BIG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
447 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
448 "</BIG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
449
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
450
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
451 (defun hm--html-add-small ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
452 "Adds the HTML tags for Small at the point in the current buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
453 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
454 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
455 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
456 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
457 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
458
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
459
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
460 (defun hm--html-add-small-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
461 "Adds the HTML tags for Small to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
462 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
463 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
464 "<SMALL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
465 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
466 "</SMALL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
467
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
468
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 (defun hm--html-add-bold ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 "Adds the HTML tags for Bold at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 (defun hm--html-add-bold-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479 "Adds the HTML tags for Bold to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 "<B>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 "</B>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 (defun hm--html-add-italic ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 "Adds the HTML tags for Italic at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (defun hm--html-add-italic-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 "Adds the HTML tags for Italic to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 "<I>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 "</I>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 (defun hm--html-add-underline ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 "Adds the HTML tags for Underline at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 (defun hm--html-add-underline-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 "Adds the HTML tags for Underline to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 "<U>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 "</U>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 (defun hm--html-add-definition ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 "Adds the HTML tags for Definition at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (defun hm--html-add-definition-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 "Adds the HTML tags for Definition to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 "<DFN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 "</DFN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (defun hm--html-add-code ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 "Adds the HTML tags for Code at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 (defun hm--html-add-code-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 "Adds the HTML tags for Code to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 "<CODE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 "</CODE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
559 (defun hm--html-add-citation ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
560 "Adds the HTML tags for Citation."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
561 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
562 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
563 "<CITE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
564 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
565 "</CITE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
566
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 (defun hm--html-add-citation-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 "Adds the HTML tags for Citation to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 "<CITE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 "</CITE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
576 (defun hm--html-add-emphasized ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
577 "Adds the HTML tags for Emphasized."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
578 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
579 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
580 "<EM>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
581 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
582 "</EM>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
583
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
584
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 (defun hm--html-add-emphasized-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 "Adds the HTML tags for Emphasized to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 "<EM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 "</EM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
594 (defun hm--html-add-fixed ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
595 "Adds the HTML tags for Fixed."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
596 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
597 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
598 "<TT>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
599 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
600 "</TT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
601
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
602
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 (defun hm--html-add-fixed-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604 "Adds the HTML tags for Fixed to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607 "<TT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 "</TT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
612 (defun hm--html-add-keyboard ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
613 "Adds the HTML tags for Keyboard."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
614 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
615 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
616 "<KBD>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
617 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
618 "</KBD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
619
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
620
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 (defun hm--html-add-keyboard-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622 "Adds the HTML tags for Keyboard to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625 "<KBD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 "</KBD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
630 (defun hm--html-add-sample ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
631 "Adds the HTML tags for Sample."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
632 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
633 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
634 "<SAMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
635 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
636 "</SAMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
637
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 (defun hm--html-add-sample-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 "Adds the HTML tags for Sample to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 "<SAMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 "</SAMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
647 (defun hm--html-add-strong ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
648 "Adds the HTML tags for Strong."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
649 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
650 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
651 "<STRONG>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
652 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
653 "</STRONG>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
654
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
655
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 (defun hm--html-add-strong-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 "Adds the HTML tags for Strong to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 "<STRONG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 "</STRONG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
665 (defun hm--html-add-variable ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
666 "Adds the HTML tags for Variable."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
667 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
668 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
669 "<VAR>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
670 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
671 "</VAR>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
672
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673 (defun hm--html-add-variable-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 "Adds the HTML tags for Variable to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 "<VAR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679 "</VAR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682 (defun hm--html-add-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 "Adds the HTML tags for Comment at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691 (defun hm--html-add-comment-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 "Adds the HTML tags for Comment to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695 "<!-- "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 " -->"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701 (defun hm--html-add-preformated ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 "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
703 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710 (defun hm--html-add-preformated-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 "Adds the HTML tags for preformated text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 "<PRE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716 "</PRE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
719 (defun hm--html-add-plaintext ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
720 "Adds the HTML tags for plaintext."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
721 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
722 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
723 "<XMP>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
724 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
725 "</XMP>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
726
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
727
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 (defun hm--html-add-plaintext-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729 "Adds the HTML tags for plaintext to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732 "<XMP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 "</XMP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
737 (defun hm--html-add-blockquote ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
738 "Adds the HTML tags for blockquote."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
739 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
740 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
741 "<BLOCKQUOTE>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
742 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
743 "</BLOCKQUOTE>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
744
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
745
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 (defun hm--html-add-blockquote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 "Adds the HTML tags for blockquote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 "<BLOCKQUOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 "</BLOCKQUOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754 (defun hm--html-add-abstract ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 "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
756 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 (defun hm--html-add-abstract-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764 "Adds the HTML tags for abstract text to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767 "<ABSTRACT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 "</ABSTRACT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773 (defun hm--html-add-strikethru ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 "Adds the HTML tags for Strikethru at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 "<S>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779 "</S>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782 (defun hm--html-add-strikethru-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 "Adds the HTML tags for Strikethru to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 "<S>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788 "</S>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791 (defun hm--html-add-superscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 "Adds the HTML tags for Superscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800 (defun hm--html-add-superscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 "Adds the HTML tags for Superscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 "<SUP>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806 "</SUP>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809 (defun hm--html-add-subscript ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 "Adds the HTML tags for Subscript at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818 (defun hm--html-add-subscript-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 "Adds the HTML tags for Subscript to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 "<SUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824 "</SUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827 (defun hm--html-add-quote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 "Adds the HTML tags for Quote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836 (defun hm--html-add-quote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 "Adds the HTML tags for Quote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 "<Q>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842 "</Q>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 (defun hm--html-add-person ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846 "Adds the HTML tags for Person at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 (defun hm--html-add-person-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855 "Adds the HTML tags for Person to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 "<PERSON>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860 "</PERSON>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863 (defun hm--html-add-instance ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 "Adds the HTML tags for Instance at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872 (defun hm--html-add-instance-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 "Adds the HTML tags for Instance to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 "<INS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878 "</INS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881 (defun hm--html-add-option ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 "Adds the HTML tags for Option at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890 (defun hm--html-add-option-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 "Adds the HTML tags for Option to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 "<OPT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896 "</OPT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899 (defun hm--html-add-publication ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 "Adds the HTML tags for Publication at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908 (defun hm--html-add-publication-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 "Adds the HTML tags for Publication to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 "<PUB>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914 "</PUB>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917 (defun hm--html-add-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 "Adds the HTML tags for Author at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926 (defun hm--html-add-author-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 "Adds the HTML tags for Author to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 "<AUTHOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932 "</AUTHOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935 (defun hm--html-add-editor ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 "Adds the HTML tags for Editor at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944 (defun hm--html-add-editor-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 "Adds the HTML tags for Editor to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948 "<EDITOR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 "</EDITOR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 (defun hm--html-add-credits ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954 "Adds the HTML tags for Credits at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 (defun hm--html-add-credits-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 "Adds the HTML tags for Credits to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 "<CREDITS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 "</CREDITS>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 (defun hm--html-add-copyright ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 "Adds the HTML tags for Copyright at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 (defun hm--html-add-copyright-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 "Adds the HTML tags for Copyright to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 "<COPYRIGHT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 "</COPYRIGHT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989 (defun hm--html-add-isbn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 "Adds the HTML tags for ISBN at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998 (defun hm--html-add-isbn-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 "Adds the HTML tags for ISBN to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 "<ISBN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004 "</ISBN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007 (defun hm--html-add-acronym ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 "Adds the HTML tags for Acronym at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016 (defun hm--html-add-acronym-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 "Adds the HTML tags for Acronym to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 "<ACRONYM>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022 "</ACRONYM>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025 (defun hm--html-add-abbrevation ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 "Adds the HTML tags for Abbrevation at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031 "</ABBREV>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034 (defun hm--html-add-abbrev-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 "Adds the HTML tags for Abbrev to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 "<ABBREV>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040 "</ABBREV>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043 (defun hm--html-add-command ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 "Adds the HTML tags for Command at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 (defun hm--html-add-command-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053 "Adds the HTML tags for Command to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 "<CMD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 "</CMD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 (defun hm--html-add-argument ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 "Adds the HTML tags for Argument at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 (defun hm--html-add-argument-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 "Adds the HTML tags for Argument to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074 "<ARG>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 "</ARG>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 (defun hm--html-add-literature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080 "Adds the HTML tags for Literature at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 (defun hm--html-add-literature-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089 "Adds the HTML tags for Literature to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092 "<LIT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 "</LIT>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 (defun hm--html-add-footnote ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098 "Adds the HTML tags for Footnote at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 (defun hm--html-add-footnote-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107 "Adds the HTML tags for Footnote to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110 "<FOOTNOTE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 "</FOOTNOTE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 (defun hm--html-add-margin ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116 "Adds the HTML tags for Margin at the point in the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 (defun hm--html-add-margin-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125 "Adds the HTML tags for Margin to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128 "<MARGIN>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 "</MARGIN>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 ;;; Lists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1139 (defun hm--html-add-listing ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1140 "Adds the HTML tags for listing."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1141 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1142 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1143 "<LISTING>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1144 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1145 "</LISTING>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1146
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1147
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 (defun hm--html-add-listing-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149 "Adds the HTML tags for listing to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152 "<LISTING>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 "</LISTING>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1156 (defun hm--html-add-center ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1157 "Adds the HTML tags for center at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1158 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1159 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1160 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1161 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1162 "</CENTER>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1163
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1164 (defun hm--html-add-center-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1165 "Adds the HTML tags for center to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1166 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1167 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1168 "<CENTER>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1169 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1170 "</CENTER>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 (defun hm--html-add-numberlist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173 "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
1174 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182 (defun hm--html-add-numberlist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 "Adds the HTML tags for a numbered list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 "<OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188 "</OL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 "<LI> "))
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 (defun hm--html-add-directory-list ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194 "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
1195 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203 (defun hm--html-add-directorylist-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 "Adds the HTML tags for a directory list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 "<DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209 "</DIR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1214 (defun hm--html-add-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1215 "Adds the HTML tags for a (unnumbered) list to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1216 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1217 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1218 "<UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1219 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1220 "</UL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1221 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1222 "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1223
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1224
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 (defun hm--html-add-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 "Adds the HTML tags for a (unnumbered) list to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 "<UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 "</UL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233 "<LI> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1236 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1237 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1238 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1239 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1240 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1241 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1242 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1243 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1244 "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1245
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1246
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1247 (defun hm--html-add-menu ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1248 "Adds the HTML tags for a menu."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1249 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1250 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1251 "<MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1252 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1253 "</MENU>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1254 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1255 "<LI> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1256 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1257 " </LI>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1258
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1259
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260 (defun hm--html-add-menu-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 "Adds the HTML tags for a menu to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 "<MENU>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1266 "</MENU>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1267
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1268 ; 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1269 ; "<LI> "))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1270
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1271
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1272 (defun hm--html-add-description-title-and-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1273 "Adds a definition title and entry.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1274 Assumes we're at the end of a previous entry."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1275 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1276 (hm--html-add-description-title)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1277 (let ((position (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1278 (search-forward "</DT>")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1279 (hm--html-add-only-description-entry)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1280 (goto-char position)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1281
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1282
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1283 (defun hm--html-add-description-list ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1284 "Adds the HTML tags for a description list.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1285 It also inserts a tag for the description title."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1286 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1287 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1288 "<DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1289 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1290 "</DL>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1291 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1292 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1293 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1294 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1295
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 (defun hm--html-add-description-list-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 "Adds the HTML tags for a description list to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299 It also inserts a tag for the description title."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302 "<DL>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1304 "</DL>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1305
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1306 ; 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1307 ; "<DT> "))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 (defun hm--html-add-description-title ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1311 "Adds the HTML tags for a description title at current point in the buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1312 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1313 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1314 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1315 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1316 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1317
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1318
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1319 (defun hm--html-add-description-title-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1320 "Adds the HTML tags for a description title to the region in the buffer."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1321 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1322 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1323 "<DT> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1324 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1325 " </DT>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1326
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1327
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1328 (defun hm--html-add-description-entry ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1329 "Adds the HTML tags for a description entry at current point in the buffer."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1332 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1333 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1334 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1335
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1336
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1337 (defun hm--html-add-description-entry-to-region ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1338 "Adds the HTML tags for a description entry to the region in the buffer."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1340 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1341 "<DD> "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1342 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1343 " </DD>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1344
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1345
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1346 (defun hm--html-add-address ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1347 "Adds the HTML tags for an address."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1348 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1349 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1350 "<ADDRESS>"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1351 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1352 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 (defun hm--html-add-address-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355 "Adds the HTML tags for an address to the region"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1358 "<ADDRESS>"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 'hm--html-insert-end-tag
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1360 "</ADDRESS>"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 (defvar hm--html-signature-reference-name "Signature"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364 "The signature reference name.")
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-make-signature-link-string (signature-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 "Returns a string which is a link to a signature file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371 hm--html-signature-reference-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 signature-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374 "\">"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377 (defun hm--html-delete-old-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 "Searches for the old signature and deletes it, if the user want it"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 (if (search-forward (concat "<address> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 "<a name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383 hm--html-signature-reference-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 " href=\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 (let ((signature-start (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 (signature-end (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389 (search-forward "</address>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 (if (yes-or-no-p "Delete the old signature (yes or no) ?")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392 (delete-region signature-start signature-end))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395 (defun hm--html-set-point-for-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 "Searches and sets the point for inserting the signature.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 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
1398 tries to use the point before the </body> tag then the point before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 the </html> tag and the the end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401 (cond ((search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 (end-of-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 (if (> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404 (newline 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 ((search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 (end-of-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407 (if (> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 (newline 2)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 ((> (current-column) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410 (newline 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 (t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 (defun hm--html-add-signature ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 "Adds the owner's signature at the end of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419 (if (not hm--html-username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 (setq hm--html-username (user-full-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422 (hm--html-delete-old-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 (hm--html-set-point-for-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425 "<ADDRESS> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 "</A></ADDRESS>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 (hm--html-make-signature-link-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 hm--html-signature-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 (insert hm--html-username)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 (error "ERROR: Define your hm--html-signature-file first !")))
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 (defun hm--html-add-header (size &optional header)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437 "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
1438 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 (format "</H%d>" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 (if header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446 (insert header))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449 (defun hm--html-add-header-to-region (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 "Adds the HTML tags for a header to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 The parameter 'size' specifies the size of the header."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452 (interactive "nSize (1 .. 6; 1 biggest): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 (if (or (< size 1) (> size 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 (format "<H%d>" size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 (format "</H%d>" size))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 (defun hm--html-set-point-for-title ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 "Searches and sets the point for inserting the HTML element title.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463 The functions start at the beginning of the file and searches first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 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
1465 position after the tag. If not, the function next searches for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466 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
1467 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
1468 this tag or the beginning of the file otherwise."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 (cond ((search-forward-regexp "<isindex>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 ((search-forward-regexp "<head>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472 ((search-forward-regexp "<html>" nil t) (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 (t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 (defun hm--html-add-title (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 "Adds the HTML tags for a title at the beginning of the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478 (interactive "sTitle: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 (save-excursion
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 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487 (let ((start (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 (insert title " (" (hm--date) ")")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 (goto-char start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503 (defun hm--html-add-title-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 "Adds the HTML tags for a title to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509 (if (search-forward "<title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 (let ((point-after-start-tag (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 (if (not (search-forward "</title>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 (goto-char (- (point) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 (delete-backward-char (- (point) point-after-start-tag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515 (insert title " (" (hm--date) ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 ;; Noch kein <TITLE> im Buffer vorhanden
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 (hm--html-set-point-for-title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 "<TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521 "</TITLE>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 'insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 (concat title " (" (hm--date) ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524 (forward-char 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 ;(newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 (defun hm--html-add-html ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530 "Adds the HTML tags <HTML> and </HTML> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 The tag <HTML> will be inserted at the beginning and </HTML> at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 end of the file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 (let ((new-cursor-position nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 (error "There is an old tag <HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<HTML>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 ; (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542 (setq new-cursor-position (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545 (error "There is an old tag </HTML> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 (hm--html-add-tags 'hm--html-insert-end-tag "</HTML>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 (goto-char new-cursor-position)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 (defun hm--html-add-head ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552 "Adds the HTML tags <HEAD> and </HEAD> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 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
1554 The function also looks for the tags <BODY> and </TITLE>."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 (if (search-forward "<html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558 (if (search-forward "<head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 (error "There is an old tag <HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561 (error "There is an old tag </HEAD> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 (newline 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 (let ((start-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 (forward-line 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567 (forward-char -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 (if (= (point) (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 (forward-line -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 "<HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578 (if (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 "</HEAD>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 (goto-char start-tag-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 "<HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 "</HEAD>")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 (defun hm--html-add-head-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593 "Adds the HTML tags <HEAD> and </HEAD> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596 "<HEAD>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 "</HEAD>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 (defun hm--html-add-body ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602 "Adds the HTML tags <BODY> and </BODY> in the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 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
1604 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605 (goto-char (point-max))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 (if (search-backward "</html>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608 (if (search-backward "</body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 (error "There is an old tag </BODY> in the current buffer !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 (if (search-backward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611 (error "There is an old tag <BODY> in the current buffer !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 (let ((end-tag-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614 (if (search-backward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 (forward-char 7)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 "<BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620 (let ((cursor-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 (goto-char (+ end-tag-position 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 (hm--html-add-tags 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623 "</BODY>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 (goto-char cursor-position)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626 (if (not (= (current-column) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 (newline))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629 'hm--html-insert-end-tag-with-newline "</BODY>"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632 (defun hm--html-add-body-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 "Adds the HTML tags <BODY> and </BODY> to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 "<BODY>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638 "</BODY>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641 (defun hm--html-add-title-and-header (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 "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
1643 ; (interactive "sTitle and Header String: \nnHeader Size (1 .. 6): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644 ; (if (> size 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 ; (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 (interactive "sTitle and Header String: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 (hm--html-add-title title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 (search-forward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651 (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 (newline 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656 (newline 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 (if (string= (what-line) "Line 1")
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 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 (newline 1)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 (hm--html-add-header 1 title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664 (defun hm--html-add-title-and-header-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 "Adds the HTML tags for a title and a header to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 ;The parameter 'size' spezifies the size of the header.";"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667 ; (interactive "nSize (1 .. 6): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 ; (if (> size 6)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 ; (message "The size must be a number from 1 to 6 !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 (let ((title (buffer-substring (region-beginning) (region-end))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 (hm--html-add-header-to-region 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673 (hm--html-add-title title)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 (defun hm--html-add-full-html-frame (title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 "Adds a full HTML frame to the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 header and the signature. The parameter TITLE specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 (interactive "sTitle and Header String: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 (hm--html-add-title-and-header title)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 (if hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687 (hm--html-add-signature))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 (search-forward "</h1>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 (forward-line 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 (defun hm--html-add-full-html-frame-with-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 "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
1697 The frame consists of the elements html, head, body, title,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698 header and the signature. The function uses the region as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 the string for the title and the header of the document."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 (hm--html-add-title-and-header-to-region)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 (hm--html-add-html)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 (hm--html-add-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 (hm--html-add-body)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 (hm--html-add-signature)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707 (hm--html-insert-created-comment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1710 (defun hm--html-add-link-target-to-region (name)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1711 "Adds the HTML tags for a link target to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1712 (interactive "sName: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1713 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1714 (concat "<A NAME=\"" name "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1715 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1716 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1717
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718 (defun hm--html-add-link-target (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 "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
1720 ; (interactive "sName (or RET for numeric): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721 (interactive "sName: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 ; (and (string= name "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 ; (setq html-link-counter (1+ html-link-counter))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 ; (setq name (format "%d" html-link-counter))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 (concat "<A NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 ;;; Functions which add links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 It returns the example extent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 (if (hm--html-get-example-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 (search-forward (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 (let ((extent (make-extent (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 (set-extent-face extent 'hm--html-help-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744 extent))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747 (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 (if extent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750 (delete-extent extent)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 ; )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 ; ;; For the Emacs 19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 ; (defun hm--html-mark-example (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755 ; "Marks the example of the parameterlist in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 ;It returns the example extent."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 ; (if (hm--html-get-example-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758 ; (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 ; (search-forward (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 ; parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 ; (put-text-property (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 ; (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 ; 'face
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764 ; 'hm--html-help-face))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 ; (defun hm--html-unmark-example (extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 ; "Unmarks the example for the current question."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 ; t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772 (defun hm--html-write-alist-in-buffer (alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 "The function writes the contents of the ALIST in the currentbuffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 (cond ((car alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 (insert (int-to-string (car (car alist))) ":\t" (cdr (car alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 (hm--html-write-alist-in-buffer (cdr alist)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 (defun hm--html-select-directory (alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781 "The function selects one of the directories of the ALIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 or the DEFAULT or the 'default-directory' by number. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783 documentation of the function hm--html-read-filename."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 (if (or (string= default "") (not default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 (setq default default-directory))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 (if alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788 (let ((buffername (generate-new-buffer "*html-directories*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790 (insert "Select one of the following directories by number !")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 (insert "===================================================")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 (insert "0:\t" default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 (hm--html-write-alist-in-buffer alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798 (pop-to-buffer buffername))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 (let ((dirnumber (read-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 "Select directory prefix by number: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 (kill-buffer "*html-directories*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803 (expand-file-name (or (cdr (assoc dirnumber alist)) default))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804 (expand-file-name default))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 (defun hm--html-delete-wrong-path-prefix-1 (filename prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 "The function deletes wrong path prefixes."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810 (cond (prefix-list (if (string-match (car prefix-list) filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 (cdr prefix-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 (t filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 (defun hm--html-delete-wrong-path-prefix (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 "The function deletes wrong path prefixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 The path prefixes are specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821 `hm--html-delete-wrong-path-prefix'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 (if (listp hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 (hm--html-delete-wrong-path-prefix-1 filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 hm--html-delete-wrong-path-prefix))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 (defun hm--html-read-filename (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 "The function reads a filename with its directory path,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 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
1836 string will be returned.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 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
1840 a filename (without path). These precede the following.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 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
1842 in a buffer and reads a number from the minbuffer, which selects one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 of the directories (lines) of the buffer. Therefore the ALIST must look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844 like the following alist:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 ((1 . \"/appl/gnu/\") (2 . \"/\"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 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
1847 the DEFAULT directory is selected. If the DEFAULT is nil or \"\" the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 'default-directory' is selected.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 After that the function reads the name of the file from the minibuffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850 Therefore the PROMPT is printed in the minibuffer and the selected directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 is taken as the start of the path of the file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 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
1853 (if parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 (prompt (hm--html-get-prompt-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856 (alist (hm--html-get-alist-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 (default (hm--html-get-default-from-parameter-list parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 (require-match (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 (filename nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 (if (or alist default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 (let ((directory (hm--html-select-directory alist default)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 (setq filename (read-file-name prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 require-match
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 (hm--html-delete-wrong-path-prefix filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 ; (if (not hm--html-delete-wrong-path-prefix)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 ; filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 ; (if (string-match hm--html-delete-wrong-path-prefix filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 ; (substring filename (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879 ; filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880 ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883 (defun hm--html-completing-read (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 "Reads a string with completing-read, if alist is non nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 The PARAMETER-LIST consists of the following elements:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886 PROMPT, ALIST, DEFAULT, REQUIRE-MATCH, EXAMPLE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 If ALIST is nil, it returns the DEFAULT, or if the DEFAULT is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 also nil it returns an empty string."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 (let ((marked-object (hm--html-mark-example parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 (string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 (if (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892 (completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 (hm--html-get-prompt-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 (hm--html-get-alist-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 (hm--html-get-require-match-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 (hm--html-get-default-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 (if (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901 (hm--html-get-default-from-parameter-list parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 ""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903 (hm--html-unmark-example marked-object)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907 (defvar hm--html-faces-exist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 (defun hm--html-generate-help-buffer-faces ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 "Generates faces for the add-link-help-buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 (if (not (facep 'hm--html-help-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 ; (if (not hm--html-faces-exist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 (setq hm--html-faces-exist t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 (make-face 'hm--html-help-face)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1917 (if hm--html-help-foreground
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1918 (set-face-foreground 'hm--html-help-face hm--html-help-foreground))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1919 (if hm--html-help-background
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1920 (set-face-background 'hm--html-help-face hm--html-help-background))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1921 (set-face-font 'hm--html-help-face hm--html-help-font)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 (defun hm--html-get-prompt-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 "Returns the prompt from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 (car parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 (defun hm--html-get-alist-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 "Returns the alist from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 (car (cdr parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 (defun hm--html-get-default-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 "Returns the default from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937 (car (cdr (cdr parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 (defun hm--html-get-require-match-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 "Returns the require-match from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 (car (cdr (cdr (cdr parameter-list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945 (defun hm--html-get-example-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 "Returns the example from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 (car (cdr (cdr (cdr (cdr parameter-list))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 (defun hm--html-get-anchor-seperator-from-parameter-list (parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 "Returns the anchor-seperator from the PARAMETER-LIST."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 (car (cdr (cdr (cdr (cdr (cdr parameter-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 (defun hm--html-generate-add-link-help-buffer (scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 "Generates and displays a help buffer with an example for adding a link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961 (let ((buffername (generate-new-buffer "*Link-Example*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 (pop-to-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 (shrink-window (- (window-height) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 (insert "Example:")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 (newline 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 (if (hm--html-get-example-from-parameter-list scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 scheme-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 (insert ":")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 (insert "//"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 host-name:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982 (if (and (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 (not (string= "/"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 (substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986 (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 servername:port-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 (if (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997 path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 (insert "/"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 (if (hm--html-get-example-from-parameter-list path+file-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 path+file-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003 (if (hm--html-get-example-from-parameter-list anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 (insert (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007 (insert (hm--html-get-example-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 anchor-parameter-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010 buffername
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 (defun hm--html-add-link (function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 anchor-parameter-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 "The function adds a link in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 The parameter FUNCTION-ADD-TAGS determines the function which adds the tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 in the buffer (for example: 'hm--html-add-tags or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023 'hm--html-add-tags-to-region).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 The parameters SCHEME-PARAMETER-LIST, HOST-NAME:PORT-PARAMETER-LIST,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 SERVERNAME:PORT-PARAMETER-LIST, PATH+FILE-PARAMETER-LIST and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 ANCHOR-PARAMETER-LIST are lists with a prompt string, an alist, a default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 value and an example string. The ANCHOR-PARAMETER-LIST has as an additional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 element an anchor seperator string. All these elements are used to read and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 construct the link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030 (let ((point nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 (let ((html-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 (html-help-buffer (hm--html-generate-add-link-help-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034 scheme-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 host-name:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 servername:port-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 path+file-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 (scheme (hm--html-completing-read scheme-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040 (hostname:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 host-name:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 (servername:port (hm--html-completing-read
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043 servername:port-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 (path+file (hm--html-read-filename path+file-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 (anchor (hm--html-completing-read anchor-parameter-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 ; (hrefname (setq html-link-counter (1+ html-link-counter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047 (anchor-seperator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 (hm--html-get-anchor-seperator-from-parameter-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 anchor-parameter-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 (if (not (string= scheme ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 (if (string= hostname:port "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 (setq scheme (concat scheme ":"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 (setq scheme (concat scheme "://"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054 (if (and (not (string= hostname:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 (not (string= servername:port ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 (not (string= (substring servername:port 0 1) "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 (setq servername:port (concat "/" servername:port)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058 (if (and (not (string= path+file ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 (not (string= "/" (substring path+file 0 1))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 (setq path+file (concat "/" path+file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 (if (not (string= anchor ""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 (setq anchor (concat anchor-seperator anchor)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 (kill-buffer html-help-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064 (pop-to-buffer html-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 (eval (list function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 ''hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067 (concat "<A"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 ; "<A Name="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 ; hrefname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 " HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071 scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 path+file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077 ''hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 "</A>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 (setq point (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080 (goto-char (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 (defun hm--html-add-info-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 "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
2085 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 "www.tnt.uni-hannover.de:8005")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 "/appl/lemacs/Global/info/dir")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 "Node: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 "emacs"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 ",")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 (defun hm--html-add-info-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120 "Adds the HTML tags for a link on a GNU Info file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 (hm--html-add-info-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125 (defun hm--html-add-info-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 "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
2127 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 (hm--html-add-info-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 (defun hm--html-add-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132 "Internal function. Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141 "Gateway and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 "www.tnt.uni-hannover.de:8001")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 "quake.think.com:210")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154 hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 "database")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 "searchstring"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 "?")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 (defun hm--html-add-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 "Adds the HTML tags for a link to a WAIS server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 (hm--html-add-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 (defun hm--html-add-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174 "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
2175 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 (hm--html-add-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 (defun hm--html-add-direct-wais-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 "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
2181 This function uses the new direct WAIS support instead of a WAIS 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 "wais"
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 "wais")
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 "Wais Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 hm--html-wais-servername:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194 "quake.think.com:210")
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 "Database: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 hm--html-wais-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 "database")
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 "Searchstring: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 "searchstring"
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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 (defun hm--html-add-direct-wais-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 "Adds the HTML tags for a direct link to a WAIS server.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 (hm--html-add-direct-wais-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 (defun hm--html-add-direct-wais-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 "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
2225 This function uses the new direct WAIS support instead of a WAIS gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 (hm--html-add-direct-wais-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 (defun hm--html-add-html-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231 "Internal function. Adds the HTML tags for a link to an HTML page."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244 "www.tnt.uni-hannover.de:80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 (defun hm--html-add-html-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 "Adds the HTML tags for a link to an HTML file."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 (hm--html-add-html-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 (defun hm--html-add-html-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 "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
2274 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 (hm--html-add-html-link-1 'hm--html-add-tags-to-region))
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 (defun hm--html-add-file-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 "Internal function. Adds the HTML tags for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 "file"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286 "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 t
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 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 "/data/info/www/tnt/overview.html")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 "Anchor: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 '((""))
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 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 "1"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 "#")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 (defun hm--html-add-file-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315 "Adds the HTML tags for a for a filegateway link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 (hm--html-add-file-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 (defun hm--html-add-file-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 "Adds the HTML tags for a for a filegateway link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 (hm--html-add-file-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 (defun hm--html-add-ftp-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 "Internal function. Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332 "ftp"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 "ftp")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 "FTP Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340 "ftp.rrzn.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 ""
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 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352 "/pub/gnu/gcc-2.4.5.tar.gz")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 ""
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 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 (defun hm--html-add-ftp-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 "Adds the HTML tags for a link to an FTP server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 (hm--html-add-ftp-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 (defun hm--html-add-ftp-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 "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
2370 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371 (hm--html-add-ftp-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374 (defun hm--html-add-gopher-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 "Internal function. Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380 "gopher"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 "gopher")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 "Gopher Servername: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 hm--html-gopher-hostname:port-default
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 "newsserver.rrzn.uni-hannover.de:70")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 "Documenttype: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 "/1")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 "Entrypoint: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399 nil
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 "Subject%20Tree"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402 "/")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 (defun hm--html-add-gopher-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 "Adds the HTML tags for a link to a gopher server."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 (hm--html-add-gopher-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 (defun hm--html-add-gopher-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 "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
2413 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 (hm--html-add-gopher-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 (defun hm--html-make-proggate-alist (proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 "Makes a proggate-alist from the PROGGATE-ALLOWED-FILE."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 (if (and (stringp proggate-allowed-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 (file-exists-p proggate-allowed-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 (let ((alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 (buffername (find-file-noselect proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 (while (search-forward-regexp "[^ \t\n]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 (error "ERROR: Can't find the 'hm--html-progate-allowed-file !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 (defun hm--html-add-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 (let ((progname-alist (hm--html-make-proggate-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 hm--html-proggate-allowed-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452 "Servername and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456 "www.tnt.uni-hannover.de:8007")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 (list ; program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 "Programname: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 progname-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 "/usr/ucb/man")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 (list ; Program Parameter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 "Programparameter: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 "8+lpd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 "+"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 (defun hm--html-add-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 (hm--html-add-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 (defun hm--html-add-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 The program is called via the program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 (hm--html-add-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491 (defun hm--html-add-local-proggate-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 "Internal function. Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 "Path/file: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517 hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 "/data/info/programs/lemacs.evlm")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 (defun hm--html-add-local-proggate-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 "Adds the HTML tags for a link to a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 (hm--html-add-local-proggate-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 (defun hm--html-add-local-proggate-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539 "Adds the HTML tags for a link to a program to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 The program is called via the local program gateway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 Email to muenkel@tnt.uni-hannover.de for information over
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 this gateway."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 (hm--html-add-local-proggate-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 (defvar hm--html-newsgroup-alist nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548 "Alist with newsgroups for the newsgateway.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551 (defvar gnus-newsrc-assoc nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 (defun hm--html-make-newsgroup-alist ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 "Makes a hm--html-make-newsgroup-alist from a .newsrc.el file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 The function looks at the environment variable NNTPSERVER.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 If this variable exists, it trys to open the file with the Name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 ~/$NNTPSERVER.el. If this file exists, the alist of the file is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559 returned as the newsgroup-alist. If the file doesn't exist, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 tries to use the file ~/$NNTPSERVER to make the alist. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 returns '((\"\"))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 (if hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 hm--html-newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 (if gnus-newsrc-assoc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565 (setq hm--html-newsgroup-alist gnus-newsrc-assoc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 (if (not (getenv "NNTPSERVER"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568 (let ((newsrc-file (expand-file-name (concat "~/.newsrc-"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 (getenv "NNTPSERVER")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 (if (file-exists-p (concat newsrc-file ".el"))
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 (load-file (concat newsrc-file ".el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 (setq hm--html-newsgroup-alist gnus-newsrc-assoc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 (if (not (file-exists-p newsrc-file))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575 '((""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 (save-window-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 (let ((alist nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 (buffername (find-file-noselect newsrc-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 (set-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 (toggle-read-only)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 (while (search-forward-regexp "[^:!]+" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 (setq alist (append (list (list (buffer-substring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 (match-beginning 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 (match-end 0))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 alist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587 (search-forward-regexp "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 (kill-buffer buffername)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 (setq hm--html-newsgroup-alist alist))))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593 (defun hm--html-add-news-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 "Internal function. Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 (let ((newsgroup-alist (hm--html-make-newsgroup-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 "news"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 "news")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 "NEWS Group: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 newsgroup-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 "comp.emacs.xemacs")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625 (defun hm--html-add-news-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 "Adds the HTML tags for a link to a news group."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 (hm--html-add-news-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631 (defun hm--html-add-news-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 "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
2633 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 (hm--html-add-news-link-1 'hm--html-add-tags-to-region))
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-add-mail-box-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 "Internal function. Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 "http"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 "http")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 "Hostname and Port: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 "www.tnt.uni-hannover.de:8003")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 (list ; servername:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 (list ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659 "Path/File: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 "/data/info/mail/mailbox")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671
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-add-mail-box-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 "Adds the HTML tags for a link to a mail box."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 (hm--html-add-mail-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 (defun hm--html-add-mail-box-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 "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
2681 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682 (hm--html-add-mail-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 (defun hm--html-add-mailto-link-1 (function-add-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 "Internal function. Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687 (let ((mailto-alist (if (and (boundp 'user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 (cons (list user-mail-address)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 hm--html-mailto-alist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 hm--html-mailto-alist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 (hm--html-add-link function-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 (list ; scheme
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 "mailto"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 "mailto")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 (list ; hostname:port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 (list ; servername:port
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2706 "Mailaddress: "
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 mailto-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 "muenkel@tnt.uni-hannover.de")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 nil ; path/file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712 (list ; anchor
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 ""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 (defun hm--html-add-mailto-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 "Adds the HTML tags for a mailto link."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 (hm--html-add-mailto-link-1 'hm--html-add-tags))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726 (defun hm--html-add-mailto-link-to-region ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 "Adds the HTML tags for a mailto link to the region."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 (hm--html-add-mailto-link-1 'hm--html-add-tags-to-region))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2731 (defun hm--html-add-relative-link (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2732 "Adds the HTML tags for a relative link at the current point."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2733 (interactive (list (read-file-name "Relative Filename: "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2734 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2735 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2736 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2737 "")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2738 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2739 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2740 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2741 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2742 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2743 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2744
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2745 (defun hm--html-add-relative-link-to-region (relative-file-path)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2746 "Adds the HTML tags for a relative link to the region."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2747 (interactive (list (read-file-name "Relative Filename: "
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2748 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2749 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2750 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2751 "")))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 (concat "<A HREF=\""
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2754 relative-file-path
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2755 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2756 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2757 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2758
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2759 (defun hm--html-add-normal-link (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2760 "Adds the HTML tags for a normal general link.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2761 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2762 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2763 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2764 (hm--html-add-tags 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2765 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2766 link-object
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2767 "\">")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2768 'hm--html-insert-end-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2769 "</A>"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2770
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2771 (defun hm--html-add-normal-link-to-region (link-object)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2772 "Adds the HTML tags for a normal general link to region.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2773 Single argument LINK-OBJECT is value of HREF in the new anchor.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2774 Mark is set after anchor."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2775 (interactive "sNode Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2776 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2777 (concat "<A HREF=\""
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2778 ; (read-string "Link to: ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2779 link-object
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782 "</A>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 (defun hm--html-add-normal-node-link ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 "Adds the HTML tags for a normal node link (<LINK...>) at the point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 (hm--html-insert-start-tag (concat "<LINK HREF=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 (read-string "Node Link to: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790 "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793 ;;; Functions to update the date and the changelog entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 (defun hm--html-maybe-new-date-and-changed-comment ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 "Hook function which updates the date in the title line, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 'hm--html-automatic-new-date' is t and which inserts a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799 \"changed comment\" line, if 'hm--html-automatic-changed-comment' is t."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 (if hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801 (hm--html-new-date))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 (if hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2803 (hm--html-insert-changed-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2805
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2806 (defun hm--html-new-date ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2807 "The function sets the date in the title line up."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2808 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2809 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2810 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2811 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2812 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2813 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2814 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2815 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2816 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2817 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2818 (if (re-search-forward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2819 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2820 "\\((\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2821 "\\([ \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
2822 "\\()[ \t\n]*</title>\\)")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2823 end-of-head
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2824 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2825 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2826 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2827 (goto-char (match-beginning 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2828 (insert (hm--date)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2829
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2830
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2831 (defun hm--html-insert-created-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2832 "The function inserts a \"created comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2833 The comment looks like <!-- Created by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2834 The comment will be inserted after the title line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2835 An error message is printed, if there is no title line and if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2836 noerror is nil."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2837 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2838 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2839 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2840 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2841 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2842 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2843 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2844 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2845 (point-max)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2846 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2847 (if (not (search-forward "</title>" end-of-head t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2848 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2849 (error "ERROR: Please insert a title in the document !"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2850 (let ((end-of-title-position (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2851 (if (search-forward "<!-- Created by: " end-of-head t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2852 (if (yes-or-no-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2853 "Replace the old comment \"<!-- Created by: \" ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2854 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2855 (goto-char (match-beginning 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2856 (kill-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2857 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2858 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2859 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2860 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2861 (hm--date))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2862 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2863 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2864 (insert "Created by: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2865 (or hm--html-username (user-full-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2866 ", "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2867 (hm--date)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2868 )))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2870
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2871 (defun hm--html-insert-changed-comment-1 (newline username)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2872 "Internal function of 'hm--html-insert-changed-comment'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2873 Inserts a newline if NEWLINE is t, before the comment is inserted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2874 USERNAME is the name to be inserted in the comment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2875 (if newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2876 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2877 ; (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2878 (newline)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2879 (hm--html-add-comment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2880 (insert "Changed by: " username ", " (hm--date)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2882 (defun hm--html-insert-changed-comment (&optional noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2883 "The function inserts a \"changed comment\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2884 The comment looks like <!-- Changed by: Heiko Münkel, 10-Dec-1993 -->.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2885 The comment will be inserted after the last \"changed comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2886 if there isn't such a line, after the \"created comment\" line, or,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2887 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
2888 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
2889 or the beginning of the body.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2890 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
2891 by the new one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2893 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
2894 else in such a line !"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2895 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2896 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2897 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2898 (let ((case-fold-search t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2899 (end-of-head (if (search-forward "</head>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2900 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2901 (if (search-forward "<body>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2902 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2903 (point-max))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2904 (username (or hm--html-username (user-full-name))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2905 (goto-char end-of-head)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2906 (if (search-backward "<!-- Changed by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2907 (if (string-match username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2908 (buffer-substring (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2909 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2910 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2911 (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2912 ;; exchange the comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2913 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2914 (beginning-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2915 (delete-region (point) (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2916 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2917 (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2918 (hm--html-insert-changed-comment-1 nil username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2919 ;; new comment line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2920 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2921 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2922 (if (search-backward "<!-- Created by: " nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2923 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2924 (end-of-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2925 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2926 (if (search-backward "</title>" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2927 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2928 (goto-char (match-end 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2929 (if (not (looking-at "\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2930 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2931 (newline)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2932 (forward-char -1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2933 (hm--html-insert-changed-comment-1 t username))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2934 (if (not noerror)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2935 (error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2936 "ERROR: Insert at first a title in the document !"))))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2939
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2940 ;;; Functions to insert templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2942 (defvar hm--html-template-file-history nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2943 "Historvariable for the template files.")
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-insert-template (filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2946 "Inserts a templatefile."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2947 (interactive (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2948 (let ((file-name-history hm--html-template-file-history))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2949 (read-file-name "Templatefile: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2950 hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2951 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2952 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2953 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2954 ; 'hm--html-template-file-history)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2955 (insert-file (expand-file-name filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2956 (if hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2957 (tmpl-expand-templates-in-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2958 (if hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2959 (hm--html-insert-created-comment t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2960
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2963 ;;; Functions for highlighting
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-toggle-use-highlighting ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2966 ; "Toggles the variable html-use-highlighting."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2967 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2968 ; (if html-use-highlighting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2969 ; (setq html-use-highlighting nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2970 ; (setq html-use-highlighting t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2971
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2973 ;;; Functions for font lock mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2974
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
2975 (if (adapt-emacs19p)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2976 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2977 (make-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2978 (make-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2979 (make-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2980 (or (face-differs-from-default-p 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2981 (copy-face 'font-lock-comment-face 'font-lock-doc-string-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2982 (or (face-differs-from-default-p 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2983 (copy-face 'italic 'font-lock-comment-face))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2984 (or (face-differs-from-default-p 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2985 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2986 (copy-face 'font-lock-doc-string-face 'font-lock-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2987 (set-face-underline-p 'font-lock-string-face t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2988 (setq font-lock-comment-face 'font-lock-comment-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2989 ;; (setq font-lock-doc-string-face 'font-lock-doc-string-face)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2990 (setq font-lock-string-face 'font-lock-string-face)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2991
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2993 ;(defun hm--html-set-font-lock-color ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2994 ; "Sets the color for the font lock mode in HTML mode.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2995 ;This color is used to highlight HTML expressions."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2996 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2997 ; (setq hm--html-font-lock-color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2998 ; (completing-read "Color: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2999 ; '(("grey80")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3000 ; ("black")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3001 ; ("red")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3002 ; ("yellow")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3003 ; ("blue"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3004 ; nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3005 ; nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3006 ; "black"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3007 ; (set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3008 ; (set-face-foreground 'font-lock-string-face hm--html-font-lock-color))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3009
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3011 ;;; Functions which determine if an active region exists
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3012
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3013 ;(defvar hm--region-active nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3014 ; "t : Region is active.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3015 ;nil: Region is inactive.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3016 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3017 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3018 ;(defun hm--set-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3019 ; (setq hm--region-active t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3020 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3021 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3022 ;(defun hm--unset-hm--region-active ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3023 ; (setq hm--region-active nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3024
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3026
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3027 ;;; Functions to insert forms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3028
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3029 (defun hm--html-form-read-method ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3030 "Reads the method for a form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3031 (completing-read "Method of the form: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3032 '(("POST") ("GET"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3033 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3034 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3035 "POST"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3036
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3038 (defun hm--html-form-read-action (method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3039 "Reads the URL for the action attribute of a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3040 It returns nil if no action attribute is wanted.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3041 METHOD is the method of the form."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3042 (if (y-or-n-p "Current document URL as action attribute ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3043 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3044 (hm--html-read-url "Query server URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3045 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3046 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3047 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3048 (hm--html-read-url-predicate table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3049 (car
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3050 (read-from-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3051 method)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3052 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3053 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3055
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3056 (defun hm--html-add-form (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3057 "Adds the HTML tags for a form.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3058 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3059 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3060 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3061 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3062 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3063 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3064 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3065 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3066 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3067 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3068 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3069 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3070 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3071 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3072 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3073 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3074 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3075
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3076
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3077 (defun hm--html-add-form-to-region (&optional method)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3078 "Adds the HTML tags for a form to a region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3079 The function asks only for a method, if METHOD is nil, otherwise
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3080 the METHOD must have one of the values \"GET\" or \"POST\"."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3081 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3082 (let* ((method (or method (hm--html-form-read-method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3083 (action (hm--html-form-read-action method)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3084 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3085 (concat "<FORM METHOD=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3086 method
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3087 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3088 (if action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3089 (concat " ACTION=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3090 action
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3091 "\"")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3092 "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3093 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3094 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3095 "</FORM>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3096
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3097
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3098 (defun hm--html-form-read-name (&optional last-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3099 "Reads the name for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3100 (read-string "Symbolic name: " last-name))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3103 (defun hm--html-form-read-value (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3104 "Reads the value for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3105 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3108 (defun hm--html-form-read-checked ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3109 "Reads whether a button is checked by default or not."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3110 (y-or-n-p "Should the button be checked by default ? "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3113 (defun hm--html-form-read-size ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3114 "Reads the size of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3115 (if (y-or-n-p "Defaultsize of the Inputfield ? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3116 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3117 (format "%d,%d"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3118 (read-number "Width of the input field: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3119 (read-number "Height of the input field: " t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3122 (defun hm--html-form-read-maxlength ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3123 "Reads the maxlength of text entry fields of input tags."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3124 (let ((maxlength (read-number "Maximum number of chars (0 = unlimited): "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3125 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3126 (if (<= maxlength 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3127 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3128 (int-to-string maxlength))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3131 (defun hm--html-form-read-src (prompt &optional initial-contents)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3132 "Reads the src for an input tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3133 (read-string prompt initial-contents))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3136 (defun hm--html-form-add-input (type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3137 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3138 value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3139 checked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3140 size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3141 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3142 &optional src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3143 "Adds the HTML tags for an input tag to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3144 (hm--html-insert-start-tag (concat "<INPUT TYPE=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3145 type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3146 "\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3147 (if (and name (not (string= name "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3148 (concat " NAME=\"" name "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3149 (if (and value (not (string= value "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3150 (concat " VALUE=\"" value "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3151 (if checked " CHECKED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3152 (if (and size (not (string= size "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3153 (concat " SIZE=" size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3154 (if (and maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3155 (not (string= maxlength "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3156 (concat " MAXLENGTH="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3157 maxlength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3158 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3159 (if (and src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3160 (not (string= src "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3161 (concat " SRC=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3162 src
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3163 "\""))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3164 ">")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3167 (defun hm--html-form-add-input-text (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3168 "Adds the HTML tags for a text input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3169 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3170 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3171 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3172 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3173 (hm--html-form-add-input "text" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3176 (defun hm--html-form-add-input-password (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3177 "Adds the HTML tags for a password input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3178 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3179 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3180 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3181 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3182 (hm--html-form-add-input "password" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3185 (defun hm--html-form-add-input-integer (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3186 "Adds the HTML tags for a integer input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3187 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3188 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3189 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3190 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3191 (hm--html-form-add-input "int" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3193
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3194 (defun hm--html-form-add-input-float (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3195 "Adds the HTML tags for a float input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3196 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3197 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3198 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3199 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3200 (hm--html-form-add-input "float" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3201
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3203 (defun hm--html-form-add-input-date (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3204 "Adds the HTML tags for a date input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3205 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3206 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3207 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3208 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3209 (hm--html-form-add-input "date" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3212 (defun hm--html-form-add-input-url (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3213 "Adds the HTML tags for a url input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3214 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3215 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3216 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3217 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3218 (hm--html-form-add-input "url" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3221 (defun hm--html-form-add-input-scribble (name value size maxlength)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3222 "Adds the HTML tags for a scribble input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3223 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3224 (hm--html-form-read-value "Defaultvalue: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3225 (hm--html-form-read-size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3226 (hm--html-form-read-maxlength)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3227 (hm--html-form-add-input "scribble" name value nil size maxlength))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3230 (defun hm--html-form-add-input-checkbox (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3231 "Adds the HTML tags for a checkbox button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3232 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3233 (hm--html-form-read-value "Checkbox value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3234 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3235 (hm--html-form-add-input "checkbox" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3238 (defvar hm--html-last-radio-button-name nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3239 "Name of the last radio button.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3240
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3242 (defun hm--html-form-add-input-radio (name value checked)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3243 "Adds the HTML tags for a radio button."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3244 (interactive (list (hm--html-form-read-name hm--html-last-radio-button-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3245 (hm--html-form-read-value "Radiobutton value: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3246 (hm--html-form-read-checked)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3247 (setq hm--html-last-radio-button-name name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3248 (hm--html-form-add-input "radio" name value checked nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3251 (defun hm--html-form-add-input-submit (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3252 "Adds the HTML tags for a submit input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3253 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3254 "Label of the submit button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3255 "Submit")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3256 (hm--html-form-add-input "submit" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3258
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3259 (defun hm--html-form-add-input-image (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3260 "Adds the HTML tags for an image input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3261 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3262 (hm--html-read-url "Image URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3263 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3264 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3265 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3266 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3267 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3268 'IMAGE)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3269 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3270 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3271 (hm--html-form-add-input "IMAGE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3272 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3273 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3274 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3275 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3276 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3277 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3279
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3280 (defun hm--html-form-add-input-audio (name src)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3281 "Adds the HTML tags for an audio input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3282 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3283 (hm--html-read-url "Audio URL: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3284 hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3285 (function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3286 (lambda (table-element-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3287 (hm--html-read-url-predicate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3288 table-element-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3289 'AUDIO)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3290 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3291 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3292 (hm--html-form-add-input "AUDIO"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3293 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3294 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3295 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3296 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3297 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3298 src))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3300
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3301 (defun hm--html-form-add-input-reset (value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3302 "Adds the HTML tags for a reset input field."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3303 (interactive (list (hm--html-form-read-value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3304 "Label of the reset button: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3305 "Reset")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3306 (hm--html-form-add-input "reset" nil value nil nil nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3309 (defun hm--html-form-add-input-isindex (size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3310 "Adds the HTML tags for an isindex input field.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3311 Size is the value of the input field wide."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3312 (interactive "nWidth of the input field (i.e: 20): ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3313 (hm--html-insert-start-tag (concat "<INPUT NAME=\"isindex\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3314 (if (= size 20)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3315 ">"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3316 (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3317 " SIZE=%d>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3318 size)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3319
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-form-add-select-option-menu (name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3322 "Adds the HTML tags for a select option menu to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3323 (interactive (list (hm--html-form-read-name)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3324 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3325 (concat "<SELECT NAME=\"" name "\">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3326 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3327 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3328 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3329 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3330
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3332 (defun hm--html-form-add-select-scrolled-list (name listsize multiple)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3333 "Adds the HTML tags for a select scrolled list to the buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3334 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3335 (read-number "No of visible items (>1): " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3336 (y-or-n-p "Multiple selections allowed ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3337 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3338 (concat "<SELECT NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3339 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3340 "\" SIZE="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3341 (int-to-string listsize)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3342 (if multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3343 " MULTIPLE")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3344 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3345 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3346 "</SELECT>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3347 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3348 "<OPTION> "))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3349
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-form-add-select-option (selected-by-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3352 "Adds the tags for an option in a select form menu."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3353 (interactive (list (y-or-n-p "Select this option by default ? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3354 (hm--html-insert-end-tag-with-newline (concat "<OPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3355 (if selected-by-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3356 " SELECTED")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3357 "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3360 (defun hm--html-form-add-textarea (name rows columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3361 "Adds the tags for a textarea tag."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3362 (interactive (list (hm--html-form-read-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3363 (read-number "Number of Rows of the Textarea: " t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3364 (read-number "Number of Columns of the Textarea: " t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3365 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3366 (concat "<TEXTAREA NAME=\""
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3367 name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3368 "\" ROWS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3369 (int-to-string rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3370 " COLS="
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3371 (int-to-string columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3372 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3373 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3374 "</TEXTAREA>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3375
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3376
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3377 ;;; Functions to insert tables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3378
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3379 (defun hm--html-add-table (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3380 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3381 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3382 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
3383 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3384 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3385 (hm--html-add-tags 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3386 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3387 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3388 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3389 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3390 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3391 "</TABLE>")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3392 (backward-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3394
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3395 (defun hm--html-add-table-to-region (border compact)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3396 "Add the HTML tags for a table frame.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3397 If BORDER is t, then the table should be drawn with a border.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3398 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
3399 (interactive (list (y-or-n-p "Use a table with a border? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3400 (y-or-n-p "Use a small table? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3401 (hm--html-add-tags-to-region 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3402 (concat "<TABLE"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3403 (if border " border" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3404 (if compact " compact" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3405 ">")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3406 'hm--html-insert-start-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3407 "</TABLE>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3410 (defun hm--html-add-table-title (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3411 "Adds the HTML tag for a table title at the current point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3412 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
3413 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3414 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3415 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3416 (concat "\n<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3417 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3418 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3419 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3420 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3421
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3423 (defun hm--html-add-table-title-to-region (top)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3424 "Adds the HTML tag for a table title to the region.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3425 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
3426 bottom of the table."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3427 (interactive (list (y-or-n-p "Put the title at the table top? ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3428 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3429 (concat "<CAPTION"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3430 (if top " align=top" " align=bottom")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3431 "> ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3432 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3433 " </CAPTION>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3435
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3436 (defvar hm--html-table-alignment-alist '(("default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3437 ("left")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3438 ("right")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3439 ("center"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3440 "Alist with table alignments.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3442 (defun hm--html-table-read-cell-entries-and-alignments (cell-no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3443 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3444 &optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3445 alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3446 "Reads the alignments and the entries for NO-OF-CELLS cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3447 The return is a list with strings of the form: \"align=left> entry\".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3448 CELL-NO is the current cell no.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3449 If (car ALIGNMENT-LIST) is non-nil, then it is used as alignment."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3450 (if (> cell-no no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3451 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3452 (let ((alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3453 (or (car alignment-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3454 (completing-read (format "Alignment of the %d. cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3455 cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3456 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3457 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3458 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3459 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3460 (entry (read-string (format "Entry of the %d. cell: " cell-no))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3461 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3462 (setq alignment "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3463 (setq alignment (concat " align=" alignment)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3464 (cons (concat alignment "> " entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3465 (hm--html-table-read-cell-entries-and-alignments (1+ cell-no)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3466 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3467 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3468 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3469 ))))
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-add-table-header (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3472 "Adds the HTML tags for a complete simple table header line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3473 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3474 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3475 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3476 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3477 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3478 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3479 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3480 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3481 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3482 (concat "<TH" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3483 (hm--html-table-read-cell-entries-and-alignments 1 no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3484 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3485 " <TR>")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3488 (defun hm--html-add-first-table-row (no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3489 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3490 It asks for the number of cells and the allignment of the cells.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3491 The number of cells can also be given as prefix argument."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3492 (interactive "NNo of cells in a row: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3493 (if (< no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3494 (error "ERROR: There must be at least one cell in a row!"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3495 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3496 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3497 (concat "<TD" (car (hm--html-table-read-cell-entries-and-alignments 1 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3498 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3499 (if (<= no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3500 "<TR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3501 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3502 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3503 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3504 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3505 2 no-of-cells)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3506 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3507 " <TR>")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3510 (defun hm--html-table-get-previous-alignments ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3511 "Returns a list with the alignments of the previous table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3512 The row must be a data row and not a header row!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3513 An example for the return list: '(\"left\" \"default\" \"center\" \"right\")"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3514 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3515 (let* ((point-of-view (point))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3516 (end-of-last-row (search-backward "<tr>" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3517 (begin-of-last-row (progn (search-backward "<tr" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3518 (search-forward "<td" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3519 (match-beginning 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3520 (alignment-list nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3521 (if (not (search-forward "<td" end-of-last-row t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3522 (error "Error: No previous data row found!")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3523 (goto-char end-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3524 (while (> (point) begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3525 (let ((cell-start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3526 (search-backward-regexp "\\(<td[^>]*>\\)\\|\\(<th[^>]*>\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3527 begin-of-last-row
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3528 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3529 (if (not cell-start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3530 (goto-char begin-of-last-row)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3531 (setq alignment-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3532 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3533 (if (search-forward-regexp "\\(align=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3534 (match-end 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3535 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3536 (buffer-substring (match-beginning 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3537 (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3538 "default")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3539 alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3540 (goto-char cell-start))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3541 alignment-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3543
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3544 (defun hm--html-add-additional-table-row ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3545 "Adds the HTML tags for a table row.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3546 It tries to detect the number of cells and their alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3547 from existing rows of the table."
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 (let* ((old-alignment-list (hm--html-table-get-previous-alignments))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3550 (no-of-cells (length old-alignment-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3551 (hm--html-add-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3552 'hm--html-insert-end-tag-with-newline
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3553 (concat "<TD" (car (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3554 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3555 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3556 old-alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3557 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3558 (if (<= no-of-cells 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3559 "<TR>"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3560 (concat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3561 (mapconcat '(lambda (entry)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3562 (concat "<TD" entry))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3563 (hm--html-table-read-cell-entries-and-alignments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3564 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3565 no-of-cells
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3566 (cdr old-alignment-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3567 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3568 " <TR>"))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3569
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-add-row-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3572 "Adds the HTML tag for a table row entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3573 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3574 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3575 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3576 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3577 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3578 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3579 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3580 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3581 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3582 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3585 (defun hm--html-add-header-entry (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3586 "Adds the HTML tag for a table header entry at the current point."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3587 (interactive (list (completing-read "Alignment of the cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3588 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3589 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3590 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3591 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3592 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3593 (concat "<TH"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3594 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3595 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3596 (concat " align=" alignment "> ")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3599 (defun hm--html-add-row-frame (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3600 "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
3601 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3602 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3603 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3604 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3605 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3606 (hm--html-add-tags 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3607 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3608 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3609 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3610 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3611 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3612 "<TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3615 (defun hm--html-add-row-frame-to-region (alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3616 "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
3617 (interactive (list (completing-read "Alignment of the start cell: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3618 hm--html-table-alignment-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3619 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3620 t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3621 "default")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3622 (hm--html-add-tags-to-region 'hm--html-insert-start-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3623 (concat "<TD"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3624 (if (string= "default" alignment)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3625 "> "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3626 (concat " align=" alignment "> ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3627 'hm--html-insert-end-tag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3628 " <TR>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3630
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3631 (defun hm--html-table-add-colspan-attribute (columns)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3632 "Adds a colspawn attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3633 A prefix arg is used as no of COLUMNS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3634 (interactive "NNo of columns, spaned by this cell: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3635 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3636 (if (and (search-backward "<" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3637 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3638 (if (search-forward-regexp "\\([ \t\n]+colspan=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3639 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3640 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3641 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3642 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3643 (insert (format "\"%d\"" columns)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3644 (insert (format " colspan=\"%d\"" columns)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3645 (error "ERROR: Point not in a table cell!"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3647
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3648 (defun hm--html-table-add-rowspan-attribute (rows)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3649 "Adds a rowspan attribute to a table cell.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3650 A prefix arg is used as no of ROWS."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3651 (interactive "NNo of rows, spaned by this cell: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3652 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3653 (if (and (search-backward "<" nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3654 (search-forward-regexp "<[ \t\n]*\\(th\\)\\|\\(td\\)" nil t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3655 (if (search-forward-regexp "\\([ \t\n]+rowspan=\\)\\([^ \t\n>]*\\)"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3656 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3657 t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3658 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3659 (delete-region (match-beginning 2) (match-end 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3660 (insert (format "\"%d\"" rows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3661 (insert (format " rowspan=\"%d\"" rows)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3662 (error "ERROR: Point not in a table cell!"))))
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 ;;; ISO-Characters for Emacs HTML-mode (Berthold Crysmann)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3666 ;(setq buffer-invisibility-spec '(hm--html-iso-entity-invisible-flag))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3667
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3668 ;(defvar hm--html-iso-entity-invisible-flag t
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3669 ; "Controls the visibility of the iso entities.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3670
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3671 ;(defvar hm--html-iso-glyph-invisible-flag nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3672 ; "Controls the visibility of the iso character glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3673
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3674 ;(defvar hm--html-glyph-cache nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3675 ; "Internal variable. An assoc list with the already created glyphs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3676
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3677 ;(defun hm--html-create-glyph (string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3678 ; "Creates a glyph from the string or returns an existing one.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3679 ;The glyph is stored in `hm--html-glyph-cache'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3680 ; (if nil ;(assoc string hm--html-glyph-cache)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3681 ; (cdr (assoc string hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3682 ; (let ((glyph (make-glyph string)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3683 ; (setq hm--html-glyph-cache (cons (cons string glyph)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3684 ; hm--html-glyph-cache))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3685 ; glyph)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3686
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3687 ;(defun hm--html-attach-glyph-to-region (start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3688 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3689 ; string
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3690 ; region-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3691 ; glyph-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3692 ; "Make the region invisible and attach a glyph STRING.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3693 ;The invisible flags could be used, to toggle the visibility."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3694 ; (mapcar 'delete-annotation (annotations-at end)) ; delete old anotations
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3695 ; ;; delete old extents
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3696 ; (let ((extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3697 ; (annotation nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3698 ; (set-extent-property extent 'invisible region-invisible-flag)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3699 ; (set-extent-property extent 'end-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3700 ; (set-extent-property extent 'start-open t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3701 ; (set-extent-property extent 'intangible t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3702 ; (setq annotation (make-annotation "Hallo Du da" ;(hm--html-create-glyph string)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3703 ; end
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3704 ; 'text))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3705 ; (goto-char end)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3706
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3707
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3708 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3709 ; "Inserts an iso char as html ENTITY and displays a glyph.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3710 ;The glyph is created from the string CHAR."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3711 ; (let ((start (point)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3712 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3713 ; (hm--html-attach-glyph-to-region start
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3714 ; (point)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3715 ; char
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3716 ; 'hm--html-iso-entity-invisible-flag
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3717 ; 'hm--html-iso-glyph-invisible-flag)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3718
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3719 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3720 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3721 ; (hm--html-insert-iso-char-as-entity-and-glyph "ü" "&uuml;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3722
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3723
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3724 ;(defun hm--html-insert-iso-char-as-entity-and-glyph (char entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3725 ; (let ((start (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3726 ; (end nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3727 ; (extent nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3728 ; (insert entity)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3729 ; (setq end (point))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3730 ; (setq extent (make-extent start end))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3731 ; (set-extent-begin-glyph extent char)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3732 ; (set-extent-property extent 'invisible t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3733
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3734 ;(defun hm--html_ue ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3735 ; (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
3736 ; (hm--html-insert-iso-char-as-entity-and-glyph ?ü "&uuml;"))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3737
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3738 (defun hm--html_ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3739 "Insert the character 'ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3740 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3741 (insert "&uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3742
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3743 (defun hm--html_oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3744 "Insert the character 'oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3745 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3746 (insert "&ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3748 (defun hm--html_ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3749 "Insert the character 'ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3750 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3751 (insert "&auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3752
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3753 (defun hm--html_aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3754 "Insert the character 'aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3755 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3756 (insert "&aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3757
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3758 (defun hm--html_Ue ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3759 "Insert the character 'Ue'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3760 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3761 (insert "&Uuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3762
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3763 (defun hm--html_Oe ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3764 "Insert the character 'Oe'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3765 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3766 (insert "&Ouml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3768 (defun hm--html_Ae ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3769 "Insert the character 'Ae'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3770 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3771 (insert "&Auml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3773 (defun hm--html_Aa ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3774 "Insert the character 'Aa'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3775 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3776 (insert "&Aring;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3777
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3778 (defun hm--html_sz ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3779 "Insert the character 'sz'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3780 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3781 (insert "&szlig;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3783 (defun hm--html_aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3784 "Insert the character 'aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3785 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3786 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3787
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3788 (defun hm--html_eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3789 "Insert the character 'eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3790 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3791 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3792
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3793 (defun hm--html_iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3794 "Insert the character 'iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3795 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3796 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3798 (defun hm--html_oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3799 "Insert the character 'oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3800 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3801 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3802
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3803 (defun hm--html_uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3804 "Insert the character 'uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3805 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3806 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3808 (defun hm--html_Aacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3809 "Insert the character 'Aacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3810 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3811 (insert "&aacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3813 (defun hm--html_Eacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3814 "Insert the character 'Eacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3815 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3816 (insert "&eacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3817
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3818 (defun hm--html_Iacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3819 "Insert the character 'Iacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3820 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3821 (insert "&iacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3822
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3823 (defun hm--html_Oacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3824 "Insert the character 'Oacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3825 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3826 (insert "&oacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3828 (defun hm--html_Uacute ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3829 "Insert the character 'Uacute'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3830 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3831 (insert "&uacute;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3832
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3833 (defun hm--html_agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3834 "Insert the character 'agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3835 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3836 (insert "&agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3837
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3838 (defun hm--html_egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3839 "Insert the character 'egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3840 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3841 (insert "&egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3843 (defun hm--html_igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3844 "Insert the character 'igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3845 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3846 (insert "&igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3847
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3848 (defun hm--html_ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3849 "Insert the character 'ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3850 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3851 (insert "&ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3852
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3853 (defun hm--html_ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3854 "Insert the character 'ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3855 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3856 (insert "&ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3857
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3858 (defun hm--html_Agrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3859 "Insert the character 'Agrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3860 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3861 (insert "&Agrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3862
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3863 (defun hm--html_Egrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3864 "Insert the character 'Egrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3865 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3866 (insert "&Egrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3867
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3868 (defun hm--html_Igrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3869 "Insert the character 'Igrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3870 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3871 (insert "&Igrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3873 (defun hm--html_Ograve ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3874 "Insert the character 'Ograve'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3875 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3876 (insert "&Ograve;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3877
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3878 (defun hm--html_Ugrave ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3879 "Insert the character 'Ugrave'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3880 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3881 (insert "&Ugrave;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3882
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3883 (defun hm--html_ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3884 "Insert the character 'ccedilla'."
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 (insert "&ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3888 (defun hm--html_Ccedilla ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3889 "Insert the character 'Ccedilla'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3890 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3891 (insert "&Ccedilla;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3893 (defun hm--html_atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3894 "Insert the character 'atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3895 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3896 (insert "&atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3897
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3898 (defun hm--html_otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3899 "Insert the character 'otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3900 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3901 (insert "&otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3903 (defun hm--html_ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3904 "Insert the character 'ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3905 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3906 (insert "&ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3908 (defun hm--html_Atilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3909 "Insert the character 'Atilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3910 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3911 (insert "&Atilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3912
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3913 (defun hm--html_Otilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3914 "Insert the character 'Otilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3915 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3916 (insert "&Otilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3918 (defun hm--html_Ntilde ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3919 "Insert the character 'Ntilde'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3920 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3921 (insert "&Ntilde;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3922
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3923 (defun hm--html_acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3924 "Insert the character 'acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3925 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3926 (insert "&acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3927
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3928 (defun hm--html_ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3929 "Insert the character 'ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3930 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3931 (insert "&ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3933 (defun hm--html_icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3934 "Insert the character 'icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3935 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3936 (insert "&icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3938 (defun hm--html_ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3939 "Insert the character 'ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3940 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3941 (insert "&ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3942
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3943 (defun hm--html_ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3944 "Insert the character 'ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3945 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3946 (insert "&ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3947
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3948 (defun hm--html_Acircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3949 "Insert the character 'Acircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3950 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3951 (insert "&Acircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3952
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3953 (defun hm--html_Ecircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3954 "Insert the character 'Ecircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3955 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3956 (insert "&Ecircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3958 (defun hm--html_Icircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3959 "Insert the character 'Icircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3960 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3961 (insert "&Icircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3962
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3963 (defun hm--html_Ocircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3964 "Insert the character 'Ocircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3965 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3966 (insert "&Ocircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3968 (defun hm--html_Ucircumflex ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3969 "Insert the character 'Ucircumflex'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3970 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3971 (insert "&Ucircumflex;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3973 (defun hm--html_ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3974 "Insert the character 'ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3975 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3976 (insert "&euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3977
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3978 (defun hm--html_idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3979 "Insert the character 'idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3980 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3981 (insert "&iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3983 (defun hm--html_Ediaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3984 "Insert the character 'Ediaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3985 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3986 (insert "&Euml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3987
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3988 (defun hm--html_Idiaeresis ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3989 "Insert the character 'Idiaeresis'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3990 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3991 (insert "&Iuml;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3993 (defun hm--html_thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3994 "Insert the character 'thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3995 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3996 (insert "&thorn;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3998 (defun hm--html_Thorn ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3999 "Insert the character 'Thorn'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4000 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4001 (insert "&THORN;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4002
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4003 (defun hm--html_eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4004 "Insert the character 'eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4005 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4006 (insert "&eth;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4008 (defun hm--html_Eth ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4009 "Insert the character 'Eth'."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4010 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4011 (insert "&ETH;"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4012
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4014 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4015 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4016 ; smart functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4017
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4018 (defvar hm--just-insert-less-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4019 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4020
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4021 (defun hm--html-less-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4022 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4023 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4024 (insert "&lt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4025
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4026 (defun hm--html-smart-less-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4027 "Insert a '<' or the entity '&lt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4028 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4029 (if (and (eq last-command 'hm--html-smart-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4030 hm--just-insert-less-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4031 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4032 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4033 (hm--html-less-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4034 (setq hm--just-insert-less-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4035 (insert ?<)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4036 (setq hm--just-insert-less-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4038 (defvar hm--just-insert-greater-than nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4039 "Internal variable.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4040
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4041 (defun hm--html-greater-than ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4042 "Inserts the entity '&gt;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4043 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4044 (insert "&gt;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4045
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4046 (defun hm--html-smart-greater-than ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4047 "Insert a '>' or the entity '&gt;' if you execute this command twice."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4048 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4049 (if (and (eq last-command 'hm--html-smart-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4050 hm--just-insert-greater-than)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4051 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4052 (delete-char -1)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4053 (hm--html-greater-than)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4054 (setq hm--just-insert-greater-than nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4055 (insert ?>)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4056 (setq hm--just-insert-greater-than t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4057
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4058
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4059 (defvar hm--just-insert-ampersand nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4060 "Internal variable.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4061
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4062 (defun hm--html-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4063 "Inserts the entity '&amp;'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4064 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4065 (insert "&amp;"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4066
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4067 (defun hm--html-smart-ampersand ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4068 "Insert a '&' or the entity '&amp;' if you execute this command twice."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4069 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4070 (if (and (eq last-command 'hm--html-smart-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4071 hm--just-insert-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4072 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4073 (delete-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4074 (hm--html-ampersand)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4075 (setq hm--just-insert-ampersand nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4076 (insert ?&)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4077 (setq hm--just-insert-ampersand t)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4078
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4079
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4080 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4081 ; sending the contents of a html buffer to netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4082 ; (Thanks to Adrian Aichner for providing this function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4084 (defun hm--html-send-buffer-to-netscape (buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4085 &optional new-netscape new-window)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4086 "View html buffer with Netscape.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4087 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
4088 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4089 (require 'vm)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4090 (if new-netscape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4091 (vm-run-background-command vm-netscape-program buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4092 (or (equal 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4093 (vm-run-command vm-netscape-program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4094 "-remote"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4095 (concat "openURL(file://localhost"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4096 buffer-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4097 (if new-window ", new-window" "")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4098 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4099 (hm--html-send-buffer-to-netscape buffer t new-window))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4103 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4104 ; some other usefull functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4105 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4107 (defun hm--html-remove-numeric-names ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4108 "Remove the number in numbered links in the current buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4109 Eg: the string \"Name=3\". The function asks the user every time whether
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4110 the number should be removed."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4111 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4112 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4113 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4114 (query-replace-regexp "name=\"?[0-9]+\"?+[ \t]*" "")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4116 ;;This should be extended in the future to use also other viewers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4117 (defun hm--html-view-www-package-docu ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4118 "View the WWW documentation of the package."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4119 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4120 (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
4121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4122 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4123 ; Bug reporting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4124 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4126 (defun hm--html-submit-bug-report ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4127 "Submit via mail a bug report on hm--html-menus."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4128 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4129 (require 'reporter)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4130 (let ((reporter-prompt-for-summary-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4131 (reporter-submit-bug-report
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4132 hm--html-menus-package-maintainer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4133 (concat hm--html-menus-package-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4134 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4135 hm--html-menus-package-version)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4136 (list 'emacs-version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4137 'major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4138 'hm--html-automatic-changed-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4139 'hm--html-automatic-created-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4140 'hm--html-automatic-expand-templates
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4141 'hm--html-automatic-new-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4142 'hm--html-expert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4143 'hm--html-favorite-http-server-host-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4144 'hm--html-file-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4145 'hm--html-ftp-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4146 'hm--html-ftp-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4147 'hm--html-ftp-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4148 'hm--html-gopher-anchor-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4149 'hm--html-gopher-doctype-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4150 'hm--html-gopher-doctype-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4151 'hm--html-gopher-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4152 'hm--html-gopher-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4153 'hm--html-html-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4154 'hm--html-html-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4155 'hm--html-html-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4156 'hm--html-info-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4157 'hm--html-info-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4158 'hm--html-info-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4159 'hm--html-local-proggate-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4160 'hm--html-mail-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4161 'hm--html-mail-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4162 'hm--html-mail-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4163 'hm--html-marc
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4164 'hm--html-menu-load-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4165 'hm--html-proggate-allowed-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4166 'hm--html-proggate-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4167 'hm--html-proggate-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4168 'hm--html-server-side-include-command-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4169 'hm--html-server-side-include-command-with-parameter-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4170 'hm--html-signature-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4171 'hm--html-template-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4172 'hm--html-url-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4173 'hm--html-user-config-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4174 'hm--html-username
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4175 'hm--html-wais-hostname:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4176 'hm--html-wais-hostname:port-default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4177 'hm--html-wais-path-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4178 'hm--html-wais-servername:port-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4179 'hm--html-wais-servername:port-default
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4180 ; 'html-deemphasize-color
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4181 'html-document-previewer
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4182 ; 'html-document-previewer-args
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4183 ; 'html-emphasize-color
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4184 ; 'html-quotify-hrefs-on-find
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4185 'hm--html-region-mode
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4186 'html-sigusr1-signal-value
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4187 ; 'html-use-font-lock
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4188 ; 'html-use-highlighting
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4189 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4190 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4191 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4192 "Decribe your Bug: "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4193 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4195
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4196 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4197 ; hook adding functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4198 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4200 (if (adapt-xemacsp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4201 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4202
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4203 (add-hook 'zmacs-activate-region-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4204 'hm--html-switch-region-modes-on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4205 ; (function (lambda () (hm--html-region-mode 1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4207 (add-hook 'zmacs-deactivate-region-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4208 'hm--html-switch-region-modes-off)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4209 ; (function (lambda () (hm--html-region-mode -1))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4211 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4213 (transient-mark-mode t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4215 (add-hook 'activate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4216 'hm--html-switch-region-modes-on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4217 ; (function (lambda () (hm--html-region-mode t))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4219 (add-hook 'deactivate-mark-hook
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4220 'hm--html-switch-region-modes-off)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4221 ; (function (lambda () (hm--html-region-mode nil))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4223 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4225
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4226 ;(add-hook 'hm--html-mode-hook
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4227 ; (function
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4228 ; (lambda ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4229 ; (make-variable-buffer-local 'write-file-hooks)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4230 ; (add-hook 'write-file-hooks
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4231 ; 'hm--html-maybe-new-date-and-changed-comment))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4232
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4233 ;(add-hook 'zmacs-activate-region-hook 'hm--set-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4234 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4235 ;(add-hook 'zmacs-deactivate-region-hook 'hm--unset-hm--region-active)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4239 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4240 ; Environment loading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4241 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4243 (defun hm--html-load-config-files ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4244 "Load the html configuration files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4245 First, the system config file (detemined by the environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4246 HTML_CONFIG_FILE; normaly hm--html-configuration.el(c)) is loaded and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4247 after that the user config file (determined by the environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4248 HTML_USER_CONFIG_FILE; normaly the file ~/.hm--html-configuration.el(c)).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4249 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
4250 is searched in one of the lisp load path directories.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4251 If no HTML_USER_CONFIG_FILE exists, then the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4252 `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
4253 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
4254 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4255 ;; at first the system config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4256 (if (and (stringp (getenv "HTML_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4257 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4258 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4259 (getenv "HTML_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4260 (load-library (expand-file-name (getenv "HTML_CONFIG_FILE")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4261 (load-library "hm--html-configuration"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4263 ;; and now the user config file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4264 (cond ((and (stringp (getenv "HTML_USER_CONFIG_FILE"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4265 (file-exists-p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4266 (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4267 (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4268 (load-file (expand-file-name (getenv "HTML_USER_CONFIG_FILE"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4269 ((and (boundp 'hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4270 (stringp hm--html-user-config-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4271 (file-exists-p (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4272 (load-file (expand-file-name hm--html-user-config-file)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4273 ((file-exists-p (expand-file-name "~/.hm--html-configuration.elc"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4274 (load-file (expand-file-name "~/.hm--html-configuration.elc")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4275 ((file-exists-p (expand-file-name "~/.hm--html-configuration.el"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4276 (load-file (expand-file-name "~/.hm--html-configuration.el")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4277 (t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4278 (message (concat "WARNING: No HTML User Config File ! "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4279 "Look at hm--html-load-config-files !")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4280 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4281 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4285 ;(hm--html-load-config-files)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4287 ;;; Definition of the minor mode html-region-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4288
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4289 ;(defvar html-region-mode nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4290 ; "*t, if the minor mode html-region-mode is on and nil otherwise.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4291
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4292 ;(make-variable-buffer-local 'html-region-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4293
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4294 ;(defvar html-region-mode-map nil "")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4295
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4296 ;(hm--html-load-config-files)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4297
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4298 ;(if hm--html-use-old-keymap
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4299 ; (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4300
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4301 ;;(setq minor-mode-alist (cons '(html-region-mode " Region") minor-mode-alist))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4302 ;(or (assq 'html-region-mode minor-mode-alist)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4303 ; (setq minor-mode-alist
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4304 ; (purecopy
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4305 ; (append minor-mode-alist
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4306 ; '((html-region-mode " Region"))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4307
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4308 ;(defun html-region-mode (on)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4309 ; "Turns the minor mode html-region-mode on or off.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4310 ;The function turns the html-region-mode on, if ON is t and off otherwise."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4311 ; (if (string= mode-name "HTML")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4312 ; (if on
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4313 ; ;; html-region-mode on
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4314 ; (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4315 ; (setq html-region-mode t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4316 ; (use-local-map html-region-mode-map))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4317 ; ;; html-region-mode off
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4318 ; (setq html-region-mode nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4319 ; (use-local-map html-mode-map))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4320
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4321 ;))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4324
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4325
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4327 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4328 ; Set font lock color
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4329 ; (hm--html-font-lock-color should be defined in hm--html-configuration.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4330 ; oder .hm--html-configuration.el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4331 ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4332 ;(require 'font-lock)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4333 ;(load-library "font-lock")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4334 ;(set-face-foreground 'font-lock-comment-face hm--html-font-lock-color)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4336
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4337 ;(hm--html-generate-help-buffer-faces)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4339
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4342 ;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4343 ;(setq hm--html-hostname-search-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4344 ; "[-a-zA-Z0-9]*\\.[-a-zA-Z0-9]*\\.[-a-zA-Z0-9.]*")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4345 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4346 ;(defun hm--html-get-next-hostname ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4347 ; (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4348 ; (search-forward-regexp hm--html-hostname-search-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4349 ; (buffer-substring (match-beginning 0) (match-end 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4350 ;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4351
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4352 ;;; Announce the feature hm--html-configuration
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4353
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4354 ;;; quotify href
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4355
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4356 (defvar hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4357 "<[aA][ \t\n]+\\([nN][aA][mM][eE]=[a-zA-Z0-9]+[ \t\n]+\\)?[hH][rR][eE][fF]="
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4358 "Regular expression used for searching hrefs.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4359
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4360 (defun hm--html-quotify-hrefs ()
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4361 "Insert quotes around all HREF and NAME attribute value literals.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4362
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4363 This remedies the problem with old HTML files that can't be processed
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4364 by SGML parsers. That is, changes <A HREF=foo> to <A HREF=\"foo\">.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4365
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4366 Look also at the variable `hm--html-quotify-href-regexp'."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4367 (interactive)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4368 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4369 (goto-char (point-min))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4370 (while
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4371 (re-search-forward hm--html-quotify-href-regexp
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4372 (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4373 t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4374 (cond
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4375 ((null (looking-at "\""))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4376 (insert "\"")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4377 (re-search-forward "[ \t\n>]" (point-max) t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4378 (forward-char -1)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4379 (insert "\""))))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4380
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4381
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4382
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
4383 (provide 'hm--html)