Subject: bug#21067: 25.0.50; [PATCH] With mercurial, vc-print-log puts point at eob

From: Dmitry Gutov <[email-masked]>
Date: Sun, 19 Jul 2015 03:08:28 +0300

On 07/15/2015 02:09 PM, Wolfgang Jenkner wrote:

> So I wonder whether it wouldn't be worthwile to make their job easier
> (and thereby avoid bugs like the one described above) by handling async
> and sync processes alike in this respect.  The condition for this to
> work is that backend functions don't expect point to be preserved,
> except, of course, if it is actually their purpose to compute point
> (like for vc-git-show-log-entry).

I like the idea, but FWIW the patch breaks diff-hl-revert-hunk (diff-hl 
is in GNU ELPA). Haven't investigated it further yet.

And the particular bug you've described, naturally, can also be fixed by 
making vc-hg-print-log asynchronous:

diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el
index 556174a..f634e2e 100644
--- a/lisp/vc/vc-hg.el
+++ b/lisp/vc/vc-hg.el
@@ -272,7 +272,7 @@ If LIMIT is non-nil, show no more than this many 
entries."
    (let ((inhibit-read-only t))
      (with-current-buffer
  	buffer
-      (apply 'vc-hg-command buffer 0 files "log"
+      (apply 'vc-hg-command buffer 'async files "log"
  	     (nconc
  	      (when start-revision (list (format "-r%s:0" start-revision)))
  	      (when limit (list "-l" (format "%s" limit)))