From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26362 invoked by alias); 2 Dec 2014 16:49:09 -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: 33833 Received: (qmail 3209 invoked from network); 2 Dec 2014 16:49:07 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=AKpDk7pY c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=A92cGCtB03wA:10 a=l4m8wDNy30Mr1ruz0moA:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141202084858.ZM31517@torch.brasslantern.com> Date: Tue, 02 Dec 2014 08:48:58 -0800 In-reply-to: <20141202155452.647182b4@pwslap01u.europe.root.pri> Comments: In reply to Peter Stephenson "Something rotten in tar completion" (Dec 2, 3:54pm) References: <20141202155452.647182b4@pwslap01u.europe.root.pri> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Peter Stephenson , "Zsh Hackers' List" Subject: Re: Something rotten in tar completion MIME-version: 1.0 Content-type: text/plain; charset=us-ascii [Cc-ing PWS because mail I sent yesterday to zsh-users still hasn't shown up there.] On Dec 2, 3:54pm, Peter Stephenson wrote: } Subject: Something rotten in tar completion } } If I try to complete after "tar xvzf ...", which is where I usually am } completing (I don't tend to bother completing inside tar files), it's } *incredibly* slow. I suspect it's looking in the file, which it doesn't } need to at this point --- it's only completing the name of the file. Well, let's see ... _complete_debug with no zstyles at all ... % tar xvzf It runs "tar --version" THREE TIMES to figure out which kind of tar and what options it has. Then: _files -J -default- -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' ... which invokes _path_files at least twice. The result is a listing of directory names and tar file names. Tried the same thing with a partial file name on the line, got the same results except directories were properly not completed. But I don't see it examining the tarfile contents. Looking at _tar, it should only poke inside if it already has both a tarfile name and some tar commands on the line. Hmm, it IS legal to put a list of file names to extract after "tar xf archive ..." -- it could be that it's trying to populate that list because the "x" is present. That does happen if I complete after "tar xvzf archive.tgz " but does not if the cursor is still inside the word "archive.tgz". At various places (_description, _path_files) it does look for the "fake", "fake-always", and "fake-files" styles. Could that have something to do with it on your end?