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

时间:2015-01-28 21:17:07

标签: emacs

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

1 个答案:

答案 0 :(得分:5)

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

(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)))

或者你可以直接将函数绑定到C-z,但我觉得将它打开作为其他命令的前缀绑定非常有用 - 鉴于我很少见实际上需要拨打suspend-frame,我发现双C-z C-z就像方便一样。

相关问题