emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc.el,v


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc.el,v
Date: Tue, 15 Apr 2008 07:28:33 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/04/15 07:28:32

Index: vc.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc.el,v
retrieving revision 1.582
retrieving revision 1.583
diff -u -b -r1.582 -r1.583
--- vc.el       14 Apr 2008 16:36:32 -0000      1.582
+++ vc.el       15 Apr 2008 07:28:30 -0000      1.583
@@ -2714,7 +2714,9 @@
   extra
   marked
   ;; To keep track of not updated files during a global refresh
-  needs-update)
+  needs-update
+  ;; To distinguish files and directories.
+  directoryp)
 
 (defvar vc-status nil)
 
@@ -2738,6 +2740,8 @@
 
 (defun vc-default-status-printer (backend fileentry)
   "Pretty print FILEENTRY."
+  (if (vc-status-fileinfo->directoryp fileentry)
+      (insert "   Directory: %s" (vc-status-fileinfo->name fileentry))
   ;; If you change the layout here, change vc-status-move-to-goal-column.
   (let ((state (vc-status-fileinfo->state fileentry)))
     (insert
@@ -2755,7 +2759,7 @@
      (propertize
       (format "%s" (vc-status-fileinfo->name fileentry))
       'face 'font-lock-function-name-face
-      'mouse-face 'highlight))))
+       'mouse-face 'highlight)))))
 
 (defun vc-status-printer (fileentry)
   (let ((backend (vc-responsible-backend default-directory)))
@@ -3019,9 +3023,18 @@
     ;; Insert the entries sorted by name into the ewoc.
     ;; We assume the ewoc is sorted too, which should be the
     ;; case if we always add entries with vc-status-update.
-    (setq entries (sort entries
+    (setq entries
+         ;; Sort: first files and then subdirectories.
+         ;; XXX: this is VERY inefficient, it computes the directory
+         ;; names too many times
+         (sort entries
                         (lambda (entry1 entry2)
-                          (string-lessp (car entry1) (car entry2)))))
+                 (let ((dir1 (file-name-directory (expand-file-name (car 
entry1))))
+                       (dir2 (file-name-directory (expand-file-name (car 
entry2)))))
+                   (cond
+                    ((string< dir1 dir2) t)
+                    ((not (string= dir1 dir2)) nil)
+                    ((string< (car entry1) (car entry2))))))))
     (let ((entry (car entries))
            (node (ewoc-nth vc-status 0)))
       (while (and entry node)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]