tool/dired: don't kill git process to abruptly
This would leave behind index.lock files. This may potentially fix #389.
This commit is contained in:
parent
d01deb5545
commit
e16ec5ae94
1 changed files with 8 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue