From: Sean Whitton Date: Sat, 26 Apr 2025 05:15:55 +0000 (+0800) Subject: vc-diff: Delete redundant call to vc-maybe-buffer-sync X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f5b6d660de9d0f22569a375163ff7ad1567fbf99;p=emacs.git vc-diff: Delete redundant call to vc-maybe-buffer-sync 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) --- diff --git a/lisp/files.el b/lisp/files.el index 4be36335482..287a0a80f67 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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)) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index c7f16859922..611331f31ee 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -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