From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26241 invoked by alias); 22 Oct 2014 14:03:17 -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: 33505 Received: (qmail 24487 invoked from network); 22 Oct 2014 14:03:16 -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, SPF_HELO_PASS autolearn=ham version=3.3.2 From: Frank Terbeck To: Manfred Lotz Cc: zsh-workers@zsh.org Subject: Re: [PATCH] vcs_info: Use =?utf-8?B?4oCYY29tbWFuZOKAmQ==?= prefix to call version control programs In-Reply-To: <20141022145453.5f25f831@hogwart.bsdlocal.net> (Manfred Lotz's message of "Wed, 22 Oct 2014 14:54:53 +0200") References: <141021232256.ZM14769@torch.brasslantern.com> <1413970104-5500-1-git-send-email-ft@bewatermyfriend.org> <20141022105356.GB1692@tarsus.local2> <87h9ywb9by.fsf@ft.bewatermyfriend.org> <20141022145453.5f25f831@hogwart.bsdlocal.net> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.94 (gnu/linux) Date: Wed, 22 Oct 2014 15:51:36 +0200 Message-ID: <878uk8b4bb.fsf@ft.bewatermyfriend.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: NDMwNDQ0 Manfred Lotz wrote: [...] > I agree there are use-cases for a wrapper function. :-) > > Although in my case I could fix it easily in my function svn() because > I always issue a debug message to stdout (in this case stderr would > be better I have to admit) which makes normal parsing of the svn command > fail if function svn gets called instead of command svn. After removing > it all is fine now. You can keep your function if you do this (as Daniel suggested): zstyle ':vcs_info:svn:*' command =3Dsvn This assumes, you have the EQUALS option set to make the =3Dsvn expansion work (this is the default behaviour of zsh). You could otherwise do this: zstyle ':vcs_info:svn:*' command ${commands[svn]} > Nevertheless, I think a wrapper function isn't illegal and shouldn't > fail.=20 If you change its behaviour in incompatible ways, there is no way to make this work while still allowing the use of wrapper functions within vcs_info. Either your wrapper behaves like the original program would for normal program invocations or vcs_info always uses the command instead of any functions that may be defined. You can't have it both ways. Anyway. I think using an explicit =E2=80=98command=E2=80=99 style with inco= mpatible wrappers is the best way to ensure functionality as well as backwards compatibility. Regards, Frank --=20 In protocol design, perfection has been reached not when there is nothing left to add, but when there is nothing left to take away. -- RFC 1925