From 70e6c17de52b26a570f114e0285064657291b494 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 20 Oct 2019 09:33:07 -0400 Subject: [PATCH] Don't autorevert if minibuffer is active Some ivy/helm commands allow you to preview buffers, which is not an appropriate time to (invisibly) revert them. The message could be missed and expensive machinary could be triggered (e.g. updating git-gutter), which could appear slow. Best to defer reverting until the user has deliberately landed on the target, and is more likely to notice a revert notification in the minibuffer. Suggested by @flatwhatson --- core/core-editor.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index 00574b260..c05f898dc 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -153,16 +153,16 @@ possible." ;; changes when we switch to a buffer or when we focus the Emacs frame. (defun doom-auto-revert-buffer-h () "Auto revert current buffer, if necessary." - (unless auto-revert-mode + (unless (or auto-revert-mode (active-minibuffer-window)) + ;; Only prompts for confirmation when buffer is unsaved. (let ((revert-without-query (list "."))) (auto-revert-handler)))) (defun doom-auto-revert-buffers-h () - "Auto revert's stale buffers (that are visible)." - (unless auto-revert-mode - (dolist (buf (doom-visible-buffers)) - (with-current-buffer buf - (doom-auto-revert-buffer-h)))))) + "Auto revert stale buffers in visible windows, if necessary." + (dolist (buf (doom-visible-buffers)) + (with-current-buffer buf + (doom-auto-revert-buffer-h))))) (use-package! recentf