diff options
| author | Gerd Moellmann | 2000-04-09 10:59:46 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-04-09 10:59:46 +0000 |
| commit | 25112054fe5d863c409dd9779cb5e7ed3530e9e7 (patch) | |
| tree | 20c21a47526cc094dece975ac92389ecf82ef701 | |
| parent | 9f1a8fb4afe5032aa6f23df520e284cb78d1de99 (diff) | |
| download | emacs-25112054fe5d863c409dd9779cb5e7ed3530e9e7.tar.gz emacs-25112054fe5d863c409dd9779cb5e7ed3530e9e7.zip | |
(easy-menu-create-menu): Process menu
item help string.
(easy-menu-do-add-item): Ditto.
(easy-menu-define): Extend doc string.
| -rw-r--r-- | lisp/emacs-lisp/easymenu.el | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/easymenu.el b/lisp/emacs-lisp/easymenu.el index 09cee0e8ae4..70343580209 100644 --- a/lisp/emacs-lisp/easymenu.el +++ b/lisp/emacs-lisp/easymenu.el | |||
| @@ -130,6 +130,10 @@ anything else means an ordinary menu item. | |||
| 130 | SELECTED is an expression; the checkbox or radio button is selected | 130 | SELECTED is an expression; the checkbox or radio button is selected |
| 131 | whenever this expression's value is non-nil. | 131 | whenever this expression's value is non-nil. |
| 132 | 132 | ||
| 133 | :help HELP | ||
| 134 | |||
| 135 | HELP is a string, the help to display for the menu item. | ||
| 136 | |||
| 133 | A menu item can be a string. Then that string appears in the menu as | 137 | A menu item can be a string. Then that string appears in the menu as |
| 134 | unselectable text. A string consisting solely of hyphens is displayed | 138 | unselectable text. A string consisting solely of hyphens is displayed |
| 135 | as a solid horizontal line. | 139 | as a solid horizontal line. |
| @@ -168,7 +172,7 @@ This function returns the right thing in the two cases." | |||
| 168 | MENU-NAME is a string, the name of the menu. MENU-ITEMS is a list of items | 172 | MENU-NAME is a string, the name of the menu. MENU-ITEMS is a list of items |
| 169 | possibly preceded by keyword pairs as described in `easy-menu-define'." | 173 | possibly preceded by keyword pairs as described in `easy-menu-define'." |
| 170 | (let ((menu (make-sparse-keymap menu-name)) | 174 | (let ((menu (make-sparse-keymap menu-name)) |
| 171 | prop keyword arg label enable filter visible) | 175 | prop keyword arg label enable filter visible help) |
| 172 | ;; Look for keywords. | 176 | ;; Look for keywords. |
| 173 | (while (and menu-items (cdr menu-items) | 177 | (while (and menu-items (cdr menu-items) |
| 174 | (symbolp (setq keyword (car menu-items))) | 178 | (symbolp (setq keyword (car menu-items))) |
| @@ -179,6 +183,7 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." | |||
| 179 | ((eq keyword :filter) (setq filter arg)) | 183 | ((eq keyword :filter) (setq filter arg)) |
| 180 | ((eq keyword :active) (setq enable (or arg ''nil))) | 184 | ((eq keyword :active) (setq enable (or arg ''nil))) |
| 181 | ((eq keyword :label) (setq label arg)) | 185 | ((eq keyword :label) (setq label arg)) |
| 186 | ((eq keyword :help) (setq help arg)) | ||
| 182 | ((or (eq keyword :included) (eq keyword :visible)) | 187 | ((or (eq keyword :included) (eq keyword :visible)) |
| 183 | (setq visible (or arg ''nil))))) | 188 | (setq visible (or arg ''nil))))) |
| 184 | (if (equal visible ''nil) nil ; Invisible menu entry, return nil. | 189 | (if (equal visible ''nil) nil ; Invisible menu entry, return nil. |
| @@ -187,6 +192,7 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." | |||
| 187 | (if (and enable (not (easy-menu-always-true enable))) | 192 | (if (and enable (not (easy-menu-always-true enable))) |
| 188 | (setq prop (cons :enable (cons enable prop)))) | 193 | (setq prop (cons :enable (cons enable prop)))) |
| 189 | (if filter (setq prop (cons :filter (cons filter prop)))) | 194 | (if filter (setq prop (cons :filter (cons filter prop)))) |
| 195 | (if help (setq prop (cons :help (cons help prop)))) | ||
| 190 | (if label (setq prop (cons nil (cons label prop)))) | 196 | (if label (setq prop (cons nil (cons label prop)))) |
| 191 | (while menu-items | 197 | (while menu-items |
| 192 | (easy-menu-do-add-item menu (car menu-items)) | 198 | (easy-menu-do-add-item menu (car menu-items)) |
| @@ -210,7 +216,7 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." | |||
| 210 | ;; Optional argument BEFORE is nil or a key in MENU. If BEFORE is not nil | 216 | ;; Optional argument BEFORE is nil or a key in MENU. If BEFORE is not nil |
| 211 | ;; put item before BEFORE in MENU, otherwise if item is already present in | 217 | ;; put item before BEFORE in MENU, otherwise if item is already present in |
| 212 | ;; MENU, just change it, otherwise put it last in MENU. | 218 | ;; MENU, just change it, otherwise put it last in MENU. |
| 213 | (let (name command label prop remove) | 219 | (let (name command label prop remove help) |
| 214 | (cond | 220 | (cond |
| 215 | ((stringp item) ; An item or separator. | 221 | ((stringp item) ; An item or separator. |
| 216 | (setq label item)) | 222 | (setq label item)) |
| @@ -250,6 +256,7 @@ possibly preceded by keyword pairs as described in `easy-menu-define'." | |||
| 250 | ((eq keyword :keys) (setq keys arg no-name nil)) | 256 | ((eq keyword :keys) (setq keys arg no-name nil)) |
| 251 | ((eq keyword :label) (setq label arg)) | 257 | ((eq keyword :label) (setq label arg)) |
| 252 | ((eq keyword :active) (setq active (or arg ''nil))) | 258 | ((eq keyword :active) (setq active (or arg ''nil))) |
| 259 | ((eq keyword :help) (setq prop (cons :help (cons arg prop)))) | ||
| 253 | ((eq keyword :suffix) (setq suffix arg)) | 260 | ((eq keyword :suffix) (setq suffix arg)) |
| 254 | ((eq keyword :style) (setq style arg)) | 261 | ((eq keyword :style) (setq style arg)) |
| 255 | ((eq keyword :selected) (setq selected (or arg ''nil))))) | 262 | ((eq keyword :selected) (setq selected (or arg ''nil))))) |