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


Groups > gnu.bash.bug > #14235 > unrolled thread

Re: [PATCH] Add nofirstword completion option

Started byLuca Boccassi <bluca@debian.org>
First post2018-06-12 20:15 +0100
Last post2018-06-12 20:15 +0100
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#14235 — Re: [PATCH] Add nofirstword completion option

FromLuca Boccassi <bluca@debian.org>
Date2018-06-12 20:15 +0100
SubjectRe: [PATCH] Add nofirstword completion option
Message-ID<mailman.1767.1528830912.1292.bug-bash@gnu.org>

[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

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web