From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12666 invoked by alias); 16 May 2018 09:56: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: List-Unsubscribe: X-Seq: 42784 Received: (qmail 24646 invoked by uid 1010); 16 May 2018 09:56:09 -0000 X-Qmail-Scanner-Diagnostics: from park01.gkg.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(205.235.26.22):SA:0(-1.4/5.0):. Processed in 1.337924 secs); 16 May 2018 09:56:09 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: SRS0=uSOV=ID=yahoo.co.uk=okiddle@bounces.park01.gkg.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new at gkg.net Authentication-Results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1526464546; bh=dI1NA/g1D/YVv5P1TJyeLgxoF46xn0aQ2K3GKnxI1+M=; h=From:To:Subject:Date:From:Subject; b=nQ1j/+/PH6NRhWzKMNYbvwc5AuHJsKPUYj32Q0Pkp1oyhtmYxCKTI3pN1rwOPcy4t4WkVYL2jFSieQKdrIPCd2lR2Z1Q8newbmafbSf004gl0WRBHpLPkgy/92mhTzC/hab1trb0L4xw+SD/bOGCUuo2ZOArAH0AxDnKOayRqpvaxp+E5W9cHImxA0g03Xdn998r/pv92lvgizVdaUA4PreKmQijXi7pzfOoVppMEoNs+XaJ9T2Y/I66i5eWn9Aru/g4SWBMkpNjRsW9Xou4ipgUmhW1n509ALInXoIDlFVm+LTKUpBS7v0Us+r9CzScjSwQEOlfmvZ4SgoMZdvByg== X-YMail-OSG: 7zFRFE0VM1nb.0a_aM9950nu8bhnP53Azop4ssJqTQ5DUvhioAeDhzBQSGQFbPR 5_hcArOrgO2sfHvDr2OREGjEgcMUNm3SLtVLt4qbvaaXEKZGWvJ2tn3TkXlyv8_gl9TKeRUWLAsm aUYK1o8EYUtwcWvOG3bEc__dxYz2qyqc.DZ9MMECDcXKOPTSxK0qoPIymOCa47S4JVgFxlBQmBMF dLf3tc.MLjvS3k08hasN2DPmFdHBMYnSft9CVluViqtAYvObqqZp.TlhPfKHJj97d6TD.k8H3AKX V_PEedfGhUHXHWXRHC0WgVub6nCjcQ_jyvCzFWnU6gzxvBV1PmVoBxhJI1gB5oE6Lc1xvTu_YtF4 SWKR9j6IE_LKNxM.BSpO_OQau1zhTkZBFWAjGAw9TKvXuflFxks2lLIHf95w5S12Liq.wK.Zp1J. xPxtrd2jgwHsO4pSQRyR89nRdA0zW9ajJKe5ku67Sc0d9KeJIVDvEutqkl4B7_P0Xg0A_I_8XgTO WRCMrVncTZBjQswJ28ZHHXlCBVum8DTWNjqSBN6IpE14E5dzbRYXaNHES0HaWw2iS3zhNSCXIff2 gc5PNjmtQ5oSZPEtghgMih_RMUGyKFxcd_C8mapOjiUcbULgBrTc.275i9ylhcILj From: Oliver Kiddle To: Zsh workers Subject: PATCH: functions completion missed -s and -x MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <20684.1526464539.1@thecus> Date: Wed, 16 May 2018 11:55:39 +0200 Message-ID: <20685.1526464539@thecus> Two relatively new options to functions were missing from the completion function: -x which allows the indentation to be changed and -s which is for defining math functions with a string parameter. On the subject of math functions, is it not inconsistent with everything else that redefining a math function results in a "function already exists" error rather than being silent. If I re-source my .zshrc, it is silent apart from these errors. Oliver diff --git a/Completion/Zsh/Command/_typeset b/Completion/Zsh/Command/_typeset index 14d5d371b..fb7189c77 100644 --- a/Completion/Zsh/Command/_typeset +++ b/Completion/Zsh/Command/_typeset @@ -55,9 +55,13 @@ case ${service} in ;; float) use="EFHghlprtux";; functions) - use="UkmTtuzMW" + use="UkmTtuzW" func=f - allargs[M]='(-k -t -T -u -U -z -M +M +k +t +z)-+M[define mathematical function]' + args=( + '(-k -t -T -u -U -W -x -z -M +M +k +t +W +z)-+M[define mathematical function]' + '(-k -m -t -T -u -U -W -x -z +M +k +t +W +z)-s[define mathematical function that takes a string argument]' + '(-M)-x+[specify spaces to use for indentation]:spaces' + ) ;; integer) use="Hghilprtux" @@ -89,8 +93,10 @@ if [[ "$state" = vars_eq ]]; then _wanted functions expl 'math function' compadd -F line - \ ${${${(f)"$(functions -M)"}##*-M }%% *} elif (( $+opt_args[-M] )); then - _arguments ':new math function:_functions' ':minimum arguments' \ - ':maximum arguments' ':shell function:_functions' + _arguments ':new math function:_functions' \ + ":minimum arguments${(k)opt_args[-s]:+:(1)}" \ + ":maximum arguments${(k)opt_args[-s]:+:(1)}" \ + ':shell function:_functions' elif (( $+opt_args[-w] )); then _wanted files expl 'zwc file' _files -g '*.zwc(-.)' elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then