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