在emacs中按Ctrl-Z会冻结所有内容

lim*_*imp 7 emacs

我正在使用Linux,并在emacs和sublime文本之间进行切换.在崇高文本中,Ctrl-Z是撤消.这意味着有时我有时会在emacs中按Ctrl-Z; 不幸的是,当我这样做时,整个过程只是冻结了.我假设这与暂停进程的典型Ctrl-Z行为有关; 但是我在GUI中运行Emacs,为什么它会有这种行为有点超出我的意义.有没有办法改变这个?

phi*_*ils 7

我建议以下简单地完全禁用绑定:

(global-unset-key (kbd "C-z"))

(global-set-key (kbd "C-z C-z") 'my-suspend-frame)

(defun my-suspend-frame ()
  "In a GUI environment, do nothing; otherwise `suspend-frame'."
  (interactive)
  (if (display-graphic-p)
      (message "suspend-frame disabled for graphical displays.")
    (suspend-frame)))
Run Code Online (Sandbox Code Playgroud)

或者你可以直接将函数绑定到C-z,但是我觉得打开它作为其他命令的前缀绑定是非常有用的 - 鉴于我实际上需要调用的频率非常低suspend-frame,我发现一个双倍的C-z C-z方便.