From 200fb38b94e9246b0a7a1850b0f5e5a3a3d3980a Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Fri, 11 Feb 2011 04:58:31 +0000 Subject: Doc for send-invisible --- Doc/Zsh/contrib.yo | 95 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 57 insertions(+), 38 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index c02d33cf1..56dedcb9a 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1771,22 +1771,6 @@ The tt(word-context) style is implemented by the function tt(match-word-context). This should not usually need to be called directly. ) -tindex(delete-whole-word-match) -item(tt(delete-whole-word-match))( -This is another function which works like the tt(-match) functions -described immediately above, i.e. using styles to decide the word -boundaries. However, it is not a replacement for any existing function. - -The basic behaviour is to delete the word around the cursor. There is no -numeric prefix handling; only the single word around the cursor is -considered. If the widget contains the string tt(kill), the removed text -will be placed in the cutbuffer for future yanking. This can be obtained -by defining tt(kill-whole-word-match) as follows: - -example(zle -N kill-whole-word-match delete-whole-word-match) - -and then binding the widget tt(kill-whole-word-match). -) tindex(copy-earlier-word) item(tt(copy-earlier-word))( This widget works like a combination of tt(insert-last-word) and @@ -1818,6 +1802,33 @@ This widget allows the cursor to be easily moved to the other interesting spots. It can be invoked repeatedly to cycle between all positions reported by the completion system. ) +tindex(delete-whole-word-match) +item(tt(delete-whole-word-match))( +This is another function which works like the tt(-match) functions +described immediately above, i.e. using styles to decide the word +boundaries. However, it is not a replacement for any existing function. + +The basic behaviour is to delete the word around the cursor. There is no +numeric prefix handling; only the single word around the cursor is +considered. If the widget contains the string tt(kill), the removed text +will be placed in the cutbuffer for future yanking. This can be obtained +by defining tt(kill-whole-word-match) as follows: + +example(zle -N kill-whole-word-match delete-whole-word-match) + +and then binding the widget tt(kill-whole-word-match). +) +tindex(down-line-or-beginning-search) +tindex(up-line-or-beginning-search) +item(tt(up-line-or-beginning-search), tt(down-line-or-beginning-search))( +These widgets are similar to the builtin functions tt(up-line-or-search) +and tt(down-line-or-search): if in a multiline buffer they move up or +down within the buffer, otherwise they search for a history line matching +the start of the current line. In this case, however, they search for +a line which matches the current line up to the current cursor position, in +the manner of tt(history-beginning-search-backward) and tt(-forward), rather +than the first word on the line. +) tindex(edit-command-line) item(tt(edit-command-line))( Edit the command line using your visual editor, as in tt(ksh). @@ -1890,17 +1901,6 @@ example(autoload -U history-pattern-search zle -N history-pattern-search-backward history-pattern-search zle -N history-pattern-search-forward history-pattern-search) ) -tindex(up-line-or-beginning-search) -tindex(down-line-or-beginning-search) -item(tt(up-line-or-beginning-search), tt(down-line-or-beginning-search))( -These widgets are similar to the builtin functions tt(up-line-or-search) -and tt(down-line-or-search): if in a multiline buffer they move up or -down within the buffer, otherwise they search for a history line matching -the start of the current line. In this case, however, they search for -a line which matches the current line up to the current cursor position, in -the manner of tt(history-beginning-search-backward) and tt(-forward), rather -than the first word on the line. -) tindex(incarg) vindex(incarg, use of) item(tt(incarg))( @@ -2130,6 +2130,17 @@ into the command line. example(bindkey '^Xf' insert-files) ) +tindex(insert-unicode-char) +item(tt(insert-unicode-char))( +When first executed, the user inputs a set of hexadecimal digits. +This is terminated with another call to tt(insert-unicode-char). +The digits are then turned into the corresponding Unicode character. +For example, if the widget is bound to tt(^XU), the character sequence +`tt(^XU 4 c ^XU)' inserts tt(L) (Unicode U+004c). + +See tt(insert-composed-char) for a way of inserting characters +using a two-character mnemonic. +) tindex(narrow-to-region) tindex(narrow-to-region-invisible) xitem(tt(narrow-to-region [ -p) var(pre) tt(] [ -P) var(post) tt(])) @@ -2187,17 +2198,6 @@ narrow-to-region -p $'Editing restricted region\n' \ zle recursive-edit narrow-to-region -R state) ) -tindex(insert-unicode-char) -item(tt(insert-unicode-char))( -When first executed, the user inputs a set of hexadecimal digits. -This is terminated with another call to tt(insert-unicode-char). -The digits are then turned into the corresponding Unicode character. -For example, if the widget is bound to tt(^XU), the character sequence -`tt(^XU 4 c ^XU)' inserts tt(L) (Unicode U+004c). - -See tt(insert-composed-char) for a way of inserting characters -using a two-character mnemonic. -) tindex(predict-on) tindex(predict-off) item(tt(predict-on))( @@ -2325,6 +2325,25 @@ tt(narrow-to-region-invisible) widget. One limitation of the current version is that tt(undo) will cycle through changes to the replacement and source strings before undoing the replacement itself. ) +tindex(send-invisible) +item(tt(send-invisible))( +This is similar to read-from-minibuffer in that it may be called as a +function from a widget or as a widget of its own, and interactively reads +input from the keyboard. However, the input being typed is concealed and +a string of asterisks (`tt(*)') is shown instead. The value is saved in +the paramter tt($INVISIBLE) to which a reference is inserted into the +editing buffer at the restored cursor position. If the read was aborted +by a keyboard break (typically tt(^G)) or another escape from editing such +as tt(push-line), the function returns status 1, tt($INVISIBLE) is set to +empty, and the original buffer is restored unchanged. + +If one argument is supplied to the function it is taken as a prompt, +otherwise `tt(Non-echoed text: )' is used (as in emacs). If a second and +third argument are supplied they are used to begin and end the reference +to tt($INVISIBLE) that is inserted into the buffer. The default is to +open with tt(${), then tt(INVISIBLE), and close with tt(}), but many +other effects are possible. +) tindex(smart-insert-last-word) item(tt(smart-insert-last-word))( This function may replace the tt(insert-last-word) widget, like so: -- cgit v1.2.3 From 732a07ad955c744247cce845995475f857cfafb2 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Fri, 11 Feb 2011 05:03:59 +0000 Subject: Tweak so as not to fib about send-invisible return status. --- Doc/Zsh/contrib.yo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 56dedcb9a..926c7b3c4 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -2334,8 +2334,8 @@ a string of asterisks (`tt(*)') is shown instead. The value is saved in the paramter tt($INVISIBLE) to which a reference is inserted into the editing buffer at the restored cursor position. If the read was aborted by a keyboard break (typically tt(^G)) or another escape from editing such -as tt(push-line), the function returns status 1, tt($INVISIBLE) is set to -empty, and the original buffer is restored unchanged. +as tt(push-line), tt($INVISIBLE) is set to empty and the original buffer +is restored unchanged. If one argument is supplied to the function it is taken as a prompt, otherwise `tt(Non-echoed text: )' is used (as in emacs). If a second and -- cgit v1.2.3 From 2eac10577064b3de18173ba0e2ee07ee55240feb Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Fri, 4 Mar 2011 13:25:25 +0000 Subject: 28853: Fix typo: preceed -> precede --- ChangeLog | 9 +++++++-- Doc/Zsh/contrib.yo | 2 +- Doc/Zsh/expn.yo | 2 +- Functions/Chpwd/cdr | 2 +- Src/builtin.c | 2 +- Src/prompt.c | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 69b892566..7e6a794b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-03-04 Frank Terbeck + + * 28853: Doc/Zsh/contrib.yo, Doc/Zsh/expn.yo, Functions/Chpwd/cdr, + Src/builtin.c, Src/prompt.c: Fix typo: preceed -> precede + 2011-03-02 Barton E. Schaefer * 28805: Doc/Zsh/builtins.yo, Doc/Zsh/mod_sched.yo: move stray @@ -1272,7 +1277,7 @@ * users/15011: Completion/Unix/Type/_path_files, Doc/Zsh/compsys.yo: add path-completion style to allow - completion of preceeding directories in files to be be turned + completion of preceding directories in files to be be turned off. 2010-04-13 Peter Stephenson @@ -14287,5 +14292,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5213 $ +* $Revision: 1.5214 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 926c7b3c4..c5808fbeb 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -355,7 +355,7 @@ subsect(Use) All direct user interaction is via the tt(cdr) function. The argument to cdr is a number var(N) corresponding to the var(N)th most -recently changed-to directory. 1 is the immediately preceeding directory; +recently changed-to directory. 1 is the immediately preceding directory; the current directory is remembered but is not offered as a destination. Note that if you have multiple windows open 1 may refer to a directory changed to in another window; you can avoid this by having per-terminal diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index d246c3c23..9c4491386 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -381,7 +381,7 @@ Each part of a command argument that takes the form `tt(LPAR())var(list)tt(RPAR())' or `tt(=LPAR())var(list)tt(RPAR())' -is subject to process substitution. The expression may be preceeded +is subject to process substitution. The expression may be preceded or followed by other strings except that, to prevent clashes with commonly occurring strings and patterns, the last form must occur at the start of a command argument, and the forms diff --git a/Functions/Chpwd/cdr b/Functions/Chpwd/cdr index 3025a9d5c..4f399106b 100644 --- a/Functions/Chpwd/cdr +++ b/Functions/Chpwd/cdr @@ -15,7 +15,7 @@ # changing directory permanently, see below. # # The argument to cdr is a number corresponding to the Nth most recently -# changed-to directory starting at 1 for the immediately preceeding +# changed-to directory starting at 1 for the immediately preceding # directory (the current directory is remembered but is not offered as a # destination). You can use directory arguments if you set the # recent-dirs-default style, see below; however, it should be noted diff --git a/Src/builtin.c b/Src/builtin.c index 6dbfa75ca..cda5e68cb 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -4713,7 +4713,7 @@ zexit(int val, int from_where) */ in_exit = -1; /* - * We want to do all remaining processing regardless of preceeding + * We want to do all remaining processing regardless of preceding * errors. */ errflag = 0; diff --git a/Src/prompt.c b/Src/prompt.c index a91ac541f..715f4b503 100644 --- a/Src/prompt.c +++ b/Src/prompt.c @@ -1205,7 +1205,7 @@ prompttrunc(int arg, int truncchar, int doprint, int endchar, if (truncatleft) { /* * To truncate at the left, selectively copy - * maxwidth bytes from the main prompt, preceeded + * maxwidth bytes from the main prompt, preceded * by the truncation string in full. * * We're overwriting the string containing the -- cgit v1.2.3 From f2dca9e155f25ee57f15df7dc2dc81489e1abbae Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 11 Mar 2011 16:32:07 +0000 Subject: users/15864: turn zsh_directory_name into a hook --- ChangeLog | 8 ++- Completion/Zsh/Context/_dynamic_directory_name | 12 +++- Doc/Zsh/contrib.yo | 52 +++++++---------- Doc/Zsh/expn.yo | 25 +++++++-- Functions/Chpwd/.distfiles | 1 + Functions/Chpwd/zsh_directory_name_cdr | 25 +++++++++ Functions/Misc/add-zsh-hook | 7 ++- Src/subst.c | 4 +- Src/utils.c | 78 ++++++++++++++++++++------ 9 files changed, 149 insertions(+), 63 deletions(-) create mode 100644 Functions/Chpwd/zsh_directory_name_cdr (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 1a6a69d09..bdbc02d84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2011-03-11 Peter Stephenson + * users/15864: Completion/Zsh/Context/_dynamic_directory_name, + Doc/Zsh/contrib.yo, Doc/Zsh/expn.yo, Functions/Chpwd/.distfiles, + Functions/Chpwd/zsh_directory_name_cdr, + Functions/Misc/add-zsh-hook, Src/subst.c, Src/utils.c: + turn zsh_directory_name into a hook. + * 28886: Src/Zle/zle_utils.c: Fix 28772 for the case where regions have the "P" flag to include $PREDISPLAY in the offsets. @@ -14316,5 +14322,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5218 $ +* $Revision: 1.5219 $ ***************************************************** diff --git a/Completion/Zsh/Context/_dynamic_directory_name b/Completion/Zsh/Context/_dynamic_directory_name index 5f7fe9a90..fbea15a7a 100644 --- a/Completion/Zsh/Context/_dynamic_directory_name +++ b/Completion/Zsh/Context/_dynamic_directory_name @@ -1,7 +1,15 @@ #autoload -if [[ -n $functions[zsh_directory_name] ]]; then - zsh_directory_name c +local func +integer ret=1 + +if [[ -n $functions[zsh_directory_name] || \ + ${+zsh_directory_name_functions} -ne 0 ]] ; then + zsh_directory_name c && ret=0 + for func in $zsh_directory_name_functions; do + $func c && ret=0 + done + return ret else _message 'dynamic directory name: implemented as zsh_directory_name c' fi diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index c5808fbeb..5b9af12f3 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -302,10 +302,13 @@ called at the same point; these are so-called `hook functions'. The shell function tt(add-zsh-hook) provides a simple way of adding or removing functions from the array. -var(hook) is one of tt(chpwd), tt(periodic), tt(precmd) or tt(preexec), -the special functions in question. +var(hook) is one of tt(chpwd), tt(periodic), tt(precmd), tt(preexec), +tt(zshaddhistory), tt(zshexit), or tt(zsh_directory_name), +the special functions in question. Note that tt(zsh_directory_name) +is called in a different way from the other functions, but may +still be manipulated as a hook. -var(functions) is name of an ordinary shell function. If no options +var(function) is name of an ordinary shell function. If no options are given this will be added to the array of functions to be executed in the given context. @@ -315,6 +318,10 @@ the array of functions to be executed. If the option tt(-D) is given, the var(function) is treated as a pattern and any matching names of functions are removed from the array of functions to be executed. + +The options tt(-U), tt(-z) and tt(-k) are passed as arguments to +tt(autoload) for var(function). For functions contributed with zsh, the +options tt(-Uz) are appropriate. ) enditem() @@ -544,36 +551,15 @@ enditem() subsect(Use with dynamic directory naming) It is possible to refer to recent directories using the dynamic directory -name syntax that appeared in zsh version 4.3.7. If you create and -autoload a function tt(zsh_directory_name) containing the following code, -tt(~[1]) will refer to the most recent directory other than $PWD, and so on. -This also includes completion. - -example(if [[ $1 = n ]]; then - if [[ $2 = <-> ]]; then - # Recent directory - typeset -ga reply - autoload -Uz cdr - cdr -r - if [[ -n ${reply[$2]} ]]; then - reply=LPAR()${reply[$2]}RPAR() - return 0 - else - reply=LPAR()RPAR() - return 1 - fi - fi -elif [[ $1 = c ]]; then - if [[ $PREFIX = <-> || -z $PREFIX ]]; then - typeset -a keys values - values=LPAR()${${(f)"$+LPAR()cdr -l+RPAR()"}/ ##/:}RPAR() - keys=LPAR()${values%%:*}RPAR() - _describe -t dir-index 'recent directory index' \ - values keys -V unsorted -S']' - return - fi -fi -return 1) +name syntax by using the supplied function tt(zsh_directory_name_cdr) +a hook: + +example(autoload -Uz add-zsh-hook +add-zsh-hook -Uz zsh_directory_name zsh_directory_name_cdr) + +When this is done, tt(~[1]) will refer to the most recent +directory other than $PWD, and so on. Completion after tt(~[)var(...) +also works. subsect(Details of directory handling) diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 9c4491386..1bace49c3 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1517,8 +1517,12 @@ cindex(directories, named, dynamic) cindex(named directories, dynamic) cindex(dynamic named directories) -The feature described here is only available if the shell function -tt(zsh_directory_name) exists. +If the function tt(zsh_directory_name) exists, or the shell variable +tt(zsh_directory_name_functions) exists and contains an array of +function names, then the functions are used to implement dynamic +directory naming. The functions are tried in order until one returns +status zero, so it is important that functions test whether they can +handle the case in question and return an appropriate status. A `tt(~)' followed by a string var(namstr) in unquoted square brackets is treated specially as a dynamic directory name. Note that the first @@ -1529,11 +1533,12 @@ which is the directory corresponding to the name and return status zero (executing an assignment as the last statement is usually sufficient), or it should return status non-zero. In the former case the element of reply is used as the directory; in the latter case the substitution is deemed to -have failed and tt(NOMATCH) handling is applied if the option is set. +have failed. If all functions fail and the option tt(NOMATCH) is set, +an error results. -The function tt(zsh_directory_name) is also used to see if a directory can +The functions defined as above are also used to see if a directory can be turned into a name, for example when printing the directory stack or -when expanding tt(%~) in prompts. In this case the function is passed two +when expanding tt(%~) in prompts. In this case each function is passed two arguments: the string tt(d) (for directory) and the candidate for dynamic naming. The function should either return non-zero status, if the directory cannot be named by the function, or it should set the array reply @@ -1551,7 +1556,15 @@ parts of the directory path, as described below; it is used if the prefix length matched (16 in the example) is longer than that matched by any static name. -The completion system calls `tt(zsh_directory_name c)' in order to +It is not a requirement that a function implements both +tt(n) and tt(d) calls; for example, it might be appropriate for certain +dynamic forms of expansion not to be contracted to names. In that case +any call with the first argument tt(d) should cause a non-zero status to +be returned. + +The completion system calls `tt(zsh_directory_name c)' followed by +equivalent calls to elements of the array +tt(zsh_directory_name_functions), if it exists, in order to complete dynamic names for directories. The code for this should be as for any other completion function as described in ifnzman(noderef(Completion System))\ diff --git a/Functions/Chpwd/.distfiles b/Functions/Chpwd/.distfiles index 39ccd830c..89779a686 100644 --- a/Functions/Chpwd/.distfiles +++ b/Functions/Chpwd/.distfiles @@ -5,4 +5,5 @@ _cdr chpwd_recent_add chpwd_recent_dirs chpwd_recent_filehandler +zsh_directory_name_cdr ' diff --git a/Functions/Chpwd/zsh_directory_name_cdr b/Functions/Chpwd/zsh_directory_name_cdr new file mode 100644 index 000000000..09aa35a93 --- /dev/null +++ b/Functions/Chpwd/zsh_directory_name_cdr @@ -0,0 +1,25 @@ +if [[ $1 = n ]]; then + if [[ $2 = <-> ]]; then + # Recent directory + typeset -ga reply + autoload -Uz cdr + cdr -r + if [[ -n ${reply[$2]} ]]; then + reply=(${reply[$2]}) + return 0 + else + reply=() + return 1 + fi + fi +elif [[ $1 = c ]]; then + if [[ $PREFIX = <-> || -z $PREFIX ]]; then + typeset -a keys values + values=(${${(f)"$(cdr -l)"}/ ##/:}) + keys=(${values%%:*}) + _describe -t dir-index 'recent directory index' \ + values keys -V unsorted -S']' + return + fi +fi +return 1 diff --git a/Functions/Misc/add-zsh-hook b/Functions/Misc/add-zsh-hook index aedc1e754..c49688643 100644 --- a/Functions/Misc/add-zsh-hook +++ b/Functions/Misc/add-zsh-hook @@ -1,6 +1,6 @@ # Add to HOOK the given FUNCTION. # HOOK is one of chpwd, precmd, preexec, periodic, zshaddhistory, -# zshexit (the _functions subscript is not required). +# zshexit, zsh_directory_name (the _functions subscript is not required). # # With -d, remove the function from the hook instead; delete the hook # variable if it is empty. @@ -15,7 +15,10 @@ emulate -L zsh local -a hooktypes -hooktypes=(chpwd precmd preexec periodic zshaddhistory zshexit) +hooktypes=( + chpwd precmd preexec periodic zshaddhistory zshexit + zsh_directory_name +) local opt local -a autoopts diff --git a/Src/subst.c b/Src/subst.c index 37d63cabe..9b3699a47 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -579,7 +579,6 @@ filesubstr(char **namptr, int assign) char *str = *namptr; if (*str == Tilde && str[1] != '=' && str[1] != Equals) { - Shfunc dirfunc; char *ptr, *tmp, *res, *ptr2; int val; @@ -594,12 +593,11 @@ filesubstr(char **namptr, int assign) *namptr = dyncat((tmp = oldpwd) ? tmp : pwd, str + 2); return 1; } else if (str[1] == Inbrack && - (dirfunc = getshfunc("zsh_directory_name")) && (ptr2 = strchr(str+2, Outbrack))) { char **arr; untokenize(tmp = dupstrpfx(str+2, ptr2 - (str+2))); remnulargs(tmp); - arr = subst_string_by_func(dirfunc, "n", tmp); + arr = subst_string_by_hook("zsh_directory_name", "n", tmp); res = arr ? *arr : NULL; if (res) { *namptr = dyncat(res, ptr2+1); diff --git a/Src/utils.c b/Src/utils.c index 844a43e1b..9857303bb 100644 --- a/Src/utils.c +++ b/Src/utils.c @@ -890,7 +890,8 @@ finddir(char *s) { static struct nameddir homenode = { {NULL, "", 0}, NULL, 0 }; static int ffsz; - Shfunc func = getshfunc("zsh_directory_name"); + char **ares; + int len; /* Invalidate directory cache if argument is NULL. This is called * * whenever a node is added to or removed from the hash table, and * @@ -906,9 +907,16 @@ finddir(char *s) return finddir_last = NULL; } - /* It's not safe to use the cache while we have function transformations.*/ - if(!func && !strcmp(s, finddir_full) && *finddir_full) +#if 0 + /* + * It's not safe to use the cache while we have function + * transformations, and it's not clear it's worth the + * complexity of guessing here whether subst_string_by_hook + * is going to turn up the goods. + */ + if (!strcmp(s, finddir_full) && *finddir_full) return finddir_last; +#endif if ((int)strlen(s) >= ffsz) { free(finddir_full); @@ -920,18 +928,15 @@ finddir(char *s) finddir_scan(&homenode.node, 0); scanhashtable(nameddirtab, 0, 0, 0, finddir_scan, 0); - if (func) { - char **ares = subst_string_by_func(func, "d", finddir_full); - int len; - if (ares && arrlen(ares) >= 2 && - (len = (int)zstrtol(ares[1], NULL, 10)) > finddir_best) { - /* better duplicate this string since it's come from REPLY */ - finddir_last = (Nameddir)hcalloc(sizeof(struct nameddir)); - finddir_last->node.nam = zhtricat("[", dupstring(ares[0]), "]"); - finddir_last->dir = dupstrpfx(finddir_full, len); - finddir_last->diff = len - strlen(finddir_last->node.nam); - finddir_best = len; - } + ares = subst_string_by_hook("zsh_directory_name", "d", finddir_full); + if (ares && arrlen(ares) >= 2 && + (len = (int)zstrtol(ares[1], NULL, 10)) > finddir_best) { + /* better duplicate this string since it's come from REPLY */ + finddir_last = (Nameddir)hcalloc(sizeof(struct nameddir)); + finddir_last->node.nam = zhtricat("[", dupstring(ares[0]), "]"); + finddir_last->dir = dupstrpfx(finddir_full, len); + finddir_last->diff = len - strlen(finddir_last->node.nam); + finddir_best = len; } return finddir_last; @@ -3212,7 +3217,7 @@ getshfunc(char *nam) char ** subst_string_by_func(Shfunc func, char *arg1, char *orig) { - int osc = sfcontext; + int osc = sfcontext, osm = stopmsg; LinkList l = newlinklist(); char **ret; @@ -3228,6 +3233,47 @@ subst_string_by_func(Shfunc func, char *arg1, char *orig) ret = getaparam("reply"); sfcontext = osc; + stopmsg = osm; + return ret; +} + +/** + * Front end to subst_string_by_func to use hook-like logic. + * name can refer to a function, and name + "_hook" can refer + * to an array containing a list of functions. The functions + * are tried in order until one returns success. + */ +/**/ +char ** +subst_string_by_hook(char *name, char *arg1, char *orig) +{ + Shfunc func; + char **ret = NULL; + + if ((func = getshfunc(name))) { + ret = subst_string_by_func(func, arg1, orig); + } + + if (!ret) { + char **arrptr; + int namlen = strlen(name); + VARARR(char, arrnam, namlen + HOOK_SUFFIX_LEN); + memcpy(arrnam, name, namlen); + memcpy(arrnam + namlen, HOOK_SUFFIX, HOOK_SUFFIX_LEN); + + if ((arrptr = getaparam(arrnam))) { + /* Guard against internal modification of the array */ + arrptr = arrdup(arrptr); + for (; *arrptr; arrptr++) { + if ((func = getshfunc(*arrptr))) { + ret = subst_string_by_func(func, arg1, orig); + if (ret) + break; + } + } + } + } + return ret; } -- cgit v1.2.3 From ae6fb299f33e8dcffeb18787b4a041f47f17cab5 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 20:07:05 +0000 Subject: Mike Meyer: 28956, 28957: Add fossil support to vcs_info. --- ChangeLog | 9 +++++++- Doc/Zsh/contrib.yo | 7 +++++-- Functions/VCS_Info/Backends/VCS_INFO_detect_fossil | 13 ++++++++++++ .../VCS_Info/Backends/VCS_INFO_get_data_fossil | 24 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 Functions/VCS_Info/Backends/VCS_INFO_detect_fossil create mode 100644 Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index a595be973..9141f9c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-03-20 Frank Terbeck + + * Mike Meyer: 28956, 28957: + Functions/VCS_Info/Backends/VCS_INFO_detect_fossil, + Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil, + Doc/Zsh/contrib.yo: Add fossil support to vcs_info. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14387,5 +14394,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5233 $ +* $Revision: 1.5234 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 5b9af12f3..81167bf3e 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -600,6 +600,7 @@ sitem(Bazaar (tt(bzr)))(http://bazaar-vcs.org/) sitem(Codeville (tt(cdv)))(http://codeville.org/) sitem(Concurrent Versioning System (tt(cvs)))(http://www.nongnu.org/cvs/) sitem(Darcs (tt(darcs)))(http://darcs.net/) +sitem(Fossil (tt(fossil)))(http://fossil-scm.org/) sitem(Git (tt(git)))(http://git-scm.com/) sitem(GNU arch (tt(tla)))(http://www.gnu.org/software/gnu-arch/) sitem(Mercurial (tt(hg)))(http://mercurial.selenic.com/) @@ -649,6 +650,7 @@ bzr cdv cvs darcs +fossil git hg mtn @@ -692,8 +694,9 @@ example(:vcs_info:::) startitem() item(tt())( is one of: git, git-svn, git-p4, hg, hg-git, hg-hgsubversion, hg-hgsvn, -darcs, bzr, cdv, mtn, svn, cvs, svk, tla or p4. When hooks are active the -hooks name is added after a `+'. (See tt(Hooks in vcs_info) below.) +darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil. When hooks are +active the hooks name is added after a `+'. (See tt(Hooks in vcs_info) +below.) ) item(tt())( is a freely configurable string, assignable by diff --git a/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil new file mode 100644 index 000000000..551528361 --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_detect_fossil @@ -0,0 +1,13 @@ +## vim:ft=zsh +## fossil support by: Mike Meyer +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions NO_shwordsplit + +[[ $1 == '--flavours' ]] && return 1 + +VCS_INFO_check_com ${vcs_comm[cmd]} || return 1 +vcs_comm[detect_need_file]=_FOSSIL_ +VCS_INFO_bydir_detect . || return 1 + +return 0 diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil b/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil new file mode 100644 index 000000000..fd0f8389e --- /dev/null +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_fossil @@ -0,0 +1,24 @@ +## vim:ft=zsh +## fossil support by: Mike Meyer (mwm@mired.org) +## Distributed under the same BSD-ish license as zsh itself. + +setopt localoptions extendedglob +local a b +local -A fsinfo +local fshash fsbranch changed merging action + +${vcs_comm[cmd]} status | + while IFS=: read a b; do + fsinfo[${a//-/_}]="${b## #}" + done + +fshash=${fsinfo[checkout]%% *} +fsbranch=${fsinfo[tags]%%, *} +changed=${(Mk)fsinfo:#(ADDED|EDITED|DELETED|UPDATED)*} +merging=${(Mk)fsinfo:#*_BY_MERGE*} +if [ -n "$merging" ]; then + action="merging" +fi + +VCS_INFO_formats "$action" "${fsbranch}" "${fsinfo[local_root]}" '' "$changed" "${fshash}" "${fsinfo[repository]}" +return 0 -- cgit v1.2.3 From abe0ee3936c7f4a291666af3a9d70ed2a6d710f4 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:17:07 +0000 Subject: 28960: Add functions to add/remove static hooks. --- ChangeLog | 7 +++++- Doc/Zsh/contrib.yo | 28 ++++++++++++++++++++++- Functions/VCS_Info/.distfiles | 2 ++ Functions/VCS_Info/vcs_info | 2 ++ Functions/VCS_Info/vcs_info_hookadd | 22 ++++++++++++++++++ Functions/VCS_Info/vcs_info_hookdel | 45 +++++++++++++++++++++++++++++++++++++ 6 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 Functions/VCS_Info/vcs_info_hookadd create mode 100644 Functions/VCS_Info/vcs_info_hookdel (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index a18ac7163..808344d2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,11 @@ * 28958: Functions/VCS_Info/VCS_INFO_hook: Support registering hooks independent of the context. + * 28960: Doc/Zsh/contrib.yo, Functions/VCS_Info/.distfiles, + Functions/VCS_Info/vcs_info, Functions/VCS_Info/vcs_info_hookadd, + Functions/VCS_Info/vcs_info_hookdel: Add functions to add/remove + static hooks. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14402,5 +14407,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5236 $ +* $Revision: 1.5237 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 81167bf3e..5c82c5d46 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1117,6 +1117,24 @@ tt(Variable description) below). If an argument is given, that string will be used instead of tt(default) in the tt(user-context) field of the style context. ) +findex(vcs_info_hookadd) +item(tt(vcs_info_hookadd))( +Statically registers a number of functions to a given hook. The hook needs +to be given as the first argument; what follows is a list of hook-function +names to register to the hook. The `tt(+vi-)' prefix needs to be left out +here. See tt(Hooks in vcs_info) below for details. +) +findex(vcs_info_hookdel) +item(tt(vcs_info_hookdel))( +Remove hook-functions from a given hook. The hook needs to be given as the +first non-option argument; what follows is a list of hook-function +names to un-register from the hook. If `tt(-a)' is used as the first +argument, tt(all) occurances of the functions are unregistered. Otherwise +only the last occurance is removed (if a function was registered to a hook +more than once) . The `tt(+vi-)' prefix needs to be left out here. See +tt(Hooks in vcs_info) below for details. +) +findex(vcs_info_lastmsg) item(tt(vcs_info_lastmsg))( Outputs the last var(${vcs_info_msg_*_}) value. Takes into account the value of the tt(use-prompt-escapes) style in @@ -1129,6 +1147,7 @@ Prints a list of all supported version control systems. Useful to find out possible contexts (and which of them are enabled) or values for the var(disable) style. ) +findex(vcs_info_setsys) item(tt(vcs_info_setsys))( Initializes var(vcs_info)'s internal list of available backends. With this function, you can add support for new VCSs @@ -1176,13 +1195,20 @@ avoid namespace problems, all registered function names are prepended by a `+vi-', so the actual functions called for the `foo' hook are `tt(+vi-bar)' and `tt(+vi-baz)'. +If you would like to register a function to a hook regardless of the +current context, you may use the var(vcs_info_hookadd) function. To remove +a function that was added like that, the var(vcs_info_hookdel) function +can be used. + If something seems weird, you can enable the `debug' boolean style in the proper context and the hook-calling code will print what it tried to execute and whether the function in question existed. When you register more than one function to a hook, all functions are executed one after another until one function returns non-zero or until -all functions have been called. +all functions have been called. Context-sensitive hook functions are +executed tt(before) statically registered ones (the ones added by +var(vcs_info_hookadd)). You may pass data between functions via an associative array, tt(user_data). For example: diff --git a/Functions/VCS_Info/.distfiles b/Functions/VCS_Info/.distfiles index 988e7ada4..b6e55d2fc 100644 --- a/Functions/VCS_Info/.distfiles +++ b/Functions/VCS_Info/.distfiles @@ -1,6 +1,8 @@ DISTFILES_SRC=' .distfiles vcs_info +vcs_info_hookadd +vcs_info_hookdel VCS_INFO_adjust VCS_INFO_bydir_detect VCS_INFO_check_com diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 6ce1cd702..385a451da 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -26,6 +26,8 @@ static_functions=( VCS_INFO_reposub VCS_INFO_set + vcs_info_hookadd + vcs_info_hookdel vcs_info_lastmsg vcs_info_printsys vcs_info_setsys diff --git a/Functions/VCS_Info/vcs_info_hookadd b/Functions/VCS_Info/vcs_info_hookadd new file mode 100644 index 000000000..867f7e271 --- /dev/null +++ b/Functions/VCS_Info/vcs_info_hookadd @@ -0,0 +1,22 @@ +## vim:ft=zsh +## Written by Frank Terbeck +## Distributed under the same BSD-ish license as zsh itself. + +emulate -L zsh +setopt extendedglob + +if (( ${#argv} < 2 )); then + print 'usage: vcs_info_hookadd ' + return 1 +fi + +local hook func context +local -a old + +hook=$1 +shift +context=":vcs_info-static_hooks:${hook}" + +zstyle -a "${context}" hooks old +zstyle "${context}" hooks "${old[@]}" "$@" +return $? diff --git a/Functions/VCS_Info/vcs_info_hookdel b/Functions/VCS_Info/vcs_info_hookdel new file mode 100644 index 000000000..e09a0575e --- /dev/null +++ b/Functions/VCS_Info/vcs_info_hookdel @@ -0,0 +1,45 @@ +## vim:ft=zsh +## Written by Frank Terbeck +## Distributed under the same BSD-ish license as zsh itself. + +emulate -L zsh +setopt extendedglob + +local -i all + +if [[ "x$1" == 'x-a' ]]; then + all=1 + shift +else + all=0 +fi + +if (( ${#argv} < 2 )); then + print 'usage: vcs_info_hookdel [-a] ' + return 1 +fi + +local hook func context +local -a old + +hook=$1 +shift +context=":vcs_info-static_hooks:${hook}" + +zstyle -a "${context}" hooks old || return 0 +for func in "$@"; do + if [[ -n ${(M)old:#$func} ]]; then + old[(Re)$func]=() + else + printf 'Not statically registered to `%s'\'': "%s"\n' \ + "${hook}" "${func}" + continue + fi + if (( all )); then + while [[ -n ${(M)old:#$func} ]]; do + old[(Re)$func]=() + done + fi +done +zstyle "${context}" hooks "${old[@]}" +return $? -- cgit v1.2.3 From 7c50fa1262bd106a923f8b7be85d8f23afc4ecc7 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:19:17 +0000 Subject: 28961: Add `no-vcs' hook. --- ChangeLog | 5 ++++- Doc/Zsh/contrib.yo | 5 +++++ Functions/VCS_Info/VCS_INFO_set | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 808344d2f..6c70d1acf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,9 @@ Functions/VCS_Info/vcs_info_hookdel: Add functions to add/remove static hooks. + * 28961: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set: Add + `no-vcs' hook. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14407,5 +14410,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5237 $ +* $Revision: 1.5238 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 5c82c5d46..bc4a814a5 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -1307,6 +1307,11 @@ When setting tt(ret) to non-zero, the string in tt(${hook_com[guards-string]}) will be used in the var(%g) escape in the tt(patch-format) and tt(nopatch-format) styles. ) +item(tt(no-vcs))( +This hooks is called when no version control system was detected. + +The `hook_com' parameter is not used. +) item(tt(post-quilt))( Called after the tt(quilt) support is done. The following information is passed as arguments to the hook: 1. the quilt-support mode (`addon' or diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index a2b838cdb..23dc06b4b 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -16,6 +16,7 @@ if [[ $1 == '--nvcs' ]] ; then typeset -gx vcs_info_msg_${i}_= done VCS_INFO_nvcsformats $2 + [[ $2 != '-preinit-' ]] && VCS_INFO_hook "no-vcs" fi (( ${#msgs} - 1 < 0 )) && return 0 -- cgit v1.2.3 From eb46727d3a03f2282e811664eee68c7e581c3277 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Wed, 30 Mar 2011 21:24:42 +0000 Subject: 28959: Make the nvcsformats style be used if vcs_info is disabled. --- ChangeLog | 6 +++++- Doc/Zsh/contrib.yo | 10 +++++----- Functions/VCS_Info/VCS_INFO_set | 5 ----- Functions/VCS_Info/vcs_info | 5 +++-- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 6c70d1acf..5368f0a18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,10 @@ * 28961: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set: Add `no-vcs' hook. + * 28959: Doc/Zsh/contrib.yo, Functions/VCS_Info/VCS_INFO_set, + Functions/VCS_Info/vcs_info: Make the nvcsformats style be used if + vcs_info is disabled. + 2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in @@ -14410,5 +14414,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5238 $ +* $Revision: 1.5239 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index bc4a814a5..476e7ca31 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -756,11 +756,11 @@ revision number. This style lets you modify how that string should look. ) kindex(nvcsformats) item(tt(nvcsformats))( -These "formats" are exported when we didn't detect -a version control system for the current directory. This is useful if you -want var(vcs_info) to completely take over the generation of your prompt. -You would do something like tt(PS1='${vcs_info_msg_0_}') to accomplish -that. +These "formats" are exported when we didn't detect a version control system +for the current directory or var(vcs_info) was disabled. This is useful if +you want var(vcs_info) to completely take over the generation of your +prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to +accomplish that. ) kindex(hgrevformat) item(tt(hgrevformat))( diff --git a/Functions/VCS_Info/VCS_INFO_set b/Functions/VCS_Info/VCS_INFO_set index 23dc06b4b..5087be43f 100644 --- a/Functions/VCS_Info/VCS_INFO_set +++ b/Functions/VCS_Info/VCS_INFO_set @@ -5,11 +5,6 @@ setopt localoptions noksharrays NO_shwordsplit local -i i j -if [[ $1 == '--clear' ]] ; then - for i in {0..9} ; do - unset vcs_info_msg_${i}_ - done -fi if [[ $1 == '--nvcs' ]] ; then [[ $2 == '-preinit-' ]] && (( maxexports == 0 )) && (( maxexports = 1 )) for i in {0..$((maxexports - 1))} ; do diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info index 385a451da..513489b70 100644 --- a/Functions/VCS_Info/vcs_info +++ b/Functions/VCS_Info/vcs_info @@ -37,6 +37,7 @@ for func in ${static_functions} ; do autoload -Uz ${func} done +[[ -n ${(Mk)parameters:#vcs_info_msg_<->_} ]] && unset ${parameters[(I)vcs_info_msg_<->_]} VCS_INFO_set --nvcs '-preinit-' vcs_info_setsys @@ -77,7 +78,7 @@ vcs_info () { (( ${#enabled} == 0 )) && enabled=( all ) if [[ -n ${(M)enabled:#(#i)none} ]] ; then - [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs return 0 fi @@ -90,7 +91,7 @@ vcs_info () { for pat in ${dps} ; do if [[ ${PWD} == ${~pat} ]] ; then - [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --clear + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs return 0 fi done -- cgit v1.2.3 From e1be101682739324b96f0788cccf8db99f7b5f6a Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sat, 7 May 2011 07:05:35 +0000 Subject: 29170: vcs_info: Clarify check-for-changes style behaviour with the mercurial backend. --- ChangeLog | 7 ++++++- Doc/Zsh/contrib.yo | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index e3f6decae..5d66c8fd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-05-07 Frank Terbeck + + * 29170: Doc/Zsh/contrib.yo: vcs_info: Clarify check-for-changes + style behaviour with the mercurial backend. + 2011-05-06 Peter Stephenson * 29163: README, Etc/FAQ.yo: update latest version claimed @@ -14590,5 +14595,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5278 $ +* $Revision: 1.5279 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index 476e7ca31..dc62a29f7 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -826,6 +826,10 @@ these escapes can be controlled via the var(stagedstr) and var(unstagedstr) styles. The only backends that currently support this option are tt(git) and tt(hg) (tt(hg) only supports unstaged). +For this style to be evaluated with the tt(hg) backend, the var(get-revision) +needs to be set and the var(use-simple) style needs to be unset. The latter +is the default; the former is not. + Note, the actions taken if this style is enabled are potentially expensive (read: they may be slow, depending on how big the current repository is). Therefore, it is disabled by default. -- cgit v1.2.3 From 0ba32c913067130a8251569076b41402032b1afe Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Sat, 7 May 2011 18:39:35 +0000 Subject: unposted: Add missing word ("style") spotted by Bart. --- ChangeLog | 5 ++++- Doc/Zsh/contrib.yo | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 5d66c8fd7..0b9cc79df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * 29170: Doc/Zsh/contrib.yo: vcs_info: Clarify check-for-changes style behaviour with the mercurial backend. + * unposted: Doc/Zsh/contrib.yo: Add missing word ("style") spotted + by Bart. + 2011-05-06 Peter Stephenson * 29163: README, Etc/FAQ.yo: update latest version claimed @@ -14595,5 +14598,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5279 $ +* $Revision: 1.5280 $ ***************************************************** diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index dc62a29f7..31f41942f 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -827,8 +827,8 @@ styles. The only backends that currently support this option are tt(git) and tt(hg) (tt(hg) only supports unstaged). For this style to be evaluated with the tt(hg) backend, the var(get-revision) -needs to be set and the var(use-simple) style needs to be unset. The latter -is the default; the former is not. +style needs to be set and the var(use-simple) style needs to be unset. The +latter is the default; the former is not. Note, the actions taken if this style is enabled are potentially expensive (read: they may be slow, depending on how big the current repository is). -- cgit v1.2.3 From 72cb7cfc6fff21d3fb9b3f1aa384ce4b17a4e8c0 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Thu, 19 May 2011 16:10:46 +0000 Subject: 29307, 29308 + replies: Fix some doubled words in docs and comments. --- ChangeLog | 7 ++++++- Completion/BSD/Command/_bsd_pkg | 2 +- Completion/Base/Utility/_sep_parts | 2 +- Completion/Unix/Command/_git | 2 +- Completion/Unix/Command/_osc | 2 +- Completion/Unix/Command/_perforce | 2 +- Completion/compinit | 2 +- Completion/openSUSE/Command/_osc | 2 +- Completion/openSUSE/Command/_zypper | 2 +- Doc/Zsh/builtins.yo | 2 +- Doc/Zsh/calsys.yo | 2 +- Doc/Zsh/compctl.yo | 2 +- Doc/Zsh/compsys.yo | 4 ++-- Doc/Zsh/compwid.yo | 2 +- Doc/Zsh/contrib.yo | 10 +++++----- Doc/Zsh/expn.yo | 2 +- Doc/Zsh/zle.yo | 6 +++--- Etc/CONTRIBUTORS | 2 +- Etc/ChangeLog-3.0 | 2 +- Functions/Calendar/calendar_parse | 2 +- Functions/Misc/sticky-note | 2 +- Functions/TCP/tcp_read | 2 +- Functions/Zftp/zfcput | 2 +- Src/Zle/compctl.c | 2 +- Src/Zle/zle_hist.c | 2 +- Src/exec.c | 2 +- Src/hist.c | 2 +- Src/jobs.c | 2 +- Src/lex.c | 2 +- Src/math.c | 2 +- Src/params.c | 2 +- Src/subst.c | 4 ++-- 32 files changed, 45 insertions(+), 40 deletions(-) (limited to 'Doc/Zsh/contrib.yo') diff --git a/ChangeLog b/ChangeLog index 34b5a3bbd..c59967ba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-05-19 Mikael Magnusson + + * 29307, 29308 + replies: Fix some doubled words in docs and + comments. + 2011-05-18 Wayne Davison * Valentin Haenel: 29315: Completion/Unix/Command/_git: add a @@ -14747,5 +14752,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5311 $ +* $Revision: 1.5312 $ ***************************************************** diff --git a/Completion/BSD/Command/_bsd_pkg b/Completion/BSD/Command/_bsd_pkg index 8cc1a6230..9f4b0f11a 100644 --- a/Completion/BSD/Command/_bsd_pkg +++ b/Completion/BSD/Command/_bsd_pkg @@ -178,7 +178,7 @@ _bsd_pkg() { '-m[show mtree files]' '-p[show installation prefixes]' '-q[be quiet]' - '-R[show list list of installed requiring packages]' + '-R[show list of installed requiring packages]' '-r[show requirements scripts]' '-v[be verbose]' ) diff --git a/Completion/Base/Utility/_sep_parts b/Completion/Base/Utility/_sep_parts index 6e6c1beed..de836a696 100644 --- a/Completion/Base/Utility/_sep_parts +++ b/Completion/Base/Utility/_sep_parts @@ -96,7 +96,7 @@ suffixes=("") autosuffix=() while [[ $# -gt 0 && "$str" == *${1}* ]]; do - # Remove anything up to the the suffix. + # Remove anything up to the suffix. str="${str#*${1}}" diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git index 2ebeef094..2f6188824 100644 --- a/Completion/Unix/Command/_git +++ b/Completion/Unix/Command/_git @@ -131,7 +131,7 @@ _git-archive () { '--format=-[format of the resulting archive]:archive format:__git_archive_formats' \ '(- :)'{-l,--list}'[list available archive formats]' \ '(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \ - '--prefix=-[prepend the given path prefix to to each filename]:path prefix:_directories -r ""' \ + '--prefix=-[prepend the given path prefix to each filename]:path prefix:_directories -r ""' \ '--output=[write archive to argument instead of stdout]:archive:_files' \ '--worktree-attributes[look for attributes in .gitattributes in working directory too]' \ $backend_args \ diff --git a/Completion/Unix/Command/_osc b/Completion/Unix/Command/_osc index 2808f92ee..c15b40af2 100644 --- a/Completion/Unix/Command/_osc +++ b/Completion/Unix/Command/_osc @@ -4,7 +4,7 @@ # # This file is released under the GPLv2. # -# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html +# Based on the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html # # Toggle verbose completions: zstyle ':completion:*:osc:*' verbose no # zstyle ':completion:*:osc-subcommand:*' verbose no diff --git a/Completion/Unix/Command/_perforce b/Completion/Unix/Command/_perforce index 0cef1f7da..08c42cbce 100644 --- a/Completion/Unix/Command/_perforce +++ b/Completion/Unix/Command/_perforce @@ -2605,7 +2605,7 @@ _perforce_cmd_tickets() { _perforce_cmd_triggers() { _arguments -s : \ '-o[output form to stdout]' \ - '-i[read from from stdin]' + '-i[read from stdin]' } diff --git a/Completion/compinit b/Completion/compinit index fc3625fc7..d3c5e28b5 100644 --- a/Completion/compinit +++ b/Completion/compinit @@ -26,7 +26,7 @@ # expand-or-complete, expand-or-complete-prefix, list-choices, # menu-complete, menu-expand-or-complete, or reverse-menu-complete). # This creates a widget behaving like