Emacs - evil-mode 导致 eldoc 模式闪烁

标签 emacs elisp evil-mode

任何移动命令都会导致迷你缓冲区中的 eldoc 消息闪烁。禁用 evil-mode 会消除闪烁。

从 eldoc 文档中,我找到了这个相关片段。

;; This function goes on pre-command-hook for XEmacs or when using idle
;; timers in Emacs.  Motion commands clear the echo area for some reason,
;; which make eldoc messages flicker or disappear just before motion
;; begins.  This function reprints the last eldoc message immediately
;; before the next command executes, which does away with the flicker.
;; This doesn't seem to be required for Emacs 19.28 and earlier.
(defun eldoc-pre-command-refresh-echo-area ()
  (and eldoc-last-message
       (if (eldoc-display-message-no-interference-p)
           (eldoc-message eldoc-last-message)
         (setq eldoc-last-message nil))))

如何在启用 evil-mode 的情况下防止闪烁?

最佳答案

所以, evil-mode 是无辜的。罪魁祸首是key-chord.el .

当按下 key-chord-define 中存在的键时,显示屏会闪烁。我将“jk”绑定(bind)到 keyboard-quit,所以每次我按下 jk 时,eldoc 都会闪烁。

(key-chord-define-global "jk" 'keyboard-quit)

这不是 evil-mode 中的错误。由于 hj 等单字母命令,它在 evil-mode 下更加明显。

我在 https://github.com/jschaf/key-chord 修补了键和弦修复闪烁。参见 commit a2f6c61进行实际修复。

关于Emacs - evil-mode 导致 eldoc 模式闪烁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25829232/

相关文章:

Emacspeak 为那些没有视力障碍的人

emacs - 在守护进程 Emacs 中使用字体列表

emacs - 使用recentf 强制emacs 最近的文件忽略指定的文件(例如.windows 和.revive)

emacs - 让 Emacs 填充段落与类似 javadoc 的注释一起玩

windows - Linux 和 Windows 下 emacs 中 webdev 的可靠配置?

python - 将 OrgMode 中的 Python 输出解析为表

python - 我如何在 Emacs 中为某些东西着色?

emacs - 在 evil-mode 下绑定(bind) C-z 以逃至 shell

vim - 具有RSI类型症状(无法使用的手指)的代码创建/编辑器的软件要求

emacs - 在 evil-mode 下的元键是什么