From unknown Fri Aug 15 16:18:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12744 <12744@debbugs.gnu.org> To: bug#12744 <12744@debbugs.gnu.org> Subject: Status: 24.1; key-binding and local-key-binding return invalid keymap Reply-To: bug#12744 <12744@debbugs.gnu.org> Date: Fri, 15 Aug 2025 23:18:36 +0000 retitle 12744 24.1; key-binding and local-key-binding return invalid keymap reassign 12744 emacs submitter 12744 lennart.fricke@kabelmail.de severity 12744 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 27 13:57:06 2012 Received: (at submit) by debbugs.gnu.org; 27 Oct 2012 17:57:06 +0000 Received: from localhost ([127.0.0.1]:36039 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSAd7-0002aZ-0M for submit@debbugs.gnu.org; Sat, 27 Oct 2012 13:57:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:57414) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TS9hl-0001IU-Lh for submit@debbugs.gnu.org; Sat, 27 Oct 2012 12:57:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS9fY-0001Gd-Pb for submit@debbugs.gnu.org; Sat, 27 Oct 2012 12:55:34 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:52785) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS9fY-0001GY-MD for submit@debbugs.gnu.org; Sat, 27 Oct 2012 12:55:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS9fX-0000cW-60 for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 12:55:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TS9fV-0001G8-JC for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 12:55:31 -0400 Received: from smtpa1.mediabeam.com ([194.25.41.13]:55111 helo=smtpa2.mediabeam.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TS9fV-0001FI-9a for bug-gnu-emacs@gnu.org; Sat, 27 Oct 2012 12:55:29 -0400 Received: from IMAP1 (balancer7.mediabeam.com [10.100.1.80]) by smtpa2.mediabeam.com (8.13.8/8.13.1) with ESMTP id q9RGtOQd001608 for ; Sat, 27 Oct 2012 18:55:24 +0200 Received: from localhost (178-24-204-58-dynip.superkabel.de [178.24.204.58] (may be forged)) (authenticated bits=0) by smtpa.mediabeam.com (8.13.8/8.13.1) with ESMTP id q9RGtNkL001596 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Sat, 27 Oct 2012 18:55:24 +0200 X-mediaBEAM-Originating-IP: [178.24.204.58] X-mediaBEAM-AUTHID: [Lennart.Fricke@kabelmail.de] From: lennart.fricke@kabelmail.de To: bug-gnu-emacs@gnu.org Subject: 24.1; key-binding and local-key-binding return invalid keymap Date: Sat, 27 Oct 2012 18:52:32 +0200 Message-ID: <87ip9vzwkv.fsf@tee.lan> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sat, 27 Oct 2012 13:57:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.9 (------) TWhen the buffer is in org-mode and i trigger tmm-menubar neither the Org nor the Tbl menu are in the list. It seems to me. That (key-binding [menu-bar]) returns a wrong keymap. It starts with a nested keymap: (keymap (keymap (keymap (show . undefined) (hide . undefined) (headings .. undefined) (Org menu-item "Org" ...) (Tbl menu-item "Tbl" ...)) keymap (headings... But there's nothing about that nesting in the docs. In 23.4.1 on Windows there are no nested keymaps: (keymap (show . undefined) (hide . undefined) (headings . undefined) (Org menu-item "Org" ...) (Tbl menu-item "Tbl"...) keymap (headings ... But the org-mode-map is similar and has the following as part of a keymap: (menu-bar keymap (show . undefined) (hide . undefined) (headings . undefined) (Org menu-item "Org" (keymap "Org"... Best regards Lennart Fricke In GNU Emacs 24.1.1 (i686-redhat-linux-gnu, GTK+ Version 2.24.11) of 2012-08-13 on buildvm-23.phx2.fedoraproject.org Windowing system distributor `Fedora Project', version 11.0.11203000 Configured using: `configure '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-dbus' '--with-gif' '--with-jpeg' '--with-png' '--with-rsvg' '--with-tiff' '--with-xft' '--with-xpm' '--with-x-toolkit=gtk' '--with-gpm=no' '--with-wide-int' 'build_alias=i686-redhat-linux-gnu' 'host_alias=i686-redhat-linux-gnu' 'CFLAGS=-DMAIL_USE_LOCKF -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables' 'LDFLAGS=-Wl,-z,relro '' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: de_DE.utf8 value of $XMODIFIERS: @im=none locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Org Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: M-x C-x C-f o r t e s t / t e s t . o r g M-x t m m - m M-x o r g - v e r Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Quit test.org has auto save data; consider M-x recover-this-file Quit Org-mode version 7.8.11 goto-history-element: Beginning of history; no preceding item goto-history-element: End of history; no default available Load-path shadows: None found. Features: (shadow sort gnus-util mail-extr emacsbug message rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode view tmm electric org-wl org-w3m org-vm org-rmail org-mhe org-mew org-irc org-jsinfo org-infojs org-html org-exp ob-exp org-exp-blocks find-func org-agenda org-info org-gnus org-docview org-bibtex bibtex org-bbdb org byte-opt warnings bytecomp byte-compile cconv macroexp advice help-fns advice-preload ob-emacs-lisp ob-tangle ob-ref ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval org-pcomplete pcomplete comint ansi-color ring org-list org-faces org-compat org-entities org-macs noutline outline easy-mmode format-spec regexp-opt cal-menu easymenu calendar cal-loaddefs time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces cus-face files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process dbusbind dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 28 11:00:50 2012 Received: (at 12744-done) by debbugs.gnu.org; 28 Oct 2012 15:00:50 +0000 Received: from localhost ([127.0.0.1]:36723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSUM5-0007IF-VB for submit@debbugs.gnu.org; Sun, 28 Oct 2012 11:00:50 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:25243) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TSUM2-0007I7-Km for 12744-done@debbugs.gnu.org; Sun, 28 Oct 2012 11:00:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAG6Zu0/O+LET/2dsb2JhbABEtBGBCIIVAQEEAVYjBQsLNBIUGA03iAADBgW6CYoahioDkHCSQ4FYgwU X-IronPort-AV: E=Sophos;i="4.75,637,1330923600"; d="scan'208";a="203019715" Received: from 206-248-177-19.dsl.teksavvy.com (HELO pastel.home) ([206.248.177.19]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 28 Oct 2012 10:58:24 -0400 Received: by pastel.home (Postfix, from userid 20848) id 4DCAE59415; Sun, 28 Oct 2012 10:58:23 -0400 (EDT) From: Stefan Monnier To: lennart.fricke@kabelmail.de Subject: Re: bug#12744: 24.1; key-binding and local-key-binding return invalid keymap Message-ID: References: <87ip9vzwkv.fsf@tee.lan> Date: Sun, 28 Oct 2012 10:58:23 -0400 In-Reply-To: <87ip9vzwkv.fsf@tee.lan> (lennart fricke's message of "Sat, 27 Oct 2012 18:52:32 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12744-done Cc: 12744-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) > It seems to me. That (key-binding [menu-bar]) returns a wrong keymap. > It starts with a nested keymap: > (keymap (keymap (keymap (show . undefined) (hide . undefined) (headings > .. undefined) (Org menu-item "Org" ...) (Tbl menu-item "Tbl" ...)) keymap > (headings... > But there's nothing about that nesting in the docs. Indeed, it's missing from the docs. This is a new format added in Emacs-24 (used in `make-composed-keymap'). Any keymap that appears as above within a keymap is treated as a kind of additional parent, as if it were "inlined" where it appears. > When the buffer is in org-mode and i trigger tmm-menubar neither the Org > nor the Tbl menu are in the list. Indeed, it looks like the tmm-menubar needs some updating as well, thanks for spotting this. I've installed the patch below which should fix those problems. Stefan === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-10-27 09:54:04 +0000 +++ lisp/ChangeLog 2012-10-28 14:54:26 +0000 @@ -1,3 +1,7 @@ +2012-10-28 Stefan Monnier + + * tmm.el (tmm-prompt): Use map-keymap (bug#12744). + 2012-10-27 Eli Zaretskii * profiler.el (profiler-report-make-entry-part): Fix help-echo === modified file 'lisp/tmm.el' --- lisp/tmm.el 2012-06-07 16:35:00 +0000 +++ lisp/tmm.el 2012-10-28 14:38:38 +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. + (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))))) + (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, @@ -463,9 +465,10 @@ (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 === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-10-28 12:56:15 +0000 +++ doc/lispref/ChangeLog 2012-10-28 14:54:03 +0000 @@ -1,3 +1,8 @@ +2012-10-28 Stefan Monnier + + * keymaps.texi (Format of Keymaps): Document the multiple + inheritance format. + 2012-10-28 Martin Rudalics * windows.texi (Basic Windows): Reformulate description of live, === modified file 'doc/lispref/keymaps.texi' --- doc/lispref/keymaps.texi 2012-10-24 03:48:50 +0000 +++ doc/lispref/keymaps.texi 2012-10-28 14:55:42 +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}. + +@item (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 From unknown Fri Aug 15 16:18:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 26 Nov 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator