comparison lisp/x-menubar.el @ 237:89ec2bb86eea r20-5b17

Import from CVS: tag r20-5b17
author cvs
date Mon, 13 Aug 2007 10:15:03 +0200
parents 52952cbfc5b5
children 41f2f0e326e9
comparison
equal deleted inserted replaced
236:78d3ccccee6d 237:89ec2bb86eea
33 33
34 ;;; Code: 34 ;;; Code:
35 35
36 ;;; Warning-free compile 36 ;;; Warning-free compile
37 (eval-when-compile 37 (eval-when-compile
38 (defvar language-environment-list)) 38 (defvar language-environment-list)
39 (defvar bookmark-alist)
40 (defvar language-info-alist)
41 (defvar current-language-environment)
42 (defvar tutorial-supported-languages))
39 43
40 (defconst default-menubar 44 (defconst default-menubar
41 (purecopy-menubar 45 (purecopy-menubar
42 ;; note backquote. 46 ;; note backquote.
43 `( 47 `(
733 nil ; the partition: menus after this are flushright 737 nil ; the partition: menus after this are flushright
734 738
735 ("Help" 739 ("Help"
736 ["About XEmacs..." about-xemacs t] 740 ["About XEmacs..." about-xemacs t]
737 ("Basics" 741 ("Basics"
738 ["Tutorial" help-with-tutorial t] 742 ;; Tutorials.
743 ,(if (featurep 'mule)
744 ;; Mule tutorials.
745 (let ((lang language-info-alist)
746 submenu tut)
747 (while lang
748 (and (setq tut (assq 'tutorial (car lang)))
749 (not (string= (caar lang) "ASCII"))
750 (setq
751 submenu
752 (cons
753 `[,(caar lang) (help-with-tutorial nil ,(cdr tut)) t]
754 submenu)))
755 (setq lang (cdr lang)))
756 (append `("Tutorials"
757 :filter tutorials-menu-filter
758 ["Default" help-with-tutorial t
759 ,(concat "(" current-language-environment ")")])
760 submenu))
761 ;; Non mule tutorials.
762 (let ((lang tutorial-supported-languages)
763 submenu)
764 (while lang
765 (setq submenu
766 (cons
767 `[,(caar lang)
768 (help-with-tutorial ,(format "TUTORIAL.%s"
769 (cadr (car lang)))) t]
770 submenu))
771 (setq lang (cdr lang)))
772 (append '("Tutorials"
773 ["English" help-with-tutorial t])
774 submenu)))
739 ["News" view-emacs-news t] 775 ["News" view-emacs-news t]
740 ["Packages" finder-by-keyword t] 776 ["Packages" finder-by-keyword t]
741 ["Splash" xemacs-splash-buffer t]) 777 ["Splash" xemacs-splash-buffer t])
742 "-----" 778 "-----"
743 ("XEmacs FAQ" 779 ("XEmacs FAQ"
987 The grouping function is specified in `buffers-menu-grouping-function'. 1023 The grouping function is specified in `buffers-menu-grouping-function'.
988 If this is an integer, do not build submenus if the number of buffers 1024 If this is an integer, do not build submenus if the number of buffers
989 is not larger than this value." 1025 is not larger than this value."
990 :type '(choice (const :tag "No Subgroups" nil) 1026 :type '(choice (const :tag "No Subgroups" nil)
991 (integer :tag "Max. submenus" 10) 1027 (integer :tag "Max. submenus" 10)
992 (const :tag "Allow Subgroups" t)) 1028 (sexp :format "%t\n" :tag "Allow Subgroups" :value t))
993 :group 'buffers-menu) 1029 :group 'buffers-menu)
994 1030
995 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer 1031 (defcustom buffers-menu-switch-to-buffer-function 'switch-to-buffer
996 "*The function to call to select a buffer from the buffers menu. 1032 "*The function to call to select a buffer from the buffers menu.
997 `switch-to-buffer' is a good choice, as is `pop-to-buffer'." 1033 `switch-to-buffer' is a good choice, as is `pop-to-buffer'."
1551 (set-buffer init-output-buffer) 1587 (set-buffer init-output-buffer)
1552 (save-buffer)) 1588 (save-buffer))
1553 )) 1589 ))
1554 1590
1555 1591
1592 ;;; The Help menu
1593
1594 (if (featurep 'mule)
1595 (defun tutorials-menu-filter (menu-items)
1596 ;; If there's a tutorial for the current language environment, make it
1597 ;; appear first as the default one. Otherwise, use the english one.
1598 (let* ((menu menu-items)
1599 (item (pop menu-items)))
1600 (aset
1601 item 3
1602 (concat "("
1603 (if (assoc
1604 'tutorial
1605 (assoc current-language-environment language-info-alist))
1606 current-language-environment
1607 "English")
1608 ")"))
1609 menu)))
1610
1611
1556 (set-menubar default-menubar) 1612 (set-menubar default-menubar)
1557 1613
1558 1614
1559 ;;; Popup menus. 1615 ;;; Popup menus.
1560 1616