--text follows this line--
The problem can't be reproduced with -Q however with -q one only needs
2 lines in .emacs to recreate. Also, be forewarned that the problem
DOES NOT happen if you specify --debug-init. This is the only command
line option I tried and it hampered predictable recreation efforts.
.emacs content =
(global-set-key [f3] 'describe-key)
(custom-set-variables '(which-key-mode t))
Upon startup, quickly type C-h k F3.
It shows F3 is bound to describe-key
as expected and the key works
normally as do any others you have set. Try it as much as you like.
Now comes the
insidious part. If you type the 'k' a little bit too
slowly F3 is overwritten by kmacro-start-macro-or-insert-counter.
Specifically, type C-h and wait before typing k. Then F3.
Other situations and chords have a similar effect but the common
thread is that no key combination in particular ever causes the problem
reliably. It seems to only happen if you use a prefix (C-u) or take too
long typing the 2nd key in a combination but I don't really know.
Possibly useful observations:
I noticed 2 other clobbered keys while troubleshooting F3 but assumed
they were related and didn't look at them further. I did, however
notice they require different circumstances from those above to be reset
because both mouse-1 and M-i were
reset to defaults independently of F3.
That is, I observed an instance where M-i was reset but F3 was not. I
also saw F3 reset when mouse-2 was not.
Another useful point is that once a key has been reverted to defaults,
if you re-assert your preference it will never revert again. I suspect
--debug-init invokes whatever initially causes the keys to be overwritten
and site-start is then in the position otherwise occupied by someone
re-asserting their preferences. If true, it explains how keys can 'stick'
after a
--debug-init start. If other things have a similar effect,
something many users do may limit the number of people experiencing the
problem.
Or, maybe it's something specific to this build since I've never had a
Ubuntu machine before, my config has never seen a non-Windows build till
now.
In GNU Emacs 30.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.41,
cairo version 1.18.0) of 2025-05-11 built on lcy02-amd64-059
Repository revision: 9328fd1ab06a1a1f85077fd1caadf9128c90f6c1
Repository branch: master
System Description: Ubuntu 24.04.2 LTS
Configured using:
'configure --prefix=/snap/emacs/current/usr --with-x-toolkit=gtk3
--without-xaw3d --with-modules --with-cairo
--with-native-compilation=aot --with-pgtk --with-xinput2
--with-tree-sitter 'CFLAGS=-isystem
/build/emacs/parts/emacs/install/usr/include -isystem
/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem
/build/emacs/stage/usr/include -O2' 'CPPFLAGS=-isystem
/build/emacs/parts/emacs/install/usr/include -isystem
/build/emacs/parts/emacs/install/usr/include/x86_64-linux-gnu -isystem
/build/emacs/stage/usr/include'
'LDFLAGS=-L/build/emacs/parts/emacs/install/lib
-L/build/emacs/parts/emacs/install/usr/lib
-L/build/emacs/parts/emacs/install/lib/x86_64-linux-gnu
-L/build/emacs/parts/emacs/install/usr/lib/x86_64-linux-gnu
-L/build/emacs/stage/usr/lib''
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB
Important settings:
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Fundamental
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils shortdoc text-property-search
kmacro byte-opt help-fns radix-tree site-start comp cl-seq comp-cstr
cl-extra help-mode comp-common warnings icons subr-x rx gv cl-loaddefs
cl-lib bytecomp byte-compile rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gtk pgtk
lcms2 multi-tty move-toolbar make-network-process native-compile emacs)
Memory information:
((conses 16 123573 16384) (symbols 48 7625 0) (strings 32 25412 1713)
(string-bytes 1 1761900) (vectors 16 14083)
(vector-slots 8 177707 11252) (floats 8 85 3) (intervals 56 476 0)
(buffers 992 12))