Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: TCP functions: zgprintf not necessary



Just realised that zformat already does exactly what I was trying to do
with zgprintf, so the latter isn't necessary.

Index: Doc/Zsh/tcpsys.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/tcpsys.yo,v
retrieving revision 1.1
diff -u -r1.1 tcpsys.yo
--- Doc/Zsh/tcpsys.yo	6 Feb 2003 12:21:51 -0000	1.1
+++ Doc/Zsh/tcpsys.yo	23 Feb 2003 23:20:43 -0000
@@ -495,24 +495,6 @@
 The tt(-S) and tt(-F) options are used to pass in the session name and file
 descriptor for possible replacement in the prompt.
 )
-findex(zgprintf)
-item(tt(zgprintf) tt(-rPR -%)var(X)tt(=)var(subst) var(fmt) tt([) var(val) tt(... ]))(
-This function is used for performing tt(%)-replacement in prompts supplied
-to tt(tcp_output).  The var(fmt) string is printed to standard output.
-The option tt(-%)var(X)tt(=)var(subst) specifies that any occurrence
-of tt(%)var(X) in the var(fmt) string should be replaced by var(subst).
-These arguments may be repeated for arbitrary var(X).
-
-The option tt(-r) specifies that the normal tt(print) conventions are not
-to be used, as with the corresponding argument to the tt(print) builtin.
-
-The option tt(-R) specifies that the output is to be left in the parameter
-tt($REPLY) instead of being printed.
-
-The option tt(-P) specifies that unhandled tt(%)-escapes should be
-formatted by a call to tt(printf).  Each is assumed to consume exactly one
-additional var(val) argument.  This option is only minimally implemented.
-)
 enditem()
 
 texinode(TCP Parameters)(TCP Examples)(TCP Functions)(TCP Function System)
Index: Functions/TCP/tcp_open
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/TCP/tcp_open,v
retrieving revision 1.1
diff -u -r1.1 tcp_open
--- Functions/TCP/tcp_open	6 Feb 2003 12:21:51 -0000	1.1
+++ Functions/TCP/tcp_open	23 Feb 2003 23:20:43 -0000
@@ -54,7 +54,8 @@
 setopt extendedglob cbases
 
 zmodload -i zsh/net/tcp || return 1
-autoload -U zgprintf tcp_alias tcp_close tcp_command tcp_expect tcp_fd_handler
+zmodload -i zsh/zutil
+autoload -U tcp_alias tcp_close tcp_command tcp_expect tcp_fd_handler
 autoload -U tcp_log tcp_output tcp_proxy tcp_read tcp_rename tcp_send
 autoload -U tcp_sess tcp_spam tcp_talk tcp_wait
 
Index: Functions/TCP/tcp_output
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/TCP/tcp_output,v
retrieving revision 1.1
diff -u -r1.1 tcp_output
--- Functions/TCP/tcp_output	6 Feb 2003 12:21:51 -0000	1.1
+++ Functions/TCP/tcp_output	23 Feb 2003 23:20:44 -0000
@@ -29,7 +29,7 @@
 # where data is coming from; also, it allows more predictable
 # behaviour in tcp_expect.
 if [[ -n $tprompt ]]; then
-  zgprintf -R -%s=$sess -%f=$read_fd -- $tprompt
+  zformat -f REPLY $tprompt "s:$sess" "f:$read_fd"
   # We will pass this back up.
   REPLY="$REPLY$*"
 else
Index: Functions/TCP/tcp_spam
===================================================================
RCS file: /cvsroot/zsh/zsh/Functions/TCP/tcp_spam,v
retrieving revision 1.1
diff -u -r1.1 tcp_spam
--- Functions/TCP/tcp_spam	6 Feb 2003 12:21:51 -0000	1.1
+++ Functions/TCP/tcp_spam	23 Feb 2003 23:20:44 -0000
@@ -91,7 +91,7 @@
     tcp_on_spam $TCP_SESS $cmd $*
     [[ $REPLY = done ]] && continue
   fi
-  [[ -n $verbose ]] && zgprintf -R -%s=$TCP_SESS \
-    -%f=${tcp_by_name[$TCP_SESS]} -- $TCP_PROMPT
+  [[ -n $verbose ]] && zformat REPLY $TCP_PROMPT "s:$TCP_SESS" \
+    "f:${tcp_by_name[$TCP_SESS]}"
   eval $cmd '$*'
 done

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author