From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11273 invoked by alias); 3 Oct 2013 16:30:53 -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: 31782 Received: (qmail 10770 invoked from network); 3 Oct 2013 16:30:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f0a6d000007b1b-27-524d99380a01 Date: Thu, 03 Oct 2013 17:20:07 +0100 From: Peter Stephenson To: Zsh Hackers' List Subject: Re: Bug somewhere in verbose output for completion listing Message-id: <20131003172007.57e1e825@pwslap01u.europe.root.pri> In-reply-to: <131003080956.ZM1033@torch.brasslantern.com> References: <20131003140025.227f5bc1@pwslap01u.europe.root.pri> <131003075018.ZM991@torch.brasslantern.com> <131003080956.ZM1033@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmluLIzCtJLcpLzFFi42I5/e/4NV2Lmb5BBn2TJCwONj9kcmD0WHXw A1MAYxSXTUpqTmZZapG+XQJXxtIPDgXtwhWz51Q1MDbxdzFyckgImEj0fLvHDmGLSVy4t56t i5GLQ0hgKaPEl8ZjjBDOciaJI+83sIFUsQioSlz+8oYFxGYTMJSYumk2UBEHh4iAtkT7RzGQ sLCAs8TPjrVgQ3kF7CW+L7kJZnMKWEqcbr4LtWAOo8T9F21MIAl+AX2Jq38/MUFcYS8x88oZ RohmQYkfk++B7WIW0JLYvK2JFcKWl9i85i3zBEaBWUjKZiEpm4WkbAEj8ypG0dTS5ILipPRc Q73ixNzi0rx0veT83E2MkAD8soNx8TGrQ4wCHIxKPLw7qnyDhFgTy4orcw8xSnAwK4nwsoGE eFMSK6tSi/Lji0pzUosPMTJxcEo1MEqULjcJ9+nj2f5ps0vQr/MMGvvPyx3cFz35j+O86TWb 1+zXkohcUrrlbY/iq74ULfFzuv7tWf7zNTe1t21rXflw3T+tYFl5d65ixaLlykIXrZI/P93x 7bmRxszyL2c/yPx0FFi6gGdqovm/gusCWy7uVeFd9pL9YbFgkoi4atPlg6rs01QETJRYijMS DbWYi4oTAXno/FgeAgAA On Thu, 03 Oct 2013 08:09:56 -0700 Bart Schaefer wrote: > On Oct 3, 7:50am, Bart Schaefer wrote: > } > } http://www.zsh.org/mla/workers/2013/msg00368.html > } > } Unfortunately I don't have any new insights. > > Well, one maybe: There's a static global struct in computil.c called > cd_state that has maxmlen and minmlen fields. Those are based on the > exported globals maxmlen and minmlen from compcore.c, which the comment > (there's a comment!) describes as "Length of the longest/shortest match". > > A bit of grepping does not find anywhere that cd_state.maxmlen is reset > across ZLE exit/restart. I'm a bit worried that forcibly doing so may > slow down or actually break _oldlist, but maybe cd_state is the place > to start looking. Thanks, I think that may have been all the assistance that was needed. I discovered that before the problem took effect, completing after wtf gave (gdb) p cd_state $1 = {showd = 1, sep = 0xa0f64e8 "# ", slen = 2, swidth = 2, maxmlen = 40, sets = 0xa1183b0, pre = 10, premaxw = 10, suf = 36, maxg = 1, maxglen = 12, groups = 0, descs = 2, gprew = 0, runs = 0x0} and with the problem showing up it gave (gdb) p cd_state $2 = {showd = 1, sep = 0xa0f64e8 "# ", slen = 2, swidth = 2, maxmlen = 40, sets = 0xa1183b0, pre = 10, premaxw = 102, suf = 36, maxg = 1, maxglen = 12, groups = 0, descs = 2, gprew = 0, runs = 0x0} so premaxw has gone up. Sure enough it doesn't get reset with most of the other stuff in cd_init(), and I can't see any reason why it shouldn't be. It must start off initially at 0 so resetting it to 0 each time we initialise the state can't make anything worse (theoretically). This removes the persistent problem: you still don't get descriptions with very long completions, even though list-separator is output, which seems a dodgy combination of things, but that's obviously a different issue. diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c index f8983c3..ee39185 100644 --- a/Src/Zle/computil.c +++ b/Src/Zle/computil.c @@ -465,6 +465,7 @@ cd_init(char *nam, char *hide, char *mlen, char *sep, cd_state.showd = disp; cd_state.maxg = cd_state.groups = cd_state.descs = 0; cd_state.maxmlen = atoi(mlen); + cd_state.premaxw = 0; itmp = zterm_columns - cd_state.swidth - 4; if (cd_state.maxmlen > itmp) cd_state.maxmlen = itmp; pws