summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2009-02-25 04:00:08 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2009-02-25 04:00:08 +0000
commit7c11a02bbf03f3a973ffbd413c9adc4f2b2815a9 (patch)
tree9e57930f7b3eaa5572a4326c3b3668776ef19b07
parentdc72959ec108958b3d64d3693afb44e597275694 (diff)
downloademacs-7c11a02bbf03f3a973ffbd413c9adc4f2b2815a9.tar.gz
(vc-dir-update): Make sure ./ is always first in the listing.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc-dir.el12
2 files changed, 12 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 211b30a882e..187a497b541 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,6 +1,10 @@
+2009-02-25 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * vc-dir.el (vc-dir-update): Make sure ./ is always first in the listing.
+
2009-02-25 David Reitter <david.reitter@gmail.com>
- * mail/mailclient.el: declare clipboard-kill-ring-save
+ * mail/mailclient.el (clipboard-kill-ring-save): Declare.
2009-02-25 Kenichi Handa <handa@m17n.org>
diff --git a/lisp/vc-dir.el b/lisp/vc-dir.el
index 93e081c0f9b..d2414f9172f 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)