From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25282 invoked by alias); 28 Aug 2016 23:03:30 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39114 Received: (qmail 80 invoked from network); 28 Aug 2016 23:03:30 -0000 X-Qmail-Scanner-Diagnostics: from smtprelay03.ispgateway.de by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(80.67.29.7):SA:0(0.0/5.0):. Processed in 0.521449 secs); 28 Aug 2016 23:03:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: ft@bewatermyfriend.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at bewatermyfriend.org does not designate permitted sender hosts) From: Frank Terbeck To: Peter Stephenson Cc: Zsh hackers list Subject: Re: Broken specialsed file completion In-Reply-To: <20160828222112.0433a930@ntlworld.com> (Peter Stephenson's message of "Sun, 28 Aug 2016 22:21:12 +0100") References: <20160828222112.0433a930@ntlworld.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Date: Mon, 29 Aug 2016 00:56:26 +0200 Message-ID: <8760qkqz8l.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain X-Df-Sender: NDMwNDQ0 Hi, Peter Stephenson wrote: > For some reason the following, which has worked fine for many years, has > stopped working. > > zle -C most-recent-file menu-complete _generic > zstyle ':completion:most-recent-file:*' completer _menu _path_files _match > zstyle ':completion:most-recent-file:*' file-sort modification > zstyle ':completion:most-recent-file:*' hidden all > bindkey '^X.' most-recent-file > > Instead of completing most recently modified files, it reports > > _path_files:compfiles:466: too few arguments I had a bit of time on my hands, so I bisected this down to this commit: f7c3aa170b8c36b146ba7644cf3912cb1329a5d2 is the first bad commit commit f7c3aa170b8c36b146ba7644cf3912cb1329a5d2 Author: Barton E. Schaefer Date: Wed Aug 10 18:33:04 2016 -0700 39019 (cf. PWS 39013): fix SHWORDSPLIT regression introduced by workers/29313 Also add test cases for more join/split combinations There is one hunk that changes code in that diff: diff --git a/Src/subst.c b/Src/subst.c index e3af156..ae3e4c4 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -3454,13 +3454,22 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, * exception is that ${name:-word} and ${name:+word} will have already * done any requested splitting of the word value with quoting preserved. */ - if (ssub || (spbreak && isarr >= 0) || spsep || sep) { + if (ssub || spbreak || spsep || sep) { + int force_split = !ssub && (spbreak || spsep); if (isarr) { - val = sepjoin(aval, sep, 1); - isarr = 0; - ms_flags = 0; + if (nojoin == 0) { + val = sepjoin(aval, sep, 1); + isarr = 0; + ms_flags = 0; + } else if (force_split && nojoin == 2) { + /* Hack to simulate splitting individual elements: + * first join on what we later use to split + */ + val = sepjoin(aval, spsep, 1); + isarr = 0; + } } - if (!ssub && (spbreak || spsep)) { + if (force_split && !isarr) { aval = sepsplit(val, spsep, 0, 1); if (!aval || !aval[0]) val = dupstring(""); Maybe that is useful to someone who knows that code. Regards, Frank