From: Stefan Monnier Date: Mon, 16 Jun 2008 20:36:55 +0000 (+0000) Subject: (vc-dir-child-files): Use vc-string-prefix-p. X-Git-Tag: emacs-pretest-23.0.90~4720 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7b74a6f9f0da0023dfb1aefab6d064f3587da4a4;p=emacs.git (vc-dir-child-files): Use vc-string-prefix-p. (vc-dir-marked-only-files): vc-string-prefix-p. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f5118a38210..d8f54c5979a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-06-16 Stefan Monnier + + * 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 * progmodes/gdb-ui.el (gdb-memory-set-address) @@ -7,7 +12,7 @@ 2008-06-16 Derek Upham (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 diff --git a/lisp/vc-dispatcher.el b/lisp/vc-dispatcher.el index 066e45f08cc..c21be117f18 100644 --- a/lisp/vc-dispatcher.el +++ b/lisp/vc-dispatcher.el @@ -1258,13 +1258,10 @@ that share the same state." 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 @@ that share the same state." 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 @@ If it is a file, return the file itself." (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.