Subject: 30.1; Key bindings via use-package :bind are being forgotten

From: Alex Lamaison <[email-masked]>
Date: Wed, 14 May 2025 17:00:56 +0100

Since starting to use Emacs 30 I've been having issues with keybindings
I've defined being overwritten.  Some are overwritten on startup,
sometimes later during the session.  This didn't happen in earlier
version of Emacs using the same init.el.

In particular, I have keybindings for ace-window and helm-find-files
defined as follows:

(use-package ace-window
  :ensure t
  :bind ("C-x o" . ace-window)
  :config (setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)))
(use-package helm-files
  :bind (("C-x C-f" . helm-find-files))
  :config (setq helm-ff-file-name-history-use-recentf t))

If I include multi-term in my config, these keybinds are reverted back
to their defaults by the time Emacs starts up.  All it takes is the
presence of this line, I don't have to actually open a terminal:

(use-package multi-term :ensure)

So I removed this line and thought I was fine.  However at some point
during my session I will still lose the bindings to ace-window and
helm-find-files.  So it seems the issue is more fundamental.

M-x describe-personal-keybindings shows:

Key name          Command                                 Comments
----------------- --------------------------------------- ---------------------
C-@               `er/expand-region'                      was `set-mark-command'

C-c SPC           `ace-jump-mode'
C-c l             `#<interpreted-function>'

C-x b             `helm-mini'                             was `switch-to-buffer'
C-x g             `magit-status'
C-x o             `ace-window'                            [now: `other-window']

C-x C-b           `helm-buffers-list'                     was `list-buffers'
C-x C-f           `helm-find-files'                       [now: `find-file']

M-;               `comment-dwim-2'                        was `comment-dwim'
M-x               `helm-M-x'                              was
`execute-extended-command'

M-s g             `helm-git-grep-at-point'
M-s o             `helm-occur'                            was `occur'

Note how the two keybindings in question are listed with '[now:
...]'. Other keybindings defined with (use-package ... :bind ...) are
left untouched.

Possibly unrelated, I've noticed that C-x C-c doesn't recognise the
second key of the chord if I press it too fast.  That didn't happen with
earlier Emacs using the same init.el.

I've tried many ways of intercepting changes to keybinding by defining
advice but nothing catches anything trying to reset the binding.

Any advice greatly appreciated.

Alex

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: Python

Minor modes in effect:
  recentf-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  auto-revert-mode: t
  lsp-completion-mode: t
  lsp-lens-mode: t
  lsp-modeline-workspace-status-mode: t
  lsp-modeline-diagnostics-mode: t
  lsp-modeline-code-actions-mode: t
  lsp-headerline-breadcrumb-mode: t
  lsp-diagnostics-mode: t
  subword-mode: t
  copilot-mode: t
  doom-modeline-mode: t
  company-quickhelp-mode: t
  company-quickhelp-local-mode: t
  global-diff-hl-mode: t
  diff-hl-mode: t
  which-key-mode: t
  lsp-ui-mode: t
  lsp-ui-doc-mode: t
  lsp-ui-sideline-mode: t
  lsp-managed-mode: t
  lsp-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  helm-mode: t
  helm-minibuffer-history-mode: t
  helm-autoresize-mode: t
  helm--remap-mouse-mode: t
  global-company-mode: t
  company-mode: t
  projectile-mode: t
  override-global-mode: t
  delete-selection-mode: t
  desktop-save-mode: t
  server-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/alex/.emacs.d/elpa/transient-20250501.846/transient hides
/snap/emacs/current/usr/share/emacs/30.1/lisp/transient

Features:
(shadow sort mail-extr emacsbug ediff ediff-merg ediff-mult ediff-wind
ediff-diff ediff-help ediff-init ediff-util gptel-context reveal
gptel-curl gptel-rewrite gptel-transient org-element org-persist org-id
org-refile org-element-ast org ob ob-tangle ob-ref ob-lob ob-table
ob-exp org-macro org-src sh-script executable ob-comint org-pcomplete
org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core
ob-eval org-cycle org-table org-keys oc org-loaddefs cal-menu calendar
cal-loaddefs ol org-fold org-fold-core org-compat avl-tree org-version
org-macs gptel gptel-openai gptel-autoloads loaddefs-gen tar-mode
arc-mode archive-mode misearch multi-isearch mm-archive mule-util
display-line-numbers recentf helm-x-files helm-for-files helm-bookmark
helm-adaptive magit-bookmark bookmark url-cache cus-edit cus-start
cus-load pulse image-file image-converter helm-external helm-net
emacsql-sqlite-builtin forge-repos forge-tablist hl-line forge-topics
forge-commands forge-semi forge-bitbucket buck forge-gogs gogs
forge-gitea gtea forge-gitlab glab forge-github ghub-graphql treepy
gsexp ghub url-http url-gw url-auth let-alist forge-forgejo forge-notify
forge-revnote forge-pullreq forge-issue forge-discussion forge-topic
yaml eieio-custom bug-reference forge-post forge-repo forge forge-core
forge-db closql emacsql-sqlite emacsql emacsql-compiler eieio-base
magit-submodule magit-blame magit-stash magit-reflog magit-bisect
magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff git-commit log-edit message sendmail rfc822 mml mml-sec
epa derived gnus-util mailabbrev mail-utils gmm-utils mailheader add-log
magit-core magit-autorevert magit-margin magit-transient magit-process
with-editor magit-mode benchmark magit-git magit-base magit-section
cursor-sensor crm llama helm-git-grep yank-media ace-window avy winner
tramp-archive tramp-gvfs tramp-cache time-stamp zeroconf helm-command
helm-elisp helm-eval edebug debug backtrace helm-info view lsp-zig
lsp-yang lsp-yaml lsp-xml lsp-wgsl lsp-volar lsp-vimscript lsp-vhdl
lsp-vetur lsp-html lsp-verilog lsp-vala lsp-v lsp-typespec lsp-typeprof
lsp-ttcn3 lsp-ts-query lsp-trunk lsp-toml lsp-tilt lsp-tex lsp-terraform
lsp-svelte lsp-steep lsp-sqls lsp-sql lsp-sorbet lsp-solidity
lsp-solargraph lsp-semgrep lsp-rust lsp-ruff lsp-ruby-syntax-tree
lsp-ruby-lsp lsp-rubocop lsp-roslyn lsp-roc lsp-rf lsp-remark lsp-racket
lsp-r lsp-qml lsp-pylsp lsp-pyls lsp-pwsh lsp-purescript lsp-postgres
lsp-pls lsp-php lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml
lsp-nushell lsp-nix lsp-nim lsp-nginx lsp-nextflow lsp-move lsp-mojo
lsp-mint lsp-meson lsp-mdx lsp-matlab lsp-marksman lsp-markdown
lsp-magik lsp-fennel lsp-lua lsp-lisp lsp-kubernetes-helm lsp-kotlin
lsp-json lsp-jq lsp-javascript lsp-idris lsp-haxe lsp-hack lsp-groovy
lsp-graphql lsp-golangci-lint lsp-glsl lsp-gleam lsp-gdscript lsp-fsharp
lsp-futhark lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elm
lsp-elixir lsp-earthly lsp-dockerfile lsp-dhall lsp-d lsp-cypher
lsp-cucumber lsp-copilot lsp-css lsp-c3 lsp-csharp gnutls lsp-crystal
lsp-credo lsp-cobol lsp-cmake lsp-clojure lsp-clangd lsp-bufls lsp-go
lsp-beancount lsp-bash lsp-awk lsp-autotools lsp-astro lsp-asm
lsp-ansible lsp-angular lsp-ada lsp-semantic-tokens lsp-actionscript
yaml-mode autorevert lsp-completion lsp-lens lsp-modeline lsp-headerline
lsp-icons lsp-diagnostics cap-words superword subword copilot
copilot-balancer editorconfig editorconfig-core editorconfig-core-handle
editorconfig-fnmatch jsonrpc go-mode find-file ffap doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path
company-quickhelp pos-tip company-oddmuse company-keywords company-etags
company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic company-bbdb
restclient-jq jq-mode smie pcre2el rxt re-builder visual-regexp-steroids
visual-regexp nvm protobuf-mode symon battery dbus diff-hl-dired diff-hl
log-view pcvs-util vc-dir vc which-key docker docker-context
docker-volume docker-network docker-image docker-container docker-faces
docker-core docker-compose docker-process docker-utils tablist
tablist-filter semantic/wisent/comp semantic/wisent
semantic/wisent/wisent semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw mode-local cedet docker-group
transient pp aio restclient json-mode json-snatcher js2-refactor
js2r-paredit js2r-conveniences js2r-conditionals js2r-wrapping
js2r-functions yasnippet js2r-vars mc-hide-unmatched-lines-mode
mc-mark-more sgml-mode facemenu dom mc-cycle-cursors
multiple-cursors-core rect js2r-iife js2r-formatting js2r-helpers
js2-mode etags fileloop generator js c-ts-common cc-mode cc-fonts
cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs
py-autopep8 auto-virtualenv pytest python compat treesit lsp-ui
lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu lsp-ui-peek
lsp-ui-sideline lsp-mode xref tree-widget wid-edit spinner
network-stream puny nsm markdown-mode color noutline outline lv inline
imenu f ewoc epg rfc6068 epg-config lsp-ui-util face-remap lsp-protocol
s ht dash flycheck-irony flycheck find-func irony-diagnostics
company-irony-c-headers company-irony company-template irony-completion
irony-snippet irony irony-iotask clang-format vc-git diff-mode
track-changes vc-dispatcher xml cmake-project advice helm-projectile
helm-mode helm-misc helm-files image-dired image-dired-tags
image-dired-external image-dired-util image-mode dired dired-loaddefs
exif filenotify tramp trampver tramp-integration files-x tramp-message
tramp-compat xdg shell pcomplete parse-time iso8601 time-date
tramp-loaddefs helm-buffers helm-x-icons helm-occur helm-tags
helm-locate helm-grep wgrep-helm wgrep helm-regexp format-spec
helm-utils helm-help helm-types helm helm-global-bindings helm-easymenu
helm-core helm-source helm-multi-match helm-lib async company projectile
project grep compile text-property-search comint ansi-osc ring ibuf-ext
ibuffer ibuffer-loaddefs thingatpt use-package-delight nerd-icons
nerd-icons-faces nerd-icons-data nerd-icons-data-mdicon
nerd-icons-data-flicon nerd-icons-data-codicon nerd-icons-data-devicon
nerd-icons-data-sucicon nerd-icons-data-wicon nerd-icons-data-faicon
nerd-icons-data-powerline nerd-icons-data-octicon
nerd-icons-data-pomicon nerd-icons-data-ipsicon zenburn-theme midnight
edmacro kmacro use-package-bind-key bind-key easy-mmode
use-package-diminish delight comp-run diminish exec-path-from-shell
quelpa-use-package quelpa mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr lisp-mnt help-fns
radix-tree use-package-ensure use-package-core finder-inf delsel desktop
frameset ansi-color server site-start comp comp-cstr cl-extra help-mode
comp-common warnings 0blayout-autoloads ace-jump-mode-autoloads
ace-window-autoloads auto-virtualenv-autoloads
autodisass-java-bytecode-autoloads avy-autoloads clang-format-autoloads
cmake-mode-autoloads cmake-project-autoloads comment-dwim-2-autoloads
company-anaconda-autoloads anaconda-mode-autoloads company-go-autoloads
company-irony-autoloads company-irony-c-headers-autoloads
company-quickhelp-autoloads company-autoloads copilot-autoloads
delight-autoloads diff-hl-autoloads diminish-autoloads docker-autoloads
aio-autoloads docker-compose-mode-autoloads dockerfile-mode-autoloads
doom-modeline-autoloads exec-path-from-shell-autoloads
expand-region-autoloads flx-ido-autoloads flx-autoloads
flycheck-gometalinter-autoloads flycheck-irony-autoloads
flycheck-autoloads forge-autoloads closql-autoloads emacsql-autoloads
ghub-autoloads git-link-autoloads go-eldoc-autoloads go-mode-autoloads
google-c-style-autoloads helm-git-grep-autoloads helm-lsp-autoloads
helm-mt-autoloads helm-projectile-autoloads helm-autoloads
helm-core-autoloads async-autoloads irony-autoloads
js2-refactor-autoloads js2-mode-autoloads json-mode-autoloads rx
json-snatcher-autoloads lsp-ui-autoloads lsp-mode-autoloads ht-autoloads
lv-autoloads magit-autoloads pcase magit-section-autoloads
llama-autoloads markdown-mode-autoloads multi-term-autoloads
multi-vterm-autoloads multiple-cursors-autoloads nerd-icons-autoloads
nvm-autoloads pcre2el-autoloads pos-tip-autoloads powerline-autoloads
projectile-autoloads protobuf-mode-autoloads py-autopep8-autoloads
pytest-autoloads pythonic-autoloads quelpa-use-package-autoloads
quelpa-autoloads restclient-jq-autoloads jq-mode-autoloads
restclient-autoloads shrink-path-autoloads f-autoloads s-autoloads
spinner-autoloads symon-autoloads tablist-autoloads
terraform-mode-autoloads dash-autoloads hcl-mode-autoloads
transient-autoloads treepy-autoloads typescript-mode-autoloads
verb-autoloads visual-regexp-steroids-autoloads visual-regexp-autoloads
vterm-autoloads web-mode-autoloads wfnames-autoloads
wgrep-helm-autoloads wgrep-autoloads info with-editor-autoloads
yaml-autoloads yaml-mode-autoloads yasnippet-autoloads
zenburn-theme-autoloads package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs icons password-cache json subr-x map byte-opt
gv bytecomp byte-compile url-vars cl-loaddefs cl-lib 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 4302968 455938) (symbols 48 73144 156) (strings 32 595858 39270)
 (string-bytes 1 18664035) (vectors 16 209584) (vector-slots 8 2139842 381470)
 (floats 8 758 1783) (intervals 56 539243 7349) (buffers 992 86))

-- 

Alex Lamaison
Staff Engineer
W:  www.orbital.tech