zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: zsh-workers@sunsite.dk
Subject: Re: How to complete backquote, etc. using compsys?
Date: Wed, 29 Aug 2001 18:31:04 +0100	[thread overview]
Message-ID: <3B8D26D8.A1598021@yahoo.co.uk> (raw)
In-Reply-To: <1010828155058.ZM2724@candle.brasslantern.com>

Bart Schaefer wrote:
> 
> } how can it tell it's in $(...)?
> 
> Hmm, at the moment perhaps it doesn't, but it could look at $LBUFFER to
> find out.

Parsing $LBUFFER correctly to avoid any quoted $( and matching the
closing brackets wouldn't be easy. No doubt, the C code already has this
information. As you tried, it won't give it to us with %_ but it'd be
better in somewhere like compstate anyway.

> The problem is that you end up with too many layers of autoremovable
> suffixes.  When completing a path name within backticks, you can't
> get both the trailing / on a directory name and the trailing backtick.

Multiple layers of autoremovable suffixes is clearly one of the things
that needs some thought. Possibly all should be added but they would
each have separate lists of characters which would result in their
removal. Then if a suffix is auto-removed, subsequent suffixes also need
removing.

When adding matches for completion, it is common (such as with
directories in _files or `http://' in _urls that the match only makes up
a part of what the function completes (such as `http://' which is
clearly only a partical url). So _urls does not add any suffixes it was
passed with -S and anything like backquotes should also not be added.
The opposite is also simple where a function completes something which
can only be the final portion and so any suffixes are added.
Auto-removable suffixes are a nice way of handling things which can be
final or partial and it can vary as to which is the best assumption
hence the need for a better system for defining what it'll do.

> } Also, without multios the closing
> } bracket of $(<...) should always be completed.
> 
> It would have to be an autoremovable suffix, too; `echo $(<file wc)' is
> a silly example of why.

I never knew you could do that. Still, ')' as an autoremovable suffix
would be better behaviour than the current situation.

Oliver

_____________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp


  reply	other threads:[~2001-08-29 17:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20010821204255.64C6417403@puel.sfc.wide.ad.jp>
     [not found] ` <3B84D18C.19BA712@yahoo.co.uk>
     [not found]   ` <1010823180146.ZM25810@candle.brasslantern.com>
     [not found]     ` <3B8B6600.54A33D8E@yahoo.co.uk>
2001-08-28 15:50       ` Bart Schaefer
2001-08-29 17:31         ` Oliver Kiddle [this message]
2001-08-29 17:52           ` Bart Schaefer
2001-08-29 21:06             ` Zefram
2001-08-30  0:07               ` 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=3B8D26D8.A1598021@yahoo.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@sunsite.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).