Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14235

Re: [PATCH] Add nofirstword completion option

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Luca Boccassi <bluca@debian.org>
Newsgroups gnu.bash.bug
Subject Re: [PATCH] Add nofirstword completion option
Date Tue, 12 Jun 2018 20:15:00 +0100
Lines 91
Approved bug-bash@gnu.org
Message-ID <mailman.1767.1528830912.1292.bug-bash@gnu.org> (permalink)
References <20180518110611.5099-1-bluca@debian.org> <96bcb197-40d1-aac8-c214-c513a6db805d@case.edu> <1527068652.6997.5.camel@debian.org> <76b1d3fa-4cb1-3e70-d93c-ada07c04dfa2@case.edu> <1527082457.6997.14.camel@debian.org> <4ccfc554-15a9-2ec1-55e1-b2df687f0bee@case.edu> <1527270167.6997.22.camel@debian.org> <3a98f6c5-0f1e-54aa-491c-da7100430ce8@case.edu> <1527605096.6997.27.camel@debian.org> <1527860403.6997.72.camel@debian.org> <1528468856.6554.6.camel@debian.org> <e33be886-7975-2e2f-d2d9-a45e24408f72@case.edu> <1528824534.6554.23.camel@debian.org> <c73f2b22-ee77-1ef9-3762-323aa381554e@case.edu>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-kRJmMf+qut73i3vPpGJ5"
X-Trace usenet.stanford.edu 1528830912 19555 208.118.235.17 (12 Jun 2018 19:15:12 GMT)
X-Complaints-To action@cs.stanford.edu
To chet.ramey@case.edu, bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:mime-version; bh=ULf6/k/y0oHOzbyVLOR2mQPZcUIRQ8T5K398oOCECB4=; b=K0keJkuW+4B+D2NRJRCkoLuZx54R/sPJsHeVy3AHq2h0NR1rnGsLMtXUWjZLU5WYMi 9nq/JcFZkK5K1mHpjN3c2PGbjxjlmSOmZAH4Z6qzuTOvu1gYszHvuTgdcF7nGp0eFUi6 ExOAgUemuk5mxIM8NGmpoWjV25q0lbMe9sJBtPCIE92xVQ2PUolKnhtbKhYQXp1NFtcH /a9pasqyfevW1VGONjp7H0XXxKzOmbX8Cg5BdXypZKWJbvpZdWRPoZIzn5N5IjAkiLcr cjBtHaxtqWElZr7cN3SgxWcXmuz/l5ICgDfyc2iA8v/JXGCAPXmUDjnZ5VS6EdDke2s3 LkTw==
X-Gm-Message-State APt69E2gMNqH3HEEHCbwKoAwYr9RfnPP/4i1mnWgufGHyq8z36ppYfky wm0z1xbUFWyklGSS+dClggo=
X-Google-Smtp-Source ADUXVKLRQc80hUxNmkLb9UkcTG01kwZ3nw+SO8KBGxAsvPF/lhVN4enjCs6K92VbOXPj6XROuoNHFg==
X-Received by 2002:a1c:1815:: with SMTP id 21-v6mr1331128wmy.72.1528830903561; Tue, 12 Jun 2018 12:15:03 -0700 (PDT)
In-Reply-To <c73f2b22-ee77-1ef9-3762-323aa381554e@case.edu>
X-Mailer Evolution 3.22.6-1+deb9u1
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy]
X-Received-From 74.125.82.66
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14235

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Tue, 2018-06-12 at 14:54 -0400, Chet Ramey wrote:
> On 6/12/18 1:28 PM, Luca Boccassi wrote:
> > On Fri, 2018-06-08 at 11:03 -0400, Chet Ramey wrote:
> > > On 6/8/18 10:40 AM, Luca Boccassi wrote:
> > > 
> > > > Any chance you had a sec to look at the diff? Would love some
> > > > feedback!
> > > 
> > > I'm going to try and look at it this weekend. It's been a busy
> > > couple
> > > of
> > > months.
> > 
> > Hi Chet,
> > 
> > I've seen that the change is now in the devel branch, thank you so
> > much!
> > I also like way more the new option name, definitely clearer :-)
> > 
> > One difference I noticed with the previous version is that when
> > trying
> > to complete a command when the line starts with an empty space (eg:
> > to
> > avoid the history) the initial word programmable completion doesn't
> > happen.
> > 
> > It seems to hit the following branch:
> > 
> >        else if (s >= e && n[0] == '\0' && text[0] == '\0' && start
> > > 0)
> >          {
> >            foundcs = 0; /* empty command name following assignments
> > */
> >            in_command_position = was_assignment;
> >          }
> > 
> > Given was_assignment is 0, then the programmable completion is
> > later
> > not attempted.
> > 
> > Since that branch matches an empty command name, should it perhaps
> > call
> > the EMPTYCMD completion?
> 
> It's not an empty command line, since it starts with point after
> column 0.
> It should perform command completion, though.

Ah, I see.

> Try the attached patch, or wait for the next devel branch push.
> 
> Chet

Can confirm it works like a charm, thanks again!

In case it can be somewhat useful, once 5.0-beta with the new option is
out I'll ask QA at $work to run regressions tests on it and report back
in case any issues are found. They have a lot of tests for the command
line interface (not just related to completion), so perhaps it could
help a little with testing the new version.

-- 
Kind regards,
Luca Boccassi

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH] Add nofirstword completion option Luca Boccassi <bluca@debian.org> - 2018-06-12 20:15 +0100

csiph-web