Re: Showing and hiding files in Dired
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

 Up
Re: Showing and hiding files in Dired         

Group: gnu.emacs.help · Group Profile
Author: Andreas Politz
Date: Sep 18, 2008 15:10

Corey Foote wrote:
>
>
>
>
>
>
> Is there away to filter the directory list provided by Dired
> by showing or hiding all files which match a regular expression? Say I just
> wanted to see files in the current directory which ended with .html.
>
> Thanks for everything!
>
>
>
>
>
> - Corey Foote
> Toby Software LLC
>
>

Here is one way :

1. Mark all files you want to see with `%%m'
2. Inverse the marks via `*t'
3. Invoke `dired-do-kill-lines' with `k'
4. Reset the listing with `g'

Wrapped up in a function :

(defun dired-show-only (regexp)
(interactive "sFiles to show (regexp): ")
(dired-mark-files-regexp regexp)
(dired-toggle-marks)
(dired-do-kill-lines))

(define-key dired-mode-map [?%%?h] 'dired-show-only)

-ap
no comments
diggit! del.icio.us! reddit!