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


Groups > gnu.bash.bug > #14852

Re: [PATCH] Fix custom program's completions when initial word is set

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Tom Ryder <tom@sanctum.geek.nz>
Newsgroups gnu.bash.bug
Subject Re: [PATCH] Fix custom program's completions when initial word is set
Date Sun, 25 Nov 2018 23:04:18 +1300
Lines 82
Approved bug-bash@gnu.org
Message-ID <mailman.4585.1543147539.1284.bug-bash@gnu.org> (permalink)
References <20181123124854.4208-1-bluca@debian.org>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type multipart/mixed; boundary="J2SCkAp4GZ/dPZZf"
X-Trace usenet.stanford.edu 1543147539 19036 208.118.235.17 (25 Nov 2018 12:05:39 GMT)
X-Complaints-To action@cs.stanford.edu
Cc bug-bash@gnu.org
To Luca Boccassi <bluca@debian.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=simple/simple; d=sanctum.geek.nz; s=mail20160328; t=1543140260; bh=16nHx8G1N/hgfpk5GOZ7NCPks86VHGNvpz/63p/flFE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=boT/ceM7OXf3SScfwxNltzDN7eVuS1O8+zBg3jzIpXjcmFmEsYlp8LPRORCY6Ov8d Gf1u0B+ZZU9TFE7+IGW0ztlo0nCT+IGRHSUX7x9/i7dHBzLw76u2U7YbdOp93egTez AAt06yz75eI4JA8vV68HpBHGIY6B7jSoZPiSDrm4=
Content-Disposition inline
In-Reply-To <20181123124854.4208-1-bluca@debian.org>
User-Agent Mutt/1.10.1+2 (7e6b35c6) (2018-07-16)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2403:7000:8000:700::c
X-Mailman-Approved-At Sun, 25 Nov 2018 07:05:38 -0500
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:14852

Show key headers only | View raw


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

On Fri, Nov 23, 2018 at 12:48:54PM +0000, Luca Boccassi wrote:
>The fix is to only override foundcs if both iw_compspec is not null
>and we are not in command position.

Thank you for this patch. I first ran into the issue with 5.0-beta2 
another way: I noticed that my default completion spec with -D as 
suggested by the Bash manual page was no longer working:

    _completion_loader()
    {
         . "/etc/bash_completion.d/$1.sh" >/dev/null 2>&1 && return 124
    }
    complete -D -F _completion_loader -o bashdefault -o default

In 5.0-beta2, after running this code, for any command with no 
completion specs defined in /etc/bash_completion.d, completing an 
argument does nothing.

Your second patch does not correct that, but it looks like that's 
because a non-zero `foundcs` is coerced to 1 in it, when there are other 
meaningful values for the integer as the first parameter for 
`pcomp_set_readline_variables(int, int)`.

The attached patch is my own attempt, which seems to correct my issues 
as well as the one you raised in this post. Long-time user, first-time 
poster...

-- 
Tom Ryder <https://sanctum.geek.nz/>

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


Thread

Re: [PATCH] Fix custom program's completions when initial word is set Tom Ryder <tom@sanctum.geek.nz> - 2018-11-25 23:04 +1300

csiph-web