From 424ce3bd4685791ef527976cd3d4b457c45709c1 Mon Sep 17 00:00:00 2001 From: Sam Steingold Date: Fri, 20 Jun 2008 15:50:16 +0000 Subject: [PATCH] (vc-dir-hide-up-to-date): Accept a prefix argument to also remove DIRECTORY entries. --- lisp/ChangeLog | 5 +++++ lisp/vc.el | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4e50b09539e..b5f5e1684b9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-06-20 Sam Steingold + + * vc.el (vc-dir-hide-up-to-date): Accept a prefix argument to also + remove DIRECTORY entries. + 2008-06-20 Eli Zaretskii * makefile.w32-in (distclean): Depend on `clean'. diff --git a/lisp/vc.el b/lisp/vc.el index 0507bf72130..c8a5c9785a4 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -2014,12 +2014,17 @@ outside of VC) and one wants to do some operation on it." (interactive "fShow file: ") (vc-dir-update (list (list (file-relative-name file) (vc-state file))) (current-buffer))) -(defun vc-dir-hide-up-to-date () - "Hide up-to-date items from display." - (interactive) +(defun vc-dir-hide-up-to-date (&optional drop-directory) + "Hide up-to-date items from display. +With a prefix argument, also drop DIRECTORY entries." + (interactive "P") (ewoc-filter vc-ewoc - (lambda (crt) (not (eq (vc-dir-fileinfo->state crt) 'up-to-date))))) + (if drop-directory + (lambda (crt) + (not (or (eq (vc-dir-fileinfo->state crt) 'up-to-date) + (vc-dir-fileinfo->directory crt)))) + (lambda (crt) (not (eq (vc-dir-fileinfo->state crt) 'up-to-date)))))) (defun vc-default-status-fileinfo-extra (backend file) "Default absence of extra information returned for a file." -- 2.39.2