GNU bug report logs - #6148
add ability to hide unregistered files in vc-dir

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Mon, 10 May 2010 01:04:02 UTC

Severity: wishlist

Tags: patch

Merged with 12159

Found in version 24.1.50

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Magnus Henoch <magnus.henoch <at> gmail.com>
To: 6148 <at> debbugs.gnu.org
Subject: bug#6148: add ability to hide unregistered files in vc-dir
Date: Mon, 10 May 2010 12:30:26 +0100
This piece of code has been in my .emacs for a while:

(defun my-vc-dir-hide-some (states)
  "Hide files whose state is in STATES."
  (interactive
   (list
    (progn
      (unless vc-ewoc
	(error "Not in a vc-dir buffer"))
      (mapcar 'intern
	      (completing-read-multiple
	       "Hide files that are in state(s): "
	       (let (possible-states)
		 (ewoc-map (lambda (item)
			     (let ((state (vc-dir-fileinfo->state item)))
			       (when state
				 (pushnew state possible-states))
			       nil))
			   vc-ewoc)
		 (mapcar 'symbol-name possible-states))
	       nil t)))))
  (let ((inhibit-read-only t))
    (ewoc-filter vc-ewoc
		 (lambda (file)
		   (not (memq (vc-dir-fileinfo->state file) states))))))
(eval-after-load "vc-dir"
  '(define-key vc-dir-mode-map "H" 'my-vc-dir-hide-some))

-- 
Magnus Henoch




This bug report was last modified 12 years and 279 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.