如何将 GUD 断点键绑定更改为旧的

How to change GUD breakpoint keybinding to the old one

目前,我在最新版本的Emacs 中使用GUD。自旧 Emacs 以来,键绑定已经改变。现在它是设置断点的“\C-x \C-a \C-b”,但它是 \C-[space].

我想知道是否可以将键绑定更改为旧格式? (出于某种原因,我无法更改我的 Emacs 版本)

我正在使用 Emacs 24.5

这是我的 .emacs 文件:

;; .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)

不必更改您的 Emacs 版本。试试这个:

(require 'gud)
(define-key gud-mode-map (kbd "C-SPC") 'gud-break)

这将允许您用 C-SPC 触发 gud-break。如果您不是在谈论 gud-break 命令,请将其替换为您所指的命令。

一般来说,问题 "can I change this keybinding?" 的答案在 Emacs 中总是 "yes"。

不知何故我能够用这个修复它:

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