unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Enila Nero <geortal@yahoo.com>
Subject: Re: hide/show in dired
Date: Thu, 24 Jun 2004 23:37:10 GMT	[thread overview]
Message-ID: <ud63omswa.fsf@yahoo.com> (raw)
In-Reply-To: upt7qolnd.fsf@hotmail.com

Mathias Dahl <brakjoller@hotmail.com> writes:

> Enila Nero <geortal@yahoo.com> writes:
>
>> Mathias Dahl <brakjoller@hotmail.com> writes:
>> 
>> > Enila Nero <geortal@yahoo.com> 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	other threads:[~2004-06-24 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-20 20:21 hide/show in dired Enila Nero
2004-06-21 17:55 ` Mathias Dahl
2004-06-22 23:50   ` Enila Nero
2004-06-23  6:04     ` Mathias Dahl
2004-06-24 23:37       ` Enila Nero [this message]
2004-06-30 15:38 ` Kai Grossjohann

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=ud63omswa.fsf@yahoo.com \
    --to=geortal@yahoo.com \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).