自动保存的回显提示与 ivy 显示冲突

问题描述

spacemacs 中使用了自动保存,如果一个 buffer 更改一段时间后没有保存,会触发自动保存,同时在回显区(minibuffer)中显示提示信息。

众所周知,ivy 是使用 minibuffer 来显示信息的。如果 ivy buffer 已经打开,则上述提示信息会覆盖 mini buffer 的显示内容。怎样设置能够当 ivy 显示时,关闭自动保存的提示信息呢?

试试通过 advice 来规避,在 *Message* 中还是会有记录的:

(defun whatacold/inhibit-message-advice (orig-fun &rest args)
  "An :around advice to inhibit showing message in the echo area."
  (let ((inhibit-message t))
    (apply orig-fun args)))

(advice-add #'auto-save-buffers :around #'whatacold/inhibit-message-advice)
1 个赞