Initial Commit
[packages] / xemacs-packages / hm--html-menus / hm--html-menu.el
1 ;;;  hm--html-menu ---  A menu for the hm--html-mode.
2 ;;;  
3 ;;;  $Id: hm--html-menu.el,v 6.22 2003-10-08 06:40:50 viteno Exp $
4 ;;;
5 ;;;  Copyright (C) 1993 - 1998  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 ;;;
25 ;;;     Defines pulldown and popup menus for the html mode (hm--html-mode).
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 ;;;   
34 ;;;     Put this file in one of your load path directories.
35 ;;;
36 ;;;     Look at the files hm--html-mode.el and hm--html-configuration
37 ;;;     for further installation points.
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"
53           ["Relative link..." hm--html-add-relative-link t]
54           ["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           "----"
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-box-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           ["CGI link..." hm--html-add-cgi-link t]
73           ["Proggate link..." hm--html-add-proggate-link t]
74           ["Local Proggate link..." hm--html-add-local-proggate-link t]
75           "----"
76           ["Link target..." hm--html-add-link-target t]
77           )
78          ("Frame"
79           ["Full html frame..." hm--html-add-full-html-frame t]
80           ["Frame template..." 
81            (hm--html-insert-template hm--html-frame-template-file)
82            (file-exists-p hm--html-frame-template-file)]
83           "----"
84           ["Doctype" hm--html-add-doctype t]
85           ["Html" hm--html-add-html t]
86           ["Head" hm--html-add-head t]
87           ["Body" hm--html-add-body t]
88           "----"
89           ["Title and Header..." hm--html-add-title-and-header t]
90           ["Title..." hm--html-add-title t]
91           ["Header..." hm--html-add-header t]
92           ["Address" hm--html-add-address t]
93           ["Signature" hm--html-add-signature t]
94           "----"
95           ["Meta information..." hm--html-add-meta t]
96           ["Node Link..." hm--html-add-normal-node-link t]
97           ["Isindex..." hm--html-add-isindex t]
98           ["Document Base..." hm--html-add-base t]
99           "----"
100           ["Created comment" hm--html-insert-created-comment t]
101           ["Changed comment" hm--html-insert-changed-comment t]
102           ["Modified line" hm--html-insert-modified-line t]
103           ["New date in title" hm--html-new-date t]
104           )
105          ("Structure"
106           ["Menu or list item" hm--html-add-list-or-menu-item t]
107           ["Menu" hm--html-add-menu t]
108           ["Unordered list" hm--html-add-list t]
109           ["Ordered list" hm--html-add-numberlist t]
110           ["Directory list" hm--html-add-directory-list t]
111           "----"
112           ["Description list" hm--html-add-description-list t]
113           ["Description title" hm--html-add-description-title t]
114           ["Description entry" hm--html-add-description-entry t]
115           ["Description title + entry" 
116            hm--html-add-description-title-and-entry t]
117           "----"
118           ["Table..." hm--html-add-table t]
119           ["Table title..." hm--html-add-table-title t]
120           ["Table header..." hm--html-add-table-header t]
121           ["Table first row..." hm--html-add-first-table-row t]
122           ["Table additional row..." hm--html-add-additional-table-row t]
123           ("Additional Commands"
124            ["Table row frame..." hm--html-add-row-frame t]
125            ["Table header entry..." hm--html-add-header-entry t]
126            ["Table row entry..." hm--html-add-row-entry t]
127            ["Span columns..." hm--html-table-add-colspan-attribute t]
128            ["Span rows..." hm--html-table-add-rowspan-attribute t]
129            )
130           "----"
131           ["Paragraph container" hm--html-add-paragraph t]
132           ["Paragraph start tag" hm--html-add-paragraph-separator t]
133           ["Document division" hm--html-add-document-division t]
134           ["New line" hm--html-add-line-break t]
135           ["Horizontal rule" hm--html-add-horizontal-rule t]
136           )
137          ("Formatting Paragraphs"
138 ;         ["Without links" hm--html-add-plaintext t]
139           ["Preformatted" hm--html-add-preformatted t]
140           ["Blockquote" hm--html-add-blockquote t]
141           "----"
142           ["Basefont..." hm--html-add-basefont t]
143           ["Font..." hm--html-add-font t]
144           ["Center" hm--html-add-center t]
145           ["Style" hm--html-add-style t]
146           "----"
147           ["HTML Comment" hm--html-add-comment t]
148 ;         ["Listing" hm--html-add-listing t]
149 ;         ["Abstract" hm--html-add-abstract t]
150           )
151          ("Formatting Words"
152           ["Bold" hm--html-add-bold t]
153           ["Italic" hm--html-add-italic t]
154           ["Typewriter" hm--html-add-fixed t]
155           ["Small" hm--html-add-small t]
156           ["Big" hm--html-add-big t]
157           ["Superscript" hm--html-add-superscript t]
158           ["Subscript" hm--html-add-subscript t]
159           "----"
160           ["Underline" hm--html-add-underline t]
161           ["Strikethru" hm--html-add-strikethru t]
162           "----"
163 ;          ["Emphasized" hm--html-add-emphasized t]
164 ;          ["Strong" hm--html-add-strong t]
165 ;          "----"
166           ("Phrase"
167            ["Emphasized" hm--html-add-emphasized t]
168            ["Strong" hm--html-add-strong t]
169            "----"
170            ["Definition" hm--html-add-definition t]
171            ["Keyboard" hm--html-add-keyboard t]
172            ["Variable" hm--html-add-variable t]
173            ["Code" hm--html-add-code t]
174            ["Sample" hm--html-add-sample t]
175            ["Citation" hm--html-add-citation t]
176            )
177 ;; All the following commands are still implemented, but most
178 ;; of them are not defined in HTM 3.2
179 ;; You've to load hm--html-not-standard.el to use them
180 ;         ("Computing"
181 ;          ["Definition" hm--html-add-definition t]
182 ;          ["Keyboard" hm--html-add-keyboard t]
183 ;          ["Command" hm--html-add-command t]
184 ;          ["Argument" hm--html-add-argument t]
185 ;          ["Option" hm--html-add-option t]
186 ;          ["Variable" hm--html-add-variable t]
187 ;          ["Instance" hm--html-add-instance t]
188 ;          ["Code" hm--html-add-code t]
189 ;          ["Sample" hm--html-add-sample t]
190 ;          )
191 ;         ("Literature"
192 ;          ["Quote" hm--html-add-quote t]
193 ;          ["Acronym" hm--html-add-acronym t]
194 ;          ["Abbreviation" hm--html-add-abbreviation t]
195 ;          ["Citation" hm--html-add-citation t]
196 ;          ["Literature" hm--html-add-literature t]
197 ;          ["Publication" hm--html-add-publication t]
198 ;          ["ISBN" hm--html-add-isbn t]
199 ;          )
200 ;         ("Person"
201 ;          ["Person" hm--html-add-person t]
202 ;          ["Author" hm--html-add-author t]
203 ;          ["Editor" hm--html-add-editor t]
204 ;          ["Credits" hm--html-add-credits t]
205 ;          ["Copyright" hm--html-add-copyright t]
206 ;          )
207 ;         "----"
208 ;         ["Footnote" hm--html-add-footnote t]
209 ;         ["Margin" hm--html-add-margin t]
210 ;         "----"
211 ;         ["HTML Comment" hm--html-add-comment t]
212           )
213          ("Include"
214           ["Top aligned image..." hm--html-add-image-top t]
215           ["Middle aligned image..." hm--html-add-image-middle t]
216           ["Bottom aligned image..." hm--html-add-image-bottom t]
217           ["Image as map? ..." hm--html-add-image t]
218           ["Drag & Drop"
219            idd-start-mouse-drag-and-drop
220            :active t
221            :keys "\\[idd-mouse-drag-and-drop]"]
222           "----"
223           ["Image map..." hm--html-add-image-map t]
224           ["Map..." hm--html-add-map t]
225           ["Area..." hm--html-add-area t]
226           "----"
227           ["Applet..." hm--html-add-applet t]
228           ["Parameter..." hm--html-add-applet-parameter t]
229           ["Script" hm--html-add-script t]
230 ;         "----"
231 ;         ["File..."  hm--html-add-server-side-include-file t]
232 ;         ["Command..." hm--html-add-server-side-include-command t]
233 ;         ["Command with isindex parameter..." 
234 ;          hm--html-add-server-side-include-command-with-isindex-parameter
235 ;          t]
236           )
237          ("Forms"
238           ["Form..." hm--html-add-form t]
239           "----"
240           ["Text field..." hm--html-form-add-input-text t]
241           ["Password field..." hm--html-form-add-input-password t]
242           ["Isindex field..." hm--html-form-add-input-isindex t]
243           ["Integer field..." hm--html-form-add-input-integer t]
244           ["Float field..." hm--html-form-add-input-float t]
245           ["Date field..." hm--html-form-add-input-date t]
246           ["Url field..." hm--html-form-add-input-url t]
247           ["Scribble field..." hm--html-form-add-input-scribble t]
248           "----"
249           ["Checkbox button..." hm--html-form-add-input-checkbox t]
250           ["Radio button..." hm--html-form-add-input-radio t]
251           ["Reset button..." hm--html-form-add-input-reset t]
252           ["Submit button..." hm--html-form-add-input-submit t]
253           ["Image button..." hm--html-form-add-input-image t]
254           ["Audio button..." hm--html-form-add-input-audio t]
255           "----"
256           ["Option Menu..." hm--html-form-add-select-option-menu t]
257           ["Scrolled List..." hm--html-form-add-select-scrolled-list t]
258           ["Option..." hm--html-form-add-select-option t]
259           "----"
260           ["Textarea..." hm--html-form-add-textarea t]
261           )
262          ))
263
264
265 (setq hm--html-menu-noregion-novice
266        '("HTML No-region Novice Menu"
267          ("Anchors"
268           ["Relative link..." hm--html-add-relative-link t]
269           ["Drag & Drop"
270            idd-start-mouse-drag-and-drop 
271            :active t
272            :keys "\\[idd-mouse-drag-and-drop]"]
273           "----"
274           ["Html link..." hm--html-add-html-link t]
275           ["File link..." hm--html-add-file-link t]
276           )
277          ("Frame"
278           ["Full html frame..." hm--html-add-full-html-frame t]
279           "----"
280           ["Title and Header..." hm--html-add-title-and-header t]
281           ["Signature" hm--html-add-signature t]
282           )
283          ("Structure"
284           ["Menu item" hm--html-add-list-or-menu-item t]
285           ["Menu" hm--html-add-menu t]
286           "----"
287           ["Paragraph Container" hm--html-add-paragraph t]
288           )
289          ("Formatting Paragraphs"
290 ;         ["Without links" hm--html-add-plaintext t]
291           ["Preformatted" hm--html-add-preformatted t]
292           )
293          ("Formatting Words"
294           ["Bold" hm--html-add-bold t]
295           ["Italic" hm--html-add-italic t]
296           ["Underline" hm--html-add-underline t]
297           ["Typewriter" hm--html-add-fixed t]
298           )))
299
300 (setq hm--html-menu-region-expert
301        '("HTML Region Expert Menu"
302          ("Anchors"
303           ["Relative link..." hm--html-add-relative-link-to-region t]
304           ["General link..." hm--html-add-normal-link-to-region t]
305           ["Drag & Drop"
306            idd-start-mouse-drag-and-drop 
307            :active t
308            :keys "\\[idd-mouse-drag-and-drop]"]
309           "----"
310           ["Html link..." hm--html-add-html-link-to-region t]
311           ["Info link..." hm--html-add-info-link-to-region t]
312           ["Gopher link..." hm--html-add-gopher-link-to-region t]
313           ["File link..." hm--html-add-file-link-to-region t]
314           "----"
315           ["Ftp link..." hm--html-add-ftp-link-to-region t]
316           ["News link..." hm--html-add-news-link-to-region t]
317           ["Mailbox link..." hm--html-add-mail-box-link-to-region t]
318           ["Mailto link..." hm--html-add-mailto-link-to-region t]
319           ["WAIS link (direct)..." hm--html-add-direct-wais-link-to-region t]
320           ["WAIS link (gateway)..." hm--html-add-wais-link-to-region t]
321           "----"
322           ["CGI link..." hm--html-add-cgi-link-to-region t]
323           ["Proggate link..." hm--html-add-proggate-link-to-region t]
324           ["Local Proggate link..." 
325            hm--html-add-local-proggate-link-to-region 
326            t]
327           "----"
328           ["Link target..." hm--html-add-link-target-to-region t]
329           )
330          ("Frame"
331           ["Full html frame..." hm--html-add-full-html-frame-with-region t]
332           "----"
333           ["Head" hm--html-add-head-to-region t]
334           ["Body" hm--html-add-body-to-region t]
335           "----"
336           ["Title and Header..." hm--html-add-title-and-header-to-region t]
337           ["Title" hm--html-add-title-to-region t]
338           ["Header..." hm--html-add-header-to-region t]
339           ["Address" hm--html-add-address-to-region t]
340           )
341          ("Structure"
342           ["Menu item" hm--html-add-list-or-menu-item-to-region t]
343           ["Menu" hm--html-add-menu-to-region t]
344           ["Unordered list" hm--html-add-list-to-region t]
345           ["Ordered list" hm--html-add-numberlist-to-region t]
346           ["Directory list" hm--html-add-directorylist-to-region t]
347           "----"
348           ["Description list" hm--html-add-description-list-to-region t]
349           ["Description title" hm--html-add-description-title-to-region t]
350           ["Description entry" hm--html-add-description-entry-to-region t]
351           "----"
352           ["Table..." hm--html-add-table-to-region t]
353           ["Table Title..." hm--html-add-table-title-to-region t]
354           ("Additional Commands"
355            ["Table row frame..." hm--html-add-row-frame-to-region t]
356            )
357           "----"
358           ["Paragraph container" hm--html-add-paragraph-to-region t]
359           ["Document division" hm--html-add-document-division-to-region t]
360           )
361          ("Formatting Paragraphs"
362 ;         ["Without links" hm--html-add-plaintext-to-region t]
363           ["Preformatted" hm--html-add-preformatted-to-region t]
364           ["Blockquote" hm--html-add-blockquote-to-region t]
365           "----"
366           ["Font..." hm--html-add-font-to-region t]
367           ["Center" hm--html-add-center-to-region t]
368           ["Style" hm--html-add-style-to-region t]
369           "----"
370           ["HTML Comment" hm--html-add-comment-to-region t]
371 ;         ["Listing" hm--html-add-listing-to-region t]
372 ;         ["Abstract" hm--html-add-abstract-to-region t]
373           )
374          ("Formatting Words"
375           ["Bold" hm--html-add-bold-to-region t]
376           ["Italic" hm--html-add-italic-to-region t]
377           ["Typewriter" hm--html-add-fixed-to-region t]
378           ["Small" hm--html-add-small-to-region t]
379           ["Big" hm--html-add-big-to-region t]
380           ["Superscript" hm--html-add-superscript-to-region t]
381           ["Subscript" hm--html-add-subscript-to-region t]
382           "----"
383           ["Underline" hm--html-add-underline-to-region t]
384           ["Strikethru" hm--html-add-strikethru-to-region t]
385           ;;      ["Render" hm--html-add-render-to-region t]
386           "----"
387 ;          ["Emphasized" hm--html-add-emphasized-to-region t]
388 ;          ["Strong" hm--html-add-strong-to-region t]
389 ;         "----"
390           ("Phrase"
391            ["Emphasized" hm--html-add-emphasized-to-region t]
392            ["Strong" hm--html-add-strong-to-region t]
393            "----"
394            ["Definition" hm--html-add-definition-to-region t]
395            ["Keyboard" hm--html-add-keyboard-to-region t]
396            ["Variable" hm--html-add-variable-to-region t]         
397            ["Code" hm--html-add-code-to-region t]
398            ["Sample" hm--html-add-sample-to-region t]
399            ["Citation" hm--html-add-citation-to-region t]
400            )
401 ;; All the following commands are still implemented, but most
402 ;; of them are not defined in HTM 3.2
403 ;         ("Computing"
404 ;          ["Definition" hm--html-add-definition-to-region t]
405 ;          ["Keyboard" hm--html-add-keyboard-to-region t]
406 ;          ["Command" hm--html-add-command-to-region t]
407 ;          ["Argument" hm--html-add-argument-to-region t]
408 ;          ["Option" hm--html-add-option-to-region t]
409 ;          ["Variable" hm--html-add-variable-to-region t]         
410 ;          ["Instance" hm--html-add-instance-to-region t]
411 ;          ["Code" hm--html-add-code-to-region t]
412 ;          ["Sample" hm--html-add-sample-to-region t]
413 ;          )
414 ;         ("Literature"
415 ;          ["Quote" hm--html-add-quote-to-region t]
416 ;          ["Acronym" hm--html-add-acronym-to-region t]
417 ;          ["Abbrevation" hm--html-add-abbrevation-to-region t]
418 ;          ["Citation" hm--html-add-citation-to-region t]
419 ;          ["Literature" hm--html-add-literature-to-region t]
420 ;          ["Publication" hm--html-add-publication-to-region t]
421 ;          ["ISBN" hm--html-add-isbn-to-region t]
422 ;          )
423 ;         ("Person"
424 ;          ["Person" hm--html-add-person-to-region t]
425 ;          ["Author" hm--html-add-author-to-region t]
426 ;          ["Editor" hm--html-add-editor-to-region t]
427 ;          ["Credits" hm--html-add-credits-to-region t]
428 ;          ["Copyright" hm--html-add-copyright-to-region t]
429 ;          )
430 ;         "----"
431 ;         ["Footnote" hm--html-add-footnote-to-region t]
432 ;         ["Margin" hm--html-add-margin-to-region t]
433 ;         "----"
434 ;         ["HTML Comment" hm--html-add-comment-to-region t]
435           )
436          ("Include"
437           ["Map..." hm--html-add-map-to-region t]
438           "----"
439           ["Applet..." hm--html-add-applet-to-region t]
440           ["Script" hm--html-add-script-to-region t]
441           )
442          ("Forms"
443           ["Form..." hm--html-add-form-to-region t])
444          ))
445
446
447 (setq hm--html-menu-region-novice
448       '("HTML Region Novice Menu"
449          ("Anchors"
450           ["Relative link..." hm--html-add-relative-link-to-region t]
451           ["Drag & Drop"
452            idd-start-mouse-drag-and-drop 
453            :active t
454            :keys "\\[idd-mouse-drag-and-drop]"]
455           "----"
456           ["Html link..." hm--html-add-html-link-to-region t]
457           ["File link..." hm--html-add-file-link-to-region t]
458           )
459          ("Frame"
460           ["Full html frame..." hm--html-add-full-html-frame-with-region t]
461           "----"