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-dir.el,v


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-dir.el,v
Date: Sat, 28 Jun 2008 07:30:51 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   08/06/28 07:30:50

Index: vc-dir.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-dir.el,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- vc-dir.el   27 Jun 2008 23:29:15 -0000      1.6
+++ vc-dir.el   28 Jun 2008 07:30:46 -0000      1.7
@@ -478,11 +478,6 @@
            (funcall mark-unmark-function))))
     (funcall mark-unmark-function)))
 
-(defun vc-string-prefix-p (prefix string)
-  (let ((lpref (length prefix)))
-    (and (>= (length string) lpref)
-        (eq t (compare-strings prefix nil nil string nil lpref)))))
-
 (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))
@@ -938,9 +933,29 @@
 (defun vc-dir-hide-up-to-date ()
   "Hide up-to-date items from display."
   (interactive)
-  (ewoc-filter
-   vc-ewoc
-   (lambda (crt) (not (eq (vc-dir-fileinfo->state crt) 'up-to-date)))))
+  (let ((crt (ewoc-nth vc-ewoc -1))
+       (first (ewoc-nth vc-ewoc 0)))
+    ;; Go over from the last item to the first and remove the
+    ;; up-to-date files and directories with no child files.
+    (while (not (eq crt first))
+      (let* ((data (ewoc-data crt))
+            (dir (vc-dir-fileinfo->directory data))
+            (next (ewoc-next vc-ewoc crt))
+            (prev (ewoc-prev vc-ewoc crt))
+            ;; ewoc-delete does not work without this...
+            (inhibit-read-only t))
+         (when (or
+                ;; Remove directories with no child files.
+                (and dir
+                     (or
+                      ;; Nothing follows this directory.
+                      (not next)
+                      ;; Next item is a directory.
+                      (vc-dir-fileinfo->directory (ewoc-data next))))
+                ;; Remove files in the up-to-date state.
+                (eq (vc-dir-fileinfo->state data) 'up-to-date))
+           (ewoc-delete vc-ewoc crt))
+         (setq crt prev)))))
 
 (defun vc-dir-status-printer (fileentry)
   (vc-call-backend vc-dir-backend 'status-printer fileentry))




reply via email to

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