From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27997 invoked from network); 23 Feb 1999 10:27:22 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 23 Feb 1999 10:27:22 -0000 Received: (qmail 25299 invoked by alias); 23 Feb 1999 10:27:04 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5486 Received: (qmail 25292 invoked from network); 23 Feb 1999 10:27:03 -0000 Date: Tue, 23 Feb 1999 11:26:21 +0100 (MET) Message-Id: <199902231026.LAA24103@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@sunsite.auc.dk In-reply-to: "Andrej Borsenkow"'s message of Tue, 23 Feb 1999 13:03:49 +0300 Subject: Re: change to __path_files and clean up of Functions/Completion needed Andrej Borsenkow wrote: > # This function behaves as if you have a matcher definition like: > # compctl -M 'r:|[-.,_/]=* r:|=* m:{a-z}={A-Z} m:-=_ m:.=,' \ > # 'm:{a-z}={A-Z} l:|=* r:|=*' > # so you may want to modify this. > > I think, it is unacceptable. It is the same, as if users had to modify C > sources to change compctl behaviour. I don't think so. This is shell code after all. I agree, though, that we draw more attention to this -- I added the comment for this but I know that this may be not enough. This function was initially written to show some of the nice things that can be done with the new completion stuff. > I'd suggest, that __path_files would > take -M argument to do the same. Functions like `_path_files' do all the the matching themselves. If we make them get only a `-M ...' argument, the function would have to parse it and derive a set of `:gs/.../.../' modifiers from it. This can get so hard, I don't even want to think about implementing it. But I just had another idea: add two autoloaded functions: `_match_test' and `_match_pattern' or something like that. Functions like `_path_files' would call the first one at the beginning: _match_test || return This function would test the value of `MATCHER' to see if the calling function should try to build matches, the standard implementation would be: (( MATCHER == 1 )) The function `_match_pattern' would be called with the name of a parameter. It's duty is to modify the value of this parameter so that it contains the pattern to use for matching. The standard implementation would be an empty function. That way the user can supply for the match-specs he uses (more precisely: for the match specs he wants to use in such functions) by simply writing files into a directory that is searched before the standard directory. As a reply to your other mail: yes, maybe we should already start splitting the contents of the directory. Currently this was intended as a repository from which users might copy the files they want into some other directory. Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de