bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#66022: 30.0.50; kmacro overwriting global keybindings


From: Eli Zaretskii
Subject: bug#66022: 30.0.50; kmacro overwriting global keybindings
Date: Sun, 17 Sep 2023 09:05:12 +0300

> From: Gerd Möllmann <gerd.moellmann@gmail.com>
> 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-<mouse-3>" '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-<mouse-3>")
>   => 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-<mouse-3> 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?





reply via email to

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