diff options
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/keymaps.texi | 5 | ||||
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/tmm.el | 27 |
4 files changed, 29 insertions, 12 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index fe12e27a070..6b3febba631 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * keymaps.texi (Format of Keymaps): Document the multiple | ||
| 4 | inheritance format. | ||
| 5 | |||
| 1 | 2012-10-28 Martin Rudalics <rudalics@gmx.at> | 6 | 2012-10-28 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * windows.texi (Basic Windows): Reformulate description of live, | 8 | * windows.texi (Basic Windows): Reformulate description of live, |
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi index 8fe729d50f2..f658f7e66fb 100644 --- a/doc/lispref/keymaps.texi +++ b/doc/lispref/keymaps.texi | |||
| @@ -210,6 +210,11 @@ Aside from elements that specify bindings for keys, a keymap can also | |||
| 210 | have a string as an element. This is called the @dfn{overall prompt | 210 | have a string as an element. This is called the @dfn{overall prompt |
| 211 | string} and makes it possible to use the keymap as a menu. | 211 | string} and makes it possible to use the keymap as a menu. |
| 212 | @xref{Defining Menus}. | 212 | @xref{Defining Menus}. |
| 213 | |||
| 214 | @item (keymap @dots{}) | ||
| 215 | If an element of a keymap is itself a keymap, it counts as if this inner keymap | ||
| 216 | were inlined in the outer keymap. This is used for multiple-inheritance, such | ||
| 217 | as in @code{make-composed-keymap}. | ||
| 213 | @end table | 218 | @end table |
| 214 | 219 | ||
| 215 | When the binding is @code{nil}, it doesn't constitute a definition | 220 | When the binding is @code{nil}, it doesn't constitute a definition |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d7349617d58..c52ed5e6e8b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * tmm.el (tmm-prompt): Use map-keymap (bug#12744). | ||
| 4 | |||
| 1 | 2012-10-27 Eli Zaretskii <eliz@gnu.org> | 5 | 2012-10-27 Eli Zaretskii <eliz@gnu.org> |
| 2 | 6 | ||
| 3 | * profiler.el (profiler-report-make-entry-part): Fix help-echo | 7 | * profiler.el (profiler-report-make-entry-part): Fix help-echo |
diff --git a/lisp/tmm.el b/lisp/tmm.el index 4bc1c9af99a..6c2adf6837a 100644 --- a/lisp/tmm.el +++ b/lisp/tmm.el | |||
| @@ -165,13 +165,15 @@ Its value should be an event that has a binding in MENU." | |||
| 165 | ;; tmm-km-list is an alist of (STRING . MEANING). | 165 | ;; tmm-km-list is an alist of (STRING . MEANING). |
| 166 | ;; It has no other elements. | 166 | ;; It has no other elements. |
| 167 | ;; The order of elements in tmm-km-list is the order of the menu bar. | 167 | ;; The order of elements in tmm-km-list is the order of the menu bar. |
| 168 | (dolist (elt menu) | 168 | (if (not not-menu) |
| 169 | (cond | 169 | (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu) |
| 170 | ((stringp elt) (setq gl-str elt)) | 170 | (dolist (elt menu) |
| 171 | ((listp elt) (tmm-get-keymap elt not-menu)) | 171 | (cond |
| 172 | ((vectorp elt) | 172 | ((stringp elt) (setq gl-str elt)) |
| 173 | (dotimes (i (length elt)) | 173 | ((listp elt) (tmm-get-keymap elt not-menu)) |
| 174 | (tmm-get-keymap (cons i (aref elt i)) not-menu))))) | 174 | ((vectorp elt) |
| 175 | (dotimes (i (length elt)) | ||
| 176 | (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) | ||
| 175 | ;; Choose an element of tmm-km-list; put it in choice. | 177 | ;; Choose an element of tmm-km-list; put it in choice. |
| 176 | (if (and not-menu (= 1 (length tmm-km-list))) | 178 | (if (and not-menu (= 1 (length tmm-km-list))) |
| 177 | ;; If this is the top-level of an x-popup-menu menu, | 179 | ;; If this is the top-level of an x-popup-menu menu, |
| @@ -432,7 +434,7 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 432 | (or (keymapp (cdr-safe (cdr-safe elt))) | 434 | (or (keymapp (cdr-safe (cdr-safe elt))) |
| 433 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) | 435 | (eq (car (cdr-safe (cdr-safe elt))) 'lambda)) |
| 434 | (and (symbolp (cdr-safe (cdr-safe elt))) | 436 | (and (symbolp (cdr-safe (cdr-safe elt))) |
| 435 | (fboundp (cdr-safe (cdr-safe elt))))) | 437 | (fboundp (cdr-safe (cdr-safe elt))))) |
| 436 | (setq km (cddr elt)) | 438 | (setq km (cddr elt)) |
| 437 | (and (stringp (car elt)) (setq str (car elt)))) | 439 | (and (stringp (car elt)) (setq str (car elt)))) |
| 438 | 440 | ||
| @@ -458,14 +460,15 @@ It uses the free variable `tmm-table-undef' to keep undefined keys." | |||
| 458 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) | 460 | (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda)) |
| 459 | (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) | 461 | (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt)))) |
| 460 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) | 462 | (fboundp (cdr-safe (cdr-safe (cdr-safe elt)))))) |
| 461 | ; New style of easy-menu | 463 | ; New style of easy-menu |
| 462 | (setq km (cdr (cddr elt))) | 464 | (setq km (cdr (cddr elt))) |
| 463 | (and (stringp (car elt)) (setq str (car elt)))) | 465 | (and (stringp (car elt)) (setq str (car elt)))) |
| 464 | 466 | ||
| 465 | ((stringp event) ; x-popup or x-popup element | 467 | ((stringp event) ; x-popup or x-popup element |
| 466 | (if (or in-x-menu (stringp (car-safe elt))) | 468 | (setq str event) |
| 467 | (setq str event event nil km elt) | 469 | (setq event nil) |
| 468 | (setq str event event nil km (cons 'keymap elt))))) | 470 | (setq km (if (or in-x-menu (stringp (car-safe elt))) |
| 471 | elt (cons 'keymap elt))))) | ||
| 469 | (unless (or (eq km 'ignore) (null str)) | 472 | (unless (or (eq km 'ignore) (null str)) |
| 470 | (let ((binding (where-is-internal km nil t))) | 473 | (let ((binding (where-is-internal km nil t))) |
| 471 | (when binding | 474 | (when binding |