[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/diff-hl 328e23e 23/25: Introduce diff-hl-after-revert
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/diff-hl 328e23e 23/25: Introduce diff-hl-after-revert |
Date: |
Sun, 20 Dec 2020 05:07:05 -0500 (EST) |
branch: externals/diff-hl
commit 328e23e73edf69cf8cff420ad4ccb15b827e2b7a
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Introduce diff-hl-after-revert
To only update when necessary (e.g. auto-revert-mode did its thing).
#152
---
diff-hl.el | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/diff-hl.el b/diff-hl.el
index 2c543e7..98c16b8 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -405,6 +405,11 @@ performance when viewing such files in certain conditions."
(unless (buffer-modified-p)
(diff-hl-update))))
+(defun diff-hl-after-revert ()
+ (defvar revert-buffer-preserve-modes)
+ (when revert-buffer-preserve-modes
+ (diff-hl-update)))
+
(defun diff-hl-diff-goto-hunk-1 ()
(vc-buffer-sync)
(let* ((line (line-number-at-pos))
@@ -582,7 +587,7 @@ The value of this variable is a mode line template as in
'find-file-hook)
'diff-hl-update-once t t)
(add-hook 'vc-checkin-hook 'diff-hl-update nil t)
- (add-hook 'after-revert-hook 'diff-hl-update nil t)
+ (add-hook 'after-revert-hook 'diff-hl-after-revert nil t)
;; Magit does call `auto-revert-handler', but it usually
;; doesn't do much, because `buffer-stale--default-function'
;; doesn't care about changed VC state.
- [elpa] externals/diff-hl a625033 10/25: Update Magit bridge to use the recommended approach, (continued)
- [elpa] externals/diff-hl a625033 10/25: Update Magit bridge to use the recommended approach, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl f3b2d15 11/25: diff-hl-diff-goto-hunk, diff-hl-revert-hunk: handle indirect buffers., Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 176f931 14/25: Support buffers in 'conflict' state as well, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 165a30f 16/25: Merge pull request #143 from walseb/master, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl c58098c 15/25: Added option to not automatically enable diff-hl in certain major-modes, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl d1b9a2b 18/25: Add global-diff-hl-amend-mode to diff-hl custom group, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl c31af59 20/25: Don't hook into after-revert-hook, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 8ed1120 22/25: Revert "Don't hook into after-revert-hook", Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl f6244ab 19/25: Merge pull request #150 from tarsiiformes/custom-group, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 09ffe8d 21/25: Introduce diff-hl-update-once, to avoid diffing twice in normal-mode, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 328e23e 23/25: Introduce diff-hl-after-revert,
Dmitry Gutov <=
- [elpa] externals/diff-hl b8b4f43 24/25: Bump the version, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl a0028d9 25/25: Merge branch 'externals/diff-hl' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Dmitry Gutov, 2020/12/20