master 13ce6f30832: Make vc-dir-hide-state ignore the states of directory entries

Sean Whitton <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 13ce6f30832459d024b18fc5fcb455060646da09
Author: Sean Whitton <[email protected]>
Commit: Sean Whitton <[email protected]>

    Make vc-dir-hide-state ignore the states of directory entries
    
    * lisp/vc/vc-dir.el (vc-dir-hide-state): Don't consider
    directory entries when removing based on state.
    (vc-dir-refresh-files): Remove old workaround.
---
 lisp/vc/vc-dir.el | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

diff --git a/lisp/vc/vc-dir.el b/lisp/vc/vc-dir.el
index 393a2ebdbc3..3d8e73a143d 100644
--- a/lisp/vc/vc-dir.el
+++ b/lisp/vc/vc-dir.el
@@ -1666,17 +1666,8 @@ specific headers."
                ;; file/dir doesn't exist and isn't versioned.
                (ewoc-filter vc-ewoc
                             (lambda (info)
-			      ;; The state for directory entries might
-			      ;; have been changed to 'up-to-date,
-			      ;; reset it, otherwise it will be removed when doing 'x'
-			      ;; next time.
-			      ;; FIXME: There should be a more elegant way to do this.
-			      (when (and (vc-dir-fileinfo->directory info)
-					 (eq (vc-dir-fileinfo->state info)
-					     'up-to-date))
-				(setf (vc-dir-fileinfo->state info) nil))
-
-                              (not (vc-dir-fileinfo->needs-update info))))))))))))
+                              (not
+                               (vc-dir-fileinfo->needs-update info))))))))))))
 
 (defun vc-dir-revert-buffer-function (&optional _ignore-auto _noconfirm)
   (vc-dir-refresh)
@@ -1782,10 +1773,11 @@ state of item at point, if any."
 		     (vc-dir-fileinfo->directory (ewoc-data next))))
 	       ;; Remove files in specified STATE.  STATE can be a
 	       ;; symbol, a user-name, or nil.
-               (let ((data-state (vc-dir-fileinfo->state data)))
-                 (if state
-                     (equal data-state state)
-                   (memq data-state vc-dir--up-to-date-states))))
+               (and (not dir)
+                    (let ((data-state (vc-dir-fileinfo->state data)))
+                      (if state
+                          (equal data-state state)
+                        (memq data-state vc-dir--up-to-date-states)))))
 	  (ewoc-delete vc-ewoc crt))
 	(setq crt prev)))))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.