From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19776 invoked from network); 14 Oct 2008 04:27:19 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=AWL autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Oct 2008 04:27:19 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 18793 invoked from network); 14 Oct 2008 04:27:10 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Oct 2008 04:27:10 -0000 Received: (qmail 22137 invoked by alias); 14 Oct 2008 04:27:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 25886 Received: (qmail 22120 invoked from network); 14 Oct 2008 04:27:02 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 14 Oct 2008 04:27:02 -0000 Received: from vms172073pub.verizon.net (vms172073pub.verizon.net [206.46.172.73]) by bifrost.dotsrc.org (Postfix) with ESMTP id D818380524C0 for ; Tue, 14 Oct 2008 06:26:47 +0200 (CEST) Received: from torch.brasslantern.com ([96.238.220.215]) by vms172073.mailsrvcs.net (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPA id <0K8P006CHOCAUPZ2@vms172073.mailsrvcs.net> for zsh-workers@sunsite.dk; Mon, 13 Oct 2008 23:26:35 -0500 (CDT) Received: from torch.brasslantern.com (localhost.localdomain [127.0.0.1]) by torch.brasslantern.com (8.13.1/8.13.1) with ESMTP id m9E4QXtD030839 for ; Mon, 13 Oct 2008 21:26:34 -0700 Received: (from schaefer@localhost) by torch.brasslantern.com (8.13.1/8.13.1/Submit) id m9E4QXQL030838 for zsh-workers@sunsite.dk; Mon, 13 Oct 2008 21:26:33 -0700 Date: Mon, 13 Oct 2008 21:26:33 -0700 From: Bart Schaefer Subject: Re: [PATCH 2/2] Use _multi_parts for scp remote file completion and complete abbrevs In-reply-to: <1223918374-21544-2-git-send-email-joerg@alea.gnuu.de> To: zsh-workers@sunsite.dk Message-id: <081013212633.ZM30837@torch.brasslantern.com> MIME-version: 1.0 X-Mailer: OpenZMail Classic (0.9.2 24April2005) Content-type: text/plain; charset=us-ascii References: <1223918374-21544-1-git-send-email-joerg@alea.gnuu.de> <1223918374-21544-2-git-send-email-joerg@alea.gnuu.de> Comments: In reply to ( Text in unknown character set UTF-8 not shown ) "[PATCH 2/2] Use _multi_parts for scp remote file completion and complete abbrevs" (Oct 13, 7:19pm) X-Virus-Scanned: ClamAV 0.92.1/8419/Tue Oct 14 04:08:23 2008 on bifrost X-Virus-Status: Clean On Oct 13, 7:19pm, Joerg wrote: } } This patches uses the function _multi_parts to simplify the code. I'm not convinced that "simpler" here is equivalent to "correct." At the very least the user should get to decide whether he prefers to know the file type and to have the suffix autoremoved, i.e., the old behavior should be available via a zstyle. For one thing, the old behavior was intended to minimize the amount of useless data the remote system had to send. There are things it is "fast enough" to do on the local filesystem that it's too costly to wait for when it has to be shipped across the network as text. Also, if you're giving up on the file type suffix, you should remove the "F" option from the "ls" command that's executed on the remote system. I think that's the source of the quoting issue for which you sent a follow-up patch to _multi_parts; I'm also not sure that the _multi_parts patch is correct when the pattern is NOT going to be evaluated on the far end of an ssh. } With _multi_parts it's easier to do completion of abbreviated path like } /u/s/d/zsh. So do it. This doesn't quite work, even if it's worth the overhead. If I try, for example: % scp remote:/u/s/d I get as far as % scp remote:/usr/s/d (with cursor on the second slash), and at that point it all stops working; I can only complete more if I first move the cursor to the end of the word (to the right of "d") every time. If I merely insert an "h" to disambiguate /usr/sbin from /usr/share and hit TAB with the cursor still on the second slash, I end up going from % scp remote:/usr/sh/d to % scp remote: _complete_debug says (in part): : _remote_files:6:then; rempat='\*/usr\*/sh\*' : _remote_files:7:then; [[ /usr/sh == (.|..|)/* ]] : _remote_files:7:then cmdand; rempat='/usr\*/sh\*' : _remote_files:8:then; remfiles=: _remote_files:8:then; remfiles=( /usr/share/ ) The trailing "/d" has been lost because the of the cursor placement.