[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/add-vdiff b4c3e09 195/258: Ensure sentinel runs in correc
From: |
Justin Burkett |
Subject: |
[elpa] scratch/add-vdiff b4c3e09 195/258: Ensure sentinel runs in correct context |
Date: |
Wed, 17 May 2017 08:13:49 -0400 (EDT) |
branch: scratch/add-vdiff
commit b4c3e09fdbd30a0860dc9f234860ce765dafba6b
Author: justbur <address@hidden>
Commit: justbur <address@hidden>
Ensure sentinel runs in correct context
---
vdiff.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/vdiff.el b/vdiff.el
index 55608a1..8b6558d 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -394,6 +394,15 @@ because those are handled differently.")
(1- (overlay-start ovr))
(1+ (overlay-end ovr)))))))
+(defmacro vdiff--with-buffer-a (session &rest body)
+ "Execute BODY in buffer a of SESSION."
+ (declare (indent 1))
+ `(let ((buf (car (vdiff-session-buffers ,session))))
+ (unless (buffer-live-p buf)
+ (error "vdiff: Session buffer (%s) not live"))
+ (with-current-buffer buf
+ ,@body)))
+
(defmacro vdiff--with-all-buffers (&rest body)
"Execute BODY in all vdiff buffers."
`(dolist (buf (vdiff-session-buffers vdiff--session))
@@ -567,15 +576,16 @@ parsing the diff output and triggering the overlay
updates."
(setq finished t)
(message "vdiff process error: %s" event)))
(when finished
- (vdiff--refresh-overlays)
- (vdiff--refresh-line-maps)
+ (vdiff--with-buffer-a ses
+ (vdiff--refresh-overlays)
+ (vdiff--refresh-line-maps)
+ (when vdiff-auto-refine
+ (vdiff-refine-all-hunks))
+ (run-hooks (process-get proc 'vdiff-post-refresh-hook)))
(delete-file (process-get proc 'vdiff-tmp-a))
(delete-file (process-get proc 'vdiff-tmp-b))
(when (process-get proc 'vdiff-tmp-c)
- (delete-file (process-get proc 'vdiff-tmp-c)))
- (when vdiff-auto-refine
- (vdiff-refine-all-hunks))
- (run-hooks (process-get proc 'vdiff-post-refresh-hook)))
+ (delete-file (process-get proc 'vdiff-tmp-c))))
(setf (vdiff-session-diff-stale ses) nil))))
(defun vdiff--remove-all-overlays ()
- [elpa] scratch/add-vdiff baed24a 148/258: Work on moving refresh to 3way, (continued)
- [elpa] scratch/add-vdiff baed24a 148/258: Work on moving refresh to 3way, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 74ebab6 143/258: Don't move point when closing all folds, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 938cc55 155/258: Fix use of delq (wanted remq), Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 0cbaf6f 156/258: Fix point jumping after receive-changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8f7a212 157/258: Remove with-other-window and sync-line, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff c2627f0 160/258: Fix recenter-all, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 78071df 147/258: Use a separate minor-mode for 3way, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff a373c6b 139/258: Fix line endings in README, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 7bc7f40 172/258: Add recent changes, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 8842469 184/258: Allow point to leave overlay on target selection, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff b4c3e09 195/258: Ensure sentinel runs in correct context,
Justin Burkett <=
- [elpa] scratch/add-vdiff 28c939f 194/258: Document new option, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 133e187 193/258: Allow folds to close on point but make optional, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 4dd194b 190/258: Update screenshot with refinements, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff b840935 202/258: Use more specific faces for refinements, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff f4332f2 212/258: Fix typo in Commentary section, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 1549115 005/258: Add option to lock scrolling by default, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 0f640d3 007/258: Add header info, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 72c20a5 010/258: Add gitignore, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 016518f 016/258: Fix folds at end of buffer, Justin Burkett, 2017/05/17
- [elpa] scratch/add-vdiff 10b7760 018/258: Add faces, Justin Burkett, 2017/05/17