emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-dispatcher.el,v


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-dispatcher.el,v
Date: Sat, 05 Jul 2008 18:09:34 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/07/05 18:09:33

Index: vc-dispatcher.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-dispatcher.el,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -b -r1.64 -r1.65
--- vc-dispatcher.el    22 Jun 2008 19:04:21 -0000      1.64
+++ vc-dispatcher.el    5 Jul 2008 18:09:31 -0000       1.65
@@ -480,15 +480,25 @@
         (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)
+    (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)))))
+           (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]