简体   繁体   English

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

[英]How to change GUD breakpoint keybinding to the old one

Currently, I am using GUD in the newest version of Emacs. 目前,我在最新版本的Emacs中使用GUD。 The keybinding has changed since the old Emacs. 自旧Emacs以来,键绑定已发生变化。 Now it is "\\Cx \\Ca \\Cb" for setting a breakpoint but it was \\C-[space]. 现在设置断点是“\\ Cx \\ Ca \\ Cb”,但它是\\ 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) (出于某种原因,我无法更改我的Emacs版本)

I am using Emacs 24.5 我使用的是Emacs 24.5

Here is my .emacs file: 这是我的.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)

Changing your Emacs version should not be necessary. 不需要更改您的Emacs版本。 Try this: 尝试这个:

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

This will allow you to trigger gud-break with C-SPC . 这将允许您使用C-SPC触发gud-break If you are not talking about the gud-break command, replace it with the command you are referring too. 如果您不是在谈论gud-break命令,请将其替换为您所指的命令。

Generally, the answer to the question "can I change this keybinding?" 一般来说,问题的答案是“我可以更改此键绑定吗?” is always "yes" in Emacs. 在Emacs中总是“是”。

Somehow I was able to fix it with this: 不知怎的,我能够解决这个问题:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM