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

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

RE: Filesets question


From: Drew Adams
Subject: RE: Filesets question
Date: Tue, 2 Dec 2008 22:28:30 -0800

> I'm having an issue with filesets: I can create a "pattern" type
> fileset that works fine, but the moment I change the type to
> "directory tree" (what I actually want), it tells me the fileset does
> not exist. So far as I know, the settings for pattern vs directory
> tree should be exactly the same: a directory name to act as root, and
> a regex to find files. But when I use the "pattern" type, it finds all
> the appropriate files under the root directory, and when I use the
> "directory tree" type, it finds nothing at all. I've tried editing the
> settings via the customize buffer and directly in .emacs, and the
> results are the same. Can someone please take a look at this and tell
> me what I'm doing wrong? All I want is a fileset containing all .py
> files in "myrootdir" and below.
> 
> '(filesets-data (quote (("pr" (:tree "~/dev/myrootdir" "^.+\\.py$")))))

A value of (("pr" (:tree "~/dev/myrootdir" "^.+\\.py$"))) for `filesets-data'
looks OK to me. But I don't recognize the form you have: a list starting with
`filesets-data' (unless that is supposed to be a `let' binding). If I use
Customize on `filesets-data' and create such a value, it works for me.

What you should see, if you give `filesets-data' a value of
(("pr" (:tree "~/dev/myrootdir" "^.+\\.py$"))):

When you choose the submenu Filesets > pr you should see menu entries for each
of the files in ~/dev/myrootdir that have extension py, and you should see
submenus for each of the subdirectories. In those submenus you should see
similar matching files from the subdirectories or more submenus (for
subsubdirectories), and so on. 

IOW, the pr menu and its submenus should _together_ lead you to all of the files
under ~/dev/myrootdir that have extension py. The fileset is not manifested as a
single flat set of files; instead, the files are available only interactively
and individually, and only via a hierarchy of menus.

If you do get the behavior I just described, but you expected something
different (e.g. all of the files in a single explicit set), then see below,
after the line (----). Else, maybe someone else can help. 

If you don't get the above behavior, it's possible that you have an old version
of filesets.el. This is the author's Filesets site:
http://members.a1.net/t.link/CompEmacsFilesets.html. However, I just tried with
vanilla Emacs 22.3 (-q), and it seems to do what I described above.

----

You might want to take a look at this bug report, especially the last message in
the thread, by Tom Link (filesets author):
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=976

Excerpts:

 :tree rebuilds a directory structure in the menu. It isn't
 supposed to collect all files in a directory recursively
 into a single fileset. So, every directory corresponds to
 one "virtual" fileset.

 > The attached code might help you in fixing this
 If I understand it right, this code tries to achieve something
 slightly different in collecting all files under a directory
 in one single fileset. Interesting idea.

These bug reports might also be helpful (dunno):
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=965
http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=977

This is related, but it doesn't directly respond to your question:
http://www.emacswiki.org/emacs/Icicles_-_Persistent_Completions#toc5.
It lets you combine filesets into supersets, and it lets you use patterns to
define a single set of files under (not just in) a directory (which is what bug
#976 says :tree should do but doesn't). If you need to manifest a list of files
under a directory that match your pattern, this will do that.

HTH.





reply via email to

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