Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: need help with enhancement to prevent completion from stat'ing automounts



On Tue, 08 Sep 2009 19:39:21 -0400
Greg Klanderman <gak@xxxxxxxxxxxxxx> wrote:
> I'm quite certain that passing the 'fake' files and directories to
> compadd would solve the problem here.  I will acknowledge that IMO the
> most correct change would be to introduce a 'fake-dirs' zstyle and fix
> all of _path_files and compfiles to maintain these fake completions
> separately so they can be given to compadd with the correct suffix
> rather than '-f' when the time comes.
> 
> But I find those two pieces of code so impenetrable that I'm having
> trouble forcing myself down that path.  And so another idea is to add
> an array parameter, say completion_automount_roots, which I could
> maybe set to (/net /home) and have bound to a C variable, then in the
> ztat() function return 'directory' without stat()ing any files
> directly under those roots.  Not pretty, but I can see exactly what
> needs to be done and it's not too hard.

It's high time we fixed this properly.  The whole problem with the
completion system is arbitrary bits getting added without understanding the
existing bits, and each time that happens it gets worse.

Both Bart and I have been bamboozled by the networks of special cases and
clever features in _path_files, but we need to track them down if we want
to make file completion maintainable.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author