diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/elisp.texi | 9 | ||||
| -rw-r--r-- | doc/lispref/keymaps.texi | 168 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/emacs-lisp/easymenu.el | 147 |
5 files changed, 213 insertions, 120 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 26765e7a384..9142ef49b12 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * keymaps.texi (Toolkit Differences): Node deleted. | ||
| 4 | (Easy Menu): New node. | ||
| 5 | |||
| 1 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-10-23 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. | 8 | * hooks.texi (Standard Hooks): Clarify that -hooks is deprecated. |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index d46cb071bf7..1d1dab8faac 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -800,17 +800,14 @@ Menu Keymaps | |||
| 800 | * Menu Bar:: How to customize the menu bar. | 800 | * Menu Bar:: How to customize the menu bar. |
| 801 | * Tool Bar:: A tool bar is a row of images. | 801 | * Tool Bar:: A tool bar is a row of images. |
| 802 | * Modifying Menus:: How to add new items to a menu. | 802 | * Modifying Menus:: How to add new items to a menu. |
| 803 | * Easy Menu:: A convenience macro for defining menus. | ||
| 803 | 804 | ||
| 804 | Defining Menus | 805 | Defining Menus |
| 805 | 806 | ||
| 806 | * Simple Menu Items:: A simple kind of menu key binding, | 807 | * Simple Menu Items:: A simple kind of menu key binding. |
| 807 | limited in capabilities. | 808 | * Extended Menu Items:: More complex menu item definitions. |
| 808 | * Extended Menu Items:: More powerful menu item definitions | ||
| 809 | let you specify keywords to enable | ||
| 810 | various features. | ||
| 811 | * Menu Separators:: Drawing a horizontal line through a menu. | 809 | * Menu Separators:: Drawing a horizontal line through a menu. |
| 812 | * Alias Menu Items:: Using command aliases in menu items. | 810 | * Alias Menu Items:: Using command aliases in menu items. |
| 813 | * Toolkit Differences:: Not all toolkits provide the same features. | ||
| 814 | 811 | ||
| 815 | Major and Minor Modes | 812 | Major and Minor Modes |
| 816 | 813 | ||
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 9fa6193a804..8fe729d50f2 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -1963,13 +1963,14 @@ is active for the next input event, that activates the keyboard menu | |||
| 1963 | feature. | 1963 | feature. |
| 1964 | 1964 | ||
| 1965 | @menu | 1965 | @menu |
| 1966 | * Defining Menus:: How to make a keymap that defines a menu. | 1966 | * Defining Menus:: How to make a keymap that defines a menu. |
| 1967 | * Mouse Menus:: How users actuate the menu with the mouse. | 1967 | * Mouse Menus:: How users actuate the menu with the mouse. |
| 1968 | * Keyboard Menus:: How users actuate the menu with the keyboard. | 1968 | * Keyboard Menus:: How users actuate the menu with the keyboard. |
| 1969 | * Menu Example:: Making a simple menu. | 1969 | * Menu Example:: Making a simple menu. |
| 1970 | * Menu Bar:: How to customize the menu bar. | 1970 | * Menu Bar:: How to customize the menu bar. |
| 1971 | * Tool Bar:: A tool bar is a row of images. | 1971 | * Tool Bar:: A tool bar is a row of images. |
| 1972 | * Modifying Menus:: How to add new items to a menu. | 1972 | * Modifying Menus:: How to add new items to a menu. |
| 1973 | * Easy Menu:: A convenience macro for making menus. | ||
| 1973 | @end menu | 1974 | @end menu |
| 1974 | 1975 | ||
| 1975 | @node Defining Menus | 1976 | @node Defining Menus |
| @@ -2015,17 +2016,12 @@ an existing menu, you can specify its position in the menu using | |||
| 2015 | @code{define-key-after} (@pxref{Modifying Menus}). | 2016 | @code{define-key-after} (@pxref{Modifying Menus}). |
| 2016 | 2017 | ||
| 2017 | @menu | 2018 | @menu |
| 2018 | * Simple Menu Items:: A simple kind of menu key binding, | 2019 | * Simple Menu Items:: A simple kind of menu key binding. |
| 2019 | limited in capabilities. | 2020 | * Extended Menu Items:: More complex menu item definitions. |
| 2020 | * Extended Menu Items:: More powerful menu item definitions | ||
| 2021 | let you specify keywords to enable | ||
| 2022 | various features. | ||
| 2023 | * Menu Separators:: Drawing a horizontal line through a menu. | 2021 | * Menu Separators:: Drawing a horizontal line through a menu. |
| 2024 | * Alias Menu Items:: Using command aliases in menu items. | 2022 | * Alias Menu Items:: Using command aliases in menu items. |
| 2025 | * Toolkit Differences:: Not all toolkits provide the same features. | ||
| 2026 | @end menu | 2023 | @end menu |
| 2027 | 2024 | ||
| 2028 | |||
| 2029 | @node Simple Menu Items | 2025 | @node Simple Menu Items |
| 2030 | @subsubsection Simple Menu Items | 2026 | @subsubsection Simple Menu Items |
| 2031 | 2027 | ||
| @@ -2312,28 +2308,6 @@ itself). To request this, give the alias symbol a non-@code{nil} | |||
| 2312 | causes menu items for @code{make-read-only} and @code{make-writable} to | 2308 | causes menu items for @code{make-read-only} and @code{make-writable} to |
| 2313 | show the keyboard bindings for @code{read-only-mode}. | 2309 | show the keyboard bindings for @code{read-only-mode}. |
| 2314 | 2310 | ||
| 2315 | @node Toolkit Differences | ||
| 2316 | @subsubsection Toolkit Differences | ||
| 2317 | |||
| 2318 | The various toolkits with which you can build Emacs do not all support | ||
| 2319 | the same set of features for menus. Some code works as expected with | ||
| 2320 | one toolkit, but not under another. | ||
| 2321 | |||
| 2322 | One example is menu actions or buttons in a top-level menu bar. The | ||
| 2323 | following works with the Lucid toolkit or on MS Windows, but not with | ||
| 2324 | GTK or Nextstep, where clicking on the item has no effect. | ||
| 2325 | |||
| 2326 | @example | ||
| 2327 | (defun menu-action-greet () | ||
| 2328 | (interactive) | ||
| 2329 | (message "Hello Emacs User!")) | ||
| 2330 | |||
| 2331 | (defun top-level-menu () | ||
| 2332 | (interactive) | ||
| 2333 | (define-key lisp-interaction-mode-map [menu-bar m] | ||
| 2334 | '(menu-item "Action Button" menu-action-greet))) | ||
| 2335 | @end example | ||
| 2336 | |||
| 2337 | @node Mouse Menus | 2311 | @node Mouse Menus |
| 2338 | @subsection Menus and the Mouse | 2312 | @subsection Menus and the Mouse |
| 2339 | 2313 | ||
| @@ -2813,3 +2787,125 @@ menu of Shell mode, after the item @code{break}: | |||
| 2813 | [work] '("Work" . work-command) 'break) | 2787 | [work] '("Work" . work-command) 'break) |
| 2814 | @end example | 2788 | @end example |
| 2815 | @end defun | 2789 | @end defun |
| 2790 | |||
| 2791 | @node Easy Menu | ||
| 2792 | @subsection Easy Menu | ||
| 2793 | |||
| 2794 | The following macro provides a convenient way to define pop-up menus | ||
| 2795 | and/or menu bar menus. | ||
| 2796 | |||
| 2797 | @defmac easy-menu-define symbol maps doc menu | ||
| 2798 | This macro defines a pop-up menu and/or menu bar submenu, whose | ||
| 2799 | contents are given by @var{menu}. | ||
| 2800 | |||
| 2801 | If @var{symbol} is non-@code{nil}, it should be a symbol; then this | ||
| 2802 | macro defines @var{symbol} as a function for popping up the menu | ||
| 2803 | (@pxref{Pop-Up Menus}), with @var{doc} as its documentation string. | ||
| 2804 | @var{symbol} should not be quoted. | ||
| 2805 | |||
| 2806 | Regardless of the value of @var{symbol}, if @var{maps} is a keymap, | ||
| 2807 | the menu is added to that keymap, as a top-level menu for the menu bar | ||
| 2808 | (@pxref{Menu Bar}). It can also be a list of keymaps, in which case | ||
| 2809 | the menu is added separately to each of those keymaps. | ||
| 2810 | |||
| 2811 | The first element of @var{menu} must be a string, which serves as the | ||
| 2812 | menu label. It may be followed by any number of the following | ||
| 2813 | keyword-argument pairs: | ||
| 2814 | |||
| 2815 | @table @code | ||
| 2816 | @item :filter @var{function} | ||
| 2817 | @var{function} must be a function which, if called with one | ||
| 2818 | argument---the list of the other menu items---returns the actual items | ||
| 2819 | to be displayed in the menu. | ||
| 2820 | |||
| 2821 | @item :visible @var{include} | ||
| 2822 | @var{include} is an expression; if it evaluates to @code{nil}, the | ||
| 2823 | menu is made invisible. @code{:included} is an alias for | ||
| 2824 | @code{:visible}. | ||
| 2825 | |||
| 2826 | @item :active @var{enable} | ||
| 2827 | @var{enable} is an expression; if it evaluates to @code{nil}, the menu | ||
| 2828 | is not selectable. @code{:enable} is an alias for @code{:active}. | ||
| 2829 | @end table | ||
| 2830 | |||
| 2831 | The remaining elements in @var{menu} are menu items. | ||
| 2832 | |||
| 2833 | A menu item can be a vector of three elements, @code{[@var{name} | ||
| 2834 | @var{callback} @var{enable}]}. @var{name} is the menu item name (a | ||
| 2835 | string). @var{callback} is a command to run, or an expression to | ||
| 2836 | evaluate, when the item is chosen. @var{enable} is an expression; if | ||
| 2837 | it evaluates to @code{nil}, the item is disabled for selection. | ||
| 2838 | |||
| 2839 | Alternatively, a menu item may have the form: | ||
| 2840 | |||
| 2841 | @smallexample | ||
| 2842 | [ @var{name} @var{callback} [ @var{keyword} @var{arg} ]... ] | ||
| 2843 | @end smallexample | ||
| 2844 | |||
| 2845 | @noindent | ||
| 2846 | where @var{name} and @var{callback} have the same meanings as above, | ||
| 2847 | and each optional @var{keyword} and @var{arg} pair should be one of | ||
| 2848 | the following: | ||
| 2849 | |||
| 2850 | @table @code | ||
| 2851 | @item :keys @var{keys} | ||
| 2852 | @var{keys} is a keyboard equivalent to the menu item (a string). This | ||
| 2853 | is normally not needed, as keyboard equivalents are computed | ||
| 2854 | automatically. @var{keys} is expanded with | ||
| 2855 | @code{substitute-command-keys} before it is displayed (@pxref{Keys in | ||
| 2856 | Documentation}). | ||
| 2857 | |||
| 2858 | @item :key-sequence @var{keys} | ||
| 2859 | @var{keys} is a hint for speeding up Emacs's first display of the | ||
| 2860 | menu. It should be nil if you know that the menu item has no keyboard | ||
| 2861 | equivalent; otherwise it should be a string or vector specifying a | ||
| 2862 | keyboard equivalent for the menu item. | ||
| 2863 | |||
| 2864 | @item :active @var{enable} | ||
| 2865 | @var{enable} is an expression; if it evaluates to @code{nil}, the item | ||
| 2866 | is make unselectable.. @code{:enable} is an alias for @code{:active}. | ||
| 2867 | |||
| 2868 | @item :visible @var{include} | ||
| 2869 | @var{include} is an expression; if it evaluates to @code{nil}, the | ||
| 2870 | item is made invisible. @code{:included} is an alias for | ||
| 2871 | @code{:visible}. | ||
| 2872 | |||
| 2873 | @item :label @var{form} | ||
| 2874 | @var{form} is an expression that is evaluated to obtain a value which | ||
| 2875 | serves as the menu item's label (the default is @var{name}). | ||
| 2876 | |||
| 2877 | @item :suffix @var{form} | ||
| 2878 | @var{form} is an expression that is dynamically evaluated and whose | ||
| 2879 | value is concatenated with the menu entry's label. | ||
| 2880 | |||
| 2881 | @item :style @var{style} | ||
| 2882 | @var{style} is a symbol describing the type of menu item; it should be | ||
| 2883 | @code{toggle} (a checkbox), or @code{radio} (a radio button), or | ||
| 2884 | anything else (meaning an ordinary menu item). | ||
| 2885 | |||
| 2886 | @item :selected @var{selected} | ||
| 2887 | @var{selected} is an expression; the checkbox or radio button is | ||
| 2888 | selected whenever the expression's value is non-nil. | ||
| 2889 | |||
| 2890 | @item :help @var{help} | ||
| 2891 | @var{help} is a string describing the menu item. | ||
| 2892 | @end table | ||
| 2893 | |||
| 2894 | Alternatively, a menu item can be a string. Then that string appears | ||
| 2895 | in the menu as unselectable text. A string consisting of dashes is | ||
| 2896 | displayed as a separator (@pxref{Menu Separators}). | ||
| 2897 | |||
| 2898 | Alternatively, a menu item can be a list with the same format as | ||
| 2899 | @var{menu}. This is a submenu. | ||
| 2900 | @end defmac | ||
| 2901 | |||
| 2902 | Here is an example of using @code{easy-menu-define} to define a menu | ||
| 2903 | similar to the one defined in the example in @ref{Menu Bar}: | ||
| 2904 | |||
| 2905 | @example | ||
| 2906 | (easy-menu-define words-menu global-map | ||
| 2907 | "Menu for word navigation commands." | ||
| 2908 | '("Words" | ||
| 2909 | ["Forward word" forward-word] | ||
| 2910 | ["Backward word" backward-word])) | ||
| 2911 | @end example | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c84d0110fc7..5b709c76c74 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-24 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * emacs-lisp/easymenu.el (easy-menu-define): Doc fix (Bug#12628). | ||
| 4 | |||
| 1 | 2012-10-24 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-10-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * minibuffer.el (completion--all-sorted-completions-location): New var. | 7 | * minibuffer.el (completion--all-sorted-completions-location): New var. |
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 939fab78942..26a1fce2309 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -44,110 +44,101 @@ menus, turn this variable off, otherwise it is probably better to keep it on.") | |||
| 44 | 44 | ||
| 45 | ;;;###autoload | 45 | ;;;###autoload |
| 46 | (defmacro easy-menu-define (symbol maps doc menu) | 46 | (defmacro easy-menu-define (symbol maps doc menu) |
| 47 | "Define a menu bar submenu in maps MAPS, according to MENU. | 47 | "Define a pop-up menu and/or menu bar menu specified by MENU. |
| 48 | If SYMBOL is non-nil, define SYMBOL as a function to pop up the | ||
| 49 | submenu defined by MENU, with DOC as its doc string. | ||
| 48 | 50 | ||
| 49 | If SYMBOL is non-nil, store the menu keymap in the value of SYMBOL, | 51 | MAPS, if non-nil, should be a keymap or a list of keymaps; add |
| 50 | and define SYMBOL as a function to pop up the menu, with DOC as its doc string. | 52 | the submenu defined by MENU to the keymap or each of the keymaps, |
| 51 | If SYMBOL is nil, just store the menu keymap into MAPS. | 53 | as a top-level menu bar item. |
| 52 | 54 | ||
| 53 | The first element of MENU must be a string. It is the menu bar item name. | 55 | The first element of MENU must be a string. It is the menu bar |
| 54 | It may be followed by the following keyword argument pairs | 56 | item name. It may be followed by the following keyword argument |
| 57 | pairs: | ||
| 55 | 58 | ||
| 56 | :filter FUNCTION | 59 | :filter FUNCTION |
| 60 | FUNCTION must be a function which, if called with one | ||
| 61 | argument---the list of the other menu items---returns the | ||
| 62 | items to actually display. | ||
| 57 | 63 | ||
| 58 | FUNCTION is a function with one argument, the rest of menu items. | 64 | :visible INCLUDE |
| 59 | It returns the remaining items of the displayed menu. | 65 | INCLUDE is an expression. The menu is visible if the |
| 66 | expression evaluates to a non-nil value. `:included' is an | ||
| 67 | alias for `:visible'. | ||
| 60 | 68 | ||
| 61 | :visible INCLUDE | 69 | :active ENABLE |
| 70 | ENABLE is an expression. The menu is enabled for selection | ||
| 71 | if the expression evaluates to a non-nil value. `:enable' is | ||
| 72 | an alias for `:active'. | ||
| 62 | 73 | ||
| 63 | INCLUDE is an expression; this menu is only visible if this | 74 | The rest of the elements in MENU are menu items. |
| 64 | expression has a non-nil value. `:included' is an alias for `:visible'. | 75 | A menu item can be a vector of three elements: |
| 65 | 76 | ||
| 66 | :active ENABLE | 77 | [NAME CALLBACK ENABLE] |
| 67 | |||
| 68 | ENABLE is an expression; the menu is enabled for selection whenever | ||
| 69 | this expression's value is non-nil. `:enable' is an alias for `:active'. | ||
| 70 | |||
| 71 | The rest of the elements in MENU, are menu items. | ||
| 72 | |||
| 73 | A menu item is usually a vector of three elements: [NAME CALLBACK ENABLE] | ||
| 74 | 78 | ||
| 75 | NAME is a string--the menu item name. | 79 | NAME is a string--the menu item name. |
| 76 | 80 | ||
| 77 | CALLBACK is a command to run when the item is chosen, | 81 | CALLBACK is a command to run when the item is chosen, or an |
| 78 | or a list to evaluate when the item is chosen. | 82 | expression to evaluate when the item is chosen. |
| 79 | 83 | ||
| 80 | ENABLE is an expression; the item is enabled for selection | 84 | ENABLE is an expression; the item is enabled for selection if the |
| 81 | whenever this expression's value is non-nil. | 85 | expression evaluates to a non-nil value. |
| 82 | 86 | ||
| 83 | Alternatively, a menu item may have the form: | 87 | Alternatively, a menu item may have the form: |
| 84 | 88 | ||
| 85 | [ NAME CALLBACK [ KEYWORD ARG ] ... ] | 89 | [ NAME CALLBACK [ KEYWORD ARG ]... ] |
| 86 | |||
| 87 | Where KEYWORD is one of the symbols defined below. | ||
| 88 | |||
| 89 | :keys KEYS | ||
| 90 | |||
| 91 | KEYS is a string; a complex keyboard equivalent to this menu item. | ||
| 92 | This is normally not needed because keyboard equivalents are usually | ||
| 93 | computed automatically. | ||
| 94 | KEYS is expanded with `substitute-command-keys' before it is used. | ||
| 95 | |||
| 96 | :key-sequence KEYS | ||
| 97 | |||
| 98 | KEYS is nil, a string or a vector; nil or a keyboard equivalent to this | ||
| 99 | menu item. | ||
| 100 | This is a hint that will considerably speed up Emacs's first display of | ||
| 101 | a menu. Use `:key-sequence nil' when you know that this menu item has no | ||
| 102 | keyboard equivalent. | ||
| 103 | |||
| 104 | :active ENABLE | ||
| 105 | |||
| 106 | ENABLE is an expression; the item is enabled for selection whenever | ||
| 107 | this expression's value is non-nil. `:enable' is an alias for `:active'. | ||
| 108 | |||
| 109 | :visible INCLUDE | ||
| 110 | |||
| 111 | INCLUDE is an expression; this item is only visible if this | ||
| 112 | expression has a non-nil value. `:included' is an alias for `:visible'. | ||
| 113 | |||
| 114 | :label FORM | ||
| 115 | 90 | ||
| 116 | FORM is an expression that will be dynamically evaluated and whose | 91 | where NAME and CALLBACK have the same meanings as above, and each |
| 117 | value will be used for the menu entry's text label (the default is NAME). | 92 | optional KEYWORD and ARG pair should be one of the following: |
| 118 | 93 | ||
| 119 | :suffix FORM | 94 | :keys KEYS |
| 95 | KEYS is a string; a keyboard equivalent to the menu item. | ||
| 96 | This is normally not needed because keyboard equivalents are | ||
| 97 | usually computed automatically. KEYS is expanded with | ||
| 98 | `substitute-command-keys' before it is used. | ||
| 120 | 99 | ||
| 121 | FORM is an expression that will be dynamically evaluated and whose | 100 | :key-sequence KEYS |
| 122 | value will be concatenated to the menu entry's label. | 101 | KEYS is a hint for speeding up Emacs's first display of the |
| 102 | menu. It should be nil if you know that the menu item has no | ||
| 103 | keyboard equivalent; otherwise it should be a string or | ||
| 104 | vector specifying a keyboard equivalent for the menu item. | ||
| 123 | 105 | ||
| 124 | :style STYLE | 106 | :active ENABLE |
| 107 | ENABLE is an expression; the item is enabled for selection | ||
| 108 | whenever this expression's value is non-nil. `:enable' is an | ||
| 109 | alias for `:active'. | ||
| 125 | 110 | ||
| 126 | STYLE is a symbol describing the type of menu item. The following are | 111 | :visible INCLUDE |
| 127 | defined: | 112 | INCLUDE is an expression; this item is only visible if this |
| 113 | expression has a non-nil value. `:included' is an alias for | ||
| 114 | `:visible'. | ||
| 128 | 115 | ||
| 129 | toggle: A checkbox. | 116 | :label FORM |
| 130 | Prepend the name with `(*) ' or `( ) ' depending on if selected or not. | 117 | FORM is an expression that is dynamically evaluated and whose |
| 131 | radio: A radio button. | 118 | value serves as the menu item's label (the default is NAME). |
| 132 | Prepend the name with `[X] ' or `[ ] ' depending on if selected or not. | ||
| 133 | button: Surround the name with `[' and `]'. Use this for an item in the | ||
| 134 | menu bar itself. | ||
| 135 | anything else means an ordinary menu item. | ||
| 136 | 119 | ||
| 137 | :selected SELECTED | 120 | :suffix FORM |
| 121 | FORM is an expression that is dynamically evaluated and whose | ||
| 122 | value is concatenated with the menu entry's label. | ||
| 138 | 123 | ||
| 139 | SELECTED is an expression; the checkbox or radio button is selected | 124 | :style STYLE |
| 140 | whenever this expression's value is non-nil. | 125 | STYLE is a symbol describing the type of menu item; it should |
| 126 | be `toggle' (a checkbox), or `radio' (a radio button), or any | ||
| 127 | other value (meaning an ordinary menu item). | ||
| 141 | 128 | ||
| 142 | :help HELP | 129 | :selected SELECTED |
| 130 | SELECTED is an expression; the checkbox or radio button is | ||
| 131 | selected whenever the expression's value is non-nil. | ||
| 143 | 132 | ||
| 144 | HELP is a string, the help to display for the menu item. | 133 | :help HELP |
| 134 | HELP is a string, the help to display for the menu item. | ||
| 145 | 135 | ||
| 146 | A menu item can be a string. Then that string appears in the menu as | 136 | Alternatively, a menu item can be a string. Then that string |
| 147 | unselectable text. A string consisting solely of hyphens is displayed | 137 | appears in the menu as unselectable text. A string consisting |
| 148 | as a solid horizontal line. | 138 | solely of dashes is displayed as a menu separator. |
| 149 | 139 | ||
| 150 | A menu item can be a list with the same format as MENU. This is a submenu." | 140 | Alternatively, a menu item can be a list with the same format as |
| 141 | MENU. This is a submenu." | ||
| 151 | (declare (indent defun) (debug (symbolp body))) | 142 | (declare (indent defun) (debug (symbolp body))) |
| 152 | `(progn | 143 | `(progn |
| 153 | ,(if symbol `(defvar ,symbol nil ,doc)) | 144 | ,(if symbol `(defvar ,symbol nil ,doc)) |