diff options
Diffstat (limited to 'Etc')
-rw-r--r-- | Etc/FAQ.yo | 46 | ||||
-rw-r--r-- | Etc/zsh-development-guide | 53 |
2 files changed, 91 insertions, 8 deletions
diff --git a/Etc/FAQ.yo b/Etc/FAQ.yo index c23dff5b2..9b7e558a6 100644 --- a/Etc/FAQ.yo +++ b/Etc/FAQ.yo @@ -126,6 +126,7 @@ Chapter 3: How to get various things to work 3.25. How do I get coloured prompts on my colour xterm? 3.26. Why is my output duplicated with `tt(foo 2>&1 >foo.out | bar)'? 3.27. What are these `^' and `~' pattern characters, anyway? +3.28. How do I edit the input buffer in $EDITOR? Chapter 4: The mysteries of completion 4.1. What is completion? @@ -305,7 +306,7 @@ sect(On what machines will it run?) sect(What's the latest version?) - Zsh 5.0.8 is the latest production version. For details of all the + Zsh 5.1 is the latest production version. For details of all the changes, see the NEWS file in the source distribution. A beta of the next version is sometimes available. Development of zsh is @@ -777,6 +778,27 @@ label(23) mytt(function) to define a function, which doesn't expand aliases. It is possible to argue for extra warnings somewhere in this mess. + One workaround for this is to use the "function" keyword instead: + verb( + alias l='/bin/ls -F' + function l { /bin/ls -la "$@" | more } + ) + The mytt(l) after mytt(function) is not expanded. Note you don't need + the mytt(LPAR()RPAR()) in this case, although it's harmless. + + You need to be careful if you are defining a function with multiple + names; most people don't need to do this, so it's an unusual problem, + but in case you do you should be aware that in versions of the shell + before 5.1 names after the first em(were) expanded: + verb( + function a b c { ... } + ) + Here, mytt(b) and mytt(c), but not mytt(a), have aliases expanded. + This oddity was fixed in version 5.1. + + The rest of this item assumes you use the (more common, + but equivalent) mytt(LPAR()RPAR()) definitions. + Bart Schaefer's rule is: Define first those aliases you expect to use in the body of a function, but define the function first if the alias has the same name as the function. @@ -1701,11 +1723,17 @@ sect(What's wrong with cut and paste on my xterm?) already active, and needs to be turned off when the first command is executed. The shell doesn't even know if the remaining text is input to a command or for the shell, so there's simply nothing it can do. + However, if you have problems you can trick it: type `tt({)' on a line by itself, then paste the input, then type `tt(})' on a line by itself. The shell will not execute anything until the final brace is read; all input is read as continuation lines (this may require the fixes referred to above in order to be reliable). + + As of 5.0.9, this trick is not necessary on terminal emulators that + support the em(bracketed paste) feature (this includes most modern + terminal emulators). See the description of tt($zle_bracketed_paste) + in the tt(zshparam) manual page for details. ) @@ -1924,6 +1952,22 @@ label(327) ) +sect(How do I edit the input buffer in $EDITOR?) +label(328) + + When typing a long command interactively, it's possible to edit it in $EDITOR + before execution by using the tt(edit-command-line) ZLE widget. For example, + after putting + verb( + autoload -U edit-command-line; + zle -N edit-command-line; + bindkey '^Fc' edit-command-line; + ) + in your tt(~/.zshrc), typing mytt(^F c) will open the entered-so-far + command-line for editing. The command will not be automatically executed; + quitting the editor will only return to zsh's command-line editing mode. + + chapter(The mysteries of completion) diff --git a/Etc/zsh-development-guide b/Etc/zsh-development-guide index 7f5266bd9..cbbc798d3 100644 --- a/Etc/zsh-development-guide +++ b/Etc/zsh-development-guide @@ -70,6 +70,19 @@ avoided further changes to our workflow. a commit to the master repository. Don't create a separate change for this: amend the existing commit in your local repository. + Several developers use scripts to automate part or all of the ChangeLog + workflow: + + Subject: helper script for making ChangeLog entries + X-Seq: 33835, 33872, 34912 + http://www.zsh.org/mla/workers/2014/msg01622.html + http://www.zsh.org/mla/workers/2014/msg01659.html + http://www.zsh.org/mla/workers/2015/msg00836.html + + Subject: Re: _git commit object name completion + X-Seq: 35414 + http://www.zsh.org/mla/workers/2015/msg01338.html + * Do not merge your private feature branches onto the master branch: a linear history without merge commits is simpler to follow (and to bisect). @@ -738,7 +751,7 @@ the other things that can be defined by modules: /**/ int - boot_foo(Module m) + boot_(Module m) { int ret; @@ -748,7 +761,7 @@ the other things that can be defined by modules: ... /**/ int - cleanup_foo(Module m) + cleanup_(Module m) { deletehookdefs(m->nam, foohooks, sizeof(foohooks)/sizeof(*foohooks)); ... @@ -789,14 +802,37 @@ The definition is simple: }; The macro `WRAPDEF(...)' gets the C-function as its only argument. -This function should be defined like: +The `boot_()' function must install wrappers by calling `addwrapper()' +like so: + + /**/ + int + boot_(Module m) + { + int ret; + + ret = addwrapper(m, wrapper); + ... + } + +The `cleanup_()' function should then remove the wrappers again: + + /**/ + int + cleanup_(Module m) + { + deletewrapper(m, wrapper); + ... + } + +The wrapper function should be defined like: /**/ static int - ex_wrapper(List list, FuncWrap w, char *name) + ex_wrapper(Eprog prog, FuncWrap w, char *name) { ... - runshfunc(list, w, name); + runshfunc(prog, w, name); ... return 0; } @@ -815,11 +851,11 @@ finished: /**/ static int - ex_wrapper(List list, FuncWrap w, char *name) + ex_wrapper(Eprog prog, FuncWrap w, char *name) { if (wrapper_need_to_run) { ... - runshfunc(list, w, name); + runshfunc(prog, w, name); ... return 0; } @@ -907,6 +943,9 @@ Documentation surrounding text. No extra newlines after the opening or before the closing parenthesis are required. +A syntax highlighting file for Vim is included, just source tt(Doc/Zsh/.vimrc) +before editing one of the Doc/Zsh/*.yo files. + Module names ------------ |