zsh-workers
 help / color / mirror / code / Atom feed
* Re: new completion modifications
@ 2001-03-26  8:49 Sven Wischnowsky
  0 siblings, 0 replies; 7+ messages in thread
From: Sven Wischnowsky @ 2001-03-26  8:49 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Mar 23,  2:16pm, Peter Stephenson wrote:
> } Subject: Re: new completion modifications
> }
> } Sven wrote:
> } > This seems reasonable.  Question to everyone (and -workers in
> } > particular): should we add a `urls' style, comparable to `hosts' and
> } > such, that just gives a bunch of strings to complete as urls?
> } > Probably taking precedence over the other things (different from
> } > `hosts' and friends).
> } 
> } Something like this.
> 
> That, and/or a flat file of URLs rather than a directory structure.  Hmm,
> we could have the following styles for the `urls' tag:
> 
> 	file	-- flat file containing URLs to complete (new?)
> 	local	-- prefixes for completing local URLs (exists now)
> 	path	-- location of directory tree mapping URLs (exists)
> 	urls	-- array of URLs to complete (new?)
> 
> I'm not sure about the names "file" and "path", but ...

Hmhm.

> } I don't know if it's going to be a problem with it always taking
> } precedence, however; one of these simple ones can then mask any of the
> } other sort if you just type a fairly generic prefix.
> 
> I don't think that's a problem because the tag is always `urls'; they'd
> just be in different groups.  Am I confused?

With the same tag (or without using group-names) they'd be in the same 
group.  But of course we can also make the other things take
precedence or give them all the same precedence so that users who use
more than one mechanism see all of them at the same time.  And of
course we can use different tags leaving it to the user's tag-order
setting.

> } (Does anyone else use _next_tags?)
> 
> I have, but rarely.

I have sometimes, too.  I need to remember it more often...


Oliver Kiddle wrote:

> Sven Wischnowsky wrote:
> > 
> > This seems reasonable.  Question to everyone (and -workers in
> > particular): should we add a `urls' style, comparable to `hosts' and
> > such, that just gives a bunch of strings to complete as urls?
> > Probably taking precedence over the other things (different from
> > `hosts' and friends).
> 
> I would prefer it if we could come up with a more general solution to
> this issue - I've seen other places where I've done repeated tabs. Also,
> the behaviour would be useful if the local style is the only one used
> for urls.

The problem I have with the current way to specify URLs is not the
repeated tabs, it's that it much more complicated to set up then
needed (for some, like the original poster).

> Is there maybe a way that you could get the completion system to have
> another go at completion straight away if it has just inserted a string
> unambigously. This could avoid the repeated tab situations. It would
> have to be configurable to only work in specific contexts with a style .
> This could be used in other cases.

But anyway, this is a good idea.  I know I thought about this some
time ago and thought I mentioned it here (but I'm not sure).

The problem is to find out when to stop.  And that the only way to
implement it I can currently see is some kind of wrapper around
_main_complete.  Although that could be just another widget, that
might be bound to TAB.

Hm.  Something as simple as:

    zle -N frob

    frob() {
      zle complete-word
      while [[ $_lastcomp[nmatches] -eq 1 && $RBUFFER[-1] != [[:blank:]] ]]; do
        zle complete-word
      done
    }

already does part of it, though not nicely.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
  2001-03-27 11:06 Sven Wischnowsky
@ 2001-03-27 17:57 ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-03-27 17:57 UTC (permalink / raw)
  To: zsh-workers

On Mar 27,  1:06pm, Sven Wischnowsky wrote:
}
}   path -- removed
}   urls -- if it has only one value
}             if that is the name of a directory: like path now
}             elif it is the name of a normal file: list of urls from the file
}           otherwise the values are the urls
} 
} In any case local is unchanged.

This would be fine with me.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
@ 2001-03-27 11:06 Sven Wischnowsky
  2001-03-27 17:57 ` Bart Schaefer
  0 siblings, 1 reply; 7+ messages in thread
From: Sven Wischnowsky @ 2001-03-27 11:06 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Mar 23,  2:16pm, Peter Stephenson wrote:
> } Subject: Re: new completion modifications
> }
> } Sven wrote:
> } > This seems reasonable.  Question to everyone (and -workers in
> } > particular): should we add a `urls' style, comparable to `hosts' and
> } > such, that just gives a bunch of strings to complete as urls?
> } > Probably taking precedence over the other things (different from
> } > `hosts' and friends).
> } 
> } Something like this.
> 
> That, and/or a flat file of URLs rather than a directory structure.  Hmm,
> we could have the following styles for the `urls' tag:
> 
> 	file	-- flat file containing URLs to complete (new?)
> 	local	-- prefixes for completing local URLs (exists now)
> 	path	-- location of directory tree mapping URLs (exists)
> 	urls	-- array of URLs to complete (new?)
> 
> I'm not sure about the names "file" and "path", but ...

After thinking again... do we really need two new style?  Or any?

E.g.:

  path -- unchanged
  urls -- if it has only one value and that is the name of a file,
          take the urls from that file

or:

  path -- if the value names a directory, use as we use it now, if it
          names a normal file, take the urls from it
  urls -- just a list of urls

or:

  path -- removed
  urls -- if it has only one value
            if that is the name of a directory: like path now
            elif it is the name of a normal file: list of urls from the file
          otherwise the values are the urls

In any case local is unchanged.

After all, how often would one want to use more than one setup?


Bye
 Sven


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
       [not found] <200103231407.PAA07685@beta.informatik.hu-berlin.de>
  2001-03-23 14:16 ` Peter Stephenson
@ 2001-03-25 14:21 ` Oliver Kiddle
  1 sibling, 0 replies; 7+ messages in thread
From: Oliver Kiddle @ 2001-03-25 14:21 UTC (permalink / raw)
  Cc: Zsh workers

Sven Wischnowsky wrote:
> 
> This seems reasonable.  Question to everyone (and -workers in
> particular): should we add a `urls' style, comparable to `hosts' and
> such, that just gives a bunch of strings to complete as urls?
> Probably taking precedence over the other things (different from
> `hosts' and friends).

I would prefer it if we could come up with a more general solution to
this issue - I've seen other places where I've done repeated tabs. Also,
the behaviour would be useful if the local style is the only one used
for urls.

Is there maybe a way that you could get the completion system to have
another go at completion straight away if it has just inserted a string
unambigously. This could avoid the repeated tab situations. It would
have to be configurable to only work in specific contexts with a style .
This could be used in other cases.

Oliver



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
  2001-03-23 14:16 ` Peter Stephenson
@ 2001-03-24 19:45   ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-03-24 19:45 UTC (permalink / raw)
  To: Zsh hackers list

On Mar 23,  2:16pm, Peter Stephenson wrote:
} Subject: Re: new completion modifications
}
} Sven wrote:
} > This seems reasonable.  Question to everyone (and -workers in
} > particular): should we add a `urls' style, comparable to `hosts' and
} > such, that just gives a bunch of strings to complete as urls?
} > Probably taking precedence over the other things (different from
} > `hosts' and friends).
} 
} Something like this.

That, and/or a flat file of URLs rather than a directory structure.  Hmm,
we could have the following styles for the `urls' tag:

	file	-- flat file containing URLs to complete (new?)
	local	-- prefixes for completing local URLs (exists now)
	path	-- location of directory tree mapping URLs (exists)
	urls	-- array of URLs to complete (new?)

I'm not sure about the names "file" and "path", but ...

} I don't know if it's going to be a problem with it always taking
} precedence, however; one of these simple ones can then mask any of the
} other sort if you just type a fairly generic prefix.

I don't think that's a problem because the tag is always `urls'; they'd
just be in different groups.  Am I confused?

} (Does anyone else use _next_tags?)

I have, but rarely.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
       [not found] <200103231407.PAA07685@beta.informatik.hu-berlin.de>
@ 2001-03-23 14:16 ` Peter Stephenson
  2001-03-24 19:45   ` Bart Schaefer
  2001-03-25 14:21 ` Oliver Kiddle
  1 sibling, 1 reply; 7+ messages in thread
From: Peter Stephenson @ 2001-03-23 14:16 UTC (permalink / raw)
  To: Zsh hackers list

Sven wrote:
> This seems reasonable.  Question to everyone (and -workers in
> particular): should we add a `urls' style, comparable to `hosts' and
> such, that just gives a bunch of strings to complete as urls?
> Probably taking precedence over the other things (different from
> `hosts' and friends).

Something like this.  I don't know if it's going to be a problem with it
always taking precedence, however; one of these simple ones can then mask
any of the other sort if you just type a fairly generic prefix.  But maybe
it works OK in practice.  If they used different tags, you could used
`_next_tags' to get round this.  (Does anyone else use _next_tags?)

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: new completion modifications
       [not found] ` <20010322102147.9030.qmail@web9301.mail.yahoo.com>
@ 2001-03-22 18:11   ` Bart Schaefer
  0 siblings, 0 replies; 7+ messages in thread
From: Bart Schaefer @ 2001-03-22 18:11 UTC (permalink / raw)
  To: zsh-workers

On Mar 22, 11:00am, Sven Wischnowsky wrote:
} Subject: Re: new completion modifications
}
} To -workers: for some commands (including `rlogin', I think) we could
} make the completion function more tolerant by adding `-A "-*"'s to the 
} calls to _arguments.

This sounds like a good idea.  However, I don't think it will work for
rlogin, because some versions of rlogin require you to give the remote
host name BEFORE the options, e.g. `rlogin wilma -l fred'.

On Mar 22, 10:21am, Oliver Kiddle wrote:
} Subject: Re: new completion modifications
}
} Note to -workers - should _ssh be completing for ssh1 and ssh2 too?

Probably wouldn't hurt, although the options for ssh1/ssh2/openSSH are
a bit different.  (It looks as if _ssh is set up for openssh options,
except that ssh-keygen completion doesn't know about -d for DSA keys.)

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-03-27 17:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26  8:49 new completion modifications Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2001-03-27 11:06 Sven Wischnowsky
2001-03-27 17:57 ` Bart Schaefer
     [not found] <200103231407.PAA07685@beta.informatik.hu-berlin.de>
2001-03-23 14:16 ` Peter Stephenson
2001-03-24 19:45   ` Bart Schaefer
2001-03-25 14:21 ` Oliver Kiddle
     [not found] <200103221000.LAA05184@beta.informatik.hu-berlin.de>
     [not found] ` <20010322102147.9030.qmail@web9301.mail.yahoo.com>
2001-03-22 18:11   ` Bart Schaefer

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).