From 36d859c671d01e6e79902fe37ee50e30687a457c Mon Sep 17 00:00:00 2001 From: 10sr <8.slashes@gmail.com> Date: Thu, 30 Jan 2020 16:06:25 +0900 Subject: [PATCH] Fix dired-k --- emacs.el | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/emacs.el b/emacs.el index 5f5d537..c126b07 100644 --- a/emacs.el +++ b/emacs.el @@ -2399,14 +2399,21 @@ ARG is num to show, or defaults to 7." ;; (set-variable 'dired-k-date-colors ;; `((,most-positive-fixnum))) - ;; always execute dired-k when dired buffer is opened and reverted - (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)))) - ) + (let* ((pkg (cadr (assq 'dired-k + package-alist))) + (version-str (package-version-join (package-desc-version pkg)))) + ;; Currently dired-k HEAD of original repository is broken so do not use that + (when (string= version-str + "20171017.1228") + + ;; always execute dired-k when dired buffer is opened and reverted + (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)))) + )))