2
|
1 ;;; hm--html-menu --- A menu for the hm--html-mode.
|
|
2 ;;;
|
153
|
3 ;;; $Id: hm--html-menu.el,v 1.7 1997/05/29 23:49:42 steve Exp $
|
2
|
4 ;;;
|
98
|
5 ;;; Copyright (C) 1993 - 1997 Heiko Muenkel
|
0
|
6 ;;; email: muenkel@tnt.uni-hannover.de
|
|
7 ;;;
|
|
8 ;;; This program is free software; you can redistribute it and/or modify
|
|
9 ;;; it under the terms of the GNU General Public License as published by
|
|
10 ;;; the Free Software Foundation; either version 2, or (at your option)
|
|
11 ;;; any later version.
|
|
12 ;;;
|
|
13 ;;; This program is distributed in the hope that it will be useful,
|
|
14 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16 ;;; GNU General Public License for more details.
|
|
17 ;;;
|
|
18 ;;; You should have received a copy of the GNU General Public License
|
|
19 ;;; along with this program; if not, write to the Free Software
|
|
20 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
21 ;;;
|
|
22 ;;;
|
|
23 ;;; Description:
|
|
24 ;;;
|
2
|
25 ;;; Defines pulldown and popup menus for the html mode (hm--html-mode).
|
0
|
26 ;;;
|
|
27 ;;; You should also have the w3 package from William M. Perry, for
|
|
28 ;;; browsing html- files in the xemacs and the program Xmosaic together
|
|
29 ;;; with the file html-view.el from Ron Tapia for browsing html- files
|
|
30 ;;; in the Xmosaic.
|
|
31 ;;;
|
|
32 ;;; Installation:
|
|
33 ;;;
|
2
|
34 ;;; Put this file in one of your load path directories.
|
0
|
35 ;;;
|
2
|
36 ;;; Look at the files hm--html-mode.el and hm--html-configuration
|
|
37 ;;; for further installation points.
|
0
|
38 ;;;
|
|
39
|
|
40 ;;
|
|
41 ;; Menu "HTML"
|
|
42 ;;
|
|
43
|
|
44 (defvar hm--html-pulldown-menu nil "*A List with the HTML-Menu.")
|
|
45 (defvar hm--html-menu-region-expert nil "*A List with the HTML-Menu.")
|
|
46 (defvar hm--html-menu-region-novice nil "*A List with the HTML-Menu.")
|
|
47 (defvar hm--html-menu-noregion-expert nil "*A List with the HTML-Menu.")
|
|
48 (defvar hm--html-menu-noregion-novice nil "*A List with the HTML-Menu.")
|
|
49
|
|
50 (setq hm--html-menu-noregion-expert
|
|
51 '("HTML Noregion Expert Menu"
|
|
52 ("Anchors"
|
2
|
53 ["Relative link..." hm--html-add-relative-link t]
|
|
54 ["General link..." hm--html-add-normal-link t]
|
98
|
55 ["Drag & Drop"
|
|
56 idd-start-mouse-drag-and-drop
|
|
57 :active t
|
|
58 :keys "\\[idd-mouse-drag-and-drop]"]
|
2
|
59 "----"
|
0
|
60 ["Html link..." hm--html-add-html-link t]
|
|
61 ["Info link..." hm--html-add-info-link t]
|
|
62 ["Gopher link..." hm--html-add-gopher-link t]
|
|
63 ["File link..." hm--html-add-file-link t]
|
|
64 "----"
|
|
65 ["Ftp link..." hm--html-add-ftp-link t]
|
|
66 ["News link..." hm--html-add-news-link t]
|
116
|
67 ["Mailbox link..." hm--html-add-mail-box-link t]
|
0
|
68 ["Mailto link..." hm--html-add-mailto-link t]
|
|
69 ["Wais link (direct)..." hm--html-add-direct-wais-link t]
|
|
70 ["Wais link (gateway)..." hm--html-add-wais-link t]
|
|
71 "----"
|
|
72 ["Proggate link..." hm--html-add-proggate-link t]
|
|
73 ["Local Proggate link..." hm--html-add-local-proggate-link t]
|
|
74 "----"
|
|
75 ["Link target..." hm--html-add-link-target t]
|
|
76 )
|
|
77 ("Frame"
|
|
78 ["Full html frame..." hm--html-add-full-html-frame t]
|
|
79 ["Frame template..."
|
|
80 (hm--html-insert-template hm--html-frame-template-file)
|
|
81 (file-exists-p hm--html-frame-template-file)]
|
|
82 "----"
|
100
|
83 ["Doctype" hm--html-add-doctype t]
|
0
|
84 ["Html" hm--html-add-html t]
|
|
85 ["Head" hm--html-add-head t]
|
|
86 ["Body" hm--html-add-body t]
|
|
87 "----"
|
|
88 ["Title and Header..." hm--html-add-title-and-header t]
|
|
89 ["Title..." hm--html-add-title t]
|
|
90 ["Header..." hm--html-add-header t]
|
2
|
91 ["Address" hm--html-add-address t]
|
0
|
92 ["Signature" hm--html-add-signature t]
|
|
93 "----"
|
100
|
94 ["Meta information..." hm--html-add-meta t]
|
|
95 ["Node Link..." hm--html-add-normal-node-link t]
|
|
96 ["Isindex..." hm--html-add-isindex t]
|
|
97 ["Document Base..." hm--html-add-base t]
|
|
98 "----"
|
0
|
99 ["Created comment" hm--html-insert-created-comment t]
|
|
100 ["Changed comment" hm--html-insert-changed-comment t]
|
153
|
101 ["Modified line" hm--html-insert-modified-line t]
|
0
|
102 ["New date in title" hm--html-new-date t]
|
|
103 )
|
|
104 ("Structure"
|
2
|
105 ["Menu or list item" hm--html-add-list-or-menu-item t]
|
|
106 ["Menu" hm--html-add-menu t]
|
|
107 ["Unordered list" hm--html-add-list t]
|
0
|
108 ["Ordered list" hm--html-add-numberlist t]
|
|
109 ["Directory list" hm--html-add-directory-list t]
|
|
110 "----"
|
2
|
111 ["Description list" hm--html-add-description-list t]
|
0
|
112 ["Description title" hm--html-add-description-title t]
|
2
|
113 ["Description entry" hm--html-add-description-entry t]
|
|
114 ["Description title + entry"
|
|
115 hm--html-add-description-title-and-entry t]
|
0
|
116 "----"
|
|
117 ["Table..." hm--html-add-table t]
|
|
118 ["Table title..." hm--html-add-table-title t]
|
|
119 ["Table header..." hm--html-add-table-header t]
|
|
120 ["Table first row..." hm--html-add-first-table-row t]
|
|
121 ["Table additional row..." hm--html-add-additional-table-row t]
|
|
122 ("Additional Commands"
|
|
123 ["Table row frame..." hm--html-add-row-frame t]
|
|
124 ["Table header entry..." hm--html-add-header-entry t]
|
|
125 ["Table row entry..." hm--html-add-row-entry t]
|
|
126 ["Span columns..." hm--html-table-add-colspan-attribute t]
|
|
127 ["Span rows..." hm--html-table-add-rowspan-attribute t]
|
|
128 )
|
|
129 "----"
|
|
130 ["Paragraph container" hm--html-add-paragraph t]
|
|
131 ["Paragraph start tag" hm--html-add-paragraph-separator t]
|
100
|
132 ["Document division" hm--html-add-document-division t]
|
0
|
133 ["New line" hm--html-add-line-break t]
|
|
134 ["Horizontal rule" hm--html-add-horizontal-rule t]
|
|
135 )
|
142
|
136 ("Formatting Paragraphs"
|
102
|
137 ; ["Without links" hm--html-add-plaintext t]
|
142
|
138 ["Preformatted" hm--html-add-preformatted t]
|
102
|
139 ["Blockquote" hm--html-add-blockquote t]
|
0
|
140 "----"
|
100
|
141 ["Basefont..." hm--html-add-basefont t]
|
|
142 ["Font..." hm--html-add-font t]
|
102
|
143 ["Center" hm--html-add-center t]
|
|
144 ["Style" hm--html-add-style t]
|
70
|
145 "----"
|
102
|
146 ["HTML Comment" hm--html-add-comment t]
|
|
147 ; ["Listing" hm--html-add-listing t]
|
|
148 ; ["Abstract" hm--html-add-abstract t]
|
0
|
149 )
|
|
150 ("Formatting Words"
|
|
151 ["Bold" hm--html-add-bold t]
|
|
152 ["Italic" hm--html-add-italic t]
|
2
|
153 ["Typewriter" hm--html-add-fixed t]
|
|
154 ["Small" hm--html-add-small t]
|
|
155 ["Big" hm--html-add-big t]
|
0
|
156 ["Superscript" hm--html-add-superscript t]
|
|
157 ["Subscript" hm--html-add-subscript t]
|
2
|
158 "----"
|
|
159 ["Underline" hm--html-add-underline t]
|
|
160 ["Strikethru" hm--html-add-strikethru t]
|
0
|
161 "----"
|
2
|
162 ; ["Emphasized" hm--html-add-emphasized t]
|
|
163 ; ["Strong" hm--html-add-strong t]
|
|
164 ; "----"
|
|
165 ("Phrase"
|
|
166 ["Emphasized" hm--html-add-emphasized t]
|
|
167 ["Strong" hm--html-add-strong t]
|
|
168 "----"
|
0
|
169 ["Definition" hm--html-add-definition t]
|
2
|
170 ["Keyboard" hm--html-add-keyboard t]
|
|
171 ["Variable" hm--html-add-variable t]
|
0
|
172 ["Code" hm--html-add-code t]
|
2
|
173 ["Sample" hm--html-add-sample t]
|
|
174 ["Citation" hm--html-add-citation t]
|
0
|
175 )
|
2
|
176 ;; All the following commands are still implemented, but most
|
|
177 ;; of them are not defined in HTM 3.2
|
102
|
178 ;; You've to load hm--html-not-standard.el to use them
|
2
|
179 ; ("Computing"
|
|
180 ; ["Definition" hm--html-add-definition t]
|
|
181 ; ["Keyboard" hm--html-add-keyboard t]
|
|
182 ; ["Command" hm--html-add-command t]
|
|
183 ; ["Argument" hm--html-add-argument t]
|
|
184 ; ["Option" hm--html-add-option t]
|
|
185 ; ["Variable" hm--html-add-variable t]
|
|
186 ; ["Instance" hm--html-add-instance t]
|
|
187 ; ["Code" hm--html-add-code t]
|
|
188 ; ["Sample" hm--html-add-sample t]
|
|
189 ; )
|
|
190 ; ("Literature"
|
|
191 ; ["Quote" hm--html-add-quote t]
|
|
192 ; ["Acronym" hm--html-add-acronym t]
|
116
|
193 ; ["Abbreviation" hm--html-add-abbreviation t]
|
2
|
194 ; ["Citation" hm--html-add-citation t]
|
|
195 ; ["Literature" hm--html-add-literature t]
|
|
196 ; ["Publication" hm--html-add-publication t]
|
|
197 ; ["ISBN" hm--html-add-isbn t]
|
|
198 ; )
|
|
199 ; ("Person"
|
|
200 ; ["Person" hm--html-add-person t]
|
|
201 ; ["Author" hm--html-add-author t]
|
|
202 ; ["Editor" hm--html-add-editor t]
|
|
203 ; ["Credits" hm--html-add-credits t]
|
|
204 ; ["Copyright" hm--html-add-copyright t]
|
|
205 ; )
|
|
206 ; "----"
|
|
207 ; ["Footnote" hm--html-add-footnote t]
|
|
208 ; ["Margin" hm--html-add-margin t]
|
102
|
209 ; "----"
|
|
210 ; ["HTML Comment" hm--html-add-comment t]
|
0
|
211 )
|
|
212 ("Include"
|
|
213 ["Top aligned image..." hm--html-add-image-top t]
|
|
214 ["Middle aligned image..." hm--html-add-image-middle t]
|
|
215 ["Bottom aligned image..." hm--html-add-image-bottom t]
|
100
|
216 ["Image as map? ..." hm--html-add-image t]
|
98
|
217 ["Drag & Drop"
|
|
218 idd-start-mouse-drag-and-drop
|
|
219 :active t
|
|
220 :keys "\\[idd-mouse-drag-and-drop]"]
|
24
|
221 "----"
|
100
|
222 ["Image map..." hm--html-add-image-map t]
|
|
223 ["Map..." hm--html-add-map t]
|
|
224 ["Area..." hm--html-add-area t]
|
|
225 "----"
|
2
|
226 ["Applet..." hm--html-add-applet t]
|
|
227 ["Parameter..." hm--html-add-applet-parameter t]
|
102
|
228 ["Script" hm--html-add-script t]
|
0
|
229 ; "----"
|
|
230 ; ["File..." hm--html-add-server-side-include-file t]
|
|
231 ; ["Command..." hm--html-add-server-side-include-command t]
|
|
232 ; ["Command with isindex parameter..."
|
|
233 ; hm--html-add-server-side-include-command-with-isindex-parameter
|
|
234 ; t]
|
|
235 )
|
|
236 ("Forms"
|
|
237 ["Form..." hm--html-add-form t]
|
|
238 "----"
|
|
239 ["Text field..." hm--html-form-add-input-text t]
|
|
240 ["Password field..." hm--html-form-add-input-password t]
|
|
241 ["Isindex field..." hm--html-form-add-input-isindex t]
|
|
242 ["Integer field..." hm--html-form-add-input-integer t]
|
|
243 ["Float field..." hm--html-form-add-input-float t]
|
|
244 ["Date field..." hm--html-form-add-input-date t]
|
|
245 ["Url field..." hm--html-form-add-input-url t]
|
|
246 ["Scribble field..." hm--html-form-add-input-scribble t]
|
|
247 "----"
|
|
248 ["Checkbox button..." hm--html-form-add-input-checkbox t]
|
|
249 ["Radio button..." hm--html-form-add-input-radio t]
|
|
250 ["Reset button..." hm--html-form-add-input-reset t]
|
|
251 ["Submit button..." hm--html-form-add-input-submit t]
|
|
252 ["Image button..." hm--html-form-add-input-image t]
|
|
253 ["Audio button..." hm--html-form-add-input-audio t]
|
|
254 "----"
|
|
255 ["Option Menu..." hm--html-form-add-select-option-menu t]
|
|
256 ["Scrolled List..." hm--html-form-add-select-scrolled-list t]
|
|
257 ["Option..." hm--html-form-add-select-option t]
|
|
258 "----"
|
|
259 ["Textarea..." hm--html-form-add-textarea t]
|
|
260 )
|
|
261 ))
|
|
262
|
|
263
|
|
264 (setq hm--html-menu-noregion-novice
|
|
265 '("HTML No-region Novice Menu"
|
|
266 ("Anchors"
|
2
|
267 ["Relative link..." hm--html-add-relative-link t]
|
98
|
268 ["Drag & Drop"
|
|
269 idd-start-mouse-drag-and-drop
|
|
270 :active t
|
|
271 :keys "\\[idd-mouse-drag-and-drop]"]
|
2
|
272 "----"
|
0
|
273 ["Html link..." hm--html-add-html-link t]
|
|
274 ["File link..." hm--html-add-file-link t]
|
|
275 )
|
|
276 ("Frame"
|
|
277 ["Full html frame..." hm--html-add-full-html-frame t]
|
|
278 "----"
|
|
279 ["Title and Header..." hm--html-add-title-and-header t]
|
|
280 ["Signature" hm--html-add-signature t]
|
|
281 )
|
|
282 ("Structure"
|
2
|
283 ["Menu item" hm--html-add-list-or-menu-item t]
|
|
284 ["Menu" hm--html-add-menu t]
|
0
|
285 "----"
|
|
286 ["Paragraph Container" hm--html-add-paragraph t]
|
|
287 )
|
142
|
288 ("Formatting Paragraphs"
|
102
|
289 ; ["Without links" hm--html-add-plaintext t]
|
142
|
290 ["Preformatted" hm--html-add-preformatted t]
|
0
|
291 )
|
|
292 ("Formatting Words"
|
|
293 ["Bold" hm--html-add-bold t]
|
|
294 ["Italic" hm--html-add-italic t]
|
|
295 ["Underline" hm--html-add-underline t]
|
2
|
296 ["Typewriter" hm--html-add-fixed t]
|
0
|
297 )))
|
|
298
|
|
299 (setq hm--html-menu-region-expert
|
|
300 '("HTML Region Expert Menu"
|
|
301 ("Anchors"
|
2
|
302 ["Relative link..." hm--html-add-relative-link-to-region t]
|
|
303 ["General link..." hm--html-add-normal-link-to-region t]
|
98
|
304 ["Drag & Drop"
|
|
305 idd-start-mouse-drag-and-drop
|
|
306 :active t
|
|
307 :keys "\\[idd-mouse-drag-and-drop]"]
|
2
|
308 "----"
|
0
|
309 ["Html link..." hm--html-add-html-link-to-region t]
|
|
310 ["Info link..." hm--html-add-info-link-to-region t]
|
|
311 ["Gopher link..." hm--html-add-gopher-link-to-region t]
|
|
312 ["File link..." hm--html-add-file-link-to-region t]
|
|
313 "----"
|
|
314 ["Ftp link..." hm--html-add-ftp-link-to-region t]
|
|
315 ["News link..." hm--html-add-news-link-to-region t]
|
116
|
316 ["Mailbox link..." hm--html-add-mail-box-link-to-region t]
|
0
|
317 ["Mailto link..." hm--html-add-mailto-link-to-region t]
|
|
318 ["WAIS link (direct)..." hm--html-add-direct-wais-link-to-region t]
|
|
319 ["WAIS link (gateway)..." hm--html-add-wais-link-to-region t]
|
|
320 "----"
|
|
321 ["Proggate link..." hm--html-add-proggate-link-to-region t]
|
|
322 ["Local Proggate link..."
|
|
323 hm--html-add-local-proggate-link-to-region
|
|
324 t]
|
|
325 "----"
|
2
|
326 ["Link target..." hm--html-add-link-target-to-region t]
|
0
|
327 )
|
|
328 ("Frame"
|
|
329 ["Full html frame..." hm--html-add-full-html-frame-with-region t]
|
|
330 "----"
|
|
331 ["Head" hm--html-add-head-to-region t]
|
|
332 ["Body" hm--html-add-body-to-region t]
|
|
333 "----"
|
|
334 ["Title and Header..." hm--html-add-title-and-header-to-region t]
|
|
335 ["Title" hm--html-add-title-to-region t]
|
|
336 ["Header..." hm--html-add-header-to-region t]
|
|
337 ["Address" hm--html-add-address-to-region t]
|
|
338 )
|
|
339 ("Structure"
|
2
|
340 ["Menu item" hm--html-add-list-or-menu-item-to-region t]
|
0
|
341 ["Menu" hm--html-add-menu-to-region t]
|
|
342 ["Unordered list" hm--html-add-list-to-region t]
|
|
343 ["Ordered list" hm--html-add-numberlist-to-region t]
|
|
344 ["Directory list" hm--html-add-directorylist-to-region t]
|
|
345 "----"
|
|
346 ["Description list" hm--html-add-description-list-to-region t]
|
2
|
347 ["Description title" hm--html-add-description-title-to-region t]
|
|
348 ["Description entry" hm--html-add-description-entry-to-region t]
|
0
|
349 "----"
|
|
350 ["Table..." hm--html-add-table-to-region t]
|
|
351 ["Table Title..." hm--html-add-table-title-to-region t]
|
|
352 ("Additional Commands"
|
|
353 ["Table row frame..." hm--html-add-row-frame-to-region t]
|
|
354 )
|
|
355 "----"
|
|
356 ["Paragraph container" hm--html-add-paragraph-to-region t]
|
100
|
357 ["Document division" hm--html-add-document-division-to-region t]
|
0
|
358 )
|
|
359 ("Formatting Paragraphs"
|
102
|
360 ; ["Without links" hm--html-add-plaintext-to-region t]
|
142
|
361 ["Preformatted" hm--html-add-preformatted-to-region t]
|
102
|
362 ["Blockquote" hm--html-add-blockquote-to-region t]
|
70
|
363 "----"
|
100
|
364 ["Font..." hm--html-add-font-to-region t]
|
102
|
365 ["Center" hm--html-add-center-to-region t]
|
|
366 ["Style" hm--html-add-style-to-region t]
|
0
|
367 "----"
|
102
|
368 ["HTML Comment" hm--html-add-comment-to-region t]
|
|
369 ; ["Listing" hm--html-add-listing-to-region t]
|
|
370 ; ["Abstract" hm--html-add-abstract-to-region t]
|
0
|
371 )
|
|
372 ("Formatting Words"
|
|
373 ["Bold" hm--html-add-bold-to-region t]
|
|
374 ["Italic" hm--html-add-italic-to-region t]
|
|
375 ["Typewriter" hm--html-add-fixed-to-region t]
|
2
|
376 ["Small" hm--html-add-small-to-region t]
|
|
377 ["Big" hm--html-add-big-to-region t]
|
0
|
378 ["Superscript" hm--html-add-superscript-to-region t]
|
|
379 ["Subscript" hm--html-add-subscript-to-region t]
|
2
|
380 "----"
|
|
381 ["Underline" hm--html-add-underline-to-region t]
|
|
382 ["Strikethru" hm--html-add-strikethru-to-region t]
|
0
|
383 ;; ["Render" hm--html-add-render-to-region t]
|
|
384 "----"
|
2
|
385 ; ["Emphasized" hm--html-add-emphasized-to-region t]
|
|
386 ; ["Strong" hm--html-add-strong-to-region t]
|
|
387 ; "----"
|
|
388 ("Phrase"
|
|
389 ["Emphasized" hm--html-add-emphasized-to-region t]
|
|
390 ["Strong" hm--html-add-strong-to-region t]
|
|
391 "----"
|
0
|
392 ["Definition" hm--html-add-definition-to-region t]
|
|
393 ["Keyboard" hm--html-add-keyboard-to-region t]
|
|
394 ["Variable" hm--html-add-variable-to-region t]
|
|
395 ["Code" hm--html-add-code-to-region t]
|
|
396 ["Sample" hm--html-add-sample-to-region t]
|
|
397 ["Citation" hm--html-add-citation-to-region t]
|
|
398 )
|
2
|
399 ;; All the following commands are still implemented, but most
|
|
400 ;; of them are not defined in HTM 3.2
|
|
401 ; ("Computing"
|
|
402 ; ["Definition" hm--html-add-definition-to-region t]
|
|
403 ; ["Keyboard" hm--html-add-keyboard-to-region t]
|
|
404 ; ["Command" hm--html-add-command-to-region t]
|
|
405 ; ["Argument" hm--html-add-argument-to-region t]
|
|
406 ; ["Option" hm--html-add-option-to-region t]
|
|
407 ; ["Variable" hm--html-add-variable-to-region t]
|
|
408 ; ["Instance" hm--html-add-instance-to-region t]
|
|
409 ; ["Code" hm--html-add-code-to-region t]
|
|
410 ; ["Sample" hm--html-add-sample-to-region t]
|
|
411 ; )
|
|
412 ; ("Literature"
|
|
413 ; ["Quote" hm--html-add-quote-to-region t]
|
|
414 ; ["Acronym" hm--html-add-acronym-to-region t]
|
|
415 ; ["Abbrevation" hm--html-add-abbrevation-to-region t]
|
|
416 ; ["Citation" hm--html-add-citation-to-region t]
|
|
417 ; ["Literature" hm--html-add-literature-to-region t]
|
|
418 ; ["Publication" hm--html-add-publication-to-region t]
|
|
419 ; ["ISBN" hm--html-add-isbn-to-region t]
|
|
420 ; )
|
|
421 ; ("Person"
|
|
422 ; ["Person" hm--html-add-person-to-region t]
|
|
423 ; ["Author" hm--html-add-author-to-region t]
|
|
424 ; ["Editor" hm--html-add-editor-to-region t]
|
|
425 ; ["Credits" hm--html-add-credits-to-region t]
|
|
426 ; ["Copyright" hm--html-add-copyright-to-region t]
|
|
427 ; )
|
|
428 ; "----"
|
|
429 ; ["Footnote" hm--html-add-footnote-to-region t]
|
|
430 ; ["Margin" hm--html-add-margin-to-region t]
|
102
|
431 ; "----"
|
|
432 ; ["HTML Comment" hm--html-add-comment-to-region t]
|
24
|
433 )
|
100
|
434 ("Include"
|
|
435 ["Map..." hm--html-add-map-to-region t]
|
|
436 "----"
|
|
437 ["Applet..." hm--html-add-applet-to-region t]
|
102
|
438 ["Script" hm--html-add-script-to-region t]
|
100
|
439 )
|
0
|
440 ("Forms"
|
|
441 ["Form..." hm--html-add-form-to-region t])
|
|
442 ))
|
|
443
|
|
444
|
|
445 (setq hm--html-menu-region-novice
|
|
446 '("HTML Region Novice Menu"
|
|
447 ("Anchors"
|
2
|
448 ["Relative link..." hm--html-add-relative-link-to-region t]
|
98
|
449 ["Drag & Drop"
|
|
450 idd-start-mouse-drag-and-drop
|
|
451 :active t
|
|
452 :keys "\\[idd-mouse-drag-and-drop]"]
|
2
|
453 "----"
|
0
|
454 ["Html link..." hm--html-add-html-link-to-region t]
|
|
455 ["File link..." hm--html-add-file-link-to-region t]
|
|
456 )
|
|
457 ("Frame"
|
|
458 ["Full html frame..." hm--html-add-full-html-frame-with-region t]
|
|
459 "----"
|
|
460 ["Title and Header..." hm--html-add-title-and-header-to-region t]
|
|
461 )
|
|
462 ("Structure"
|
2
|
463 ["Menu item" hm--html-add-list-or-menu-item-to-region t]
|
0
|
464 ["Menu" hm--html-add-menu-to-region t]
|
|
465 )
|
|
466 ("Formatting Paragraphs"
|
102
|
467 ; ["Without links" hm--html-add-plaintext-to-region t]
|
142
|
468 ["Preformatted" hm--html-add-preformatted-to-region t]
|
0
|
469 )
|
|
470 ("Formatting Words"
|
|
471 ["Bold" hm--html-add-bold-to-region t]
|
|
472 ["Italic" hm--html-add-italic-to-region t]
|
|
473 ["Underline" hm--html-add-underline-to-region t]
|
|
474 ["Typewriter" hm--html-add-fixed-to-region t]
|
|
475 )
|
|
476 ))
|
|
477
|
|
478
|
153
|
479 (if (adapt-xemacsp)
|
|
480 ;; The reason for this if form is, that the Emacs 19 can't
|
|
481 ;; work correct with `:keys "\\[idd-help-mouse-drag-and-drop]"'
|
|
482 (setq hm--html-pulldown-menu
|
|
483 '("HTML Config Menu"
|
|
484 ("Set popup menu"
|
|
485 ["Novice menu"
|
|
486 hm--html-use-novice-menu
|
|
487 :active t
|
|
488 :style radio
|
|
489 :selected (not hm--html-expert)]
|
|
490 ["Expert menu"
|
|
491 hm--html-use-expert-menu
|
|
492 :active t
|
|
493 :style radio
|
|
494 :selected hm--html-expert]
|
|
495 )
|
|
496 ["Reload config files" hm--html-load-config-files t]
|
|
497 ["Templates (fixed dirs) ..."
|
|
498 hm--html-insert-template-from-fixed-dirs
|
|
499 t]
|
|
500 ["Templates ..." hm--html-insert-template t]
|
|
501 ["Drag & Drop"
|
|
502 idd-start-mouse-drag-and-drop
|
|
503 :active t
|
|
504 :keys "\\[idd-mouse-drag-and-drop]"]
|
|
505 ["Drag & Drop Help"
|
|
506 idd-start-help-mouse-drag-and-drop
|
|
507 :active t
|
|
508 :keys "\\[idd-help-mouse-drag-and-drop]"]
|
|
509 "----"
|
|
510 ["Remove numeric names" hm--html-remove-numeric-names t]
|
|
511 ["Quotify hrefs" hm--html-quotify-hrefs t]
|
|
512 "----"
|
|
513 ["Submit bug report..." hm--html-submit-bug-report t]
|
|
514 ["WWW Package Docs" hm--html-view-www-package-docu t]
|
|
515 "----"
|
|
516 ("Preview Document"
|
|
517 ["Netscape view buffer" (hm--html-send-buffer-to-netscape
|
|
518 (current-buffer)) t]
|
|
519 "----"
|
|
520 ["Xmosaic start" html-view-start-mosaic t]
|
|
521 ["Xmosaic view buffer" html-view-view-buffer t]
|
|
522 ["Xmosaic view file" html-view-view-file t]
|
|
523 ["Xmosaic goto url" html-view-goto-url t]
|
|
524 ["Xmosaic get display" html-view-get-display t]
|
|
525 "----"
|
|
526 ["W3 start" w3 t]
|
|
527 ["W3 view buffer" w3-preview-this-buffer t]
|
|
528 ["W3 open remote file..." w3-fetch t]
|
|
529 ["W3 open local..." w3-open-local t]
|
|
530 ["W3 use hotlist..." w3-use-hotlist t]
|
|
531 )
|
|
532 ))
|
|
533 (setq hm--html-pulldown-menu
|
|
534 '("HTML Config Menu"
|
|
535 ("Set popup menu"
|
|
536 ["Novice menu"
|
|
537 hm--html-use-novice-menu
|
|
538 :active t
|
|
539 :style radio
|
|
540 :selected (not hm--html-expert)]
|
|
541 ["Expert menu"
|
|
542 hm--html-use-expert-menu
|
|
543 :active t
|
|
544 :style radio
|
|
545 :selected hm--html-expert]
|
|
546 )
|
|
547 ["Reload config files" hm--html-load-config-files t]
|
|
548 ["Templates (fixed dirs) ..."
|
|
549 hm--html-insert-template-from-fixed-dirs
|
|
550 t]
|
|
551 ["Templates ..." hm--html-insert-template t]
|
|
552 ["Drag & Drop"
|
|
553 idd-start-mouse-drag-and-drop
|
|
554 :active t]
|
|
555 ["Drag & Drop Help"
|
|
556 idd-start-help-mouse-drag-and-drop
|
|
557 :active t]
|
|
558 "----"
|
|
559 ["Remove numeric names" hm--html-remove-numeric-names t]
|
|
560 ["Quotify hrefs" hm--html-quotify-hrefs t]
|
|
561 "----"
|
|
562 ["Submit bug report..." hm--html-submit-bug-report t]
|
|
563 ["WWW Package Docs" hm--html-view-www-package-docu t]
|
|
564 "----"
|
|
565 ("Preview Document"
|
|
566 ["Netscape view buffer" (hm--html-send-buffer-to-netscape
|
|
567 (current-buffer)) t]
|
|
568 "----"
|
|
569 ["Xmosaic start" html-view-start-mosaic t]
|
|
570 ["Xmosaic view buffer" html-view-view-buffer t]
|
|
571 ["Xmosaic view file" html-view-view-file t]
|
|
572 ["Xmosaic goto url" html-view-goto-url t]
|
|
573 ["Xmosaic get display" html-view-get-display t]
|
|
574 "----"
|
|
575 ["W3 start" w3 t]
|
|
576 ["W3 view buffer" w3-preview-this-buffer t]
|
|
577 ["W3 open remote file..." w3-fetch t]
|
|
578 ["W3 open local..." w3-open-local t]
|
|
579 ["W3 use hotlist..." w3-use-hotlist t]
|
|
580 )
|
|
581 ))
|
|
582 )
|
0
|
583
|
|
584 (if (adapt-xemacsp)
|
2
|
585 (defun hm--install-html-menu (menu-name)
|
|
586 (if (and current-menubar (not (assoc menu-name current-menubar)))
|
0
|
587 (progn
|
|
588 (set-buffer-menubar (copy-sequence current-menubar))
|
116
|
589 (add-submenu nil
|
|
590 (cons menu-name (cdr hm--html-pulldown-menu))
|
|
591 "HTML"))))
|
2
|
592
|
|
593 (defun hm--install-html-menu (menu-name)
|
|
594 (if (eq major-mode 'hm--html-mode)
|
|
595 (easy-menu-define hm--html-menu-map
|
|
596 hm--html-mode-map
|
|
597 "The hm--html-mode pulldown menu."
|
|
598 (cons menu-name
|
|
599 (cdr hm--html-pulldown-menu)))
|
|
600 (easy-menu-define hm--html-minor-menu-map
|
|
601 hm--html-minor-mode-map
|
|
602 "The hm--html-minor-mode pulldown menu."
|
|
603 (cons menu-name
|
|
604 (cdr hm--html-pulldown-menu))))
|
|
605 ))
|
0
|
606
|
2
|
607 (if (adapt-emacs19p)
|
|
608 (progn
|
0
|
609
|
2
|
610 (setq hm--html-menu-noregion-expert-map
|
|
611 (make-lucid-menu-keymap (car hm--html-menu-noregion-expert)
|
|
612 (cdr hm--html-menu-noregion-expert)))
|
|
613
|
|
614 (setq hm--html-menu-region-expert-map
|
|
615 (make-lucid-menu-keymap (car hm--html-menu-region-expert)
|
|
616 (cdr hm--html-menu-region-expert)))
|
0
|
617
|
2
|
618 (setq hm--html-menu-noregion-novice-map
|
|
619 (make-lucid-menu-keymap (car hm--html-menu-noregion-novice)
|
|
620 (cdr hm--html-menu-noregion-novice)))
|
|
621
|
|
622 (setq hm--html-menu-region-novice-map
|
|
623 (make-lucid-menu-keymap (car hm--html-menu-region-novice)
|
|
624 (cdr hm--html-menu-region-novice)))
|
|
625
|
|
626 ;; Speeds up the first popup of a menu
|
|
627 (if hm--html-expert
|
|
628 (progn
|
|
629 (x-popup-menu nil hm--html-menu-noregion-expert-map)
|
|
630 (x-popup-menu nil hm--html-menu-region-expert-map)
|
|
631 )
|
|
632 (x-popup-menu nil hm--html-menu-noregion-novice-map)
|
|
633 (x-popup-menu nil hm--html-menu-region-novice-map))
|
0
|
634
|
|
635
|
2
|
636 )
|
|
637
|
|
638 (defun hm--html-popup-menu (event)
|
|
639 "Pops the HTML- menu up, if no region is active."
|
|
640 (interactive "@e")
|
0
|
641 (if hm--html-expert
|
|
642 (popup-menu hm--html-menu-noregion-expert)
|
2
|
643 (popup-menu hm--html-menu-noregion-novice)))
|
0
|
644
|
|
645
|
2
|
646 (defun hm--html-popup-menu-region (event)
|
|
647 "Pops the HTML- menu up, if a region is active."
|
|
648 (interactive "@e")
|
0
|
649 (if hm--html-expert
|
|
650 (popup-menu hm--html-menu-region-expert)
|
2
|
651 (popup-menu hm--html-menu-region-novice)))
|
0
|
652 )
|
|
653
|
|
654
|
2
|
655 (if (adapt-xemacsp)
|
|
656 (progn
|
|
657
|
|
658 (defun hm--html-use-novice-menu ()
|
|
659 "Changes the HTML popup menu to the novice menu."
|
|
660 (interactive)
|
|
661 (setq hm--html-expert nil)
|
|
662 )
|
|
663
|
|
664
|
|
665 (defun hm--html-use-expert-menu ()
|
|
666 "Changes the HTML popup menu to the expert menu."
|
|
667 (interactive)
|
|
668 (setq hm--html-expert t)
|
|
669 )
|
|
670 )
|
|
671
|
|
672 ;; For the Emacs 19
|
|
673 (defun hm--html-use-novice-menu ()
|
|
674 "Changes the HTML popup menu to the novice menu."
|
|
675 (interactive)
|
|
676 (setq hm--html-expert nil)
|
|
677 (define-key hm--html-region-mode-map
|
|
678 hm--html-emacs19-popup-region-menu-button
|
|
679 hm--html-menu-region-novice-map)
|
|
680 (define-key hm--html-minor-region-mode-map
|
|
681 hm--html-emacs19-popup-region-menu-button
|
|
682 hm--html-menu-region-novice-map)
|
|
683 (if (not hm--html-region-mode)
|
|
684 (define-key hm--html-mode-map
|
|
685 hm--html-emacs19-popup-noregion-menu-button
|
|
686 hm--html-menu-noregion-novice-map))
|
|
687 (if (not hm--html-minor-region-mode)
|
|
688 (define-key hm--html-minor-mode-map
|
|
689 hm--html-emacs19-popup-noregion-menu-button
|
|
690 hm--html-menu-noregion-novice-map))
|
|
691 )
|
|
692
|
|
693 (defun hm--html-use-expert-menu ()
|
|
694 "Changes the HTML popup menu to the expert menu."
|
|
695 (interactive)
|
|
696 (setq hm--html-expert t)
|
|
697 (define-key hm--html-region-mode-map
|
|
698 hm--html-emacs19-popup-region-menu-button
|
|
699 hm--html-menu-region-expert-map)
|
|
700 (define-key hm--html-minor-region-mode-map
|
|
701 hm--html-emacs19-popup-region-menu-button
|
|
702 hm--html-menu-region-expert-map)
|
|
703 (if (not hm--html-region-mode)
|
|
704 (define-key hm--html-mode-map
|
|
705 hm--html-emacs19-popup-noregion-menu-button
|
|
706 hm--html-menu-noregion-expert-map))
|
|
707 (if (not hm--html-minor-region-mode)
|
|
708 (define-key hm--html-minor-mode-map
|
|
709 hm--html-emacs19-popup-noregion-menu-button
|
|
710 hm--html-menu-noregion-expert-map))
|
|
711 )
|
0
|
712 )
|
|
713
|
2
|
714
|
|
715 (defvar hm--html-use-psgml t
|
|
716 "Set this to t, if functions from the psgml-mode should be used.")
|
|
717
|
|
718 ;;; Popup the menus in the minor mode
|
|
719
|
|
720 (if (adapt-xemacsp)
|
|
721 (progn
|
|
722
|
|
723 (defadvice sgml-xemacs-get-popup-value (around
|
|
724 hm--html-popup-menu-advice
|
|
725 activate)
|
|
726 "Calls `hm--html-sgml-xemacs-get-popup-value' instead of the original.
|
|
727 `hm--html-sgml-xemacs-get-popup-value' is only called, if the
|
|
728 `hm--html-minor-mode' is active.
|
|
729 `hm--html-sgml-xemacs-get-popup-value' adds the 'hm--html-mode' popup
|
|
730 menus to the psgml popup menu."
|
|
731 (if hm--html-minor-mode
|
|
732 (setq ad-return-value
|
|
733 (hm--html-sgml-xemacs-get-popup-value (ad-get-arg 0)))
|
|
734 ad-do-it))
|
|
735
|
|
736 (defun hm--html-sgml-xemacs-get-popup-value (menudesc)
|
|
737 (let ((value nil)
|
|
738 (event nil))
|
|
739 ;; (popup-menu menudesc)
|
|
740 (popup-menu (append hm--html-popup-menu ; for the hm--html-menu
|
|
741 (list "==" ;
|
|
742 (car menudesc) ;
|
|
743 "==") ;
|
|
744 (cdr menudesc))) ;
|
116
|
745 (while (popup-up-p)
|
2
|
746 (setq event (next-command-event event))
|
116
|
747 (cond ((misc-user-event-p event)
|
2
|
748 (cond
|
|
749 ((eq (event-object event) 'abort)
|
|
750 (signal 'quit nil))
|
|
751 ((eq (event-object event) 'menu-no-selection-hook)
|
|
752 nil)
|
|
753 ((commandp (event-object event)) ; for the
|
|
754 (call-interactively (event-object event)) ; hm--html-menu
|
|
755 (signal 'quit nil)) ; items
|
|
756 (t
|
|
757 (eval (event-object event)))))
|
|
758 ((button-release-event-p event) ; don't beep twice
|
|
759 nil)
|
|
760 ((and (fboundp 'event-matches-key-specifier-p)
|
|
761 (event-matches-key-specifier-p event (quit-char)))
|
|
762 (signal 'quit nil))
|
|
763 (t
|
|
764 (beep)
|
|
765 (message "please make a choice from the menu."))))
|
|
766 value))
|
|
767 )
|
|
768 ; Fuer den Emacs 19 fehlt hier noch etwas !!!
|
|
769 )
|
|
770
|
|
771 (if (adapt-xemacsp)
|
|
772 (progn
|
|
773
|
|
774 (defun hm--html-popup-minor-html-menu (event)
|
|
775 "Pops the HTML- menu up, if no region is active."
|
|
776 (interactive "@e")
|
|
777 (if hm--html-use-psgml
|
|
778 (let ((hm--html-popup-menu (if hm--html-expert
|
|
779 hm--html-menu-noregion-expert
|
|
780 hm--html-menu-noregion-novice)))
|
|
781 (sgml-tags-menu event))
|
|
782 (if hm--html-expert
|
|
783 (popup-menu hm--html-menu-noregion-expert)
|
|
784 (popup-menu hm--html-menu-noregion-novice))
|
|
785 ))
|
|
786
|
|
787
|
|
788 (defun hm--html-popup-minor-html-menu-region (event)
|
|
789 "Pops the HTML- menu up, if a region is active."
|
|
790 (interactive "@e")
|
|
791 (if hm--html-use-psgml
|
|
792 (let ((hm--html-popup-menu (if hm--html-expert
|
|
793 hm--html-menu-region-expert
|
|
794 hm--html-menu-region-novice)))
|
|
795 (sgml-tags-menu event))
|
|
796 (if hm--html-expert
|
|
797 (popup-menu hm--html-menu-region-expert)
|
|
798 (popup-menu hm--html-menu-region-novice))
|
|
799 ))
|
|
800
|
|
801 ))
|
|
802
|
|
803
|
0
|
804 (run-hooks 'hm--html-menu-load-hook)
|
|
805
|
2
|
806
|
|
807 ;;; Announce the feature hm--html-menu
|
|
808 (provide 'hm--html-menu)
|