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