zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Zsh workers <zsh-workers@zsh.org>
Subject: PATCH: functions completion missed -s and -x
Date: Wed, 16 May 2018 11:55:39 +0200	[thread overview]
Message-ID: <20685.1526464539@thecus> (raw)

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


             reply	other threads:[~2018-05-16  9:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20180516095641epcas4p240d76877aedbddfc42d29ce1b3945ee5@epcas4p2.samsung.com>
2018-05-16  9:55 ` Oliver Kiddle [this message]
2018-05-16 10:15   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20685.1526464539@thecus \
    --to=okiddle@yahoo.co.uk \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).