help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Why is an 'x' appended in _prefix completer?
Date: Thu, 9 Mar 2023 09:21:53 +0000 (GMT)	[thread overview]
Message-ID: <2022992152.13489.1678353713103@mail.virginmedia.com> (raw)
In-Reply-To: <CAH+w=7Z7Xm-HkwJmWB8ZuUJ5EnU1Sbg3_tH7AevXtYV+bDE0ww@mail.gmail.com>

> On 08/03/2023 17:48 Bart Schaefer <schaefer@brasslantern.com> wrote:
> On Wed, Mar 8, 2023 at 4:49 AM Mikael Magnusson <mikachu@gmail.com> wrote:
> >
> > See the comment above addx() in zle_tricky.c and get_comp_string() (i
> > don't actually recommend looking at this code).
> I always wondered why Sven chose to use "x" instead of, say, something
> out-of-band / non-printable.  I guess with metafication etc. maybe
> there wasn't any such thing.
> Anyway, as I recall it, the point of the extra character is to help
> completion distinguish the position of word breaks when completing
> somewhere other than at end of line.

That's a pretty obscure and undocumented effect at the point in question,

      compadd -U -i "$IPREFIX" -I "$ISUFFIX" - "${compstate[unambiguous]%$suf}x"

compadd shouldn't be making this visible to shell code.

This is something to do with inserting an unambiguous prefix; I haven't worked
out on what occasions this line would be hit.  I would guess the _prefix
completer isn't used all that widely?


  reply	other threads:[~2023-03-09  9:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 10:32 Marlon Richert
2023-03-08 12:48 ` Mikael Magnusson
2023-03-08 17:48   ` Bart Schaefer
2023-03-09  9:21     ` Peter Stephenson [this message]
2023-03-09 15:29       ` Bart Schaefer
2023-04-11  9:49 Marlon Richert

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2022992152.13489.1678353713103@mail.virginmedia.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \


* 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


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