comparison lisp/vc-dispatcher.el @ 94802:b6ba0c08fee1

(vc-dispatcher-selection-set): More typos, plus indentation.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Fri, 09 May 2008 16:01:27 +0000
parents 4a0c0906cc91
children 3e09ff6082e0
comparison
equal deleted inserted replaced
94801:4a0c0906cc91 94802:b6ba0c08fee1
1338 (eq (current-buffer) (get-file-buffer elem))) 1338 (eq (current-buffer) (get-file-buffer elem)))
1339 (setq member t)))) 1339 (setq member t))))
1340 member)) 1340 member))
1341 1341
1342 (defun vc-dispatcher-selection-set () 1342 (defun vc-dispatcher-selection-set ()
1343 "Deduce a set of files to which to apply an operation. Return the fileset. 1343 "Deduce a set of files to which to apply an operation. Return the fileset.
1344 If we're in a directory display, the fileset is the list of marked files (if 1344 If we're in a directory display, the fileset is the list of marked files (if
1345 there is one) else the file on the curreent line. If not in a directory 1345 there is one) else the file on the curreent line. If not in a directory
1346 display, but the current buffer visits a file, the fileset is a singleton 1346 display, but the current buffer visits a file, the fileset is a singleton
1347 containing that file. Otherwise, throw an error." 1347 containing that file. Otherwise, throw an error."
1348 (let ((files 1348 (let ((files
1349 (cond 1349 (cond
1350 ;; Browsing with vc-dir 1350 ;; Browsing with vc-dir
1351 ((vc-dispatcher-browsing) 1351 ((vc-dispatcher-browsing)
1352 (or (vc-dir-marked-files) (list (vc-dir-current-file)))) 1352 (or (vc-dir-marked-files) (list (vc-dir-current-file))))
1353 ;; Visiting an eligible file 1353 ;; Visiting an eligible file
1354 ((buffer-file-name) 1354 ((buffer-file-name)
1355 (list buffer-file-name)) 1355 (list buffer-file-name))
1356 ;; No eligible file -- if there's a parent buffer, deduce from there 1356 ;; No eligible file -- if there's a parent buffer, deduce from there
1357 ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer) 1357 ((and vc-parent-buffer (or (buffer-file-name vc-parent-buffer)
1358 (with-current-buffer vc-parent-buffer 1358 (with-current-buffer vc-parent-buffer
1359 (vc-dispatcher-browsing)))) 1359 (vc-dispatcher-browsing))))
1360 (with-current-buffer vc-parent-buffer 1360 (with-current-buffer vc-parent-buffer
1361 (vc-dispatcher-selection-set))) 1361 (vc-dispatcher-selection-set)))
1362 ;; No good set here, throw error 1362 ;; No good set here, throw error
1363 (t (error "No fileset is available here."))))) 1363 (t (error "No fileset is available here")))))
1364 ;; We assume, in order to avoid unpleasant surprises to the user, 1364 ;; We assume, in order to avoid unpleasant surprises to the user,
1365 ;; that a fileset is not in good shape to be handed to the user if the 1365 ;; that a fileset is not in good shape to be handed to the user if the
1366 ;; buffers visiting the fileset don't match the on-disk contents. 1366 ;; buffers visiting the fileset don't match the on-disk contents.
1367 ;; This is actually untrue for operations like `print-log' (or `diff' 1367 ;; This is actually untrue for operations like `print-log' (or `diff'
1368 ;; between two revisions), so maybe this should be moved elsewhere. 1368 ;; between two revisions), so maybe this should be moved elsewhere.
1369 (save-some-buffers 1369 (save-some-buffers
1370 nil (lambda () (vc-dispatcher-in-fileset-p fileset))) 1370 nil (lambda () (vc-dispatcher-in-fileset-p files)))
1371 files)) 1371 files))
1372 1372
1373 ;; arch-tag: 7d08b17f-5470-4799-914b-bfb9fcf6a246 1373 ;; arch-tag: 7d08b17f-5470-4799-914b-bfb9fcf6a246
1374 ;;; vc-dispatcher.el ends here 1374 ;;; vc-dispatcher.el ends here