ignoring subdirectory in find-file completion

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

ignoring subdirectory in find-file completion

Albert Reiner
Hi,

I am looking for some way to make completion when using find-file
ignore any directory named _darcs; i.e., if I have a directory
structure

    foo/
      _darcs/
        ...
      bar/
        ...

then `M-x find-file f o o / TAB' should complete to `foo/bar/'.

>From the documentation I thought that

    (add-to-list 'completion-ignored-extensions "_darcs")

should do what I want, but that does not seem to be the case.

Any help would be appreciated.

Albert.

_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

J. David Boyd
Albert Reiner <[hidden email]> writes:

> Hi,
>
> I am looking for some way to make completion when using find-file
> ignore any directory named _darcs; i.e., if I have a directory
> structure
>
>     foo/
>       _darcs/
>         ...
>       bar/
>         ...
>
> then `M-x find-file f o o / TAB' should complete to `foo/bar/'.
>
> From the documentation I thought that
>
>     (add-to-list 'completion-ignored-extensions "_darcs")
>
> should do what I want, but that does not seem to be the case.
>
> Any help would be appreciated.
>
> Albert.

The docs for completion-ignored-extensions say:

...Directories are ignored if they match any string in this list which
ends in a slash...

And your "_darcs" doesn't end in a slash...

Dave
_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

Albert Reiner
Thanks for your reply:

[[hidden email] (J. David Boyd), Wed, 01 Jun 2005 16:07:26 GMT]:
> >     (add-to-list 'completion-ignored-extensions "_darcs")
>
> The docs for completion-ignored-extensions say:
>
> ...Directories are ignored if they match any string in this list which
> ends in a slash...
>
> And your "_darcs" doesn't end in a slash...

But even with the slash I don't get the desired behavior.  Also, the
description seems to indicate that ignored items should end in that
string, but foo_darcs should not be skipped.

BTW, the version here is "GNU Emacs 21.3.1 (i386-redhat-linux-gnu, X
toolkit, Xaw3d scroll bars) of 2005-02-04 on bugs.build.redhat.com".

Thanks again,

Albert.

_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

Stefan Monnier
> Also, the description seems to indicate that ignored items should end in
> that string, but foo_darcs should not be skipped.

Sorry, can't do that,


        Stefan
_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

Albert Reiner
[Stefan Monnier <[hidden email]>, Wed, 01 Jun 2005 12:31:56 -0400]:
> > Also, the description seems to indicate that ignored items should end in
> > that string, but foo_darcs should not be skipped.
>
> Sorry, can't do that,

Well, I'll live with that.  Thanks for your help, though, and for
pointing out that support for this isn't built in.

Regards,

Albert.
_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

Eli Zaretskii
In reply to this post by Albert Reiner
> From: Albert Reiner <[hidden email]>
> Date: 01 Jun 2005 18:19:36 +0200
>
> But even with the slash I don't get the desired behavior.  Also, the
> description seems to indicate that ignored items should end in that
> string, but foo_darcs should not be skipped.
>
> BTW, the version here is "GNU Emacs 21.3.1 (i386-redhat-linux-gnu, X
> toolkit, Xaw3d scroll bars) of 2005-02-04 on bugs.build.redhat.com".

IIRC, this feature has a bug in 21.3 (and older versions as well), and
will be only fixed in the next release.  (And even there foo_darcs
will be skipped too.)


_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs
Reply | Threaded
Open this post in threaded view
|

Re: ignoring subdirectory in find-file completion

Albert Reiner
In reply to this post by Albert Reiner
[Eli Zaretskii <[hidden email]>, Wed, 01 Jun 2005 23:09:36 +0300]:
> IIRC, this feature has a bug in 21.3 (and older versions as well), and
> will be only fixed in the next release.  (And even there foo_darcs
> will be skipped too.)

Ah, thanks for pointing that out!

Regards,

Albert.
_______________________________________________
Help-gnu-emacs mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs