Mercurial > emacs
changeset 5338:b3a78854c791
(vc-buffer-sync, vc-diff): New arg NOT-URGENT.
(vc-diff): Pass new arg.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 24 Dec 1993 23:07:23 +0000 |
parents | 0740b2a454d9 |
children | b589e807c0b3 |
files | lisp/vc.el |
diffstat | 1 files changed, 12 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/vc.el Fri Dec 24 22:55:03 1993 +0000 +++ b/lisp/vc.el Fri Dec 24 23:07:23 1993 +0000 @@ -331,14 +331,17 @@ (if new-mark (set-mark new-mark)))))) -(defun vc-buffer-sync () +(defun vc-buffer-sync (&optional not-urgent) ;; 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. (if (buffer-modified-p) - (progn - (or vc-suppress-confirm - (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name))) - (error "Aborted")) - (save-buffer)))) + (if (or vc-suppress-confirm + (y-or-n-p (format "Buffer %s modified; save it? " (buffer-name)))) + (save-buffer) + (if not-urgent + nil + (error "Aborted"))))) + (defun vc-workfile-unchanged-p (file &optional want-differences-if-changed) ;; Has the given workfile changed since last checkout? @@ -748,7 +751,7 @@ ;; Additional entry points for examining version histories ;;;###autoload -(defun vc-diff (historic) +(defun vc-diff (historic &optional not-urgent) "Display diffs between file versions. Normally this compares the current file and buffer with the most recent checked in version of that file. This uses no arguments. @@ -768,7 +771,7 @@ unchanged) (or (and file (vc-name file)) (vc-registration-error file)) - (vc-buffer-sync) + (vc-buffer-sync not-urgent) (setq unchanged (vc-workfile-unchanged-p buffer-file-name)) (if unchanged (message "No changes to %s since latest version." file) @@ -1120,7 +1123,7 @@ (while vc-parent-buffer (pop-to-buffer vc-parent-buffer)) (let ((file buffer-file-name) - (obuf (current-buffer)) (changed (vc-diff nil))) + (obuf (current-buffer)) (changed (vc-diff nil t))) (if (and changed (or vc-suppress-confirm (not (yes-or-no-p "Discard changes? ")))) (progn