zsh-workers
 help / color / mirror / code / Atom feed
From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@math.gatech.edu
Subject: Re: Compctl completion tweaking
Date: Wed, 1 Jul 1998 08:13:11 +0200 (MET DST)	[thread overview]
Message-ID: <199807010613.IAA21953@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Tue, 30 Jun 1998 12:02:24 -0700


Bart Schaefer wrote:

> ...
> 
> This brings up a general question, then.  Suppose for the moment that we
> do choose ++ to mean inclusive-or.  Suppose I have:
> 
>     compctl -x 'c[-1,-m]' -P '%' -u ++ -P '+' -f -W ~/Mail -- zmail
> 
> I.e., "user names prefixed with % or files in ~/Mail prefixed with +".  
> What does the list of completions look like before any + or % is present
> on the command line?  If there's both a file and a user named "schaefer",
> which prefix gets inserted?
> 

This is one of the things I am worrying about (and which kept me from
trying to implement it...).

First, I would try to change the behaviour of -P (and -S) so that they 
are not inserted straight away, but instead saved together with the
corresponding matches (one of the reasons to store prefixes and
suffixes with the matches). Then, if we find out that only one prefix
is used for all matches, it becomes easy. Otherwise (the case you
described above), if menucompletion or automenu is used, the prefixes
are walked through, too (note also, that storing prefixes and suffixes 
that have to be inserted into the command line with the matches
inhibits removing matches that merely have the same matching word, so
in your example we would have `schaefer' with `+' and `schaefer' with
`%' in the list of matches). If menucompletion is not used, we could
at least try to insert the unambiguous part (`schaefer'), leaving the
cursor at the place where the ambiguous part began, the user would
have to insert something to make it unambiguous, of course. In your
example where we only had one-character-prefixes, this is pretty
simple (typing either `+' or `%'). More problematic is the case where
we have prefixes like, say `barrr' and `bazzz'. The completion code
would insert the `ba', leaving the cursor after it to let the user
make it unambiuous. With completeinword set, the user could type
either `r' or `z' and then start completion to let zsh insert the
rest, but without completeinword (and without automenu), the user
would have to type `rrr' or `zzz' which is a bit ugly.

So, does this seem to make sense?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


             reply	other threads:[~1998-07-01 12:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-01  6:13 Sven Wischnowsky [this message]
1998-07-03 19:33 ` Bart Schaefer
  -- strict thread matches above, loose matches on Subject: below --
1998-07-06  6:37 Sven Wischnowsky
1998-06-30  5:49 Sven Wischnowsky
1998-06-30 19:02 ` Bart Schaefer
1998-06-29  8:40 Sven Wischnowsky
1998-06-29 15:48 ` Bart Schaefer
1998-06-26  5:44 Sven Wischnowsky
1998-06-26 18:59 ` Bart Schaefer
1998-06-24 11:00 Andrej Borsenkow
1998-06-24  7:13 Sven Wischnowsky
1998-06-25 19:08 ` Bart Schaefer
1998-06-24  6:19 Sven Wischnowsky
     [not found] <358FC264.1C7A9EFA@bigfoot.com>
1998-06-23 19:04 ` 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=199807010613.IAA21953@beta.informatik.hu-berlin.de \
    --to=wischnow@informatik.hu-berlin.de \
    --cc=zsh-workers@math.gatech.edu \
    /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).