branch: externals/diff-hl commit 5ac6dce3f33b297fe45305605f79114b98b4652c Author: Dmitry Gutov <dmi...@gutov.dev> Commit: Dmitry Gutov <dmi...@gutov.dev>
diff-hl-update: Avoid locking the current buffer in the thread Workaround for https://debbugs.gnu.org/76969 --- diff-hl.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/diff-hl.el b/diff-hl.el index 61d8f49c26..3345eeffc6 100644 --- a/diff-hl.el +++ b/diff-hl.el @@ -420,7 +420,15 @@ It can be a relative expression as well, such as \"HEAD^\" with Git, or (run-hook-with-args-until-success 'diff-hl-async-inhibit-functions default-directory))) ;; TODO: debounce if a thread is already running. - (make-thread 'diff-hl--update-safe "diff-hl--update-safe") + (let ((buf (current-buffer))) + ;; Switch buffer temporarily, to "unlock" it for other threads. + (with-temp-buffer + (make-thread + (lambda () + (when (buffer-live-p buf) + (set-buffer buf) + (diff-hl--update-safe))) + "diff-hl--update-safe"))) (diff-hl--update))) (defun diff-hl-with-editor-p (_dir)