all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Showing and hiding files in Dired
@ 2008-09-18 21:47 Corey Foote
  2008-09-18 22:40 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Corey Foote @ 2008-09-18 21:47 UTC (permalink / raw)
  To: help-gnu-emacs

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]








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


_________________________________________________________________
Get more out of the Web. Learn 10 hidden secrets of Windows Live.
http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008

[-- Attachment #2: Type: text/html, Size: 802 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Showing and hiding files in Dired
       [not found] <mailman.19503.1221774483.18990.help-gnu-emacs@gnu.org>
@ 2008-09-18 22:10 ` Andreas Politz
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Politz @ 2008-09-18 22:10 UTC (permalink / raw)
  To: help-gnu-emacs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Showing and hiding files in Dired
  2008-09-18 21:47 Corey Foote
@ 2008-09-18 22:40 ` Peter Dyballa
  2008-09-18 22:42 ` Drew Adams
  2008-09-19  8:24 ` Tassilo Horn
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Dyballa @ 2008-09-18 22:40 UTC (permalink / raw)
  To: Corey Foote; +Cc: help-gnu-emacs


Am 18.09.2008 um 23:47 schrieb Corey Foote:

> 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.

Dired-x offers some extras ...

--
Greetings

   Pete

Atheism is a non prophet organization.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Showing and hiding files in Dired
  2008-09-18 21:47 Corey Foote
  2008-09-18 22:40 ` Peter Dyballa
@ 2008-09-18 22:42 ` Drew Adams
  2008-09-19  8:24 ` Tassilo Horn
  2 siblings, 0 replies; 5+ messages in thread
From: Drew Adams @ 2008-09-18 22:42 UTC (permalink / raw)
  To: 'Corey Foote', help-gnu-emacs

> From: Corey Foote Sent: Thursday, September 18, 2008 2:48 PM
> 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.
	
[Please use plain-text, not HTML, for mail to the mailing list.]

Yes, there are several ways to do that. Here are a few. Other people will
perhaps add others.

1. You can open Dired on just the files that match a shell globbing pattern. For
example, `C-x d f*.html' opens Dired on only files that start with `f' and end
with `.html'. This is not using a regexp, but it is sufficient for your
particular request.

2. The rest of the items here work with the marked files in Dired. So first use
`% m' to mark the files you want using a regexp. `% m' acts on all files in the
Dired buffer, including files in inserted subdirectories.

3. Library `dired-aux.el' gives you command `dired-do-kill-lines', which is
bound to `k'. It hides (omits, "kills") the (lines for the) files that are
marked. Use `l' or `g' to show the (hidden) marked files again. Again, marked
files in included subdirs are omitted too.

4. If you use library `dired+.el', then `dired-do-kill-lines' is also available
in the `Mark' menu as item `Omit Marked'. You can also use item `Omit Unmarked'
to omit all except the marked files (same as `t k t': toggle marked/unmarked,
then omit marked, then toggle again).

5. `dired+.el' also provides command `diredp-marked', which lets you open a
Dired buffer on just the marked files. In the menu, this is `Dired Marked Files'
or `Dired Marked Files in Other Window'. The other-window form is bound to
`C-M-*'. With this command, only the files that were marked will be present in
the new Dired buffer.
http://www.emacswiki.org/cgi-bin/wiki/DiredPlus

6. If you use Icicles, you can easily open Dired on a set of files from any
directories (not necessarily in the same directory tree). This is handy for
working on a project that spans directories. Define your project files once,
save that definition persistently, then open the project in Dired at any time.
You can also use combinations of Emacs filesets to define such a project.
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Dired_Enhancements

BTW, `dired-do-grep' (also in `dired+.el'), bound to `M-g' in Dired, lets you
`grep' just the marked files or all of the files present in Dired.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Showing and hiding files in Dired
  2008-09-18 21:47 Corey Foote
  2008-09-18 22:40 ` Peter Dyballa
  2008-09-18 22:42 ` Drew Adams
@ 2008-09-19  8:24 ` Tassilo Horn
  2 siblings, 0 replies; 5+ messages in thread
From: Tassilo Horn @ 2008-09-19  8:24 UTC (permalink / raw)
  To: help-gnu-emacs

Corey Foote <coreyfoote@hotmail.com> writes:

Hi Corey,

> Is there away to filter the directory list provided by Dired by
> showing or hiding all files which match a regular expression?

Sure, it's emacs.  You can use `dired-omit-mode' which in in
dired-x.el.  Here's my setup:

--8<---------------cut here---------------start------------->8---
(require 'dired-x)
(setq dired-omit-files
      (rx (or (seq bol (? ".") "#")         ;; emacs autosave files
              (seq bol "." (not (any "."))) ;; dot-files
              (seq "~" eol)                 ;; backup-files
              (seq bol "CVS" eol)           ;; CVS dirs
              )))

(setq dired-omit-extensions
      (append dired-latex-unclean-extensions
              dired-bibtex-unclean-extensions
              dired-texinfo-unclean-extensions))

(add-hook 'dired-mode-hook (lambda () (dired-omit-mode 1)))
--8<---------------cut here---------------end--------------->8---

With `M-o' you cat toggle the mode.

Hope that helps,
Tassilo





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-09-19  8:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.19503.1221774483.18990.help-gnu-emacs@gnu.org>
2008-09-18 22:10 ` Showing and hiding files in Dired Andreas Politz
2008-09-18 21:47 Corey Foote
2008-09-18 22:40 ` Peter Dyballa
2008-09-18 22:42 ` Drew Adams
2008-09-19  8:24 ` Tassilo Horn

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.