emacs-devel
[Top][All Lists]
Advanced

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

Re: CVS directories in completion-ignored-extensions


From: Eli Zaretskii
Subject: Re: CVS directories in completion-ignored-extensions
Date: 06 Jan 2004 07:55:52 +0200

> From: Miles Bader <address@hidden>
> Date: 06 Jan 2004 09:08:25 +0900
> 
> Ok, how about something like:
> 
>    (defun string-matcher-member (string matcher)
>      "Return non-nil if STRING is matched by the `string matcher' MATCHER.
>    MATCHER should be a list, where each element is either a string,
>    which will be compared with STRING using `equal', or a cons of the
>    form (regexp REGEXP), in which case REGEXP will be compared with
>    STRING using `string-match'.  The actual return value is the first
>    element of MATCHER that matches."

The current completion-ignored-extensions machinery is implemented in
C (see dired.c).  I'm worried about the complexity and performance of
walking a non-trivial list and trying to match a regexp for every
file in a directory returned by `readdir'.

Do these concerns have merit, and if so, should we perhaps rewrite
file_name_completion and/or maybe slightly redesign this feature so it
would be easier to implement efficiently?

Possible alternative designs:

 1) Use shell wildcards instead of regexps, and make
    `file_name_completion' use `fnmatch' instead of regexp matching.

 2) Restructure `file_name_completion', so that it doesn't need to
    compile the regexps for each file name it examines.

Thoughts?





reply via email to

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