diff options
author | Dan Nicolaescu <dann@ics.uci.edu> | 2009-02-25 04:00:08 +0000 |
---|---|---|
committer | Dan Nicolaescu <dann@ics.uci.edu> | 2009-02-25 04:00:08 +0000 |
commit | 02ffe8e3ab1b10e1aa6c7f1ac7c011a3207ad42d (patch) | |
tree | 62f44b6136a2cd1422d998d042fa679eebbb6320 /lisp/vc-dir.el | |
parent | bd6e492c7cf859a74027ff933a11494da8e6b8d9 (diff) |
(vc-dir-update): Make sure ./ is always first in the listing.
Diffstat (limited to 'lisp/vc-dir.el')
-rw-r--r-- | lisp/vc-dir.el | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el index 93e081c0f9..d2414f9172 100644 --- a/lisp/vc-dir.el +++ b/lisp/vc-dir.el @@ -351,13 +351,13 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." ((string< (car entry1) (car entry2)))))))) ;; Insert directory entries in the right places. (let ((entry (car entries)) - (node (ewoc-nth vc-ewoc 0))) + (node (ewoc-nth vc-ewoc 0)) + (dotname (file-relative-name default-directory))) ;; Insert . if it is not present. (unless node - (let ((rd (file-relative-name default-directory))) - (ewoc-enter-last - vc-ewoc (vc-dir-create-fileinfo - rd nil nil nil (expand-file-name default-directory)))) + (ewoc-enter-last + vc-ewoc (vc-dir-create-fileinfo + dotname nil nil nil (expand-file-name default-directory))) (setq node (ewoc-nth vc-ewoc 0))) (while (and entry node) @@ -372,6 +372,8 @@ If NOINSERT, ignore elements on ENTRIES which are not in the ewoc." ;; Found the directory, find the place for the file name. (let ((nodefile (vc-dir-fileinfo->name (ewoc-data node)))) (cond + ((string= nodefile dotname) + (setq node (ewoc-next vc-ewoc node))) ((string-lessp nodefile entryfile) (setq node (ewoc-next vc-ewoc node))) ((string-equal nodefile entryfile) |