Search code examples
emacsgdbpdbgud

Emacs gud raising prefix key error


I'm trying to debug code in Emacs but when I try either M-x gdb or M-x pdb, I get this error:

global-set-key: Key sequence C-x C-a C-l starts with non-prefix key C-x C-a

This is most likely coming from this bit in gud.el:

(defcustom gud-key-prefix "\C-x\C-a"
  "Prefix of all GUD commands valid in C buffers."
  :type 'string
  :group 'gud)

(global-set-key (concat gud-key-prefix "\C-l") 'gud-refresh)

I'm using GNU Emacs 23.1.95.1 (x86_64-apple-darwin, NS apple-appkit-1038.29) (pretest built from emacsformacosx.com. I have not modified any of the stock stuff that came with the build. My local elisp directories have no modifications to gud or gdb variables or hooks.

Specific questions:

  1. Has anybody seen/fixed this before?
  2. If not, how is gud defining an appropriate prefix key on your emacs and not mine?

Solution

  • Found the problem. I had bound C-x C-a to another function in my .emacs.