all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Andreas Politz <politza@fh-trier.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Showing and hiding files in Dired
Date: Fri, 19 Sep 2008 00:10:15 +0200	[thread overview]
Message-ID: <1221776025.788168@arno.fh-trier.de> (raw)
In-Reply-To: <mailman.19503.1221774483.18990.help-gnu-emacs@gnu.org>

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	other threads:[~2008-09-18 22:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.19503.1221774483.18990.help-gnu-emacs@gnu.org>
2008-09-18 22:10 ` Andreas Politz [this message]
2008-09-18 21:47 Showing and hiding files in Dired Corey Foote
2008-09-18 22:40 ` Peter Dyballa
2008-09-18 22:42 ` Drew Adams
2008-09-19  8:24 ` Tassilo Horn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1221776025.788168@arno.fh-trier.de \
    --to=politza@fh-trier.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.