]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-string-prefix-p): New function.
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 27 May 2008 01:13:25 +0000 (01:13 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 27 May 2008 01:13:25 +0000 (01:13 +0000)
(vc-dir-parent-marked-p): Use it.

lisp/ChangeLog
lisp/vc-dispatcher.el

index 5b097d2d8517543455555299dc08e8f725d4a49d..9965fa6a27f7564cf56bfec3886d5ae0a2fa7778 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-27  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * vc-dispatcher.el (vc-string-prefix-p): New function.
+       (vc-dir-parent-marked-p): Use it.
+
 2008-05-27  Dan Nicolaescu  <dann@ics.uci.edu>
 
        * vc.el (Problems): Remove fixed issues.
        (vc-make-backend-object): Fix name.
        (vc-dir-show-fileentry): Fix docstring.
        (vc-dir-refresh): Use vc-dir-backend.  Fix docstring.
-       (vc-dir-refresh-files): Use vc-dir-backend.  Fix docstring.  Reset
-       the state for directories.
+       (vc-dir-refresh-files): Use vc-dir-backend.  Fix docstring.
+       Reset the state for directories.
        (vc-dir-headers): Align labels.
        (vc-default-status-printer): Do no call prettify-state-info.
        (vc-deduce-fileset): Replace implementation with one based on a
        working older version.
-       (vc-next-action): Use the new form of vc-deduce-fileset.  Fix
-       dealing with unregistered files.
+       (vc-next-action): Use the new form of vc-deduce-fileset.
+       Fix dealing with unregistered files.
 
        * vc-dispatcher.el (vc-resynch-window): Fix mode-line updating.
        (vc-dir-menu-map): Fix menu title for the menu bar and the popup menu.
index 8e9cf21d3c774b7856250bdfba85e00449152939..116e9476bf3decf9fecf7d1765448c0e21a235af 100644 (file)
@@ -1024,6 +1024,10 @@ If a prefix argument is given, move by that many lines."
            (funcall mark-unmark-function))))
     (funcall mark-unmark-function)))
 
+(defun vc-string-prefix-p (prefix string)
+  (and (>= (length string) (length prefix))
+       (eq t (compare-strings prefix nil nil string nil (length prefix)))))
+
 (defun vc-dir-parent-marked-p (arg)
   ;; Return nil if none of the parent directories of arg is marked.
   (let* ((argdir (vc-dir-node-directory arg))
@@ -1036,7 +1040,7 @@ If a prefix argument is given, move by that many lines."
       (setq data (ewoc-data crt))
       (setq dir (vc-dir-node-directory crt))
       (when (and (vc-dir-fileinfo->directory data)
-                (string-equal (substring argdir 0 (length dir)) dir))
+                (vc-string-prefix-p dir argdir))
        (when (vc-dir-fileinfo->marked data)
          (error "Cannot mark `%s', parent directory `%s' marked"
                 (vc-dir-fileinfo->name (ewoc-data arg))