diff lisp/vc.el @ 106888:70822719735d

(with-vc-properties): Deal with directory arguments. (Bug#5298)
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 17 Jan 2010 13:31:25 -0800
parents 1d1d5d9bd884
children 1918e70c8b37 6dc6d78ccf45
line wrap: on
line diff
--- a/lisp/vc.el	Sun Jan 17 12:36:21 2010 -0800
+++ b/lisp/vc.el	Sun Jan 17 13:31:25 2010 -0800
@@ -791,13 +791,23 @@
 
 (defmacro with-vc-properties (files form settings)
   "Execute FORM, then maybe set per-file properties for FILES.
+If any of FILES is actually a directory, then do the same for all
+buffers for files in that directory.
 SETTINGS is an association list of property/value pairs.  After
 executing FORM, set those properties from SETTINGS that have not yet
 been updated to their corresponding values."
   (declare (debug t))
-  `(let ((vc-touched-properties (list t)))
+  `(let ((vc-touched-properties (list t))
+	 (flist nil))
+     (dolist (file ,files)
+       (if (file-directory-p file)
+	   (dolist (buffer (buffer-list))
+	     (let ((fname (buffer-file-name buffer)))
+	       (when (and fname (vc-string-prefix-p file fname))
+		 (push fname flist))))
+	 (push file flist)))
      ,form
-     (dolist (file ,files)
+     (dolist (file flist)
        (dolist (setting ,settings)
          (let ((property (car setting)))
            (unless (memq property vc-touched-properties)