Emacs - 邪恶模式导致eldoc模式闪烁

时间:2014-09-14 01:14:31

标签: emacs elisp evil-mode

任何移动命令都会导致迷你缓冲区中的eldoc-message闪烁。禁用邪恶模式可以消除闪烁。

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

如何在启用恶魔模式的情况下防止闪烁?

1 个答案:

答案 0 :(得分:1)

所以,邪恶模式是无辜的。罪魁祸首是key-chord.el

按下key-chord-define时出现的按键时,显示屏闪烁。我将“jk”绑定到keyboard-quit,因此每次按下jk时,eldoc都会闪烁。

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

这不是邪恶模式中的错误。由于hj这样的单字母命令,它在恶魔模式下更加引人注目。

我在https://github.com/jschaf/key-chord修补了键和弦来修复闪烁。有关实际修复,请参阅commit a2f6c61