changeset 96018:47c289fef3ec

(vc-dir-child-files): Use vc-string-prefix-p. (vc-dir-marked-only-files): vc-string-prefix-p.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 16 Jun 2008 20:36:55 +0000
parents 54d310663505
children 6cece6cbe017
files lisp/ChangeLog lisp/vc-dispatcher.el
diffstat 2 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Jun 16 19:11:02 2008 +0000
+++ b/lisp/ChangeLog	Mon Jun 16 20:36:55 2008 +0000
@@ -1,3 +1,8 @@
+2008-06-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-dispatcher.el (vc-dir-child-files): Use vc-string-prefix-p.
+	(vc-dir-marked-only-files): vc-string-prefix-p.
+
 2008-06-16  Nick Roberts  <nickrob@snap.net.nz>
 
 	* progmodes/gdb-ui.el (gdb-memory-set-address)
@@ -7,7 +12,7 @@
 
 2008-06-16  Derek Upham  <sand@blarg.net>  (tiny change)
 
-        * nxml/nxml-mode.el (nxml-mode): Use run-mode-hooks.
+	* nxml/nxml-mode.el (nxml-mode): Use run-mode-hooks.
 
 2008-06-16  Juanma Barranquero  <lekktu@gmail.com>
 
--- a/lisp/vc-dispatcher.el	Mon Jun 16 19:11:02 2008 +0000
+++ b/lisp/vc-dispatcher.el	Mon Jun 16 20:36:55 2008 +0000
@@ -1258,13 +1258,10 @@
 		       data)
 		  (while
 		      (and (setq crt (ewoc-next vc-ewoc crt))
-			   (string-equal
-			    (substring
-			     (progn
-			       (setq data (ewoc-data crt))
-			       (vc-dir-node-directory crt))
-			     0 dirlen)
-			    dir))
+			   (vc-string-prefix-p dir
+                                               (progn
+                                                 (setq data (ewoc-data crt))
+                                                 (vc-dir-node-directory crt))))
 		    (unless (vc-dir-fileinfo->directory data)
 		      (push (expand-file-name (vc-dir-fileinfo->name data)) result))))
 	      (push (expand-file-name (vc-dir-fileinfo->name crt-data)) result)
@@ -1277,20 +1274,16 @@
 If it is a file, return the file itself."
   (let* ((crt (ewoc-locate vc-ewoc))
 	 (crt-data (ewoc-data crt))
-	 result)
+         result)
     (if (vc-dir-fileinfo->directory crt-data)
 	(let* ((dir (vc-dir-fileinfo->directory crt-data))
 	       (dirlen (length dir))
 	       data)
 	  (while
 	      (and (setq crt (ewoc-next vc-ewoc crt))
-		   (string-equal
-		    (substring
-		     (progn
-		       (setq data (ewoc-data crt))
-		       (vc-dir-node-directory crt))
-		     0 dirlen)
-		    dir))
+                   (vc-string-prefix-p dir (progn
+                                             (setq data (ewoc-data crt))
+                                             (vc-dir-node-directory crt))))
 	    (unless (vc-dir-fileinfo->directory data)
 	      (push (expand-file-name (vc-dir-fileinfo->name data)) result))))
       (push (expand-file-name (vc-dir-fileinfo->name crt-data)) result))
@@ -1315,19 +1308,21 @@
 	      (let ((ddir (expand-file-name default-directory)))
 		(when (vc-string-prefix-p ddir file)
 		  (let*
+                      ;; FIXME: Any reason we don't use file-relative-name?
 		      ((file-short (substring file (length ddir)))
-		       (state
-			(funcall (vc-client-object->file-to-state vc-client-mode)
+		       (state (funcall (vc-client-object->file-to-state
+                                        vc-client-mode)
 				 file))
-		       (extra
-			(funcall (vc-client-object->file-to-extra vc-client-mode)
+		       (extra (funcall (vc-client-object->file-to-extra
+                                        vc-client-mode)
 				 file))
 		       (entry
 			(list file-short state extra)))
 		    (vc-dir-update (list entry) status-buf))))))
 	  ;; We didn't find any vc-dir buffers, remove the hook, it is
 	  ;; not needed.
-	  (unless found-vc-dir-buf (remove-hook 'after-save-hook 'vc-dir-resynch-file)))))))
+	  (unless found-vc-dir-buf
+            (remove-hook 'after-save-hook 'vc-dir-resynch-file)))))))
 
 (defun vc-dir-mode (client-object)
   "Major mode for dispatcher directory buffers.