emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r110701: * lisp/tmm.el (tmm-prompt):


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110701: * lisp/tmm.el (tmm-prompt): Use map-keymap.
Date: Sun, 28 Oct 2012 10:56:51 -0400
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110701
fixes bug: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12744
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2012-10-28 10:56:51 -0400
message:
  * lisp/tmm.el (tmm-prompt): Use map-keymap.
  * doc/lispref/keymaps.texi (Format of Keymaps): Document the multiple
  inheritance format.
modified:
  doc/lispref/ChangeLog
  doc/lispref/keymaps.texi
  lisp/ChangeLog
  lisp/tmm.el
=== modified file 'doc/lispref/ChangeLog'
--- a/doc/lispref/ChangeLog     2012-10-28 12:56:15 +0000
+++ b/doc/lispref/ChangeLog     2012-10-28 14:56:51 +0000
@@ -1,3 +1,8 @@
+2012-10-28  Stefan Monnier  <address@hidden>
+
+       * keymaps.texi (Format of Keymaps): Document the multiple
+       inheritance format.
+
 2012-10-28  Martin Rudalics  <address@hidden>
 
        * windows.texi (Basic Windows): Reformulate description of live,

=== modified file 'doc/lispref/keymaps.texi'
--- a/doc/lispref/keymaps.texi  2012-10-24 03:48:50 +0000
+++ b/doc/lispref/keymaps.texi  2012-10-28 14:56:51 +0000
@@ -210,6 +210,11 @@
 have a string as an element.  This is called the @dfn{overall prompt
 string} and makes it possible to use the keymap as a menu.
 @xref{Defining Menus}.
+
address@hidden (keymap @dots{})
+If an element of a keymap is itself a keymap, it counts as if this inner keymap
+were inlined in the outer keymap.  This is used for multiple-inheritance, such
+as in @code{make-composed-keymap}.
 @end table
 
 When the binding is @code{nil}, it doesn't constitute a definition

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-27 09:54:04 +0000
+++ b/lisp/ChangeLog    2012-10-28 14:56:51 +0000
@@ -1,3 +1,7 @@
+2012-10-28  Stefan Monnier  <address@hidden>
+
+       * tmm.el (tmm-prompt): Use map-keymap (bug#12744).
+
 2012-10-27  Eli Zaretskii  <address@hidden>
 
        * profiler.el (profiler-report-make-entry-part): Fix help-echo

=== modified file 'lisp/tmm.el'
--- a/lisp/tmm.el       2012-06-07 16:35:00 +0000
+++ b/lisp/tmm.el       2012-10-28 14:56:51 +0000
@@ -165,13 +165,15 @@
     ;; tmm-km-list is an alist of (STRING . MEANING).
     ;; It has no other elements.
     ;; The order of elements in tmm-km-list is the order of the menu bar.
-    (dolist (elt menu)
-      (cond
-       ((stringp elt) (setq gl-str elt))
-       ((listp elt) (tmm-get-keymap elt not-menu))
-       ((vectorp elt)
-        (dotimes (i (length elt))
-          (tmm-get-keymap (cons i (aref elt i)) not-menu)))))
+    (if (not not-menu)
+        (map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu)
+      (dolist (elt menu)
+        (cond
+         ((stringp elt) (setq gl-str elt))
+         ((listp elt) (tmm-get-keymap elt not-menu))
+         ((vectorp elt)
+          (dotimes (i (length elt))
+            (tmm-get-keymap (cons i (aref elt i)) not-menu))))))
     ;; Choose an element of tmm-km-list; put it in choice.
     (if (and not-menu (= 1 (length tmm-km-list)))
        ;; If this is the top-level of an x-popup-menu menu,
@@ -432,7 +434,7 @@
                   (or (keymapp (cdr-safe (cdr-safe elt)))
                       (eq (car (cdr-safe (cdr-safe elt))) 'lambda))
                 (and (symbolp (cdr-safe (cdr-safe elt)))
-                              (fboundp (cdr-safe (cdr-safe elt)))))
+                      (fboundp (cdr-safe (cdr-safe elt)))))
               (setq km (cddr elt))
               (and (stringp (car elt)) (setq str (car elt))))
 
@@ -458,14 +460,15 @@
                       (eq (car (cdr-safe (cdr-safe (cdr-safe elt)))) 'lambda))
                 (and (symbolp (cdr-safe (cdr-safe (cdr-safe elt))))
                      (fboundp (cdr-safe (cdr-safe (cdr-safe elt))))))
-                                        ; New style of easy-menu
+                                        ; New style of easy-menu
               (setq km (cdr (cddr elt)))
               (and (stringp (car elt)) (setq str (car elt))))
 
              ((stringp event)          ; x-popup or x-popup element
-              (if (or in-x-menu (stringp (car-safe elt)))
-                  (setq str event event nil km elt)
-                (setq str event event nil km (cons 'keymap elt)))))
+               (setq str event)
+               (setq event nil)
+              (setq km (if (or in-x-menu (stringp (car-safe elt)))
+                            elt (cons 'keymap elt)))))
         (unless (or (eq km 'ignore) (null str))
           (let ((binding (where-is-internal km nil t)))
             (when binding


reply via email to

[Prev in Thread] Current Thread [Next in Thread]