diff --git a/modules/tools/dired/config.el b/modules/tools/dired/config.el index 452d5c925..4bccd2932 100644 --- a/modules/tools/dired/config.el +++ b/modules/tools/dired/config.el @@ -47,6 +47,14 @@ (add-hook 'dired-initial-position-hook #'dired-k) (add-hook 'dired-after-readin-hook #'dired-k-no-revert) + (defun +dired*interrupt-process (orig-fn &rest args) + "Fixes dired-k killing git processes too abruptly, leaving behind disruptive +.git/index.lock files." + (cl-letf (((symbol-function #'kill-process) + (symbol-function #'interrupt-process))) + (apply orig-fn args))) + (advice-add #'dired-k--start-git-status :around #'+dired*interrupt-process) + (defun +dired*dired-k-highlight (orig-fn &rest args) "Butt out if the requested directory is remote (i.e. through tramp)." (unless (file-remote-p default-directory)