我正在使用 Linux,并在 emacs 和 sublime 文本之间切换。在崇高的文本中,Ctrl-Z 是撤消。这意味着有时我有时会在 emacs 中按 Ctrl-Z;不幸的是,当我这样做时,整个过程就会卡住。我认为这与暂停进程的典型 Ctrl-Z 行为有关;但是我在 GUI 中运行 Emacs,所以为什么它会有这种行为有点超出我的理解。有什么办法可以改变这个吗?
最佳答案
我会建议以下简单地完全禁用绑定(bind):
(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)))
或者您可以直接将函数绑定(bind)到
C-z
,但我发现将其作为其他命令的前缀绑定(bind)打开它非常有用——考虑到我实际上很少需要调用 suspend-frame
, 我找到一个双 C-z C-z
一样方便。
关于emacs - 在 emacs 中按 Ctrl-Z 会卡住所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28202546/