Subject: Re: bug#31764: 26.1; Point in VC change log is not centered as documented

From: Carlos Pita <[email-masked]>
Date: Sat, 9 Jun 2018 11:18:10 -0300

Sadly it doesn't improve matters, Eli.

Below I'm repeating the conclusions of my debugging session in a more
orderly fashion:

1) `C-x v l` is bound to vc-print-log

2) vc-print-log takes an optional working-revision argument. When
called with a prefix argument, working-revision is prompted for.

3) In both cases (prompted or not) the default value for this argument is nil.

4) vc-print-log calls (vc-print-log-internal backend files
working-revision nil limit)

5) Then vc-print-log-internal calls vc-log-internal-common.

6) This last function takes a goto-location-func argument that the
caller is passing as the result of:

       ;; When it's nil, point really shouldn't move (bug#15322).
       (when working-revision
         (lambda (bk)
           (vc-call-backend bk 'show-log-entry working-revision)))

that is, nil by default.

7) vc-log-internal-common only moves the point when goto-location-func
is not nil:

       (when goto-location-func
         (funcall goto-location-func backend)
         (setq vc-sentinel-movepoint (point)))

So I'm really failing to see how this could work at all.

Besides, there is the point that this advice, that changes the nil
default for the working version of the current buffer, makes it work
as documented:

(advice-add 'vc-print-log
        :filter-args (lambda (args)
               (cons (or (car args)
                     (and (buffer-file-name)
                      (vc-working-revision (buffer-file-name))))
                 (cdr args))))