zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: Re: change to __path_files and clean up of Functions/Completion needed
Date: Tue, 23 Feb 1999 11:26:21 +0100 (MET)	[thread overview]
Message-ID: <199902231026.LAA24103@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Andrej Borsenkow"'s message of Tue, 23 Feb 1999 13:03:49 +0300


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


         reply	other threads:[~1999-02-23 10:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-25 15:02 Sven Wischnowsky
1999-02-25 16:42 ` completion cleanup discussion + patch Peter Stephenson
1999-02-23 10:26   ` Sven Wischnowsky [this message]
1999-02-25 13:32     ` change to __path_files and clean up of Functions/Completion needed Andrej Borsenkow
1999-02-26  6:39       ` completion cleanup discussion Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199902231026.LAA24103@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@sunsite.auc.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).