comparison lisp/hm--html-menus/hm--html-menu.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents 6a22abad6937
children 0d2f883870bc
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
1 ;;; hm--html-menu --- A menu for the hm--html-mode. 1 ;;; hm--html-menu --- A menu for the hm--html-mode.
2 ;;; 2 ;;;
3 ;;; $Id: hm--html-menu.el,v 1.6 1997/03/26 22:42:38 steve Exp $ 3 ;;; $Id: hm--html-menu.el,v 1.1.1.1 1996/12/18 22:43:20 steve Exp $
4 ;;; 4 ;;;
5 ;;; Copyright (C) 1993 - 1997 Heiko Muenkel 5 ;;; Copyright (C) 1993, 1994, 1995, 1996 Heiko Muenkel
6 ;;; email: muenkel@tnt.uni-hannover.de 6 ;;; email: muenkel@tnt.uni-hannover.de
7 ;;; 7 ;;;
8 ;;; This program is free software; you can redistribute it and/or modify 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 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) 10 ;;; the Free Software Foundation; either version 2, or (at your option)
35 ;;; 35 ;;;
36 ;;; Look at the files hm--html-mode.el and hm--html-configuration 36 ;;; Look at the files hm--html-mode.el and hm--html-configuration
37 ;;; for further installation points. 37 ;;; for further installation points.
38 ;;; 38 ;;;
39 39
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)
46
47
40 ;; 48 ;;
41 ;; Menu "HTML" 49 ;; Menu "HTML"
42 ;; 50 ;;
43 51
44 (defvar hm--html-pulldown-menu nil "*A List with the HTML-Menu.") 52 (defvar hm--html-pulldown-menu nil "*A List with the HTML-Menu.")
50 (setq hm--html-menu-noregion-expert 58 (setq hm--html-menu-noregion-expert
51 '("HTML Noregion Expert Menu" 59 '("HTML Noregion Expert Menu"
52 ("Anchors" 60 ("Anchors"
53 ["Relative link..." hm--html-add-relative-link t] 61 ["Relative link..." hm--html-add-relative-link t]
54 ["General link..." hm--html-add-normal-link t] 62 ["General link..." hm--html-add-normal-link t]
55 ["Drag & Drop"
56 idd-start-mouse-drag-and-drop
57 :active t
58 :keys "\\[idd-mouse-drag-and-drop]"]
59 "----" 63 "----"
60 ["Html link..." hm--html-add-html-link t] 64 ["Html link..." hm--html-add-html-link t]
61 ["Info link..." hm--html-add-info-link t] 65 ["Info link..." hm--html-add-info-link t]
62 ["Gopher link..." hm--html-add-gopher-link t] 66 ["Gopher link..." hm--html-add-gopher-link t]
63 ["File link..." hm--html-add-file-link t] 67 ["File link..." hm--html-add-file-link t]
64 "----" 68 "----"
65 ["Ftp link..." hm--html-add-ftp-link t] 69 ["Ftp link..." hm--html-add-ftp-link t]
66 ["News link..." hm--html-add-news-link t] 70 ["News link..." hm--html-add-news-link t]
67 ["Mailbox link..." hm--html-add-mail-box-link t] 71 ["Mailbox link..." hm--html-add-mail-link t]
68 ["Mailto link..." hm--html-add-mailto-link t] 72 ["Mailto link..." hm--html-add-mailto-link t]
69 ["Wais link (direct)..." hm--html-add-direct-wais-link t] 73 ["Wais link (direct)..." hm--html-add-direct-wais-link t]
70 ["Wais link (gateway)..." hm--html-add-wais-link t] 74 ["Wais link (gateway)..." hm--html-add-wais-link t]
71 "----" 75 "----"
72 ["Proggate link..." hm--html-add-proggate-link t] 76 ["Proggate link..." hm--html-add-proggate-link t]
78 ["Full html frame..." hm--html-add-full-html-frame t] 82 ["Full html frame..." hm--html-add-full-html-frame t]
79 ["Frame template..." 83 ["Frame template..."
80 (hm--html-insert-template hm--html-frame-template-file) 84 (hm--html-insert-template hm--html-frame-template-file)
81 (file-exists-p hm--html-frame-template-file)] 85 (file-exists-p hm--html-frame-template-file)]
82 "----" 86 "----"
83 ["Doctype" hm--html-add-doctype t]
84 ["Html" hm--html-add-html t] 87 ["Html" hm--html-add-html t]
85 ["Head" hm--html-add-head t] 88 ["Head" hm--html-add-head t]
86 ["Body" hm--html-add-body t] 89 ["Body" hm--html-add-body t]
87 "----" 90 "----"
88 ["Title and Header..." hm--html-add-title-and-header t] 91 ["Title and Header..." hm--html-add-title-and-header t]
89 ["Title..." hm--html-add-title t] 92 ["Title..." hm--html-add-title t]
90 ["Header..." hm--html-add-header t] 93 ["Header..." hm--html-add-header t]
94 ["Node Link..." hm--html-add-normal-node-link t]
91 ["Address" hm--html-add-address t] 95 ["Address" hm--html-add-address t]
92 ["Signature" hm--html-add-signature t] 96 ["Signature" hm--html-add-signature t]
93 "----"
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 "----" 97 "----"
99 ["Created comment" hm--html-insert-created-comment t] 98 ["Created comment" hm--html-insert-created-comment t]
100 ["Changed comment" hm--html-insert-changed-comment t] 99 ["Changed comment" hm--html-insert-changed-comment t]
101 ["New date in title" hm--html-new-date t] 100 ["New date in title" hm--html-new-date t]
102 ) 101 )
126 ["Span rows..." hm--html-table-add-rowspan-attribute t] 125 ["Span rows..." hm--html-table-add-rowspan-attribute t]
127 ) 126 )
128 "----" 127 "----"
129 ["Paragraph container" hm--html-add-paragraph t] 128 ["Paragraph container" hm--html-add-paragraph t]
130 ["Paragraph start tag" hm--html-add-paragraph-separator t] 129 ["Paragraph start tag" hm--html-add-paragraph-separator t]
131 ["Document division" hm--html-add-document-division t]
132 ["New line" hm--html-add-line-break t] 130 ["New line" hm--html-add-line-break t]
133 ["Horizontal rule" hm--html-add-horizontal-rule t] 131 ["Horizontal rule" hm--html-add-horizontal-rule t]
134 ) 132 )
135 ("Formating Paragraphs" 133 ("Formating Paragraphs"
136 ; ["Without links" hm--html-add-plaintext t] 134 ["Without links" hm--html-add-plaintext t]
137 ["Preformated" hm--html-add-preformated t] 135 ["With links" hm--html-add-preformated t]
136 "----"
138 ["Blockquote" hm--html-add-blockquote t] 137 ["Blockquote" hm--html-add-blockquote t]
139 "----" 138 ["Listing" hm--html-add-listing t]
140 ["Basefont..." hm--html-add-basefont t] 139 ["Abstract" hm--html-add-abstract t]
141 ["Font..." hm--html-add-font t] 140 "----"
142 ["Center" hm--html-add-center t] 141 ["Center" hm--html-add-center t]
143 ["Style" hm--html-add-style t]
144 "----"
145 ["HTML Comment" hm--html-add-comment t]
146 ; ["Listing" hm--html-add-listing t]
147 ; ["Abstract" hm--html-add-abstract t]
148 ) 142 )
149 ("Formatting Words" 143 ("Formatting Words"
150 ["Bold" hm--html-add-bold t] 144 ["Bold" hm--html-add-bold t]
151 ["Italic" hm--html-add-italic t] 145 ["Italic" hm--html-add-italic t]
152 ["Typewriter" hm--html-add-fixed t] 146 ["Typewriter" hm--html-add-fixed t]
155 ["Superscript" hm--html-add-superscript t] 149 ["Superscript" hm--html-add-superscript t]
156 ["Subscript" hm--html-add-subscript t] 150 ["Subscript" hm--html-add-subscript t]
157 "----" 151 "----"
158 ["Underline" hm--html-add-underline t] 152 ["Underline" hm--html-add-underline t]
159 ["Strikethru" hm--html-add-strikethru t] 153 ["Strikethru" hm--html-add-strikethru t]
154 ;; ["Render" hm--html-add-render t]
160 "----" 155 "----"
161 ; ["Emphasized" hm--html-add-emphasized t] 156 ; ["Emphasized" hm--html-add-emphasized t]
162 ; ["Strong" hm--html-add-strong t] 157 ; ["Strong" hm--html-add-strong t]
163 ; "----" 158 ; "----"
164 ("Phrase" 159 ("Phrase"
172 ["Sample" hm--html-add-sample t] 167 ["Sample" hm--html-add-sample t]
173 ["Citation" hm--html-add-citation t] 168 ["Citation" hm--html-add-citation t]
174 ) 169 )
175 ;; All the following commands are still implemented, but most 170 ;; All the following commands are still implemented, but most
176 ;; of them are not defined in HTM 3.2 171 ;; of them are not defined in HTM 3.2
177 ;; You've to load hm--html-not-standard.el to use them
178 ; ("Computing" 172 ; ("Computing"
179 ; ["Definition" hm--html-add-definition t] 173 ; ["Definition" hm--html-add-definition t]
180 ; ["Keyboard" hm--html-add-keyboard t] 174 ; ["Keyboard" hm--html-add-keyboard t]
181 ; ["Command" hm--html-add-command t] 175 ; ["Command" hm--html-add-command t]
182 ; ["Argument" hm--html-add-argument t] 176 ; ["Argument" hm--html-add-argument t]
187 ; ["Sample" hm--html-add-sample t] 181 ; ["Sample" hm--html-add-sample t]
188 ; ) 182 ; )
189 ; ("Literature" 183 ; ("Literature"
190 ; ["Quote" hm--html-add-quote t] 184 ; ["Quote" hm--html-add-quote t]
191 ; ["Acronym" hm--html-add-acronym t] 185 ; ["Acronym" hm--html-add-acronym t]
192 ; ["Abbreviation" hm--html-add-abbreviation t] 186 ; ["Abbrevation" hm--html-add-abbrevation t]
193 ; ["Citation" hm--html-add-citation t] 187 ; ["Citation" hm--html-add-citation t]
194 ; ["Literature" hm--html-add-literature t] 188 ; ["Literature" hm--html-add-literature t]
195 ; ["Publication" hm--html-add-publication t] 189 ; ["Publication" hm--html-add-publication t]
196 ; ["ISBN" hm--html-add-isbn t] 190 ; ["ISBN" hm--html-add-isbn t]
197 ; ) 191 ; )
203 ; ["Copyright" hm--html-add-copyright t] 197 ; ["Copyright" hm--html-add-copyright t]
204 ; ) 198 ; )
205 ; "----" 199 ; "----"
206 ; ["Footnote" hm--html-add-footnote t] 200 ; ["Footnote" hm--html-add-footnote t]
207 ; ["Margin" hm--html-add-margin t] 201 ; ["Margin" hm--html-add-margin t]
208 ; "----" 202 "----"
209 ; ["HTML Comment" hm--html-add-comment t] 203 ["HTML Comment" hm--html-add-comment t]
210 ) 204 )
211 ("Include" 205 ("Include"
212 ["Top aligned image..." hm--html-add-image-top t] 206 ["Top aligned image..." hm--html-add-image-top t]
213 ["Middle aligned image..." hm--html-add-image-middle t] 207 ["Middle aligned image..." hm--html-add-image-middle t]
214 ["Bottom aligned image..." hm--html-add-image-bottom t] 208 ["Bottom aligned image..." hm--html-add-image-bottom t]
215 ["Image as map? ..." hm--html-add-image t]
216 ["Drag & Drop"
217 idd-start-mouse-drag-and-drop
218 :active t
219 :keys "\\[idd-mouse-drag-and-drop]"]
220 "----"
221 ["Image map..." hm--html-add-image-map t]
222 ["Map..." hm--html-add-map t]
223 ["Area..." hm--html-add-area t]
224 "----" 209 "----"
225 ["Applet..." hm--html-add-applet t] 210 ["Applet..." hm--html-add-applet t]
226 ["Parameter..." hm--html-add-applet-parameter t] 211 ["Parameter..." hm--html-add-applet-parameter t]
227 ["Script" hm--html-add-script t]
228 ; "----" 212 ; "----"
229 ; ["File..." hm--html-add-server-side-include-file t] 213 ; ["File..." hm--html-add-server-side-include-file t]
230 ; ["Command..." hm--html-add-server-side-include-command t] 214 ; ["Command..." hm--html-add-server-side-include-command t]
231 ; ["Command with isindex parameter..." 215 ; ["Command with isindex parameter..."
232 ; hm--html-add-server-side-include-command-with-isindex-parameter 216 ; hm--html-add-server-side-include-command-with-isindex-parameter
262 246
263 (setq hm--html-menu-noregion-novice 247 (setq hm--html-menu-noregion-novice
264 '("HTML No-region Novice Menu" 248 '("HTML No-region Novice Menu"
265 ("Anchors" 249 ("Anchors"
266 ["Relative link..." hm--html-add-relative-link t] 250 ["Relative link..." hm--html-add-relative-link t]
267 ["Drag & Drop"
268 idd-start-mouse-drag-and-drop
269 :active t
270 :keys "\\[idd-mouse-drag-and-drop]"]
271 "----" 251 "----"
272 ["Html link..." hm--html-add-html-link t] 252 ["Html link..." hm--html-add-html-link t]
273 ["File link..." hm--html-add-file-link t] 253 ["File link..." hm--html-add-file-link t]
274 ) 254 )
275 ("Frame" 255 ("Frame"
283 ["Menu" hm--html-add-menu t] 263 ["Menu" hm--html-add-menu t]
284 "----" 264 "----"
285 ["Paragraph Container" hm--html-add-paragraph t] 265 ["Paragraph Container" hm--html-add-paragraph t]
286 ) 266 )
287 ("Formating Paragraphs" 267 ("Formating Paragraphs"
288 ; ["Without links" hm--html-add-plaintext t] 268 ["Without links" hm--html-add-plaintext t]
289 ["Preformated" hm--html-add-preformated t] 269 ["With links" hm--html-add-preformated t]
290 ) 270 )
291 ("Formatting Words" 271 ("Formatting Words"
292 ["Bold" hm--html-add-bold t] 272 ["Bold" hm--html-add-bold t]
293 ["Italic" hm--html-add-italic t] 273 ["Italic" hm--html-add-italic t]
294 ["Underline" hm--html-add-underline t] 274 ["Underline" hm--html-add-underline t]
298 (setq hm--html-menu-region-expert 278 (setq hm--html-menu-region-expert
299 '("HTML Region Expert Menu" 279 '("HTML Region Expert Menu"
300 ("Anchors" 280 ("Anchors"
301 ["Relative link..." hm--html-add-relative-link-to-region t] 281 ["Relative link..." hm--html-add-relative-link-to-region t]
302 ["General link..." hm--html-add-normal-link-to-region t] 282 ["General link..." hm--html-add-normal-link-to-region t]
303 ["Drag & Drop"
304 idd-start-mouse-drag-and-drop
305 :active t
306 :keys "\\[idd-mouse-drag-and-drop]"]
307 "----" 283 "----"
308 ["Html link..." hm--html-add-html-link-to-region t] 284 ["Html link..." hm--html-add-html-link-to-region t]
309 ["Info link..." hm--html-add-info-link-to-region t] 285 ["Info link..." hm--html-add-info-link-to-region t]
310 ["Gopher link..." hm--html-add-gopher-link-to-region t] 286 ["Gopher link..." hm--html-add-gopher-link-to-region t]
311 ["File link..." hm--html-add-file-link-to-region t] 287 ["File link..." hm--html-add-file-link-to-region t]
312 "----" 288 "----"
313 ["Ftp link..." hm--html-add-ftp-link-to-region t] 289 ["Ftp link..." hm--html-add-ftp-link-to-region t]
314 ["News link..." hm--html-add-news-link-to-region t] 290 ["News link..." hm--html-add-news-link-to-region t]
315 ["Mailbox link..." hm--html-add-mail-box-link-to-region t] 291 ["Mailbox link..." hm--html-add-mail-link-to-region t]
316 ["Mailto link..." hm--html-add-mailto-link-to-region t] 292 ["Mailto link..." hm--html-add-mailto-link-to-region t]
317 ["WAIS link (direct)..." hm--html-add-direct-wais-link-to-region t] 293 ["WAIS link (direct)..." hm--html-add-direct-wais-link-to-region t]
318 ["WAIS link (gateway)..." hm--html-add-wais-link-to-region t] 294 ["WAIS link (gateway)..." hm--html-add-wais-link-to-region t]
319 "----" 295 "----"
320 ["Proggate link..." hm--html-add-proggate-link-to-region t] 296 ["Proggate link..." hm--html-add-proggate-link-to-region t]
351 ("Additional Commands" 327 ("Additional Commands"
352 ["Table row frame..." hm--html-add-row-frame-to-region t] 328 ["Table row frame..." hm--html-add-row-frame-to-region t]
353 ) 329 )
354 "----" 330 "----"
355 ["Paragraph container" hm--html-add-paragraph-to-region t] 331 ["Paragraph container" hm--html-add-paragraph-to-region t]
356 ["Document division" hm--html-add-document-division-to-region t]
357 ) 332 )
358 ("Formatting Paragraphs" 333 ("Formatting Paragraphs"
359 ; ["Without links" hm--html-add-plaintext-to-region t] 334 ["Without links" hm--html-add-plaintext-to-region t]
360 ["Preformated" hm--html-add-preformated-to-region t] 335 ["With links" hm--html-add-preformated-to-region t]
336 "----"
361 ["Blockquote" hm--html-add-blockquote-to-region t] 337 ["Blockquote" hm--html-add-blockquote-to-region t]
362 "----" 338 ["Listing" hm--html-add-listing-to-region t]
363 ["Font..." hm--html-add-font-to-region t] 339 ["Abstract" hm--html-add-abstract-to-region t]
340 "----"
364 ["Center" hm--html-add-center-to-region t] 341 ["Center" hm--html-add-center-to-region t]
365 ["Style" hm--html-add-style-to-region t]
366 "----"
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]
370 ) 342 )
371 ("Formatting Words" 343 ("Formatting Words"
372 ["Bold" hm--html-add-bold-to-region t] 344 ["Bold" hm--html-add-bold-to-region t]
373 ["Italic" hm--html-add-italic-to-region t] 345 ["Italic" hm--html-add-italic-to-region t]
374 ["Typewriter" hm--html-add-fixed-to-region t] 346 ["Typewriter" hm--html-add-fixed-to-region t]
425 ; ["Copyright" hm--html-add-copyright-to-region t] 397 ; ["Copyright" hm--html-add-copyright-to-region t]
426 ; ) 398 ; )
427 ; "----" 399 ; "----"
428 ; ["Footnote" hm--html-add-footnote-to-region t] 400 ; ["Footnote" hm--html-add-footnote-to-region t]
429 ; ["Margin" hm--html-add-margin-to-region t] 401 ; ["Margin" hm--html-add-margin-to-region t]
430 ; "----" 402 "----"
431 ; ["HTML Comment" hm--html-add-comment-to-region t] 403 ["HTML Comment" hm--html-add-comment-to-region t]
432 )
433 ("Include"
434 ["Map..." hm--html-add-map-to-region t]
435 "----"
436 ["Applet..." hm--html-add-applet-to-region t]
437 ["Script" hm--html-add-script-to-region t]
438 ) 404 )
439 ("Forms" 405 ("Forms"
440 ["Form..." hm--html-add-form-to-region t]) 406 ["Form..." hm--html-add-form-to-region t])
441 )) 407 ))
442 408
443 409
444 (setq hm--html-menu-region-novice 410 (setq hm--html-menu-region-novice
445 '("HTML Region Novice Menu" 411 '("HTML Region Novice Menu"
446 ("Anchors" 412 ("Anchors"
447 ["Relative link..." hm--html-add-relative-link-to-region t] 413 ["Relative link..." hm--html-add-relative-link-to-region t]
448 ["Drag & Drop"
449 idd-start-mouse-drag-and-drop
450 :active t
451 :keys "\\[idd-mouse-drag-and-drop]"]
452 "----" 414 "----"
453 ["Html link..." hm--html-add-html-link-to-region t] 415 ["Html link..." hm--html-add-html-link-to-region t]
454 ["File link..." hm--html-add-file-link-to-region t] 416 ["File link..." hm--html-add-file-link-to-region t]
455 ) 417 )
456 ("Frame" 418 ("Frame"
461 ("Structure" 423 ("Structure"
462 ["Menu item" hm--html-add-list-or-menu-item-to-region t] 424 ["Menu item" hm--html-add-list-or-menu-item-to-region t]
463 ["Menu" hm--html-add-menu-to-region t] 425 ["Menu" hm--html-add-menu-to-region t]
464 ) 426 )
465 ("Formatting Paragraphs" 427 ("Formatting Paragraphs"
466 ; ["Without links" hm--html-add-plaintext-to-region t] 428 ["Without links" hm--html-add-plaintext-to-region t]
467 ["Preformated" hm--html-add-preformated-to-region t] 429 ["With links" hm--html-add-preformated-to-region t]
468 ) 430 )
469 ("Formatting Words" 431 ("Formatting Words"
470 ["Bold" hm--html-add-bold-to-region t] 432 ["Bold" hm--html-add-bold-to-region t]
471 ["Italic" hm--html-add-italic-to-region t] 433 ["Italic" hm--html-add-italic-to-region t]
472 ["Underline" hm--html-add-underline-to-region t] 434 ["Underline" hm--html-add-underline-to-region t]
487 ["Expert menu" 449 ["Expert menu"
488 hm--html-use-expert-menu 450 hm--html-use-expert-menu
489 :active t 451 :active t
490 :style radio 452 :style radio
491 :selected hm--html-expert] 453 :selected hm--html-expert]
454 ; ["Marcs menu" hm--html-use-marcs-menu t]
492 ) 455 )
493 ["Reload config files" hm--html-load-config-files t] 456 ["Reload config files" hm--html-load-config-files t]
494 ["Templates (fixed dirs) ..."
495 hm--html-insert-template-from-fixed-dirs
496 t]
497 ["Templates ..." hm--html-insert-template t] 457 ["Templates ..." hm--html-insert-template t]
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]"]
506 "----" 458 "----"
507 ["Remove numeric names" hm--html-remove-numeric-names t] 459 ["Remove numeric names" hm--html-remove-numeric-names t]
508 ["Quotify hrefs" hm--html-quotify-hrefs t] 460 ["Quotify hrefs" hm--html-quotify-hrefs t]
509 "----" 461 "----"
510 ["Submit bug report..." hm--html-submit-bug-report t] 462 ["Submit bug report..." hm--html-submit-bug-report t]
532 (if (adapt-xemacsp) 484 (if (adapt-xemacsp)
533 (defun hm--install-html-menu (menu-name) 485 (defun hm--install-html-menu (menu-name)
534 (if (and current-menubar (not (assoc menu-name current-menubar))) 486 (if (and current-menubar (not (assoc menu-name current-menubar)))
535 (progn 487 (progn
536 (set-buffer-menubar (copy-sequence current-menubar)) 488 (set-buffer-menubar (copy-sequence current-menubar))
537 (add-submenu nil 489 (add-menu nil menu-name (cdr hm--html-pulldown-menu)))))
538 (cons menu-name (cdr hm--html-pulldown-menu))
539 "HTML"))))
540 490
541 (defun hm--install-html-menu (menu-name) 491 (defun hm--install-html-menu (menu-name)
542 (if (eq major-mode 'hm--html-mode) 492 (if (eq major-mode 'hm--html-mode)
543 (easy-menu-define hm--html-menu-map 493 (easy-menu-define hm--html-menu-map
544 hm--html-mode-map 494 hm--html-mode-map
548 (easy-menu-define hm--html-minor-menu-map 498 (easy-menu-define hm--html-minor-menu-map
549 hm--html-minor-mode-map 499 hm--html-minor-mode-map
550 "The hm--html-minor-mode pulldown menu." 500 "The hm--html-minor-mode pulldown menu."
551 (cons menu-name 501 (cons menu-name
552 (cdr hm--html-pulldown-menu)))) 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))
553 )) 513 ))
554 514
555 (if (adapt-emacs19p) 515 (if (adapt-emacs19p)
556 (progn 516 (progn
557 517
579 ) 539 )
580 (x-popup-menu nil hm--html-menu-noregion-novice-map) 540 (x-popup-menu nil hm--html-menu-noregion-novice-map)
581 (x-popup-menu nil hm--html-menu-region-novice-map)) 541 (x-popup-menu nil hm--html-menu-region-novice-map))
582 542
583 543
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)))
584 ) 576 )
585 577
586 (defun hm--html-popup-menu (event) 578 (defun hm--html-popup-menu (event)
587 "Pops the HTML- menu up, if no region is active." 579 "Pops the HTML- menu up, if no region is active."
588 (interactive "@e") 580 (interactive "@e")
581 ; (if hm--html-marc
582 ; (popup-menu html-menu)
589 (if hm--html-expert 583 (if hm--html-expert
590 (popup-menu hm--html-menu-noregion-expert) 584 (popup-menu hm--html-menu-noregion-expert)
591 (popup-menu hm--html-menu-noregion-novice))) 585 (popup-menu hm--html-menu-noregion-novice)))
586 ;)
592 587
593 588
594 (defun hm--html-popup-menu-region (event) 589 (defun hm--html-popup-menu-region (event)
595 "Pops the HTML- menu up, if a region is active." 590 "Pops the HTML- menu up, if a region is active."
596 (interactive "@e") 591 (interactive "@e")
592 ; (if hm--html-marc
593 ; (popup-menu html-menu)
597 (if hm--html-expert 594 (if hm--html-expert
598 (popup-menu hm--html-menu-region-expert) 595 (popup-menu hm--html-menu-region-expert)
599 (popup-menu hm--html-menu-region-novice))) 596 (popup-menu hm--html-menu-region-novice)))
597 ;)
600 ) 598 )
601 599
602 600
603 (if (adapt-xemacsp) 601 (if (adapt-xemacsp)
604 (progn 602 (progn
605 603
606 (defun hm--html-use-novice-menu () 604 (defun hm--html-use-novice-menu ()
607 "Changes the HTML popup menu to the novice menu." 605 "Changes the HTML popup menu to the novice menu."
608 (interactive) 606 (interactive)
609 (setq hm--html-expert nil) 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)
610 ) 611 )
611 612
612 613
613 (defun hm--html-use-expert-menu () 614 (defun hm--html-use-expert-menu ()
614 "Changes the HTML popup menu to the expert menu." 615 "Changes the HTML popup menu to the expert menu."
615 (interactive) 616 (interactive)
616 (setq hm--html-expert t) 617 (setq hm--html-expert t)
618 ; (setq hm--html-marc nil)
619 ; (define-key html-mode-map '(button3) 'hm--popup-html-menu)
620 ; (define-key html-region-mode-map '(button3) 'hm--popup-html-menu)
617 ) 621 )
618 ) 622 )
619 623
620 ;; For the Emacs 19 624 ;; For the Emacs 19
621 (defun hm--html-use-novice-menu () 625 (defun hm--html-use-novice-menu ()
657 hm--html-emacs19-popup-noregion-menu-button 661 hm--html-emacs19-popup-noregion-menu-button
658 hm--html-menu-noregion-expert-map)) 662 hm--html-menu-noregion-expert-map))
659 ) 663 )
660 ) 664 )
661 665
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
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
676 ;(add-hook 'html-mode-hook 'hm--install-html-menu)
677
678
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)))
662 705
663 (defvar hm--html-use-psgml t 706 (defvar hm--html-use-psgml t
664 "Set this to t, if functions from the psgml-mode should be used.") 707 "Set this to t, if functions from the psgml-mode should be used.")
665 708
666 ;;; Popup the menus in the minor mode 709 ;;; Popup the menus in the minor mode
688 (popup-menu (append hm--html-popup-menu ; for the hm--html-menu 731 (popup-menu (append hm--html-popup-menu ; for the hm--html-menu
689 (list "==" ; 732 (list "==" ;
690 (car menudesc) ; 733 (car menudesc) ;
691 "==") ; 734 "==") ;
692 (cdr menudesc))) ; 735 (cdr menudesc))) ;
693 (while (popup-up-p) 736 (while (popup-menu-up-p)
694 (setq event (next-command-event event)) 737 (setq event (next-command-event event))
695 (cond ((misc-user-event-p event) 738 (cond ((menu-event-p event)
696 (cond 739 (cond
697 ((eq (event-object event) 'abort) 740 ((eq (event-object event) 'abort)
698 (signal 'quit nil)) 741 (signal 'quit nil))
699 ((eq (event-object event) 'menu-no-selection-hook) 742 ((eq (event-object event) 'menu-no-selection-hook)
700 nil) 743 nil)
747 )) 790 ))
748 791
749 )) 792 ))
750 793
751 794
795 ;(defvar hm--html-menu-load-hook nil
796 ; "*Hook variable to execute functions after loading the file hm--html-menu.")
797
798
752 (run-hooks 'hm--html-menu-load-hook) 799 (run-hooks 'hm--html-menu-load-hook)
753 800
754 801
755 ;;; Announce the feature hm--html-menu 802 ;;; Announce the feature hm--html-menu
756 (provide 'hm--html-menu) 803 (provide 'hm--html-menu)