Mercurial > hg > xemacs-beta
comparison lisp/menubar-items.el @ 406:b8cc9ab3f761 r21-2-33
Import from CVS: tag r21-2-33
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:17:09 +0200 |
parents | 2f8bb876ab1d |
children | 501cfd01ee6d |
comparison
equal
deleted
inserted
replaced
405:0e08f63c74d2 | 406:b8cc9ab3f761 |
---|---|
2 | 2 |
3 ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1991-1995, 1997-1998 Free Software Foundation, Inc. |
4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. | 4 ;; Copyright (C) 1995 Tinker Systems and INS Engineering Corp. |
5 ;; Copyright (C) 1995 Sun Microsystems. | 5 ;; Copyright (C) 1995 Sun Microsystems. |
6 ;; Copyright (C) 1995, 1996, 2000 Ben Wing. | 6 ;; Copyright (C) 1995, 1996, 2000 Ben Wing. |
7 ;; Copyright (C) 1997 MORIOKA Tomohiko | 7 ;; Copyright (C) 1997 MORIOKA Tomohiko. |
8 | 8 |
9 ;; Maintainer: XEmacs Development Team | 9 ;; Maintainer: XEmacs Development Team |
10 ;; Keywords: frames, extensions, internal, dumped | 10 ;; Keywords: frames, extensions, internal, dumped |
11 | 11 |
12 ;; This file is part of XEmacs. | 12 ;; This file is part of XEmacs. |
23 | 23 |
24 ;; You should have received a copy of the GNU General Public License | 24 ;; You should have received a copy of the GNU General Public License |
25 ;; along with Xmacs; see the file COPYING. If not, write to the | 25 ;; along with Xmacs; see the file COPYING. If not, write to the |
26 ;; Free Software Foundation, 59 Temple Place - Suite 330, | 26 ;; Free Software Foundation, 59 Temple Place - Suite 330, |
27 ;; Boston, MA 02111-1307, USA. | 27 ;; Boston, MA 02111-1307, USA. |
28 | |
29 ;;; Authorship: | |
30 | |
31 ;; Created c. 1991 for Lucid Emacs. Originally called x-menubar.el. | |
32 ;; Contained four menus -- File, Edit, Buffers, Help. | |
33 ;; Dynamic menu changes possible only through activate-menubar-hook. | |
34 ;; Also contained menu manipulation funs, e.g. find-menu-item, add-menu. | |
35 ;; Options menu added for 19.9 by Jamie Zawinski, late 1993. | |
36 ;; Major reorganization c. 1994 by Ben Wing; added many items and moved | |
37 ;; some items to two new menus, Apps and Tools. (for 19.10?) | |
38 ;; Generic menubar functions moved to new file, menubar.el, by Ben Wing, | |
39 ;; 1995, for 19.12; also, creation of current buffers menu options, | |
40 ;; and buffers menu changed from purely most-recent to sorted alphabetical, | |
41 ;; by mode. Also added mode-popup-menu support. | |
42 ;; New API (add-submenu, add-menu-button) and menu filter support added | |
43 ;; late summer 1995 by Stig, for 19.13. Also popup-menubar-menu. | |
44 ;; Renamed to menubar-items.el c. 1998, with MS Win support. | |
45 ;; Options menu rewritten to use custom c. 1999 by ? (Jan Vroonhof?). | |
46 ;; Major reorganization Mar. 2000 by Ben Wing; added many items and changed | |
47 ;; top-level menus to File, Edit, View, Cmds, Tools, Options, Buffers. | |
48 ;; Accelerator spec functionality added Mar. 2000 by Ben Wing. | |
28 | 49 |
29 ;;; Commentary: | 50 ;;; Commentary: |
30 | 51 |
31 ;; This file is dumped with XEmacs (when window system and menubar support is | 52 ;; This file is dumped with XEmacs (when window system and menubar support is |
32 ;; compiled in). | 53 ;; compiled in). |
124 :active (buffer-modified-p) | 145 :active (buffer-modified-p) |
125 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] | 146 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] |
126 ["Save %_As..." write-file] | 147 ["Save %_As..." write-file] |
127 ["Save So%_me Buffers" save-some-buffers] | 148 ["Save So%_me Buffers" save-some-buffers] |
128 "-----" | 149 "-----" |
129 ["%_Print Buffer" lpr-buffer | 150 ["%_Print Buffer" generic-print-buffer |
130 :active (fboundp 'lpr-buffer) | 151 :active (or (valid-specifier-tag-p 'msprinter) |
152 (and (not (eq system-type 'windows-nt)) | |
153 (fboundp 'lpr-buffer))) | |
131 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] | 154 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] |
132 ["Prett%_y-Print Buffer" ps-print-buffer-with-faces | 155 ["Prett%_y-Print Buffer" ps-print-buffer-with-faces |
133 :active (fboundp 'ps-print-buffer-with-faces) | 156 :active (fboundp 'ps-print-buffer-with-faces) |
134 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] | 157 :suffix (if put-buffer-names-in-file-menu (buffer-name) "")] |
135 "-----" | 158 "-----" |
171 :active (selection-owner-p)] | 194 :active (selection-owner-p)] |
172 "----" | 195 "----" |
173 ["Select %_All" mark-whole-buffer] | 196 ["Select %_All" mark-whole-buffer] |
174 ["Select %_Page" mark-page] | 197 ["Select %_Page" mark-page] |
175 "----" | 198 "----" |
176 ["%_1 Search..." isearch-forward] | 199 ["%_Search..." make-search-dialog] |
177 ["%_2 Search Backward..." isearch-backward] | 200 ["%_1 Replace..." query-replace] |
178 ["%_3 Replace..." query-replace] | |
179 "----" | 201 "----" |
180 ["%_4 Search (Regexp)..." isearch-forward-regexp] | 202 ["%_2 Search (Regexp)..." isearch-forward-regexp] |
181 ["%_5 Search Backward (Regexp)..." isearch-backward-regexp] | 203 ["%_3 Search Backward (Regexp)..." isearch-backward-regexp] |
182 ["%_6 Replace (Regexp)..." query-replace-regexp] | 204 ["%_4 Replace (Regexp)..." query-replace-regexp] |
183 | 205 |
184 ,@(when (featurep 'mule) | 206 ,@(when (featurep 'mule) |
185 '("----" | 207 '("----" |
186 ("%_Multilingual (\"Mule\")" | 208 ("%_Multilingual (\"Mule\")" |
187 ("%_Describe Language Support") | 209 ("%_Describe Language Support") |
334 ["Rectangle %_from Register" insert-register] | 356 ["Rectangle %_from Register" insert-register] |
335 ["%_Clear Rectangle" clear-rectangle] | 357 ["%_Clear Rectangle" clear-rectangle] |
336 ["%_Open Rectangle" open-rectangle] | 358 ["%_Open Rectangle" open-rectangle] |
337 ["%_Prefix Rectangle..." string-rectangle] | 359 ["%_Prefix Rectangle..." string-rectangle] |
338 ["Rectangle %_Mousing" | 360 ["Rectangle %_Mousing" |
339 (customize-set-variable | 361 (customize-set-variable 'mouse-track-rectangle-p |
340 mouse-track-rectangle-p (not mouse-track-rectangle-p)) | 362 (not mouse-track-rectangle-p)) |
341 :style toggle :selected mouse-track-rectangle-p] | 363 :style toggle :selected mouse-track-rectangle-p] |
342 ) | 364 ) |
343 ("%_Sort" | 365 ("%_Sort" |
344 ["%_Lines" sort-lines :active (region-exists-p)] | 366 ["%_Lines" sort-lines :active (region-exists-p)] |
345 ["%_Paragraphs" sort-paragraphs :active (region-exists-p)] | 367 ["%_Paragraphs" sort-paragraphs :active (region-exists-p)] |
394 (vector string | 416 (vector string |
395 (list 'grep string))) | 417 (list 'grep string))) |
396 (menu-truncate-list grep-history 10))))) | 418 (menu-truncate-list grep-history 10))))) |
397 (append menu '("---") items)))) | 419 (append menu '("---") items)))) |
398 ["%_Grep..." grep :active (fboundp 'grep)] | 420 ["%_Grep..." grep :active (fboundp 'grep)] |
399 ["%_Repeat Grep" recompile :active (fboundp 'recompile)] | |
400 ["%_Kill Grep" kill-compilation | 421 ["%_Kill Grep" kill-compilation |
401 :active (and (fboundp 'kill-compilation) | 422 :active (and (fboundp 'kill-compilation) |
402 (fboundp 'compilation-find-buffer) | 423 (fboundp 'compilation-find-buffer) |
403 (let ((buffer (condition-case nil | 424 (let ((buffer (condition-case nil |
404 (compilation-find-buffer) | 425 (compilation-find-buffer) |
407 "---" | 428 "---" |
408 ["Grep %_All Files in Current Directory..." | 429 ["Grep %_All Files in Current Directory..." |
409 (progn | 430 (progn |
410 (require 'compile) | 431 (require 'compile) |
411 (let ((grep-command | 432 (let ((grep-command |
412 (cons (concat grep-command " *") (length grep-command)))) | 433 (cons (concat grep-command " *") |
434 (length grep-command)))) | |
413 (call-interactively 'grep))) | 435 (call-interactively 'grep))) |
414 :active (fboundp 'grep)] | 436 :active (fboundp 'grep)] |
415 ["Grep %_C Files in Current Directory..." | 437 ["Grep %_C and C Header Files in Current Directory..." |
416 (progn | 438 (progn |
417 (require 'compile) | 439 (require 'compile) |
418 (let ((grep-command | 440 (let ((grep-command |
419 (cons (concat grep-command " *.[ch]") (length grep-command)))) | 441 (cons (concat grep-command " *.[chCH]" |
442 ; i wanted to also use *.cc and *.hh. | |
443 ; see long comment below under Perl. | |
444 ) | |
445 (length grep-command)))) | |
446 (call-interactively 'grep))) | |
447 :active (fboundp 'grep)] | |
448 ["Grep C Hea%_der Files in Current Directory..." | |
449 (progn | |
450 (require 'compile) | |
451 (let ((grep-command | |
452 (cons (concat grep-command " *.[hH]" | |
453 ; i wanted to also use *.hh. | |
454 ; see long comment below under Perl. | |
455 ) | |
456 (length grep-command)))) | |
420 (call-interactively 'grep))) | 457 (call-interactively 'grep))) |
421 :active (fboundp 'grep)] | 458 :active (fboundp 'grep)] |
422 ["Grep %_E-Lisp Files in Current Directory..." | 459 ["Grep %_E-Lisp Files in Current Directory..." |
423 (progn | 460 (progn |
424 (require 'compile) | 461 (require 'compile) |
425 (let ((grep-command | 462 (let ((grep-command |
426 (cons (concat grep-command " *.el") (length grep-command)))) | 463 (cons (concat grep-command " *.el") |
464 (length grep-command)))) | |
465 (call-interactively 'grep))) | |
466 :active (fboundp 'grep)] | |
467 ["Grep %_Perl Files in Current Directory..." | |
468 (progn | |
469 (require 'compile) | |
470 (let ((grep-command | |
471 (cons (concat grep-command " *.pl" | |
472 ; i wanted to use this: | |
473 ; " *.pl *.pm *.am" | |
474 ; but grep complains if it can't | |
475 ; match anything in a glob, and | |
476 ; that screws other things up. | |
477 ; perhaps we need to first scan | |
478 ; each separate glob in the directory | |
479 ; to see if there are any files in | |
480 ; that glob, and if not, omit it. | |
481 ) | |
482 (length grep-command)))) | |
483 (call-interactively 'grep))) | |
484 :active (fboundp 'grep)] | |
485 ["Grep %_HTML Files in Current Directory..." | |
486 (progn | |
487 (require 'compile) | |
488 (let ((grep-command | |
489 (cons (concat grep-command " *.*htm*") | |
490 (length grep-command)))) | |
427 (call-interactively 'grep))) | 491 (call-interactively 'grep))) |
428 :active (fboundp 'grep)] | 492 :active (fboundp 'grep)] |
429 "---" | 493 "---" |
430 ["%_Next Match" next-error | 494 ["%_Next Match" next-error |
431 :active (and (fboundp 'compilation-errors-exist-p) | 495 :active (and (fboundp 'compilation-errors-exist-p) |
432 (compilation-errors-exist-p))] | 496 (compilation-errors-exist-p))] |
433 ["%_Previous Match" previous-error | 497 ["Pre%_vious Match" previous-error |
434 :active (and (fboundp 'compilation-errors-exist-p) | 498 :active (and (fboundp 'compilation-errors-exist-p) |
435 (compilation-errors-exist-p))] | 499 (compilation-errors-exist-p))] |
436 ["%_First Match" first-error | 500 ["%_First Match" first-error |
437 :active (and (fboundp 'compilation-errors-exist-p) | 501 :active (and (fboundp 'compilation-errors-exist-p) |
438 (compilation-errors-exist-p))] | 502 (compilation-errors-exist-p))] |
472 (and buffer (get-buffer-process buffer))))] | 536 (and buffer (get-buffer-process buffer))))] |
473 "---" | 537 "---" |
474 ["%_Next Error" next-error | 538 ["%_Next Error" next-error |
475 :active (and (fboundp 'compilation-errors-exist-p) | 539 :active (and (fboundp 'compilation-errors-exist-p) |
476 (compilation-errors-exist-p))] | 540 (compilation-errors-exist-p))] |
477 ["%_Previous Error" previous-error | 541 ["Pre%_vious Error" previous-error |
478 :active (and (fboundp 'compilation-errors-exist-p) | 542 :active (and (fboundp 'compilation-errors-exist-p) |
479 (compilation-errors-exist-p))] | 543 (compilation-errors-exist-p))] |
480 ["%_First Error" first-error | 544 ["%_First Error" first-error |
481 :active (and (fboundp 'compilation-errors-exist-p) | 545 :active (and (fboundp 'compilation-errors-exist-p) |
482 (compilation-errors-exist-p))] | 546 (compilation-errors-exist-p))] |
698 (customize-set-variable 'debug-on-signal (not debug-on-signal)) | 762 (customize-set-variable 'debug-on-signal (not debug-on-signal)) |
699 :style toggle :selected debug-on-signal] | 763 :style toggle :selected debug-on-signal] |
700 ) | 764 ) |
701 | 765 |
702 ("%_Printing" | 766 ("%_Printing" |
767 ["Set Printer %_Name for Generic Print Support..." | |
768 (customize-set-variable | |
769 'printer-name | |
770 (read-string "Set printer name: " printer-name))] | |
771 "---" | |
703 ["Command-Line %_Switches for `lpr'/`lp'..." | 772 ["Command-Line %_Switches for `lpr'/`lp'..." |
704 ;; better to directly open a customization buffer, since the value | 773 ;; better to directly open a customization buffer, since the value |
705 ;; must be a list of strings, which is somewhat complex to prompt for. | 774 ;; must be a list of strings, which is somewhat complex to prompt for. |
706 (customize-variable 'lpr-switches) | 775 (customize-variable 'lpr-switches) |
707 (boundp 'lpr-switches)] | 776 (boundp 'lpr-switches)] |
806 (read-string "Set email address: " user-mail-address))] | 875 (read-string "Set email address: " user-mail-address))] |
807 ["Set %_Machine Email Name..." | 876 ["Set %_Machine Email Name..." |
808 (customize-set-variable | 877 (customize-set-variable |
809 'mail-host-address | 878 'mail-host-address |
810 (read-string "Set machine email name: " mail-host-address))] | 879 (read-string "Set machine email name: " mail-host-address))] |
880 ["Set %_SMTP Server..." | |
881 (progn | |
882 (require 'smtpmail) | |
883 (customize-set-variable | |
884 'smtpmail-smtp-server | |
885 (read-string "Set SMTP server: " smtpmail-smtp-server))) | |
886 :active (and (boundp 'send-mail-function) | |
887 (eq send-mail-function 'smtpmail-send-it))] | |
888 ["SMTP %_Debug Info" | |
889 (progn | |
890 (require 'smtpmail) | |
891 (customize-set-variable 'smtpmail-debug-info | |
892 (not smtpmail-debug-info))) | |
893 :style toggle | |
894 :selected (and (boundp 'smtpmail-debug-info) smtpmail-debug-info) | |
895 :active (and (boundp 'send-mail-function) | |
896 (eq send-mail-function 'smtpmail-send-it))] | |
811 "---" | 897 "---" |
812 ("%_Open URLs With" | 898 ("%_Open URLs With" |
813 ["%_Emacs-W3" | 899 ["%_Emacs-W3" |
814 (customize-set-variable 'browse-url-browser-function 'browse-url-w3) | 900 (customize-set-variable 'browse-url-browser-function 'browse-url-w3) |
815 :style radio | 901 :style radio |
1305 | 1391 |
1306 nil ; the partition: menus after this are flushright | 1392 nil ; the partition: menus after this are flushright |
1307 | 1393 |
1308 ("%_Help" | 1394 ("%_Help" |
1309 ["%_About XEmacs..." about-xemacs] | 1395 ["%_About XEmacs..." about-xemacs] |
1310 ("%_Basics" | |
1311 ["%_Installation" describe-installation | |
1312 :active (boundp 'Installation-string)] | |
1313 ;; Tutorials. | |
1314 ,(if (featurep 'mule) | |
1315 ;; Mule tutorials. | |
1316 (let ((lang language-info-alist) (n 0) | |
1317 submenu tut) | |
1318 (while lang | |
1319 (setq n (1+ n)) | |
1320 (and (setq tut (assq 'tutorial (car lang))) | |
1321 (not (string= (caar lang) "ASCII")) | |
1322 (setq | |
1323 submenu | |
1324 (cons | |
1325 `[,(concat (menu-item-generate-accelerator-spec n) | |
1326 (caar lang)) | |
1327 (help-with-tutorial nil ,(cdr tut))] | |
1328 submenu))) | |
1329 (setq lang (cdr lang))) | |
1330 (append `("%_Tutorials" | |
1331 :filter tutorials-menu-filter | |
1332 ["%_Default" help-with-tutorial t | |
1333 ,(concat "(" current-language-environment ")")]) | |
1334 submenu)) | |
1335 ;; Non mule tutorials. | |
1336 (let ((lang tutorial-supported-languages) | |
1337 (n 0) | |
1338 submenu) | |
1339 (while lang | |
1340 (setq n (1+ n)) | |
1341 (setq submenu | |
1342 (cons | |
1343 `[,(concat (menu-item-generate-accelerator-spec n) | |
1344 (caar lang)) | |
1345 (help-with-tutorial ,(format "TUTORIAL.%s" | |
1346 (cadr (car lang))))] | |
1347 submenu)) | |
1348 (setq lang (cdr lang))) | |
1349 (append '("%_Tutorials" | |
1350 ["%_English" help-with-tutorial]) | |
1351 submenu))) | |
1352 ["%_News" view-emacs-news] | |
1353 ["%_Packages" finder-by-keyword] | |
1354 ["%_Splash" xemacs-splash-buffer]) | |
1355 "-----" | 1396 "-----" |
1397 ["XEmacs %_News" view-emacs-news] | |
1398 ["%_Obtaining XEmacs" describe-distribution] | |
1399 "-----" | |
1400 ("%_Info (Online Docs)" | |
1401 ["%_Info Contents" info] | |
1402 ["Lookup %_Key Binding..." Info-goto-emacs-key-command-node] | |
1403 ["Lookup %_Command..." Info-goto-emacs-command-node] | |
1404 ["Lookup %_Function..." Info-elisp-ref] | |
1405 ["Lookup %_Topic..." Info-query]) | |
1356 ("XEmacs %_FAQ" | 1406 ("XEmacs %_FAQ" |
1357 ["%_FAQ (local)" xemacs-local-faq] | 1407 ["%_FAQ (local)" xemacs-local-faq] |
1358 ["FAQ via %_WWW" xemacs-www-faq (boundp 'browse-url-browser-function)] | 1408 ["FAQ via %_WWW" xemacs-www-faq |
1359 ["%_Home Page" xemacs-www-page (boundp 'browse-url-browser-function)]) | 1409 :active (boundp 'browse-url-browser-function)] |
1410 ["%_Home Page" xemacs-www-page | |
1411 :active (boundp 'browse-url-browser-function)]) | |
1412 ("%_Tutorials" | |
1413 :filter tutorials-menu-filter) | |
1360 ("%_Samples" | 1414 ("%_Samples" |
1361 ["Sample .%_emacs" (find-file (locate-data-file "sample.emacs")) (locate-data-file "sample.emacs")] | 1415 ["Sample .%_emacs" |
1362 ["Sample .%_Xdefaults" (find-file (locate-data-file "sample.Xdefaults")) (locate-data-file "sample.Xdefaults")] | 1416 (find-file (locate-data-file "sample.emacs")) |
1363 ["Sample e%_nriched" (find-file (locate-data-file "enriched.doc")) (locate-data-file "enriched.doc")]) | 1417 :active (locate-data-file "sample.emacs")] |
1364 "-----" | 1418 ["Sample .%_Xdefaults" |
1365 ("Lookup in %_Info" | 1419 (find-file (locate-data-file "sample.Xdefaults")) |
1366 ["%_Key Binding..." Info-goto-emacs-key-command-node] | 1420 :active (locate-data-file "sample.Xdefaults")] |
1367 ["%_Command..." Info-goto-emacs-command-node] | 1421 ["Sample e%_nriched" |
1368 ["%_Function..." Info-elisp-ref] | 1422 (find-file (locate-data-file "enriched.doc")) |
1369 ["%_Topic..." Info-query]) | 1423 :active (locate-data-file "enriched.doc")]) |
1370 ("%_Manuals" | |
1371 ["%_Info" info] | |
1372 ["%_Unix Manual..." manual-entry]) | |
1373 ("%_Commands & Keys" | 1424 ("%_Commands & Keys" |
1374 ["%_Mode" describe-mode] | 1425 ["%_Mode" describe-mode] |
1375 ["%_Apropos..." hyper-apropos] | 1426 ["%_Apropos..." hyper-apropos] |
1376 ["Apropos %_Docs..." apropos-documentation] | 1427 ["Apropos %_Docs..." apropos-documentation] |
1377 "-----" | 1428 "-----" |
1384 ["%_Variable..." describe-variable] | 1435 ["%_Variable..." describe-variable] |
1385 ["%_Locate Command..." where-is]) | 1436 ["%_Locate Command..." where-is]) |
1386 "-----" | 1437 "-----" |
1387 ["%_Recent Messages" view-lossage] | 1438 ["%_Recent Messages" view-lossage] |
1388 ("%_Misc" | 1439 ("%_Misc" |
1440 ["%_Current Installation Info" describe-installation | |
1441 :active (boundp 'Installation-string)] | |
1389 ["%_No Warranty" describe-no-warranty] | 1442 ["%_No Warranty" describe-no-warranty] |
1390 ["XEmacs %_License" describe-copying] | 1443 ["XEmacs %_License" describe-copying] |
1391 ["The Latest %_Version" describe-distribution]) | 1444 ["Find %_Packages" finder-by-keyword] |
1392 ["%_Send Bug Report..." report-emacs-bug | 1445 ["View %_Splash Screen" xemacs-splash-buffer] |
1446 ["%_Unix Manual..." manual-entry]) | |
1447 ["Send %_Bug Report..." report-emacs-bug | |
1393 :active (fboundp 'report-emacs-bug)])))) | 1448 :active (fboundp 'report-emacs-bug)])))) |
1394 | 1449 |
1395 | 1450 |
1396 (defun maybe-add-init-button () | 1451 (defun maybe-add-init-button () |
1397 "Don't call this. | 1452 "Don't call this. |
1788 | 1843 |
1789 | 1844 |
1790 | 1845 |
1791 ;;; The Help menu | 1846 ;;; The Help menu |
1792 | 1847 |
1793 (if (featurep 'mule) | 1848 (defun tutorials-menu-filter (menu-items) |
1794 (defun tutorials-menu-filter (menu-items) | 1849 (append |
1795 ;; If there's a tutorial for the current language environment, make it | 1850 (if (featurep 'mule) |
1796 ;; appear first as the default one. Otherwise, use the english one. | 1851 (if (assq 'tutorial |
1797 (let* ((menu menu-items) | 1852 (assoc current-language-environment language-info-alist)) |
1798 (item (pop menu-items))) | 1853 `([,(concat "%_Default (" current-language-environment ")") |
1799 (aset | 1854 help-with-tutorial])) |
1800 item 3 | 1855 '(["%_English" help-with-tutorial])) |
1801 (concat "(" | 1856 (submenu-generate-accelerator-spec |
1802 (if (assoc | 1857 (if (featurep 'mule) |
1803 'tutorial | 1858 ;; Mule tutorials. |
1804 (assoc current-language-environment language-info-alist)) | 1859 (mapcan #'(lambda (lang) |
1805 current-language-environment | 1860 (let ((tut (assq 'tutorial lang))) |
1806 "English") | 1861 (and tut |
1807 ")")) | 1862 (not (string= (car lang) "ASCII")) |
1808 menu))) | 1863 ;; skip current language, since we already |
1864 ;; included it first | |
1865 (not (string= (car lang) | |
1866 current-language-environment)) | |
1867 `([,(car lang) | |
1868 (help-with-tutorial nil ,(cdr tut))])))) | |
1869 language-info-alist)) | |
1870 ;; Non mule tutorials. | |
1871 (mapcar #'(lambda (lang) | |
1872 `[,(car lang) | |
1873 (help-with-tutorial ,(format "TUTORIAL.%s" | |
1874 (cadr lang)))]) | |
1875 tutorial-supported-languages)))) | |
1809 | 1876 |
1810 | 1877 |
1811 (set-menubar default-menubar) | 1878 (set-menubar default-menubar) |
1812 | 1879 |
1813 | 1880 |
1905 (if (null bmenu) | 1972 (if (null bmenu) |
1906 (error "Can't find the Buffers menu")) | 1973 (error "Can't find the Buffers menu")) |
1907 (popup-menu bmenu))) | 1974 (popup-menu bmenu))) |
1908 | 1975 |
1909 (defun popup-menubar-menu (event) | 1976 (defun popup-menubar-menu (event) |
1910 "Pop up a copy of menu that also appears in the menubar" | 1977 "Pop up a copy of menu that also appears in the menubar." |
1911 ;; by Stig@hackvan.com | |
1912 (interactive "e") | 1978 (interactive "e") |
1913 (let ((window (and (event-over-text-area-p event) (event-window event))) | 1979 (let ((window (and (event-over-text-area-p event) (event-window event))) |
1914 popup-menubar) | 1980 popup-menubar) |
1915 (or window | 1981 (or window |
1916 (error "Pointer must be in a normal window")) | 1982 (error "Pointer must be in a normal window")) |