From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completion problems.
Date: Wed, 4 Aug 1999 17:00:44 +0000 [thread overview]
Message-ID: <990804170044.ZM14586@candle.brasslantern.com> (raw)
In-Reply-To: <199908040937.LAA15313@beta.informatik.hu-berlin.de>
On Aug 4, 11:37am, Sven Wischnowsky wrote:
} Subject: Re: Completion problems.
}
} Tanaka Akira wrote:
}
} > In following examples, unquoted forms are not known until runtime.
} >
} > % if some-complex-command; then var=xxx; else var=yyy; fi; tst $var/<TAB>
} > % tst $(some-complex-command)/<TAB>
}
} I see two ways to go: 1) completely change the completion code to
} report strings in unquoted form or 2) add a parameter expansion
} modifier which does something like the opposite of `:q'.
I think (2) would be quite useful in other contexts anyway. Perhaps (Q)?
(And we could add (q) which means the same as :q, just for completeness.)
There is some question about what paramter unquoting should do in the case
of mismatched quotes. I can think of cases where you'd want it to produce
the same errors as using that same quoting in a command, and other cases
(like completion) where you'd just like it to assume the closing quote.
} [...] with match specs using `*'-patterns new stuff can be inserted
} anywhere in the word. To retain the single quotes the completion code
} would have to keep track of the original positions and would have to
} calculate the new positions for every single or double quote inside
} the word. This is extremly difficult, expensive (i.e. slow), and at
} least I wouldn't implement it (if anyone else is interested: try to
} find out how the completion code now handles completion inside braces
} -- you would have to do something similar, but not only for two
} places, but for a whole list of positions).
I almost hate to mention this, but braces can be nested, and right now
completion doesn't work in that case -- presumably *because* it isn't
keeping track of a list of positions.
There are similar (?) problems with nested parameter substitutions:
zagzig<1> echo ${${p<TAB>
path perl prompt psvar
zagzig<1> echo ${${pa<TAB>
zagzig<1> echo ${${path}
^Cursor is now here; arguably no space should
have been added, because it can't possibly be
correct in that context. Also, if you now type
a right-curly, the trailing space is deleted,
but the right-curly is not inserted (which I
guess is theoretically correct).
BTW, expand-or-complete is a pain in the butt when combined with braces,
because as soon as you close the braces the next TAB *expands* them,
leaving you with multiple half-finished words. You can prevent this by
setting GLOB_COMPLETE, but in that case completion after the right-brace
still doesn't work.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
next prev parent reply other threads:[~1999-08-04 17:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-08-04 9:37 Sven Wischnowsky
1999-08-04 17:00 ` Bart Schaefer [this message]
1999-08-06 18:53 ` Tanaka Akira
-- strict thread matches above, loose matches on Subject: below --
1999-08-09 9:58 Sven Wischnowsky
1999-08-05 10:56 Sven Wischnowsky
1999-08-04 7:36 Sven Wischnowsky
1999-08-02 10:58 Sven Wischnowsky
1999-08-02 18:03 ` Tanaka Akira
1999-07-27 9:53 Tanaka Akira
1999-04-27 16:12 completion problems Sven Wischnowsky
1999-04-28 20:32 ` Tanaka Akira
1999-04-28 21:45 ` Vin Shelton
1999-04-27 14:26 Tanaka Akira
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=990804170044.ZM14586@candle.brasslantern.com \
--to=schaefer@candle.brasslantern.com \
--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).