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

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

Re: hide/show in dired


From: Enila Nero
Subject: Re: hide/show in dired
Date: Thu, 24 Jun 2004 23:37:10 GMT

Mathias Dahl <address@hidden> writes:

> Enila Nero <address@hidden> writes:
>
>> Mathias Dahl <address@hidden> writes:
>> 
>> > Enila Nero <address@hidden> writes:
>> >
>> >> I have looked around for hide/show functionality in dired, but
>> >> couldn't find anything.  What I mean, is to be able to give a regexp
>> >> and dired would limit the display to matching files only.  Then, to be
>> >> able to redisplay all the files.
>> >> 
>> >> This behavior would analogous to gnus-summary-limit-to-* and
>> >> gnus-summary-pop-limit in gnus, where articles are hidden and then
>> >> popped. 
>> >> 
>> >> The closest functionality I found is the dired-omit-extensions in
>> >> dired-x.el and dired-wipe.el, but don't quite have the above
>> >> behavior. 
>> >
>> > You might find the following links useful:
>> >
>> > * 
>> > http://www.gnu.org/software/emacs/manual/html_node/Dired-and-Find.html#Dired%20and%20Find
>> > * 
>> > http://www.gnu.org/software/emacs/manual/html_node/Dired-Updating.html#Dired%20Updating
>> >
>> > /Mathias
>> 
>> Thank you for the useful links.  Certainly there is a lot of related
>> functionality there.  To do exactly what I asked:
>> 
>> % m regexp   (to mark all files matching a regular expression)
>> 
>> kill-all-unmarked-file-lines  (couldn't find such functionality)
>
> Maybe you could use the toggle command (t) first which would
> mark all unmarked lines, and then use the kill command?
>
> /Mathias

Yes. Thank you for the help.  I arrived at the following function which
seems to be doing what I wanted.  I am sure it can be made more robust
and be improved upon.  To redisplay the directory and one simply has
to do "g".

(defun en-dired-limit-regexp (regexp) 
  "Limit dired display to files matching a regular expression"
  (interactive
   (list (dired-read-regexp "Regexp: ")))
  (progn
    (dired-mark-files-regexp regexp)
    (dired-toggle-marks)
    (dired-do-kill-lines)
    ))


Enila


reply via email to

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