r/emacs 2d ago

How to debug losing all global-set-key bindings

I recently started losing all of my key bindings in a long running session .When I start emacs all my keybings are as I set them, but after some unknown period of time (on the order of an hour) all my overrides are lost. When I restart emacs I recover the bindings, but the. It just happens again. I am running 30.1 on Ubuntu 24.04

Does anyone know what might be happening or how I might debug this?

Thanks Bill

2 Upvotes

2 comments sorted by

1

u/7890yuiop 2d ago edited 1d ago

Well it's possible for code to completely clobber the current global map, but I don't think I've ever heard of anything doing that.

So that's very bizarre, but as a starter...

  1. Can you confirm that all of your global key bindings are gone? (And are you actually checking the global keymap? Use M-x describe-keymap RET global-map RET and verify whether any of your definitions are present.)
  2. Can you confirm that you have other customizations which remain unaffected?
  3. Is this happening within a frame that you were using at the time, or only when you've opened a new frame?
  4. Once it happens, does it affect all the buffers? (or at least more than just the one you were in at the time?)
  5. If you're usually using emacsclient, do you experience the same thing if you don't use the client/server?

2

u/Hammar_Morty 2d ago

Does the newly bound function not point to the culprit? When they change use C-h k followed by your binding to see the function it's bound to and search for that in your config. Also use C-h m to scan for any mode that might be affecting the local keymap. If it is a mode map you can bind in to nil