aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2012-10-28 10:56:51 -0400
committerStefan Monnier2012-10-28 10:56:51 -0400
commit70edffb13005de4aa58ba818559b85aa63a1cdd4 (patch)
treef25322a5427af78d2f055a50cc008bb124eeaba5 /lisp
parent3a51f0eb4168885b869641e9d5c98e3f40e5a515 (diff)
downloademacs-70edffb13005de4aa58ba818559b85aa63a1cdd4.tar.gz
emacs-70edffb13005de4aa58ba818559b85aa63a1cdd4.zip
* lisp/tmm.el (tmm-prompt): Use map-keymap.
* doc/lispref/keymaps.texi (Format of Keymaps): Document the multiple inheritance format. Fixes: debbugs:12744
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog4
-rw-r--r--lisp/tmm.el27
2 files changed, 19 insertions, 12 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d7349617d58..c52ed5e6e8b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,7 @@
12012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * tmm.el (tmm-prompt): Use map-keymap (bug#12744).
4
12012-10-27 Eli Zaretskii <eliz@gnu.org> 52012-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