help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Showing and hiding files in Dired


From: Andreas Politz
Subject: Re: Showing and hiding files in Dired
Date: Fri, 19 Sep 2008 00:10:15 +0200
User-agent: Mozilla-Thunderbird 2.0.0.16 (X11/20080724)

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


reply via email to

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