From d13e0f4fb487cbb74d3d1ba2ed02cf235ae32427 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Fri, 9 May 2008 16:01:27 +0000 Subject: (vc-dispatcher-selection-set): More typos, plus indentation. --- lisp/vc-dispatcher.el | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'lisp/vc-dispatcher.el') diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el index 5a5e15fbc7d..2537c5265ca 100644 --- a/lisp/vc-dispatcher.el +++ b/lisp/vc-dispatcher.el @@ -1340,34 +1340,34 @@ NOT-URGENT means it is ok to continue if the user says not to save." member)) (defun vc-dispatcher-selection-set () - "Deduce a set of files to which to apply an operation. Return the fileset. + "Deduce a set of files to which to apply an operation. Return the fileset. If we're in a directory display, the fileset is the list of marked files (if -there is one) else the file on the curreent line. If not in a directory -display, but the current buffer visits a file, the fileset is a singleton -containing that file. Otherwise, throw an error." +there is one) else the file on the curreent line. If not in a directory +display, but the current buffer visits a file, the fileset is a singleton +containing that file. Otherwise, throw an error." (let ((files - (cond - ;; Browsing with vc-dir - ((vc-dispatcher-browsing) - (or (vc-dir-marked-files) (list (vc-dir-current-file)))) - ;; Visiting an eligible file - ((buffer-file-name) - (list buffer-file-name)) - ;; No eligible file -- if there's a parent buffer, deduce from there - ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer) - (with-current-buffer vc-parent-buffer - (vc-dispatcher-browsing)))) - (with-current-buffer vc-parent-buffer - (vc-dispatcher-selection-set))) - ;; No good set here, throw error - (t (error "No fileset is available here."))))) + (cond + ;; Browsing with vc-dir + ((vc-dispatcher-browsing) + (or (vc-dir-marked-files) (list (vc-dir-current-file)))) + ;; Visiting an eligible file + ((buffer-file-name) + (list buffer-file-name)) + ;; No eligible file -- if there's a parent buffer, deduce from there + ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer) + (with-current-buffer vc-parent-buffer + (vc-dispatcher-browsing)))) + (with-current-buffer vc-parent-buffer + (vc-dispatcher-selection-set))) + ;; No good set here, throw error + (t (error "No fileset is available here"))))) ;; We assume, in order to avoid unpleasant surprises to the user, ;; that a fileset is not in good shape to be handed to the user if the ;; buffers visiting the fileset don't match the on-disk contents. ;; This is actually untrue for operations like `print-log' (or `diff' ;; between two revisions), so maybe this should be moved elsewhere. (save-some-buffers - nil (lambda () (vc-dispatcher-in-fileset-p fileset))) + nil (lambda () (vc-dispatcher-in-fileset-p files))) files)) ;; arch-tag: 7d08b17f-5470-4799-914b-bfb9fcf6a246 -- cgit v1.2.1