zsh-workers
 help / color / mirror / code / Atom feed
From: Marlon Richert <marlon.richert@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Don't complete escaped words as aliases
Date: Sat, 13 Nov 2021 19:11:31 +0200	[thread overview]
Message-ID: <CAHLkEDtn21jk2WdDAYzMeL=GioSAvXANA1+mCLFSLYSG3nk66w@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3RJRWZJFdbFeT_ujUAi6kTxa3DgHXT7q7UFedfcvMQ1pw@mail.gmail.com>

On Sat, Nov 13, 2021 at 9:02 AM Mikael Magnusson <mikachu@gmail.com> wrote:
>
> On 11/12/21, Marlon Richert <marlon.richert@gmail.com> wrote:
> > It doesn't make sense to complete \escaped 'words' as aliases, since
> > they won't be expanded as aliases either.
>
> Would this break aliases of this form?
>
> % alias 'foo\bar'=echo\ hi
> % foo\bar
> hi

I think "break" is a bit of an overstatement. These aliases will still
be expanded once the command line has been accepted. They just won't
be completed.

If we require that aliases of that form are still completed, an
alternative could be to do `local +h PREFIX=$words[CURRENT] SUFFIX=`
before calling alias completion. The drawback to that approach is that
it effectively negates COMPLETE_IN_WORD. Getting unquoted versions of
$PREFIX and $SUFFIX, however, doesn't appear to be possible within a
completion function.

Would this be preferable? I can make that change. No other
alternatives come to mind right now.


  reply	other threads:[~2021-11-13 17:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-12 21:34 Marlon Richert
2021-11-13  7:02 ` Mikael Magnusson
2021-11-13 17:11   ` Marlon Richert [this message]
2021-11-13 20:59     ` Bart Schaefer
2021-11-14 13:02       ` Oliver Kiddle

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='CAHLkEDtn21jk2WdDAYzMeL=GioSAvXANA1+mCLFSLYSG3nk66w@mail.gmail.com' \
    --to=marlon.richert@gmail.com \
    --cc=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /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).