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