]> code.delx.au - gnu-emacs/blobdiff - lisp/vc-dispatcher.el
term/ns-win.el (composition-function-table) (script-representative-chars): Don't...
[gnu-emacs] / lisp / vc-dispatcher.el
index 6a91ac343d503b60ea33740e86838e6731c5074b..c51a4896b7649b5d08d12fa5d77afe85b8d40543 100644 (file)
@@ -1,6 +1,6 @@
 ;;; vc-dispatcher.el -- generic command-dispatcher facility.
 
-;; Copyright (C) 2008
+;; Copyright (C) 2008, 2009
 ;;   Free Software Foundation, Inc.
 
 ;; Author:     FSF (see below for full credits)
@@ -324,9 +324,6 @@ that is inserted into the command line before the filename."
                             (mapconcat 'identity vc-path path-separator))
                     process-environment))
              (w32-quote-process-args t))
-         (when (and (eq okstatus 'async) (file-remote-p default-directory))
-           ;; start-process does not support remote execution
-           (setq okstatus nil))
          (if (eq okstatus 'async)
              ;; Run asynchronously.
              (let ((proc
@@ -480,15 +477,25 @@ editing!"
         (kill-buffer (current-buffer)))))
 
 (declare-function vc-dir-resynch-file "vc-dir" (&optional fname))
+(declare-function vc-string-prefix-p "vc" (prefix string))
+
+(defun vc-resynch-buffers-in-directory (directory &optional keep noquery)
+  "Resync all buffers that visit files in DIRECTORY."
+  (dolist (buffer (buffer-list))
+    (let ((fname (buffer-file-name buffer)))
+      (when (and fname (vc-string-prefix-p directory fname))
+       (vc-resynch-buffer fname keep noquery)))))
 
 (defun vc-resynch-buffer (file &optional keep noquery)
   "If FILE is currently visited, resynch its buffer."
   (if (string= buffer-file-name file)
       (vc-resynch-window file keep noquery)
-    (let ((buffer (get-file-buffer file)))
-      (when buffer
-       (with-current-buffer buffer
-         (vc-resynch-window file keep noquery)))))
+    (if (file-directory-p file)
+       (vc-resynch-buffers-in-directory file keep noquery)
+      (let ((buffer (get-file-buffer file)))
+       (when buffer
+         (with-current-buffer buffer
+           (vc-resynch-window file keep noquery))))))
   ;; Try to avoid unnecessary work, a *vc-dir* buffer is only present
   ;; if this is true.
   (when (memq 'vc-dir-resynch-file after-save-hook)