Search code examples
emacskey-bindingsgud

How to change GUD breakpoint keybinding to the old one


Currently, I am using GUD in the newest version of Emacs. The keybinding has changed since the old Emacs. Now it is "\C-x \C-a \C-b" for setting a breakpoint but it was \C-[space].

I was wondering if there is anyway to change the keybinding to the old format? (For some reason I cannot change my Emacs version)

I am using Emacs 24.5

Here is my .emacs file:

;; .emacs

;;; uncomment this line to disable loading of "default.el" at startup
;; (setq inhibit-default-init t)

;; turn on font-lock mode
(when (fboundp 'global-font-lock-mode)
  (global-font-lock-mode t))

;; enable visual feedback on selections
;(setq transient-mark-mode t)

;; default to better frame titles
(setq frame-title-format
      (concat  "%b - emacs@" (system-name)))

;; default to unified diffs
(setq diff-switches "-u")

;; always end a file with a newline
;(setq require-final-newline 'query)

;; Show main source buffer when using gdb
(setq gdb-show-main t)

;; Show all debugging frames in GDB
(setq gdb-many-windows t)

;; see buffer list on the same frame
(global-set-key "\C-x\C-b" 'buffer-menu)

;; old keybinding for breakoint in GUD
(require 'gud)
(define-key gud-mode-map "\C-x SPC" 'gud-break)

Solution

  • Somehow I was able to fix it with this:

    (require 'gud)
    (global-set-key [24 32] (quote gud-break))