Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: compset -q oddities
- X-seq: zsh-workers 39322
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: compset -q oddities
- Date: Wed, 14 Sep 2016 09:04:57 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=KSLKn0kLtZW2Vcyomx1Igf6reF/Av8lCrfpicLLKlzc=; b=uMboX4d6T7T3zFSbTXYIADdYl4od0tNSlz528FtoI96IF5Jp7M+Y5eX/MZwbpymZC+ qlwkW49eFvqHrzr3AuuSkFcfeYnN2tF4zktPK7m0kfCxo7kVM30LfPdwOC/FnqEQlqQG 9TT6mqnXSWGStsunkTB016ulY073a4N6JhHB137z2ErhdKjpIUqEZJgnCEObxWAsncSd A/ZJZazHgNnbh8TrkHfA2c335iENr4Hl7+u4yxywFbN5+Yr6nS9o+6eHVntfjgU6SLrf LWx0dLWpQnUt8gIUNbiQeI2M3QDSc6jRAY8vL/OfXVmMY/Q0GbO7NQexbuIu3RLPsc4x GMfA==
- In-reply-to: <20160914093146.08a2c090@pwslap01u.europe.root.pri>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20160911073031.GA19137@fujitsu.shahaf.local2> <160911191422.ZM21970@torch.brasslantern.com> <20160912230632.GA29577@fujitsu.shahaf.local2> <160912232853.ZM27002@torch.brasslantern.com> <20160914032254.GA32528@fujitsu.shahaf.local2> <CGME20160914052047eucas1p13386804ba0e1bca01d29b380fee88b2a@eucas1p1.samsung.com> <160913222029.ZM13117@torch.brasslantern.com> <20160914093146.08a2c090@pwslap01u.europe.root.pri>
On Sep 14, 9:31am, Peter Stephenson wrote:
} Subject: Re: compset -q oddities
}
} On Tue, 13 Sep 2016 22:20:29 -0700
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > Well, no, not really. "compset -q" should make note that there were
} > no quotes when it was called, and therefore not restore any quote on
} > the way back out. There's a comment above compcore.c:307
} >
} > /*
} > * It looks like we may need to do stuff with backslashes even
} > * if instring is QT_NONE.
} > */
}
} I think the point is related to the fact that in the case of backslashes
} we never know there are no quotes.
Aha. So if we see a word that starts with backslash, instring will be
QT_BACKSLASH, but when instring is QT_NONE, we do not know whether any
other backslashes appear in the middle of the word.
However, as I said in a previous reply:
>> The problem isn't really with the backslash being added there, it's
>> somewhere later on when the prefix is being compared to the candidate
>> match and one side of gets too much (? different?) quoting before the
>> comparison is made.
That later stage [wherever it is, I suspect comp_match()] also expects
that quoting has been manipulated in this way, and so if it has *not*
(I played with compcore.c:307) then strings that should match, do not.
The problem is that we have [at least] three sources of data: The
literal command line, the (possibly quoting-manipulated) subset of
the command line against which completion is being attempted, and the
candidate matches passed to compadd. Canonicalizing in a way that
makes it possible to compare any two of the three is very difficult.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author