From 9ca8bcf7f6c53752ba1dc56ad9202fb4329b049f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 26 Apr 2025 12:55:56 +0800 Subject: [PATCH] Rename vc-buffer-sync's argument to NOT-ESSENTIAL * lisp/vc/vc-dispatcher.el (vc-buffer-sync): * lisp/vc/vc.el (vc-maybe-buffer-sync, vc-diff) (vc-buffer-sync-fileset, vc-ediff, vc-root-diff): Rename argument from NOT-URGENT to NOT-ESSENTIAL. (cherry picked from commit 6b204c2d164a53ff85e132d4a77bd7afbb0fc42e) --- lisp/vc/vc-dispatcher.el | 6 +++--- lisp/vc/vc.el | 32 ++++++++++++++++---------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lisp/vc/vc-dispatcher.el b/lisp/vc/vc-dispatcher.el index 7e9e6091ff7..2db9ea9cbaa 100644 --- a/lisp/vc/vc-dispatcher.el +++ b/lisp/vc/vc-dispatcher.el @@ -697,9 +697,9 @@ editing!" (when vc-dir-buffers (vc-dir-resynch-file file))) -(defun vc-buffer-sync (&optional not-urgent) +(defun vc-buffer-sync (&optional not-essential) "Make sure the current buffer and its working file are in sync. -NOT-URGENT means it is ok to continue if the user says not to save." +NOT-ESSENTIAL means it is okay to continue if the user says not to save." (let (missing) (when (cond ((buffer-modified-p)) @@ -712,7 +712,7 @@ NOT-URGENT means it is ok to continue if the user says not to save." "is missing on disk" "modified")))) (save-buffer) - (unless not-urgent + (unless not-essential (error "Aborted")))))) ;; Command closures diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index ddb13db651c..c7f16859922 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -2276,34 +2276,34 @@ state of each file in the fileset." t (list backend (list rootdir)) rev1 rev2 (called-interactively-p 'interactive))))) -(defun vc-maybe-buffer-sync (not-urgent) +(defun vc-maybe-buffer-sync (not-essential) (with-current-buffer (or (buffer-base-buffer) (current-buffer)) - (when buffer-file-name (vc-buffer-sync not-urgent)))) + (when buffer-file-name (vc-buffer-sync not-essential)))) ;;;###autoload -(defun vc-diff (&optional historic not-urgent fileset) +(defun vc-diff (&optional historic not-essential fileset) "Display diffs between file revisions. Normally this compares the currently selected fileset with their working revisions. With a prefix argument HISTORIC, it reads two revision designators specifying which revisions to compare. -The optional argument NOT-URGENT non-nil means it is ok to say no to -saving the buffer. The optional argument FILESET can override the -deduced fileset." +Optional argument NOT-ESSENTIAL non-nil means it is okay to say no to +saving the buffer. +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-urgent) + (vc-maybe-buffer-sync not-essential) (let ((fileset (or fileset (vc-deduce-fileset t)))) - (vc-buffer-sync-fileset fileset not-urgent) + (vc-buffer-sync-fileset fileset not-essential) (vc-diff-internal t fileset nil nil (called-interactively-p 'interactive))))) -(defun vc-buffer-sync-fileset (fileset not-urgent) +(defun vc-buffer-sync-fileset (fileset not-essential) (dolist (filename (cadr fileset)) (when-let ((buffer (find-buffer-visiting filename))) (with-current-buffer buffer - (vc-buffer-sync not-urgent))))) + (vc-buffer-sync not-essential))))) ;;;###autoload (defun vc-diff-mergebase (_files rev1 rev2) @@ -2369,35 +2369,35 @@ state of each file in FILES." (error "More than one file is not supported")))) ;;;###autoload -(defun vc-ediff (historic &optional not-urgent) +(defun vc-ediff (historic &optional not-essential) "Display diffs between file revisions using ediff. Normally this compares the currently selected fileset with their working revisions. With a prefix argument HISTORIC, it reads two revision designators specifying which revisions to compare. -The optional argument NOT-URGENT non-nil means it is ok to say no to +Optional argument NOT-ESSENTIAL non-nil means it is okay to say no to saving the buffer." (interactive (list current-prefix-arg t)) (if historic (call-interactively 'vc-version-ediff) - (vc-maybe-buffer-sync not-urgent) + (vc-maybe-buffer-sync not-essential) (vc-version-ediff (cadr (vc-deduce-fileset t)) nil nil))) ;;;###autoload -(defun vc-root-diff (historic &optional not-urgent) +(defun vc-root-diff (historic &optional not-essential) "Display diffs between VC-controlled whole tree revisions. Normally, this compares the tree corresponding to the current fileset with the working revision. With a prefix argument HISTORIC, prompt for two revision designators specifying which revisions to compare. -The optional argument NOT-URGENT non-nil means it is ok to say no to +Optional argument NOT-ESSENTIAL non-nil means it is okay to say no to saving the buffer." (interactive (list current-prefix-arg t)) (if historic ;; We want the diff for the VC root dir. (call-interactively 'vc-root-version-diff) - (vc-maybe-buffer-sync not-urgent) + (vc-maybe-buffer-sync not-essential) (let ((backend (vc-deduce-backend)) (default-directory default-directory) rootdir) -- 2.39.5