zsh-workers
 help / color / mirror / code / Atom feed
From: Tanaka Akira <akr@jaist.ac.jp>
To: zsh-workers@sunsite.auc.dk
Subject: Re: Completion problems.
Date: 03 Aug 1999 03:03:05 +0900	[thread overview]
Message-ID: <rsq3dy22h7q.fsf@crane.jaist.ac.jp> (raw)
In-Reply-To: Sven Wischnowsky's message of "Mon, 2 Aug 1999 12:58:55 +0200 (MET DST)"

In article <199908021058.MAA12713@beta.informatik.hu-berlin.de>,
  Sven Wischnowsky <wischnow@informatik.hu-berlin.de> writes:

> That's wrong, too. Again, this is a problem with the recently changed
> quoting behaviour. The prefix is reported in quoted form and appended
> and prepended to IPREFIX/ISUFFIX -- which will be quoted again when it 
> is inserted.

Thanks. It is fixed.  But such a unquoting/re-quoting seems bit
problematic with variables.

Z(3):akr@is27e1u11% Src/zsh -f
is27e1u11% fpath=($PWD/Completion/*(/)); autoload -U compinit; compinit -D; compdef _tst tst
is27e1u11% _tst () { compset -P '*/'; compadd tst }
is27e1u11% var=val
is27e1u11% tst $var/<TAB>

Then, the last line is changed to:

is27e1u11% tst \$var/tst 

I think automatic unquoting/re-quoting is dangerous.

Since the completion code works on quoted form and unquoted form is
only interesting to usual completers, definitely the conversion
between these forms is required. But it is sometimes very difficult or
even impossible.

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>

So, I think that it is dangerous decision to embed the quoting stuff
into the completion code.

I think that it is right way to separate the quoting stuff to builtin
or variable expansion.

Also, I don't like re-quoting such as:

% tst a'#'/<TAB>
->
% tst a\#/...

My expectation to completion is simply inserting something into cursor
position. So re-quoting surprise me.  If the quoting stuff is
separated, customizing these behaviours may be easier.

Also, making the quoting stuff usable from completers is useful for
checking the array words. For example, currentry, following does not
work because contents of words are quoted form and $words[2] is
"'-d'".

% cvs '-d' <TAB>

If _cvs can unquote the word safely, _cvs can determin options more
precisely.
(Although we can use eval, I think eval is evil.)
-- 
Tanaka Akira


  reply	other threads:[~1999-08-02 18:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-02 10:58 Sven Wischnowsky
1999-08-02 18:03 ` Tanaka Akira [this message]
  -- 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  9:37 Sven Wischnowsky
1999-08-04 17:00 ` Bart Schaefer
1999-08-06 18:53 ` Tanaka Akira
1999-08-04  7:36 Sven Wischnowsky
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=rsq3dy22h7q.fsf@crane.jaist.ac.jp \
    --to=akr@jaist.ac.jp \
    --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).