GNU bug report logs - #78582
30.1; which-key-mode overwrites custom key bindings

Previous Next

Package: emacs;

Reported by: Rick <rbielaws <at> gmail.com>

Date: Sat, 24 May 2025 21:17:02 UTC

Severity: normal

Found in version 30.1

Full log


Message #47 received at 78582 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gerd Möllmann <gerd.moellmann <at> gmail.com>,
 Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: murray.alex <at> gmail.com, luangruo <at> yahoo.com, 78582 <at> debbugs.gnu.org
Subject: Re: bug#78582: 30.1; which-key-mode overwrites custom key bindings
Date: Mon, 02 Jun 2025 10:26:12 +0300
> From: Gerd Möllmann <gerd.moellmann <at> gmail.com>
> Cc: Alex Murray <murray.alex <at> gmail.com>,  Po Lu <luangruo <at> yahoo.com>,
>   78582 <at> debbugs.gnu.org
> Date: Mon, 02 Jun 2025 05:49:14 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > Po Lu, any ideas why the PGTK build could show this strange behavior?
> 
> I encountered this on macOS today. Reproducer with an installed Emacs 
> (which is the Emacs.app on macOS):
> 
>   ~/Desktop/Emacs.app/Contents/MacOS/Emacs -q
> 
> In *scratch*, eval
> 
>  (global-set-key [f4] #'kill-current-buffer)
>  (documentation 'rectangle-mark-mode)
> 
> Then C-h k <f4> and observe that it has been redefined.

Not reproducible on my system with today's master branch.  When I
press "C-h k <f4>" after evaluating the above line by line, I get the
expected documentation of kill-current-buffer.

> A backtrace how this happens with which-key is at then end. In short,
> which-key calls 'documentation' which loads lisp/loaddefs which
> evaluates the global-set-keys loaddefs.el contains.

"M-x debug-on-entry RET global-set-key RET" doesn't pop up the
debugger when I evaluate "(documentation 'rectangle-mark-mode)".

Anyway, why would Emacs want to load loaddefs, when loaddefs is
preloaded?

> I have no idea how to fix this.

And I have no idea why this happens on some systems, but not on
others.




This bug report was last modified 9 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.