]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-diff: Delete redundant call to vc-maybe-buffer-sync
authorSean Whitton <spwhitton@spwhitton.name>
Sat, 26 Apr 2025 05:15:55 +0000 (13:15 +0800)
committerEshel Yaron <me@eshelyaron.com>
Sun, 27 Apr 2025 13:29:15 +0000 (15:29 +0200)
This call is redundant with the subsequent call to
vc-buffer-sync-fileset.  I believe this call to
vc-maybe-buffer-sync was reintroduced by accident -- the
changeset adding the call to vc-buffer-sync-fileset deleted a
call to vc-sync-fileset in the same place.

* lisp/vc/vc.el (vc-diff): Delete redundant call to
vc-maybe-buffer-sync.
* lisp/files.el (find-buffer-visiting): Note in docstring that
this function only ever returns base buffers.

(cherry picked from commit d047a89e769f3c8429c43a40d5f251a895590d3a)

lisp/files.el
lisp/vc/vc.el

index 4be36335482cafdbe9e1f6371ccb887bc1dbd50a..287a0a80f67fe7b642304212152afd44a6c53a42 100644 (file)
@@ -2305,6 +2305,9 @@ If PREDICATE is non-nil, only buffers satisfying it are eligible,
 and others are ignored.  PREDICATE is called with the buffer as
 the only argument, but not with the buffer as the current buffer.
 
+Note that indirect buffers don't count as visiting files,
+and that therefore this function only ever returns base buffers.
+
 If there is no such live buffer, return nil."
   (or (let ((buf (get-file-buffer filename)))
         (when (and buf (or (not predicate) (funcall predicate buf))) buf))
index c7f16859922b25c67f88428336a1e6f98bb4ee77..611331f31ee38a987e49f3ed909f6989ad2273f1 100644 (file)
@@ -2293,7 +2293,6 @@ Optional argument FILESET, if non-nil, overrides the fileset."
   (interactive (list current-prefix-arg t))
   (if historic
       (call-interactively 'vc-version-diff)
-    (vc-maybe-buffer-sync not-essential)
     (let ((fileset (or fileset (vc-deduce-fileset t))))
       (vc-buffer-sync-fileset fileset not-essential)
       (vc-diff-internal t fileset nil nil