From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12556 invoked by alias); 14 Dec 2015 11:05:46 -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: 37401 Received: (qmail 15734 invoked from network); 14 Dec 2015 11:05:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_HDRS_LCASE, T_MANY_HDRS_LCASE autolearn=ham autolearn_force=no version=3.4.0 X-AuditID: cbfec7f4-f79026d00000418a-25-566ea286385f Date: Mon, 14 Dec 2015 11:05:40 +0000 From: Peter Stephenson To: Zsh Hackers' List Subject: PATCH: overeager use of stat list format Message-id: <20151214110540.41096af2@pwslap01u.europe.root.pri> 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+NgFtrBLMWRmVeSWpSXmKPExsVy+t/xK7pti/LCDBaf1bE42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGS13fzAWTOOqmPZ5J1sDYyNHFyMnh4SAicTXh8vYIWwxiQv3 1rN1MXJxCAksZZR49eUhM4Qzg0ni8a3LLBDOOUaJ6a/fMUI4Zxkl9q39xQLSzyKgKtE98ygT iM0mYCgxddNsoCIODhEBbYn2j2IgYWGg8N7+hWwgNq+AvcTTE/cZQWx+AX2Jq38/MUGcYS8x 88oZRogaQYkfk++BjWcW0JLYvK2JFcKWl9i85i0ziC0koC5x4+5u9gmMgrOQtMxC0jILScsC RuZVjKKppckFxUnpuYZ6xYm5xaV56XrJ+bmbGCHh+WUH4+JjVocYBTgYlXh4M5blhgmxJpYV V+YeYpTgYFYS4VWemxcmxJuSWFmVWpQfX1Sak1p8iFGag0VJnHfurvchQgLpiSWp2ampBalF MFkmDk6pBsZguXeawdu+KT3qzTbZqLp27+1ZyQeXf2GeFlmcUy5+5s/xYKvsSZuPOvCcd3nT oRLwz+hCeo9JhdhxmRD+X5HRNiGLOVjTJp598mSF7dN7C2+dZO26Kh23UXRh/aRTG6bPbex0 O2I9dcfqt6GyaVOFl3pkzBaacrE7ssDqytslmmKprl9Uud4qsRRnJBpqMRcVJwIAxcd5IUsC AAA= This must have been there for ages, though I've only just noticed by trying to complete in my zsh functions directory which contains lots and lots and lots of files. I have the file-list style set to list=10 which means display as ls -l if I'm listing and I have no more than 10 files to list. It turns out owing to a typo in the pattern it can match if I'm not listing and I have any number of files at all. So normal completion with TAB just hung up for ages and as it didn't display the listing there was no obvious reason. The moral is the usual one: be careful about designing patterns that aren't supposed to match a certain type of string. I'm worried I'm only seeing this because something else just got a lot more inefficient, but I'm not going to be looking at that myself. (Alternatively, I may have fixed some obscure pattern bug with a knock-on effect.) pws diff --git a/Completion/Unix/Type/_list_files b/Completion/Unix/Type/_list_files index e04392d..6c52bc1 100644 --- a/Completion/Unix/Type/_list_files +++ b/Completion/Unix/Type/_list_files @@ -36,7 +36,7 @@ for elt in $stylevals; do break ;; - (*($what|all|true|1|yes)[^=]#) + ([^=]#($what|all|true|1|yes)[^=]#) # always use long format (( ok = 1 )) break