zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-workers@zsh.org
Subject: Re: [PATCH?] Re: Autocorrect for commands with a hyphen (dash) in the name
Date: Sat, 23 May 2020 21:30:58 +0100	[thread overview]
Message-ID: <b20887d9dee281c346812e19b41b22f6d5cd7b97.camel@ntlworld.com> (raw)
In-Reply-To: <CAH+w=7ar8HHOG-T2EXqwVKTFFPjmrtM0L1XMo90vW+Sed=ESjA@mail.gmail.com>

On Sat, 2020-05-23 at 12:54 -0700, Bart Schaefer wrote:
> On Sat, May 23, 2020 at 12:45 PM Peter Stephenson
> <p.w.stephenson@ntlworld.com> wrote:
> > 
> > On Sat, 2020-05-23 at 12:33 -0700, Bart Schaefer wrote:
> > > [Moving to -workers from -users]
> > > 
> > > On Tue, May 19, 2020 at 2:25 PM Bart Schaefer <schaefer@brasslantern.com> wrote:
> > > > 
> > > > So, the following?  Or should this also have the equivalent of
> > > > 
> > > >             if (*w == Tilde || *w == Equals || *w == String)
> > > >                 *x = *w;
> > > 
> > > Any comment on this?
> > 
> > I don't think you need to put back tokens.
> 
> Good point.
> 
> What about the special handling for Tilde et al?  That precedes the
> spckword() call in zle_tricky.c

Yes, I guess you need to skip over those before untokenizing.  That matches
this line in spckword():

    if (*t == Tilde || *t == Equals || *t == String)
	t++;

The next block is then skipping other tokens.  I wonder if that
would be the right place to put the surgery?  E.g. if thereʼs
a Dash or anything else we want to be able to treat literally, dupstring
at that point within spckword() and replace those?

However, thatʼs late enough that itʼs past the point where we check the
word isnʼt already found in a hash table --- and presumably we need at
least to have the dashes fixed by that point.  But still not sure we
actually need two separate token-based interventions.

pws


  reply	other threads:[~2020-05-23 20:31 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOoO2vg=-9P7v=ATOzrbh6VF35o_xzK_-yF+EA6OgTHsQBik-A@mail.gmail.com>
     [not found] ` <CAH+w=7bKpm7GO2ZhbA5Apr0sBDz5=kmX1=WK2X0nTcWxpkHPPQ@mail.gmail.com>
     [not found]   ` <ab8b7655-83e8-45b2-889f-043314faea62@www.fastmail.com>
     [not found]     ` <CAH+w=7aqAO37qpSvtmJXMPWq3zP=pUAZCe3i-BFyn0knRmFjVQ@mail.gmail.com>
2020-05-23 19:33       ` Bart Schaefer
2020-05-23 19:44         ` Peter Stephenson
2020-05-23 19:54           ` Bart Schaefer
2020-05-23 20:30             ` Peter Stephenson [this message]
2020-05-23 21:18               ` Bart Schaefer
2020-05-24 17:11                 ` Peter Stephenson
2020-05-24 18:39                   ` Bart Schaefer
2020-05-25  5:46                     ` Bart Schaefer
2020-05-25 16:35                       ` Peter Stephenson
2020-05-25 21:45                         ` Bart Schaefer
2020-05-30 21:25                           ` Bart Schaefer

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=b20887d9dee281c346812e19b41b22f6d5cd7b97.camel@ntlworld.com \
    --to=p.w.stephenson@ntlworld.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).