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