emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r99365: (with-vc-properties): Deal wi


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99365: (with-vc-properties): Deal with directory arguments. (Bug#5298)
Date: Sun, 17 Jan 2010 13:31:25 -0800
User-agent: Bazaar (2.0.2)

------------------------------------------------------------
revno: 99365
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Sun 2010-01-17 13:31:25 -0800
message:
  (with-vc-properties): Deal with directory arguments.  (Bug#5298)
modified:
  lisp/ChangeLog
  lisp/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-01-17 20:36:21 +0000
+++ b/lisp/ChangeLog    2010-01-17 21:31:25 +0000
@@ -1,5 +1,7 @@
 2010-01-17  Dan Nicolaescu  <address@hidden>
 
+       * vc.el (with-vc-properties): Deal with directory arguments.  (Bug#5298)
+
        * vc-dir.el (vc-dir-resynch-file): Update the vc-dir header when
        resyncing a directory.
 

=== modified file 'lisp/vc.el'
--- a/lisp/vc.el        2010-01-13 08:35:10 +0000
+++ b/lisp/vc.el        2010-01-17 21:31:25 +0000
@@ -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)


reply via email to

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