From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66022: 30.0.50; kmacro overwriting global keybindings Date: Sun, 17 Sep 2023 09:05:12 +0300 Message-ID: <83edixgwrr.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30425"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66022@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 17 08:06:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qhkvB-0007iZ-A7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Sep 2023 08:06:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qhkur-0006ek-6d; Sun, 17 Sep 2023 02:05:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhkuq-0006ea-2p for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 02:05:56 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qhkup-0008Ps-Qx for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 02:05:55 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qhkuv-0005aB-RT for bug-gnu-emacs@gnu.org; Sun, 17 Sep 2023 02:06:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Sep 2023 06:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66022 X-GNU-PR-Package: emacs Original-Received: via spool by 66022-submit@debbugs.gnu.org id=B66022.169493074021434 (code B ref 66022); Sun, 17 Sep 2023 06:06:01 +0000 Original-Received: (at 66022) by debbugs.gnu.org; 17 Sep 2023 06:05:40 +0000 Original-Received: from localhost ([127.0.0.1]:48886 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhkua-0005Zd-B7 for submit@debbugs.gnu.org; Sun, 17 Sep 2023 02:05:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43936) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qhkuT-0005ZM-PU for 66022@debbugs.gnu.org; Sun, 17 Sep 2023 02:05:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qhkuG-0008Jb-OW; Sun, 17 Sep 2023 02:05:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=Z4XxNRIcPMa6nsmMguWgkNtp8DPiT8DIbuowtdLeSho=; b=l4cY/PZ1rsoPUGVIgk6P RSpY927k0iVZONQuxNFM2xy15Hvoa/ZVFHxBZbBwxAwHMLTa7+HnPIEbMkbETDGrYYGeRXg8faYEg s91TZ/RAZbFOHEb9oRjmhI0GzkKSy95GK/8ApPm7MmUvn61B2tGX5CMr0w7rCwjj9kCmvwsdNrTu3 E0jAxoDjHPtWWd8GlNXMOQTu9MSlgfVkUmQGeLDgh6Odv800NqpMNrcy5l8TIMUmPxKCyTs7JheBF kUiQ7+7Iu+CKAmy7Nm+/6QCXiLHj5b/IxMBC0NhzYTvh+ew5sFnLVWCBI/1/0diDqX3ulZNzCFdFs ODWned23uHVykw==; In-Reply-To: (message from Gerd =?UTF-8?Q?M=C3=B6llmann?= on Sat, 16 Sep 2023 08:38:22 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:270665 Archived-At: > From: Gerd Möllmann > Date: Sat, 16 Sep 2023 08:38:22 +0200 > > current master 1442f4043a761e9bdeeb4e1fbe9822c2987c1502, emacs -Q The same problem exists on emacs-29 (and I presume in older versions of Emacs). > (keymap-global-set "S-" 'ignore) > > then C-x ( C-g. (The C-g part is not relevant; the same happens if you finish defining the macro.) > (keymap-lookup global-map "S-") > => kmacro-end-call-mouse > > Notice that the binding has been overwritten. This is because of this snippet at top level of kmacro.el: (if kmacro-call-mouse-event (global-set-key (vector kmacro-call-mouse-event) #'kmacro-end-call-mouse)) As the doc string of kmacro-call-mouse-event says: (defcustom kmacro-call-mouse-event 'S-mouse-3 "The mouse event used by kmacro to call a macro. Set to nil if no mouse binding is desired." :type 'symbol) customize this to nil to avoid overwriting the S- binding you have. > This is actually not the binding I care about, but it's the only one I > can easily reproduce with emacs -Q. With my init file, and with a > (trace-function 'global-set-key) I see > > ====================================================================== > 1 -> (global-set-key "(" kmacro-start-macro) > 1 <- global-set-key: kmacro-start-macro > ====================================================================== > 1 -> (global-set-key ")" kmacro-end-macro) > 1 <- global-set-key: kmacro-end-macro > ====================================================================== > 1 -> (global-set-key "e" kmacro-end-and-call-macro) > 1 <- global-set-key: kmacro-end-and-call-macro > ====================================================================== > 1 -> (global-set-key [f3] kmacro-start-macro-or-insert-counter) > 1 <- global-set-key: kmacro-start-macro-or-insert-counter > ====================================================================== > 1 -> (global-set-key [f4] kmacro-end-or-call-macro) > 1 <- global-set-key: kmacro-end-or-call-macro > ====================================================================== > 1 -> (global-set-key " " kmacro-keymap) > 1 <- global-set-key: kmacro-keymap > ====================================================================== > 1 -> (global-set-key "6" 2C-command) > 1 <- global-set-key: 2C-command > ====================================================================== > 1 -> (global-set-key [f2] 2C-command) > 1 <- global-set-key: 2C-command > > which overwrites part of my key bindings, also with ones from two-column. Those bindings come from loaddefs.el, which should be preloaded, so the bindings should be executed when dumping Emacs, as part of loading loadup.el, not when processing your init files. Can you tell more about how you captured those traces, exactly? Also, what are the details of your build, and in particular did you build "--with-native-compilation=aot", per chance? Stefan, any comments?