From fc00e3a6b79862be1b605279615fe88259d70799 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 4 Dec 2015 09:27:30 +0000 Subject: 37294: Add ZSH_EXECUTION_STRING. This shows the argument to shell option -c. --- Doc/Zsh/params.yo | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo index 21bb87442..672209267 100644 --- a/Doc/Zsh/params.yo +++ b/Doc/Zsh/params.yo @@ -933,6 +933,11 @@ tt(zsh/zutil) module. ) enditem() ) +vindex(ZSH_EXECUTION_STRING) +item(tt(ZSH_EXECUTION_STRING))( +If the shell was started with the option tt(-c), this contains +the argument passed to the option. Otherwise it is not set. +) vindex(ZSH_NAME) item(tt(ZSH_NAME))( Expands to the basename of the command used to invoke this instance -- cgit v1.2.3 From dfd761058e5b187c6ec9e8695cd93d64799ccd69 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 7 Dec 2015 09:44:06 +0000 Subject: 37310: effect of disabling typeset reserved word --- ChangeLog | 5 +++++ Doc/Zsh/builtins.yo | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 2c7b5ad94..f1d39873e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-12-07 Peter Stephenson + + * 37310: Doc/Zsh/builtins.yo: effect of disabling typeset + reserved word. + 2015-12-06 Peter Stephenson * 37326: Src/utils.c: comment how counting for multibyte string diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 49806e4d8..120ec8260 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1812,7 +1812,10 @@ this means. Note that each interface to any of the commands my be disabled separately. For example, `tt(disable -r typeset)' disables the reserved word interface to tt(typeset), exposing the builtin interface, while -`tt(disable typeset)' disables the builtin. +`tt(disable typeset)' disables the builtin. Note that disabling the +reserved word interface for tt(typeset) may cause problems with the +output of `tt(typeset -p)', which assumes the reserved word interface is +available in order to restore array and associative array values. If the shell option tt(TYPESET_SILENT) is not set, for each remaining var(name) that refers to a parameter that is already set, the name and -- cgit v1.2.3 From f5b8efa7e0450450a91c8263733502f9de6729b4 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Mon, 7 Dec 2015 21:49:07 +0000 Subject: 37344: restore old printable quoting, add ${(q+)...}. The \C- form is only used inside quotedzputs(). ${(q+)...} outputs a quotedzputs() representation. --- ChangeLog | 5 + Doc/Zsh/expn.yo | 5 + Src/subst.c | 14 ++- Src/utils.c | 264 ++++++++++++++++++++++++++++++++++++++++--------- Src/zsh.h | 8 +- Test/D04parameter.ztst | 2 +- Test/V09datetime.ztst | 2 +- 7 files changed, 247 insertions(+), 53 deletions(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 55a917068..7906ba40c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2015-12-07 Peter Stephenson + * 37344: Doc/Zsh/expn.yo, Src/subst.c, Src/utils.c, Src/zsh.h, + Test/D04parameter.ztst, Test/V09datetime.ztst: restore old + printable quoting of characters when not used from quotedzputs() + and add ${(q+)...} to output the new form. + * 37331: Src/utils.c: use a single character to represent an MB_INCOMPLETE string even if multiple octets. diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 564c70dd1..c6e7b6f16 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1067,6 +1067,11 @@ If a tt(q-) is given (only a single tt(q) may appear), a minimal form of single quoting is used that only quotes the string if needed to protect special characters. Typically this form gives the most readable output. + +If a tt(q+) is given, an extended form of minmal quoting is used that +causes unprintable characters to be rendered using tt($')var(...)tt('). +This quoting is similar to that used by the output of values by the +tt(typeset) family of commands. ) item(tt(Q))( Remove one level of quotes from the resulting words. diff --git a/Src/subst.c b/Src/subst.c index d9c9d24aa..bb1dd8939 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1887,12 +1887,13 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (quotetype == QT_DOLLARS || quotetype == QT_BACKSLASH_PATTERN) goto flagerr; - if (s[1] == '-') { + if (s[1] == '-' || s[1] == '+') { if (quotemod) goto flagerr; s++; quotemod = 1; - quotetype = QT_SINGLE_OPTIONAL; + quotetype = (*s == '-') ? QT_SINGLE_OPTIONAL : + QT_QUOTEDZPUTS; } else { if (quotetype == QT_SINGLE_OPTIONAL) { /* extra q's after '-' not allowed */ @@ -3583,7 +3584,10 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, ap = aval; if (quotemod > 0) { - if (quotetype > QT_BACKSLASH) { + if (quotetype == QT_QUOTEDZPUTS) { + for (; *ap; ap++) + *ap = quotedzputs(*ap, NULL); + } else if (quotetype > QT_BACKSLASH) { int sl; char *tmp; @@ -3626,7 +3630,9 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (!copied) val = dupstring(val), copied = 1; if (quotemod > 0) { - if (quotetype > QT_BACKSLASH) { + if (quotetype == QT_QUOTEDZPUTS) { + val = quotedzputs(val, NULL); + } else if (quotetype > QT_BACKSLASH) { int sl; char *tmp; tmp = quotestring(val, NULL, quotetype); diff --git a/Src/utils.c b/Src/utils.c index fc2b1920e..1554fa0ae 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -387,6 +387,7 @@ putshout(int c) return 0; } +#ifdef MULTIBYTE_SUPPORT /* * Turn a character into a visible representation thereof. The visible * string is put together in a static buffer, and this function returns @@ -407,6 +408,73 @@ putshout(int c) * in a multibyte string. */ +/**/ +mod_export char * +nicechar_sel(int c, int quotable) +{ + static char buf[10]; + char *s = buf; + c &= 0xff; + if (ZISPRINT(c)) + goto done; + if (c & 0x80) { + if (isset(PRINTEIGHTBIT)) + goto done; + *s++ = '\\'; + *s++ = 'M'; + *s++ = '-'; + c &= 0x7f; + if(ZISPRINT(c)) + goto done; + } + if (c == 0x7f) { + if (quotable) { + *s++ = '\\'; + *s++ = 'C'; + *s++ = '-'; + } else + *s++ = '^'; + c = '?'; + } else if (c == '\n') { + *s++ = '\\'; + c = 'n'; + } else if (c == '\t') { + *s++ = '\\'; + c = 't'; + } else if (c < 0x20) { + if (quotable) { + *s++ = '\\'; + *s++ = 'C'; + *s++ = '-'; + } else + *s++ = '^'; + c += 0x40; + } + done: + /* + * The resulting string is still metafied, so check if + * we are returning a character in the range that needs metafication. + * This can't happen if the character is printed "nicely", so + * this results in a maximum of two bytes total (plus the null). + */ + if (imeta(c)) { + *s++ = Meta; + *s++ = c ^ 32; + } else + *s++ = c; + *s = 0; + return buf; +} + +/**/ +mod_export char * +nicechar(int c) +{ + return nicechar_sel(c, 0); +} + +#else /* MULTIBYTE_SUPPORT */ + /**/ mod_export char * nicechar(int c) @@ -459,6 +527,8 @@ nicechar(int c) return buf; } +#endif /* MULTIBYTE_SUPPORT */ + /* * Return 1 if nicechar() would reformat this character. */ @@ -527,7 +597,7 @@ mb_charinit(void) /**/ mod_export char * -wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) +wcs_nicechar_sel(wchar_t c, size_t *widthp, char **swidep, int quotable) { static char *buf; static int bufalloc = 0, newalloc; @@ -552,9 +622,12 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) s = buf; if (!iswprint(c) && (c < 0x80 || !isset(PRINTEIGHTBIT))) { if (c == 0x7f) { - *s++ = '\\'; - *s++ = 'C'; - *s++ = '-'; + if (quotable) { + *s++ = '\\'; + *s++ = 'C'; + *s++ = '-'; + } else + *s++ = '^'; c = '?'; } else if (c == L'\n') { *s++ = '\\'; @@ -563,9 +636,12 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) *s++ = '\\'; c = 't'; } else if (c < 0x20) { - *s++ = '\\'; - *s++ = 'C'; - *s++ = '-'; + if (quotable) { + *s++ = '\\'; + *s++ = 'C'; + *s++ = '-'; + } else + *s++ = '^'; c += 0x40; } else if (c >= 0x80) { ret = -1; @@ -635,6 +711,13 @@ wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) return buf; } +/**/ +mod_export char * +wcs_nicechar(wchar_t c, size_t *widthp, char **swidep) +{ + return wcs_nicechar_sel(c, widthp, swidep, 0); +} + /* * Return 1 if wcs_nicechar() would reformat this character for display. */ @@ -4918,7 +5001,7 @@ mb_niceformat(const char *s, FILE *stream, char **outstrp, int flags) /* FALL THROUGH */ case MB_INVALID: /* The byte didn't convert, so output it as a \M-... sequence. */ - fmt = nicechar(*ptr); + fmt = nicechar_sel(*ptr, flags & NICEFLAG_QUOTE); newl = strlen(fmt); cnt = 1; /* Get mbs out of its undefined state. */ @@ -4933,7 +5016,7 @@ mb_niceformat(const char *s, FILE *stream, char **outstrp, int flags) if (c == L'\'' && (flags & NICEFLAG_QUOTE)) fmt = "\\'"; else - fmt = wcs_nicechar(c, &newl, NULL); + fmt = wcs_nicechar_sel(c, &newl, NULL, flags & NICEFLAG_QUOTE); break; } @@ -4967,8 +5050,13 @@ mb_niceformat(const char *s, FILE *stream, char **outstrp, int flags) if (outstrp) { *outptr = '\0'; /* Use more efficient storage for returned string */ - *outstrp = (flags & NICEFLAG_HEAP) ? dupstring(outstr) : ztrdup(outstr); - free(outstr); + if (flags & NICEFLAG_NODUP) + *outstrp = outstr; + else { + *outstrp = (flags & NICEFLAG_HEAP) ? dupstring(outstr) : + ztrdup(outstr); + free(outstr); + } } return l; @@ -5834,38 +5922,76 @@ quotestring(const char *s, char **e, int instring) return v; } -/* Unmetafy and output a string, quoted if it contains special characters. */ +/* + * Unmetafy and output a string, quoted if it contains special + * characters. + * + * If stream is NULL, return the same output with any allocation on the + * heap. + */ /**/ -mod_export void +mod_export char * quotedzputs(char const *s, FILE *stream) { int inquote = 0, c; + char *outstr, *ptr; /* check for empty string */ if(!*s) { + if (!stream) + return "''"; fputs("''", stream); - return; + return NULL; } #ifdef MULTIBYTE_SUPPORT if (is_mb_niceformat(s)) { - fputs("$'", stream); - mb_niceformat(s, stream, NULL, NICEFLAG_QUOTE); - fputc('\'', stream); - return; + if (stream) { + fputs("$'", stream); + mb_niceformat(s, stream, NULL, NICEFLAG_QUOTE); + fputc('\'', stream); + return NULL; + } else { + char *substr; + mb_niceformat(s, NULL, &substr, NICEFLAG_QUOTE|NICEFLAG_NODUP); + outstr = (char *)zhalloc(4 + strlen(substr)); + sprintf(outstr, "$'%s'", substr); + free(substr); + return outstr; + } } #endif /* MULTIBYTE_SUPPORT */ if (!hasspecial(s)) { - zputs(s, stream); - return; + if (stream) { + zputs(s, stream); + return NULL; + } else { + return dupstring(s); + } } + if (!stream) { + const char *cptr; + int l = strlen(s) + 2; + for (cptr = s; *cptr; cptr++) { + if (*cptr == Meta) + cptr++; + else if (*cptr == '\'') + l += isset(RCQUOTES) ? 1 : 3; + } + ptr = outstr = zhalloc(l + 1); + } else { + ptr = outstr = NULL; + } if (isset(RCQUOTES)) { /* use rc-style quotes-within-quotes for the whole string */ - if(fputc('\'', stream) < 0) - return; + if (stream) { + if (fputc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; while(*s) { if (*s == Meta) c = *++s ^ 32; @@ -5873,52 +5999,98 @@ quotedzputs(char const *s, FILE *stream) c = *s; s++; if (c == '\'') { - if(fputc('\'', stream) < 0) - return; - } else if(c == '\n' && isset(CSHJUNKIEQUOTES)) { - if(fputc('\\', stream) < 0) - return; + if (stream) { + if (fputc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; + } else if (c == '\n' && isset(CSHJUNKIEQUOTES)) { + if (stream) { + if (fputc('\\', stream) < 0) + return NULL; + } else + *ptr++ = '\\'; + } + if (stream) { + if (fputc(c, stream) < 0) + return NULL; + } else { + if (imeta(c)) { + *ptr++ = Meta; + *ptr++ = c ^ 32; + } else + *ptr++ = c; } - if(fputc(c, stream) < 0) - return; } - if(fputc('\'', stream) < 0) - return; + if (stream) { + if (fputc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; } else { /* use Bourne-style quoting, avoiding empty quoted strings */ - while(*s) { + while (*s) { if (*s == Meta) c = *++s ^ 32; else c = *s; s++; if (c == '\'') { - if(inquote) { - if(fputc('\'', stream) < 0) - return; + if (inquote) { + if (stream) { + if (putc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; inquote=0; } - if(fputs("\\'", stream) < 0) - return; + if (stream) { + if (fputs("\\'", stream) < 0) + return NULL; + } else { + *ptr++ = '\\'; + *ptr++ = '\''; + } } else { if (!inquote) { - if(fputc('\'', stream) < 0) - return; + if (stream) { + if (fputc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; inquote=1; } - if(c == '\n' && isset(CSHJUNKIEQUOTES)) { - if(fputc('\\', stream) < 0) - return; + if (c == '\n' && isset(CSHJUNKIEQUOTES)) { + if (stream) { + if (fputc('\\', stream) < 0) + return NULL; + } else + *ptr++ = '\\'; + } + if (stream) { + if (fputc(c, stream) < 0) + return NULL; + } else { + if (imeta(c)) { + *ptr++ = Meta; + *ptr++ = c ^ 32; + } else + *ptr++ = c; } - if(fputc(c, stream) < 0) - return; } } if (inquote) { - if(fputc('\'', stream) < 0) - return; + if (stream) { + if (fputc('\'', stream) < 0) + return NULL; + } else + *ptr++ = '\''; } } + if (!stream) + *ptr++ = '\0'; + + return outstr; } /* Double-quote a metafied string. */ diff --git a/Src/zsh.h b/Src/zsh.h index caf7def06..0302d6886 100644 --- a/Src/zsh.h +++ b/Src/zsh.h @@ -272,7 +272,12 @@ enum { /* * As QT_BACKSLASH, but a NULL string is shown as ''. */ - QT_BACKSLASH_SHOWNULL + QT_BACKSLASH_SHOWNULL, + /* + * Quoting as produced by quotedzputs(), used for human + * readability of parameter values. + */ + QT_QUOTEDZPUTS }; #define QT_IS_SINGLE(x) ((x) == QT_SINGLE || (x) == QT_SINGLE_OPTIONAL) @@ -3055,6 +3060,7 @@ enum { enum { NICEFLAG_HEAP = 1, /* Heap allocation where needed */ NICEFLAG_QUOTE = 2, /* Result will appear in $'...' */ + NICEFLAG_NODUP = 4, /* Leave allocated */ }; /* Metafied input */ diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 2b46e069d..1460ff6b6 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -398,7 +398,7 @@ foo=$'\x7f\x00' print -r -- ${(V)foo} 0:${(V)...} ->\C-?\C-@ +>^?^@ foo='playing '\''stupid'\'' "games" \w\i\t\h $quoting.' print -r ${(q)foo} diff --git a/Test/V09datetime.ztst b/Test/V09datetime.ztst index 831421dc3..7905155d8 100644 --- a/Test/V09datetime.ztst +++ b/Test/V09datetime.ztst @@ -71,4 +71,4 @@ print -r -- ${(V)"$(strftime $'%Y\0%m\0%d' 100000000)"} 0:Embedded nulls ->1973\C-@03\C-@03 +>1973^@03^@03 -- cgit v1.2.3 From c3ea3ffa730037714fd1bb23b6fc1174b379368f Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Wed, 16 Dec 2015 06:51:54 +0100 Subject: 36650: Add zle-line-pre-redraw hook for highlighting --- ChangeLog | 5 +++++ Doc/Zsh/zle.yo | 5 +++++ Src/Zle/zle_main.c | 31 ++++++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 1 deletion(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 54248963f..26add1966 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-12-19 Mikael Magnusson + + * 36650: Doc/Zsh/zle.yo, Src/Zle/zle_main.c: Add + zle-line-pre-redraw hook for highlighting + 2015-12-19 Daniel Shahaf * unposted (after users/20873): Functions/Zle/edit-command-line: diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 7047b43d9..9c4623247 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -1087,6 +1087,11 @@ widget: example(zle-isearch-exit+LPAR()RPAR() { zle -M ""; } zle -N zle-isearch-exit) ) +tindex(zle-line-pre-redraw) +item(tt(zle-line-pre-redraw))( +Executed whenever the input line is about to be redrawn, providing an +opportunity to update the region_highlight array. +) tindex(zle-line-init) item(tt(zle-line-init))( Executed every time the line editor is started to read a new line diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 1f0c07df4..7862d48fb 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1025,6 +1025,31 @@ getrestchar(int inchar, char *outstr, int *outcount) /**/ #endif +static void redrawhook() +{ + Thingy initthingy; + if ((initthingy = rthingy_nocreate("zle-line-pre-redraw"))) { + int lastcmd_prev = lastcmd; + int old_incompfunc = incompfunc; + char *args[2]; + Thingy lbindk_save = lbindk, bindk_save = bindk; + refthingy(lbindk_save); + refthingy(bindk_save); + args[0] = initthingy->nam; + args[1] = NULL; + incompfunc = 0; + execzlefunc(initthingy, args, 0); + incompfunc = old_incompfunc; + unrefthingy(initthingy); + unrefthingy(lbindk); + unrefthingy(bindk); + lbindk = lbindk_save; + bindk = bindk_save; + /* we can't set ZLE_NOTCOMMAND since it's not a legit widget, so + * restore lastcmd manually so that we don't mess up the global state */ + lastcmd = lastcmd_prev; + } +} /**/ void @@ -1084,6 +1109,8 @@ zlecore(void) errflag |= ERRFLAG_ERROR; break; } + + redrawhook(); #ifdef HAVE_POLL if (baud && !(lastcmd & ZLE_MENUCMP)) { struct pollfd pfd; @@ -1113,6 +1140,7 @@ zlecore(void) zrefresh(); freeheap(); + } region_active = 0; @@ -1191,7 +1219,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish) vistartchange = -1; zleline = (ZLE_STRING_T)zalloc(((linesz = 256) + 2) * ZLE_CHAR_SIZE); *zleline = ZWC('\0'); - virangeflag = lastcmd = done = zlecs = zlell = mark = 0; + virangeflag = lastcmd = done = zlecs = zlell = mark = yankb = yanke = 0; vichgflag = 0; viinsbegin = 0; statusline = NULL; @@ -1812,6 +1840,7 @@ recursiveedit(UNUSED(char **args)) { int locerror; + redrawhook(); zrefresh(); zlecore(); -- cgit v1.2.3 From 15b73ea99b7e156dc9281d89a68fea8fae76706b Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 31 Dec 2015 12:38:10 -0800 Subject: 37467: add "print -v var" / "printf -v var" --- ChangeLog | 5 +++++ Doc/Zsh/builtins.yo | 10 ++++++++-- Src/builtin.c | 34 +++++++++++++++++++++++++--------- Test/B03print.ztst | 9 +++++++++ 4 files changed, 47 insertions(+), 11 deletions(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 9fde9c7ff..eaf4f080a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2015-12-31 Barton E. Schaefer + + * 37467: Doc/Zsh/builtins.yo, Src/builtin.c, Test/B03print.ztst: + add "print -v var" / "printf -v var" + 2015-12-31 Oliver Kiddle * 37453 (with Bart, started by Baptiste Daroussin, 37315) diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 120ec8260..dc0b947a6 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1124,7 +1124,7 @@ tt(popd) that do not change the environment seen by an interactive user. ) findex(print) xitem(tt(print )[ tt(-abcDilmnNoOpPrsSz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ]) -item(SPACES()[ tt(-xX) var(tab-stop) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( +item(SPACES()[ tt(-v) var(name) ] [ tt(-xX) var(tabstop) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( With the `tt(-f)' option the arguments are printed as described by tt(printf). With no flags or with the flag `tt(-)', the arguments are printed on the standard output as described by tt(echo), with the following differences: @@ -1219,6 +1219,9 @@ tt(HIST_LEX_WORDS) option active. item(tt(-u) var(n))( Print the arguments to file descriptor var(n). ) +item(tt(-v) var(name))( +Store the printed arguments as the value of the parameter var(name). +) item(tt(-x) var(tab-stop))( Expand leading tabs on each line of output in the printed string assuming a tab stop every var(tab-stop) characters. This is appropriate @@ -1250,7 +1253,7 @@ If any of `tt(-m)', `tt(-o)' or `tt(-O)' are used in combination with case of `tt(-m)') then nothing is printed. ) findex(printf) -item(tt(printf) var(format) [ var(arg) ... ])( +item(tt(printf) [ -v var(name) ] var(format) [ var(arg) ... ])( Print the arguments according to the format specification. Formatting rules are the same as used in C. The same escape sequences as for tt(echo) are recognised in the format. All C conversion specifications ending in @@ -1279,6 +1282,9 @@ until all arguments have been consumed. With the tt(print) builtin, this can be suppressed by using the tt(-r) option. If more arguments are required by the format than have been specified, the behaviour is as if zero or an empty string had been specified as the argument. + +The tt(-v) option causes the output to be stored as the value of the +parameter var(name), instead of printed. ) findex(pushd) pindex(PUSHD_TO_HOME, use of) diff --git a/Src/builtin.c b/Src/builtin.c index b06bc6de7..128bc36b5 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -99,8 +99,8 @@ static struct builtin builtins[] = #endif BUILTIN("popd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 1, BIN_POPD, "q", NULL), - BUILTIN("print", BINF_PRINTOPTS, bin_print, 0, -1, BIN_PRINT, "abcC:Df:ilmnNoOpPrRsSu:x:X:z-", NULL), - BUILTIN("printf", 0, bin_print, 1, -1, BIN_PRINTF, NULL, NULL), + BUILTIN("print", BINF_PRINTOPTS, bin_print, 0, -1, BIN_PRINT, "abcC:Df:ilmnNoOpPrRsSu:v:x:X:z-", NULL), + BUILTIN("printf", 0, bin_print, 1, -1, BIN_PRINTF, "v:", NULL), BUILTIN("pushd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 2, BIN_PUSHD, "qsPL", NULL), BUILTIN("pushln", 0, bin_print, 0, -1, BIN_PRINT, NULL, "-nz"), BUILTIN("pwd", 0, bin_pwd, 0, 0, 0, "rLP", NULL), @@ -4032,6 +4032,11 @@ bin_print(char *name, char **args, Options ops, int func) zulong zulongval; char *stringval; + if (OPT_ISSET(ops, 'z') + OPT_ISSET(ops, 's') + OPT_ISSET(ops, 'v') > 1) { + zwarnnam(name, "only one of -z, -s, or -v allowed"); + return 1; + } + if (func == BIN_PRINTF) { if (!strcmp(*args, "--") && !*++args) { zwarnnam(name, "not enough arguments"); @@ -4157,8 +4162,8 @@ bin_print(char *name, char **args, Options ops, int func) if ((OPT_HASARG(ops,'u') || OPT_ISSET(ops,'p')) && /* rule out conflicting options -- historical precedence */ ((!fmt && (OPT_ISSET(ops,'c') || OPT_ISSET(ops,'C'))) || - !(OPT_ISSET(ops, 'z') || - OPT_ISSET(ops, 's') || OPT_ISSET(ops, 'S')))) { + !(OPT_ISSET(ops, 'z') || OPT_ISSET(ops, 'v') || + OPT_ISSET(ops, 's') || OPT_ISSET(ops, 'S')))) { int fdarg, fd; if (OPT_ISSET(ops, 'p')) { @@ -4359,7 +4364,8 @@ bin_print(char *name, char **args, Options ops, int func) /* normal output */ if (!fmt) { - if (OPT_ISSET(ops, 'z') || OPT_ISSET(ops, 's')) { + if (OPT_ISSET(ops, 'z') || OPT_ISSET(ops, 's') || + OPT_ISSET(ops, 'v')) { /* * We don't want the arguments unmetafied after all. */ @@ -4367,6 +4373,13 @@ bin_print(char *name, char **args, Options ops, int func) metafy(args[n], len[n], META_NOALLOC); } + /* -v option -- store the arguments in the named parameter */ + if (OPT_ISSET(ops,'v')) { + queue_signals(); + assignsparam(OPT_ARG(ops, 'v'), sepjoin(args, NULL, 0), 0); + unqueue_signals(); + return 0; + } /* -z option -- push the arguments onto the editing buffer stack */ if (OPT_ISSET(ops,'z')) { queue_signals(); @@ -4474,7 +4487,7 @@ bin_print(char *name, char **args, Options ops, int func) * special cases of printing to a ZLE buffer or the history, however. */ - if (OPT_ISSET(ops,'z') || OPT_ISSET(ops,'s')) { + if (OPT_ISSET(ops,'z') || OPT_ISSET(ops,'s') || OPT_ISSET(ops, 'v')) { #ifdef HAVE_OPEN_MEMSTREAM if ((fout = open_memstream(&buf, &mcount)) == NULL) zwarnnam(name, "open_memstream failed"); @@ -4853,7 +4866,7 @@ bin_print(char *name, char **args, Options ops, int func) /* if there are remaining args, reuse format string */ } while (*argp && argp != first && !fmttrunc && !OPT_ISSET(ops,'r')); - if (OPT_ISSET(ops,'z') || OPT_ISSET(ops,'s')) { + if (OPT_ISSET(ops,'z') || OPT_ISSET(ops,'s') || OPT_ISSET(ops,'v')) { #ifdef HAVE_OPEN_MEMSTREAM putc(0, fout); fclose(fout); @@ -4865,11 +4878,14 @@ bin_print(char *name, char **args, Options ops, int func) buf[count] = '\0'; #endif queue_signals(); + stringval = metafy(buf, -1, META_REALLOC); if (OPT_ISSET(ops,'z')) { - zpushnode(bufstack, buf); + zpushnode(bufstack, stringval); + } else if (OPT_ISSET(ops,'v')) { + assignsparam(OPT_ARG(ops, 'v'), stringval, 0); } else { ent = prepnexthistent(); - ent->node.nam = buf; + ent->node.nam = stringval; ent->stim = ent->ftim = time(NULL); ent->node.flags = 0; ent->words = (short *)NULL; diff --git a/Test/B03print.ztst b/Test/B03print.ztst index eb79c4ddb..2e9bf99e5 100644 --- a/Test/B03print.ztst +++ b/Test/B03print.ztst @@ -301,3 +301,12 @@ >one two three four > one two three four > one two three four + + unset foo + print -v foo once more + print -r -- $foo + printf -v foo "%s-" into the breach + print -r -- $foo +0:print and printf into a variable +>once more +>into-the-breach- -- cgit v1.2.3 From 03adf524140dce211372124895fa4356376329a8 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sat, 2 Jan 2016 12:40:31 -0800 Subject: 37493: readonly + POSIX_BUILTINS == typeset -gr --- ChangeLog | 5 +++++ Doc/Zsh/builtins.yo | 5 ++++- Src/builtin.c | 8 ++++++-- Src/hashtable.h | 2 +- Test/B02typeset.ztst | 8 ++++---- 5 files changed, 20 insertions(+), 8 deletions(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index b89c9d307..afd7a514c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-02 Barton E. Schaefer + + * 37493: Doc/Zsh/builtins.yo, Src/builtin.c, Src/hashtable.h, + Test/B02typeset.ztst: readonly + POSIX_BUILTINS == typeset -gr + 2016-01-01 Barton E. Schaefer * 37483: Src/glob.c: save and possibly restore cshnullglob failure diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index dc0b947a6..fb630a713 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -1465,7 +1465,10 @@ cancels both tt(-p) and tt(-u). The tt(-c) or tt(-l) flags cancel any and all of tt(-kpquz). ) cindex(parameters, marking readonly) -alias(readonly)(typeset -r) +item(tt(readonly))( +Same as tt(typeset -r). With the tt(POSIX_BUILTINS) option set, same +as tt(typeset -gr). +) alias(rehash)(hash -r) findex(return) cindex(functions, returning from) diff --git a/Src/builtin.c b/Src/builtin.c index 05907f1d3..557487c87 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -62,7 +62,7 @@ static struct builtin builtins[] = BUILTIN("enable", 0, bin_enable, 0, -1, BIN_ENABLE, "afmprs", NULL), BUILTIN("eval", BINF_PSPECIAL, bin_eval, 0, -1, BIN_EVAL, NULL, NULL), BUILTIN("exit", BINF_PSPECIAL, bin_break, 0, 1, BIN_EXIT, NULL, NULL), - BUILTIN("export", BINF_PLUSOPTS | BINF_MAGICEQUALS | BINF_PSPECIAL | BINF_ASSIGN, (HandlerFunc)bin_typeset, 0, -1, BIN_EXPORT, "E:%F:%HL:%R:%TUZ:%afhi:%lprtu", "xg"), + BUILTIN("export", BINF_PLUSOPTS | BINF_MAGICEQUALS | BINF_PSPECIAL | BINF_ASSIGN, (HandlerFunc)bin_typeset, 0, -1, 0, "E:%F:%HL:%R:%TUZ:%afhi:%lprtu", "xg"), BUILTIN("false", 0, bin_false, 0, -1, 0, NULL, NULL), /* * We used to behave as if the argument to -e was optional. @@ -106,7 +106,7 @@ static struct builtin builtins[] = BUILTIN("pwd", 0, bin_pwd, 0, 0, 0, "rLP", NULL), BUILTIN("r", 0, bin_fc, 0, -1, BIN_R, "IlLnr", NULL), BUILTIN("read", 0, bin_read, 0, -1, 0, "cd:ek:%lnpqrst:%zu:AE", NULL), - BUILTIN("readonly", BINF_PLUSOPTS | BINF_MAGICEQUALS | BINF_PSPECIAL | BINF_ASSIGN, (HandlerFunc)bin_typeset, 0, -1, 0, "AE:%F:%HL:%R:%TUZ:%afghi:%lptux", "r"), + BUILTIN("readonly", BINF_PLUSOPTS | BINF_MAGICEQUALS | BINF_PSPECIAL | BINF_ASSIGN, (HandlerFunc)bin_typeset, 0, -1, BIN_READONLY, "AE:%F:%HL:%R:%TUZ:%afghi:%lptux", "r"), BUILTIN("rehash", 0, bin_hash, 0, 0, 0, "df", "r"), BUILTIN("return", BINF_PSPECIAL, bin_break, 0, 1, BIN_RETURN, NULL, NULL), BUILTIN("set", BINF_PSPECIAL | BINF_HANDLES_OPTS, bin_set, 0, -1, 0, NULL, NULL), @@ -2533,6 +2533,10 @@ bin_typeset(char *name, char **argv, LinkList assigns, Options ops, int func) if (OPT_ISSET(ops,'f')) return bin_functions(name, argv, ops, func); + /* POSIX handles "readonly" specially */ + if (func == BIN_READONLY && isset(POSIXBUILTINS) && !OPT_PLUS(ops, 'g')) + ops->ind['g'] = 1; + /* Translate the options into PM_* flags. * * Unfortunately, this depends on the order * * these flags are defined in zsh.h */ diff --git a/Src/hashtable.h b/Src/hashtable.h index b6346bb9a..3606e9785 100644 --- a/Src/hashtable.h +++ b/Src/hashtable.h @@ -53,7 +53,7 @@ #define BIN_LOGOUT 19 #define BIN_TEST 20 #define BIN_BRACKET 21 -#define BIN_EXPORT 22 +#define BIN_READONLY 22 #define BIN_ECHO 23 #define BIN_DISABLE 24 #define BIN_ENABLE 25 diff --git a/Test/B02typeset.ztst b/Test/B02typeset.ztst index 7d65cc8a7..681fe73c7 100644 --- a/Test/B02typeset.ztst +++ b/Test/B02typeset.ztst @@ -479,12 +479,12 @@ setopt POSIXBUILTINS readonly pbro print ${+pbro} >&2 - (typeset pbro=3) + (typeset -g pbro=3) (pbro=4) - readonly -p | grep pbro >&2 # shows up as "readonly" although unset - typeset -r pbro # idempotent (no error)... + readonly -p pbro >&2 # shows up as "readonly" although unset + typeset -gr pbro # idempotent (no error)... print ${+pbro} >&2 # ...so still readonly... - typeset +r pbro # ...can't turn it off + typeset -g +r pbro # ...can't turn it off ) 1:readonly with POSIX_BUILTINS ?0 -- cgit v1.2.3 From 524f8026106af96809ab70f8b48b0ee3c80a7098 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 3 Jan 2016 18:57:10 +0000 Subject: 37489, tweaked: with POSIX_IDENTIFIERS create math var as scalar --- Doc/Zsh/options.yo | 6 ++++++ Src/params.c | 1 + Test/C01arith.ztst | 11 +++++++++++ 3 files changed, 18 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo index f37753991..2fce10780 100644 --- a/Doc/Zsh/options.yo +++ b/Doc/Zsh/options.yo @@ -2098,6 +2098,12 @@ When it is unset, zsh allows expressions of the form tt($#)var(name) to refer to the length of tt($)var(name), even for special variables, for example in expressions such as tt($#-) and tt($#*). +Another difference is that with the option set assignment to an +unset variable in arithmetic context causes the variable to be created +as a scalar rather than a numeric type. So after `tt(unset t; (( t = 3 +)))'. without tt(POSIX_IDENTIFIERS) set tt(t) has integer type, while with +it set it has scalar type. + When the option is unset and multibyte character support is enabled (i.e. it is compiled in and the option tt(MULTIBYTE) is set), then additionally any alphanumeric characters in the local character set may be used in diff --git a/Src/params.c b/Src/params.c index 8cab96983..054fb1f54 100644 --- a/Src/params.c +++ b/Src/params.c @@ -3061,6 +3061,7 @@ setnparam(char *s, mnumber val) if (ss) *ss = '\0'; pm = createparam(t, ss ? PM_ARRAY : + isset(POSIXIDENTIFIERS) ? PM_SCALAR : (val.type & MN_INTEGER) ? PM_INTEGER : PM_FFLOAT); if (!pm) pm = (Param) paramtab->getnode(paramtab, t); diff --git a/Test/C01arith.ztst b/Test/C01arith.ztst index c7bd81fc3..61da763ac 100644 --- a/Test/C01arith.ztst +++ b/Test/C01arith.ztst @@ -409,3 +409,14 @@ >2 >(eval):6: bad math expression: unexpected ')' >(eval):7: bad math expression: unexpected ')' + + unset number + (( number = 3 )) + print ${(t)number} + unset number + (setopt posix_identifiers + (( number = 3 )) + print ${(t)number}) +0:type of variable when created in arithmetic context +>integer +>scalar -- cgit v1.2.3 From abe997e5e03aaa3761c764a095fcd95d8e89a551 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 18 Jan 2016 02:39:51 +0000 Subject: unposted: docs: zshzle(1): Trivial clarification to $CONTEXT. --- ChangeLog | 5 +++++ Doc/Zsh/zle.yo | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 1c2b37420..8ab37305d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-18 Daniel Shahaf + + * unposted: Doc/Zsh/zle.yo: docs: zshzle(1): Trivial + clarification to $CONTEXT. + 2016-01-15 Peter Stephenson * 37646: Src/builtin.c, Test/B02typeset.ztst: typeset should diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index 9c4623247..414c8dd65 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -802,7 +802,7 @@ item(tt(cont))( A continuation to a command line (at prompt tt(PS2)). ) item(tt(select))( -In a tt(select) loop. +In a tt(select) loop (at prompt tt(PS3)). ) item(tt(vared))( Editing a variable in tt(vared). -- cgit v1.2.3 From 9df6c728e8e43a20e337debbd17c6509f31f570f Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 18 Jan 2016 02:36:39 +0000 Subject: 37664: docs: Document the completion function _command_names. --- ChangeLog | 5 +++++ Completion/Unix/Type/_path_commands | 3 +++ Doc/Zsh/compsys.yo | 6 ++++++ 3 files changed, 14 insertions(+) (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 18ea94f53..3ede08c69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-01-20 Daniel Shahaf + + * 37664: Completion/Unix/Type/_path_commands, Doc/Zsh/compsys.yo: + docs: Document the completion function _command_names. + 2016-01-19 Peter Stephenson * 37693: Src/glob.c: turn Dash into '-' in glob qualifiers. diff --git a/Completion/Unix/Type/_path_commands b/Completion/Unix/Type/_path_commands index 423563c0d..66795ae0f 100644 --- a/Completion/Unix/Type/_path_commands +++ b/Completion/Unix/Type/_path_commands @@ -82,6 +82,9 @@ if [[ -n $need_desc ]]; then else _wanted commands expl 'external command' compadd "$@" -k commands && ret=0 fi +# TODO: this is called from '_command_names -e' which is typically used in +# contexts (such as _env) that don't accept directory names. Should this +# 'if' block move up to the "_command_names -" branch of _command_names? if [[ -o path_dirs ]]; then local -a path_dirs path_dirs=(${^path}/*(/N:t)) diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index d6b180301..9954f30d2 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -4203,6 +4203,12 @@ All arguments after the required field name are passed to tt(compadd) when generating matches from the style value, or to the functions for the fields if they are called. ) +findex(_command_names) +item(tt(_command_names) [ tt(-e) | tt(-) ])( +This function completes words that are valid at command position: names of +aliases, builtins, hashed commands, functions, and so on. With the tt(-e) +flag, only hashed commands are completed. The tt(-) flag is ignored. +) findex(_describe) redef(SPACES)(0)(tt(ifztexi(NOTRANS(@ @ @ @ @ @ @ @ @ @ ))ifnztexi( ))) xitem(tt(_describe )[tt(-12JVx)] [ tt(-oO) | tt(-t) var(tag) ] var(descr) var(name1) [ var(name2) ] [ var(opt) ... ]) -- cgit v1.2.3 From c6fc6f80cd960af914400eb3f49c52fc17598ba5 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Mon, 18 Jan 2016 02:36:59 +0000 Subject: 37665: Completion: New helper _absolute_command_paths. --- ChangeLog | 4 ++++ Completion/Unix/Command/_git | 8 ++++---- Completion/Unix/Type/_absolute_command_paths | 29 ++++++++++++++++++++++++++++ Doc/Zsh/compsys.yo | 6 ++++++ 4 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 Completion/Unix/Type/_absolute_command_paths (limited to 'Doc') diff --git a/ChangeLog b/ChangeLog index 3ede08c69..a22bc92e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2016-01-20 Daniel Shahaf + * 37665: Completion/Unix/Command/_git, + Completion/Unix/Type/_absolute_command_paths, Doc/Zsh/compsys.yo: + Completion: New helper _absolute_command_paths. + * 37664: Completion/Unix/Type/_path_commands, Doc/Zsh/compsys.yo: docs: Document the completion function _command_names. diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2a124c18c..ce3521972 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -1941,7 +1941,7 @@ _git-config () { 'branch.*.pushremote:what remote git push should push to::__git_remotes' 'branch.*.rebase:rebase on top of fetched branch::->bool:false' 'browser.*.cmd:browser command to use:browser:_cmdstring' - 'browser.*.path:path to use for the browser:absolute browser path:_files -g "*(*)"' + 'browser.*.path:path to use for the browser:absolute browser path:_absolute_command_paths' clean.requireForce:'require --force for git clean to actually do something::->bool:true' color.branch:'color output of git branch::->color-bool:false' color.branch.current:'color of the current branch::->color' @@ -2013,7 +2013,7 @@ _git-config () { diff.suppressBlankEmpty:'inhibit printing space before empty output lines::->bool:false' diff.tool:'diff tool to use::__git_difftools' 'difftool.*.cmd:command to invoke for the diff tool::_cmdstring' - 'difftool.*.path:path to use for the diff tool:absolute diff tool path:_files -g "*(*)"' + 'difftool.*.path:path to use for the diff tool:absolute diff tool path:_absolute_command_paths' difftool.prompt:'prompt before each invocation of the diff tool::->bool:true' diff.wordRegex:'regex used to determine what a word is when performing word-by-word diff:regular expression:->string' diff.guitool:'diff tool with gui to use::__git_difftools' @@ -2180,7 +2180,7 @@ _git-config () { mailmap.file:'augmenting mailmap file:mailmap file:_files' man.viewer:'man viewer to use for help in man format::__git_man_viewers' 'man.*.cmd:the command to invoke the specified man viewer:man command:_cmdstring' - 'man.*.path:path to use for the man viewer:absolute man tool path:_files -g "*(*)"' + 'man.*.path:path to use for the man viewer:absolute man tool path:_absolute_command_paths' merge.branchdesc:'populate the log message with the branch description text as well::->bool:false' merge.conflictstyle:'style used for conflicted hunks::->merge.conflictstyle:merge' merge.defaultToUpstream:'merge the upstream branches configured for the current branch by default::->bool:true' @@ -2194,7 +2194,7 @@ _git-config () { 'merge.*.name:human-readable name for custom low-level merge driver:name:->string' 'merge.*.driver:command that implements a custom low-level merge driver:merge command:_cmdstring' 'merge.*.recursive:low-level merge driver to use when performing internal merge between common ancestors::__git_builtin_merge_drivers' - 'mergetool.*.path:path to use for the merge tool:absolute merge tool path:_files -g "*(*)"' + 'mergetool.*.path:path to use for the merge tool:absolute merge tool path:_absolute_command_paths' 'mergetool.*.cmd:command to invoke for the merge tool:merge command:_cmdstring' 'mergetool.*.trustExitCode:trust the exit code of the merge tool::->bool:false' mergetool.keepBackup:'keep the original file with conflict markers::->bool:true' diff --git a/Completion/Unix/Type/_absolute_command_paths b/Completion/Unix/Type/_absolute_command_paths new file mode 100644 index 000000000..e9ab17023 --- /dev/null +++ b/Completion/Unix/Type/_absolute_command_paths @@ -0,0 +1,29 @@ +#autoload + +# This function completes 'ls' to '/bin/ls' +_hashed_absolute_command_paths() { + local -aU set_of_dirs_of_hashed_commands=( ${^commands%/*}/ ) + local i + integer ret=1 + for i in $set_of_dirs_of_hashed_commands + do + compadd -M "l:|=$i" "$expl[@]" -a 'commands[(R)${~i}[^/]#]' + ret=0 + done + return ret +} + +# This function completes absolute pathnames of executables, e.g., /etc/rc.local +_typed-in_absolute_command_paths() { + # TODO: the description "full path to an executable" and tag in the caller are ignored by _path_files + _path_files -/ -g '*(-*)' -P / -W / +} + +_absolute_command_paths() { + _alternative \ + 'commands:hashed command by absolute path:_hashed_absolute_command_paths' \ + 'commands:full path to an executable:_typed-in_absolute_command_paths' +} + + +_absolute_command_paths "$@" diff --git a/Doc/Zsh/compsys.yo b/Doc/Zsh/compsys.yo index 9954f30d2..2aa0740b8 100644 --- a/Doc/Zsh/compsys.yo +++ b/Doc/Zsh/compsys.yo @@ -3461,6 +3461,12 @@ completion has been tried. A function will only be called once unless it explicitly reinserts itself into the array. startitem() +findex(_absolute_command_paths) +item(tt(_absolute_command_paths))( +This function completes external commands as absolute paths (unlike +tt(_command_names -e) which completes their basenames). It takes no +arguments. +) findex(_all_labels) item(tt(_all_labels) [ tt(-x) ] [ tt(-12VJ) ] var(tag) var(name) var(descr) [ var(command) var(arg) ... ])( This is a convenient interface to the tt(_next_label) function below, -- cgit v1.2.3