From b2d7d0471195ce12fee68c7b39819c4fe1c0deea Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Wed, 13 Nov 2019 15:48:05 +0900 Subject: [PATCH] Add dired-k-no-revert to switch-buffer-functions --- emacs.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index a3b5f77..9fbc4fa 100644 --- a/emacs.el +++ b/emacs.el @@ -2487,8 +2487,11 @@ Any output will be written to current buffer." ;; `((,most-positive-fixnum))) ;; always execute dired-k when dired buffer is opened and reverted - ;; TODO: Always up-to-date (add-hook 'dired-after-readin-hook #'dired-k-no-revert) + (add-hook 'switch-buffer-functions + (lambda (prev cur) + (when (derived-mode-p 'dired-mode) + (dired-k-no-revert)))) ) (add-hook 'python-mode-hook