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

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

bug#976: 23.0.60; incorrect code for filesets-get-filelist


From: Andrew Hyatt
Subject: bug#976: 23.0.60; incorrect code for filesets-get-filelist
Date: Tue, 29 Dec 2015 20:16:12 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (darwin)

"Drew Adams" <drew.adams@oracle.com> writes:

> 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".

I'm looking into whether this still exists in Emacs 25.  The code still
is as you describe.  Can you give steps to reproduce a user-visible bug?

>  
> 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'
>  





reply via email to

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