diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-27 01:13:25 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-27 01:13:25 +0000 |
commit | 08b95b1f43603ec1fdc63cfe9ac79e41cdaca6ae (patch) | |
tree | 538592da55004d40400c1afc1c27e5642f0801a9 /lisp/vc-dispatcher.el | |
parent | 022ce115496134dedb625d0fe2c3a53c9eb0b3d6 (diff) | |
download | emacs-08b95b1f43603ec1fdc63cfe9ac79e41cdaca6ae.tar.gz |
(vc-string-prefix-p): New function.
(vc-dir-parent-marked-p): Use it.
Diffstat (limited to 'lisp/vc-dispatcher.el')
-rw-r--r-- | lisp/vc-dispatcher.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el index 8e9cf21d3c7..116e9476bf3 100644 --- a/lisp/vc-dispatcher.el +++ b/lisp/vc-dispatcher.el @@ -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)) |