Received: (at unknown) by unknown; unknown X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-4.0 required=4.0 tests=BAYES_00 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 976) by emacsbugs.donarmstrong.com; 19 Sep 2008 07:58:39 +0000 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id m8J7wYPC016610 for <976 <at> emacsbugs.donarmstrong.com>; Fri, 19 Sep 2008 00:58:35 -0700 Received: (qmail invoked by alias); 19 Sep 2008 07:58:27 -0000 Received: from mk090152180002.a1.net (EHLO [90.152.180.2]) [90.152.180.2] by mail.gmx.net (mp007) with SMTP; 19 Sep 2008 09:58:27 +0200 X-Authenticated: #6654488 X-Provags-ID: V01U2FsdGVkX19WSrsvHqZWmhULgl9cPvDVPRyPVcaMtRItDhwiw8 ihqhD1/h3ZTAf/ Message-ID: <48D35BA1.9060602 <at> gmx.at> Date: Fri, 19 Sep 2008 09:58:25 +0200 From: Thomas Link <t.link <at> gmx.at> User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: cyd <at> MIT.EDU CC: 976 <at> debbugs.gnu.org, drew.adams <at> oracle.com Subject: Re: 23.0.60; incorrect code for filesets-get-filelist References: <20080919000709.s4thfhu7pqo84kwk <at> webmail.mit.edu> In-Reply-To: <20080919000709.s4thfhu7pqo84kwk <at> webmail.mit.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.55 cyd <at> MIT.EDU wrote: > Hi Thomas, > > Could you take a look at the following bug report about filesets.el? > > http://debbugs.gnu.org/cgi/bugreport.cgi?bug= Since I don't have emacs accessible right now I'm not sure my comment are of much help. What I'm writing below is based on how I remember the code worked. > ((:tree) > ;;well, the way trees are handled is a mess +++ > (let* ((dirpatt (if (consp (nth 1 entry)) > (filesets-entry-get-tree entry) > entry)) > (dir (nth 0 dirpatt)) > (patt (nth 1 dirpatt))) > (filesets-list-dir dir patt ':files t))) > > However, I think the following would be sufficient: > > ((:tree) > (let* ((dirpatt (filesets-entry-get-tree entry)) > (dir (nth 0 dirpatt)) > (patt (nth 1 dirpatt))) > (filesets-directory-files dir patt ':files t))) > It's possible this could be explained with my effort to maintain backward-compatibility with older versions of filesets with regard to values defined via the defcustom interface. Or maybe a problem with filesets-build-dir-submenu-now? > The original code is completely broken Well, it definitely worked for me when I last tried it -- but that was 4 years ago. I rememb > In my previously suggested code, > `filesets-get-filelist' does the same thing for type :tree as for type :pattern > - it returns only the files in the directory, not also the files in its > subdirectories. > When changing filesets-get-filelist, please also take a look at filesets-build-dir-submenu-now, which actually builds the tree in the menu. :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. If emacs glob patterns understood something like "dir/**" (I assume it doesn't?), this could be done with :pattern, I suppose. > In particular, I had some problems > byte-compiling. It would be great if the version (1.8.4) in GNU Emacs could be > upgraded. > For the latest version, everything emacs-specific is supposed to be located in filesets-emacs.el, which should be loaded instead of filesets(2).el. If igrep is xemacs-specific, it's in filesets2.el by accident. (It's possible that I didn't test the last version with emacs because of problems with cl.) > There is no explanation of the Filesets menu items. There is an > `About' item with a link to a non-GNU Web page This should probably open the info page then. > What is the meaning of `#' and `+' in front of the > submenus These are keyboard shortcuts for easier navigation. If this makes sense, depends on whether the gui toolkit supports accelerator keys. > - Filesets Menu In Menu > In case users don't want to clutter the main menu bar with an additional menu, users can select a parent menu. > - Filesets Menu Shortcuts Marker > If the gui toolkit doesn't support accelerator keys (as they are commonly used on ms windows but also kde or gnome), this should be an empty string maybe. > - Filesets Menu Cache Contents > - Filesets Menu Cache Contents (needs to be explained better) > > - Filesets Cache Hostname Flag > This may be useful if you sync emacs configuration files between hosts. > - Filesets Browse Dir Function (external command not clear) > > - Filesets Find File Delay (what for?) > Xemacs-specific work-around. > - Filesets Commands (explanation unclear) > - Filesets External Viewers (Properties is especially unclear) > This opens files with external viewers depending of file patterns. Are all properties unclear? > - Filesets Ingroup Patterns > Recognize include-like statements. Only effective for :ingroup filesets. ingroup can be thought of as a logical tree of documents -- regardless of where the files are located physically. The root of an ingroup could, e.g., be an master tex file. HTH a little.
Thomas Link <t.link <at> gmx.at>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.Received: (at unknown) by unknown; unknown X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.2 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER, RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 976) by emacsbugs.donarmstrong.com; 19 Sep 2008 06:58:27 +0000 Received: from agminet01.oracle.com (agminet01.oracle.com [141.146.126.228]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8J6wOql027668 for <976 <at> emacsbugs.donarmstrong.com>; Thu, 18 Sep 2008 23:58:26 -0700 Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m8J6wGbI028600; Fri, 19 Sep 2008 01:58:17 -0500 Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m8J6wE6s024814; Fri, 19 Sep 2008 00:58:15 -0600 Received: from dradamslap1 (/24.23.165.218) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 19 Sep 2008 06:58:14 +0000 From: "Drew Adams" <drew.adams <at> oracle.com> To: <976 <at> debbugs.gnu.org>, <t.link <at> gmx.at> References: <000401c91a21$957bc7d0$0200a8c0 <at> us.oracle.com> Subject: RE: bug#976: Please see bug #965 also (and some minor comments) Date: Thu, 18 Sep 2008 23:58:14 -0700 Message-ID: <000a01c91a25$16922b40$0200a8c0 <at> us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <000401c91a21$957bc7d0$0200a8c0 <at> us.oracle.com> Thread-Index: AckaIZToyZFGiEtyT1CDYQr8IHdoigAA1XpA X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE Sorry; the mail subject should have been "Please see bug #965 also", not #976.
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,FOURLA,
RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham
version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 976) by emacsbugs.donarmstrong.com; 19 Sep 2008 06:33:20 +0000
Received: from agminet01.oracle.com (agminet01.oracle.com [141.146.126.228])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8J6XGca019085
for <976 <at> emacsbugs.donarmstrong.com>; Thu, 18 Sep 2008 23:33:17 -0700
Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212])
by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m8J6XArH009939;
Fri, 19 Sep 2008 01:33:10 -0500
Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84])
by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m8J6X9XO025025;
Fri, 19 Sep 2008 00:33:09 -0600
Received: from dradamslap1 (/24.23.165.218)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Fri, 19 Sep 2008 06:33:09 +0000
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <976 <at> debbugs.gnu.org>, <t.link <at> gmx.at>
Subject: Please see bug #976 also (and some minor comments)
Date: Thu, 18 Sep 2008 23:33:09 -0700
Message-ID: <000401c91a21$957bc7d0$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: AckaIZToyZFGiEtyT1CDYQr8IHdoig==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
Hi Thomas,
It would be great if you could also take a look at bug #965
(http://debbugs.gnu.org/cgi/bugreport.cgi?bug=965), which is
about the Filesets doc in the GNU Emacs manual.
Also, I tried (briefly) to use the more recent version (2.2) on your website
(http://members.a1.net/t.link/CompEmacsFilesets.html), but I was unable to use
it with GNU Emacs (e.g. release 22.2). In particular, I had some problems
byte-compiling. It would be great if the version (1.8.4) in GNU Emacs could be
upgraded.
FWIW, here are a few minor problems I ran into with your version 2.2 (using GNU
Emacs). You might want to take a look:
1. In the defcustom of `filesets-commands': the `igrep' part should be used only
if `igrep' is defined:
("Grep <<selection>>"
"grep"
("-n " filesets-get-quoted-selection " " "<<file-name>>")
(:textual))
,@(and (fboundp 'igrep) ; Do nothing if not defined.
'(("iGrep <selection>"
igrep
(nil filesets-get-selection "<file-list>")
(:textual :filelist))))
2. In the defcustom for `filesets-menu-path', '("files") should be '("file").
The GNU Emacs version uses nil as the default, which makes `Filesets' a separate
menu-bar menu, but I think it makes more sense to do as you have done: make it a
submenu of the `File' menu.
3. For GNU Emacs, the code in the GNU Emacs version is needed, I think, for the
`eval-and-compile' that defines `filesets-error': `filesets-add-menu' should not
be used, I think.
4. In `filesets-get-selection', I think (and m p) should be (and m p
mark-active).
5. For GNU Emacs at least, the code that uses `beginning-of-buffer' and
`end-of-buffer' should be treated as in the GNU Emacs version.
6. Some doc string typos: `filesets-get-filelist-1': "NAME" -> "ENTRY";
`filesets-set-default(!|+)': spelling.
7. Untested, but I think in `filesets-open' the code should be
(filesets-file-open open-function this name t), not (filesets-file-open
open-function this t). It makes no sense to use `t' for the name, AFAICT, and
there is no call in the file that uses all four args.
8. In `filesets-add-file', (abbreviate-file-name fn t) should be
(abbreviate-file-name fn) for GNU Emacs.
9. In `filesets-build-menu-now', `filesets-add-submenu' should be `add-submenu'
for GNU Emacs (as in the GNU Emacs version).
10. The doc string of `filesets-dired-find-or-display' should be something like
"Find or display the file on this Dired line."
11. FWIW, `filesets-get-filelist-1' is not used anywhere(?). It seems to be a
work in progress.
Thx. I hope someone will have the time to fix this library up a bit. I've
started using filesets recently and I appreciate the feature - thanks. It needs
better doc, though, to help people try it and realize the potential - I think it
has largely gone unnoticed so far by GNU Emacs users. It would be good to have a
little more explanation of the various keywords, preferably with some simple
illustrative examples.
FWIW, I've been playing with filesets in Icicles:
http://www.emacswiki.org/cgi-bin/wiki/Icicles_-_Persistent_Completions#toc3
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.Received: (at unknown) by unknown; unknown X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02 (2007-08-08) on rzlab.ucr.edu X-Spam-Level: X-Spam-Status: No, score=-8.0 required=4.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02 Received: (at 976) by emacsbugs.donarmstrong.com; 19 Sep 2008 04:07:29 +0000 Received: from south-station-annex.mit.edu (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8J47Pnb000612 for <976 <at> emacsbugs.donarmstrong.com>; Thu, 18 Sep 2008 21:07:27 -0700 Received: from grand-central-station.mit.edu (GRAND-CENTRAL-STATION.MIT.EDU [18.7.21.82]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id m8J47ONK026493; Fri, 19 Sep 2008 00:07:24 -0400 (EDT) Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by grand-central-station.mit.edu (8.13.6/8.9.2) with ESMTP id m8J47Aa1014366; Fri, 19 Sep 2008 00:07:14 -0400 (EDT) Received: from w92-130-webmail-2.mit.edu (WEBMAIL-SNAT.MIT.EDU [18.7.22.108]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id m8J479Rk003309; Fri, 19 Sep 2008 00:07:09 -0400 (EDT) Received: (from nobody <at> localhost) by w92-130-webmail-2.mit.edu (8.12.4) id m8J4795e012188; Fri, 19 Sep 2008 00:07:09 -0400 Received: from c-24-63-201-57.hsd1.ma.comcast.net (c-24-63-201-57.hsd1.ma.comcast.net [24.63.201.57]) (User authenticated as cyd <at> ATHENA.MIT.EDU) by webmail.mit.edu (Horde MIME library) with HTTP; Fri, 19 Sep 2008 00:07:09 -0400 Message-ID: <20080919000709.s4thfhu7pqo84kwk <at> webmail.mit.edu> Date: Fri, 19 Sep 2008 00:07:09 -0400 From: cyd <at> MIT.EDU To: Thomas Link <t.link <at> gmx.at> Cc: 976 <at> debbugs.gnu.org Subject: Re: 23.0.60; incorrect code for filesets-get-filelist MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.0.3) X-Scanned-By: MIMEDefang 2.42 Hi Thomas, Could you take a look at the following bug report about filesets.el? http://debbugs.gnu.org/cgi/bugreport.cgi?bug=976 Thanks.
cyd <at> MIT.EDU:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA,
HAS_BUG_NUMBER,NEXTPART,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham
version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 976) by emacsbugs.donarmstrong.com; 16 Sep 2008 21:28:10 +0000
Received: from rgminet01.oracle.com (rgminet01.oracle.com [148.87.113.118])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8GLS6af011923
for <976 <at> emacsbugs.donarmstrong.com>; Tue, 16 Sep 2008 14:28:07 -0700
Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110])
by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8GLRwU9020354;
Tue, 16 Sep 2008 15:27:58 -0600
Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84])
by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m8GLRvIq021506;
Tue, 16 Sep 2008 15:27:58 -0600
Received: from dradamslap1 (/141.144.58.96)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Tue, 16 Sep 2008 21:27:57 +0000
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <976 <at> debbugs.gnu.org>, <emacs-pretest-bug <at> gnu.org>
References: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com> <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
Subject: RE: bug#976: 23.0.60; incorrect code for filesets-get-filelist
Date: Tue, 16 Sep 2008 14:28:35 -0700
Message-ID: <003701c91843$2db4aa20$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0038_01C91808.8155D220"
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWggCetBEgAAIp8qA=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
This is a multi-part message in MIME format.
------=_NextPart_000_0038_01C91808.8155D220
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sorry for the added noise, but it's probably better for the default behavior to
use absolute filenames. The attached code does that.
> From: Drew Adams Sent: Tuesday, September 16, 2008 1:44 PM
> The attached code might help you in fixing this - if not,
> ignore it. I haven't
> tested all of the code that calls `filesets-get-filelist',
> but the version of
> `filesets-get-filelist' attached seems to DTRT, AFAICT.
>
> The problem with the original code, and with the suggestion I
> sent earlier, is
> that `filesets-get-filelist' does not DTRT for type :tree.
> The original code is
> completely broken - does nothing here. In my previously
> suggested code,
> `filesets-get-filelist' does the same thing for type :tree as
> for type :pattern
> - it returns only the files in the directory, not also the
> files in its
> subdirectories.
>
> See attached file for proposed new definition (with new function
> filesets-files-under).
>
> HTH
>
>
> > From: Drew Adams Sent: Saturday, September 13, 2008 9:41 AM
> > The part that treats a :tree of the code defining
> > `filesets-get-filelist' is not correct and never could have been
> > correct. And it does not correspond to the (correct) code from the
> > filesets author. One wonders if the GNU Emacs code was ever tested.
> >
> > This is the `case' clause that treats :tree in the definition
> > of `filesets-get-filelist':
> >
> > ((:tree)
> > (let ((dir (nth 0 entry))
> > (patt (nth 1 entry)))
> > (filesets-directory-files dir patt ':files t)))
> >
> > But `entry' here is a complete fileset, which is of the form
> > ("my-fs" (:tree "/some/directory" "^.+\.suffix$"))
> >
> > The above code thus tries to use "my-fs" as the directory,
> whereas it
> > should use "/some/directory".
> >
> > This is the (correct) code in the latest version from the author
> > (http://members.a1.net/t.link/CompEmacsFilesets.html). (The
> comment is
> > from the author.)
> >
> > ((:tree)
> > ;;well, the way trees are handled is a mess +++
> > (let* ((dirpatt (if (consp (nth 1 entry))
> > (filesets-entry-get-tree entry)
> > entry))
> > (dir (nth 0 dirpatt))
> > (patt (nth 1 dirpatt)))
> > (filesets-list-dir dir patt ':files t)))
> >
> > However, I think the following would be sufficient:
> >
> > ((:tree)
> > (let* ((dirpatt (filesets-entry-get-tree entry))
> > (dir (nth 0 dirpatt))
> > (patt (nth 1 dirpatt)))
> > (filesets-directory-files dir patt ':files t)))
> >
> > I don't see why the author's more complex treatment would ever be
> > needed, since in order for the :tree clause of the `case' to be
> > reached (consp (nth 1 entry)) must be a cons, AFAICT.
> >
> > At any rate, either the author's code or what I suggest immediately
> > above is needed. There is no way that the current GNU Emacs code can
> > work with a :tree fileset.
> >
> >
> > In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> > of 2008-09-03 on LENNART-69DE564
> > Windowing system distributor `Microsoft Corp.', version 5.1.2600
> > configured using `configure --with-gcc (3.4) --no-opt
> > --cflags -Ic:/g/include
> > -fno-crossjumping'
> >
> >
> >
> >
> >
> >
> >
>
------=_NextPart_000_0038_01C91808.8155D220
Content-Type: application/octet-stream;
name="throw.el"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="throw.el"
;;; filesets+.el --- Extensions to `filesets.el'.
;;
;; Filename: filesets+.el
;; Description: Extensions to `filesets.el'.
;; Author: Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 2008, Drew Adams, all rights reserved.
;; Created: Tue Sep 16 14:11:36 2008 (-0700)
;; Version: 22.0
;; Last-Updated: Tue Sep 16 14:27:01 2008 (-0700)
;; By: dradams
;; Update #: 13
;; URL: http://www.emacswiki.org/cgi-bin/wiki/filesets+.el
;; Keywords:
;; Compatibility: GNU Emacs 22.x
;;
;; Features that might be required by this library:
;;
;; Required feature throw was not provided.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This library provides some fixes to standard library
;; `filesets.el'. The reference version of that library is 1.8.4,
;; but I believe the same fixes are appropriate for other versions
;; (e.g. 2.2, named `filesets2.el', which is the latest version by
;; the original author, at
;; http://members.a1.net/t.link/CompEmacsFilesets.html).
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;
;; 2008/09/16 dadams
;; Created.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.;;; Code:
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(require 'filesets)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom filesets-menu-path '("file") ; Original was nil.
"The menu under which the filesets menu should be inserted.
See `add-submenu' for documentation."
:set (function filesets-set-default)
:type 'sexp :group 'filesets)
(defcustom filesets-menu-before "Open File..." ; Original was "File".
"The name of a menu before which this menu should be added.
See `add-submenu' for documentation."
:set (function filesets-set-default)
:type 'sexp :group 'filesets)
(defun filesets-get-filelist (entry &optional mode event)
"Get all files for fileset ENTRY.
Assume MODE (see `filesets-entry-mode'), if provided."
(let* ((mode (or mode (filesets-entry-mode entry)))
(fl (case mode
((:files) (filesets-entry-get-files entry))
((:file) (list (filesets-entry-get-file entry)))
((:ingroup)
(let ((entry (expand-file-name
(if (stringp entry)
entry
(filesets-entry-get-master entry)))))
(cons entry (filesets-ingroup-cache-get entry))))
((:tree)
(let* ((dirpatt (filesets-entry-get-tree entry))
(dir (nth 0 dirpatt))
(patt (nth 1 dirpatt))
(depth (or (filesets-entry-get-tree-max-level entry)
filesets-tree-max-level)))
(filesets-files-under 0 depth entry dir patt)))
((:pattern)
(let ((dirpatt (filesets-entry-get-pattern entry)))
(if dirpatt
(let ((dir (filesets-entry-get-pattern--dir dirpatt))
(patt (filesets-entry-get-pattern--pattern dirpatt)))
(filesets-directory-files dir patt ':files t))
(filesets-error 'error "Filesets: malformed entry: "
entry)))))))
(filesets-filter-list
fl (lambda (file) (not (filesets-filetype-property file event))))))
(defun filesets-files-under (level depth entry dir patt &optional relativep)
"Files under DIR that match PATT.
LEVEL is the current level under DIR.
DEPTH is the maximal tree scanning depth for ENTRY.
ENTRY is a fileset.
DIR is a directory.
PATT is a regexp that included file names must match.
RELATIVEP non-nil means use relative file names."
(and (or (= depth 0) (< level depth))
(let* ((dir (file-name-as-directory dir))
(files-here (filesets-directory-files
dir patt nil (not relativep)
(filesets-entry-get-filter-dirs-flag entry)))
(subdirs (filesets-filter-dir-names files-here))
(files
(filesets-filter-dir-names
(apply #'append
files-here
(mapcar
(lambda (subdir)
(let* ((subdir (file-name-as-directory subdir))
(full-subdir (concat dir subdir)))
(filesets-files-under (+ level 1) depth entry
full-subdir patt)))
subdirs))
t)))
files)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'filesets+)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; filesets+.el ends here
------=_NextPart_000_0038_01C91808.8155D220--
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.9 required=4.0 tests=AWL,BAYES_00,FOURLA,
HAS_BUG_NUMBER,NEXTPART,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham
version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 16 Sep 2008 21:28:28 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8GLSOXQ011943
for <submit <at> emacsbugs.donarmstrong.com>; Tue, 16 Sep 2008 14:28:26 -0700
Received: from mail.gnu.org ([199.232.76.166]:38629 helo=mx10.gnu.org)
by fencepost.gnu.org with esmtp (Exim 4.67)
(envelope-from <drew.adams <at> oracle.com>)
id 1Kfi44-00045X-IE
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 17:26:29 -0400
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1Kfi5q-0006zC-0R
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 17:28:22 -0400
Received: from rgminet01.oracle.com ([148.87.113.118]:30302)
by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
(Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1Kfi5o-0006y2-Um
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 17:28:17 -0400
Received: from rgmgw1.us.oracle.com (rgmgw1.us.oracle.com [138.1.186.110])
by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8GLRwU9020354;
Tue, 16 Sep 2008 15:27:58 -0600
Received: from acsmt706.oracle.com (acsmt706.oracle.com [141.146.40.84])
by rgmgw1.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m8GLRvIq021506;
Tue, 16 Sep 2008 15:27:58 -0600
Received: from dradamslap1 (/141.144.58.96)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Tue, 16 Sep 2008 21:27:57 +0000
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <976 <at> debbugs.gnu.org>, <emacs-pretest-bug <at> gnu.org>
References: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com> <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
Subject: RE: bug#976: 23.0.60; incorrect code for filesets-get-filelist
Date: Tue, 16 Sep 2008 14:28:35 -0700
Message-ID: <003701c91843$2db4aa20$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0038_01C91808.8155D220"
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWggCetBEgAAIp8qA=
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6
X-CrossAssassin-Score: 2
This is a multi-part message in MIME format.
------=_NextPart_000_0038_01C91808.8155D220
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sorry for the added noise, but it's probably better for the default behavior to
use absolute filenames. The attached code does that.
> From: Drew Adams Sent: Tuesday, September 16, 2008 1:44 PM
> The attached code might help you in fixing this - if not,
> ignore it. I haven't
> tested all of the code that calls `filesets-get-filelist',
> but the version of
> `filesets-get-filelist' attached seems to DTRT, AFAICT.
>
> The problem with the original code, and with the suggestion I
> sent earlier, is
> that `filesets-get-filelist' does not DTRT for type :tree.
> The original code is
> completely broken - does nothing here. In my previously
> suggested code,
> `filesets-get-filelist' does the same thing for type :tree as
> for type :pattern
> - it returns only the files in the directory, not also the
> files in its
> subdirectories.
>
> See attached file for proposed new definition (with new function
> filesets-files-under).
>
> HTH
>
>
> > From: Drew Adams Sent: Saturday, September 13, 2008 9:41 AM
> > The part that treats a :tree of the code defining
> > `filesets-get-filelist' is not correct and never could have been
> > correct. And it does not correspond to the (correct) code from the
> > filesets author. One wonders if the GNU Emacs code was ever tested.
> >
> > This is the `case' clause that treats :tree in the definition
> > of `filesets-get-filelist':
> >
> > ((:tree)
> > (let ((dir (nth 0 entry))
> > (patt (nth 1 entry)))
> > (filesets-directory-files dir patt ':files t)))
> >
> > But `entry' here is a complete fileset, which is of the form
> > ("my-fs" (:tree "/some/directory" "^.+\.suffix$"))
> >
> > The above code thus tries to use "my-fs" as the directory,
> whereas it
> > should use "/some/directory".
> >
> > This is the (correct) code in the latest version from the author
> > (http://members.a1.net/t.link/CompEmacsFilesets.html). (The
> comment is
> > from the author.)
> >
> > ((:tree)
> > ;;well, the way trees are handled is a mess +++
> > (let* ((dirpatt (if (consp (nth 1 entry))
> > (filesets-entry-get-tree entry)
> > entry))
> > (dir (nth 0 dirpatt))
> > (patt (nth 1 dirpatt)))
> > (filesets-list-dir dir patt ':files t)))
> >
> > However, I think the following would be sufficient:
> >
> > ((:tree)
> > (let* ((dirpatt (filesets-entry-get-tree entry))
> > (dir (nth 0 dirpatt))
> > (patt (nth 1 dirpatt)))
> > (filesets-directory-files dir patt ':files t)))
> >
> > I don't see why the author's more complex treatment would ever be
> > needed, since in order for the :tree clause of the `case' to be
> > reached (consp (nth 1 entry)) must be a cons, AFAICT.
> >
> > At any rate, either the author's code or what I suggest immediately
> > above is needed. There is no way that the current GNU Emacs code can
> > work with a :tree fileset.
> >
> >
> > In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> > of 2008-09-03 on LENNART-69DE564
> > Windowing system distributor `Microsoft Corp.', version 5.1.2600
> > configured using `configure --with-gcc (3.4) --no-opt
> > --cflags -Ic:/g/include
> > -fno-crossjumping'
> >
> >
> >
> >
> >
> >
> >
>
------=_NextPart_000_0038_01C91808.8155D220
Content-Type: application/octet-stream;
name="throw.el"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="throw.el"
;;; filesets+.el --- Extensions to `filesets.el'.
;;
;; Filename: filesets+.el
;; Description: Extensions to `filesets.el'.
;; Author: Drew Adams
;; Maintainer: Drew Adams
;; Copyright (C) 2008, Drew Adams, all rights reserved.
;; Created: Tue Sep 16 14:11:36 2008 (-0700)
;; Version: 22.0
;; Last-Updated: Tue Sep 16 14:27:01 2008 (-0700)
;; By: dradams
;; Update #: 13
;; URL: http://www.emacswiki.org/cgi-bin/wiki/filesets+.el
;; Keywords:
;; Compatibility: GNU Emacs 22.x
;;
;; Features that might be required by this library:
;;
;; Required feature throw was not provided.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Commentary:
;;
;; This library provides some fixes to standard library
;; `filesets.el'. The reference version of that library is 1.8.4,
;; but I believe the same fixes are appropriate for other versions
;; (e.g. 2.2, named `filesets2.el', which is the latest version by
;; the original author, at
;; http://members.a1.net/t.link/CompEmacsFilesets.html).
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Change log:
;;
;;
;; 2008/09/16 dadams
;; Created.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;; General Public License for more details.
;;
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.;;; Code:
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;; Code:
(require 'filesets)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defcustom filesets-menu-path '("file") ; Original was nil.
"The menu under which the filesets menu should be inserted.
See `add-submenu' for documentation."
:set (function filesets-set-default)
:type 'sexp :group 'filesets)
(defcustom filesets-menu-before "Open File..." ; Original was "File".
"The name of a menu before which this menu should be added.
See `add-submenu' for documentation."
:set (function filesets-set-default)
:type 'sexp :group 'filesets)
(defun filesets-get-filelist (entry &optional mode event)
"Get all files for fileset ENTRY.
Assume MODE (see `filesets-entry-mode'), if provided."
(let* ((mode (or mode (filesets-entry-mode entry)))
(fl (case mode
((:files) (filesets-entry-get-files entry))
((:file) (list (filesets-entry-get-file entry)))
((:ingroup)
(let ((entry (expand-file-name
(if (stringp entry)
entry
(filesets-entry-get-master entry)))))
(cons entry (filesets-ingroup-cache-get entry))))
((:tree)
(let* ((dirpatt (filesets-entry-get-tree entry))
(dir (nth 0 dirpatt))
(patt (nth 1 dirpatt))
(depth (or (filesets-entry-get-tree-max-level entry)
filesets-tree-max-level)))
(filesets-files-under 0 depth entry dir patt)))
((:pattern)
(let ((dirpatt (filesets-entry-get-pattern entry)))
(if dirpatt
(let ((dir (filesets-entry-get-pattern--dir dirpatt))
(patt (filesets-entry-get-pattern--pattern dirpatt)))
(filesets-directory-files dir patt ':files t))
(filesets-error 'error "Filesets: malformed entry: "
entry)))))))
(filesets-filter-list
fl (lambda (file) (not (filesets-filetype-property file event))))))
(defun filesets-files-under (level depth entry dir patt &optional relativep)
"Files under DIR that match PATT.
LEVEL is the current level under DIR.
DEPTH is the maximal tree scanning depth for ENTRY.
ENTRY is a fileset.
DIR is a directory.
PATT is a regexp that included file names must match.
RELATIVEP non-nil means use relative file names."
(and (or (= depth 0) (< level depth))
(let* ((dir (file-name-as-directory dir))
(files-here (filesets-directory-files
dir patt nil (not relativep)
(filesets-entry-get-filter-dirs-flag entry)))
(subdirs (filesets-filter-dir-names files-here))
(files
(filesets-filter-dir-names
(apply #'append
files-here
(mapcar
(lambda (subdir)
(let* ((subdir (file-name-as-directory subdir))
(full-subdir (concat dir subdir)))
(filesets-files-under (+ level 1) depth entry
full-subdir patt)))
subdirs))
t)))
files)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(provide 'filesets+)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; filesets+.el ends here
------=_NextPart_000_0038_01C91808.8155D220--
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.2 required=4.0 tests=AWL,BAYES_00,FOURLA,
HAS_BUG_NUMBER,MIME_QP_LONG_LINE,NEXTPART,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY
autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at 976) by emacsbugs.donarmstrong.com; 16 Sep 2008 20:43:57 +0000
Received: from rgminet01.oracle.com (rgminet01.oracle.com [148.87.113.118])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8GKhrLH027961
for <976 <at> emacsbugs.donarmstrong.com>; Tue, 16 Sep 2008 13:43:54 -0700
Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111])
by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8GKhfNE020907;
Tue, 16 Sep 2008 14:43:41 -0600
Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82])
by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m8GKhdF1003548;
Tue, 16 Sep 2008 14:43:39 -0600
Received: from dradamslap1 (/141.144.58.96)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Tue, 16 Sep 2008 20:43:38 +0000
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <976 <at> debbugs.gnu.org>, <emacs-pretest-bug <at> gnu.org>
References: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com>
Subject: RE: bug#976: 23.0.60; incorrect code for filesets-get-filelist
Date: Tue, 16 Sep 2008 13:44:16 -0700
Message-ID: <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_002D_01C91802.501F4E80"
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com>
Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWggCetBEg
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
This is a multi-part message in MIME format.
------=_NextPart_000_002D_01C91802.501F4E80
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
The attached code might help you in fixing this - if not, ignore it. I haven't
tested all of the code that calls `filesets-get-filelist', but the version of
`filesets-get-filelist' attached seems to DTRT, AFAICT.
The problem with the original code, and with the suggestion I sent earlier, is
that `filesets-get-filelist' does not DTRT for type :tree. The original code is
completely broken - does nothing here. In my previously suggested code,
`filesets-get-filelist' does the same thing for type :tree as for type :pattern
- it returns only the files in the directory, not also the files in its
subdirectories.
See attached file for proposed new definition (with new function
filesets-files-under).
HTH
> From: Drew Adams Sent: Saturday, September 13, 2008 9:41 AM
> The part that treats a :tree of the code defining
> `filesets-get-filelist' is not correct and never could have been
> correct. And it does not correspond to the (correct) code from the
> filesets author. One wonders if the GNU Emacs code was ever tested.
>
> This is the `case' clause that treats :tree in the definition
> of `filesets-get-filelist':
>
> ((:tree)
> (let ((dir (nth 0 entry))
> (patt (nth 1 entry)))
> (filesets-directory-files dir patt ':files t)))
>
> But `entry' here is a complete fileset, which is of the form
> ("my-fs" (:tree "/some/directory" "^.+\.suffix$"))
>
> The above code thus tries to use "my-fs" as the directory, whereas it
> should use "/some/directory".
>
> This is the (correct) code in the latest version from the author
> (http://members.a1.net/t.link/CompEmacsFilesets.html). (The comment is
> from the author.)
>
> ((:tree)
> ;;well, the way trees are handled is a mess +++
> (let* ((dirpatt (if (consp (nth 1 entry))
> (filesets-entry-get-tree entry)
> entry))
> (dir (nth 0 dirpatt))
> (patt (nth 1 dirpatt)))
> (filesets-list-dir dir patt ':files t)))
>
> However, I think the following would be sufficient:
>
> ((:tree)
> (let* ((dirpatt (filesets-entry-get-tree entry))
> (dir (nth 0 dirpatt))
> (patt (nth 1 dirpatt)))
> (filesets-directory-files dir patt ':files t)))
>
> I don't see why the author's more complex treatment would ever be
> needed, since in order for the :tree clause of the `case' to be
> reached (consp (nth 1 entry)) must be a cons, AFAICT.
>
> At any rate, either the author's code or what I suggest immediately
> above is needed. There is no way that the current GNU Emacs code can
> work with a :tree fileset.
>
>
> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> of 2008-09-03 on LENNART-69DE564
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt
> --cflags -Ic:/g/include
> -fno-crossjumping'
>
>
>
>
>
>
>
------=_NextPart_000_002D_01C91802.501F4E80
Content-Type: application/octet-stream;
name="throw.el"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="throw.el"
(defun filesets-get-filelist (entry &optional mode event)=0A=
"Get all files for fileset ENTRY.=0A=
Assume MODE (see `filesets-entry-mode'), if provided."=0A=
(let* ((mode (or mode (filesets-entry-mode entry)))=0A=
(fl (case mode=0A=
((:files) (filesets-entry-get-files entry))=0A=
((:file) (list (filesets-entry-get-file entry)))=0A=
((:ingroup)=0A=
(let ((entry (expand-file-name=0A=
(if (stringp entry)=0A=
entry=0A=
(filesets-entry-get-master entry)))))=0A=
(cons entry (filesets-ingroup-cache-get entry))))=0A=
((:tree)=0A=
(let* ((dirpatt (filesets-entry-get-tree entry))=0A=
(dir (nth 0 dirpatt))=0A=
(patt (nth 1 dirpatt))=0A=
(depth (or (filesets-entry-get-tree-max-level =
entry)=0A=
filesets-tree-max-level)))=0A=
(filesets-files-under 0 depth entry dir patt)))=0A=
((:pattern)=0A=
(let ((dirpatt (filesets-entry-get-pattern entry)))=0A=
(if dirpatt=0A=
(let ((dir (filesets-entry-get-pattern--dir =
dirpatt))=0A=
(patt (filesets-entry-get-pattern--pattern =
dirpatt)))=0A=
(filesets-directory-files dir patt ':files t))=0A=
(filesets-error 'error "Filesets: malformed entry: "=0A=
entry)))))))=0A=
(filesets-filter-list=0A=
fl (lambda (file) (not (filesets-filetype-property file event))))))=0A=
=0A=
(defun filesets-files-under (level depth entry dir patt &optional =
absolutep)=0A=
"Files under DIR that match PATT.=0A=
LEVEL is the current level under DIR.=0A=
DEPTH is the maximal tree scanning depth for ENTRY.=0A=
ENTRY is a fileset.=0A=
DIR is a directory.=0A=
PATT is a regexp that included file names must match.=0A=
ABSOLUTEP non-nil means use absolute file names."=0A=
(and (or (=3D depth 0) (< level depth))=0A=
(let* ((dir (file-name-as-directory dir))=0A=
(files-here (filesets-directory-files=0A=
dir patt nil absolutep=0A=
(filesets-entry-get-filter-dirs-flag entry)))=0A=
(subdirs (filesets-filter-dir-names files-here))=0A=
(files=0A=
(filesets-filter-dir-names=0A=
(apply #'append=0A=
files-here=0A=
(mapcar=0A=
(lambda (subdir)=0A=
(let* ((subdir (file-name-as-directory subdir))=0A=
(full-subdir (concat dir subdir)))=0A=
(filesets-files-under (+ level 1) depth entry=0A=
full-subdir patt)))=0A=
subdirs))=0A=
t)))=0A=
files)))=0A=
------=_NextPart_000_002D_01C91802.501F4E80--
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.2 required=4.0 tests=AWL,BAYES_00,FOURLA,
HAS_BUG_NUMBER,MIME_QP_LONG_LINE,NEXTPART,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY
autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 16 Sep 2008 20:44:14 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8GKiAcO027971
for <submit <at> emacsbugs.donarmstrong.com>; Tue, 16 Sep 2008 13:44:11 -0700
Received: from mx10.gnu.org ([199.232.76.166]:34633)
by fencepost.gnu.org with esmtp (Exim 4.67)
(envelope-from <drew.adams <at> oracle.com>)
id 1KfhNG-0005gM-B6
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 16:42:14 -0400
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1KfhP2-00070P-Gz
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 16:44:08 -0400
Received: from rgminet01.oracle.com ([148.87.113.118]:64895)
by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
(Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1KfhP1-0006yx-77
for emacs-pretest-bug <at> gnu.org; Tue, 16 Sep 2008 16:44:04 -0400
Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111])
by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m8GKhfNE020907;
Tue, 16 Sep 2008 14:43:41 -0600
Received: from acsmt704.oracle.com (acsmt704.oracle.com [141.146.40.82])
by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m8GKhdF1003548;
Tue, 16 Sep 2008 14:43:39 -0600
Received: from dradamslap1 (/141.144.58.96)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Tue, 16 Sep 2008 20:43:38 +0000
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <976 <at> debbugs.gnu.org>, <emacs-pretest-bug <at> gnu.org>
References: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com>
Subject: RE: bug#976: 23.0.60; incorrect code for filesets-get-filelist
Date: Tue, 16 Sep 2008 13:44:16 -0700
Message-ID: <002c01c9183c$fc7e2680$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_002D_01C91802.501F4E80"
X-Mailer: Microsoft Office Outlook 11
In-reply-to: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com>
Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWggCetBEg
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6
X-CrossAssassin-Score: 2
This is a multi-part message in MIME format.
------=_NextPart_000_002D_01C91802.501F4E80
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
The attached code might help you in fixing this - if not, ignore it. I haven't
tested all of the code that calls `filesets-get-filelist', but the version of
`filesets-get-filelist' attached seems to DTRT, AFAICT.
The problem with the original code, and with the suggestion I sent earlier, is
that `filesets-get-filelist' does not DTRT for type :tree. The original code is
completely broken - does nothing here. In my previously suggested code,
`filesets-get-filelist' does the same thing for type :tree as for type :pattern
- it returns only the files in the directory, not also the files in its
subdirectories.
See attached file for proposed new definition (with new function
filesets-files-under).
HTH
> From: Drew Adams Sent: Saturday, September 13, 2008 9:41 AM
> The part that treats a :tree of the code defining
> `filesets-get-filelist' is not correct and never could have been
> correct. And it does not correspond to the (correct) code from the
> filesets author. One wonders if the GNU Emacs code was ever tested.
>
> This is the `case' clause that treats :tree in the definition
> of `filesets-get-filelist':
>
> ((:tree)
> (let ((dir (nth 0 entry))
> (patt (nth 1 entry)))
> (filesets-directory-files dir patt ':files t)))
>
> But `entry' here is a complete fileset, which is of the form
> ("my-fs" (:tree "/some/directory" "^.+\.suffix$"))
>
> The above code thus tries to use "my-fs" as the directory, whereas it
> should use "/some/directory".
>
> This is the (correct) code in the latest version from the author
> (http://members.a1.net/t.link/CompEmacsFilesets.html). (The comment is
> from the author.)
>
> ((:tree)
> ;;well, the way trees are handled is a mess +++
> (let* ((dirpatt (if (consp (nth 1 entry))
> (filesets-entry-get-tree entry)
> entry))
> (dir (nth 0 dirpatt))
> (patt (nth 1 dirpatt)))
> (filesets-list-dir dir patt ':files t)))
>
> However, I think the following would be sufficient:
>
> ((:tree)
> (let* ((dirpatt (filesets-entry-get-tree entry))
> (dir (nth 0 dirpatt))
> (patt (nth 1 dirpatt)))
> (filesets-directory-files dir patt ':files t)))
>
> I don't see why the author's more complex treatment would ever be
> needed, since in order for the :tree clause of the `case' to be
> reached (consp (nth 1 entry)) must be a cons, AFAICT.
>
> At any rate, either the author's code or what I suggest immediately
> above is needed. There is no way that the current GNU Emacs code can
> work with a :tree fileset.
>
>
> In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
> of 2008-09-03 on LENNART-69DE564
> Windowing system distributor `Microsoft Corp.', version 5.1.2600
> configured using `configure --with-gcc (3.4) --no-opt
> --cflags -Ic:/g/include
> -fno-crossjumping'
>
>
>
>
>
>
>
------=_NextPart_000_002D_01C91802.501F4E80
Content-Type: application/octet-stream;
name="throw.el"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
filename="throw.el"
(defun filesets-get-filelist (entry &optional mode event)=0A=
"Get all files for fileset ENTRY.=0A=
Assume MODE (see `filesets-entry-mode'), if provided."=0A=
(let* ((mode (or mode (filesets-entry-mode entry)))=0A=
(fl (case mode=0A=
((:files) (filesets-entry-get-files entry))=0A=
((:file) (list (filesets-entry-get-file entry)))=0A=
((:ingroup)=0A=
(let ((entry (expand-file-name=0A=
(if (stringp entry)=0A=
entry=0A=
(filesets-entry-get-master entry)))))=0A=
(cons entry (filesets-ingroup-cache-get entry))))=0A=
((:tree)=0A=
(let* ((dirpatt (filesets-entry-get-tree entry))=0A=
(dir (nth 0 dirpatt))=0A=
(patt (nth 1 dirpatt))=0A=
(depth (or (filesets-entry-get-tree-max-level =
entry)=0A=
filesets-tree-max-level)))=0A=
(filesets-files-under 0 depth entry dir patt)))=0A=
((:pattern)=0A=
(let ((dirpatt (filesets-entry-get-pattern entry)))=0A=
(if dirpatt=0A=
(let ((dir (filesets-entry-get-pattern--dir =
dirpatt))=0A=
(patt (filesets-entry-get-pattern--pattern =
dirpatt)))=0A=
(filesets-directory-files dir patt ':files t))=0A=
(filesets-error 'error "Filesets: malformed entry: "=0A=
entry)))))))=0A=
(filesets-filter-list=0A=
fl (lambda (file) (not (filesets-filetype-property file event))))))=0A=
=0A=
(defun filesets-files-under (level depth entry dir patt &optional =
absolutep)=0A=
"Files under DIR that match PATT.=0A=
LEVEL is the current level under DIR.=0A=
DEPTH is the maximal tree scanning depth for ENTRY.=0A=
ENTRY is a fileset.=0A=
DIR is a directory.=0A=
PATT is a regexp that included file names must match.=0A=
ABSOLUTEP non-nil means use absolute file names."=0A=
(and (or (=3D depth 0) (< level depth))=0A=
(let* ((dir (file-name-as-directory dir))=0A=
(files-here (filesets-directory-files=0A=
dir patt nil absolutep=0A=
(filesets-entry-get-filter-dirs-flag entry)))=0A=
(subdirs (filesets-filter-dir-names files-here))=0A=
(files=0A=
(filesets-filter-dir-names=0A=
(apply #'append=0A=
files-here=0A=
(mapcar=0A=
(lambda (subdir)=0A=
(let* ((subdir (file-name-as-directory subdir))=0A=
(full-subdir (concat dir subdir)))=0A=
(filesets-files-under (+ level 1) depth entry=0A=
full-subdir patt)))=0A=
subdirs))=0A=
t)))=0A=
files)))=0A=
------=_NextPart_000_002D_01C91802.501F4E80--
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
Received: (at unknown) by unknown; unknown
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rzlab.ucr.edu
X-Spam-Level:
X-Spam-Status: No, score=-6.7 required=4.0 tests=AWL,BAYES_00,
RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham
version=3.2.3-bugs.debian.org_2005_01_02
Received: (at submit) by emacsbugs.donarmstrong.com; 13 Sep 2008 16:41:10 +0000
Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10])
by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id m8DGf5S7011950
for <submit <at> emacsbugs.donarmstrong.com>; Sat, 13 Sep 2008 09:41:07 -0700
Received: from mail.gnu.org ([199.232.76.166]:57008 helo=mx10.gnu.org)
by fencepost.gnu.org with esmtp (Exim 4.67)
(envelope-from <drew.adams <at> oracle.com>)
id 1KeY9S-0000Yg-Bg
for emacs-pretest-bug <at> gnu.org; Sat, 13 Sep 2008 12:39:14 -0400
Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1KeYBB-0004EU-3I
for emacs-pretest-bug <at> gnu.org; Sat, 13 Sep 2008 12:41:04 -0400
Received: from agminet01.oracle.com ([141.146.126.228]:17202)
by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32)
(Exim 4.60)
(envelope-from <drew.adams <at> oracle.com>)
id 1KeYBA-0004Cs-4Y
for emacs-pretest-bug <at> gnu.org; Sat, 13 Sep 2008 12:41:00 -0400
Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212])
by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m8DGeoWf024917
for <emacs-pretest-bug <at> gnu.org>; Sat, 13 Sep 2008 11:40:50 -0500
Received: from acsmt701.oracle.com (acsmt701.oracle.com [141.146.40.71])
by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m8DGensx018593
for <emacs-pretest-bug <at> gnu.org>; Sat, 13 Sep 2008 10:40:50 -0600
Received: from dradamslap1 (/24.23.165.218)
by default (Oracle Beehive Gateway v4.0)
with ESMTP ; Sat, 13 Sep 2008 09:40:49 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <emacs-pretest-bug <at> gnu.org>
Subject: 23.0.60; incorrect code for filesets-get-filelist
Date: Sat, 13 Sep 2008 09:40:59 -0700
Message-ID: <002901c915bf$811df210$0200a8c0 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
Thread-Index: AckVv4Ci1hEH5okgSQ2EUXtBuurWgg==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Brightmail-Tracker: AAAAAQAAAAI=
X-Whitelist: TRUE
X-Whitelist: TRUE
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6
The part that treats a :tree of the code defining
`filesets-get-filelist' is not correct and never could have been
correct. And it does not correspond to the (correct) code from the
filesets author. One wonders if the GNU Emacs code was ever tested.
This is the `case' clause that treats :tree in the definition
of `filesets-get-filelist':
((:tree)
(let ((dir (nth 0 entry))
(patt (nth 1 entry)))
(filesets-directory-files dir patt ':files t)))
But `entry' here is a complete fileset, which is of the form
("my-fs" (:tree "/some/directory" "^.+\.suffix$"))
The above code thus tries to use "my-fs" as the directory, whereas it
should use "/some/directory".
This is the (correct) code in the latest version from the author
(http://members.a1.net/t.link/CompEmacsFilesets.html). (The comment is
from the author.)
((:tree)
;;well, the way trees are handled is a mess +++
(let* ((dirpatt (if (consp (nth 1 entry))
(filesets-entry-get-tree entry)
entry))
(dir (nth 0 dirpatt))
(patt (nth 1 dirpatt)))
(filesets-list-dir dir patt ':files t)))
However, I think the following would be sufficient:
((:tree)
(let* ((dirpatt (filesets-entry-get-tree entry))
(dir (nth 0 dirpatt))
(patt (nth 1 dirpatt)))
(filesets-directory-files dir patt ':files t)))
I don't see why the author's more complex treatment would ever be
needed, since in order for the :tree clause of the `case' to be
reached (consp (nth 1 entry)) must be a cons, AFAICT.
At any rate, either the author's code or what I suggest immediately
above is needed. There is no way that the current GNU Emacs code can
work with a :tree fileset.
In GNU Emacs 23.0.60.1 (i386-mingw-nt5.1.2600)
of 2008-09-03 on LENNART-69DE564
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags -Ic:/g/include
-fno-crossjumping'
"Drew Adams" <drew.adams <at> oracle.com>:Emacs Bugs <bug-gnu-emacs <at> gnu.org>.
Full text available.bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>:bug#976; Package emacs.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.