From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20593 invoked from network); 13 Apr 2004 17:45:06 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 13 Apr 2004 17:45:06 -0000 Received: (qmail 29971 invoked by alias); 13 Apr 2004 17:44:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19771 Received: (qmail 29892 invoked from network); 13 Apr 2004 17:44:58 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 13 Apr 2004 17:44:58 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [130.225.247.86] by sunsite.dk (MessageWall 1.0.8) with SMTP; 13 Apr 2004 17:44:57 -0000 Received: (qmail 21865 invoked from network); 13 Apr 2004 17:44:57 -0000 Received: from wbar3.sjo1-4-11-009-147.sjo1.dsl-verizon.net (HELO candle.brasslantern.com) (4.11.9.147) by a.mx.sunsite.dk with SMTP; 13 Apr 2004 17:44:55 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id i3DHirD21003; Tue, 13 Apr 2004 10:44:53 -0700 X-Authentication-Warning: candle.brasslantern.com: schaefer set sender to schaefer@closedmail.com using -f From: Bart Schaefer Message-Id: <1040413174453.ZM21002@candle.brasslantern.com> Date: Tue, 13 Apr 2004 17:44:53 +0000 In-Reply-To: <200404131617.i3DGHX7s031305@soup.acv.apexcovantage.com> Comments: In reply to Jay Berkenbilt "Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too soon]" (Apr 13, 12:17pm) References: <20040413012117.GA9729@scowler.net> <200404130137.i3D1b5CW004764@soup.in.ql.org> <20040413021931.GA10355@scowler.net> <200404131617.i3DGHX7s031305@soup.acv.apexcovantage.com> X-Mailer: Z-Mail (5.0.0 30July97) To: zsh-workers@sunsite.dk Subject: Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too soon] Cc: 243385@bugs.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: **** X-Spam-Status: No, hits=4.7 required=6.0 tests=RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: 4.7 [I don't know whether ejb will see this, because I don't know if he's subscribed to zsh-uses and I suspect bugs.debian.org is going to reject my mail because I'm on a DSL line. We'll see ...] On Apr 13, 12:17pm, Jay Berkenbilt wrote: } Subject: Re: [ejb@ql.org: Bug#243385: zsh: rsync completion expands * too } } To me, something feels cleaner and safer about avoiding the } unnecessary eval than enclosing everything in an extra set of quotes If the eval were unnecessary, believe me, it wouldn't be there. } This will probably break if _call_program is changed to do what it } does differently. It's extremely unlikely that _call_program could be made to do what it does without the eval. } On the other hand, since I'll admit to not completely understanding } what the purpose of _call_program is (it looks to me like it provides } a mechanism for using zstyle to tell zsh that command names should be } completed at a given point in expanding a program's argument) No, that's not what it's for at all. In this particular case, It's so that you can use a zstyle to tell the completion function that it should use something other than ssh as the remote shell program for expanding the file names. It implements the "command" zstyle, which is documented: command In many places, completion functions need to call external commands to generate the list of completions. This style can be used to override the command that is called in some such cases. The elements of the value are joined with spaces to form a command line to execute. The value can also start with a hyphen, in which case the usual command will be added to the end; this is most useful for putting `builtin' or `command' in front to make sure the appropriate version of a command is called, for example to avoid calling a shell function with the same name as an external command. So, if for example I have a shell function named "ssh", I might do zstyle ':completion:*:complete:scp:*:files' command command - which would cause _call_program to eval "command ssh ..." when _ssh asks for remote file completions, and thereby bypass my shell function. } Note that _ssh and _rlogin both have remote_files functions that do } not call _call_program. In the case of _rlogin, it *should* be using _call_program, but that function predates the invention of the "command" style and has not yet been updated. Thanks for pointing that out. } _ssh used to before my previous patch but now doesn't. Your previous patch was not applied to the "official" zsh sources (I don't know about the Debian repackaging). Instead a patch that added quoting was done, very similar to what Clint posted for _rsync. (The -L option *did* get added to the "ls" in _ssh.) So _ssh *does* have _call_program.