From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Enila Nero Newsgroups: gmane.emacs.help Subject: Re: hide/show in dired Date: Thu, 24 Jun 2004 23:37:10 GMT Organization: Home Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: Reply-To: geortal@yahoo.com NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1088538523 26699 80.91.224.253 (29 Jun 2004 19:48:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Jun 2004 19:48:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Jun 29 21:48:39 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BfOat-0000Qd-00 for ; Tue, 29 Jun 2004 21:48:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BfOcZ-0005aW-8d for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Jun 2004 15:50:23 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!nwrddc03.gnilink.net.POSTED!372e6f02!not-for-mail Original-Newsgroups: gnu.emacs.help Cancel-Lock: sha1:aG7a4iYCrrSa2rYY7PhOVErEKTA= Original-Lines: 57 Original-NNTP-Posting-Host: 4.43.183.182 Original-X-Complaints-To: abuse@verizon.net Original-X-Trace: nwrddc03.gnilink.net 1088120230 4.43.183.182 (Thu, 24 Jun 2004 19:37:10 EDT) Original-NNTP-Posting-Date: Thu, 24 Jun 2004 19:37:10 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:123946 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19306 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19306 Mathias Dahl writes: > Enila Nero writes: > >> Mathias Dahl writes: >> >> > Enila Nero 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