diff -Nru zsh-5.0.5/ChangeLog zsh-5.0.7/ChangeLog --- zsh-5.0.5/ChangeLog 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/ChangeLog 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,1399 @@ +2014-10-07 Peter Stephenson + + * unposted: Config/version.mk: 5.0.7 + +2014-10-06 Peter Stephenson + + * unposted (discussed offline): README: update description of + integer import problem. + +2014-10-04 Barton E. Schaefer + + * 33354: Src/jobs.c, Test/A05execution.ztst: when backgrounding + a pipeline, close all pipe descriptors in the parent; add test + for both this and 33345+33346 + +2014-10-03 Bart Schaefer + + * 33346: Src/parse.c: another bit of the 33345 repair + +2014-10-03 Peter Stephenson + + * 33345: Src/parse.c, Test/C04funcdef.ztst: fix longstanding + anonoymous function corruption of "complex" state that allowed + complex wordcode to be passed to execsimple(), causing crash. + + * unposted: src/parse.c: comments were the wrong way round. + + * 33343: Src/parse.c, Test/C04funcdef.ztst: variant anonymous + function syntax with arguments. + +2014-10-02 Peter Stephenson + + * unposted: 5.0.6-dev-1. + +2014-10-02 Oliver Kiddle + + * 33323: Completion/Zsh/Command/_typeset, Doc/Zsh/builtins.yo, + Src/builtin.c: fix bug in removing math functions and complete + -M option to functions + + * 33315: Completion/Unix/Command/_sysctl: fix pattern to + match freebsd10 and later + +2014-10-02 Peter Stephenson + + * unposted: remove "major". + + * 33330: README, Etc/FAQ.yo: information for forthcoming 5.0.7 + release. + + * 33332: Test/C01arith.ztst: test numeric import fix in 33276. + +2014-10-02 Barton E. Schaefer + + * 33320 (cf. PWS 33311): Completion/Base/Completer/_expand_alias, + Src/Zle/compcore.c, Src/utils.c, Src/ztype.h: revert 33069; add + typtab_flags bits (replaces specialcomma boolean) to record any + unusual handling of typtab entries; signal safety; make bangchar + non-special during completion lexing of the command line. + +2014-10-02 Peter Stephenson + + * 33325: Src/exec.c, Test/A05execution.ztst: fix ksh autoloads + with redirections on function definitions. + +2014-10-01 Barton E. Schaefer + + * 33319: Doc/Zsh/grammar.yo: fix parens in example from 33312 + +2014-10-02 Axel Beckert + + * 33284: Mathieu Malaterre: Completion/Unix/Command/_{graphics, + image}magick: Add missing JPEG 2000 file extensions. + +2014-10-01 Peter Stephenson + + * 33312: Doc/Zsh/builtins.yo, Doc/Zsh/grammar.yo: document + redirections applied to function definitions. + +2014-09-30 Barton E. Schaefer + + * 33298: Src/lex.c: make lexrestore() more signal-safe + +2014-09-30 Peter Stephenson + + * 33294: Src/Modules/parameter.c, Test/A04redirect.ztst: + functions[func] value for functions with redirections and + extra tests. + + * 33293: Src/Zle/compctl.c, Src/Zle/zle_refresh.c: fix warnings + from swish new compilers with a contemporary outlook. + +2014-09-29 Peter Stephenson + + * 33286: Src/exec.c, Test/A04redirect.ztst: handle redirections + for multiple named functions. + + * 33285: NEWS, Src/exec.c, Src/hashtable.c, Src/parse.c, + Src/signals.c, Src/zsh.h, Test/A04redirect.ztst: redirections in + function definitions are applied at execution not definition. + +2014-09-29 Frank Terbeck + + * 33277: Functions/VCS_Info/VCS_INFO_reposub: Fix + VCS_INFO_reposub's command expansion + +2014-09-29 Peter Stephenson + + * users/19183: Src/hist.c: handle unlikely error case with + fdopen() better. + + * 33276: Src/params.c, Src/zsh.h: safer import of numerical + variables from environment. + +2014-09-28 Barton E. Schaefer + + * 33268: Src/exec.c, Src/init.c, Src/signals.c: interactive shells + treat SIGPIPE like SIGHUP if and only if SHTTY is disconnected + +2014-09-27 Barton E. Schaefer + + * 33256: Src/prompt.c: fix prompttrunc() counting of %{ %} spans + +2014-09-26 Peter Stephenson + + * 33242: Src/parse.c: don't treat tokens immediately following + end of shell constructs for, while, repeat, if as being in + command position. + + * Wieland Hoffmann: 33252: Completion/Unix/Command/_notmuch: + complete more subcommands. + +2014-09-25 Peter Stephenson + + * users/19143: Src/glob.c: **/*(odonT) didn't work because + the trailing slash wasn't properly ignored. + +2014-09-25 Peter Stephenson + + * unposted: NEWS: tweak last change. + +2014-09-24 Oliver Kiddle + + * 33238: Completion/Unix/Command/_quilt: correct return values + +2014-09-24 Peter Stephenson + + * Eric Cook: 33224: Completion/Linux/Command/_btrfs: complete + directory as second argument. + +2014-09-23 Barton E. Schaefer + + * 33223: Completion/Base/Utility/_call_program: discard stderr + except when _complete_debug is in progress. + +2014-09-23 Øystein Walle + + * 33179: Completion/Unix/Command/_git: _git: updates for Git 2.0.0 + + * 33176: Completion/Unix/Command/_git: _git: Add missing --list to + git-tag + + * 33178: Completion/Unix/Command/_git: _git: updates for Git 2.1.0 + + * 33177: Completion/Unix/Command/_git: _git: fix typo in git-apply + + * 33180: Completion/Unix/Command/_git: _git: add missing --3way + option + +2014-09-23 Peter Stephenson + + * unposted: NEWS: more minor tweaks. + + * unposted: NEWS: mention numeric output with underscore separators. + + * unposted: NEWS: mention new + /usr/local/share/zsh/site-functions default. + +2014-09-23 Peter Stephenson + + * 33221 (including 33173 from Anthony Heading): + Completion/Unix/Command/_perforce: complete directories + when handling unmaintained files and rationalise code that does + this. + + * unposted: Completion/Unix/Command/_dvi: add dvipdf to list of + commands. + + * Richard Hartmann: 33218: Completion/X/Command/_mplayer: + complete m4a files. + +2014-09-22 Oliver Kiddle + + * 33198: Completion/Unix/Command/_augeas: new augtool completion + + * users/19113: Completion/Linux/_cryptsetup: reorganised function + +2014-09-22 Daniel Hahler + + * 33217: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info: use `--ignore-submodules=dirty` with diff/diff-index + +2014-09-22 Peter Stephenson + + * 33208: Tanu Kaskinen: improve printing of paths at end of + configuration. + +2014-09-20 Peter Stephenson + + * 33214 (modified yet further): configure.ac: test prefixes better. + + * 33213: configure.ac, Config/defs.mk.in: try again. + + * 33212: Src/zsh.mdd: Src/init.c, Src/zsh.mdd, configure.ac: add + /usr/local/share/zsh/site-functions to head of fpath if not + present from result of running configure. There's no + configuration for this as it serves as a fallback. + + * Tanu Kaskinen: 33209: Doc/Makefile.in: don't fail + catastrophically when builing zsh.texi if yodl isn't available. + +2014-09-19 Barton E. Schaefer + + * 33206: Doc/Zsh/mod_computil.yo: fix compdescribe doc + + * 33205: Completion/Base/Utility/_describe: if passed both an + array of completions and an array of display strings, keep them + in sync when filtering for matches. + +2014-09-18 Peter Stephenson + + * users/19097: Doc/Zsh/mod_parameter.yo, + Src/Modules/parameter.c: remove functypetrace and instead add + cross-reference to zsh_eval_context. + +2014-09-16 Marc Finet + + * 33188: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: set rrn before using it + + * 33184: Doc/Zsh/contrib.yo, + Functions/VCS_Info/Backends/VCS_INFO_get_data_git: vcs_info git: + consider patches for rebase + +2014-09-16 Mikael Magnusson + + * 33136: Doc/Zsh/expn.yo, Src/glob.c: P glob qualifier appends + words when negated. + + * 33137: Completion/Unix/Type/_path_files: complete # to introduce + a glob flag + +2014-09-14 Marc Finet + + * 33149: Misc/vcs_info-examples: vcs_info examples: fix typo + + * 33151: Completion/Unix/Command/_git: completion git: support + aliases when \n exist + + * 33147: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: detect revert or cherry-pick with multiple commits + + * 33148: Functions/VCS_Info/VCS_INFO_quilt: vcs_info quilt: + refactor standalone detection + + * 33145: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: fix applied-string name + + * 33150: Completion/Unix/Command/_git: completion git: fix + send-email --confirm values + +2014-09-12 Barton E. Schaefer + + * 33143: Src/init.c: POSIX_ARGZERO more closely matches bash et al. + +2014-09-12 Peter Stephenson + + * users/19075: Doc/Zsh/mod_parameter.yo, + Src/Modules/parameter.c: $functypestack gives "function", + "source" or "eval" for parallel element of $funcstack. + +2014-09-09 Peter Stephenson + + * Eric Cook: 33132: Completion/Unix/Type/_net_interfaces: use ip + on Linux to get interface names. + +2014-09-08 Peter Stephenson + + * users/19059 based on users/19058 (Paulo César Pereira de + Andrade): Src/pattern.c, Test/D02glob.ztst: remove inefficiency + with multiple "*"s in pattern matching and add test. + +2014-09-07 Barton E. Schaefer + + * 33122: Src/Modules/pcre.c, Test/V07pcre.ztst: typo from 32891 + caused incorrect matches for pcre_match -n + +2014-09-06 Barton E. Schaefer + + * 33118: Src/subst.c: record original param unset state when + ${name:#word} et al. need to treat empty the same as unset, to + avoid incorrect NO_UNSET error + + * 33116: Src/hist.c: followup to 32580 to prevent double-locking + with shared or incremental history + + * unposted: Doc/Zsh/expn.yo: clarify ${(~j.|.)array} example + +2014-08-21 Mikael Magnusson + + * 33061: Completion/Zsh/Command/_setopt, + Completion/Zsh/Command/_unsetopt: More useful setopt / unsetopt + completion. + +2014-09-04 Peter Stephenson + + * 33110: Doc/Zsh/expn.yo: document use of $IFS[1] for variable + padding. + +2014-09-04 Peter Stephenson + + * Alexandre Rames: 33108: Completion/Unix/Command/_stgit: + --patch completion. + + * 33091: Doc/Zsh/builtins.yo: improve documentation for ttyctl. + +2014-09-03 Barton E. Schaefer + + * 33100: Src/exec.c: check $fd more rigorously in "exec {fd}<&-" + + * 33088: Completion/Base/Widget/_complete_debug: indentation in $PS4 + +2014-09-01 Peter Stephenson + + * Mark Oteiza: 33081: Completion/Unix/Type/_mime_types: suppress + error message if unnecessary file not found. + +2014-08-31 Barton E. Schaefer + + * unposted: Test/A05execution.ztst: further tweaking of the + descriptor leak regression test that sometimes hangs + + * 33077: Src/exec.c: SHTTY = -1 when closing it in closem() + +2014-08-30 Barton E. Schaefer + + * 33070: Doc/Zsh/prompt.yo, Src/prompt.c: add %(e..) based on %e + + * 33069: Completion/Base/Completer/_expand_alias: remove internal + quoting before looking up aliases when expanding aliases in an + unquoted word + +2014-08-29 Peter Stephenson + + * 33057: Doc/Zsh/prompt.yo, Src/prompt.c: %e in prompts shows + evaluation / execution depth. + +2014-08-28 Peter Stephenson + + * 33062: Etc/zsh-development-guide: update note on use of + .distfiles based on 33047. + + * unposted: Config/version.mk: update to 5.0.6-dev-0 for new + commits post release. + + * unposted: Config/version.mk: 5.0.6. + +2014-08-24 Peter Stephenson + + * unposted: Config/version.mk: 5.0.5-dev-3. + +2014-08-24 Barton E. Schaefer + + * unposted (see 33050): Completion/Unix/Command/_git: un-transpose + help text for git merge -{-no,}-verify + +2014-08-23 Peter Stephenson + + * 33047: .distfiles, Completion/.distfiles, + Completion/AIX/.distfiles, Completion/AIX/Command/.distfiles, + Completion/AIX/Type/.distfiles, Completion/BSD/.distfiles, + Completion/BSD/Command/.distfiles, Completion/Base/.distfiles, + Completion/Base/Completer/.distfiles, + Completion/Base/Core/.distfiles, + Completion/Base/Utility/.distfiles, + Completion/Base/Widget/.distfiles, + Completion/Cygwin/Command/.distfiles, + Completion/Darwin/Command/.distfiles, + Completion/Darwin/Type/.distfiles, Completion/Debian/.distfiles, + Completion/Debian/Command/.distfiles, + Completion/Debian/Type/.distfiles, + Completion/Linux/Command/.distfiles, + Completion/Linux/Type/.distfiles, + Completion/Mandriva/.distfiles, + Completion/Mandriva/Command/.distfiles, + Completion/Redhat/.distfiles, + Completion/Redhat/Command/.distfiles, + Completion/Solaris/Command/.distfiles, + Completion/Solaris/Type/.distfiles, Completion/Unix/.distfiles, + Completion/Unix/Command/.distfiles, + Completion/Unix/Type/.distfiles, Completion/X/.distfiles, + Completion/X/Command/.distfiles, Completion/X/Type/.distfiles, + Completion/X/Utility/.distfiles, Completion/Zsh/.distfiles, + Completion/Zsh/Command/.distfiles, + Completion/Zsh/Context/.distfiles, + Completion/Zsh/Function/.distfiles, + Completion/Zsh/Type/.distfiles, + Completion/openSUSE/Command/.distfiles, Config/.distfiles, + Doc/.distfiles,Doc/Zsh/.distfiles, Doc/help/.distfiles, + Etc/.distfiles, Functions/.distfiles, + Functions/Calendar/.distfiles, Functions/Chpwd/.distfiles, + Functions/Compctl/.distfiles, Functions/Example/.distfiles, + Functions/Exceptions/.distfiles, Functions/MIME/.distfiles, + Functions/Misc/.distfiles, Functions/Newuser/.distfiles, + Functions/Prompts/.distfiles, Functions/TCP/.distfiles, + Functions/VCS_Info/.distfiles, + Functions/VCS_Info/Backends/.distfiles, + Functions/Zftp/.distfiles, Functions/Zle/.distfiles, + Misc/.distfiles, Scripts/.distfiles, Src/.distfiles, + Src/Builtins/.distfiles, Src/Modules/.distfiles, + Src/Zle/.distfiles, StartupFiles/.distfiles, Test/.distfiles, + Util/.distfiles, Util/mkdisttree.sh: Files controlled by git + are part of the source distribution unless explicitly included + in DISTFILES_NOT. The .distfiles file is still needed for + the directory to be processed. + + * unposted: Etc/.gitignore: ignore generated FAQ*.html files. + +2014-08-23 Barton E. Schaefer + + * 33046: Completion/Unix/Command/.distfiles, + Completion/Unix/Command/_chsh, Completion/Unix/Type/_users: new + completion for "chsh" + +2014-08-22 Barton E. Schaefer + + * 33042: NEWS, Src/jobs.c: $? and $pipestatus report 128+signal + number for stopped jobs as well as terminated jobs + +2014-08-21 Mikael Magnusson + + * 33038: Src/glob.c: Fix {a..b} expansion hanging when either + endpoint is a literal NUL character + +2014-08-20 Barton E. Schaefer + + * Lokesh Mandvekar: 33032: Completion/Linux/Command/_docker, + Completion/Linux/Command/.distfiles: new completion for docker + +2014-08-15 Barton E. Schaefer + + * unposted (see 33006): Test/A05execution.ztst: timeout the final + "read" in hung shell regression + + * 33012: Src/utils.c: add an error return value (-1) to xsymlinks() + to differentiate when xbuf is set to the empty string; silences + bogus warning about failed expansion + +2014-08-14 Oliver Kiddle + + * 32998: Completion/Unix/Command/_dsh, Completion/Unix/Command/_nm, + Completion/Unix/Command/_mosh, Completion/Unix/Command/_rsync, + Completion/Unix/Command/_wget: completion function updates + + * 32997: Completion/Base/Utility/_sequence, Doc/Zsh/compsys.yo, + Completion/Unix/Command/_mount, Completion/Unix/Command/_nmap, + Completion/Unix/Command/_pgrep, Completion/Unix/Command/_zip: + add completion utility function for lists + +2014-08-14 Peter Stephenson + + * 33002: Doc/Zsh/tcpsys.yo, Functions/TCP/tcp_expect: add option + -P to tcp_expect for tagging matches with a string rather than + a parameter index. + +2014-08-13 Oliver Kiddle + + * 32925: Completion/Zsh/Command/_kill: complete process groups, + partly as a way to suppress insertion of ambiguous PID prefix + + * 32893: Completion/Unix/Type/_pids: move use of _call_program + inside the _tags loop to allow processes to be separated + +2014-08-12 Peter Stephenson + + * Config/version.mk: update to 5.0.5-dev-2. + +2014-08-12 Mikael Magnusson + + * 32985: NEWS: Add NEWS entry for array zipping operators. + +2014-08-12 Peter Stephenson + + * Axel Beckert: 32975, 32984: Doc/Zsh/Makefile.in: texi2html.conf + location was inconsistent when building out of tree. + +2014-08-10 Peter Stephenson + + * unposted: Completion/Base/Completer/.distfiles, + Completion/Linux/Command/.distfiles, + Completion/Unix/Command/.distfiles, Config/version.mk, + Etc/.distfiles, Etc/FAQ.yo, Functions/Zle/.distfiles, NEWS, + README: updates for 5.0.5-dev-1 and 5.0.6 release. + +2014-08-10 Axel Beckert + + * unposted: Doc/Zsh/expn.yo: Fix typo. + +2014-08-08 Barton E. Schaefer + + * unposted: NEWS, Doc/Zsh/prompt.yo: mention 32971 in NEWS, + clarify RPROMPT behavior in docs. + +2014-08-07 Barton E. Schaefer + + * 32971 (plus doc tweak): Doc/Zsh/prompt.yo, Src/prompt.c: + negative argument with %(l..) conditional and with %<< or %>> + truncation calculates space available before right margin + (positive argument still counts space used since left margin). + +2014-08-06 Peter Stephenson + + * unposted, see 32968: Completion/openSUSE/Command/.distfiles + Completion/openSUSE/Command/_SuSEconfig -> + Completion/openSUSE/Command/_SUSEconfig: rename file. + +2014-08-04 Barton E. Schaefer + + * Miles Ohlrich: 32958: Src/Zle/compctl.c: bitwise logic fix + +2014-08-04 Peter Stephenson + + * 32954: Doc/Zsh/expn.yo: missed this. + + * 32954 (plus new test): Src/cond.c, Test/D02glob.ztst: + (#q) on patterns with [[ ... = ... ] and [[ ... != ... ]] + shouldn't force a glob, it should simply be ignored. + + * unposted: Src/subst.c: remove unused variables. + +2014-08-04 Mikael Magnusson + + * 32949 (wip 32928, 32937): Doc/Zsh/expn.yo, Src/subst.c, + Test/D04parameter.ztst: Add :^ and :^^ for zipping arrays. + +2014-08-03 Peter Stephenson + + * 32944: Doc/Zsh/builtins.yo: read -qs is handled properly. + + * users/19006: Doc/Zsh/expn.yo: document position of + RC_EXPAND_PARAM handling during parameter substitution. + +2014-08-01 Peter Stephenson + + * 32932: Src/glob.c, Src/utils.c: add hmkarray() and + use to fix leak. + +2014-07-31 Barton E. Schaefer + + * 32931: Src/glob.c: with NO_NOMATCH, using a subscript glob + qualifier on a not-matching pattern should still return the + original pattern + +2014-07-30 Peter Stephenson + + * unposted: Src/Builtins/sched.c, Src/Modules/datetime.c, + Src/Modules/stat.c: missed updates to ztrftime(). + + * 32919: Doc/Zsh/tcpsys.yo Functions/TCP/tcp_output: %P + at start of prompt in TCP function system causes standard + %-style substitution. + + * 32918: Doc/Zsh/prompt.yo, Src/builtin.c,Src/prompt.c, + Src/utils.c, Src/watch.c: add ability to display times with + fractions of a second in prompts. + +2014-07-28 Barton E. Schaefer + + * 32593: Completion/Unix/Command/_qemu: update --vga option + +2014-07-26 Axel Beckert + + * Omari Norman: 32817: Add completion for moosic. + + * Sebastian Ramacher: 32816: Add completion for bpython and + variants. + + * 32911: Expand bpython completion to bpython2 and bpython3. + +2014-07-26 Barton E. Schaefer + + * 32910: Src/mkmakemod.sh: quiet update of timestamp files + +2014-07-24 Barton E. Schaefer + + * 32853: configure.ac, Src/mem.c, Src/zsh_system.h: redefine + the VARARR() macro to use heap rather than stack allocation; + enable old behavior via "configure --with-stack-allocation" + + * unposted (see 32892): Src/builtins.c: 'fc -I' is an error + + * 32903: Src/Modules/parameter.c: new empty (unset) elements in + the special parameter hash tables are special themselves, so that + adding elements via assignment syntax handles them correctly. + +2014-07-24 Peter Stephenson + + * unposted: Functions/Zle/replace-argument, Doc/Zsh/contrib.yo: + allow negative numeric prefix to count backwards from last + argument. + +2014-07-23 Peter Stephenson + + * Jai Keerthan: users/18981: Completion/Unix/Command/_tmux: + improved function completion. + +2014-07-23 Barton E. Schaefer + + * 32898 (credit Jun T.): Doc/Zsh/mod_pcre.yo: fix bug in 32891. + +2014-07-23 Ansgar Burchardt + + * 32895: Completion/Unix/Command/_nm: Match more shared library + names. + +2014-07-20 Barton E. Schaefer + + * unposted: Doc/Zsh/builtins.yo: force retention of whitespace + in "fc" item prototype + + * 32891: Doc/Zsh/mod_pcre.yo Src/Modules/pcre.c: the CASE_MATCH + option should apply to =~ when using pcre; fix pcre_match bug + with handling of empty string argument. + +2014-07-17 Barton E. Schaefer + + * 32882 (cf. Augie Fackler 32879): Src/hist.c: restore correct + reload of backslash-continuation lines from history, broken by + workers/30443 just before the zsh 5.0.0 release; fix bad history + write of events ending with an even number of backslashes. + +2014-07-17 Oliver Kiddle + + * 32849: Completion/Linux/Command/_ss: new completion function + + * 32848: Completion/Unix/Command/_perl, + Completion/Unix/Command/_python, Completion/Unix/Command/_ruby: + fix words array before using _normal for script arguments + +2014-07-17 Peter Stephenson + + * 32866 (plus extra undo fix in read-from-minibuffer): + Doc/Zsh/contrib.yo, Functions/Zle/read-from-minibuffer, + Functions/Zle/replace-argument: new replace-argument function; + fixes in read-from-minibuffer not to pass through numeric + argument to recursive edit and to hide minibuffer edit from + undo history. + +2014-07-15 Peter Stephenson + + * Koen Wilde: 32863: Completion/Unix/Command/_mpc: mpc "insert" + command. + +2014-07-08 Peter Stephenson + + * Dominic Hopf: 32837: Config/defs.mk.in: improve handling of + installation location for help directories. + + * 32832: Doc/Zsh/grammar.yo Doc/Zsh/params.yo: attempt to + improve documentation for how assignment works. + +2014-07-03 Axel Beckert + + * Felipe Sateler: 32819: Completion/Debian/Command/_axi-cache: + Update for axi-cache completion. + + * Vincent Lefevre: 32818: Completion/Unix/Command/_gzip: + --rsyncable option is missing + + * Daniel Bolton: 32815: Completion/Debian/Command/_aptitude: + missing resolver options + + * Sebastian Ramacher: 32814: Completion/Debian/Command/_dpkg: + Add --add-architecture, --remove-architecture, and + --print-foreign-architectures options. + +2014-07-03 Mikael Magnusson + + * 32821: Completion/Unix/Command/_gcc: Update _gcc as of GCC + 4.8.3 for generic options and x86. + +2014-07-03 Peter Stephenson + + * Jun T: 32833: Completion/Unix/Command/_python, + Completion/Unix/Command/_ruby: complete file arguments as for + perl. + +2014-06-30 Peter Stephenson + + * Jun T: 32823: Completion/Unix/Command/_perl: complete file + instead of script after -e. + +2014-06-26 Peter Stephenson + + * Jun T: 32812: Doc/zsh.yo, Doc/ztexi.yo: put table of contents + at front of manual. + +2014-06-26 Peter Stephenson + + * 32799: Doc/Zsh/builtins.yo, Src/Builtins/rlimits.c: resource + NTHR is not properly handled on netBSD. + +2014-06-24 Peter Stephenson + + * 32789: Src/lex.c Src/mem.c Src/zsh_system.h configure.ac: + --enable-zsh-valgrind allows valgrind to analyse heap + allocations. + +2014-06-16 Peter Stephenson + + * Jun T: 32781: Doc/Zsh/options.yo: source builtin and path + search doc. + +2014-06-14 Jun T + + * 32779: Doc/Zsh/options.yo: fix a typo in options.yo + +2014-06-13 Peter Stephenson + + * 32768, with further modifications: Doc/Zsh/options.yo, + Src/exec.c, Src/options.c, Src/zsh.h, Test/E01options.ztst, + Test/ztst.zsh: LOCAL_LOOPS option to restrict effect of + continue and break in function scope. + + * 32666: Doc/Zsh/compat.yo: shell emulation based on executable + name incompletely documented. + +2014-06-11 Barton E. Schaefer + + * Jun T: 32767: Src/glob.c: another spot to tweak bracechardots() + +2014-06-10 Barton E. Schaefer + + * 32766: Src/glob.c: bracechardots() agrees with xpandbraces() + about what constitutes a {C1..C2} pattern, thus preventing crash + + * Jun T: 32765: Src/glob.c: fix build when not MULTIBYTE_SUPPORT + +2014-06-09 Peter Stephenson + + * Jun T: 32755: Doc/Zsh/grammar.yo: move line that was in the + wrong place. + +2014-06-07 Barton E. Schaefer + + * Nikolas Garofil: 32737: Src/utils.c: properly ifdef declarations + + * Nikolas Garofil: 32736 (tweak per 32741): Src/zsh_system.h: + memmove() should return its dest argument + + * Nikolas Garofil: 32735: Src/signals.c: define ret before use + + * Nikolas Garofil: 32734: Src/mem.c: remove unused pointers + + * Nikolas Garofil: 32733: Src/prototypes.h: use size_t in bcopy() + + * Nikolas Garofil: 32732 (tweak per 32739): Src/compat.c: fix + const declaration inconsistency + +2014-06-06 Peter Stephenson + + * Jun T: 32719: Doc/Zsh/contrib.yo: minor issues. + + * Jun T: 32715: Doc/Zsh/calsys.yo, Doc/Zsh/grammar.yo, + Doc/Zsh/zle.yo: formatting fixes. + + * 32682 with tweaks: Doc/Zsh/options.yo, Src/hist.c, + Src/options.c, Src/zsh.h: INC_APPEND_HISTORY_TIME is new + behaviour, with INC_APPEND_HISTORY reverting to its previous + behaviour. + + * Andrew Magee: 32698: Completion/Unix/Command/_hg: show + committable files. + +2014-06-05 Barton E. Schaefer + + * 32723: Src/glob.c: add braces around some if/else branches + + * 32716 (via Jun T. 31714): Src/utils.c: properly test iconv + return values for error conditions + +2014-06-04 Barton E. Schaefer + + * 32711: Test/A07control.ztst: run "continue" test in a new + shell, lest it inadvertently continue the loop that reads the + test chunks from this file + + * Daniel Shahaf: 32708: Doc/Zsh/expn.yo, Src/glob.c, + Test/D02glob.ztst: glob qualifier (Y) implies (oN), plus + incidental patch to avoid adding a meaningless bitvalue to + sort-order flags + +2014-06-03 Barton E. Schaefer + + * Daniel Shahaf: 32694: Completion/Zsh/Type/_globquals, + Doc/Zsh/expn.yo, Src/glob.c, Test/D02glob.ztst: the number + of matches to find is the suffix argument of (Y) qualifier + +2014-06-03 Peter Stephenson + + * Jun T: 32681: Doc/Zsh/zle.yo: formatting issue. + +2014-06-03 Peter Stephenson + + * unposted: Src/cond.c: restore cond_match() in case used in + modules. + +2014-06-02 Barton E. Schaefer + + * 32656 (via Jun T. via waltarix on github): when __APPLE__ is + defined at compile, normalize Unicode filenames in zreaddir() + +2014-06-02 Peter Stephenson + + * Daniel Shahaf: users/18870: Src/glob.c, Test/D02glob.ztst: + glob scanner needed some coaxing with counting matches with (Y) + glob qualifier. + +2014-06-02 Daniel Shahaf + + * 32662: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: Fix stagedstr for empty repos + +2014-06-01 Barton E. Schaefer + + * 32653: Completion/Unix/Command/_php: complete files with the + ".phar" extension as well as ".php", and respect the suffixes + zstyle to change this + + * 32634 (plus doc): Doc/Zsh/options.yo, Doc/Zsh/params.yo, + Src/init.c, Src/options.c, Src/params.c, Src/zsh.h: add the + POSIX_ARGZERO option to allow toggling between the original + value of $0 and the value set by FUNCTION_ARGZERO + + * Daniel Shahaf: users/18857: Doc/Zsh/expn.yo, Src/glob.c, + Test/D02glob.ztst: add (Y) glob qualifier + +2014-06-01 Peter Stephenson + + * 32640: Doc/Zsh/cond.yo, Doc/Zsh/expn.yo, NEWS, Src/cond.c, + Src/glob.c, Test/D02glob.ztst: (#q) with EXTENDED_GLOB forces + globbing in [[ ... ]]. + +2014-05-29 Peter Stephenson + + * 32624: Src/builtin.c, Src/jobs.c: use correct scaling factor + (clock ticks) for times. + + * Keerthan Jai: users/18860: Completion/Unix/Command/_man: man + -M overrides manpath. + + * unposted: Src/params.c: use DIGBUFSIZE for pipestatus numeric + buffer. + +2014-05-29 Daniel Shahaf + + * 32619: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn: + vcs_info svn: Use the revision of cwd + + * 32621: Functions/VCS_Info/Backends/VCS_INFO_get_data_svn: + vcs_info svn: 'Fix set-branch-format' when in subdirs + + * 32620: Doc/Zsh/contrib.yo: Typo fix after commit eb4c70d + +2014-05-18 Peter Stephenson + + * Jun T: 32616: Src/Builtins/rlimits.c: unnecessary printf + argument in limits on some systems. + +2014-05-16 Peter Stephenson + + * Roman Neuhauser: users/18827 (plus tweaks to original + comments): Doc/Zsh/contrib.yo: more efficient way of extracting + hg bookmarks. + +2014-05-13 Barton E. Schaefer + + * 32609: Src/parse.c, Test/CO2cond.ztst: [[ $var ]] behaves as + [[ -n $var ]] for bash/ksh compatibility; restore ksh [ -t ] + compatibility when POSIX_BUILTINS is not set; allow operators + defined by modules to be called with no arguments, although + this affects only runtime interpretation, not parsing. + +2014-05-09 Peter Stephenson + + * Eric Cook: 32602: Doc/Zsh/grammar.yo: status of try + always + block is from the former, not the latter. + +2014-05-08 Peter Stephenson + + * m0viefreak: 32600: Src/Zle/computil.c: fix problem with + _arguments thinking -- is a single letter option called '-', + which it isn't. + +2014-05-06 Daniel Shahaf + + * 32597: Functions/VCS_Info/Backends/VCS_INFO_get_data_git: + vcs_info git: Describe detached heads symbolically. + +2014-04-29 Peter Stephenson + + * Tomoki Sekiyama: 32592: add CORRECT_IGNORE_FILE variable. + +2014-04-23 Peter Stephenson + + * Sebastien Alaiwan: 32562: Completion/Unix/Command/_bzr: + updates for bzr completion. + + * Jasper Lievisse Adriaanse: 32558: configure.ac: + _XOPEN_SOURCE_EXTENDED now works OK on OpenBSD. + +2014-04-25 Barton E. Schaefer + + * 32580: Src/hist.c: avoid indefinite wait in lockhistfile() by + checking for lock file time stamp far in the future relative to + the local clock. Change behavior of HIST_FCNTL_LOCK to use only + fcntl() locking, rather than applying both kinds of lock. + +2014-04-20 Barton E. Schaefer + + * 32569: Src/loop.c: lastval ($?) should not be reset between + word list substitution and loop body execution in for/select. + + * 32568: Src/exec.c, Src/loop.c: consistency in handling of errflag + condition during substitutions in for/select word lists, function + definition name position, and anonymous function argument lists. + +2014-04-17 Barton E. Schaefer + + * Andrew Waldron: 32552 (updated by 32560): Src/exec.c, + Src/parse.c, Src/subst.c, Test/C04funcdef.ztst: fix segfault + when using process substitution in anonymous function argument + list; disallow process substitution in function name position. + +2014-04-15 Barton E. Schaefer + + * Jun T: 32546: Completion/Unix/Type/_path_files: better handling + of ignored files when using -W to specify prefixes. + +2014-04-13 Barton E. Schaefer + + * 32540: Src/Zle/zle_tricky.c, Src/Zle/zle_utils.c: following + successful history expansion, discard saved line position data + rather than restoring from it (updates 32531). + +2014-04-07 Peter Stephenson + + * 32527: Doc/Zsh/contrib.yo, Functions/Misc/zcalc, + Functions/Zle/zcalc-auto-insert: zcalc-auto-insert widget + for key binding in zcalc. + +2014-04-06 Barton E. Schaefer + + * unposted: Doc/Zsh/options.yo: fix typo in option cross-reference + + * 32531: Src/Zle/zle_refresh.c, Src/Zle/zle_tricky.c, Src/hist.c: + fix memory leaks detected by valgrind, two in ZLE region highlight + and one in :A history modifier. + +2014-04-06 Peter Stephenson + + * Sebastian Ramacher: 32533: Completion/Debian/Command/_apt: add + completion for "apt-mark". + + * Alessandro Ghedini: 32532: Completion/Debian/Command/_apt: + support 'apt' command. + + * 32530: llua: Completion/Unix/Command/_zfs: repeatable -o + argument. + + * 32521: Doc/Zsh/params.yo: document that LOGNAME comes + from getlogin(). + +2014-04-05 Daniel Shahaf + + * 32528: Completion/Zsh/Command/_zstyle, Doc/Zsh/contrib.yo, + Functions/VCS_Info/Backends/VCS_INFO_get_data_git, + Misc/vcs_info-examples: vcs_info: Add check-for-staged-changes + + * 32528: Doc/Zsh/contrib.yo: vcs_info: Document 'post-backend' + hook and bzr 'check-for-changes' support. + +2014-03-28 Peter Stephenson + + * Danek Duvall: 32505: Completion/Unix/Command/_pgrep: improved + Solaris compatibility for pgrep completion. + +2014-03-23 Barton E. Schaefer + + * m0viefreak: users/18660: Src/Zle/compresult.c, + Src/Zle/zle_misc.c, Src/Zle/zle_refresh.c: fix auto-removable + suffix highlighting + + * m0viefreak: users/18657: Completion/Unix/Command/_git: fix + compadd for auto-removable suffix in _git_stash + + * m0viefreak: users/18655: Completion/Unix/Command/_git: fix + compadd for auto-removable suffix in _git_commit_ranges + +2014-03-21 Peter Stephenson + + * Takeshi Banse: 32502: Completion/Unix/Command/_git: fix typo + in argument list. + +2014-03-20 Peter Stephenson + + * users/18644: Doc/Zsh/zle.yo: bindkey -s doc should refer to + documentation for argument interpretation. + + * Completion/Unix/Command/_perforce: finally, after more than + ten years, complete depots after // in file paths as it always + should have done. + +2014-03-18 Barton E. Schaefer + + * 32500: Src/pattern.c: handle interrupts during pattern matching + + * Jun T: 32497: Test/X02zlevi.ztst, Test/comptest: avoid using + comptesteval in the middle of a series of tests; the change in + control required for sourcing the command file can confuse the + simulated interactive input + +2014-03-17 Peter Stephenson + + * Jun T: 32494: Doc/zman.yo: Yodl hack to fix indentation + in nroff -man output. + + * Jun T: 32493: Doc/Zsh/contrib.yo, Doc/Zsh/mod_pcre.yo, + Doc/Zsh/mod_regex.yo, Doc/Zsh/mod_sched.yo: some formatting + fixes. + +2014-03-16 Peter Stephenson + + * Mariusz Fik: 32847: Completion/openSUSE/Command/_zypper: new + options. + +2014-03-14 Peter Stephenson + + * unposted: Doc/Zsh/options.yo: document effect of 32479. + + * Jun T: 32482: Doc/zman.yo: fix character translation table + usage with some versions of Yodl. + +2014-03-14 Peter Stephenson + + * 32479: Src/builtin.c, Src/signals.c: with POSIXTRAPS + never propagate an implicit return from within a trap. + +2014-03-13 Peter Stephenson + + * Kosuke Asami: 32473: Completion/Unix/Command/_pgrep: tidy up + + * Kosuke Asami: 32471: Completion/Unix/Command/_pgrep: handle + BSD process options. + + * Kosuke Asami: 32472: Completion/Unix/Command/_pgrep: new options. + +2014-03-13 Peter Stephenson + + * Jun T: 32480: Src/Zle/zle_vi.c: fix crash in vi mode when too + few previous changes. + +2014-03-09 Barton E. Schaefer + + * 32468: Src/Modules/zutil.c: save/restore match/mbegin/mend + when doing pattern lookups against zstyle contexts + +2014-03-03 Barton E. Schaefer + + * users/18550: Doc/Zsh/compsys.yo: matcher-list clarifications + +2014-03-03 Simon Ruderich + + * 32289: Doc: Add zsh version to footer in HTML documentation. + +2014-03-03 Oliver Kiddle + + * 32441: Completion/Base/Completer/_extensions, Doc/Zsh/compsys.yo: + add completer for file extensions + + * 32450: Src/Zle/zle_hist.c: make get-line set the history + number that was saved with the line + + * 32448: Src/Zle/zle_params.c: fix seg fault after recursive-edit + + * 32439 (with Yuri D'Elia): Completion/Base/Core/_main_complete: + add new show-ambiguity style + + * 32436: Src/Zle/complist.c: allow = to be used in ZLS_COLORS + patterns if it is quoted or inside parentheses + +2014-03-01 Peter Stephenson + + * 32453: Functions/Misc/zcalc: fix default base handling. + + * Manuel Presnitz: 32412 modified c.f. 32415: + Completion/Zsh/Type/_globquals, Doc/Zsh/expn.yo, Src/glob.c, + Src/zsh.h: gigabyte and terabyte units for glob qualifiers. + +2014-02-28 Peter Stephenson + + * users/18531 plus doc etc.: Doc/Zsh/contrib.yo, + Functions/Zle/.distfiles, Functions/Zle/expand-absolute-path: + new expand-absolute-path ZLE widget. + +2014-02-26 Peter Stephenson + + * Jun T: 32435: Completion/Base/Core/_description, + Completion/Unix/Command/_rm: improved quoting for ignore-line + style. + +2014-02-24 Oliver Kiddle + + * unposted: Doc/Zsh/compsys.yo: fix typo + + * unposted: Completion/X/Command/_x_utils: duplicate local + statement was printing variable value + + * users/18498: Completion/Base/Completer/_expand_alias: observe + add-space style in _expand_alias so suffix can be disabled + + * users/18485: Completion/Unix/Command/_git: add .. as an + auto-removable suffix in git revision ranges + +2014-02-24 Peter Stephenson + + * Hong Xu: 32492: Completion/Unix/Command/_npm: fix outdated + completion. + + * Sebastien Alaiwan: 32462: Completion/Unix/Command/_bzr: + improve completion with directory path. + +2014-02-23 Barton E. Schaefer + + * 32427: Doc/Zsh/zle.yo, Src/Zle/zle_main.c: avoid busy loop + on closed descriptors for "zle -F" handlers. Assure that the + handlers are called on error conditions and document the extra + argument that is passed in the error case. + +2014-02-19 Peter Stephenson + + * 32414: Src/glob.c: improved error message for missing glob + qualifier delimiters. + +2014-02-18 Peter Stephenson + + * Eric Cook: 32408: Completion/Linux/Command/_btrfs: additional + completions + + * Eric Cook: 32409: Completion/Linux/Command/_btrfs: updated + completion for subcommands. + + * Eric Cook: 32411: Completion/Linux/Command/_btrfs: minor typo. + + * Eric Cook: 32410: Completion/Linux/Command/_btrfs: remove hard tabs. + + * m0viefreak: Util/helpfiles: 32402: prefer col -bx to colcrt. + + * m0viefreak: Util/helpfiles: 32405: Util/helpfiles: remove old + example now shell code is integrated in distribution. + + * m0viefreak: 32404: Util/helpfiles: use env to find perl. + + * m0viefreak: 32403: Doc/Zsh/contrib.yo: update zshcontrib + manual for helpfiles improvements. + +2014-02-18 m0viefreak + + * 32396: Completion/Unix/Command/_git: _git: fix + __git_committish_range_{first,last} and __git_is_committish_range + + * 32395: Completion/Unix/Command/_git: _git: diff: refactor and + fix wrong completions + + * 32397: Completion/Unix/Command/_git: _git: fix __git_submodules + to only use the actual name of the submodule + + * 32398: Completion/Unix/Command/_git: _git: completion updates up + to latest git v1.9.0 + +2014-02-17 Barton E. Schaefer + + * unposted (users/18468): Doc/Zsh/builtins.yo, Doc/Zsh/params.yo: + document interactions of "fc -R" etc. with "fc -l" and $HISTCMD + +2014-02-15 Barton E. Schaefer + + * 32389 (with Jun Takimoto): Test/X02zlevi.ztst, Test/comptest: + additional PTY and keybinding adjustments + + * 32388: Doc/Zsh/mod_zutil.yo, Src/Modules/zutil.c: zparseopts -K + preserves individual associative array elements + +2014-02-14 Oliver Kiddle + + * 32361: Src/Zle/zle_tricky.c: don't reset lastline before completion + +2014-02-13 Barton E. Schaefer + + * 32377: Test/comptest: change keybindings and PTY control for + vi-mode tests to make them more reliable + +2014-02-08 Barton E. Schaefer + + * 32365: Src/Zle/zle_refresh.c, Src/init.c: another stab at the + heuristic for initializing rprompt_indent + +2014-02-07 Peter Stephenson + + * Martin Vaeth: 32356: Util/helpfiles: fix a typo. + +2014-02-05 Oliver Kiddle + + * 32355: Doc/Zsh/zle.yo Test/X02zlevi.ztst Test/comptest: document + and test vi mode undo changes + + * 32342: Src/Zle/zle_main.c, Src/Zle/zle_vi.c: fix overstrike for vi + mode and use varying vi commands at line start + + * 32334 (modified so KEEPSUFFIX is unchanged for vi-cmd-mode; based on + Jun T: 32324, 32330), 32347, Jun T: 32344, 32349: Src/Zle/iwidgets.list, + Src/Zle/zle_main.c, Src/Zle/zle_utils.c, Src/Zle/zle_vi.c + add split-undo zle widget for configurable breaks in undo sequence + +2014-02-02 Barton E. Schaefer + + * unposted: Doc/Zsh/builtins.yo, Doc/Zsh/expn.yo, + Doc/Zsh/roadmap.yo: tweak index markers and related whitespace + to make appearance consistent with other pages + + * 32341: Src/init.c: guess at best ZLE_RPROMPT_INDENT based on + termcap/terminfo description + + * unposted: Src/Zle/zle_tricky.c: whitespace in comment + + * 32340: Src/init.c, Src/Zle/compctl.c: add specifics to error + messages explaining failure of "read -c" / "read -l". + + * 32338: Doc/Makefile.in: create Doc/help.txt as an empty file + when Util/helpfiles fails, so that the rest of the build does not + yeild a spurious error + + * 32337: Src/params.c: initialize several special parameters to + unset for better compatibility in emulation modes; for the same + reason, remove the readonly flag from $_ + +2014-01-31 Oliver Kiddle + + * 32314: Src/Zle/zle_main.c, Src/Zle/zle_tricky.c, + Src/Zle/zle_utils.c, Src/Zle/zle_vi.c: merge undo events + corresponding to vi change in the vi-cmd-mode widget so undo from + insert mode is useful again + +2014-01-30 Barton E. Schaefer + + * 32322: Completion/Base/Core/_main_complete: display a message + when completion is interrupted from the keyboard + +2014-01-30 Peter Stephenson + + * Jun T: 32300: Completion/Unix/Command/_od: + + Completion/Unix/Command/.distfiles: new completion. + +2014-01-29 Peter Stephenson + + * Christian Hesse: 32316: Completion/Unix/Command/_ssh: complete + new ssh key type. + +2014-01-28 Peter Stephenson + + * 32303: Src/Zle/compcore.c, Completion/Zsh/Type/_parameters, + Completion/Zsh/Context/_brace_parameter: allow completion + of modifiers for parameters in a fairly simplistic way. + +2014-01-28 Peter Stephenson + + * 32308 (slightly modified to use "a" as the vi command at start + of line): Src/Zle/zle_main.c, Src/Zle/zle_vi.c: improve + initialising of vi mode change when entering viins at start of + editing. + +2014-01-27 Barton E. Schaefer + + * users/18368: Completion/Unix/Command/_git: in __git_files, + retry ls-files if nothing matched the prefix pattern, to give + _multi_parts a shot at the whole file list. Restores partial + path completion inadvertently removed by 31159. + +2014-01-27 Peter Stephenson + + * unposted: Src/zsh.mdd: update 31983 to suppress stdout from + cmp, too. + +2014-01-23 Bart Schaefer + + * unposted: Doc/Zsh/arith.yo: use LPAR()+RPAR() instead of parens + in sqrt example + +2014-01-23 Peter Stephenson + + * 32299: Doc/Zsh/arith.yo, Functions/Misc/zcalc, Src/math.c, + Src/params.c, Src/subst.c, Test/C01arith.ztst: add + ability to use "_" at the end of a [#] arithmetic expression + to get underscores to space numeric output. + +2014-01-22 Barton E. Schaefer + + * unposted: Src/mem.c: reformulate 32285 to lift the fheap->sp + test out of the loop, improve commentary + +2014-01-19 Barton E. Schaefer + + * 32294 (plus typo fix): Src/utils.c: prevent buffer overflow when + scanning very long directory paths for symbolic links + + * users/18335: Completion/Zsh/Command/_typeset: avoid passing to + "functions" those typeset options that it does not accept + +2014-01-18 Barton E. Schaefer + + * 32285: Src/mem.c (freeheap): when the last-arena-with-free-space + pointer (fheap) points to an arena that is going to be discarded + because it has become empty, loop back through the entire linked + list of arenas to find another partly-filled arena; fixes crash + wherein pushheap followed by freeheap could orphan the whole list + of arenas in some circumstances + + * 32283: Src/Zle/complist.c: avoid using a negative number for + available vertical space when the terminal has only a small number + of lines; fixes crash in menu selection + +2014-01-17 Peter Stephenson + + * Daniel Hahler: 32271: Doc/Zsh/compsys.yo: fix matcher list + example. + +2014-01-17 Peter Stephenson + + * sergio: 32267: Completion/Linux/Command/_modutils: modinfo may + not be in user's path, so use explicit path as already done for lsmod. + +2014-01-17 Frank Terbeck + + * 32264: Functions/VCS_Info/Backends/VCS_INFO_detect_hg: vcs_info, + hg: Support detecting repos using ShareExtension + +2014-01-16 Barton E. Schaefer + + * Thomas Mitterfellner: 32265: Completion/openSUSE/Command/_zypper: + better handling of large lists of packages + +2014-01-16 Peter Stephenson + + * Holger Macht: 32257: Completion/openSUSE/Command/_zypper: + updates. + +2014-01-14 Peter Stephenson + + * 32255: Completion/Unix/Command/_python: complete for Python + with command names python2.4 ... python3.4. + +2014-01-11 Peter Stephenson + + * 32246: Doc/Zsh/builtins.yo, Src/builtin.c, Test/.distfiles, + Test/B08shift.ztst: add "shift -p" to pop arguments from the end + of arrays. + +2014-01-10 Peter Stephenson + + * Koen Wilde: 32245: Completion/Unix/Command/_mpc: complete more + arguments. + +2014-01-09 Peter Stephenson + + * users/18298 (tidied up): Doc/Zsh/expn.yo, Src/glob.c, + Test/D09brace.ztst: add {..} expansion. + +2014-01-07 Peter Stephenson + + * Mark Oteiza: 32238: suppress error output completing after ip. + +2014-01-06 Peter Stephenson + + * unposted: Config/version.mk: update to 5.0.5-dev-0 to avoid + installation clash with 5.0.5 release. + 2014-01-05 Peter Stephenson * unposted: Config/version.mk, Doc/Zsh/compsys.yo: update @@ -1265,7 +2661,7 @@ * users/17665: Doc/Zsh/options.yo, Src/math.c, Src/options.c, Src/zsh.h, Test/C01arith.ztst: add FORCE_FLOAT option. -2013-02-27 Oliver Kiddle +2013-02-27 Oliver Kiddle * 31076: Completion/Linux/Command/_yast, Completion/Unix/Type/_pids, Completion/Unix/Type/_pdf: @@ -1286,7 +2682,7 @@ * 31060: Src/builtin.c: "+" before a flag for "functions" or "autoload" should suppress display of function body. -2013-02-21 Oliver Kiddle +2013-02-21 Oliver Kiddle * 31058: Completion/Zsh/Command/_fc, Completion/Unix/Command/_cut, Completion/Unix/Command/_sed, Completion/Unix/Command/_wget, @@ -1298,7 +2694,7 @@ * 31055: Completion/compaudit: missing '$' in search of /proc file system. -2013-02-12 Oliver Kiddle +2013-02-12 Oliver Kiddle * 31041: Test/comptest, Test/X02zlevi.ztst: add support for testing line editor widgets from the test suite @@ -1306,7 +2702,7 @@ * unposted: Etc/zsh-development-guide: remove duplication in git guidelines -2013-02-09 Oliver Kiddle +2013-02-09 Oliver Kiddle * Morita Sho: 31038: Completion/Unix/Type/_terminals: add location of terminfo entries on Debian @@ -1363,7 +2759,7 @@ modifiers :wq operating on an empty string crashed the shell. The shell isn't supposed to crash. -2013-01-20 Oliver Kiddle +2013-01-20 Oliver Kiddle * 30987: Completion/X/Command/_xrandr: only call xrandr when necessary and use _call_program @@ -1421,7 +2817,7 @@ * unposted: Config/version.mk: zsh 5.0.1. -2012-12-18 Oliver Kiddle +2012-12-18 Oliver Kiddle * 30877: Etc/zsh-development-guide: document git workflow @@ -1455,7 +2851,7 @@ * users/17445: Src/math.c, Test/C01arith.ztst: fix handling of leading zeroes in floating point. -2012-11-20 Oliver Kiddle +2012-11-20 Oliver Kiddle * 30811: Completion/Linux/Command/_btrfs, Completion/Unix/Command/_mount: new completion for btrfs and @@ -1470,7 +2866,7 @@ * users/17042: Src/jobs.c: don't stomp the environment in "jobs -Z" unless we've first copied it to new memory. -2012-11-16 Oliver Kiddle +2012-11-16 Oliver Kiddle * 30802: Completion/Unix/Command/_find: add new command switches @@ -1488,7 +2884,7 @@ * 30800: Michal Halenka: Completion/Unix/Command/_arping: fix option. -2012-11-12 Oliver Kiddle +2012-11-12 Oliver Kiddle * 30795: Completion/Unix/Command/_xz, Completion/Unix/Command/_bzip2: new xz completion, new bzip2 options @@ -1496,7 +2892,7 @@ * 30794: Completion/Unix/Command/_irssi, Completion/Unix/Command/_mutt: update for new options -2012-11-11 Oliver Kiddle +2012-11-11 Oliver Kiddle * 30793: Completion/Unix/Command/_getent, Completion/Unix/Command/_iconv, Completion/Unix/Command/_ldd: @@ -1516,7 +2912,7 @@ * 30780: Doc/Zsh/builds.yo: document that set -o failures are hard but setopt failures are soft. -2012-11-07 Oliver Kiddle +2012-11-07 Oliver Kiddle * Benjamin R. Haskell: 30737: Completion/Unix/Command/_git: make custom completion functions for git aliases easier @@ -1585,7 +2981,7 @@ Test/C04funcdef.ztst: emulate command evaluations should apply sticky emulation to autoloads, too. -2012-10-07 Oliver Kiddle +2012-10-07 Oliver Kiddle * unposted: Completion/Unix/Command/_webbrowser, Completion/Unix/Type/_pspdf: add evince, zathura, dwb @@ -1639,7 +3035,7 @@ Functions/VCS_Info/Backends/VCS_INFO_detect_fossil: Fix fossil detection on unix -2012-09-28 Oliver Kiddle +2012-09-28 Oliver Kiddle * 30697: Completion/Unix/Command/_dbus: new completion definition diff -Nru zsh-5.0.5/Completion/AIX/Command/.distfiles zsh-5.0.7/Completion/AIX/Command/.distfiles --- zsh-5.0.5/Completion/AIX/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/AIX/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_floppy _lscfg _lsdev _lslv _lspv _lsvg _smit ' diff -Nru zsh-5.0.5/Completion/AIX/.distfiles zsh-5.0.7/Completion/AIX/.distfiles --- zsh-5.0.5/Completion/AIX/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/AIX/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/AIX/Type/.distfiles zsh-5.0.7/Completion/AIX/Type/.distfiles --- zsh-5.0.5/Completion/AIX/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/AIX/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_logical_volumes _object_classes _physical_volumes _volume_groups ' diff -Nru zsh-5.0.5/Completion/Base/Completer/.distfiles zsh-5.0.7/Completion/Base/Completer/.distfiles --- zsh-5.0.5/Completion/Base/Completer/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Completer/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,17 +1,2 @@ DISTFILES_SRC=' -.distfiles -_all_matches -_approximate -_complete -_correct -_expand -_expand_alias -_history -_ignored -_list -_match -_menu -_oldlist -_prefix -_user_expand ' diff -Nru zsh-5.0.5/Completion/Base/Completer/_expand_alias zsh-5.0.7/Completion/Base/Completer/_expand_alias --- zsh-5.0.5/Completion/Base/Completer/_expand_alias 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Completer/_expand_alias 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,7 @@ #compdef -K _expand_alias complete-word \C-xa local word expl tmp pre sel what -local -a tmpa +local -a tmpa suf eval "$_comp_setup" @@ -58,7 +58,8 @@ tmp="\\$tmp" fi fi - $pre _wanted aliases expl alias compadd -UQ -- ${tmp%%[[:blank:]]##} + zstyle -T ":completion:${curcontext}:" add-space || suf=( -S '' ) + $pre _wanted aliases expl alias compadd -UQ "$suf[@]" -- ${tmp%%[[:blank:]]##} elif (( $#pre )) && zstyle -t ":completion:${curcontext}:" complete; then $pre _aliases -s "$sel" -S '' else diff -Nru zsh-5.0.5/Completion/Base/Completer/_extensions zsh-5.0.7/Completion/Base/Completer/_extensions --- zsh-5.0.5/Completion/Base/Completer/_extensions 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Completer/_extensions 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,33 @@ +#autoload + +# This completer completes filename extensions when completing +# after *. or ^*. It can be used anywhere in the completer list +# but if used after _expand, patterns that already match a file +# will be expanded before it is called. + +compset -P '(#b)([~$][^/]#/|)(*/|)(\^|)\*.' || return 1 + +local -aU files +local -a expl suf mfiles + +files=( ${(e)~match[1]}${match[2]}*.* ) || return 1 +eval set -A files '${(MSI:'{1..${#${(O)files//[^.]/}[1]}}':)files%%.[^/]##}' +files=( ${files:#.<->(.*|)} ) + +if zstyle -t ":completion:${curcontext}:extensions" prefix-hidden; then + files=( ${files#.} ) +else + PREFIX=".$PREFIX" + IPREFIX="${IPREFIX%.}" +fi + +zstyle -T ":completion:${curcontext}:extensions" add-space || + suf=( -S '' ) + +_description extensions expl 'file extension' + +# for an exact match, fail so as to give _expand or _match a chance. +compadd -O mfiles "$expl[@]" -a files +[[ $#mfiles -gt 1 || ${mfiles[1]} != $PREFIX ]] && + compadd "$expl[@]" "$suf[@]" -a files && + [[ -z $compstate[exact_string] ]] diff -Nru zsh-5.0.5/Completion/Base/Core/_description zsh-5.0.7/Completion/Base/Core/_description --- zsh-5.0.5/Completion/Base/Core/_description 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Core/_description 2014-10-07 18:11:30.000000000 +0000 @@ -47,17 +47,19 @@ zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore || _comp_ignore=() - zstyle -s ":completion:${curcontext}:$1" ignore-line hidden && + if zstyle -s ":completion:${curcontext}:$1" ignore-line hidden; then + local -a qwords + qwords=( ${words//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} ) case "$hidden" in - true|yes|on|1) _comp_ignore=( "$_comp_ignore[@]" ${(q)"${words[@]}"} );; - current) _comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );; + true|yes|on|1) _comp_ignore+=( $qwords );; + current) _comp_ignore+=( $qwords[CURRENT] );; current-shown) [[ "$compstate[old_list]" = *shown* ]] && - _comp_ignore=( "$_comp_ignore[@]" "${(q)words[CURRENT]}" );; - other) _comp_ignore=( "$_comp_ignore[@]" - "${(@q)words[1,CURRENT-1]}" - "${(@q)words[CURRENT+1,-1]}" );; + _comp_ignore+=( $qwords[CURRENT] );; + other) _comp_ignore+=( $qwords[1,CURRENT-1] + $qwords[CURRENT+1,-1] );; esac + fi # Ensure the ignore option is first so we can override it # for fake-always. diff -Nru zsh-5.0.5/Completion/Base/Core/.distfiles zsh-5.0.7/Completion/Base/Core/.distfiles --- zsh-5.0.5/Completion/Base/Core/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Core/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,2 @@ DISTFILES_SRC=' -.distfiles -_all_labels _main_complete _next_label _requested _tags -_description _message _normal _setup _wanted -_dispatch ' diff -Nru zsh-5.0.5/Completion/Base/Core/_main_complete zsh-5.0.7/Completion/Base/Core/_main_complete --- zsh-5.0.5/Completion/Base/Core/_main_complete 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Core/_main_complete 2014-10-07 18:11:30.000000000 +0000 @@ -126,6 +126,11 @@ _completer_num=1 +# We assume localtraps to be in effect here ... +integer SECONDS=0 +trap 'zle -M "Killed by signal in ${funcstack[0]} after ${SECONDS}s"; + zle -R; return 130' INT QUIT + # Call the pre-functions. funcs=( "$compprefuncs[@]" ) @@ -329,6 +334,14 @@ compadd -x "$mesg" fi +if zstyle -s ":completion:${curcontext}:" show-ambiguity tmp; then + local prefix=${${compstate[unambiguous]}[1,${compstate[unambiguous_cursor]}-1]} + local toquote='[=\(\)\|~^?*[\]#<>]' + [[ $tmp = (yes|true|on) ]] && tmp=4 + [[ -n $prefix ]] && + _comp_colors+=( "=(#i)${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/${MATCH/$~toquote/\\$MATCH}|)}${prefix[-1]//(#m)$~toquote/\\$MATCH}(#b)(?|)*==$tmp" ) +fi + [[ "$_comp_force_list" = always || ( "$_comp_force_list" = ?* && nm -ge _comp_force_list ) ]] && compstate[list]="${compstate[list]//messages} force" diff -Nru zsh-5.0.5/Completion/Base/.distfiles zsh-5.0.7/Completion/Base/.distfiles --- zsh-5.0.5/Completion/Base/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/Base/Utility/_call_program zsh-5.0.7/Completion/Base/Utility/_call_program --- zsh-5.0.5/Completion/Base/Utility/_call_program 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Utility/_call_program 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,13 @@ #autoload +X -local tmp +local tmp err_fd=-1 + +if (( ${debug_fd:--1} > 2 )) +then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is log file +else exec {err_fd}>/dev/null +fi + +{ # Begin "always" block if zstyle -s ":completion:${curcontext}:${1}" command tmp; then if [[ "$tmp" = -* ]]; then @@ -10,4 +17,10 @@ fi else eval "$argv[2,-1]" -fi +fi 2>&$err_fd + +} always { + +exec {err_fd}>&- + +} diff -Nru zsh-5.0.5/Completion/Base/Utility/_describe zsh-5.0.7/Completion/Base/Utility/_describe --- zsh-5.0.5/Completion/Base/Utility/_describe 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Utility/_describe 2014-10-07 18:11:30.000000000 +0000 @@ -96,7 +96,7 @@ fi if [[ -n $_mats ]]; then - compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ + compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs -O $_mats - \ "${(@)${(@M)${(@P)_mats}##([^:\\]|\\?)##}//\\(#b)(?)/$match[1]}" else compadd "$_opts[@]" "${(@)_expl:/-J/-2V}" -D $_strs - \ diff -Nru zsh-5.0.5/Completion/Base/Utility/.distfiles zsh-5.0.7/Completion/Base/Utility/.distfiles --- zsh-5.0.5/Completion/Base/Utility/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Utility/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,25 +1,2 @@ DISTFILES_SRC=' -.distfiles -_alternative -_arg_compile -_arguments -_cache_invalid -_call_function -_comp_locale -_complete_help_generic -_call_program -_combination -_set_command -_describe -_multi_parts -_nothing -_regex_arguments -_retrieve_cache -_sep_parts -_store_cache -_sub_commands -_values -_guard -_pick_variant -_regex_words ' diff -Nru zsh-5.0.5/Completion/Base/Utility/_sequence zsh-5.0.7/Completion/Base/Utility/_sequence --- zsh-5.0.5/Completion/Base/Utility/_sequence 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Utility/_sequence 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,39 @@ +#autoload + +# a separated list where each component of the list uses the same +# function. + +# -n num : number of items in list [default is unlimited] +# -s sep : specify separator [defaults to comma] +# -d : duplicate values allowed + +local curcontext="$curcontext" nm="$compstate[nmatches]" pre nosep minus +local -a sep num pref suf end uniq dedup + +zparseopts -D -a opts s:=sep n:=num p:=pref i:=pref P:=pref I:=suf S:=suf q=suf r:=suf R:=suf C:=cont d=uniq M: J: X: x: +(( $#cont )) && curcontext="$curcontext%:*}:$cont[2]" +(( $#sep )) || sep[2]=, + +if (( $+suf[(r)-S] )); then + end="${(q)suf[suf[(i)-S]+1]}" + (( $#end )) && compset -S ${end}\* && suf=() && nosep=1 +fi + +if (( ! $#uniq )); then + (( $+pref[(r)-P] )) && pre="${(q)pref[pref[(i)-P]+1]}" + typeset -T unique="${PREFIX#$pre}" uniq $sep[2] + dedup=( ${(q)uniq[1,-2]} ) + unique="${SUFFIX}" + dedup+=( ${(q)uniq[2,-1]} ) +fi + +if (( ! $#num )) || (( num[2] > 1 )) && ! compset -P $(( num[2] - 1 )) \*$sep[2]; then + (( nosep )) || suf=( -S $sep[2] -r "$end[1]${sep[2][1]} \t\n\-" ) + compset -S ${sep[2]}\* && suf=() + compset -P \*$sep[2] && pref=() +else + pref=() +fi + +(( minus = argv[(ib:2:)-] )) +"${(@)argv[1,minus-1]}" "$opts[@]" -F dedup "$pref[@]" "$suf[@]" "${(@)argv[minus+1,-1]}" diff -Nru zsh-5.0.5/Completion/Base/Widget/_complete_debug zsh-5.0.7/Completion/Base/Widget/_complete_debug --- zsh-5.0.5/Completion/Base/Widget/_complete_debug 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Widget/_complete_debug 2014-10-07 18:11:30.000000000 +0000 @@ -12,6 +12,8 @@ exec {debug_fd}>&2 2>| $tmp fi + local -a debug_indent; debug_indent=( '%'{3..20}'(e. .)' ) + local PROMPT4 PS4="${(j::)debug_indent}+%N:%i> " setopt xtrace : $ZSH_NAME $ZSH_VERSION ${1:-_main_complete} diff -Nru zsh-5.0.5/Completion/Base/Widget/.distfiles zsh-5.0.7/Completion/Base/Widget/.distfiles --- zsh-5.0.5/Completion/Base/Widget/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Base/Widget/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,2 @@ DISTFILES_SRC=' -.distfiles -_bash_completions _correct_filename _history_complete_word -_complete_debug _correct_word _most_recent_file -_complete_help _expand_word _next_tags -_complete_tag _generic _read_comp ' diff -Nru zsh-5.0.5/Completion/BSD/Command/.distfiles zsh-5.0.7/Completion/BSD/Command/.distfiles --- zsh-5.0.5/Completion/BSD/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/BSD/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,19 +1,2 @@ DISTFILES_SRC=' -.distfiles -_bsd_pkg -_chflags -_csup -_cvsup -_fetch -_freebsd-update -_fstat -_kld -_pfctl -_portaudit -_portlint -_portmaster -_portsnap -_powerd -_procstat -_sockstat ' diff -Nru zsh-5.0.5/Completion/BSD/.distfiles zsh-5.0.7/Completion/BSD/.distfiles --- zsh-5.0.5/Completion/BSD/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/BSD/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/Cygwin/Command/.distfiles zsh-5.0.7/Completion/Cygwin/Command/.distfiles --- zsh-5.0.5/Completion/Cygwin/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Cygwin/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,2 @@ DISTFILES_SRC=' -.distfiles -_cygcheck _cygpath _cygrunsrv _cygserver -_cygstart _dumper _getclip -_mkshortcut _mkzsh _pscp _putclip -_readshortcut ' diff -Nru zsh-5.0.5/Completion/Darwin/Command/.distfiles zsh-5.0.7/Completion/Darwin/Command/.distfiles --- zsh-5.0.5/Completion/Darwin/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Darwin/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_defaults _fink _hdiutil _open _qtplay _softwareupdate ' diff -Nru zsh-5.0.5/Completion/Darwin/Command/_system_profiler zsh-5.0.7/Completion/Darwin/Command/_system_profiler --- zsh-5.0.5/Completion/Darwin/Command/_system_profiler 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Darwin/Command/_system_profiler 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,20 @@ +#compdef system_profiler + +typeset -A opt_args +local context state state_descr line +local -a _data_types + +# TODO: Should this be static? Calling `system_profiler -listDataTypes` takes +# about 0.07-0.08 secs on my machine. Does this list ever change (between +# different versions of OS X)? +_data_types=( SP{AirPort,Applications,Audio,Bluetooth,Camera,CardReader,Component,ConfigurationProfile,DeveloperTools,Diagnostics,DisabledSoftware,DiscBurning,Displays,Ethernet,Extensions,FibreChannel,FireWire,Firewall,Fonts,Frameworks,Hardware,HardwareRAID,InstallHistory,Logs,ManagedClient,Memory,Network,NetworkLocation,NetworkVolume,PCI,ParallelATA,ParallelSCSI,Power,PrefPane,Printers,PrintersSoftware,SAS,SPI,SerialATA,Software,StartupItem,Storage,SyncServices,Thunderbolt,USB,UniversalAccess,WWAN}DataType ) +# the dynamic alternative is: +#_data_types=( ${${(f)"$(_call_program path system_profiler -listDataTypes 2>/dev/null)"}[2,-1]} ) + +_arguments \ + '(- *)-usage' \ + '(- *)-listDataTypes[lists the available datatypes]' \ + '(-listDataTypes -usage)-xml[generate xml output]' \ + '(-listDataTypes -usage)-detailLevel[level of detail for the report]:detail level:(mini basic full)' \ + '(-listDataTypes -usage)-timeout+[maximum time to wait in seconds]' \ + '(-listDataTypes -usage)*:data type:'"($_data_types)" diff -Nru zsh-5.0.5/Completion/Darwin/Type/.distfiles zsh-5.0.7/Completion/Darwin/Type/.distfiles --- zsh-5.0.5/Completion/Darwin/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Darwin/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_mac_applications _mac_files_for_application _retrieve_mac_apps ' diff -Nru zsh-5.0.5/Completion/Debian/Command/_apt zsh-5.0.7/Completion/Debian/Command/_apt --- zsh-5.0.5/Completion/Debian/Command/_apt 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Command/_apt 2014-10-07 18:11:30.000000000 +0000 @@ -1,11 +1,13 @@ -#compdef apt-get apt-cache apt-cdrom apt-config +#compdef apt apt-get apt-cache apt-cdrom apt-config apt-mark _apt () { case "$service" in + apt) _apt-cmd "$@";; apt-get) _apt-get "$@";; apt-cache) _apt-cache "$@";; apt-cdrom) _apt-cdrom "$@";; apt-config) _apt-config "$@";; + apt-mark) _apt-mark "$@";; *) _message "unknown command $service";; esac } @@ -389,6 +391,38 @@ return 0 } +_apt-cmd () { + _apt_arguments _apt-cmd_sm \ + -h,--help:bool \ + -v,--version:bool \ + -c,--config-file:configfile \ + -o,--option:arbitem \ + -t,--target-release:release \ + -- \ + /$'list\0'/ \| \ + /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \ + /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \ + /$'update\0'/ \| \ + \( \ + /$'install\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \ + /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \) \| \ + /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'upgrade\0'/ \| \ + /$'full-upgrade\0'/ \| \ + /$'edit-sources\0'/ \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" list search show update install remove upgrade full-upgrade edit-sources' + + _apt-cmd () { + local expl_action expl_packages + _description actions expl_action 'action' + _description packages expl_packages 'package' + + _apt-cmd_sm + } + + _apt-cmd "$@" +} + _apt-get () { _apt_arguments _apt-get_sm \ -h,--help:bool \ @@ -586,4 +620,34 @@ /var/lib/dpkg/available -nt "$1" ]] } +_apt-mark () { + _apt_arguments _apt-mark_sm \ + -h,--help:bool \ + -v,--version:bool \ + -f,--file:configfile \ + -c,--config-file:configfile \ + -o,--option:arbitem \ + -qq:bool \ + -s:bool \ + -- \ + /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" auto manual hold unhold showauto showmanual showhold' + + _apt-mark () { + local expl_action expl_packages + _description actions expl_action 'action' + _description packages expl_packages 'package' + + _apt-mark_sm + } + + _apt-mark "$@" +} + _apt "$@" diff -Nru zsh-5.0.5/Completion/Debian/Command/_aptitude zsh-5.0.7/Completion/Debian/Command/_aptitude --- zsh-5.0.5/Completion/Debian/Command/_aptitude 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Command/_aptitude 2014-10-07 18:11:30.000000000 +0000 @@ -70,6 +70,8 @@ '--schedule-only[schedule operations to be performed in the future]' \ '--purge-unused[purge unused packages instead of removing]' \ '--visual-preview[start up the visual interface and display its preview screen]' \ + '--full-resolver[attempts to resolve conflicts with a higher risk of breakage]' \ + '--safe-resolver[attempts to resolve conflicts with a lower risk of breakage]' \ '-S[load the extended state information from non-standard state file]:state file:_files' \ '-u[begin updating the package lists as soon as the program starts]' \ '-i[displays a download preview when the program starts]' \ diff -Nru zsh-5.0.5/Completion/Debian/Command/_axi-cache zsh-5.0.7/Completion/Debian/Command/_axi-cache --- zsh-5.0.5/Completion/Debian/Command/_axi-cache 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Command/_axi-cache 2014-10-07 18:11:30.000000000 +0000 @@ -11,10 +11,11 @@ if (( CURRENT == 2 )); then _wanted tag expl 'axi-cache commands' \ - compadd help search more last show again + compadd help search more last show again info \ + rdetails depends madison policy showpkg showsrc else case "$words[2]" in - (search|show|again) + (search|show|again|rdetails|depends|madison|policy|showpkg|showsrc) _wanted tag expl 'terms/query' \ compadd -- $($service $words[2] --tabcomplete=plain -- $words[CURRENT]) ;; @@ -22,6 +23,9 @@ _wanted tag expl 'count' \ compadd -- 1 2 3 4 5 6 7 8 9 0 ;; + (help|info) + # no args + ;; (*) _files ;; diff -Nru zsh-5.0.5/Completion/Debian/Command/.distfiles zsh-5.0.7/Completion/Debian/Command/.distfiles --- zsh-5.0.5/Completion/Debian/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,52 +1,2 @@ DISTFILES_SRC=' -.distfiles -_a2utils -_apt -_apt-file -_aptitude -_apt-move -_apt-show-versions -_auto-apt -_axi-cache -_bts -_bug -_cdbs-edit-patch -_dak -_dchroot -_dchroot-dsa -_dcut -_debchange -_debdiff -_debfoster -_debsign -_dlocate -_dpatch-edit-patch -_dpkg -_dpkg-buildpackage -_dpkg-cross -_dpkg-repack -_dpkg_source -_dput -_dupload -_git-buildpackage -_invoke-rc.d -_lighttpd -_lintian -_madison -_make-kpkg -_members -_mergechanges -_module-assistant -_pbuilder -_piuparts -_reprepro -_schroot -_svn-buildpackage -_toolchain-source -_update-alternatives -_update-rc.d -_uscan -_wajig -_wanna-build -_vim-addons _grep-excuses ' diff -Nru zsh-5.0.5/Completion/Debian/Command/_dpkg zsh-5.0.7/Completion/Debian/Command/_dpkg --- zsh-5.0.5/Completion/Debian/Command/_dpkg 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Command/_dpkg 2014-10-07 18:11:30.000000000 +0000 @@ -50,6 +50,9 @@ '--yet-to-unpack[list uninstalled]' '--print-architecture[print target architecture]' '--print-installation-architecture' + '--print-foreign-architectures[print list of extra architectures]' + '--add-architecture[add extra architecture]:architecture:->add_architecture' + '--remove-architecture[remove extra architecture]:architecture:->remove_architecture' '--compare-versions[compare version numbers]:*::expression:= ->compare_versions' ) @@ -179,4 +182,13 @@ _call_function ret _dpkg_$state && return ret _files ;; + add_architecture) + _call_function ret _dpkg_$state && return ret + _wanted architecture expl 'extra architecture' \ + compadd ${(f)"$(dpkg-architecture -L 2>/dev/null)"} + ;; + remove_architecture) + _call_function ret _dpkg_$state && return ret + _wanted architecture expl 'extra architecture' \ + compadd ${(f)"$(dpkg --print-foreign-architectures 2>/dev/null)"} esac diff -Nru zsh-5.0.5/Completion/Debian/.distfiles zsh-5.0.7/Completion/Debian/.distfiles --- zsh-5.0.5/Completion/Debian/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/Debian/Type/.distfiles zsh-5.0.7/Completion/Debian/Type/.distfiles --- zsh-5.0.5/Completion/Debian/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Debian/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_deb_packages ' diff -Nru zsh-5.0.5/Completion/.distfiles zsh-5.0.7/Completion/.distfiles --- zsh-5.0.5/Completion/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,5 +1,2 @@ DISTFILES_SRC=' -.distfiles -.cvsignore README compaudit compdump compinit compinstall -bashcompinit ' diff -Nru zsh-5.0.5/Completion/Linux/Command/_btrfs zsh-5.0.7/Completion/Linux/Command/_btrfs --- zsh-5.0.5/Completion/Linux/Command/_btrfs 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/_btrfs 2014-10-07 18:11:30.000000000 +0000 @@ -1,15 +1,23 @@ #compdef btrfs +# based on Btrfs v3.12+20131125 local curcontext="$curcontext" curstate state line expl grp cmd ret=1 -local -a groups args cmds_1 cmds_2 cmds_3 cmds_4 cmds_5 cmds_6 +local -a cmds_1 cmds_2 cmds_3 cmds_4 cmds_5 cmds_6 cmds_7 cmds_8 cmds_9 cmds_10 +local -a groups args -groups=( subvolume filesystem device scrub balance inspect-internal help version ) -cmds_1=( create delete list snapshot get-default set-default find-new help ) +groups=( subvolume filesystem device scrub balance inspect-internal + quota qgroup replace rescue check restore send receive + help version ) +cmds_1=( create delete list snapshot get-default set-default find-new show help ) cmds_2=( df show sync defragment resize label balance help ) -cmds_3=( add delete scan help ) +cmds_3=( add delete ready scan stats help ) cmds_4=( start cancel resume status help ) cmds_5=( start pause cancel resume status ) -cmds_6=( inode-resolve logical-resolve help ) +cmds_6=( inode-resolve logical-resolve subvolid-resolve rootid help ) +cmds_7=( enable disable rescan help ) +cmds_8=( assign remove create destroy show limit help ) +cmds_9=( start status cancel help ) +cmds_10=( chunk-recover super-recover ) [[ $words[2] = h(|e(|l(|p))) ]] && args=( '--full[display detailed help]' ) @@ -31,88 +39,247 @@ : $words local grp=${groups[(i)$words[2]*]} : $grp - (( grp && grp < 7 )) || return 1 + (( grp && grp <= 14 )) || return 1 curcontext="${curcontext%:*:*}:$service-${groups[grp]}:" - _wanted commands expl command compadd -a cmds_$grp && ret=0 + case $grp in + 11) + # btrfs check + args+=( + {-s,--support}'[specify superblock]:superblock: _message "superblock"' + '--repair[try to repair the filesystem]' + '--init-csum-tree[create a new CRC tree]' + '--init-extent-tree[create a new extent tree]' + '1:path:_files -/' + ) + ;| + 12) + # btrfs replace + args+=( + '-s[get snapshots]' + '-x[get extended attributes]' + '-v[verbose]' + '-i[ignore errors]' + '-o[overwrite]' + '-t[tree location]:tree:_message "tree location"' + '-f[filesystem location]:filesystem:_message "filesystem location"' + '-u[super mirror]:mirror:_message "super mirror"' + '-r[root objectid]:objectid:_message "root objectid"' + '-d[find dir]' + '-l[list tree roots]' + '--path-regex[restore matching filenames]:regex:_message "regex"' + '1:device:_files -/' + '2:path:_files -/' + ) + ;| + 13) + # btrfs send + args+=( + '*-v[verbose mode]' + '-p[send incremental stream]:parent:_files -/' + '*-c[use snapshot as clone source]:clone:_files -/' + '-f[output file]:file:_files' + '1:subvol:_files -/' + ) + ;| + 14) + # btrfs receive + args+=( + '*-v[verbose mode]' + '-f[input file]:file: _files' + '-e[terminate after ]' + '1:mount:->mounts' + ) + ;| + <11-14>) + (( CURRENT-- )); shift words; curcontext="${curcontext%:*:*}:$service-${group[grp]}:" + _arguments -C "$args[@]" && ret=0 + ;; + <0-10>) + _wanted commands expl command compadd -a cmds_$grp && ret=0 + ;; + esac ;; args) : $words local grp=${groups[(i)$words[1]*]} - (( grp && grp < 7 )) || return 1 + (( grp && grp <= 15 )) || return 1 local group=cmds_$grp local cmd=${${(P)group}[(i)$words[2]*]} (( cmd )) || return 1 curcontext="${curcontext%:*:*}:$service-${groups[grp]}-${${(P)group}[cmd]}:" args=( '(-)--help[print help information]' ) case ${groups[grp]}:${${(P)group}[cmd]} in - filesystem:balance) - if (( CURRENT == 3 )); then - state+=cmds - else - shift words - (( CURRENT-- )) - state+=args - fi - continue - ;; - subvolume:create) args+=( '1:destination:->mounts' );; - subvolume:delete) args+=( '1:subvolume:_files -/' );; - subvolume:snapshot) args+=( '-r[readonly snapshot]' '1:snapshot:_files -/' );; - subvolume:list) args+=( '-p[include parent ID in output]' '1:path:->mounts' );; - subvolume:set-default) args+=( '1:id:_guard "[0-9]#" id' '2:path:->mounts' );; - filesystem:resize) args+=( '1:size:_guart "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );; - filesystem:defragment) - args+=( - '-v[verbose]' - '-c[compress files while defragmenting]' - '-f[flush after defragmenting]' - '-s[start position]:byte position' - '-l[defragment limited number of bytes]:length (bytes)' - '-t[defragment only files over a certain size]:minimum size (bytes)' - '*:file:_files' - ) - ;; - filesystem:label) args+=( '1:device:_files -g "*(d)"' '2:label' );; - filesystem:show) args+=( '(1 -)--all-devices[scan all devices in /dev]' '1: :_guard "^-*" uuid or label' );; - device:(add|delete)) args+=( '1:device:_files -g "*(d)"' '2:path:->mounts' );; - device:scan) args+=( '(1 -)--all-devices[scan all devices in /dev]' '1:device:_files -g "*(d)"' );; - scrub:(start|resume)) - args+=( - "-B[don't background and print statistics at end]" - '-d[print separate statistics for each device]' - '-q[omit error message and statistics]' - '-r[read only mode]' - '-u[scrub unused space too]' - '1:path or device:_files' - ) - ;; - scrub:cancel) args+=( '1:path or device' );; - scrub:status) args+=( '-d[separate statistics for each device]' '1:path or device:_files' );; - balance:start) - args+=( - '(-m -s)-d+[act on data chunks]:filter:->filters' - '(-d -s)-m+[act on metadata chunks]:filter:->filters' - '(-d -m)-s+[act on system chunks (only under -f)]:filters:->filters' - '-v[verbose mode]' - '-f[force reducing of metadata integrity]' - '1:path:_files -/' - ) - ;; - balance:status) args+=( '-v[verbose mode]' '2:path:_files -/' );; - balance:(pause|cancel|resume)) args+=( '2:path:_files -/' );; - inspect*:inode*) args+=( '-v[verbose mode]' '1:inode:_files' '2:path:_files -/' );; - inspect*:logical*) - args+=( - '-v[verbose mode]' - '-P[skip the path resolving and print the inodes instead]' - '1:logical address:_files' - '2:filesystem path:_files -/' - ) - ;; - subvolume:get-default) ;& - *:sync) ;& - *:df) args+=( '1:path:->mounts' );; - *) args+=( '*: :_default' );; # fallback for unknown subcommands + filesystem:balance) + if (( CURRENT == 3 )); then + state+=cmds + else + shift words + (( CURRENT-- )) + state+=args + fi + continue + ;; + subvolume:create) args+=( '1:destination:->mounts' );; + subvolume:delete) args+=( '1:subvolume:_files -/' );; + subvolume:snapshot) + args+=( + '-r[readonly snapshot]' + '*-i[assign to qgroup]:qgroup: _message "qgroup"' + '1:source directory:_files -/' + '2:snapshot name or destination:_files -/' + ) + ;; + subvolume:list) + args+=( + '-p[include parent ID in output]' + '-a[include all subvolumes]' + '-c[include ogeneration of the subvolume]' + '-g[include generation of the subvolume]' + '-o[include only subvolumes below the path]' + '-u[include UUID of subvolume]' + '-q[include parent UUID of subvolume]' + '-t[print results as a table]' + '-s[list only snapshot subvolumes]' + '-r[list only readonly subvolumes]' + '-G[subvolume generation is more or less than]:gen: _guard "(|+|-)[0-9]#"' + '-C[subvolume ogeneration is more or less than]:ogen: _guard "(|+|-)[0-9]#"' + '--sort=-[list in order]:sort:_values -s "," sort rootid gen ogen path' + '1:path:->mounts' + ) + ;; + subvolume:set-default) args+=( '1:id:_guard "[0-9]#" id' '2:path:->mounts' );; + subvolume:get-default) args+=( '1:path:_files -/' );; + subvolume:find-new) args+=( '1:subvol:_files -/' '2:lastgen: _message "last gen"' );; + filesystem:resize) args+=( '1:size:_guard "(|+|-)[0-9]#[GKM]"' '2:path:->mounts' );; + filesystem:defragment) + args+=( + '-v[verbose]' + '-c[compress files while defragmenting]' + '-r[defragment files recursively]' + '-f[flush after defragmenting]' + '-s[start position]:byte position' + '-l[defragment limited number of bytes]:length (bytes)' + '-t[defragment only files over a certain size]:minimum size (bytes)' + '*:file:_files' + ) + ;; + filesystem:label) args+=( '1:device:_files -g "*(d)"' '2:label' );; + filesystem:show) + args+=( + '(1 -)'{-d,--all-devices}'[scan all devices in /dev]' + '(1 -)'{-m,--mounted}'[show only mounted filesystems]' + '1: :_guard "^-*" uuid or label' + ) + ;; + device:(add|delete)) + args+=( + '1:device:_files -g "*(d)"' + '2:path:->mounts' + ) + [[ ${${(P)group}[cmd]} == add ]] && + args+=( + {-K,--nodiscard}'[do not perform discard]' + {-f,--force}'[force overwrite of existing filesystem]' + ) + ;; + device:scan) args+=( '(1 -)--all-devices[scan all devices in /dev]' '1:device:_files -g "*(d)"' );; + device:stats) args+=( "1:device or mountpoint:_files -g '*(d,/)'" '-z[reset stats when done]' );; + device:ready) args+=( '1:device: _files -g "*(d)"' );; + scrub:(start|resume)) + args+=( + "-B[don't background and print statistics at end]" + '-d[print separate statistics for each device]' + '-q[omit error message and statistics]' + '-r[read only mode]' + '-R[raw print mode]' + '-c[set ioprio class]:class:(( 0\:none 1\:realtime 2\:best-effort 3\:idle))' + '-n[set ioprio classdata]:classdata:(0 1 2 3 4 5 6 7)' + '1:path or device:_files' + ) + [[ ${${(P)group}[cmd]} == start ]] && args+=( '-R[raw print mode]' ) + ;; + scrub:cancel) args+=( '1:path or device' );; + scrub:status) args+=( '-d[separate statistics for each device]' '1:path or device:_files' );; + balance:start) + args+=( + '(-m -s)-d+[act on data chunks]:filter:->filters' + '(-d -s)-m+[act on metadata chunks]:filter:->filters' + '(-d -m)-s+[act on system chunks (only under -f)]:filters:->filters' + '-v[verbose mode]' + '-f[force reducing of metadata integrity]' + '1:path:_files -/' + ) + ;; + balance:status) args+=( '-v[verbose mode]' '2:path:_files -/' );; + balance:(pause|cancel|resume)) args+=( '2:path:_files -/' );; + quota:(enable|disable)) args+=( '1:path:_files -/' );; + quota:rescan) + args+=( + '-s[show status of currently running rescan]' + '-w[wait for rescan to finish]' + '1:path:_files -/' + ) + ;; + qgroup:(assign|remove)) args+=( '1:source path:_files -/' + '2:destination path:_files -/' '3:path:_files -/' );; + qgroup:(create|destroy)) args+=( '1:qgroupid:' '2:path:_files -/' );; + qgroup:show) + args+=( + '-p[print parent qgroup id]' + '-c[print child qgroup id]' + '-r[print max referenced size of qgroup]' + '-e[print max exclusive size of qgroup]' + '-F[list impacted qgroups\(include ancestral qgroups\)]' + '-f[list impacted qgroups\(exclude ancestral qgroups\)]' + '--sort=-[sort qgroups]:sort:_values -s , sort \ + qgroupid rfer excl max_rfer max_excl' + '1:path:_files -/' + ) + ;; + qgroup:limit) + args+=( + '-c[limit amount of data after compression]' + '-e[limit space exclusively to qgroup]' + ':size or none: _message "size or none"' + ':qgroup id or path:_files -/' + ':path:_files -/' + ) + ;; + replace:start) + args+=( + '-r[read from only]:srcdev:_files' + '-f[force overwriting of target]' + '-B[do not background]' + ':srcdev or devid:_files' + ':target:_files' + ':path:->mounts' + ) + ;; + replace:status) args+=( '-1[print once]' ':path:->mounts' );; + replace:cancel) args+=( ':path:->mounts' );; + inspect*:inode*) args+=( '-v[verbose mode]' '1:inode:_files' '2:path:_files -/' );; + inspect*:subvol*) args+=( '-v[verbose mode]' '1:subvolid:_guard "[0-9]#" subvolume id' '2:path:_files -/' );; + inspect*:logical*) + args+=( + '-v[verbose mode]' + '-P[skip the path resolving and print the inodes instead]' + '-s[buffer size]:buffer size:' + '1:logical address:_files' + '2:filesystem path:_files -/' + ) + ;; + inspect*:rootid) args+=( '1:path:_files -/' );; + rescue:(chunk|super)-recover) + args+=( + '-y[assume yes to every question]' + '-v[verbose mode]' + ) + [[ ${${(P)group}[cmd]} == chunk-recover ]] && args+=('-h[display help]') + ;; + subvolume:get-default) ;& + *:sync) ;& + *:df) args+=( '1:path:->mounts' );; + *) args+=( '*: :_default' );; # fallback for unknown subcommands esac shift words (( CURRENT-- )) @@ -125,18 +292,18 @@ filters) state=() _values -s , filter \ - 'profiles[balance only block groups in given replication profiles]:profile:->profiles' \ - 'usage[balance block groups with usage below percentage]:percentage' \ - 'devid[limit by device ID]:device ID' \ - 'drange[balance block groups overlapping byte range]:range' \ - 'vrange[balance block groups overlapping byte range in virtual address space]:range' \ - 'convert[convert block groups to given profile]:profile:->profiles' \ - 'soft[leave chunks that already have target profile]' && ret=0 + 'profiles[balance only block groups in given replication profiles]:profile:->profiles' \ + 'usage[balance block groups with usage below percentage]:percentage' \ + 'devid[limit by device ID]:device ID' \ + 'drange[balance block groups overlapping byte range]:range' \ + 'vrange[balance block groups overlapping byte range in virtual address space]:range' \ + 'convert[convert block groups to given profile]:profile:->profiles' \ + 'soft[leave chunks that already have target profile]' && ret=0 state=( $state ) ;; profiles) compset -P '*\|' - _values -s ',' profile raid0 raid1 raid10 dup single && ret=0 + _values -s ',' profile raid0 raid1 raid5 raid6 raid10 dup single && ret=0 ;; esac done diff -Nru zsh-5.0.5/Completion/Linux/Command/_cryptsetup zsh-5.0.7/Completion/Linux/Command/_cryptsetup --- zsh-5.0.5/Completion/Linux/Command/_cryptsetup 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/_cryptsetup 2014-10-07 18:11:30.000000000 +0000 @@ -1,103 +1,82 @@ #compdef cryptsetup -## completion for cryptsetup 1.3.0, based on cryptsetup(1) -function _cryptsetup_action { - typeset -a actions - actions=( - 'create:create a mapping' - 'remove:remove an existing mapping' - 'status:report mapping status' - 'resize:resize an active mapping' - 'luksFormat:Initialize a LUKS partition' - 'luksOpen:Open LUKS partition' - 'luksClose:remove an existing mapping' - 'luksSuspend:suspend active device' - 'luksResume:resume suspended device' - 'luksAddKey:add a new key' - 'luksRemoveKey:remove a key' - 'luksChangeKey:change a key' - 'luksKillSlot:wipe key from slot' - 'luksUUID:print/change device UUID' - 'isLuks:check if device is a LUKS partition' - 'luksDump:dump header information' - 'luksHeaderBackup:store binary backup of headers' - 'luksHeaderRestore:restore header backup' - ) - _describe action actions -} +local curcontext="$curcontext" ret=1 +local -a actions state line expl -function _cryptsetup_device { - typeset expl - _wanted file expl device \ - _files -} +_arguments \ + '(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \ + '--debug[enable debug mode]' \ + '(-h --hash)'{-h,--hash}'[hash algorithm]:hash algorithm' \ + '(-c --cipher)'{-c,--cipher}'[set cipher]:cipher specification' \ + '(-y --verify-passphrase)'{-y,--verify-passphrase}'[query for password twice]' \ + '(-d --key-file)'{-d,--key-file}'[set keyfile]:key file:_files' \ + '(-l --keyfile-size)'{-l,--keyfile-size}'[set keyfile size]:size (bytes)' \ + '--new-keyfile-size[set new keyfile size (luksAddKey)]:size (bytes)' \ + '--master-key-file[set master key]:key file:_files' \ + '--dump-master-key[dump luks master key]' \ + '(--use-urandom)--use-random[use /dev/random to generate volume key]' \ + '(--use-random)--use-urandom[use /dev/urandom to generate volume key]' \ + '(-S --key-slot)'{-S,--key-slot}'[select key slot]:key slot' \ + '(-s --key-size)'{-s,--key-size}'[set key size]:size (bits)' \ + '(-b --size)'{-b,--size}'[force device size]:sectors' \ + '(-o --offset)'{-o,--offset}'[set start offset]:sectors' \ + '(-p --skip)'{-p,--skip}'[data to skip at beginning]:sectors' \ + '--readonly[set up read-only mapping]' \ + '(-i --iter-time)'{-i,--iter-time}'[set password processing duration]:duration (milliseconds)' \ + '(-q --batch-mode)'{-q,--batch-mode}'[do not ask for confirmation]' \ + '(-t --timeout)'{-t,--timeout}'[set password prompt timeout]:timeout (seconds)' \ + '(-T --tries)'{-T,--tries}'[set maximum number of retries]:number of retries' \ + '--align-payload[set payload alignment]:sectors' \ + '--uuid[set device UUID]:uuid' \ + '(- : *)--version[show version information]' \ + ':action:->actions' \ + '*::arguments:->action-arguments' && ret=0 + +case $state in + actions) + actions=( + 'create:create a mapping' + 'remove:remove an existing mapping' + 'status:report mapping status' + 'resize:resize an active mapping' + 'luksFormat:initialize a LUKS partition' + 'luksOpen:open LUKS partition' + 'luksClose:remove an existing mapping' + 'luksSuspend:suspend active device' + 'luksResume:resume suspended device' + 'luksAddKey:add a new key' + 'luksRemoveKey:remove a key' + 'luksChangeKey:change a key' + 'luksKillSlot:wipe key from slot' + 'luksUUID:print/change device UUID' + 'isLuks:check if device is a LUKS partition' + 'luksDump:dump header information' + 'luksHeaderBackup:store binary backup of headers' + 'luksHeaderRestore:restore header backup' + ) + _describe action actions && ret=0 + ;; + action-arguments) + local -a args + local mapping=':mapping:_path_files -W /dev/mapper' + local device=':device:_files' + case ${words[1]} in + create) args=( $mapping $device );; + luksKillSlot) args=( $device ':key slot number' );; + luksOpen) args=( $device $mapping );; + remove|status|resize|luksClose|luksSuspend|luksResume) args=( $mapping );; + luks(AddKey|RemoveKey|DelKey|UUID|Dump)|isLuks) args=( $device );; + luks(Format|AddKey|RemoveKey|ChangeKey)) + args=( $device ':key file:_files' ) + ;; + luksHeader*) args=( $device '--header-backup-file:file:_files' );; + *) + _default + return + ;; + esac + _arguments $args && ret=0 + ;; +esac -function _cryptsetup_mapping { - typeset expl - _wanted file expl 'mapping name' \ - _path_files -W /dev/mapper -} - -function _cryptsetup_arguments { - - case ${words[1]} in - - create) - _arguments ':mapping:_cryptsetup_mapping' ':device:_cryptsetup_device' - ;; - - remove|status|resize|luksClose|luksSuspend|luksResume) - _arguments ': :_cryptsetup_mapping' - ;; - - luks(AddKey|RemoveKey|DelKey|UUID|Dump)|isLuks) - _arguments ': :_cryptsetup_device' - ;; - - luks(Format|AddKey|RemoveKey|ChangeKey)) - _arguments ': :_cryptsetup_device' ':key file:_files' - ;; - - luksKillSlot) - _arguments ': :_cryptsetup_device' ':key slot number' - ;; - - luksOpen) - _arguments ': :_cryptsetup_device' ': :_cryptsetup_mapping' - ;; - - esac -} - -function _cryptsetup { - _arguments \ - '(-v --verbose)'{-v,--verbose}'[enable verbose mode]' \ - '--debug[enable debug mode]' \ - '(-h --hash)'{-h,--hash}'[hash algorithm]:hash algorithm' \ - '(-c --cipher)'{-c,--cipher}'[set cipher]:cipher specification' \ - '(-y --verify-passphrase)'{-y,--verify-passphrase}'[query for password twice]' \ - '(-d --key-file)'{-d,--key-file}'[set keyfile]:key file:_files' \ - '(-l --keyfile-size)'{-l,--keyfile-size}'[set keyfile size]:bytes' \ - '--new-keyfile-size[set new keyfile size (luksAddKey)]:bytes' \ - '--master-key-file[set master key]:key file:_files' \ - '--dump-master-key[dump luks master key]' \ - '(--use-urandom)--use-random[use /dev/random to generate volume key]' \ - '(--use-random)--use-urandom[use /dev/urandom to generate volume key]' \ - '(-S --key-slot)'{-S,--key-slot}'[select key slot]:key slot' \ - '(-s --key-size)'{-s,--key-size}'[set key size]:bits' \ - '(-b --size)'{-b,--size}'[force device size]:sectors' \ - '(-o --offset)'{-o,--offset}'[set start offset]:sectors' \ - '(-p --skip)'{-p,--skip}'[data to skip at beginning]:sectors' \ - '--readonly[set up read-only mapping]' \ - '(-i --iter-time)'{-i,--iter-time}'[set password processing duration]:milliseconds' \ - '(-q --batch-mode)'{-q,--batch-mode}'[do not ask for confirmation]' \ - '(-t --timeout)'{-t,--timeout}'[set password prompt timeout]:seconds' \ - '(-T --tries)'{-T,--tries}'[set maximum number of retries]:maximum retries' \ - '--align-payload[set payload alignment]:sectors' \ - '--uuid[set device UUID]:uuid' \ - '--version[show version information]' \ - ':action:_cryptsetup_action' \ - '*::arguments:_cryptsetup_arguments' -} - -_cryptsetup "$@" +return ret diff -Nru zsh-5.0.5/Completion/Linux/Command/.distfiles zsh-5.0.7/Completion/Linux/Command/.distfiles --- zsh-5.0.5/Completion/Linux/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,36 +1,2 @@ DISTFILES_SRC=' -.distfiles -_acpi -_acpitool -_analyseplugin -_brctl -_btrfs -_chrt -_cryptsetup -_ethtool -_fusermount -_ionice -_ipset -_iptables -_iwconfig -_losetup -_lsusb -_mdadm -_mii-tool -_modutils -_mondo -_nmcli -_pkgtool -_rpmbuild -_schedtool -_sshfs -_strace -_tpb -_tpconfig -_tune2fs -_uml -_valgrind -_vserver -_wpa_cli -_yast ' diff -Nru zsh-5.0.5/Completion/Linux/Command/_docker zsh-5.0.7/Completion/Linux/Command/_docker --- zsh-5.0.5/Completion/Linux/Command/_docker 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/_docker 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,410 @@ +#compdef docker +# +# zsh completion for docker (http://docker.com) +# +# version: 0.3.0 +# github: https://github.com/felixr/docker-zsh-completion +# +# contributers: +# - Felix Riedel +# - Vincent Bernat +# +# license: +# +# Copyright (c) 2013, Felix Riedel +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +__parse_docker_list() { + awk ' +NR == 1 { + idx=1;i=0;f[i]=0 + header=$0 + while ( match(header, / ([A-Z]+|[A-Z]+ [A-Z]+)/) ) { + idx += RSTART+1 + f[++i]=idx + header = substr($0,idx) + } + f[++i]=999 +} + +NR > 1 '"$1"' { + for(j=0;j 1 && $1 != ""){printf("%s", $1);if ($2 != "") printf("\\:%s", $2); printf("\n")}')"}) + images=($images ${(f)"$(_call_program commands docker images | awk '(NR > 1){printf("%s:%-15s in %s\n", $3,$2,$1)}')"}) + _describe -t docker-images "Images" images +} + +__docker_tags() { + local expl + declare -a tags + tags=(${(f)"$(_call_program commands docker images | awk '(NR>1){print $2}'| sort | uniq)"}) + _describe -t docker-tags "tags" tags +} + +__docker_repositories_with_tags() { + if compset -P '*:'; then + __docker_tags + else + __docker_repositories -qS ":" + fi +} + +__docker_search() { + # declare -a dockersearch + local cache_policy + zstyle -s ":completion:${curcontext}:" cache-policy cache_policy + if [[ -z "$cache_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy + fi + + local searchterm cachename + searchterm="${words[$CURRENT]%/}" + cachename=_docker-search-$searchterm + + local expl + local -a result + if ( [[ ${(P)+cachename} -eq 0 ]] || _cache_invalid ${cachename#_} ) \ + && ! _retrieve_cache ${cachename#_}; then + _message "Searching for ${searchterm}..." + result=(${(f)"$(_call_program commands docker search ${searchterm} | awk '(NR>2){print $1}')"}) + _store_cache ${cachename#_} result + fi + _wanted dockersearch expl 'Available images' compadd -a result +} + +__docker_caching_policy() +{ + # oldp=( "$1"(Nmh+24) ) # 24 hour + oldp=( "$1"(Nmh+1) ) # 24 hour + (( $#oldp )) +} + + +__docker_repositories () { + local expl + declare -a repos + repos=(${(f)"$(_call_program commands docker images | sed -e '1d' -e 's/[ ].*//' | sort | uniq)"}) + _describe -t docker-repos "Repositories" repos "$@" +} + +__docker_commands () { + # local -a _docker_subcommands + local cache_policy + + zstyle -s ":completion:${curcontext}:" cache-policy cache_policy + if [[ -z "$cache_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy __docker_caching_policy + fi + + if ( [[ ${+_docker_subcommands} -eq 0 ]] || _cache_invalid docker_subcommands) \ + && ! _retrieve_cache docker_subcommands; + then + _docker_subcommands=(${${(f)"$(_call_program commands + docker 2>&1 | sed -e '1,6d' -e '/^[ ]*$/d' -e 's/[ ]*\([^ ]\+\)\s*\([^ ].*\)/\1:\2/' )"}}) + _docker_subcommands=($_docker_subcommands 'help:Show help for a command') + _store_cache docker_subcommands _docker_subcommands + fi + _describe -t docker-commands "docker command" _docker_subcommands +} + +__docker_subcommand () { + local -a _command_args + case "$words[1]" in + (attach) + _arguments \ + '--no-stdin[Do not attach stdin]' \ + '--sig-proxy[Proxify all received signal]' \ + ':containers:__docker_runningcontainers' + ;; + (build) + _arguments \ + '--no-cache[Do not use cache when building the image]' \ + '-q[Suppress verbose build output]' \ + '--rm[Remove intermediate containers after a successful build]' \ + '-t=-:repository:__docker_repositories_with_tags' \ + ':path or URL:_directories' + ;; + (commit) + _arguments \ + '--author=-[Author]:author: ' \ + '-m=-[Commit message]:message: ' \ + '--run=-[Configuration automatically applied when the image is run]:configuration: ' \ + ':container:__docker_containers' \ + ':repository:__docker_repositories_with_tags' + ;; + (cp) + _arguments \ + ':container:->container' \ + ':hostpath:_files' + case $state in + (container) + if compset -P '*:'; then + _files + else + __docker_containers -qS ":" + fi + ;; + esac + ;; + (diff|export) + _arguments '*:containers:__docker_containers' + ;; + (history) + _arguments \ + '--no-trunc[Do not truncate output]' \ + '-q[Only show numeric IDs]' \ + '*:images:__docker_images' + ;; + (images) + _arguments \ + '-a[Show all images]' \ + '--no-trunc[Do not truncate output]' \ + '-q[Only show numeric IDs]' \ + '--tree[Output graph in tree format]' \ + '--viz[Output graph in graphviz format]' \ + ':repository:__docker_repositories' + ;; + (inspect) + _arguments \ + '--format=-[Format the output using the given go template]:template: ' \ + '*:containers:__docker_containers' + ;; + (import) + _arguments \ + ':URL:(- http:// file://)' \ + ':repository:__docker_repositories_with_tags' + ;; + (info) + ;; + (import) + _arguments \ + ':URL:(- http:// file://)' \ + ':repository:__docker_repositories_with_tags' + ;; + (insert) + _arguments '1:containers:__docker_containers' \ + '2:URL:(http:// file://)' \ + '3:file:_files' + ;; + (kill) + _arguments '*:containers:__docker_runningcontainers' + ;; + (load) + ;; + (login) + _arguments \ + '-e=-[Email]:email: ' \ + '-p=-[Password]:password: ' \ + '-u=-[Username]:username: ' \ + ':server: ' + ;; + (logs) + _arguments \ + '-f[Follow log output]' \ + '*:containers:__docker_containers' + ;; + (port) + _arguments \ + '1:containers:__docker_runningcontainers' \ + '2:port:_ports' + ;; + (start) + _arguments \ + '-a[Attach container'"'"'s stdout/stderr and forward all signals]' \ + '-i[Attach container'"'"'s stding]' \ + '*:containers:__docker_stoppedcontainers' + ;; + (rm) + _arguments \ + '--link[Remove the specified link and not the underlying container]' \ + '-v[Remove the volumes associated to the container]' \ + '*:containers:__docker_stoppedcontainers' + ;; + (rmi) + _arguments \ + '*:images:__docker_images' + ;; + (restart|stop) + _arguments '-t=-[Number of seconds to try to stop for before killing the container]:seconds to before killing:(1 5 10 30 60)' \ + '*:containers:__docker_runningcontainers' + ;; + (top) + _arguments \ + '1:containers:__docker_runningcontainers' \ + '(-)*:: :->ps-arguments' + case $state in + (ps-arguments) + _ps + ;; + esac + + ;; + (ps) + _arguments \ + '-a[Show all containers]' \ + '--before=-[Show only container created before...]:containers:__docker_containers' \ + '-l[Show only the latest created container]' \ + '-n=-[Show n last created containers, include non-running one]:n:(1 5 10 25 50)' \ + '--no-trunc[Do not truncate output]' \ + '-q[Only show numeric IDs]' \ + '-s[Display sizes]' \ + '--since=-[Show only containers created since...]:containers:__docker_containers' + ;; + (tag) + _arguments \ + '-f[force]'\ + ':image:__docker_images'\ + ':repository:__docker_repositories_with_tags' + ;; + (run) + _arguments \ + '-P[Publish all exposed ports to the host]' \ + '-a[Attach to stdin, stdout or stderr]' \ + '-c=-[CPU shares (relative weight)]:CPU shares:(0 10 100 200 500 800 1000)' \ + '--cidfile=-[Write the container ID to the file]:CID file:_files' \ + '-d[Detached mode: leave the container running in the background]' \ + '*--dns=-[Set custom dns servers]:dns server: ' \ + '*-e=-[Set environment variables]:environment variable: ' \ + '--entrypoint=-[Overwrite the default entrypoint of the image]:entry point: ' \ + '*--expose=-[Expose a port from the container without publishing it]: ' \ + '-h=-[Container host name]:hostname:_hosts' \ + '-i[Keep stdin open even if not attached]' \ + '--link=-[Add link to another container]:link:->link' \ + '--lxc-conf=-[Add custom lxc options]:lxc options: ' \ + '-m=-[Memory limit (in bytes)]:limit: ' \ + '--name=-[Container name]:name: ' \ + '*-p=-[Expose a container'"'"'s port to the host]:port:_ports' \ + '--privileged[Give extended privileges to this container]' \ + '--rm[Remove intermediate containers when it exits]' \ + '--sig-proxy[Proxify all received signal]' \ + '-t[Allocate a pseudo-tty]' \ + '-u=-[Username or UID]:user:_users' \ + '*-v=-[Bind mount a volume (e.g. from the host: -v /host:/container, from docker: -v /container)]:volume: '\ + '--volumes-from=-[Mount volumes from the specified container]:volume: ' \ + '-w=-[Working directory inside the container]:directory:_directories' \ + '(-):images:__docker_images' \ + '(-):command: _command_names -e' \ + '*::arguments: _normal' + + case $state in + (link) + if compset -P '*:'; then + _wanted alias expl 'Alias' compadd -E "" + else + __docker_runningcontainers -qS ":" + fi + ;; + esac + + ;; + (pull|search) + _arguments ':name:__docker_search' + ;; + (push) + _arguments ':repository:__docker_repositories_with_tags' + ;; + (save) + _arguments \ + ':images:__docker_images' + ;; + (wait) + _arguments ':containers:__docker_runningcontainers' + ;; + (help) + _arguments ':subcommand:__docker_commands' + ;; + (*) + _message 'Unknown sub command' + esac + +} + +_docker () { + # Support for subservices, which allows for `compdef _docker docker-shell=_docker_containers`. + # Based on /usr/share/zsh/functions/Completion/Unix/_git without support for `ret`. + if [[ $service != docker ]]; then + _call_function - _$service + return + fi + + local curcontext="$curcontext" state line + typeset -A opt_args + + _arguments -C \ + '-H=-[tcp://host:port to bind/connect to]:socket: ' \ + '(-): :->command' \ + '(-)*:: :->option-or-argument' + + if (( CURRENT == 1 )); then + + fi + case $state in + (command) + __docker_commands + ;; + (option-or-argument) + curcontext=${curcontext%:*:*}:docker-$words[1]: + __docker_subcommand + ;; + esac +} + +_docker "$@" diff -Nru zsh-5.0.5/Completion/Linux/Command/_modutils zsh-5.0.7/Completion/Linux/Command/_modutils --- zsh-5.0.5/Completion/Linux/Command/_modutils 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/_modutils 2014-10-07 18:11:30.000000000 +0000 @@ -127,7 +127,7 @@ _message -e value 'parameter value' else local params - params=( ${${(M)${(f)"$(_call_program module_parameter modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) + params=( ${${(M)${(f)"$(_call_program module_parameter /sbin/modinfo "$words[2]" 2>/dev/null)"}:#parm:*}##parm:[[:space:]]##} ) if [[ $#params -eq 0 ]]; then _message -e parameter "This modules doesn't have parameters" else diff -Nru zsh-5.0.5/Completion/Linux/Command/_ss zsh-5.0.7/Completion/Linux/Command/_ss --- zsh-5.0.5/Completion/Linux/Command/_ss 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Command/_ss 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,98 @@ +#compdef ss + +local curcontext="$curcontext" suf ret=1 +local -a state line expl pref filt +local -A opt_args +local info="-h -V --help --version" +local sx="state exclude" + +_arguments -C -s \ + "(- *)"{-h,--help}'[show option summary]' \ + "(- *)"{-V,--version}'[show version information]' \ + "($info -n --numeric)"{-n,--numeric}"[don't resolve service names]" \ + "($info -r --resolve)"{-r,--resolve}'[resolve host addresses]' \ + "($info -a --all -l --listening)"{-a,--all}'[display all sockets]' \ + "($info -l --listening -a --all)"{-l,--listening}'[display listening sockets]' \ + "($info -o --options -e --extended)"{-o,--options}'[show timer information]' \ + "($info -e --extended -o --options)"{-e,--extended}'[show detailed information]' \ + "($info -m --memory)"{-m,--memory}'[show socket memory usage]' \ + "($info -p --processes)"{-p,--processes}'[show process using each socket]' \ + "($info -i --info)"{-i,--info}'[show internal TCP information]' \ + "($info -s --summary)"{-s,--summary}'[print summary statistics]' \ + "($info -4 --ipv4 -6 --ipv6)"{-4,--ipv4}'[display only IP version 4 sockets]' \ + "($info -4 --ipv4 -6 --ipv6)"{-6,--ipv6}'[display only IP version 6 sockets]' \ + "($info -0 --packet)"{-0,--packet}'[display PACKET sockets]' \ + "($info -t --tcp)"{-t,--tcp}'[display TCP sockets]' \ + "($info -u --udp)"{-u,--udp}'[display UDP sockets]' \ + "($info -d --dccp)"{-d,--dccp}'[display DCCP sockets]' \ + "($info -w --raw)"{-w,--raw}'[display RAW sockets]' \ + "($info -x --unix)"{-x,--unix}'[display Unix domain sockets]' \ + "($info -f --family)"{-f,--family}'[display sockets of specified type]:family:(unix inet inet6 link netlink)' \ + "($info -A --query --socket)"{-A,--query,--socket}'[specify socket tables to show]: :_values -s , socket\ table all inet tcp udp raw unix packet netlink unix_dgram unix_stream packet_raw packet_dgram' \ + "($info -D)"{-D,--diag=}'[dump raw info to file]:file:_files' \ + "($info -F)"{-F,--filter=}'[read filter information from a file]:file:_files' \ + "($info)*: :->filter" && ret=0 + +if [[ -n $state ]]; then + case $words[CURRENT-1] in + (d|s)port) + _wanted operators expl operator \ + compadd \< \> \= \>= \<= \== \!= eq ge gt lt le ne && ret=0 + ;; + dst|src) + if compset -P unix: || (( $+opt_args[-x] + $+opt_args[--unix] )) || [[ $opt_args[-f] = unix ]]; then + _files -g '*(=)' && ret=0 + elif compset -P nl:; then + if compset -P \*:; then + _pids && ret=0 + else + _message channel + fi + elif compset -P link:; then + compset -P \*: && _message ifindex || _message protocol + else + compset -P 'inet(6|):' + pref=$? + compset -S ':*' || suf="-qS:" + if compset -P \*:; then + _ports && ret=0 + elif compset -P \*/; then + _wanted netmasks expl netmask compadd $suf {1..31} && ret=0 + elif (( pref )); then + _alternative \ + "hosts:host:_hosts $suf" \ + "prefixes:prefix:compadd $suf nl link unix" && ret=0 + else + _hosts $suf && ret=0 + fi + fi + ;; + state|exclude) + _wanted states expl state compadd -M 'm:{a-zA-Z_}={A-Za-z-}' \ + ESTABLISHED SYN-SENT SYN-RECV FIN-WAIT-1 FIN-WAIT-2 TIME-WAIT \ + CLOSED CLOSE-WAIT LAST-ACK LISTEN CLOSING \ + all connected synchronized bucket big && ret=0 + ;; + *) + if [[ $words[CURRENT-2] = (d|s)port ]]; then + compset -P '*:' || pref=(-P :) + _ports $pref + return + else + (( $#line > 1 )) && [[ ${words[CURRENT-1]:Q} != (and|or|\() ]] && + filt=( "($sx)*"{and,or} ) + _values -w -s ' ' -S ' ' filter $filt \ + "*state[sockets in specified state]" \ + "*exclude[sockets not in specified state]" \ + "($sx)*src[local address/port of socket]" \ + "($sx)*dst[peer address/port of socket]" \ + "($sx)*dport[peer port]: :(lt gt ge)" \ + "($sx)*sport[local port]" \ + "($sx)*autobound[socket bound to ephemeral port]" \ + "($sx)*"{not,\(,\)} && ret=0 + fi + ;; + esac +fi + +return ret diff -Nru zsh-5.0.5/Completion/Linux/Type/.distfiles zsh-5.0.7/Completion/Linux/Type/.distfiles --- zsh-5.0.5/Completion/Linux/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Linux/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,2 @@ DISTFILES_SRC=' -.distfiles -_fuse_arguments -_fuse_values -_wakeup_capable_devices ' diff -Nru zsh-5.0.5/Completion/Mandriva/Command/.distfiles zsh-5.0.7/Completion/Mandriva/Command/.distfiles --- zsh-5.0.5/Completion/Mandriva/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Mandriva/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,5 +1,2 @@ DISTFILES_SRC=' -.distfiles -_urpmi -_rebootin ' diff -Nru zsh-5.0.5/Completion/Mandriva/.distfiles zsh-5.0.7/Completion/Mandriva/.distfiles --- zsh-5.0.5/Completion/Mandriva/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Mandriva/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/openSUSE/Command/.distfiles zsh-5.0.7/Completion/openSUSE/Command/.distfiles --- zsh-5.0.5/Completion/openSUSE/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/openSUSE/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,8 +1,2 @@ DISTFILES_SRC=' -.distfiles -_hwinfo -_osc -_SuSEconfig -_yast2 -_zypper ' diff -Nru zsh-5.0.5/Completion/openSUSE/Command/_SuSEconfig zsh-5.0.7/Completion/openSUSE/Command/_SuSEconfig --- zsh-5.0.5/Completion/openSUSE/Command/_SuSEconfig 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/openSUSE/Command/_SuSEconfig 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -#compdef SuSEconfig - -local curcontext="$curcontext" state line -typeset -A opt_args - -if [[ -z "$_SuSEconfig_modules" ]]; then - for i in /sbin/conf.d/SuSEconfig.*; do - case $i in *.rpm*|*.swap|*.bak|*.orig|*~|\#*) continue;; esac - _SuSEconfig_modules=($_SuSEconfig_modules ${i##*/SuSEconfig.}) - done -fi - - -_arguments \ - '--help' \ - '--quick' \ - '--force' \ - '--verbose' \ - '--nonewpackage' \ - '--module:module:->module' && return 0 - -case $state in - module) compadd $_SuSEconfig_modules ;; -esac - -# Usage: SuSEconfig [--quick|--nonewpackage|--force|--verbose] [--module name] - - diff -Nru zsh-5.0.5/Completion/openSUSE/Command/_SUSEconfig zsh-5.0.7/Completion/openSUSE/Command/_SUSEconfig --- zsh-5.0.5/Completion/openSUSE/Command/_SUSEconfig 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/openSUSE/Command/_SUSEconfig 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,28 @@ +#compdef SuSEconfig + +local curcontext="$curcontext" state line +typeset -A opt_args + +if [[ -z "$_SuSEconfig_modules" ]]; then + for i in /sbin/conf.d/SuSEconfig.*; do + case $i in *.rpm*|*.swap|*.bak|*.orig|*~|\#*) continue;; esac + _SuSEconfig_modules=($_SuSEconfig_modules ${i##*/SuSEconfig.}) + done +fi + + +_arguments \ + '--help' \ + '--quick' \ + '--force' \ + '--verbose' \ + '--nonewpackage' \ + '--module:module:->module' && return 0 + +case $state in + module) compadd $_SuSEconfig_modules ;; +esac + +# Usage: SuSEconfig [--quick|--nonewpackage|--force|--verbose] [--module name] + + diff -Nru zsh-5.0.5/Completion/openSUSE/Command/_zypper zsh-5.0.7/Completion/openSUSE/Command/_zypper --- zsh-5.0.5/Completion/openSUSE/Command/_zypper 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/openSUSE/Command/_zypper 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,8 @@ #compdef zypper # # Copyright (C) 2009 Holger Macht +# Copyright (C) 2014 Thomas Mitterfellner +# Copyright (C) 2014 Mariusz Fik # # This file is released under the GPLv2. # @@ -9,60 +11,171 @@ # Toggle verbose completions: zstyle ':completion:*:zypper:*' verbose no # zstyle ':completion:*:zypper-subcommand:*' verbose no # -# version 0.1 +# version 0.3 # # Main dispatcher +function _zypper_caching_policy () { + # rebuild if zsh's cache is older than zypper's + if test /var/cache/zypp/raw -nt "$1"; then + return 0 + else + return 1 + fi +} + _zypper() { + typeset -A opt_args + local context curcontext="$curcontext" state line + if (( CURRENT > 2 )) && [[ ${words[2]} != "help" ]]; then # Remember the subcommand name - local cmd=${words[2]} + local cmd=${words[2]} # Set the context for the subcommand. - curcontext="${curcontext%:*:*}:zypper-subcommand" + curcontext="${curcontext%:*:*}:zypper-subcommand" # Narrow the range of words we are looking at to exclude `zypper' - (( CURRENT-- )) - shift words - - _zypper_cmd_do $cmd + (( CURRENT-- )) + shift words + + _zypper_cmd_do $cmd else - local hline - local -a cmdlist - local tag=0 - _call_program help-commands LANG=C zypper help | sed -e ':a;N;$!ba;s/\n\t\t\t\t/ /g' | while read -A hline; do - # start parsing with "Global Options:" - [[ $hline =~ "^Global Options:" ]] && tag=1 - [[ $tag = 0 ]] && continue - # all commands have to start with lower case letters - [[ $hline[1] =~ ^[A-Z] ]] && continue - (( ${#hline} < 2 )) && continue - - # cut comma at end of command - hline[1]=`echo $hline[1] | sed -e 's/\(^.*\),/\1/'` - - # ${hline[1]%,} truncates the last ',' - cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") - done - _describe -t zypper-commands 'zypper command' cmdlist + local hline + local -a cmdlist + local tag=0 + _call_program help-commands LANG=C zypper help | sed -e ':a;N;$!ba;s/\n\t\t\t\t/ /g' | while read -A hline; do + # start parsing with "Global Options:" + [[ $hline =~ "^Global Options:" ]] && tag=1 + [[ $tag = 0 ]] && continue + # skip empty lines + [[ $hline =~ ^\s*$ ]] && continue + # all commands have to start with lower case letters + [[ $hline == [[:upper:]]* ]] && continue + (( ${#hline} < 2 )) && continue + + # cut comma at end of command + hline[1]=`echo $hline[1] | sed -e 's/\(^.*\),/\1/'` + + # ${hline[1]%,} truncates the last ',' + cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") + done + _describe -t zypper-commands 'zypper command' cmdlist fi } +_all_repos() { + local -a repos + repos=( $(zypper -q lr | tail -n +3 | cut -d'|' -f 2) ) + _describe -t repos 'Available repositories' repos && return +} + +_enabled_repos() { + repos=( $(zypper -x lr | grep 'enabled="1"' | cut -d\" -f 2) ) + _describe -t repos 'Available repositories' repos && return +} + +_disabled_repos() { + repos=( $(zypper -x lr | grep 'enabled="0"' | cut -d\" -f 2) ) + _describe -t repos 'Available repositories' repos && return +} + _zypper_cmd_do() { + typeset -A opt_args + local context state line local hline local -a cmdlist local tag=0 + local curcontext="$curcontext" + + zstyle ":completion:${curcontext}:" use-cache on + zstyle ":completion:${curcontext}:" cache-policy _zypper_caching_policy + _call_program help-commands LANG=C zypper help $cmd | while read -A hline; do - # start parsing from "Options:" - [[ $hline =~ "^Command options:" ]] && tag=1 - [[ $tag = 0 ]] && continue - # Option has to start with a '-' - [[ $hline[1] =~ ^- ]] || continue - (( ${#hline} < 2 )) && continue + # start parsing from "Options:" + [[ $hline =~ "^Command options:" ]] && tag=1 + [[ $tag = 0 ]] && continue + # Option has to start with a '-' + [[ $hline[1] =~ ^- ]] || continue + (( ${#hline} < 2 )) && continue - cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") + cmdlist=($cmdlist "${hline[1]%,}:${hline[2,-1]}") done if [ -n "$cmdlist" ]; then + local -a repos + + # special completion lists for certain options (mainly repos) + case ${words[CURRENT - 1]} in + --from) + repos=( $(zypper -x lr | grep 'enabled="1"' | cut -d\" -f 2) ) + _describe -t repos 'Available repositories' repos && return + ;; + (--enable|-e) + case $cmd in + (mr|modifyrepo) + _disabled_repos && return + ;; + esac + ;; + (--disable|-d) + case $cmd in + (mr|modifyrepo) + _enabled_repos && return + ;; + esac + ;; + (--type|-t) + local -a types + case $cmd in + (if|info|se|search|in|install) + types=( pattern srcpackage package patch ) + _describe -t types 'Package types' types && return + ;; + esac + ;; + esac + + # all options available for the active main command _describe -t zypper-commands 'zypper command' cmdlist + + case $cmd in + (lr|repos) + _all_repos + ;; + (in|install) + local expl + _description files expl 'RPM files' + _files "$expl[@]" -g '*.(#i)rpm(.)' + ;; + esac + + # only suggest packages if at least one character is given + if [[ ${words[CURRENT]} =~ "^[0-9a-zA-Z]" ]] ; then + local -a pkglist + + if ( [[ ${+_zypp_all_raw} -eq 0 ]] || _cache_invalid ZYPPER_ALL_RAW ) && ! _retrieve_cache ZYPPER_ALL_RAW; + then + _zypp_all_raw=$(zypper -x -q se | grep 'subcommands' && ret=0 + +[[ -z $state ]] && return ret + +if [[ CURRENT -eq 1 || $words[1] == help ]]; then + local -a subcmds + subcmds=( ${${${(f)"$(_call_program subcommands augtool help 2>/dev/null)"}[2,-2]## #}// #- /:} ) + _describe -t subcommands "augtool command" subcmds && ret=0 + return ret +fi + +_tags paths +while _tags; do + if _requested paths; then + local subcmd="$words[1]" + curcontext="${curcontext%:*}-${subcmd}:" + if compset -P '/files/'; then + _all_labels paths expl path _path_files -W / && ret=0 + elif compset -P '/augeas/'; then + compset -P '*/' + local files + files=( ${${(f)"$(_call_program path augtool ls ${words[CURRENT]%/*} 2>/dev/null)"}% = *} ) + while _next_label paths expl path; do + compadd "$expl[@]" -- ${files:#*/} && ret=0 + compadd "$expl[@]" -S '' -- ${(M)files:#*/} && ret=0 + done + else + local -a suf + suf=(-S '') + compset -S '/*' || suf=( -S / ) + _all_labels paths expl path compadd -P/ "$suf[@]" files augeas && ret=0 + fi + fi + (( ret )) || break +done + +return ret diff -Nru zsh-5.0.5/Completion/Unix/Command/_bpython zsh-5.0.7/Completion/Unix/Command/_bpython --- zsh-5.0.5/Completion/Unix/Command/_bpython 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_bpython 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,46 @@ +#compdef bpython bpython-gtk bpython-urwid bpython2 bpython2-gtk bpython2-urwid bpython3 bpython3-gtk bpython3-urwid + +local -a all_opts urwid_opts gtk_opts + +all_opts=( + '--config[configuration file]:config file:_files' + '-h --help[show help message]' + '(-i --interactive)'{-i,--interactive}'[drop to bpython after running a file]' + '(-q --quiet)'{-q,--quiet}'[do not flush the output to stdout]' + '(-V --version)'{-V,--version}'[print version]' + '1:script:_files -g "*.u#py(-.)"' + '*:arguments:' +) + +urwid_opts=( + '(-r --reactor)'{-r,--reactor}'[use Twisted reactor instead of the event loop]:reactor:' + '--help-reactors[display list of available Twisted reactors]' + '(-p --plugin)'{-p,--plugin}'[exectue a twistd plugin]:plugin:' + '(-s --server)'{-s,--server}'[run an eval server on the given port]:port:' +) + +gtk_opts=( + '--socket-id[embed bpython]:socket id:' +) + +case "$service" in + bpython|bpython2|bpython3) + _arguments \ + "$all_opts[@]" && return 0 + ;; + + bpython-urwid|bpython2-urwid|bpython3-urwid) + _arguments \ + "$all_opts[@]" \ + "$urwid_opts[@]" && return 0 + ;; + + bpython-gtk|bpython2-gtk|bpython3-gtk) + _arguments \ + "$all_opts[@]" \ + "$gtk_opts[@]" && return 0 + ;; +esac + + +# vim:autoindent expandtab shiftwidth=2 tabstop=2 softtabstop=2 filetype=zsh diff -Nru zsh-5.0.5/Completion/Unix/Command/_bzr zsh-5.0.7/Completion/Unix/Command/_bzr --- zsh-5.0.5/Completion/Unix/Command/_bzr 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_bzr 2014-10-07 18:11:30.000000000 +0000 @@ -25,7 +25,7 @@ (( $+functions[_bzr_unknownFiles] )) || _bzr_unknownFiles() { local fileList - fileList=(${(ps:\0:)"$(bzr ls --null --unknown)"}) + fileList=(${(ps:\0:)"$(bzr ls --null --unknown -R)"}) compadd -af fileList return 0 } @@ -41,7 +41,15 @@ (( $+functions[_bzr_versionedFiles] )) || _bzr_versionedFiles() { local fileList - fileList=(${(ps:\0:)"$(bzr ls --null --versioned)"}) + fileList=(${(ps:\0:)"$(bzr ls --null --versioned -R)"}) + compadd -af fileList + return 0 +} + +(( $+functions[_bzr_modifiedFiles] )) || +_bzr_modifiedFiles() { + local fileList + fileList=(${(ps:\0:)"$(bzr status . --versioned --short | cut -b 5- | tr '\n' '\0')"}) compadd -af fileList return 0 } @@ -214,7 +222,7 @@ '--unchanged[include unchanged files]' '(-q --quiet -v --verbose)'{--quiet,-q}'[be quiet]' '(-v --verbose -q --quiet)'{--verbose,-v}'[display more information]' - '*:modified files:_bzr_versionedFiles' + '*:modified files:_bzr_modifiedFiles' ) ;; @@ -300,7 +308,7 @@ args+=( '--no-backup[skip generation of backup~ files]' '(-r --revision)'{--revision=,-r}'[revision]:revision:' - '*:file:_bzr_versionedFiles' + '*:file:_bzr_modifiedFiles' ) ;; diff -Nru zsh-5.0.5/Completion/Unix/Command/_chsh zsh-5.0.7/Completion/Unix/Command/_chsh --- zsh-5.0.5/Completion/Unix/Command/_chsh 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_chsh 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,40 @@ +#compdef chsh chpass +case $OSTYPE in +(darwin*|*bsd*) + _arguments : \ + '-s[Specify user login shell]:shell:(${(Z+Cn+)"$(&/dev/null + then + local -a opts shells + shells=( $(=chsh -l) ) + _arguments : \ + "(-)-s[Specify your login shell]:shell:($shells)" \ + "(-)--shell[Specify your login shell]:shell:($shells)" \ + "(-)-l[Print shells in /etc/shells]" \ + "(-)--list-shells[Print shells in /etc/shells]" \ + "(-)-u[Print a usage message and exit]" \ + "(-)--help[Print a usage message and exit]" \ + "(-)-v[Print version information and exit]" \ + "(-)--version[Print version information and exit]" \ + "1:user name:_users" + return + fi + # else fall through + ;& +(*) + local s='' + # Use $s to cause all options to be treated as mutually exclusive + [[ $words[CURRENT-1] = -* ]] && s="(-)$words[CURRENT-1]" + # This fiddling with $s is a hack to cause "_arguments : --" to use + # the /etc/shells listing for -s or --shell even when the description + # of that option has been pulled from the GNU --help output. + [[ $words[CURRENT-1] = (-s|--shell) ]] && + s="$s"'[ ]:shell:(${(Z+Cn+)"$(groups' \ + '(-f --file)'{-f,--file}'[use the file as list of machines]:file:_files' \ + '(-r --remoteshell)'{-r,--remoteshell}'[execute using shell]:remote shell:(rsh ssh)' \ + '(-o --remoteshellopt)'{-o,--remoteshellopt}'[option to give to remote shell ]:option' \ + '(-)'{-h,--help}'[display help information]' \ + '(-w --wait-shell -c --concurrent-shell)'{-w,--wait-shell}'[sequentially execute shell]' \ + '(-c --concurrent-shell -w --wait-shell)'{-c,--concurrent-shell}'[execute shell concurrently]' \ + '(-F --forklimit)'{-F,--forklimit}'[concurrent with limit on number]:fork limit' \ + '(-)'{-V,--version}'[display version information]' \ + '*::args: _normal' && return + +if [[ $state = groups ]]; then + if ! zstyle -s ":completion:$curcontext:dsh-groups" dsh-groups grp; then + [[ -e ~/.dsh/group ]] && grp="~/.dsh/group" || return 1 + fi + _path_files -W ~/.dsh/group && return +fi + +return 1 diff -Nru zsh-5.0.5/Completion/Unix/Command/_dvi zsh-5.0.7/Completion/Unix/Command/_dvi --- zsh-5.0.5/Completion/Unix/Command/_dvi 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_dvi 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,4 @@ -#compdef dvips dvibook dviconcat dvicopy dvidvi dviselect dvitodvi dvitype +#compdef dvips dvibook dviconcat dvicopy dvidvi dvipdf dviselect dvitodvi dvitype local expl args diff -Nru zsh-5.0.5/Completion/Unix/Command/_gcc zsh-5.0.7/Completion/Unix/Command/_gcc --- zsh-5.0.5/Completion/Unix/Command/_gcc 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_gcc 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,6 @@ #compdef gcc g++ cc c++ llvm-gcc llvm-g++ clang clang++ -value-,LDFLAGS,-default- -value-,CFLAGS,-default- -value-,CPPFLAGS,-default- -local curcontext="$curcontext" state line ret=1 expl args args2 +local curcontext="$curcontext" state line ret=1 expl args args2 march typeset -A opt_args if [[ "$service" = -value-* ]]; then @@ -76,7 +76,7 @@ -mpowerpc-gpopt -mno-powerpc-gpopt -mpowerpc-gfxopt -mno-powerpc-gfxopt -mnew-mnemonics -mno-new-mnemonics - -mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc + -mfull-toc -mminimal-toc -mno-fop-in-toc -mno-sum-in-toc -msoft-float -mhard-float -mmultiple -mno-multiple -mstring -mno-string -mbit-align -mno-bit-align -mstrict-align -mno-strict-align -mrelocatable -mno-relocatable @@ -110,34 +110,118 @@ ) ;; i[3456]86|x86_64) + march="native i386 i486 i586 pentium pentium-mmx pentiumpro i686 pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona core2 corei7 corei7-avx core-avx-i core-avx2 atom k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx k8-sse3 opteron-sse3 athlon64-sse3 amdfam10 barcelona bdver1 bdver2 bdver3 btver1 btver2 winchip-c6 winchip2 c3 c3-2 geode" args=( - '-mtune=:CPU type:(i386 i486 i586 pentium pentium-mmx i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx winchip-c6 winchip2 c3 c3-2)' - '-march=:CPU type:(i386 i486 i586 pentium pentium-mmx i686 pentiumpro pentium2 pentium3 pentium3m pentium-m pentium4 pentium4m prescott nocona k6 k6-2 k6-3 athlon athlon-tbird athlon-4 athlon-xp athlon-mp k8 opteron athlon64 athlon-fx winchip-c6 winchip2 c3 c3-2)' - '-mfpmath=:FPU type:(387 sse sse,387)' - '-masm=:asm dialect:(att intel)' - -mieee-fp -mno-ieee-fp -msoft-float - -mno-fp-ret-in-387 -mno-fancy-math-387 - -malign-double -mno-align-double - -m128bit-long-double -m96bit-long-double - -msvr3-shlib -mno-svr3-shlib - -mrtd - '-mregparm=:number of integer argument registers:' - '-mpreferred-stack-boundary=:size of boundary:' - -mmmx -msse -msse2 -msse3 -m3dnow - -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow - -mpush-args -mno-push-args -maccumulate-outgoing-args + '-mtune=-[tune code for CPU type]:CPU type:('"$march"')' + '-march=-[generate instructions for CPU type]:CPU type:('"generic $march"')' -mthreads - -mno-align-stringops -minline-all-stringops - -momit-leaf-frame-pointer - -mtls-direct-seg-refs -mno-tls-direct-seg-refs - -m32 -m64 - -mno-red-zone - '-mcmodel=:memory model:(small kernel medium large)' - -mno-wide-multiply '-mreg-alloc=:default register allocation order:' - '-malign-jumps=: **2 base for jump goal alignment:' - '-malign-loops=: **2 base for loop alignment:' - '-malign-functions=: **2 base for function alignment:' + + # arguments with options + '-mabi=-[Generate code that conforms to the given ABI]:abi:(ms sysv)' + '-maddress-mode=-[Use given address mode]:address mode:(short long)' + '-malign-functions=-[Function starts are aligned to this power of 2]: **2 base for function alignment: ' + '-malign-jumps=-[Jump targets are aligned to this power of 2]: **2 base for jump goal alignment: ' + '-malign-loops=-[Loop code aligned to this power of 2]: **2 base for loop alignment: ' + '-masm=-[Use given assembler dialect]:asm dialect:(att intel)' + '-mbranch-cost=-[Branches are this expensive (1-5, arbitrary units)]:branch cost (1-5): ' + '-mcmodel=-[Use given x86-64 code model]:memory model:(32 small kernel medium large)' + '-mfpmath=-[Generate floating point mathematics using given instruction set]:FPU type:(387 sse sse,387 both)' + '-mincoming-stack-boundary=-[Assume incoming stack aligned to this power of 2]:assumed size of boundary: ' + '-mlarge-data-threshold=-[Data greater than given threshold will go into .ldata section in x86-64 medium model]:threshold: ' + '-mpreferred-stack-boundary=-[Attempt to keep stack aligned to this power of 2]:size of boundary: ' + '-mregparm=-[Number of registers used to pass integer arguments]:number of integer argument registers: ' + '-mstringop-strategy=-[Chose strategy to generate stringop using]:stringop strategy:(byte_loop libcall loop rep_4byte rep_8byte rep_byte unrolled_loop)' + '-mtls-dialect=-[Use given thread-local storage dialect]:TLS dialect:(gnu gnu2)' + '-mveclibabi=-[Vector library ABI to use]:vector library ABI:(acml svml)' + + # arguments without options + '-m3dnow[Support 3DNow! built-in functions]' + '-m8bit-idiv[Expand 32bit/64bit integer divide into 8bit unsigned integer divide with run-time check]' + '-m32[Generate 32bit i386 code]' + '-m64[Generate 64bit x86-64 code]' + '-m96bit-long-double[sizeof(long double) is 12]' + '-m128bit-long-double[sizeof(long double) is 16]' + '-m80387[Use hardware fp]' + '-mabm[Support code generation of Advanced Bit Manipulation (ABM) instructions]' + '-maccumulate-outgoing-args[Reserve space for outgoing arguments in the function prologue]' + '-madx[Support flag-preserving add-carry instructions]' + '-maes[Support AES built-in functions and code generation]' + '-malign-double[Align some doubles on dword boundary]' + '-malign-stringops[Align destination of the string operations]' + '-mandroid[Generate code for the Android platform]' + '-mavx2[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and AVX2 built-in functions and code generation]' + '-mavx256-split-unaligned-load[Split 32-byte AVX unaligned load]' + '-mavx256-split-unaligned-store[Split 32-byte AVX unaligned store]' + '-mavx[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2 and AVX built-in functions and code generation]' + '-mbionic[Use Bionic C library]' + '-mbmi2[Support BMI2 built-in functions and code generation]' + '-mbmi[Support BMI built-in functions and code generation]' + '-mcld[Generate cld instruction in the function prologue]' + '-mcrc32[Support code generation of crc32 instruction]' + '-mcx16[Support code generation of cmpxchg16b instruction]' + '-mdispatch-scheduler[Do dispatch scheduling if processor is bdver1 or bdver2 or bdver3 and Haifa scheduling is selected]' + '-mf16c[Support F16C built-in functions and code generation]' + '-mfancy-math-387[Generate sin, cos, sqrt for FPU]' + '-mfentry[Emit profiling counter call at function entry before prologue]' + '-mfma4[Support FMA4 built-in functions and code generation ]' + '-mfma[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX and FMA built-in functions and code generation]' + '-mforce-drap[Always use Dynamic Realigned Argument Pointer (DRAP) to realign stack]' + '-mfp-ret-in-387[Return values of functions in FPU registers]' + '-mfsgsbase[Support FSGSBASE built-in functions and code generation]' + '-mfxsr[Support FXSAVE and FXRSTOR instructions]' + '-mglibc[Use GNU C library]' + '-mhard-float[Use hardware fp]' + '-mhle[Support Hardware Lock Elision prefixes]' + '-mieee-fp[Use IEEE math for fp comparisons]' + '-minline-all-stringops[Inline all known string operations]' + '-minline-stringops-dynamically[Inline memset/memcpy string operations, but perform inline version only for small blocks]' + '-mlong-double-64[Use 64-bit long double]' + '-mlong-double-80[Use 80-bit long double]' + '-mlwp[Support LWP built-in functions and code generation ]' + '-mlzcnt[Support LZCNT built-in function and code generation]' + '-mmmx[Support MMX built-in functions]' + '-mmovbe[Support code generation of movbe instruction]' + '-mms-bitfields[Use native (MS) bitfield layout]' + '-mno-sse4[Do not support SSE4.1 and SSE4.2 built-in functions and code generation]' + '-momit-leaf-frame-pointer[Omit the frame pointer in leaf functions]' + '-mpc32[Set 80387 floating-point precision to 32-bit]' + '-mpc64[Set 80387 floating-point precision to 64-bit]' + '-mpc80[Set 80387 floating-point precision to 80-bit]' + '-mpclmul[Support PCLMUL built-in functions and code generation]' + '-mpopcnt[Support code generation of popcnt instruction]' + '-mprefer-avx128[Use 128-bit AVX instructions instead of 256-bit AVX instructions in the auto-vectorizer]' + '-mprfchw[Support PREFETCHW instruction]' + '-mpush-args[Use push instructions to save outgoing arguments]' + '-mrdrnd[Support RDRND built-in functions and code generation]' + '-mrdseed[Support RDSEED instruction]' + '-mrecip[Generate reciprocals instead of divss and sqrtss]' + '-mred-zone[Use red-zone in the x86-64 code]' + '-mrtd[Alternate calling convention]' + '-mrtm[Support RTM built-in functions and code generation]' + '-msahf[Support code generation of sahf instruction in 64bit x86-64 code]' + '-msoft-float[Do not use hardware fp]' + '-msse2[Support MMX, SSE and SSE2 built-in functions and code generation]' + '-msse2avx[Encode SSE instructions with VEX prefix]' + '-msse3[Support MMX, SSE, SSE2 and SSE3 built-in functions and code generation]' + '-msse4.1[Support MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1 built-in functions and code generation]' + '-msse4.2[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' + '-msse4[Support MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1 and SSE4.2 built-in functions and code generation]' + '-msse4a[Support MMX, SSE, SSE2, SSE3 and SSE4A built-in functions and code generation]' + '-msse[Support MMX and SSE built-in functions and code generation]' + '-msseregparm[Use SSE register passing conventions for SF and DF mode]' + '-mssse3[Support MMX, SSE, SSE2, SSE3 and SSSE3 built-in functions and code generation]' + '-mstack-arg-probe[Enable stack probing]' + '-mstackrealign[Realign stack in prologue]' + '-mtbm[Support TBM built-in functions and code generation]' + '-mtls-direct-seg-refs[Use direct references against %gs when accessing tls data]' + '-muclibc[Use uClibc C library]' + '-mvect8-ret-in-mem[Return 8-byte vectors in memory]' + '-mvzeroupper[Generate vzeroupper instruction before a transfer of control flow out of the function]' + '-mx32[Generate 32bit x86-64 code]' + '-mxop[Support XOP built-in functions and code generation ]' + '-mxsave[Support XSAVE and XRSTOR instructions]' + '-mxsaveopt[Support XSAVEOPT instruction]' ) ;; hppa*) @@ -222,90 +306,635 @@ ) fi +local -a languages +languages=( + c c-header cpp-output + c++ c++-header c++-cpp-output + objective-c objective-c-header objective-c-cpp-output + objective-c++ objective-c++-header objective-c++-cpp-output + assembler assembler-with-cpp + ada + f77 f77-cpp-input f95 f95-cpp-input + go + java +) + +# generic options (from --help) +args+=( + -a -C -H -P -s + '-###[print commands to run this compilation]' + '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' + '-x[Specify the language of the following input files]:input file language:('"$languages"')' + '+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' + '-d-:dump:->dump' + '-g-::debugging information type or level:(0 1 2 3 gdb coff stabs stabs+ dwarf dwarf+ dwarf-2 dwarf-3 dwarf-4 xcoff xcoff+)' + '-O-::optimization level:((0 1 2 3 g\:optimize\ for\ debugging\ experience s\:optimize\ for\ space fast\:optimize\ for\ speed\ disregarding\ exact\ standards\ compliance))' + '*-M-::output dependencies:((M\:only\ user\ header\ files MD\:output\ to\ file G\:treat\ missing\ header\ files\ as\ generated))' + '*-A-:define assertion:' + '*-D-:define macro:' + '*-U-:undefine macro:' + '-E[Preprocess only; do not compile, assemble or link]' + '-S[Compile only; do not assemble or link]' + '-c[Compile and assemble, but do not link]' + '*-Wp,-:preprocessor option:' + '*-Wl,-:linker option:' + '*-Xpreprocessor:preprocessor option:' + '*-Xlinker:linker option:' + '*-Xassembler:assembler option:' + '*-u:pretend symbol to be undefined:' + '*-Wa,-:assembler option:' + '*-l:library:->library' + '*-L-:library search path:_files -/' + '*-I-:header file search path:_files -/' + '-B-[Add to the compiler'\''s search paths]:executable prefix:_files -/' + '-b:target machine:' + '-V:specify compiler version:' + '--version[Display compiler version information]' + '-print-file-name=-[Display the full path to library ]:library:->library' + '-print-prog-name=-[Display the full path to compiler component ]:program:' + '*-specs=-[Override built-in specs with the contents of ]:file:_files' + '-std=-[Assume that the input sources are for ]:standard:(c90 c89 c99 c11 gnu90 gnu89 gnu99 gnu11 c++98 c++03 gnu++98 gnu++03 c++11 gnu++11 c++1y gnu++1y)' + '*-include:include file:_files -g \*.h\(-.\)' + '*-imacros:macro input file:_files -g \*.h\(-.\)' + '*-idirafter:second include path directory:_files -/' + '*-iprefix:prefix:_files' + '*-iwithprefix:second include path directory:_files -/' + '*-iwithprefixbefore:main include path directory:_files -/' + '*-isystem:second include path directory (system):_files -/' + '--sysroot=-[Use as the root directory for headers and libraries]:directory:_files -/' + '-pass-exit-codes[Exit with highest error code from a phase]' + '*--help=-[Display this information]:class:->help' + '--target-help[Display target specific command line options]' + '-dumpspecs[Display all of the built in spec strings]' + '-dumpversion[Display the version of the compiler]' + '-dumpmachine[Display the compiler'\''s target processor]' + '-print-search-dirs[Display the directories in the compiler'\''s search path]' + '-print-libgcc-file-name[Display the name of the compiler'\''s companion library]' + '-print-multiarch[Display the target'\''s normalized GNU triplet, used as a component in the library path]' + '-print-multi-directory[Display the root directory for versions of libgcc]' + '-print-multi-lib[Display the mapping between command line options and multiple library search directories]' + '-print-multi-os-directory[Display the relative path to OS libraries]' + '-print-sysroot[Display the target libraries directory]' + '-print-sysroot-headers-suffix[Display the sysroot suffix used to find headers]' + '-save-temps[Do not delete intermediate files]' + '-no-canonical-prefixes[Do not canonicalize paths when building relative prefixes to other gcc components]' + '-pipe[Use pipes rather than intermediate files]' + '-pie[Create a position independent executable]' + '-shared[Create a shared library]' + '-time[Time the execution of each subprocess]' +) -_arguments -C -M 'L:|-{fW}no-=-{fW} r:|[_-]=* r:|=*' \ +# warnings (from --help=warnings), note some -W options are listed by --help=common instead +args+=( +# --help=warnings,^joined + '-W[This switch is deprecated; use -Wextra instead]' + '-Wabi-tag[Warn if a subobject has an abi_tag attribute that the complete object type does not have]' + '-Wabi[Warn about things that will change when compiling with an ABI-compliant compiler]' + '-Waddress[Warn about suspicious uses of memory addresses]' + '-Waggregate-return[Warn about returning structures, unions or arrays]' + '-Waggressive-loop-optimizations[Warn if a loop with constant number of iterations triggers undefined behavior]' + '-Waliasing[Warn about possible aliasing of dummy arguments]' + '-Walign-commons[Warn about alignment of COMMON blocks]' + '-Wall[Enable most warning messages]' + '-Wampersand[Warn about missing ampersand in continued character constants]' + '-Warray-bounds[Warn if an array is accessed out of bounds]' + '-Warray-temporaries[Warn about creation of array temporaries]' + '-Wassign-intercept[Warn whenever an Objective-C assignment is being intercepted by the garbage collector]' + '-Wattributes[Warn about inappropriate attribute usage]' + '-Wbad-function-cast[Warn about casting functions to incompatible types]' + '-Wbuiltin-macro-redefined[Warn when a built-in preprocessor macro is undefined or redefined]' + '-Wc++-compat[Warn about C constructs that are not in the common subset of C and C++]' + '-Wc++0x-compat[Deprecated in favor of -Wc++11-compat]' + '-Wc++11-compat[Warn about C++ constructs whose meaning differs between ISO C++ 1998 and ISO C++ 2011]' + '-Wc-binding-type[Warn if the type of a variable might be not interoperable with C]' + '-Wcast-align[Warn about pointer casts which increase alignment]' + '-Wcast-qual[Warn about casts which discard qualifiers]' + '-Wchar-subscripts[Warn about subscripts whose type is "char"]' + '-Wcharacter-truncation[Warn about truncated character expressions]' + '-Wclobbered[Warn about variables that might be changed by "longjmp" or "vfork"]' + '-Wcomment[Warn about possibly nested block comments, and C++ comments spanning more than one physical line]' + '-Wcomments[Synonym for -Wcomment]' + '-Wcompare-reals[Warn about equality comparisons involving REAL or COMPLEX expressions]' + '-Wconversion-extra[Warn about most implicit conversions]' + '-Wconversion-null[Warn for converting NULL from/to a non-pointer type]' + '-Wconversion[Warn for implicit type conversions that may change a value]' + '-Wcoverage-mismatch[Warn in case profiles in -fprofile-use do not match]' + '-Wcpp[Warn when a #warning directive is encountered]' + '-Wctor-dtor-privacy[Warn when all constructors and destructors are private]' + '-Wdeclaration-after-statement[Warn when a declaration is found after a statement]' + '-Wdelete-non-virtual-dtor[Warn about deleting polymorphic objects with non- virtual destructors]' + '-Wdeprecated-declarations[Warn about uses of __attribute__((deprecated)) declarations]' + '-Wdeprecated[Warn if a deprecated compiler feature, class, method, or field is used]' + '-Wdisabled-optimization[Warn when an optimization pass is disabled]' + '-Wdiv-by-zero[Warn about compile-time integer division by zero]' + '-Wdouble-promotion[Warn about implicit conversions from "float" to "double"]' + '-Weffc++[Warn about violations of Effective C++ style rules]' + '-Wempty-body[Warn about an empty body in an if or else statement]' + '-Wendif-labels[Warn about stray tokens after #elif and #endif]' + '-Wenum-compare[Warn about comparison of different enum types]' +#this still exists but makes completing -Werror= less convenient + #'-Werror-implicit-function-declaration[This switch is deprecated; use -Werror=implicit-function-declaration instead]' + '-Wextra[Print extra (possibly unwanted) warnings]' + '-Wfloat-equal[Warn if testing floating point numbers for equality]' + '-Wformat-contains-nul[Warn about format strings that contain NUL bytes]' + '-Wformat-extra-args[Warn if passing too many arguments to a function for its format string]' + '-Wformat-nonliteral[Warn about format strings that are not literals]' + '-Wformat-security[Warn about possible security problems with format functions]' + '-Wformat-y2k[Warn about strftime formats yielding 2-digit years]' + '-Wformat-zero-length[Warn about zero-length formats]' + '-Wformat[Warn about printf/scanf/strftime/strfmon format string anomalies]' + '-Wfree-nonheap-object[Warn when attempting to free a non-heap object]' + '-Wfunction-elimination[Warn about function call elimination]' + '-Wignored-qualifiers[Warn whenever type qualifiers are ignored]' + '-Wimplicit-function-declaration[Warn about implicit function declarations]' + '-Wimplicit-int[Warn when a declaration does not specify a type]' + '-Wimplicit-interface[Warn about calls with implicit interface]' + '-Wimplicit-procedure[Warn about called procedures not explicitly declared]' + '-Wimplicit[Warn about implicit declarations]' + '-Winherited-variadic-ctor[Warn about C++11 inheriting constructors when the base has a variadic constructor]' + '-Winit-self[Warn about variables which are initialized to themselves]' + '-Winline[Warn when an inlined function cannot be inlined]' + '-Wint-to-pointer-cast[Warn when there is a cast to a pointer from an integer of a different size]' + '-Wintrinsic-shadow[Warn if a user-procedure has the same name as an intrinsic]' + '-Wintrinsics-std[Warn on intrinsics not part of the selected standard]' + '-Winvalid-memory-model[Warn when an atomic memory model parameter is known to be outside the valid range]' + '-Winvalid-offsetof[Warn about invalid uses of the "offsetof" macro]' + '-Winvalid-pch[Warn about PCH files that are found but not used]' + '-Wjump-misses-init[Warn when a jump misses a variable initialization]' + '-Wline-truncation[Warn about truncated source lines]' + '-Wliteral-suffix[Warn when a string or character literal is followed by a ud-suffix which does not begin with an underscore]' + '-Wlogical-op[Warn when a logical operator is suspiciously always evaluating to true or false]' + '-Wlong-long[Do not warn about using "long long" when -pedantic]' + '-Wmain[Warn about suspicious declarations of "main"]' + '-Wmaybe-uninitialized[Warn about maybe uninitialized automatic variables]' + '-Wmissing-braces[Warn about possibly missing braces around initializers]' + '-Wmissing-declarations[Warn about global functions without previous declarations]' + '-Wmissing-field-initializers[Warn about missing fields in struct initializers]' + '-Wmissing-include-dirs[Warn about user-specified include directories that do not exist]' + '-Wmissing-parameter-type[Warn about function parameters declared without a type specifier in K&R-style functions]' + '-Wmissing-prototypes[Warn about global functions without prototypes]' + '-Wmudflap[Warn about constructs not instrumented by -fmudflap]' + '-Wmultichar[Warn about use of multi-character character constants]' + '-Wnarrowing[Warn about narrowing conversions within { } that are ill-formed in C++11]' + '-Wnested-externs[Warn about "extern" declarations not at file scope]' + '-Wnoexcept[Warn when a noexcept expression evaluates to false even though the expression can'\''t actually throw]' + '-Wnon-template-friend[Warn when non-templatized friend functions are declared within a template]' + '-Wnon-virtual-dtor[Warn about non-virtual destructors]' + '-Wnonnull[Warn about NULL being passed to argument slots marked as requiring non-NULL]' + '-Wold-style-cast[Warn if a C-style cast is used in a program]' + '-Wold-style-declaration[Warn for obsolescent usage in a declaration]' + '-Wold-style-definition[Warn if an old-style parameter definition is used]' + '-Woverflow[Warn about overflow in arithmetic expressions]' + '-Woverlength-strings[Warn if a string is longer than the maximum portable length specified by the standard]' + '-Woverloaded-virtual[Warn about overloaded virtual function names]' + '-Woverride-init[Warn about overriding initializers without side effects]' + '-Wpacked-bitfield-compat[Warn about packed bit-fields whose offset changed in GCC 4.4]' + '-Wpacked[Warn when the packed attribute has no effect on struct layout]' + '-Wpadded[Warn when padding is required to align structure members]' + '-Wparentheses[Warn about possibly missing parentheses]' + '-Wpedantic[Issue warnings needed for strict compliance to the standard]' + '-Wpmf-conversions[Warn when converting the type of pointers to member functions]' + '-Wpointer-arith[Warn about function pointer arithmetic]' + '-Wpointer-sign[Warn when a pointer differs in signedness in an assignment]' + '-Wpointer-to-int-cast[Warn when a pointer is cast to an integer of a different size]' + '-Wpoison-system-directories[Warn for -I and -L options using system directories if cross compiling]' + '-Wpragmas[Warn about misuses of pragmas]' + '-Wproperty-assign-default[Warn if a property for an Objective-C object has no assign semantics specified]' + '-Wprotocol[Warn if inherited methods are unimplemented]' + '-Wreal-q-constant[Warn about real-literal-constants with '\''q'\'' exponent-letter]' + '-Wrealloc-lhs-all[Warn when a left-hand-side variable is reallocated]' + '-Wrealloc-lhs[Warn when a left-hand-side array variable is reallocated]' + '-Wredundant-decls[Warn about multiple declarations of the same object]' + '-Wreorder[Warn when the compiler reorders code]' + '-Wreturn-local-addr[Warn about returning a pointer/reference to a local or temporary variable]' + '-Wreturn-type[Warn whenever a function'\''s return type defaults to "int" (C), or about inconsistent return types (C++)]' + '-Wselector[Warn if a selector has multiple methods]' + '-Wsequence-point[Warn about possible violations of sequence point rules]' + '-Wshadow[Warn when one local variable shadows another]' + '-Wsign-compare[Warn about signed-unsigned comparisons]' + '-Wsign-promo[Warn when overload promotes from unsigned to signed]' + '-Wstack-protector[Warn when not issuing stack smashing protection for some reason]' + '-Wstrict-null-sentinel[Warn about uncasted NULL used as sentinel]' + '-Wstrict-prototypes[Warn about unprototyped function declarations]' + '-Wstrict-selector-match[Warn if type signatures of candidate methods do not match exactly]' + '-Wsuggest-attribute=-[Warn about functions which might be candidates for __attribute__((const))]:const: ' + '-Wsurprising[Warn about "suspicious" constructs]' + '-Wswitch-default[Warn about enumerated switches missing a "default-" statement]' + '-Wswitch-enum[Warn about all enumerated switches missing a specific case]' + '-Wswitch[Warn about enumerated switches, with no default, missing a case]' + '-Wsync-nand[Warn when __sync_fetch_and_nand and __sync_nand_and_fetch built-in functions are used]' + '-Wsynth[Deprecated. This switch has no effect]' + '-Wsystem-headers[Do not suppress warnings from system headers]' + '-Wtabs[Permit nonconforming uses of the tab character]' + '-Wtarget-lifetime[Warn if the pointer in a pointer assignment might outlive its target]' + '-Wtraditional-conversion[Warn of prototypes causing type conversions different from what would happen in the absence of prototype]' + '-Wtraditional[Warn about features not present in traditional C]' + '-Wtrampolines[Warn whenever a trampoline is generated]' + '-Wtrigraphs[Warn if trigraphs are encountered that might affect the meaning of the program]' + '-Wtype-limits[Warn if a comparison is always true or always false due to the limited range of the data type]' + '-Wundeclared-selector[Warn about @selector()s without previously declared methods]' + '-Wundef[Warn if an undefined macro is used in an #if directive]' + '-Wunderflow[Warn about underflow of numerical constant expressions]' + '-Wuninitialized[Warn about uninitialized automatic variables]' + '-Wunknown-pragmas[Warn about unrecognized pragmas]' + '-Wunsafe-loop-optimizations[Warn if the loop cannot be optimized due to nontrivial assumptions]' + '-Wunsuffixed-float-constants[Warn about unsuffixed float constants]' + '-Wunused-but-set-parameter[Warn when a function parameter is only set, otherwise unused]' + '-Wunused-but-set-variable[Warn when a variable is only set, otherwise unused]' + '-Wunused-dummy-argument[Warn about unused dummy arguments]' + '-Wunused-function[Warn when a function is unused]' + '-Wunused-label[Warn when a label is unused]' + '-Wunused-local-typedefs[Warn when typedefs locally defined in a function are not used]' + '-Wunused-macros[Warn about macros defined in the main file that are not used]' + '-Wunused-parameter[Warn when a function parameter is unused]' + '-Wunused-result[Warn if a caller of a function, marked with attribute warn_unused_result, does not use its return value]' + '-Wunused-value[Warn when an expression value is unused]' + '-Wunused-variable[Warn when a variable is unused]' + '-Wunused[Enable all -Wunused- warnings]' + '-Wuseless-cast[Warn about useless casts]' + '-Wvarargs[Warn about questionable usage of the macros used to retrieve variable arguments]' + '-Wvariadic-macros[Warn about using variadic macros]' + '-Wvector-operation-performance[Warn when a vector operation is compiled outside the SIMD]' + '-Wvirtual-move-assign[Warn if a virtual base has a non-trivial move assignment operator]' + '-Wvla[Warn if a variable length array is used]' + '-Wvolatile-register-var[Warn when a register variable is declared volatile]' + '-Wwrite-strings[In C++, nonzero means warn about deprecated conversion from string literals to '\''char *'\''. In C, similar warning, except that the conversion is of course not deprecated by the ISO C standard]' + '-Wzero-as-null-pointer-constant[Warn when a literal '\''0'\'' is used as null pointer]' + '-frequire-return-statement[Functions which return values must end with return statements]' +# --help=warnings,joined + '-Wlarger-than=-[Warn if an object is larger than bytes]:number: ' + '-Wnormalized=-[Warn about non-normalised Unicode strings]:normalization:((id\:allow\ some\ non-nfc\ characters\ that\ are\ valid\ identifiers nfc\:only\ allow\ NFC nfkc\:only\ allow\ NFKC none\:allow\ any\ normalization)): ' + '-Wstack-usage=-[Warn if stack usage might be larger than specified amount]:stack usage: ' + '-Wstrict-aliasing=-[Warn about code which might break strict aliasing rules]:level of checking (higher is more accurate):(1 2 3)' + '-Wstrict-overflow=-[Warn about optimizations that assume that signed overflow is undefined]:level of checking (higher finds more cases):(1 2 3 4 5)' +# -W options from --help=common + '-Werror=-[Treat specified warning as error (or all if none specified)]:warning:->werror' + '-Wfatal-errors[Exit on the first error occurred]' + '-Wframe-larger-than=-[Warn if a function'\'\''s stack frame requires more than bytes]:number: ' +) +# optimizers (from --help=optimizers), except for -O +args+=( +# --help=optimizers,^joined + '-faggressive-loop-optimizations[Aggressively optimize loops using language constraints]' + '-falign-functions=-[Align the start of functions]:function alignment' + '-falign-jumps=-[Align labels which are only reached by jumping]:jump alignment' + '-falign-labels=-[Align all labels]:label alignment' + '-falign-loops=-[Align the start of loops]:loop alignment' + '-fasynchronous-unwind-tables[Generate unwind tables that are exact at each instruction boundary]' + '-fbranch-count-reg[Replace add, compare, branch with branch on count register]' + '-fbranch-probabilities[Use profiling information for branch probabilities]' + '-fbranch-target-load-optimize2[Perform branch target load optimization after prologue / epilogue threading]' + '-fbranch-target-load-optimize[Perform branch target load optimization before prologue / epilogue threading]' + '-fbtr-bb-exclusive[Restrict target load migration not to re-use registers in any basic block]' + '-fcaller-saves[Save registers around function calls]' + '-fcombine-stack-adjustments[Looks for opportunities to reduce stack adjustments and stack references]' + '-fcommon[Do not put uninitialized globals in the common section]' + '-fcompare-elim[Perform comparison elimination after register allocation has finished]' + '-fconserve-stack[Do not perform optimizations increasing noticeably stack usage]' + '-fcprop-registers[Perform a register copy-propagation optimization pass]' + '-fcrossjumping[Perform cross-jumping optimization]' + '-fcse-follow-jumps[When running CSE, follow jumps to their targets]' + '-fcx-fortran-rules[Complex multiplication and division follow Fortran rules]' + '-fcx-limited-range[Omit range reduction step when performing complex division]' + '-fdata-sections[Place data items into their own section]' + '-fdce[Use the RTL dead code elimination pass]' + '-fdefer-pop[Defer popping functions args from stack until later]' + '-fdelayed-branch[Attempt to fill delay slots of branch instructions]' + '-fdelete-null-pointer-checks[Delete useless null pointer checks]' + '-fdevirtualize[Try to convert virtual calls to direct ones]' + '-fdse[Use the RTL dead store elimination pass]' + '-fearly-inlining[Perform early inlining]' + '-fexceptions[Enable exception handling]' + '-fexpensive-optimizations[Perform a number of minor, expensive optimizations]' + '-ffinite-math-only[Assume no NaNs or infinities are generated]' + '-ffloat-store[Don'\''t allocate floats and doubles in extended- precision registers]' + '-fforward-propagate[Perform a forward propagation pass on RTL]' + '-fgcse-after-reload[Perform global common subexpression elimination after register allocation has finished]' + '-fgcse-las[Perform redundant load after store elimination in global common subexpression elimination]' + '-fgcse-lm[Perform enhanced load motion during global common subexpression elimination]' + '-fgcse-sm[Perform store motion after global common subexpression elimination]' + '-fgcse[Perform global common subexpression elimination]' + '-fgraphite-identity[Enable Graphite Identity transformation]' + '-fguess-branch-probability[Enable guessing of branch probabilities]' + '-fhandle-exceptions[This switch lacks documentation]' + '-fhoist-adjacent-loads[Enable hoisting adjacent loads to encourage generating conditional move instructions]' + '-fif-conversion2[Perform conversion of conditional jumps to conditional execution]' + '-fif-conversion[Perform conversion of conditional jumps to branchless equivalents]' + '-finline-atomics[Inline __atomic operations when a lock free instruction sequence is available]' + '-finline-functions-called-once[Integrate functions only required by their single caller]' + '-finline-functions[Integrate functions not declared "inline" into their callers when profitable]' + '-finline-small-functions[Integrate functions into their callers when code size is known not to grow]' + '-finline[Enable inlining of function declared "inline", disabling disables all inlining]' + '-fipa-cp-clone[Perform cloning to make Interprocedural constant propagation stronger]' + '-fipa-cp[Perform Interprocedural constant propagation]' + '-fipa-profile[Perform interprocedural profile propagation]' + '-fipa-pta[Perform interprocedural points-to analysis]' + '-fipa-pure-const[Discover pure and const functions]' + '-fipa-reference[Discover readonly and non addressable static variables]' + '-fipa-sra[Perform interprocedural reduction of aggregates]' + '-fira-hoist-pressure[Use IRA based register pressure calculation in RTL hoist optimizations]' + '-fivopts[Optimize induction variables on trees]' + '-fjump-tables[Use jump tables for sufficiently large switch statements]' + '-floop-block[Enable Loop Blocking transformation]' + '-floop-interchange[Enable Loop Interchange transformation]' + '-floop-nest-optimize[Enable the ISL based loop nest optimizer]' + '-floop-parallelize-all[Mark all loops as parallel]' + '-floop-strip-mine[Enable Loop Strip Mining transformation]' + '-fmath-errno[Set errno after built-in math functions]' + '-fmerge-all-constants[Attempt to merge identical constants and constant variables]' + '-fmerge-constants[Attempt to merge identical constants across compilation units]' + '-fmodulo-sched[Perform SMS based modulo scheduling before the first scheduling pass]' + '-fmove-loop-invariants[Move loop invariant computations out of loops]' + '-fno-threadsafe-statics[Do not generate thread-safe code for initializing local statics]' + '-fnon-call-exceptions[Support synchronous non-call exceptions]' + '-fnothrow-opt[Treat a throw() exception specification as noexcept to improve code size]' + '-fomit-frame-pointer[When possible do not generate stack frames]' + '-fopt-info[Enable all optimization info dumps on stderr]' + '-foptimize-register-move[Do the full register move optimization pass]' + '-foptimize-sibling-calls[Optimize sibling and tail recursive calls]' + '-foptimize-strlen[Enable string length optimizations on trees]' + '-fpack-struct[Pack structure members together without holes]' + '-fpeel-loops[Perform loop peeling]' + '-fpeephole2[Enable an RTL peephole pass before sched2]' + '-fpeephole[Enable machine specific peephole optimizations]' + '-fpredictive-commoning[Run predictive commoning optimization]' + '-fprefetch-loop-arrays[Generate prefetch instructions, if available, for arrays in loops]' + '-freg-struct-return[Return small aggregates in registers]' + '-fregmove[Enables a register move optimization]' + '-frename-registers[Perform a register renaming optimization pass]' + '-freorder-blocks-and-partition[Reorder basic blocks and partition into hot and cold sections]' + '-freorder-blocks[Reorder basic blocks to improve code placement]' + '-freorder-functions[Reorder functions to improve code placement]' + '-frerun-cse-after-loop[Add a common subexpression elimination pass after loop optimizations]' + '-freschedule-modulo-scheduled-loops[Enable/Disable the traditional scheduling in loops that already passed modulo scheduling]' + '-frounding-math[Disable optimizations that assume default FP rounding behavior]' + '-frtti[Generate run time type descriptor information]' + '-fsched-critical-path-heuristic[Enable the critical path heuristic in the scheduler]' + '-fsched-dep-count-heuristic[Enable the dependent count heuristic in the scheduler]' + '-fsched-group-heuristic[Enable the group heuristic in the scheduler]' + '-fsched-interblock[Enable scheduling across basic blocks]' + '-fsched-last-insn-heuristic[Enable the last instruction heuristic in the scheduler]' + '-fsched-pressure[Enable register pressure sensitive insn scheduling]' + '-fsched-rank-heuristic[Enable the rank heuristic in the scheduler]' + '-fsched-spec-insn-heuristic[Enable the speculative instruction heuristic in the scheduler]' + '-fsched-spec-load-dangerous[Allow speculative motion of more loads]' + '-fsched-spec-load[Allow speculative motion of some loads]' + '-fsched-spec[Allow speculative motion of non-loads]' + '-fsched2-use-superblocks[If scheduling post reload, do superblock scheduling]' + '-fschedule-insns2[Reschedule instructions after register allocation]' + '-fschedule-insns[Reschedule instructions before register allocation]' + '-fsection-anchors[Access data in the same section from shared anchor points]' + '-fsel-sched-pipelining-outer-loops[Perform software pipelining of outer loops during selective scheduling]' + '-fsel-sched-pipelining[Perform software pipelining of inner loops during selective scheduling]' + '-fsel-sched-reschedule-pipelined[Reschedule pipelined regions without pipelining]' + '-fselective-scheduling2[Run selective scheduling after reload]' + '-fselective-scheduling[Schedule instructions using selective scheduling algorithm]' + '-fshort-double[Use the same size for double as for float]' + '-fshort-enums[Use the narrowest integer type possible for enumeration types]' + '-fshort-wchar[Force the underlying type for "wchar_t" to be "unsigned short"]' + '-fshrink-wrap[Emit function prologues only before parts of the function that need it, rather than at the top of the function]' + '-fsignaling-nans[Disable optimizations observable by IEEE signaling NaNs]' + '-fsigned-zeros[Disable floating point optimizations that ignore the IEEE signedness of zero]' + '-fsingle-precision-constant[Convert floating point constants to single precision constants]' + '-fsplit-ivs-in-unroller[Split lifetimes of induction variables when loops are unrolled]' + '-fsplit-wide-types[Split wide types into independent registers]' + '-fstrict-aliasing[Assume strict aliasing rules apply]' + '-fstrict-enums[Assume that values of enumeration type are always within the minimum range of that type]' + '-fthread-jumps[Perform jump threading optimizations]' + '-ftoplevel-reorder[Reorder top level functions, variables, and asms]' + '-ftrapping-math[Assume floating-point operations can trap]' + '-ftrapv[Trap for signed overflow in addition, subtraction and multiplication]' + '-ftree-bit-ccp[Enable SSA-BIT-CCP optimization on trees]' + '-ftree-builtin-call-dce[Enable conditional dead code elimination for builtin calls]' + '-ftree-ccp[Enable SSA-CCP optimization on trees]' + '-ftree-ch[Enable loop header copying on trees]' + '-ftree-coalesce-inlined-vars[Enable coalescing of copy-related user variables that are inlined]' + '-ftree-coalesce-vars[Enable coalescing of all copy-related user variables]' + '-ftree-copy-prop[Enable copy propagation on trees]' + '-ftree-copyrename[Replace SSA temporaries with better names in copies]' + '-ftree-cselim[Transform condition stores into unconditional ones]' + '-ftree-dce[Enable SSA dead code elimination optimization on trees]' + '-ftree-dominator-opts[Enable dominator optimizations]' + '-ftree-dse[Enable dead store elimination]' + '-ftree-forwprop[Enable forward propagation on trees]' + '-ftree-fre[Enable Full Redundancy Elimination (FRE) on trees]' + '-ftree-loop-distribute-patterns[Enable loop distribution for patterns transformed into a library call]' + '-ftree-loop-distribution[Enable loop distribution on trees]' + '-ftree-loop-if-convert-stores[Also if-convert conditional jumps containing memory writes]' + '-ftree-loop-if-convert[Convert conditional jumps in innermost loops to branchless equivalents]' + '-ftree-loop-im[Enable loop invariant motion on trees]' + '-ftree-loop-ivcanon[Create canonical induction variables in loops]' + '-ftree-loop-optimize[Enable loop optimizations on tree level]' + '-ftree-lrs[Perform live range splitting during the SSA- >normal pass]' + '-ftree-partial-pre[In SSA-PRE optimization on trees, enable partial- partial redundancy elimination]' + '-ftree-phiprop[Enable hoisting loads from conditional pointers]' + '-ftree-pre[Enable SSA-PRE optimization on trees]' + '-ftree-pta[Perform function-local points-to analysis on trees]' + '-ftree-reassoc[Enable reassociation on tree level]' + '-ftree-scev-cprop[Enable copy propagation of scalar-evolution information]' + '-ftree-sink[Enable SSA code sinking on trees]' + '-ftree-slp-vectorize[Enable basic block vectorization (SLP) on trees]' + '-ftree-slsr[Perform straight-line strength reduction]' + '-ftree-sra[Perform scalar replacement of aggregates]' + '-ftree-switch-conversion[Perform conversions of switch initializations]' + '-ftree-tail-merge[Enable tail merging on trees]' + '-ftree-ter[Replace temporary expressions in the SSA->normal pass]' + '-ftree-vect-loop-version[Enable loop versioning when doing loop vectorization on trees]' + '-ftree-vectorize[Enable loop vectorization on trees]' + '-ftree-vrp[Perform Value Range Propagation on trees]' + '-funit-at-a-time[Compile whole compilation unit at a time]' + '-funroll-all-loops[Perform loop unrolling for all loops]' + '-funroll-loops[Perform loop unrolling when iteration count is known]' + '-funsafe-loop-optimizations[Allow loop optimizations to assume that the loops behave in normal way]' + '-funsafe-math-optimizations[Allow math optimizations that may violate IEEE or ISO standards]' + '-funswitch-loops[Perform loop unswitching]' + '-funwind-tables[Just generate unwind tables for exception handling]' + '-fvar-tracking-assignments-toggle[Toggle -fvar-tracking-assignments]' + '-fvar-tracking-assignments[Perform variable tracking by annotating assignments]' + '-fvar-tracking-uninit[Perform variable tracking and also tag variables that are uninitialized]' + '-fvar-tracking[Perform variable tracking]' + '-fvariable-expansion-in-unroller[Apply variable expansion when loops are unrolled]' + '-fvect-cost-model[Enable use of cost model in vectorization]' + '-fvpt[Use expression value profiles in optimizations]' + '-fweb[Construct webs and split unrelated uses of single variable]' + '-fwhole-program[Perform whole program optimizations]' + '-fwrapv[Assume signed arithmetic overflow wraps around]' +# --help=optimizers,joined + '-fpack-struct=-[Set initial maximum structure member alignment]:alignment: ' +) + +# other common options, gcc --help=warnings --help=optimizers --help=common|sed 1,/language-independent/d +args+=( +# | grep -v :: + '--debug[This switch lacks documentation]' + '--dump[This switch lacks documentation]' + '--dumpbase[This switch lacks documentation]' + '--dumpdir[This switch lacks documentation]' + '--help[Display this information]' + '--no-warnings[This switch lacks documentation]' + '--optimize[This switch lacks documentation]' + '--output[This switch lacks documentation]' + '--param[Set parameter to value. See manpage for a complete list of parameters]:name=value' + '--pedantic-errors[This switch lacks documentation]' + '--pedantic[This switch lacks documentation]' + '--profile[This switch lacks documentation]' + '--verbose[This switch lacks documentation]' + '--version[This switch lacks documentation]' + '-aux-info[Emit declaration information into ]:file:_files' + '-dumpbase[Set the file basename to be used for dumps]' + '-dumpdir[Set the directory name to be used for dumps]' + '-fPIC[Generate position-independent code if possible (large mode)]' + '-fPIE[Generate position-independent code for executables if possible (large mode)]' + '-fassociative-math[Allow optimization for floating-point arithmetic which may change the result of the operation due to rounding]' + '-fauto-inc-dec[Generate auto-inc/dec instructions]' + '-fbounds-check[Generate code to check bounds before indexing arrays]' + '-fcall-saved--[Mark as being preserved across functions]:register' + '-fcall-used--[Mark as being corrupted by function calls]:register' + '-fcheck-data-deps[Compare the results of several data dependence analyzers]' + '-fcompare-debug-second[Run only the second compilation of -fcompare-debug]' + '-fcompare-debug=[Compile with and without e.g. -gtoggle, and compare the final-insns dump]:opts:' #TODO: complete gcc options here + '-fdbg-cnt-list[List all available debugging counters with their limits and counts]' + '-fdbg-cnt=[,-,...) Set the debug counter limit]:counter\:limit,...: ' #TODO: gcc -fdbg-cnt-list -x c /dev/null -o /dev/null -c + '-fdebug-types-section[Output .debug_types section when using DWARF v4 debuginfo]' + '-fdelete-dead-exceptions[Delete dead instructions that may throw exceptions]' + '-fdiagnostics-show-caret[Show the source line with a caret indicating the column]' + '-fdiagnostics-show-location=-[How often to emit source location at the beginning of line-wrapped diagnostics]:source location:(once every-line)' + '-fdiagnostics-show-option[Amend appropriate diagnostic messages with the command line option that controls them]' + #not meant for end users + #'-fdisable--pass=[disables an optimization pass]:range1+range2: ' + #'-fdisable-[disables an optimization pass]' + #'-fenable--pass=[enables an optimization pass]:range1+range2: ' + #'-fenable-[enables an optimization pass]' + #'-fdump-[Dump various compiler internals to a file]' + '-fdump-final-insns=-[Dump to filename the insns at the end of translation]:filename:_files' + '-fdump-go-spec=-[Write all declarations to file as Go code]:filename:_files' + '-fdump-noaddr[Suppress output of addresses in debugging dumps]' + '-fdump-passes[Dump optimization passes]' + '-fdump-unnumbered-links[Suppress output of previous and next insn numbers in debugging dumps]' + '-fdump-unnumbered[Suppress output of instruction numbers, line number notes and addresses in debugging dumps]' + '-fdwarf2-cfi-asm[Enable CFI tables via GAS assembler directives]' + '-feliminate-dwarf2-dups[Perform DWARF2 duplicate elimination]' + '-feliminate-unused-debug-symbols[Perform unused type elimination in debug info]' + '-feliminate-unused-debug-types[Perform unused type elimination in debug info]' + '-femit-class-debug-always[Do not suppress C++ class debug information]' + '-fexcess-precision=-[Specify handling of excess floating-point precision]:precision handling:(fast standard)' + '-ffast-math[Sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range]' + '-ffat-lto-objects[Output lto objects containing both the intermediate language and binary output]' + '-ffixed--[Mark as being unavailable to the compiler]:register' + '-ffunction-cse[Allow function addresses to be held in registers]' + '-ffunction-sections[Place each function into its own section]' + '-fgnu-tm[Enable support for GNU transactional memory]' + '-fgraphite[Enable in and out of Graphite representation]' + '-fident[Process #ident directives]' + '-findirect-inlining[Perform indirect inlining]' + '-finhibit-size-directive[Do not generate .size directives]' + '-finline-limit=[Limit the size of inlined functions to ]:number: ' + '-finstrument-functions[Instrument function entry and exit with profiling calls]' + '-fira-loop-pressure[Use IRA based register pressure calculation in RTL loop optimizations]' + '-fira-share-save-slots[Share slots for saving different hard registers]' + '-fira-share-spill-slots[Share stack slots for spilled pseudo-registers]' + '-fira-verbose=[Control IRA'\''s level of diagnostic messages]:verbosity: ' + '-fkeep-inline-functions[Generate code for functions even if they are fully inlined]' + '-fkeep-static-consts[Emit static const variables even if they are not used]' + '-fleading-underscore[Give external symbols a leading underscore]' + '-flto-compression-level=[Use zlib compression level for IL]:compression level: ' + '-flto-partition=[Partition symbols and vars at linktime based on object files they originate from]:partitioning algorithm:(1to1 balanced max)' + '-flto-report[Report various link-time optimization statistics]' + '-flto[Enable link-time optimization]' + '-fmax-errors=-[Maximum number of errors to report]:errors: ' + '-fmem-report-wpa[Report on permanent memory allocation in WPA only]' + '-fmem-report[Report on permanent memory allocation]' + '-fmerge-debug-strings[Attempt to merge identical debug strings across compilation units]' + '-fmessage-length=-[Limit diagnostics to characters per line. 0 suppresses line-wrapping]:length: ' + '-fmodulo-sched-allow-regmoves[Perform SMS based modulo scheduling with register moves allowed]' + '-fopt-info-type=-[Dump compiler optimization details]:filename:_files' + '-fopt-info[Dump compiler optimization details]' + '-fpartial-inlining[Perform partial inlining]' + '-fpcc-struct-return[Return small aggregates in memory, not registers]' + '-fpic[Generate position-independent code if possible (small mode)]' + '-fpie[Generate position-independent code for executables if possible (small mode)]' + '-fplugin-arg--[Specify argument = for plugin ]:-fplugin-arg-name-key=value: ' #TODO + '-fpost-ipa-mem-report[Report on memory allocation before interprocedural optimization]' + '-fpre-ipa-mem-report[Report on memory allocation before interprocedural optimization]' + '-fprofile-arcs[Insert arc-based program profiling code]' + '-fprofile-correction[Enable correction of flow inconsistent profile data input]' + '-fprofile-generate[Enable common options for generating profile info for profile feedback directed optimizations]' + '-fprofile-report[Report on consistency of profile]' + '-fprofile-use[Enable common options for performing profile feedback directed optimizations]' + '-fprofile-values[Insert code to profile values of expressions]' + '-fprofile[Enable basic program profiling code]' + '-frandom-seed=-[Use as random seed]:seed: ' + '-freciprocal-math[Same as -fassociative-math for expressions which include division]' + '-frecord-gcc-switches[Record gcc command line switches in the object file]' + '-free[Turn on Redundant Extensions Elimination pass]' + '-fsanitize=-[Enable AddressSanitizer, a memory error detector]:style:(address thread)' + '-fsched-stalled-insns-dep=-[Set dependence distance checking in premature scheduling of queued insns]:instructions: ' + '-fsched-stalled-insns=-[Set number of queued insns that can be prematurely scheduled]:instructions: ' + '-fsched-verbose=-[Set the verbosity level of the scheduler]:verbosity: ' + '-fshow-column[Show column numbers in diagnostics, when available]' + '-fsplit-stack[Generate discontiguous stack frames]' + '-fstack-check=-[Insert stack checking code into the program. -fstack-check=specific if to argument given]:type:(none generic specific)' + '-fstack-limit-register=-[Trap if the stack goes past ]:register: ' + '-fstack-limit-symbol=-[Trap if the stack goes past symbol ]:name: ' + '-fno-stack-limit' + '-fstack-protector-all[Use a stack protection method for every function]' + '-fstack-protector[Use propolice as a stack protection method]' + '-fstack-usage[Output stack usage information on a per-function basis]' + '-fstrict-overflow[Treat signed overflow as undefined]' + '-fstrict-volatile-bitfields[Force bitfield accesses to match their type width]' + '-fsync-libcalls[Implement __atomic operations via libcalls to legacy __sync functions]' + '-fsyntax-only[Check for syntax errors, then stop]' + '-ftest-coverage[Create data files needed by "gcov"]' + '-ftime-report[Report the time taken by each compiler pass]' + '-ftls-model=-[Set the default thread-local storage code generation model]:TLS model:(global-dynamic local-dynamic initial-exec local-exec)' + '-ftracer[Perform superblock formation via tail duplication]' + '-ftree-loop-linear[Enable loop interchange transforms. Same as -floop-interchange]' + '-fuse-ld=[Use the specified linker instead of the default linker]:linker:(bfd gold)' + '-fuse-linker-plugin[Use linker plugin during link-time optimization]' + '-fverbose-asm[Add extra commentary to assembler output]' + '-fvisibility=[Set the default symbol visibility]:visibility:(default internal hidden protected)' + '-fzero-initialized-in-bss[Put zero initialized data in the bss section]' + '-gno-pubnames[Don'\''t generate DWARF pubnames and pubtypes sections]' + '-gno-record-gcc-switches[Don'\''t record gcc command line switches in DWARF DW_AT_producer]' + '-gno-split-dwarf[Don'\''t generate debug information in separate .dwo files]' + '-gno-strict-dwarf[Emit DWARF additions beyond selected version]' + '-gpubnames[Generate DWARF pubnames and pubtypes sections]' + '-grecord-gcc-switches[Record gcc command line switches in DWARF DW_AT_producer]' + '-gsplit-dwarf[Generate debug information in separate .dwo files]' + '-gstrict-dwarf[Don'\''t emit DWARF additions beyond selected version]' + '-gtoggle[Toggle debug information generation]' + '-gvms[Generate debug information in VMS format]' + '-imultiarch[Set to be the multiarch include subdirectory]:directory:_files -/' #XXX not in manpage + '-iplugindir=[Set to be the default plugin directory]:directory:_files -/' + '(-pg)-p[Enable function profiling for prof]' + '(-p)-pg[Enable function profiling for gprof]' + '-pedantic-errors[Like -pedantic but issue them as errors]' + '-pedantic[Issue all mandatory diagnostics in the C standard]' + '-quiet[Do not display functions compiled or elapsed time]' + '-v[Enable verbose output]' + '-version[Display the compiler'\''s version]' + '-w[Suppress warnings]' +# | grep :: + '-fabi-version=-[Use version of the C++ ABI (default: 2)]:ABI version:(1 2 3 4 5 6)' + '-fdebug-prefix-map=-[Map one directory name to another in debug information]:/old/dir=/new/dir:->dirtodir' + '-ffp-contract=-[Perform floating- point expression contraction (default: fast)]:style:(on off fast)' + '-finstrument-functions-exclude-file-list=-[Do not instrument functions listed in files]:comma-separated file list:->commafiles' + '-finstrument-functions-exclude-function-list=-[Do not instrument listed functions]:comma-separated list of syms: ' + '-fira-algorithm=-[Set the used IRA algorithm]:algorithm:(priority CB)' + '-fira-region=-[Set regions for IRA]:region:(all mixed one)' + '-fplugin=-[Specify a plugin to load]:plugin: ' # TODO: complete plugins? + '-fprofile-dir=-[Set the top-level directory for storing the profile data]:profile directory:_files -/' + '-fstack-reuse=-[Set stack reuse level for local variables]:reuse-level:(all named_vars none)' + '-ftree-parallelize-loops=-[Enable automatic parallelization of loops]:threads: ' +) + +# How to mostly autogenerate the above stuff: +# joinhelplines() { sed '$!N;s/^\( -.*\)\n \s*\([^-]\)/\1 \2/;P;D' } +# gcc-x86() { gcc --help=target,\^undocumented | joinhelplines | joinhelplines } +# compdef _gnu_generic gcc-x86 +# printf '%s\n' ${(onq-)_args_cache_gcc_x86} +_arguments -C -M 'L:|-{fWm}no-=-{fWm} r:|[_-]=* r:|=*' \ "$args[@]" \ - -c -S -E -v -a -w -C -H -P -s '(-pg)-p' '(-p)-pg' \ - '-###[print commands to run this compilation]' \ - '-o:output file:_files -g "^*.(c|h|cc|C|cxx)(-.)"' \ - '-x:input file language:(c objective-c c++ c-header cpp-output c++-cpp-output assembler assembler-with-cpp none)' \ - '+e-:virtual function definitions in classes:((0\:only\ interface 1\:generate\ code))' \ - '-d-:dump:->dump' \ - '-g-::debugging information type:(gdb coff stabs stabs+ dwarf dwarf+ xcoff xcoff+)' \ - '-O-::optimization level:(0 1 2 3)' \ - '*-M-::output dependencies:((M\:only\ user\ header\ files MD\:output\ to\ file G\:treat\ missing\ header\ files\ as\ generated))' \ - '*-A-:define assertion:' \ - '*-D-:define macro:' \ - '*-U-:undefine macro:' \ - '*-Wp,-:preprocessor option:' \ - '*-Wl,-:linker option:' \ - '*-Xpreprocessor:preprocessor option:' \ - '*-Xlinker:linker option:' \ - '*-u:pretend symbol to be undefined:' \ - '*-Wa,-:assembler option:' \ - '*-l:library:->library' \ - '*-L-:library search path:_files -/' \ - '*-I-:header file search path:_files -/' \ - '-B-:executable prefix:_files -/' \ - '-b:target machine:' \ - '-V:specify compiler version:' \ - '--version' \ - '-print-file-name=:library:->library' \ - '-print-prog-name=:program:' \ - '*-include:include file:_files -g \*.h\(-.\)' \ - '*-imacros:macro input file:_files -g \*.h\(-.\)' \ - '*-idirafter:second include path directory:_files -/' \ - '*-iprefix:prefix:_files' \ - '*-iwithprefix:second include path directory:_files -/' \ - '*-iwithprefixbefore:main include path directory:_files -/' \ - '*-isystem:second include path directory (system):_files -/' \ - -nostdinc -trigraphs -undef -pipe -ansi \ - -fallow-single-precision -fcond-mismatch -fasm \ - -fbuiltin -fsigned-bitfields -fsigned-char \ - -funsigned-bitfields -funsigned-char -fwritable-strings \ - -traditional -traditional-cpp -trigraphs \ - -fall-virtual -fdollars-in-identifiers -felide-constructors \ - -fenum-int-equiv -fexternal-templates -ffor-scope \ - -fhandle-signatures -fmemoize-lookups -fdefault-inline -fgnu-keywords \ - -fnonnull-objects -foperator-names -fstrict-prototype \ - -fthis-is-variable -nostdinc++ -traditional \ - -fsyntax-only -pedantic -pedantic-errors \ - -Wall -Waggregate-return -Wbad-function-cast \ - -Wcast-align -Wcast-qual -Wchar-subscript -Wcomment \ - -Wconversion -Wenum-clash -Werror -Wformat \ - '-Wid-clash--:minimum identifier difference length:' \ - -Wimplicit -Wimport -Winline \ - '-Wlarger-than--:maximum object length:' \ - -Wmissing-declarations \ - -Wmissing-prototypes -Wnested-externs \ - -Wimport -Woverloaded-virtual -Wparentheses \ - -Wpointer-arith -Wredundant-decls -Wreorder -Wreturn-type -Wshadow \ - -Wstrict-prototypes -Wswitch -Wsynth -Wtemplate-debugging \ - -Wtraditional -Wtrigraphs -Wuninitialized -Wunused \ - -Wwrite-strings \ - -fpretend-float \ - -print-libgcc-file-name \ - -print-search-dirs -save-temps \ - -fcaller-saves -fcse-follow-jumps -fcse-skip-blocks \ - -fdelayed-branch -fexpensive-optimizations \ - -ffast-math -ffloat-store -fforce-addr -fforce-mem \ - -finline-functions -fkeep-inline-functions \ - -fdefault-inline -fdefer-pop -ffunction-cse \ - -finline -fpeephole -fomit-frame-pointer \ - -frerun-cse-after-loop -fschedule-insns \ - -fschedule-insns2 -fstrength-reduce -fthread-jumps \ - -funroll-all-loops -funroll-loops \ - -nostartfiles -nodefaultlibs -nostdlib \ - -static -shared -symbolic \ - '*-fcall-saved--:register saved by function call:' \ - '*-fcall-used--:register clobbered by function call:' \ - '*-ffixed--:fixed register:' \ - -finhibit-size-directive \ - -fno-common -fno-ident -fno-gnu-linker \ - -fpcc-struct-return -fpic -fPIC \ - -freg-struct-return -fshared-data -fshort-enums \ - -fshort-double -fvolatile -fvolatile-global \ - -fverbose-asm -fpack-struct \ "$args2[@]" && ret=0 @@ -342,7 +971,22 @@ rundir) compset -P '*:' compset -S ':*' - _files -/ -S/ -r '\n\t\- /:' "$@" + _files -/ -S/ -r '\n\t\- /:' "$@" && ret=0 + ;; +help) + _values -s , 'help' \ + optimizers warnings target params common \ + c c++ objc objc++ lto ada adascil adawhy fortran go java \ + {\^,}undocumented {\^,}joined {\^,}separate \ + && ret=0 + ;; +dirtodir) + compset -P '*=' + _files -/ && ret=0 + ;; +commafiles) + compset -P '*,' + _files && ret=0 ;; esac diff -Nru zsh-5.0.5/Completion/Unix/Command/_git zsh-5.0.7/Completion/Unix/Command/_git --- zsh-5.0.5/Completion/Unix/Command/_git 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_git 2014-10-07 18:11:30.000000000 +0000 @@ -104,6 +104,8 @@ # undocumented (and not implemented here). _arguments -S \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit message]' \ + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ '(-k --keep)'{-k,--keep}'[pass -k to git mailinfo]' \ '--keep-non-patch[pass -b to git mailinfo]' \ '( --no-keep-cr)--keep-cr[pass --keep-cr to git mailsplit]' \ @@ -405,8 +407,9 @@ '(-q --quiet)'{-q,--quiet}'[do not output anything, just set exit status]' \ '(-v --verbose)'{-v,--verbose}'[output details about the matching pattern (if any) for each pathname]' \ '--stdin[read file names from stdin instead of from the command-line]' \ - '-z[make output format machine-parseable]' \ + '-z[make output format machine-parseable and treat input-paths as NUL-separated with --stdin]' \ '(-n --non-matching)'{-n,--non-matching}'[show given paths which do not match any pattern]' \ + '--no-index[do not look in the index when undertaking the checks]' \ '*:: :->file' && ret=0 } @@ -422,7 +425,7 @@ # and perhaps also allow all that just with ^{tree} and so on. Not quite sure # how to do that, though. local new_branch_reflog_opt - if (( words[(I)-b|-B] )); then + if (( words[(I)-b|-B|--orphan] )); then new_branch_reflog_opt="(--patch)-l[create the new branch's reflog]" fi @@ -434,12 +437,13 @@ '(-f --force -m --merge --conflict --patch)'{-f,--force}'[force branch switch/ignore unmerged entries]' \ '(-q --quiet --theirs --patch)--ours[check out stage #2 for unmerged paths]' \ '(-q --quiet --ours --patch)--theirs[check out stage #3 for unmerged paths]' \ - '( -B --orphan --ours --theirs --conflict --patch)-b[create a new branch based at given commit]: :__git_branch_names' \ - '(-b --orphan --ours --theirs --conflict --patch)-B[create or update branch based at given commit]: :__git_branch_names' \ - '(-t --track --orphan --patch)'{-t,--track}'[set up configuration so pull merges from the base commit]' \ + '( -B --orphan --ours --theirs --conflict --patch --detach)-b[create a new branch based at given commit]: :__git_branch_names' \ + '(-b --orphan --ours --theirs --conflict --patch --detach)-B[create or update branch based at given commit]: :__git_branch_names' \ + '(-t --track --orphan --patch --detach)'{-t,--track}'[set up configuration so pull merges from the base commit]' \ '(--patch)--no-track[override the branch.autosetupmerge configuration variable]' \ $new_branch_reflog_opt \ - '(-b -B -t --track --patch)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \ + '(-b -B -t --track --patch --orphan)--detach[detach the HEAD at named commit]' \ + '(-b -B -t --track --patch --detach)--orphan[create a new orphan branch based at given commit]: :__git_branch_names' \ '--ignore-skip-worktree-bits[ignores patterns and adds back any files in ]' \ '(-q --quiet -f --force -m --merge --conflict --patch)'{-m,--merge}'[3way merge current branch, working tree and new branch]' \ '(-q --quiet -f --force -m --merge --patch)--conflict[same as --merge, using given merge style]:style:(merge diff3)' \ @@ -461,7 +465,7 @@ tree_ish_arg='tree-ishs::__git_tree_ishs' \ file_arg='modified-files::__git_modified_files' - if [[ -n ${opt_args[(I)-b|-B|--orphan]} ]]; then + if [[ -n ${opt_args[(I)-b|-B|--orphan|--detach]} ]]; then remote_branch_noprefix_arg= tree_ish_arg= file_arg= @@ -480,7 +484,7 @@ $remote_branch_noprefix_arg \ $tree_ish_arg \ $file_arg && ret=0 - elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan]} ]]; then + elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan|--detach]} ]]; then _nothing elif [[ -n $line[1] ]] && __git_is_treeish $line[1]; then __git_ignore_line __git_tree_files ${PREFIX:-.} $line[1] && ret=0 @@ -506,10 +510,12 @@ '(-m --mainline)'{-m,--mainline}'[specify mainline when cherry-picking a merge commit]:parent number' \ '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actually commit]' \ '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]' \ '(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if possible]' \ - ': :__git_revisions' + ': :__git_commit_ranges' } (( $+functions[_git-citool] )) || @@ -661,6 +667,7 @@ '--cleanup=[specify how the commit message should be cleaned up]:mode:((verbatim\:"do not change the commit message at all" whitespace\:"remove leading and trailing whitespace lines" strip\:"remove both whitespace and commentary lines" + scissors\:"same as whitespace but cut from scissor line" default\:"act as '\''strip'\'' if the message is to be edited and as '\''whitespace'\'' otherwise"))' \ '(-e --edit --no-edit)'{-e,--edit}'[edit the commit message before committing]' \ '(-e --edit --no-edit)--no-edit[do not edit the commit message before committing]' \ @@ -675,7 +682,8 @@ '--dry-run[only show list of paths that are to be commited or not, and any untracked]' \ '( --no-status)--status[include the output of git status in the commit message template]' \ '(--status )--no-status[do not include the output of git status in the commit message template]' \ - '(-S --gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ '(-a --all --interactive -o --only -i --include *)--interactive[interactively update paths in the index file]' \ '*: :__git_ignore_line_inside_arguments __git_changed_files' \ - '(message)' \ @@ -722,63 +730,74 @@ case $state in (from-to-file) + # If "--" is part of $opt_args, this means it was specified before any + # $words arguments. This means that no heads are specified in front, so + # we need to complete *changed* files only. + if [[ -n ${opt_args[(I)--]} ]]; then + if [[ -n ${opt_args[(I)--cached|--staged]} ]]; then + __git_changed-in-index_files && ret=0 + else + __git_changed-in-working-tree_files && ret=0 + fi + return ret + fi + + # Otherwise, more complex conditions need to be checked. case $CURRENT in (1) - if [[ -n ${opt_args[(I)--]} ]]; then - if [[ -n ${opt_args[(I)--cached|--staged]} ]]; then - __git_changed-in-index_files && ret=0 - else - __git_changed-in-working-tree_files && ret=0 - fi - else - local files_alt='files::__git_changed-in-working-tree_files' - - if [[ -n ${opt_args[(I)--cached|--staged]} ]]; then - files_alt='files::__git_changed-in-index_files' - fi - - _alternative \ - 'commit-ranges::__git_commit_ranges' \ - 'blobs-and-trees-in-treeish::__git_blobs_and_trees_in_treeish' \ - $files_alt \ - 'blobs::__git_blobs ' && ret=0 + local files_alt='files::__git_changed-in-working-tree_files' + if [[ -n ${opt_args[(I)--cached|--staged]} ]]; then + files_alt='files::__git_changed-in-index_files' fi + + _alternative \ + 'commit-ranges::__git_commit_ranges' \ + 'blobs-and-trees-in-treeish::__git_blobs_and_trees_in_treeish' \ + $files_alt \ + 'blobs::__git_blobs ' && ret=0 ;; (2) + # Check if first argument is something special. In case of committish ranges and committishs offer a full list compatible completions. if __git_is_committish_range $line[1]; then + # Example: git diff branch1..branch2 __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 elif __git_is_committish $line[1] || __git_is_treeish $line[1]; then - if [[ -n ${opt_args[(I)--]} ]]; then - __git_changed-in-working-tree_files && ret=0 - else - _alternative \ - 'commits::__git_commits' \ - 'blobs-and-trees-in-treeish::__git_blobs_and_trees_in_treeish' \ - 'files::__git_changed-in-working-tree_files' && ret=0 - fi + # Example: git diff branch1 + _alternative \ + 'commits::__git_commits' \ + 'blobs-and-trees-in-treeish::__git_blobs_and_trees_in_treeish' \ + 'files::__git_tree_files ${PREFIX:-.} HEAD' && ret=0 elif __git_is_blob $line[1]; then - if [[ -n ${opt_args[(I)--]} ]]; then - __git_cached_files && ret=0 - else - _alternative \ - 'files::__git_cached_files' \ - 'blobs::__git_blobs' && ret=0 - fi + _alternative \ + 'files::__git_cached_files' \ + 'blobs::__git_blobs' && ret=0 elif [[ -n ${opt_args[(I)--cached|--staged]} ]]; then + # Example: git diff --cached file1 __git_changed-in-index_files && ret=0 else + # Example: git diff file1 __git_changed-in-working-tree_files && ret=0 fi ;; (*) if __git_is_committish_range $line[1]; then + # Example: git diff branch1..branch2 file1 __git_tree_files ${PREFIX:-.} $(__git_committish_range_last $line[1]) && ret=0 elif { __git_is_committish $line[1] && __git_is_committish $line[2] } || __git_is_treeish $line[2]; then + # Example: git diff branch1 branch2 __git_tree_files ${PREFIX:-.} $line[2] && ret=0 + elif __git_is_committish $line[1] || __git_is_treeish $line[1]; then + # Example: git diff branch file1 + # Example: git diff branch -- f + __git_tree_files ${PREFIX:-.} HEAD && ret=0 elif __git_is_blob $line[1] && __git_is_blob $line[2]; then _nothing + elif [[ -n ${opt_args[(I)--cached|--staged]} ]]; then + # Example: git diff --cached file1 file2 + __git_changed-in-index_files && ret=0 else + # Example: git diff file1 file2 __git_changed-in-working-tree_files && ret=0 fi ;; @@ -857,8 +876,9 @@ '*--add-header=[add an arbitrary header to email headers]:header' \ '--cover-letter[generate a cover letter template]' \ '--notes=[append notes for the commit after the three-dash line]:: :__git_notes_refs' \ - '( --no-signature)--signature=[add a signature]:signature' \ - '(--signature )--no-signature[do not add a signature]' \ + '( --no-signature --signature-file)--signature=[add a signature]:signature' \ + '(--signature --signature-file)--no-signature[do not add a signature]' \ + '(--signature --no-signature )--signature-file=[use contents of file as signature]' \ '--suffix=[use the given suffix for filenames]:filename suffix' \ '--quiet[suppress the output of the names of generated files]' \ '--no-binary[do not output contents of changes in binary files, only note that they differ]' \ @@ -911,6 +931,8 @@ '(--no-exclude-standard)--exclude-standard[exclude files standard ignore mechanisms]' \ '--untracked[search in untracked files]' \ '(-a --text)'{-a,--text}'[process binary files as if they were text]' \ + '(--textconv --no-textconv)--textconv[honor textconv filter settings]' \ + '(--textconv --no-textconv)--no-textconv[do not honor textconv filter settings]' \ '(-i --ignore-case)'{-i,--ignore-case}'[ignore case when matching]' \ '-I[do not match pattern in binary files]' \ '--max-depth=[descend at most given levels of directories]: :__git_guard_number depth' \ @@ -1230,8 +1252,10 @@ _arguments \ $merge_options \ - '( --no-rebase)--rebase[perform a rebase after fetching]' \ - '(--rebase )--no-rebase[do not perform a rebase after fetching]' \ + '(-r --rebase --no-rebase)'{-r=-,--rebase=-}'[perform a rebase after fetching]::rebase after fetching:((true\:"rebase after fetching" + false\:"merge after fetching" + preserve\:"rebase and preserve merges"))' \ + '(-r --rebase )--no-rebase[do not perform a rebase after fetching]' \ $fetch_options \ ': :__git_any_repositories' \ '*: :__git_ref_specs' @@ -1239,6 +1263,7 @@ (( $+functions[_git-push] )) || _git-push () { + local ret=1 # NOTE: For --receive-pack we use _files to complete, even though this will # only complete files on the local end, not the remote end. Still, it may be # helpful to get some sort of completion going, perhaps modifying the path @@ -1253,9 +1278,11 @@ '--tags[all tags under refs/tags are pushed]' \ '--follow-tags[also push missing annotated tags reachable from the pushed refs]' \ '(--receive-pack --exec)'{--receive-pack=-,--exec=-}'[path to git-receive-pack on remote]:remote git-receive-pack:_files' \ + '(--force-with-lease --no-force-with-lease)*--force-with-lease=-[allow refs that are not ancestors to be updated if current ref matches expected value]::ref and expectation:->lease' \ + '(--force-with-lease --no-force-with-lease)--no-force-with-lease=-[cancel all previous force-with-lease specifications]' \ '(-f --force)'{-f,--force}'[allow refs that are not ancestors to be updated]' \ '(:)--repo=[default repository to use]:repository:__git_any_repositories' \ - '(-u --set-upstream-to)'{-u,--set-upstream-to}'[add upstream reference for each branch that is up to date or pushed]' \ + '(-u --set-upstream)'{-u,--set-upstream}'[add upstream reference for each branch that is up to date or pushed]' \ '( --no-thin)--thin[try to minimize number of objects to be sent]' \ '(--thin )--no-thin[do not try to minimize number of objects to be sent]' \ '(-q --quiet -v --verbose --progress)'{-q,--quiet}'[suppress all output]' \ @@ -1265,7 +1292,20 @@ '--recurse-submodules=[submodule handling]:submodule handling:((check\:"refuse pushing of supermodule if submodule commit cannot be found on the remote" on-demand\:"push all changed submodules"))' \ ':: :__git_any_repositories' \ - '*: :__git_ref_specs' + '*: :__git_ref_specs' && ret=0 + + case $state in + (lease) + compset -P '*:' + if [[ -n ${IPREFIX#*=} ]]; then + _guard '[[:xdigit:]]#' "expected value" && ret=0 + else + __git_remote_branch_names_noprefix && ret=0 + fi + ;; + esac + + return ret } (( $+functions[_git-rebase] )) || @@ -1284,6 +1324,8 @@ '--keep-empty[keep empty commits in the result]' \ '(- :)--skip[skip the current patch]' \ '(-m --merge)'{-m,--merge}'[use merging strategies to rebase]' \ + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' \ '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]' \ '(-q --quiet -v --verbose --stat -n --no-stat)'{-q,--quiet}'[suppress all output]' \ @@ -1300,6 +1342,8 @@ {-x,--exec}'[with -i\: append "exec " after each line]:command' \ '(1)--root[rebase all reachable commits]' \ $autosquash_opts \ + '(--autostash --no-autostash)--autostash[stash uncommitted changes before rebasing and apply them afterwards]' \ + '(--autostash --no-autostash)--no-autostash[do not stash uncommitted changes before rebasing and apply them afterwards]' \ '--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \ '--onto[start new branch with HEAD equal to given revision]:newbase:__git_revisions' \ ':upstream branch:__git_revisions' \ @@ -1314,6 +1358,7 @@ _arguments -w -C -s \ '( --mixed --hard --merge --keep -p --patch -- *)--soft[do not touch the index file nor the working tree]' \ '(--soft --hard --merge --keep -p --patch -- *)--mixed[reset the index but not the working tree (default)]' \ + '(--soft --hard --merge --keep -p --patch -- *)-N[keep --intent-to-add entries in the index]' \ '(--soft --mixed --merge --keep -p --patch -- *)--hard[match the working tree and index to the given tree]' \ '(--soft --mixed --hard --keep -p --patch -- *)--merge[reset out of a conflicted merge]' \ '(--soft --mixed --hard --merge -p --patch -- *)--keep[like --hard, but keep local working tree changes]' \ @@ -1347,6 +1392,8 @@ '(-m --mainline)'{-m+,--mainline=}'[pick which parent is mainline]:parent number' \ '(-n --no-commit)'{-n,--no-commit}'[do not commit the reversion]' \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ ': :__git_commits' } @@ -1501,7 +1548,7 @@ '(--keep-index )--no-keep-index[all changes already added to the index are undone]' \ '(-q --quiet)'{-q,--quiet}'[suppress all output]' \ '(-u --include-untracked)'{-u,--include-untracked}'[include untracked files]' \ - '::message' && ret=0 + ':: :_guard "([^-]?#|)" message' && ret=0 ;; (list) local -a log_options revision_options @@ -1556,7 +1603,7 @@ _git-status () { local -a branch_opts - if (( $words[(I)-s|--short] )); then + if (( $words[(I)-s|--short|--porcelain|-z] )); then branch_opts=('(-b --branch)'{-b,--branch}'[show branch and tracking info]') fi @@ -1717,11 +1764,13 @@ '*:: :__git_ignore_line_inside_arguments __git_tags' \ - listing \ '-n+[limit line output of annotation]: :__git_guard_number "limit"' \ - '-l[list tags matching pattern]' \ + '(-l --list)'{-l,--list}'[list tags matching pattern]' \ '(--no-column)--column=-[display tag listing in columns]::column.tag option:((always\:"always show in columns" never\:"never show in columns" auto\:"show in columns if the output is to the terminal" column\:"fill columns before rows (default)" row\:"fill rows before columns" plain\:"show in one column" dense\:"make unequal size columns to utilize more space" nodense\:"make equal size columns"))' \ '(--column)--no-column[do not display in columns]' \ '--contains=[only list tags which contain the specified commit]: :__git_commits' \ '--points-at=[only list tags of the given object]: :__git_commits' \ + '--sort=[specify how the tags should be sorted]:mode:((refname\:"lexicographic order" + version\\\:refname\:"tag names are treated as version numbers"))' \ '::pattern' \ - verification \ '-v[verifies gpg signutare of tags]' \ @@ -1855,7 +1904,7 @@ core.packedGitWindowSize:'size of mappings of pack files:pack window size:->bytes' core.packedGitLimit:'maximum number of bytes to map from pack files:maximum pack file map size:->bytes' core.precomposeunicode:'revert the unicode decomposition of filenames done by Mac OS::->bool:false' - core.deltaBaseCacheLimit:'maximum size of cache for base objects:maximum base objects cache size:->bytes:16m' + core.deltaBaseCacheLimit:'maximum size of cache for base objects:maximum base objects cache size:->bytes:96m' core.bigFileThreshold:'maximum size of files to compress:maximum compress size:->bytes:512m' core.excludesfile:'additional file to use for exclusion:excludes file:_files' core.askpass:'program to use for asking for passwords:password command:_path_commands' @@ -1863,7 +1912,7 @@ core.pager:'pager to use for paginating output:pager:_path_commands' core.whitespace:'list of common whitespace problems to notice::->core.whitespace' core.fsyncobjectfiles:'fsync() when writing object files::->bool:false' - core.preloadindex:'use parallel index preload for operations like git diff::->bool:false' + core.preloadindex:'use parallel index preload for operations like git diff::->bool:true' core.createObject:'take steps to prevent overwriting existing objects::->core.createObject:link' core.checkstat:'determine which stat fields to match between the index and work tree::->core.checkstat:default' core.notesRef:'show notes in given refs:refs:->string:refs/notes/commits' @@ -1889,13 +1938,13 @@ 'browser.*.cmd:browser command to use:browser:_path_commands' 'browser.*.path:path to use for the browser:absolute browser path:_files -g "*(*)"' clean.requireForce:'require --force for git clean to actually do something::->bool:true' - color.branch:'color output of git branch::->color-bool' + color.branch:'color output of git branch::->color-bool:false' color.branch.current:'color of the current branch::->color' color.branch.local:'color of a local branch::->color' color.branch.remote:'color of a remote branch::->color' color.branch.upstream:'color of upstream branches::->color' color.branch.plain:'color of other branches::->color' - color.diff:'color output of git diff::->color-bool' + color.diff:'color output of git diff::->color-bool:false' color.diff.plain:'color of context text::->color' color.diff.meta:'color of meta-information::->color' color.diff.frag:'color of hunk headers::->color' @@ -1909,7 +1958,7 @@ color.decorate.tag:'color of tags::->color' color.decorate.stash:'color of stashes::->color' color.decorate.HEAD:'color of HEAD::->color' - color.grep:'whether or not to color output of git grep::->color-bool' + color.grep:'whether or not to color output of git grep::->color-bool:false' color.grep.context:'color of non-matching text in context lines::->color' color.grep.filename:'color of filename prefix::->color' color.grep.function:'color of function name lines::->color' @@ -1917,14 +1966,14 @@ color.grep.match:'color of matching text::->color' color.grep.selected:'color of non-matching text in selected lines::->color' color.grep.separator:'color of separators between fields in a line::->color' - color.interactive:'whether or not to color in interactive mode::->color-bool' + color.interactive:'whether or not to color in interactive mode::->color-bool:false' color.interactive.prompt:'color of prompt::->color' color.interactive.header:'color of header::->color' color.interactive.help:'color of help::->color' color.interactive.error:'color of error::->color' color.pager:'feed colored output to pager::->bool:true' - color.showbranch:'color output of git show-branch::->color-bool' - color.status:'color output of git status::->color-bool' + color.showbranch:'color output of git show-branch::->color-bool:false' + color.status:'color output of git status::->color-bool:false' color.status.branch:'color of the current branch::->color' color.status.header:'color of header text::->color' color.status.added:'color of added, but not yet committed, files::->color' @@ -1932,8 +1981,9 @@ color.status.changed:'color of changed, but not yet added in the index, files::->color' color.status.untracked:'color of files not currently being tracked::->color' color.status.nobranch:'color of no-branch warning::->color' - color.ui:'color output of capable git commands::->color-bool' + color.ui:'color output of capable git commands::->color-bool:auto' commit.cleanup:'default --cleanup option::->commit.cleanup:default' + commit.gpgsign:'always GPG-sign commits::->bool:false' commit.status:'include status information in commit message template::->bool:true' commit.template:'template file for commit messages:template:_files' 'diff.*.binary:make the diff driver treat files as binary::->bool:false' @@ -1949,6 +1999,7 @@ diff.external:'command to generate diff with:diff command:_path_commands' diff.mnemonicprefix:'use mnemonic source and destination prefixes::->bool:false' diff.noprefix:'strip source and destination prefixes::->bool:false' + diff.orderfile:'file to read patch order glob patterns from:order file:_files' diff.renameLimit:'number of files to consider when detecting copy/renames:rename limit:->int' diff.renames:'try to detect renames::->diff.renames:true' diff.ignoreSubmodules:'ignore submodules::->bool:false' @@ -1961,6 +2012,7 @@ 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' + fetch.prune:'remove any remote tracking branches that no longer exist remotely::->bool:false' fetch.unpackLimit:'maximum number of objects to unpack when fetching:unpack limit:->int' fetch.recurseSubmodules:'recurse into submodules (as needed) when fetching::->fetch.recurseSubmodules:on-demand' fetch.fsckObjects:'check all fetched objects::->bool:false' @@ -1980,6 +2032,7 @@ format.signoff:'enable --signoff by default::->bool:false' 'gc.*.reflogexpire:grace period for git reflog expire::->days:90' 'gc.*.reflogexpireunreachable:grace period for git reflog expire for unreachable entries::->days:30' + gc.aggressiveDepth:'maximum delta depth:maximum delta depth::->int:250' gc.aggressiveWindow:'window size used in delta compression algorithm::->int:250' gc.auto:'minimum limit for packing loose objects with --auto::->int:6700' gc.autopacklimit:'minimum limit for packing packs with --auto::->int:50' @@ -2040,16 +2093,18 @@ guitool.title:'title of prompt dialog:prompt title:->string' guitool.prompt:'prompt to display:prompt:->string' grep.extendedRegexp:'enable --extended-regexp option by default (ignored when grep.patternType is set)::->bool:false' + grep.fullname:'enable --full-name option by default::->bool:false' grep.lineNumber:'enable -n option by default::->bool:false' grep.patternType:'default matching pattern type::->grep.patternType:default' help.browser:'browser used to display help in web format::__git_browsers' - http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files' help.htmlpath:'location of HTML help::->help.htmlpath' + http.cookiefile:'file containing cookie lines which should be used in the Git http session::_files' http.lowSpeedLimit:'limit controlling when to abort an HTTP transfer:speed limit:->int' http.lowSpeedTime:'limit controlling when to abort an HTTP transfer:time limit (seconds):->int' help.format:'default help format used by git help::->help.format' help.autocorrect:'execute corrected mistyped commands::->bool:false' http.proxy:'HTTP proxy to use:proxy:_urls' + http.savecookies:'save cookies to the cookie file::->bool:false' http.sslVerify:'verify the SSL certificate for HTTPS::->bool:true' http.sslCert:'file containing SSL certificates for HTTPS:SSL certificate file:_files' http.sslKey:'file containing the SSL private key for HTTPS:SSL private key file:_files' @@ -2067,6 +2122,30 @@ http.getanyfile:'allow clients to read any file within repository::->bool:true' http.uploadpack:'serve git fetch-pack and git ls-remote clients::->bool:true' http.receivepack:'serve git send-pack clients::->bool:true' + 'http.*.cookiefile:file containing cookie lines which should be used in the Git http session::_files' + 'http.*.lowSpeedLimit:limit controlling when to abort an HTTP transfer:speed limit:->int' + 'http.*.lowSpeedTime:limit controlling when to abort an HTTP transfer:time limit (seconds):->int' + 'help.*.format:default help format used by git help::->help.format' + 'help.*.autocorrect:execute corrected mistyped commands::->bool:false' + 'http.*.proxy:HTTP proxy to use:proxy:_urls' + 'http.*.savecookies:save cookies to the cookie file::->bool:false' + 'http.*.sslVerify:verify the SSL certificate for HTTPS::->bool:true' + 'http.*.sslCert:file containing SSL certificates for HTTPS:SSL certificate file:_files' + 'http.*.sslKey:file containing the SSL private key for HTTPS:SSL private key file:_files' + 'http.*.sslCertPasswordProtected:prompt for a password for the SSL certificate::->bool:false' + 'http.*.sslCAInfo:file containing CA certificates to verify against for HTTPS:CA certificates file:_files' + 'http.*.sslCAPath:directory containing files with CA certificates to verify against for HTTPS:CA certificates directory:_directories' + 'http.*.sslTry:attempt to use AUTH SSL/TLS and encrypted data transfers when connecting via regular FTP protocol::->bool:false' + 'http.*.maxRequests:how many HTTP requests to launch in parallel:maximum number of requests::->int:5' + 'http.*.minSessions:number of curl sessions to keep across requests:minimum number of sessions::->int:1' + 'http.*.postBuffer:maximum size of buffer used by smart HTTP transport when POSTing:maximum POST buffer size:->bytes:1m' + 'http.*.lowSpeedLimit:lower limit for HTTP transfer-speed:low transfer-speed limit:->int' + 'http.*.lowSpeedTime:duration for http.lowSpeedLimit:time:->int' + 'http.*.noEPSV:disable the use of the EPSV ftp-command::->bool:false' + 'http.*.useragent:user agent presented to HTTP server:user agent string:->string' + 'http.*.getanyfile:allow clients to read any file within repository::->bool:true' + 'http.*.uploadpack:serve git fetch-pack and git ls-remote clients::->bool:true' + 'http.*.receivepack:serve git send-pack clients::->bool:true' i18n.commitEncoding:'character encoding commit messages are stored in::->encoding' i18n.logOutputEncoding:'character encoding commit messages are output in::->encoding' imap.folder:'IMAP folder to use with git imap-send:IMAP folder name::_mailboxes' @@ -2099,7 +2178,7 @@ 'man.*.path:path to use for the man viewer:absolute man tool path:_files -g "*(*)"' 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:false' + merge.defaultToUpstream:'merge the upstream branches configured for the current branch by default::->bool:true' merge.ff:'allow fast-forward merges::->merge.ff:true' merge.log:'include summaries of merged commits in new merge commit messages::->bool:false' merge.renameLimit:'number of files to consider when detecting copy/renames during merge:limit:->int' @@ -2130,12 +2209,14 @@ pack.threads:'number of threads to use for searching for best delta matches:number of threads:->int' pack.indexVersion:'default pack index version:index version:->string' pack.packSizeLimit:'maximum size of packs:maximum size of packs:->bytes' + pull.ff:'accept fast-forwards only::->bool:false' pull.octopus:'default merge strategy to use when pulling multiple branches::__git_merge_strategies' - pull.rebase:'rebase branches on top of the fetched branch, instead of merging::->bool:false' + pull.rebase:'rebase branches on top of the fetched branch, instead of merging::->pull.rebase:false' pull.twohead:'default merge strategy to use when pulling a single branch::__git_merge_strategies' - push.default:'action git push should take if no refspec is given::->push.default:matching' + push.default:'action git push should take if no refspec is given::->push.default:simple' rebase.stat:'show a diffstat of what changed upstream since last rebase::->bool:false' rebase.autosquash:'autosquash by default::->bool:false' + rebase.autostash:'autostash by default::->bool:false' receive.autogc:'run git gc --auto after receiving data::->bool:true' receive.fsckObjects:'check all received objects::->bool:true' receive.hiderefs:'string(s) receive-pack uses to decide which refs to omit from its initial advertisement:hidden refs:->string' @@ -2149,6 +2230,7 @@ 'remote.*.url:URL of a remote repository::__git_any_repositories' 'remote.*.pushurl:push URL of a remote repository::__git_any_repositories' 'remote.*.proxy:URL of proxy to use for a remote repository::_urls' + 'remote.*.prune:remove any remote tracking branches that no longer exist remotely::->bool:false' 'remote.*.fetch:default set of refspecs for git fetch::__git_ref_specs' 'remote.*.push:default set of refspecs for git push::__git_ref_specs' 'remote.*.mirror:push with --mirror::->bool:false' @@ -2184,6 +2266,7 @@ sendemail.smtpserver:'SMTP server to connect to:smtp host:_hosts' sendemail.smtpserveroption:'specifies the outgoing SMTP server option to use:SMTP server option:->string' sendemail.smtpserverport:'port to connect to SMTP server on:smtp port:_ports' + sendemail.smtpsslcertpath:'path to ca-certificates (directory or file):ca certificates path:_files' sendemail.smtpuser:'user to use for SMTP-AUTH:smtp user:_users' sendemail.thread:'set In-Reply-To\: and References\: headers::->bool:true' sendemail.validate:'perform sanity checks on patches::->bool:true' @@ -2223,7 +2306,7 @@ 'submodule.*.fetchRecurseSubmodules:fetch commits of submodules::->bool' 'submodule.*.path:path within project:submodule directory:_directories -qS \:' 'submodule.*.url:URL to update from::__git_any_repositories' - 'submodule.*.update:update strategy to use::->submodule.update' + 'submodule.*.update:update strategy to use::->submodule.update:none' 'submodule.*.ignore:ignore modifications to submodules with git status and git diff-*::->submodule.ignore' svn.noMetadata:'disable git-svn-id: lines at end of commits::->bool:false' svn.useSvmProps:'use remappings of URLs and UUIDs from mirrors::->bool:false' @@ -2246,6 +2329,7 @@ 'svn-remote.*.pushurl:URL to push to::_urls' 'svn-remote.*.branches:branch mappings:branch mapping:->string' 'svn-remote.*.tags:tag mappings:tag mapping:->string' + tag.sort:'Default sorting method:->string' 'tar.*.command:specify a shell command through which the tar output generated by git archive should be piped::_path_commands' 'tar.*.remote:enable for use by remote clients via git-upload-archive::->bool' tar.umask:'umask to apply::->umask' @@ -2254,6 +2338,7 @@ transfer.hiderefs:'string(s) to decide which refs to omit from initial advertisements:hidden refs:->string' uploadpack.hiderefs:'string(s) upload-pack uses to decide which refs to omit from its initial advertisement:hidden refs:->string' uploadpack.allowtipsha1inwant:'allow upload-pack to accept a fetch request that asks for an object at the tip of a hidden ref::->bool:false' + uploadarchive.allowUnreachable:'allow git-upload-archive to accept an archive requests that ask for unreachable objects::->bool:false' 'url.*.insteadOf:string to start URLs with:prefix:->string' 'url.*.pushInsteadOf:string to start URLs to push to with:prefix:->string' user.email:'email address used for commits::_email_addresses' @@ -2301,6 +2386,7 @@ 'gc.*.:${${line[1]#gc.}%.*}-specific gc option' 'gitcvs.*.:gitcvs ${${line[1]#gitcvs.}%.*}-specific option' 'guitool.*.:${${line[1]#guitool.}%.*}-specific option' + 'http.*.:${${line[1]#http.}%.*}-specific option' 'man.*.:${${line[1]#man.}%.*}-specific man option' 'merge.*.:${${line[1]#merge.}%.*}-specific merge option' 'mergetool.*.:${${line[1]#mergetool.}%.*}-specific option' @@ -2358,6 +2444,9 @@ (guitool.) __git_config_sections '^guitool\..+\.[^.]+$' guitools 'gui tool' -S . && ret=0 ;; + (http.) + __git_config_sections '^http\..+\.[^.]+$' bases base -S . && ret=0 + ;; (man.) __git_man_viewers -S . && ret=0 ;; @@ -2447,6 +2536,7 @@ tar:'git tar-tree options' transfer:'options controlling transfers' uploadpack:'git upload-pack options' + uploadarchive:'git upload-archive options' url:'URL prefixes' user:'options controlling user identity' web:'web options' @@ -2568,7 +2658,7 @@ esac ;; (color-bool) - __git_config_values -t booleans -l boolean -- "$current" false \ + __git_config_values -t booleans -l boolean -- "$current" "$parts[5]" \ {never,false,no,off}:"do not $parts[2]" \ always:"always $parts[2]" \ {auto,true,yes,on}:$parts[2] && ret=0 @@ -2749,6 +2839,12 @@ (permission) __git_repository_permissions && ret=0 ;; + (pull.rebase) + __git_config_values -- "$current" "$parts[5]" \ + {true,yes,on}:$parts[2] \ + {false,no,off}:"do not $parts[2]" \ + preserve:"rebase and preserve merges" && ret=0 + ;; (push.default) __git_config_values -- "$current" "$parts[5]" \ nothing:'do not push anything' \ @@ -2802,6 +2898,18 @@ _message "${parts[3]:-${parts[2]:-value}}" fi ;; + (submodule.update) + compset -P '*!' + if [[ -n $IPREFIX ]]; then + _command_names -e + else + __git_config_values -- "$current" "$parts[5]" \ + rebase:'rebase current branch onto commit recorded in superproject' \ + merge:'merge commit recorded in superproject into current branch of submodule' \ + none:'do not merge or rebase' \ + '!:specify command name that takes sha1 to update to as parameter' && ret=0 + fi + ;; (submodule.ignore) __git_config_values -- "$current" "$parts[5]" \ all:'never consider submodules modified' \ @@ -3132,6 +3240,8 @@ (( $+functions[_git-replace] )) || _git-replace () { _arguments -w -S -s \ + '--edit[edit existing object as base a starting point]' \ + '--graft[rewrite the parents of a commit]' \ '(- *)-f[overwrite existing replace ref]' \ '(- 2)-d[delete existing replace refs]' \ '(- : *)-l[list replace refs]:pattern' \ @@ -3155,7 +3265,7 @@ '-b[show blank SHA-1 for boundary commits]' \ '--root[do not treat root commits as boundaries]' \ '--show-stats[include additional statistics at the end of blame output]' \ - '-L[annotate only the given line range]: :->line-range' \ + '*-L[annotate only the given line range]: :->line-range' \ '-l[show long rev]' \ '-t[show raw timestamp]' \ '-S[use revs from revs-file]:revs-file:_files' \ @@ -3353,6 +3463,7 @@ '(- *)'{-h,--help}'[display usage]' \ '--keep-dashdash[do not skip first -- option]' \ '--stop-at-non-option[stop parsing options at first non-option argument]' \ + '--stuck-long[output options in long form if available, and with their arguments stuck]' \ '*:option specification' && ret=0 fi elif (( words[(I)--sq-quote] )); then @@ -3442,6 +3553,13 @@ return ret } +(( $+functions[_git-verify-commit] )) || +_git-verify-commit () { + _arguments -w -S -s \ + '(-v --verbose)'{-v,--verbose}'[print the contents of the commit object before validating it]' \ + '*: :__git_commits' +} + (( $+functions[_git-verify-tag] )) || _git-verify-tag () { _arguments -w -S -s \ @@ -3566,6 +3684,8 @@ '--annotate[review and edit each patch before sending it]' \ '--bcc=[Bcc: value for each email]: :_email_addresses' \ '--cc=[starting Cc: value for each email]: :_email_addresses' \ + '--to-cover[Copy the To: list from the first file to the rest]' \ + '--cc-cover[Copy the Cc: list from the first file to the rest]' \ '--compose[edit introductory message for patch series]' \ '--from=[specify sender]:email address:_email_addresses' \ '--in-reply-to=[specify contents of first In-Reply-To header]:message-id' \ @@ -3580,6 +3700,7 @@ '--smtp-server=[specify SMTP server to connect to]:smtp server:_hosts' \ '--smtp-server-port=[specify port to connect to SMTP server on]:smtp port:_ports' \ '--smtp-server-option=[specify the outgoing SMTP server option to use]:SMPT server option' \ + '--smtp-ssl-cert-path=[path to ca-certificates (directory or file)]:ca certificates path:_files' \ '--smtp-user=[specify user to use for SMTP-AUTH]:smtp user:_users' \ '--smtp-debug=[enable or disable debug output]:smtp debug:((0\:"disable" 1\:"enable"))' \ '--cc-cmd=[specify command to generate Cc\: header with]:Cc\: command:_path_commands' \ @@ -3594,7 +3715,7 @@ '(--suppress-from )--no-suppress-from[add the From: address to the Cc: list]' \ '( --no-thread)--thread[set In-Reply-To: and References: headers]' \ '(--thread )--no-thread[do not set In-Reply-To: and References: headers]' \ - '--confirm[specify type of confirmation required before sending]: :__git_sendemail_confirm' \ + '--confirm[specify type of confirmation required before sending]: :__git_sendemail_confirm_values' \ '--dry-run[do everything except actually sending the emails]' \ '( --no-format-patch)--format-patch[interpret ambiguous arguments as format-patch arguments]' \ '(--format-patch )--no-format-patch[interpret ambiguous arguments file-name arguments]' \ @@ -3865,13 +3986,14 @@ _arguments -w -S -s \ $apply_options \ + '(--index --cached --reject)'{-3,--3way}'[fall back on 3-way merge if patch fails]' \ '--stat[output diffstat for input (turns off "apply")]' \ '--numstat[same as --stat but in decimal notation and complete pathnames (turns off "apply")]' \ '--summary[output summary of git-diff extended headers (turns off "apply")]' \ '--check[check if patches are applicable (turns off "apply")]' \ '( --cached)--index[make sure that patch is applicable to index]' \ '(--index )--cached[apply patches without touching working tree]' \ - '--build-face-ancestor[build temporary index for blobs with ambiguous origin]:index:_files' \ + '--build-fake-ancestor[build temporary index for blobs with ambiguous origin]:index:_files' \ '(-R --reverse)'{-R,--reverse}'[apply patches in reverse]' \ '-z[use NUL termination on output]' \ '--unidiff-zero[disable unified-diff-context check]' \ @@ -4166,10 +4288,18 @@ (( $+functions[_git-update-ref] )) || _git-update-ref () { + local z_opt + + if (( words[(I)--stdin] )); then + z_opt='-z[values are separated with NUL character when reading from stdin]' + fi + _arguments -w -S -s \ '-m[update reflog for specified name with specified reason]:reason for update' \ '(:)-d[delete given reference after verifying its value]:symbolic reference:__git_revisions:old reference:__git_revisions' \ - '--no-deref[overwrite ref itself, not what it points to]' \ + '(-d --no-deref)--stdin[reads instructions from standard input]' \ + $z_opt \ + '(-d -z --stdin)--no-deref[overwrite ref itself, not what it points to]' \ ':symbolic reference:__git_revisions' \ ':new reference:__git_revisions' \ '::old reference:__git_revisions' @@ -4377,6 +4507,7 @@ '--octopus[compute best common ancestors of all supplied commits]' \ '--is-ancestor[tell if A is ancestor of B (by exit status)]' \ '(-)--independent[display minimal subset of supplied commits with same ancestors]' \ + '--fork-point[find the point at which B forked from ref A (uses reflog)]' \ ': :__git_commits' \ '*: :__git_commits' } @@ -4445,9 +4576,9 @@ _git-show-ref () { _arguments -S \ - list \ - '(-h --head)'{-h,--head}'[show HEAD reference]' \ + '(-h --head)'{-h,--head}'[show the HEAD reference, even if it would normally be filtered out]' \ '--tags[show only refs/tags]' \ - '--heads[show only HEAD and refs under refs/heads]' \ + '--heads[show only refs/heads]' \ '(-d --dereference)'{-d,--dereference}'[dereference tags into object IDs as well]' \ '(-s --hash)'{-s+,--hash=-}'[only show the SHA-1 hash, not the reference name]:: :__git_guard_number length' \ '--verify[enable stricter reference checking]' \ @@ -4686,6 +4817,7 @@ {-a,--all}'[list all attributes that are associated with the specified paths]' \ '--stdin[read file names from stdin instead of from command line]' \ '--cached[consider .gitattributes in the index only, ignoring the working tree.]' \ + '-z[make output format machine-parseable and treat input-paths as NUL-separated with --stdin]' \ $z_opt \ '(-)--[interpret preceding arguments as attributes and following arguments as path names]' \ '*:: :->attribute-or-file' && ret=0 @@ -4798,12 +4930,12 @@ (( $+functions[__git_committish_range_first] )) || __git_committish_range_first () { - print -r -- ${1%..(.|)*} + print -r -- ${${${1%..*}%.}:-HEAD} } (( $+functions[__git_committish_range_last] )) || __git_committish_range_last () { - print -r -- ${1##*..(.|)} + print -r -- ${${${1#*..}#.}:-HEAD} } (( $+functions[__git_pattern_escape] )) || @@ -4832,12 +4964,12 @@ (( $+functions[__git_is_committish_range] )) || __git_is_committish_range () { - # TODO: This isn't quite right. We would like to do parts=${(~s:..(.|))}, - # but that doesn't work. (This would allow us to make sure that parts only - # contains two elements and then apply __git_is_committish on them. - [[ $1 == *..(.|)* ]] && - __git_is_committish $(__git_committish_range_first $1) && - __git_is_committish $(__git_committish_range_last $1) + [[ $1 == *..(.|)* ]] || return 1 + local first=$(__git_committish_range_first $1) + local last=$(__git_committish_range_last $1) + [[ $first != *..* && $last != *..* ]] && \ + __git_is_committish $first && \ + __git_is_committish $last } (( $+functions[__git_is_initial_commit] )) || @@ -4950,6 +5082,7 @@ rerere:'reuse recorded resolution of conflicted merges' rev-parse:'pick out and massage parameters for other git commands' show-branch:'show branches and their commits' + verify-commit:'check GPG signature of commits' verify-tag:'check GPG signature of tags' whatchanged:'show commit-logs and differences they introduce') @@ -5427,9 +5560,12 @@ __git_commits () { # TODO: deal with things that __git_heads and __git_tags has in common (i.e., # if both exists, they need to be completed to heads/x and tags/x. + local -a sopts ropt + zparseopts -E -a sopts S: r:=ropt R: q + sopts+=( $ropt:q ) _alternative \ - 'heads::__git_heads' \ - 'commit-tags::__git_commit_tags' \ + "heads::__git_heads $sopts" \ + "commit-tags::__git_commit_tags $sopts" \ 'commit-objects::__git_commit_objects' } @@ -5496,10 +5632,12 @@ (( $+functions[__git_commit_ranges] )) || __git_commit_ranges () { + local -a suf if compset -P '*..(.|)'; then __git_commits $* else - __git_commits $* -qS .. + compset -S '..*' || suf=( -S .. -r '.@~ ^:\t\n\-' ) + __git_commits $* $suf fi } @@ -5537,7 +5675,7 @@ local expl declare -a submodules - submodules=(${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#* }) + submodules=(${${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#?* }%% *}) __git_command_successful $pipestatus || return 1 _wanted submodules expl submodule compadd $* - $submodules @@ -5683,9 +5821,17 @@ # TODO: --directory should probably be added to $opts when --others is given. local pref=$gitcdup$gitprefix$PREFIX + + # First allow ls-files to pattern-match in case of remote repository files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\\\*} 2>/dev/null)"}) __git_command_successful $pipestatus || return + # If ls-files succeeded but returned nothing, try again with no pattern + if [[ -z "$files" && -n "$pref" ]]; then + files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- 2>/dev/null)"}) + __git_command_successful $pipestatus || return + fi + # _wanted $tag expl $description _files -g '{'${(j:,:)files}'}' $compadd_opts - _wanted $tag expl $description _multi_parts -f $compadd_opts - / files } @@ -5957,7 +6103,7 @@ '--find-copies-harder[try harder to find copies]' '(-D --irreversible-delete)'{-D,--irreversible-delete}'[omit the preimage for deletes]' '-l-[limit number of rename/copy targets to run]: :__git_guard_number' - '--diff-filter=-[select certain kinds of files for diff]: :_guard "[ACDMRTUXB*]#" kinds' + '--diff-filter=-[select certain kinds of files for diff]: :_guard "[AaCcDdMmRrTtUuXxBb*]#" kinds' '-S-[look for differences that add or remove the given string]:string' '-G-[look for differences whose added or removed line matches the given regex]:pattern' '--pickaxe-all[when -S finds a change, show all changes in that changeset]' @@ -6023,7 +6169,8 @@ '--parents[display parents of commit]' '--children[display children of commit]' '--left-right[mark which side of symmetric diff commit is reachable from]' - '--graph[display graphical representation of commit history]' + '(--show-linear-break )--graph[display graphical representation of commit history]' + '( --graph)--show-linear-break=[show a barrier between commits from different branches]:barrier' '--count[display how many commits would have been listed]' '(-n --max-count)'{-n+,--max-count=}'[maximum number of commits to display]: :__git_guard_number' '--skip=[skip given number of commits before output]: :__git_guard_number' @@ -6052,7 +6199,10 @@ '--tags=[-show all commits from refs/tags]::pattern' '--remotes=[-show all commits from refs/remotes]::pattern' '--glob=[show all commits from refs matching glob]:pattern' - '--stdin[read commit objects from standard input]' + '--exclude=[do not include refs matching glob]:pattern' + '--exclude=[do not include refs matching glob]:pattern' + '--ignore-missing[ignore invalid object an ref names on command line]' + '--bisect[pretend as if refs/bisect/bad --not refs/bisect/good-* was given on command line]' '(-g --walk-reflogs --reverse)'{-g,--walk-reflogs}'[walk reflog entries from most recent to oldest]' '--grep-reflog=[limit commits to ones whose reflog message matches the given pattern (with -g, --walk-reflogs)]:pattern' '--merge[after a failed merge, show refs that touch files having a conflict]' @@ -6107,10 +6257,12 @@ '( --no-squash)--squash[merge, but do not commit]' '(--squash )--no-squash[merge and commit]' '--ff-only[refuse to merge unless HEAD is up to date or merge can be resolved as a fast-forward]' + '(-S --gpg-sign --no-gpg-sign)'{-S-,--gpg-sign=}'[GPG-sign the commit]::key id' \ + '(-S --gpg-sign --no-gpg-sign)--no-gpg-sign[do not GPG-sign the commit]' \ '*'{-s,--strategy=}'[use given merge strategy]:merge strategy:__git_merge_strategies' '*'{-X,--strategy-option=}'[pass merge-strategy-specific option to merge strategy]' - '(--verify-signatures)--no-verify-signatures[verify the commits being merged or abort]' - '(--no-verify-signatures)--verify-signatures[do not verify the commits being merged]' + '(--verify-signatures)--verify-signatures[verify the commits being merged or abort]' + '(--no-verify-signatures)--no-verify-signatures[do not verify the commits being merged]' '(-q --quiet -v --verbose)'{-q,--quiet}'[suppress all output]' '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional information]') } @@ -6262,15 +6414,22 @@ builtinbrowsers=( firefox iceweasel + seamonkey + iceape google-chrome + chrome chromium konquerer + opera w3m + elinks links lynx dillo open - start) + start + cygstart + xdg-open) _tags user-browsers builtin-browsers @@ -6307,6 +6466,7 @@ vimdiff gvimdiff vimdiff2 + vimdiff3 gvimdiff2 emerge ecmerge @@ -6438,9 +6598,13 @@ if (( CURRENT > 2 )); then local -a aliases local -A git_aliases - # TODO: Should use -z here, but I couldn't get it to work. - aliases=(${(f)${${${(f)"$(_call_program aliases git config --get-regexp '\^alias\.')"}#alias.}/ /$'\n'}/(#e)/$'\n'}) - (( $#aliases % 2 == 0 )) && git_aliases=($aliases) + local k v + aliases=(${(0)"$(_call_program aliases git config -z --get-regexp '\^alias\.')"}) + for a in ${aliases}; do + k="${${a/$'\n'*}/alias.}" + v="${a#*$'\n'}" + git_aliases[$k]="$v" + done if (( $+git_aliases[$words[2]] && !$+commands[git-$words[2]] && !$+functions[_git-$words[2]] )); then local -a tmpwords expalias @@ -6469,6 +6633,7 @@ _arguments -C \ '(- :)--version[display version information]' \ '(- :)--help[display help message]' \ + '-C[run as if git was started in given path]: :_directories' \ '-c[pass configuration parameter to command]:parameter' \ '--exec-path=-[path containing core git-programs]:: :_directories' \ '(: -)--man-path[print the manpath for the man pages for this version of Git and exit]' \ diff -Nru zsh-5.0.5/Completion/Unix/Command/_graphicsmagick zsh-5.0.7/Completion/Unix/Command/_graphicsmagick --- zsh-5.0.5/Completion/Unix/Command/_graphicsmagick 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_graphicsmagick 2014-10-07 18:11:30.000000000 +0000 @@ -3,7 +3,7 @@ local state line expl formats curcontext="$curcontext" typeset -A opt_args -formats=jpg:jpeg:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv +formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv if (( $# )); then _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" diff -Nru zsh-5.0.5/Completion/Unix/Command/_gzip zsh-5.0.7/Completion/Unix/Command/_gzip --- zsh-5.0.5/Completion/Unix/Command/_gzip 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_gzip 2014-10-07 18:11:30.000000000 +0000 @@ -39,6 +39,7 @@ '(-q --quiet)--silent[suppress all warnings]' \ '(--recursive)-r[operate recursively on directories]' \ '(-r)--recursive[operate recursively on directories]' \ + '--rsyncable[make rsync-friendly archive]' \ '(--suffix)-S+[specify suffix for compressed files]:suffix:' \ '(-S)--suffix=[specify suffix for compressed files]:suffix:' \ '(--test)-t[test compressed file integrity]' \ diff -Nru zsh-5.0.5/Completion/Unix/Command/_hg zsh-5.0.7/Completion/Unix/Command/_hg --- zsh-5.0.5/Completion/Unix/Command/_hg 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_hg 2014-10-07 18:11:30.000000000 +0000 @@ -226,6 +226,16 @@ _wanted files expl 'modified files' _multi_parts / status_files } +_hg_committable() { + typeset -a status_files + # A file is a candidate for `hg commit` if it is: + # - modified (m), or + # - added (a), or + # - removed (r) + _hg_status mar + _wanted files expl 'committable files' _multi_parts / status_files +} + _hg_resolve() { local rstate rpath @@ -476,7 +486,7 @@ '(--logfile -l)'{-l+,--logfile}'[read commit message from specified file]:log file:_files' \ '(--date -d)'{-d+,--date}'[record datecode as commit date]:date code:' \ '(--user -u)'{-u+,--user}'[record user as commiter]:user:' \ - '*:file:_hg_files' + '*:file:_hg_committable' } _hg_cmd_copy() { diff -Nru zsh-5.0.5/Completion/Unix/Command/_imagemagick zsh-5.0.7/Completion/Unix/Command/_imagemagick --- zsh-5.0.5/Completion/Unix/Command/_imagemagick 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_imagemagick 2014-10-07 18:11:30.000000000 +0000 @@ -11,7 +11,7 @@ # # and certainly many other things... -formats=jpg:jpeg:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv +formats=jpg:jpeg:jp2:j2k:jpc:jpx:jpf:tiff:miff:ras:bmp:cgm:dcx:ps:eps:fig:fits:fpx:gif:mpeg:pbm:pgm:ppm:pcd:pcl:pdf:pcx:png:rad:rgb:rgba:rle:sgi:html:shtml:tga:ttf:uil:xcf:xwd:xbm:xpm:yuv if (( $# )); then _files "$@" -g "*.(#i)(${~formats//:/|})(-.)" diff -Nru zsh-5.0.5/Completion/Unix/Command/_ip zsh-5.0.7/Completion/Unix/Command/_ip --- zsh-5.0.5/Completion/Unix/Command/_ip 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_ip 2014-10-07 18:11:30.000000000 +0000 @@ -40,7 +40,7 @@ ) subcmd_prefix_label=( /$'(<->(.<->(.<->(.<->|)|)|)|[:[:xdigit]]#:[:[:xdigit:]]#)(|/<->)\0'/ - ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )" + ":ipaddresslabel:IP addrlabel prefix currently set:( $(ip -6 addrlabel list 2>/dev/null | sed -n 's/^prefix \([0-9a-f\.:/]*\) .*$/\1/p') )" ) diff -Nru zsh-5.0.5/Completion/Unix/Command/_man zsh-5.0.7/Completion/Unix/Command/_man --- zsh-5.0.5/Completion/Unix/Command/_man 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_man 2014-10-07 18:11:30.000000000 +0000 @@ -29,7 +29,7 @@ if (( index )); then local opt opt=$words[index+1] - _manpath=($_manpath $opt) + _manpath=($opt) fi # `sman' is the SGML manual directory for Solaris 7. diff -Nru zsh-5.0.5/Completion/Unix/Command/_moosic zsh-5.0.7/Completion/Unix/Command/_moosic --- zsh-5.0.5/Completion/Unix/Command/_moosic 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_moosic 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,487 @@ +#compdef moosic + +_moosic_add_cmds() { + + # querying for information + typeset -a queries + queries=( + "help:print brief description of command" + "current:print name of currently playing song" + "current-time:print the amount of time the current song has been playing" + "list:print the list of items in the current song queue" + "plainlist:print the current song queue without numbering each line" + "history:print a list of items that were recently played" + {status,state}":print the current state of the music daemon" + "length:print the number of items in the queue" + "ispaused:show whether the current song is paused or not" + "islooping:show whether the server is in loop mode" + "isadvancing:show whether the server is advancing through the song queue" + "version:print version information for client and server" + ) + + + # appending to song queue + typeset -a appending + appending=( + {append,add}":add the files to be played to the end of the song queue" + {pl-append,pl-add}":add the items listed in the given playlist files to end of queue" + "prepend:add the files to be played to the beginning of the song queue" + "pl-prepend:add the items in the given playlist files to beginning of queue" + "mixin:add the files to the song queue and reshuffle the entire queue" + "pl-mixin:add items in given playlist files to song queue and reshuffle the entire queue" + "replace:replace the current contents of the song queue with files listed" + "pl-replace:replace current contents of song queue with songs given in playlists" + "insert:insert the given items at a given point in the song queue" + "pl-insert:insert items from playlist files at specified point in queue" + "putback:reinsert current song at start of song queue" + "stagger-add:adds file list to end of queue after rearranging queue into staggered order" + "stagger-merge:adds given file list to queue in interleaved fashion" + "interval-add:inserts given songs with regular frequency specified by interval argument" + ) + + # removing + typeset -a removing + removing=( + {cut,del}":removes all song queue items in given range" + "crop:removes all song queue items that do not fall within given range" + "remove:remove all song queue items matching any one of given regexps" + "filter:remove all queue items not matching all given regexps" + "clear:clear song queue" + "wipe:clear song queue and stop current song" + ) + + # rearranging + typeset -a rearranging + rearranging=( + "move:move all items in given range to new position in song queue" + "move-pattern:moves all items matching the given regexp to new position" + "swap:trade places of songs in two specified ranges" + {shuffle,reshuffle}":reshuffle song queue within an optional range" + "sort:sort queue within optional range" + "reverse:reverse order of song queue" + "partial-sort:sort items matching each regexp" + "stagger:stagger items matching each regexp" + "sub:perform regular expression substitution on all items in queue" + "suball:like sub, but replace all occurrences of the pattern" + ) + + # general management + typeset -a general + general=( + "next:jumps ahead, number of songs optional" + "previous:retreats to previously played song" + "goto:jumps to next song matching regexp" + "gobackto:jumps back to most recent previous song matching regexp" + "noadvance:halt queue advancement" + "advance:resume queue advancement" + "toggle-advance:toggle queue advancement" + "stop:stop playing current song, stop processing queue, put current song back" + "pause:suspend current song to resume it later" + "unpause:unpause current song" + "play:resume playing" + "loop:turn loop mode on" + "noloop:turn loop mode off" + "toggle-loop:toggle loop mode" + "reconfigure:daemon reload configuration file" + "showconfig:show dameon filetype associations" + "start-server:starts new instance of daemon with given options" + {quit,exit,die}":quit daemon" + ) + + _describe queries queries -J queries + _describe appending appending -J appending + _describe removing removing -J removing + _describe rearranging rearranging -J rearranging + _describe general general -J general +} + +_moosic() { + typeset context state line + typeset -A opt_args + + typeset -a filelist_opts + filelist_opts=( + '(-g --shuffle-global)'{-g,--shuffle-global}'[shuffle filelist after directory expansion]' + '(-d --shuffle-dir)'{-d,--shuffle-dir}'[shuffle results of expanding the directories]' + '(-a --shuffle-args)'{-a,--shuffle-args}'[shuffle actual command line arguments]' + '(-o --inorder)'{-o,--inorder}'[do not shuffle filelist]' + '(-s --sort)'{-s,--sort}'[sort filelist lexicographically after expansion]' + '(-r --no-recurse)'{-r,--no-recurse}'[do not recurse through directories]' + '(-n --no-file-munge)'{-n,--no-file-munge}'[do not modify names in expanded filelist]' + '(-f --auto-find)'{-f,--auto-find}'[perform fuzzy search for music files]' + '(-F --auto-grep)'{-F,--auto-grep}'[like --auto-find but with regexp]' + '(-U --allow-unplayable)'{-U,--allow-unplayable}'[allow addition of unknown song types]' + ) + + typeset -a auto_opts + auto_opts=( + '(-m --music-dir)'{-m,--music-dir}'[directory used for auto-find, auto-grep]:directory:_files' + ) + + typeset -a main_opts + main_opts=( + '(-i --ignore-case)'{-i,--ignore-case}'[treat regexps as if they are case-insensitive]' + '(-S --showcommands)'{-S,--showcommands}'[show all moosic commands, then exit]' + '(-h --help)'{-h,--help}'[print help message then exit]' + '(-v --version)'{-v,--version}'[print version information, then exit]' + '(-c --config-dir)'{-c,--config-dir}'[configuration directory]:directory:_files' + '(-t --tcp)'{-t,--tcp}'[talk to server at specified host and port]:host\:port:' + '(-N --no-startserver)'{-N,--no-startserver}'[do not start moosicd server]' + ) + + typeset -a list_opts + list_opts=( + '(-C --current-in-list)'{-C,--current-in-list}'[print currently playing song in list]' + ) + + # GLOBAL ARGUMENTS + # do not use the -A option here. It will break the processing of + # positional arguments. + _arguments $main_opts $list_opts $auto_opts $filelist_opts \ + '1: :->cmd' \ + '*:: :->posarg' + + if [[ $state == cmd ]]; then + _moosic_add_cmds + elif [[ $state == posarg ]]; then + _moosic_cmd_${line[1]} + fi +} + +# Do something, but only if the current word is 2. +_do2() { + if (( CURRENT == 2 )); then + $@ + else + _message 'no more arguments' + fi +} + +### QUERY COMMANDS + +_moosic_cmd_help() { + _do2 '_moosic_add_cmds' +} + +_moosic_cmd_current() { + _message 'no arguments' +} + +_moosic_cmd_current-time() { + _do2 '_message' 'strftime string' +} + +_moosic_cmd_list() { + _do2 '_message' 'range' +} + +_moosic_cmd_plainlist() { + _do2 '_message' 'range' +} + +_moosic_cmd_history() { + _do2 '_message' 'maximum number of entries' +} + +_moosic_cmd_status() { + _message 'no arguments' +} + +_moosic_cmd_state() { + _message 'no arguments' +} + +_moosic_cmd_length() { + _message 'no arguments' +} + +_moosic_cmd_ispaused() { + _message 'no arguments' +} + +_moosic_cmd_islooping() { + _message 'no arguments' +} + +_moosic_cmd_isadvancing() { + _message 'no arguments' +} + +_moosic_cmd_version() { + _message 'no arguments' +} + +### APPENDING COMMANDS + +_moosic_song_files() +{ + _arguments -A '-*' $main_opts $filelist_opts $auto_opts \ + '*:song files:_files' +} + +_moosic_cmd_append() { + _moosic_song_files +} + +_moosic_cmd_add() { + _moosic_song_files +} + +_moosic_cmd_pl-append() { + _moosic_song_files +} + +_moosic_cmd_pl-add() { + _moosic_song_files +} + +_moosic_cmd_prepend() { + _moosic_song_files +} + +_moosic_cmd_pl-prepend() { + _moosic_song_files +} + +_moosic_cmd_mixin() { + _moosic_song_files +} + +_moosic_cmd_pl-mixin() { + _moosic_song_files +} + +_moosic_cmd_replace() { + _moosic_song_files +} + +_moosic_cmd_pl-replace() { + _moosic_song_files +} + +_moosic_cmd_insert() { + _moosic_song_files +} + +_moosic_cmd_pl-insert() { + _moosic_song_files +} + +_moosic_cmd_putback() { + _message 'no arguments' +} + +_moosic_cmd_stagger-add() { + _moosic_song_files +} + +_moosic_cmd_stagger-merge() { + _moosic_song_files +} + +_moosic_cmd_interval-add() { + _arguments -A '-*' $main_opts $filelist_opts \ + '1:interval:' \ + '*:song files:_files' +} + +### REMOVING COMMANDS + +_moosic_cmd_cut() { + _do2 '_message' 'range' +} + +_moosic_cmd_del() { + _do2 '_message' 'range' +} + +_moosic_cmd_crop() { + _do2 '_message' 'range' +} + +_moosic_cmd_remove() { + _do2 '_message' 'regex' +} + +_moosic_cmd_filter() { + _do2 '_message' 'regex' +} + +_moosic_cmd_clear() { + _message 'no arguments' +} + +_moosic_cmd_wipe() { + _message 'no arguments' +} + +### REARRANGING COMMANDS + +_moosic_cmd_move() { + _arguments -A '-*' $main_opts \ + '1:range:' \ + '2:index:' \ + '*:no more arguments:' +} + +_moosic_cmd_move-pattern() { + _arguments -A '-*' $main_opts \ + '1:regex:' \ + '2:index:' \ + '*:no more arguments:' +} + +_moosic_cmd_swap() { + _arguments -A '-*' $main_opts \ + '1:range:' \ + '2:range:' \ + '*:no more arguments:' +} + +_moosic_cmd_shuffle() { + _arguments -A '-*' $main_opts \ + '1:range (optional):' \ + '*:no more arguments:' +} + +_moosic_cmd_reshuffle() { + _arguments -A '-*' $main_opts \ + '1:range (optional):' \ + '*:no more arguments:' +} + +_moosic_cmd_sort() { + _arguments -A '-*' $main_opts \ + '1:range (optional):' \ + '*:no more arguments:' +} + +_moosic_cmd_reverse() { + _arguments -A '-*' $main_opts \ + '1:range (optional):' \ + '*:no more arguments:' +} + +_moosic_cmd_partial-sort() { + _do2 '_message' 'regex' +} + +_moosic_cmd_stagger() { + _do2 '_message' 'regex' +} + +_moosic_cmd_sub() { + _arguments -A '-*' $main_opts \ + '1:pattern:' \ + '2:replacement:' \ + '3:range (optional):' \ + '*:no more arguments:' +} + +_moosic_cmd_suball() { + _arguments -A '-*' $main_opts \ + '1:pattern:' \ + '2:replacement:' \ + '3:range (optional):' \ + '*:no more arguments:' +} + +### GENERAL COMMANDS + +_moosic_cmd_next() { + if (( CURRENT == 2 )); then + + typeset -a display display_cmd + if zstyle -a ":completion:${curcontext}:next" \ + 'command' display_cmd; then + $display_cmd + else + display=(${(f)"$(moosic list)"}) + fi + + typeset -a numbers + numbers=({1..${#display}}) + + compadd -V songs -d display -a numbers + else + _message 'no more arguments' + fi +} + +_moosic_cmd_previous() { + _do2 '_message' 'number to skip' +} + +_moosic_cmd_goto() { + _do2 '_message' 'regex' +} + +_moosic_cmd_gobackto() { + _do2 '_message' 'regex' +} + +_moosic_cmd_noadvance() { + _message 'no arguments' +} + +_moosic_cmd_advance() { + _message 'no arguments' +} + +_moosic_cmd_toggle-advance() { + _message 'no arguments' +} + +_moosic_cmd_stop() { + _message 'no arguments' +} + +_moosic_cmd_pause() { + _message 'no arguments' +} + +_moosic_cmd_unpause() { + _message 'no arguments' +} + +_moosic_cmd_play() { + _message 'no arguments' +} + +_moosic_cmd_loop() { + _message 'no arguments' +} + +_moosic_cmd_noloop() { + _message 'no arguments' +} + +_moosic_cmd_toggle-loop() { + _message 'no arguments' +} + +_moosic_cmd_reconfigure() { + _message 'no arguments' +} + +_moosic_cmd_showconfig() { + _message 'no arguments' +} + +_moosic_cmd_start-server() { + _message 'options' +} + +_moosic_cmd_quit() { + _message 'no arguments' +} + +_moosic_cmd_exit() { + _message 'no arguments' +} + +_moosic_cmd_die() { + _message 'no arguments' +} + +_moosic "$@" diff -Nru zsh-5.0.5/Completion/Unix/Command/_mosh zsh-5.0.7/Completion/Unix/Command/_mosh --- zsh-5.0.5/Completion/Unix/Command/_mosh 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_mosh 2014-10-07 18:11:30.000000000 +0000 @@ -1,12 +1,26 @@ #compdef mosh +local curcontext="$curcontext" state line +local -a suf + _arguments \ - '--client=:client helper:_command_names -e' \ - '--server=:server helper:_files' \ - '--ssh=:ssh command to run:_files' \ - '(-a -n)--predict=:when:(adaptive always never)' \ - '(--predict -n)-a[predict always]' \ - '(--predict -a)-n[predict never]' \ - {-p,--port=}':port:_ports' \ - ':remote:_hosts' \ - ':remote command:_command_names -e' + '(-)--help[display help information]' \ + '(-)--version[display version information]' \ + "--no-init[don't set terminal init string]" \ + '--ssh=[specify ssh command to setup session]:ssh command:_normal' \ + '--port=[specify server-side port range]:port:_sequence -n 2 -s \: _ports' \ + '(-a -n)--predict=[control speculative local echo]:mode:(adaptive always never)' \ + '(--predict -n)-a[synonym for --predict=always]' \ + '(--predict -a)-n[synonym for --predict=never]' \ + '--server[specify command to run server helper]:remote file:_files' \ + '--client[specify command to run client helper]:_command_names -e' \ + '1:remote host name:->userhost' \ + '*:::args:_normal' && return + +case $state in + userhost) + _hosts || _user_at_host && return + ;; +esac + +return 1 diff -Nru zsh-5.0.5/Completion/Unix/Command/_mount zsh-5.0.7/Completion/Unix/Command/_mount --- zsh-5.0.5/Completion/Unix/Command/_mount 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_mount 2014-10-07 18:11:30.000000000 +0000 @@ -688,7 +688,7 @@ "($excl -r -w --rw)"{-w,--rw}'[mount read/write]' "($excl)-L+[mount partition with specified label]:label:->labels" "($excl)-U+[mount partition with specified uuid]:uuid" - "($excl -t --types)"{-t+,--types=}'[specify file system type]:file system type:->fslist' + "($excl -t --types)"{-t+,--types=}'[specify file system type]:file system type:_sequence -s , _file_systems' "($excl -O --test-opts)"{-O+,--test-opts=}'[with -a, restrict filesystems by options]:file system option:->fsopt' "($excl -a -O -o --options)"{-o+,--options=}'[specify file system options]:file system option:->fsopt' '(: -)'{-B,--bind}'[remount part of filesystem elsewhere]:old directory:_directories:new directory:_directories' @@ -743,7 +743,7 @@ '-o[specify file system options]:file system option:->fsopt' '-p[print mounted file systems]' '-r[mount readonly]' - '-t[specify file system type]:file system type:->fslist' + '-t[specify file system type]:file system type:_sequence -s, _file_systems' '-u[change status of already mounted filesystem]' '-v[verbose mode]' '-w[mount read/write]' @@ -817,7 +817,7 @@ '-A[unmount all mounted file systems except the root]' '-f[force unmount]' '-h[unmount all filesystems associated with host]:host:_hosts' - '-t[unmount all filesystems of specified type]:file system type:->fslist' + '-t[unmount all filesystems of specified type]:file system type:_sequence -s, _file_systems' '-v[verbose mode]' '*:dev or dir:->udevordir' ) @@ -846,11 +846,6 @@ fi case "$state" in -fslist) - compset -P '*,' - compset -S ',*' || suf=',' - _file_systems -qS "$suf" -;; fsopt) _tags options || return 1 diff -Nru zsh-5.0.5/Completion/Unix/Command/_mpc zsh-5.0.7/Completion/Unix/Command/_mpc --- zsh-5.0.5/Completion/Unix/Command/_mpc 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_mpc 2014-10-07 18:11:30.000000000 +0000 @@ -25,7 +25,7 @@ local mpc_cmds mpc_cmds=( - add:"add a song to the current playlist" + add:"append a song to the end of the current playlist" clear:"clear the current playlist" crop:"remove all songs except for the currently playing song" current:"show the currently playing song" @@ -35,6 +35,7 @@ enable:"enable a output" idle:"wait until an event occurs" idleloop:"loop waiting for events" + insert:"insert a song after the currently playing song in the playlist" listall:"list all songs in the music directory" load:"load file as a playlist" ls:"list the contents of specified directory" @@ -253,7 +254,7 @@ local list expl list=(album artist title track name genre date composer performer comment disc filename any) - if [[ $#words -eq 2 ]]; then + if ! (( $#words % 2 )); then _wanted list expl table compadd $expl -a list else _message "pattern" diff -Nru zsh-5.0.5/Completion/Unix/Command/_nm zsh-5.0.7/Completion/Unix/Command/_nm --- zsh-5.0.5/Completion/Unix/Command/_nm 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_nm 2014-10-07 18:11:30.000000000 +0000 @@ -1,30 +1,62 @@ #compdef nm -# This is a stub. It's main reason for existence is to offer -# object files with nm. Feel free to extend it. If you do, remove -# this comment. +local args files -local state context line expl -local -A opt_args -local -a args -integer ret=1 - -if _pick_variant gnu='Free Soft' unix --version; then - args+=(-s --) +_nm_object_file() { + [[ -x $REPLY || $REPLY = *.([ao]|so) ]] +} + +files="*:object file:_path_files -g '*(-.e:_nm_object_file:)'" +args=( + '(-A -o --print-file-name)'{-A,-o,--print-file-name}'[print name of input file on each line]' + '(--demangle)-C[decode symbol names]' + '(-D --dynamic)'{-D,--dynamic}'[display dynamic symbols instead of normal ones]' + '(-g --extern-only)'{-g,--extern-only}'[display only global symbols]' + '(-t --radix -o -x)'{-t,--radix}'[specify radix for numeric values]:radix:((d\:decimal o\:octal x\:hexadecimal))' +) + +if _pick_variant gnu=GNU unix -V; then + compset -P '@' && files='*:options file:_files' + args+=( + '(- *)--help[display help information]' + '(- *)--version[display version information]' + '(-f --format -P --portability)-B[same as --format=bsd]' + '(-C --no-demangle)--demangle=-[decode symbol names]::style:(auto gnu lucid arm hp edg gnu-v3 java gnat)' + "(-C --demangle)--no-demangle[don't decode symbol names]" + '(-u --undefined-only)--defined-only[display only defined symbols]' + '(-f --format -P)'{-f+,--format=}'[specify output format]:format:(bsd sysv posix)' + '(-l --line-numbers)'{-l,--line-numbers}'[display source file and line numbers from debug information]' + '(-n --numeric-sort -p --no-sort --size-sort)'{-n,--numeric-sort}'[sort symbols numerically by address]' + '(-p --no-sort -n --numeric-sort -r -P --reverse-sort --size-sort)'{-p,--no-sort}'[do not sort symbols]' + '(-P --portability -B -f --format)'{-P,--portability}'[same as --format=posix]' + '(-r --reverse-sort -p --no-sort --size-sort)'{-r,--reverse-sort}'[reverse sort order]' + '--plugin[load specified plugin]:plugin' + '(-u --undefined-only --defined-only)'{-u,--undefined-only}'[display only undefined symbols]' + "--target=[target object format]:targets:(${${(@M)${(f)$(_call_program targets nm --help)}:#*supported targets:*}##*: })" + '(-a --debug-syms)'{-a,--debug-syms}'[display debugger-only symbols]' + '(-S --print-size)'{-S,--print-size}'[print size of defined symbols]' + '(-s --print-armap)'{-s,--print-armap}'[include index for symbols from archive members]' + '(-p --no-sort -n --numeric-sort -r)--size-sort[sort symbols by size]' + '--special-syms[include special symbols in the output]' + '--synthetic[display synthetic symbols as well]' + ) +else + # following flags are accurate for Solaris + args=( ${args:#(|*\)(\*|))-[o-]*} + "-h[don't display column headers]" + '-l[distinguish WEAK symbols with * character]' + '(-t -x)-o[print values in octal]' + '(-v)-n[sort symbols by name]' + '(-P)-p[produce parsable output]' + '(-p)-P[portable output format]' + '(-r)-R[print archive name, object file and symbol name]' + '-r[prepend name of input file to each symbol name]' + '-s[print section name instead of index]' + '-u[print undefined symbols only]' + '(-n)-v[sort external symbols by value]' + '-V[display version of the nm command]' + '(-o -t)-x[print values in hexadecimal]' + ) fi -args+=('*:file:->file') - -_arguments "$args[@]" && ret=0 - -case $state in - (file) - _alternative \ - "object-files:object file:_path_files -g '*.o'" \ - "executable-files:executable file:_path_files -g '*(*)'" \ - "dynamic-libraries:dynamic library:_path_files -g '*.so'" \ - "static-libraries:static library:_path_files -g '*.a'" \ - "directories:directory:_path_files -g '*(/)'" && ret=0 - ;; -esac -return ret +_arguments -s "$args[@]" $files diff -Nru zsh-5.0.5/Completion/Unix/Command/_nmap zsh-5.0.7/Completion/Unix/Command/_nmap --- zsh-5.0.5/Completion/Unix/Command/_nmap 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_nmap 2014-10-07 18:11:30.000000000 +0000 @@ -22,7 +22,7 @@ '-iR[scan random hosts]:num hosts' \ '-p[specify ports to try]:port numbers' \ '-F[scan only ports listed in services file]' \ - '-D[perform decoy scan]:host list:->host-list' \ + '-D[perform decoy scan]:host list:_sequence -s, _hosts' \ '-S[specify source address]:address:_hosts' \ '-e[specify interface to use]:network interface:_net_interfaces' \ '-g[specify source port number]:port number' \ diff -Nru zsh-5.0.5/Completion/Unix/Command/_notmuch zsh-5.0.7/Completion/Unix/Command/_notmuch --- zsh-5.0.5/Completion/Unix/Command/_notmuch 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_notmuch 2014-10-07 18:11:30.000000000 +0000 @@ -13,6 +13,9 @@ 'dump:creates a plain-text dump of the tags of each message' 'restore:restores the tags from the given file' 'help:show details on a command' + 'compact:compact the notmuch database' + 'config:access the notmuch configuration file' + 'count:count messages matching the given search terms' ) _describe -t command 'command' notmuch_commands diff -Nru zsh-5.0.5/Completion/Unix/Command/_npm zsh-5.0.7/Completion/Unix/Command/_npm --- zsh-5.0.5/Completion/Unix/Command/_npm 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_npm 2014-10-07 18:11:30.000000000 +0000 @@ -1,19 +1,9 @@ #compdef npm -# Node Package Manager 0.3.15 completion, letting npm do all the completion work +# Node Package Manager completion, letting npm do all the completion work -_npm() { - compadd -- $(_npm_complete $words) -} +if type npm > /dev/null; then + eval "$(npm completion)" -# We want to show all errors of any substance, but never the "npm (not )ok" one. -# (Also doesn't consider "ERR! no match found" worth breaking the terminal for.) -_npm_complete() { - local ask_npm - ask_npm=(npm completion --color false --loglevel error -- $@) - { _call_program npm $ask_npm 2>&1 >&3 \ - | egrep -v '^(npm (not |)ok|ERR! no match found)$' >&2; \ - } 3>&1 -} - -_npm "$@" + _npm_completion "$@" +fi diff -Nru zsh-5.0.5/Completion/Unix/Command/_od zsh-5.0.7/Completion/Unix/Command/_od --- zsh-5.0.5/Completion/Unix/Command/_od 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_od 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,71 @@ +#compdef od + +local context state state_descr line args ret=1 +local -A opt_args + +args=( + '(-A --address-radix)'{-A+,--address-radix=}'[file offset base]:base:((d\:decimal o\:octal x\:hexadecimal n\:none))' + '(-j --skip-bytes)'{-j+,--skip-bytes=}'[skip specified bytes]:bytes' + '(-N --read-bytes)'{-N+,--read-bytes=}'[dump at most specified bytes]:bytes' + '*'{-t+,--format=}'[specify output format]:format string:->format' + '(-v --output-duplicates)'{-v,--output-duplicates}'[do not use * to mark line suppression]' + '-a[output named characters (-t a)]' + '-b[output octal bytes (-t o1)]' + '-c[output characters with C-style escape (-t c)]' + '-d[output unsigned decimal shorts (-t u2)]' + '-f[output single-precision floats (-t fF)]' + {-h,-x}'[output hexadecimal shorts (-t x2)]' + '-i[output decimal integers (-t dI)]' + {-l,-I,-L}'[output decimal longs (-t dL)]' + {-o,-B}'[output octal shorts (-t o2)]' + '-s[output decimal shorts (-t d2)]' + '*:files:_files' +) + +if _pick_variant gnu=GNU unix --version; then + # -h -B -I and -L are obsolescent and undocumented + args=( ${(R)args:#(|\*)(|\(*\))-[hBIL]*} ) + args+=( + {-S+,--strings=-}'[output strings of at least specfied bytes long]:length' + {-w-,--width=-}'[output specified bytes per line]:bytes' + '(- : *)--help[display help and exit]' + '(- : *)--version[output version information and exit]' + ) +else + args=( ${(R)args:#(|\*)(|\(*\))--*} ) # remove long options + case "$OSTYPE" in + (darwin*|freebsd*|dragonfly*|openbsd*) + args+=( + '-D[output unsigned decimal ints (-t u4)]' + {-e,-F}'[output double-precision floats (-t fD)]' + {-H,-X}'[output hexadecimal ints (-t x4)]' + '-O[output octal ints (-t o4)]' + ) + ;; + (*) + # POSIX options only + args=( ${(M)args:#(|\*)(|\(*\))-[AjNtvbcdosx]*} ) + ;; + esac +fi + +_arguments -s -S : "$args[@]" && return 0 + +case "$state" in + (format) + compset -P '*[acCSIL1248FDL]' + if compset -P '*[doux]'; then + args=( 'C:char' 'S:short' 'I:int' 'L:long' 1 2 4 8 ) + _describe -t integer-size 'size of integer' args && ret=0 + elif compset -P '*f'; then + args=( 'F:float' 'D:double' 'L:long double' ) + _describe -t float-size 'size of float' args && ret=0 + fi + args=( 'a:named character' 'c:character (C-style escape)' + 'd:decimal' 'o:octal' 'u:unsigned decimal' + 'x:hexadecimal' 'f:floating-point number' ) + _describe -t type-specifier 'type specifier' args && ret=0 + ;; +esac + +return ret diff -Nru zsh-5.0.5/Completion/Unix/Command/_perforce zsh-5.0.7/Completion/Unix/Command/_perforce --- zsh-5.0.5/Completion/Unix/Command/_perforce 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_perforce 2014-10-07 18:11:30.000000000 +0000 @@ -1203,9 +1203,11 @@ # probably ought to be optional (you can do it with tags if # you really want). if [[ $PREFIX = //[^/]# && $whole_path -eq 0 ]]; then - # Complete //clientname spec. Don't complete non-directories... + # Complete //clientname or //depot spec. + # Don't complete non-directories... # I don't actually know if they are valid here. - altfiles+=("clients:Perforce client:_perforce_clients") + altfiles+=("clients:Perforce client:_perforce_clients" + "depots:Perforce depot:_perforce_depots") else local donefiles=1 if [[ -z $dodirs ]]; then @@ -1229,10 +1231,15 @@ # "subdirs:subdirectory search:_perforce_subdirs" ) _alternative $altfiles - elif [[ -n $unmaintained && -z $dodirs ]]; then - # a la _cvs_nonentried_files: directories are never maintained, - # so skip 'em. Unmaintained files can't be integrated, opened - # or resolved, so treat as exclusive (just as well, since + elif [[ -n $unmaintained ]]; then + # As directories are always umaintained, but may contain files + # we want to add, we'll always complete directories here. That's + # neater than the alternative of excluding them here and requesting + # them separately in the caller. The only client for this + # branch is currently 'p4 add'. + # + # Unmaintained files can't be integrated, opened + # or resolved, so treat as exclusive to other options (just as well, since # this bit's messy). local MATCH MBEGIN MEND local -a omitpats @@ -1251,7 +1258,7 @@ [[ $#omitpats -eq 1 && $omitpats[1] = '' ]] && omitpats=() if (( ${#omitpats} )); then - _path_files -g "*~(*/|)(${(j:|:)~omitpats})(D.)" + _path_files -g "*~(*/|)(${(j:|:)~omitpats})(D)" else _path_files fi diff -Nru zsh-5.0.5/Completion/Unix/Command/_perl zsh-5.0.7/Completion/Unix/Command/_perl --- zsh-5.0.5/Completion/Unix/Command/_perl 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_perl 2014-10-07 18:11:30.000000000 +0000 @@ -4,6 +4,7 @@ # Adam Spiers # # Completions currently based on Perl 5.14.1. +typeset -A opt_args _perl () { _arguments -s \ @@ -16,8 +17,8 @@ '(-d -dt -dt:)-d\:-[run under control of a debugging/tracing module]:debugging/tracing module:_perl_modules --strip-prefix --perl-hierarchy=Devel' \ '(-d -dt -d: )-dt\:-[run under control of a debugging/tracing module (debugged coded uses threads)]:debugging/tracing module:_perl_modules --strip-prefix --perl-hierarchy=Devel' \ '-D-[set debugging flags]: :_perl_debugging_flags' \ - '( -E)*-e+[run one line of program]:one line of program' \ - '(-e )*-E+[like -e but enable all optional features]:one line of program: ' \ + '(1 -E)*-e+[run one line of program]:one line of program' \ + '(1 -e)*-E+[like -e but enable all optional features]:one line of program' \ '-f[disable executing $Config{sitelib}/sitecustomize.pl at startup]' \ '-F-[split() pattern for autosplit (-a)]:split() pattern, // is optional' \ '-h[list help summary]' \ @@ -27,21 +28,29 @@ \*{-m,-M}"-[module.. executes \`use/no module...' before executing your script]:module:_perl_m_opt" \ "-n[assume 'while (<>) { ... }' loop around your script]" \ "-p[assume loop like -n but print line also like sed]" \ - '-P[run script through C preprocessor before compilation (deprecated)]' \ "-s[enable some switch parsing for switches after script name]" \ "-S[look for the script using PATH environment variable]" \ '( -T)-t[turn on taint checks but only issue warnings]' \ '(-t )-T[turn on taint checks]' \ "-u[dump core after parsing script]" \ "-U[allow unsafe operations]" \ - "-v[print version number, patchlevel plus VERY IMPORTANT perl info]" \ + "-v[print version, patchlevel and license]" \ "-V-[print perl configuration information]:configuration keys:_perl_config_vars" \ '( -W -X)-w[turn warnings on for compilation of your script (recommended)]' \ "(-w -X)-W[enable all warnings (ignores 'no warnings')]" \ "(-w -W )-X[disable all warnings (ignores 'use warnings')]" \ - '-x-[strip off text before #!perl line and perhaps cd to directory]:directory to cd to:_files -/' \ - '1:Perl script:_files -/ -g "*.(p[ml]|PL|t)(-.)"' \ - '*::args: _normal' + '-x-[ignore text before #!perl line and optionally cd to directory]:directory to cd to:_files -/' \ + '1:Perl script:_files -g "*.(p[ml]|PL|t)(-.)"' \ + '*::args:= _perl_normal' +} + +_perl_normal() { + local expl + if [[ -z "$opt_args[(I)-(e|E)]" ]]; then + shift words + (( CURRENT-- )) + fi + _normal && ret=0 } _perl_m_opt () { diff -Nru zsh-5.0.5/Completion/Unix/Command/_pgrep zsh-5.0.7/Completion/Unix/Command/_pgrep --- zsh-5.0.5/Completion/Unix/Command/_pgrep 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_pgrep 2014-10-07 18:11:30.000000000 +0000 @@ -1,61 +1,118 @@ -#compdef pgrep pkill +#compdef pgrep pkill local context state line ret=1 expl typeset -A opt_args typeset -a arguments -arguments=('-P[parent process id]:parent process id:->ppid' - '-g[match only in process group ids]:group:->pgid' - '-G[match only real group id]:group:_groups' - '-s[match only session id]:session id:->sid' +arguments=('-P[parent process id]:parent process id:->ppid' + '-F[match only in process in pidfile]:files:_files' + '-g[match only in process group ids]:group:->pgid' + '-G[match only real group id]:group:_groups' + '-j[match only in processes inside jails]:jail id:->jid' + '-J[match only in project ids]:project id:->projid' + '-M[extract the name list from the specified core]:files:_files' + '-N[extract the name list from the specified system]:files:_files' + '-s[match only session id]:session id:->sid' '-t[match only controlled by terminal]:terminal device:->tty' - '-u[match only effective user id]:user:_users' - '-U[match only real user id]:user:_users' - '(-n)-o[oldest process]' - '(-o)-n[newest process]' - '-f[match against full command line]' - '-v[negate matching]' - '-x[match exactly]' - '*:process name:->pname') + '-T[match only in processes specified routing table in rtable]' + '-u[match only effective user id]:user:_users' + '-U[match only real user id]:user:_users' + '(-n)-o[oldest process]' + '(-o)-n[newest process]' + '-a[include process ancestors in the match list]' + '-c[print a count of matching processes]' + '-f[match against full command line]' + '-i[ignore case distinctions]' + '-I[confirmation before attempting to single each process]' + '-L[given pidfile must be locked]' + '-q[do not write anything to standard output]' + '-S[search also in system processes]' + '-v[negate matching]' + '-x[match exactly]' + '-z[match only in zones]:zone:_zones') -if [[ $service == 'pkill' ]] -then +if [[ $service == 'pkill' ]]; then arguments+=('-'${^signals}'[signal]') -elif [[ $service == 'pgrep' ]] -then +elif [[ $service == 'pgrep' ]]; then arguments+=('-d[output delimiter]:delimiter:compadd ${(s\:\:)IFS}' '-l[list name in addition to id]') fi +local optchars +case "$OSTYPE" in + linux*) + optchars="cflvxdnoPgsuUGt" + ;; + freebsd*) + optchars="LSafilnoqvxFGMNPUdgjstu" + ;; + openbsd*) + optchars="flnoqvxdGgPsTtUu" + ;; + darwin*) + optchars="LafilnoqvxFGPUdgtu" + ;; + solaris*) + optchars="flvxdnoPgsuUGJtTcz" + arguments=( ${arguments##-T*} ) + arguments=( ${arguments##-c*} ) + arguments+=( '-T[match only processes in task ids]:taskid:->task' ) + arguments+=( '-c[match only processes in contract ids]:taskid:->contract' ) + ;; + *) + optchars="flvxdnoPgsuUGt" + ;; +esac +arguments=( ${(M)arguments:#(|\*)(|\(*\))-[$optchars]*} + '*:process name:->pname') + _arguments -s -w $arguments && ret=0 case $state in (tty) - compset -P '*,' - - local -a used ttys - used=(${(s:,:)IPREFIX}) - + local -a ttys ttys=( /dev/tty*(N) /dev/pts/*(N) ) - _wanted tty expl 'terminal device' compadd -S ',' -q -F used ${ttys#/dev/} + _sequence -s , _wanted tty expl 'terminal device' compadd - ${ttys#/dev/} ;; - + (sid) + if [[ $OSTYPE == openbsd* ]]; then + break + fi + compset -P '*,' local -a used sid used=(${(s:,:)IPREFIX}) - sid=(${(uon)$(ps -A o sid=)}) + if [[ $OSTYPE == freebsd* ]]; then + sid=(${(uon)$(ps -ax -o sid=)}) + else + sid=(${(uon)$(ps -A -o sid=)}) + fi _wanted sid expl 'session id' compadd -S ',' -q -F used $sid ;; - + + (jid) + compset -P '*,' + + local -a used jid + used=(${(s:,:)IPREFIX}) + jid=(${(uon)$(ps -ax -o jid=)}) + + _wanted jid expl 'jail id' compadd -S ',' -q -F used $jid + ;; + (ppid) compset -P '*,' local -a used ppid used=(${(s:,:)IPREFIX}) - ppid=(${(uon)$(ps -A o ppid=)}) + if [[ $OSTYPE == (freebsd|openbsd|darwin)* ]]; then + ppid=(${(uon)$(ps -ax -o ppid=)}) + else + ppid=(${(uon)$(ps -A -o ppid=)}) + fi _wanted ppid expl 'parent process id' compadd -S ',' -q -F used $ppid ;; @@ -65,25 +122,77 @@ local -a used pgid used=(${(s:,:)IPREFIX}) - pgid=(${(uon)$(ps -A o pgid=)}) + if [[ $OSTYPE == (freebsd|openbsd|darwin)* ]]; then + pgid=(${(uon)$(ps -ax -o pgid=)}) + else + pgid=(${(uon)$(ps -A -o pgid=)}) + fi _wanted pgid expl 'process group id' compadd -S ',' -q -F used $pgid ;; - + + (projid) + compset -P '*,' + + local -a used projid + used=(${(s:,:)IPREFIX}) + projid=(${(uon)$(ps -A -o project=)}) + + _wanted projid expl 'project id' compadd -S ',' -q -F used $projid + ;; + + (contract) + compset -P '*,' + + local -a used ctid + used=(${(s:,:)IPREFIX}) + ctid=(${(uon)$(ps -A -o ctid=)}) + + _wanted ctid expl 'contract id' compadd -S ',' -q -F used $ctid + ;; + + (task) + compset -P '*,' + + local -a used taskid + used=(${(s:,:)IPREFIX}) + taskid=(${(uon)$(ps -A -o project=)}) + + _wanted taskid expl 'task id' compadd -S ',' -q -F used $taskid + ;; + (pname) local ispat="pattern matching " - if (( ${+opt_args[-x]} )) - then + if (( ${+opt_args[-x]} )); then ispat="" fi - if (( ${+opt_args[-f]} )) - then - _wanted pname expl $ispat'process command line' compadd ${(u)${(f)"$(ps -A o cmd=)"}} + + local command + if (( ${+opt_args[-f]} )); then + if [[ "$OSTYPE" == freebsd* ]] && (( ${+opt_args[-S]} )); then + command="$(ps -axH -o command=)" + elif [[ "$OSTYPE" == (freebsd|openbsd|darwin)* ]]; then + command="$(ps -ax -o command=)" + elif [[ "$OSTYPE" == solaris* ]]; then + command="$(ps -A -o args=)" + else + command="$(ps -A o cmd=)" + fi + _wanted pname expl $ispat'process command line' compadd ${(u)${(f)${command}}} else - _wanted pname expl $ispat'process name' compadd ${(u)${(f)"$(ps -A co cmd=)"}} + if [[ "$OSTYPE" == freebsd* ]] && (( ${+opt_args[-S]} )); then + command="$(ps -axcH -o command=)" + elif [[ "$OSTYPE" == (freebsd|openbsd|darwin)* ]]; then + command="$(ps -axc -o command=)" + elif [[ "$OSTYPE" == solaris* ]]; then + command="$(ps -A -o comm=)" + else + command="$(ps -A co cmd=)" + fi + _wanted pname expl $ispat'process name' compadd ${(u)${(f)${command}}} fi ;; - + esac && ret=0 return ret diff -Nru zsh-5.0.5/Completion/Unix/Command/_php zsh-5.0.7/Completion/Unix/Command/_php --- zsh-5.0.5/Completion/Unix/Command/_php 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_php 2014-10-07 18:11:30.000000000 +0000 @@ -7,7 +7,10 @@ typeset -A opt_args local -a args -local exclusions php_files=':PHP file:_files -g "*.php(-.)"' +local exclusions php_suffix + +zstyle -s ":completion:$curcontext" suffixes php_suffix '|' || php_suffix='php|phar' +local php_files=":PHP file:_files -g '*.($php_suffix)(-.)'" if _pick_variant php5=PHP\ 5 php4 --version; then exclusions="-B --process-begin -R --process-code -F --process-file -E --process-end" diff -Nru zsh-5.0.5/Completion/Unix/Command/_python zsh-5.0.7/Completion/Unix/Command/_python --- zsh-5.0.5/Completion/Unix/Command/_python 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_python 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,7 @@ -#compdef python +#compdef python python2 python2.4 python2.5 python2.6 python2.7 python3.0 python3.1 python3.2 python3.3 python3.4 -# Python 2.6 -# Python 3.0 +# Python 2.7 +# Python 3.4 local curcontext="$curcontext" state line expl typeset -A opt_args @@ -12,9 +12,12 @@ args=( '(-bb)-b[issue warnings about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' '(-b)-bb[issue errors about str(bytes_instance), str(bytearray_instance) and comparing bytes/bytearray with str]' + "-I[isolate Python from the user's environment]" + '-X[set implementation-specific option]:option' ) else args=( + '-R[use a pseudo-random salt to make hash values unpredeictable]' '-Q+[division options]:division option:(old warn warnall new)' '(-tt)-t[issue warnings about inconsistent tab usage]' '(-t)-tt[issue errors about inconsistent tab usage]' @@ -24,12 +27,12 @@ _arguments -C -s -S "$args[@]" \ "-B[don't write .py\[co\] files on import]" \ - '(1 -)-c+[program passed in as string (terminates option list)]:python command:' \ + '(1 -)-c+[program passed in as string (terminates option list)]:python command' \ '-d[debug output from parser]' \ '-E[ignore PYTHON* environment variables (such as PYTHONPATH)]' \ '(1 * -)-h[display help information]' \ '-i[inspect interactively after running script]' \ - '(1 * -)-m[run library module as a script (terminates option list)]:module:->modules' \ + '(1 -)-m[run library module as a script (terminates option list)]:module:->modules' \ '-O[optimize generated bytecode slightly]' \ '-OO[remove doc-strings in addition to the -O optimizations]' \ "-s[don't add user site directory to sys.path]" \ @@ -39,16 +42,25 @@ '(1 * -)-V[display version information]' \ '-W+[warning control]:warning filter (action\:message\:category\:module\:lineno):(default always ignore module once error)' \ '-x[skip first line of source, allowing use of non-Unix forms of #!cmd]' \ - '(-)1:script file:_files -g "*.py(|c|o)(-.)"' \ - '*::script argument: _normal' && return + '(-)1:Python script:_files -g "*.py(|c|o)(-.)"' \ + '*::script argument:= ->normal' && return -if [[ "$state" = modules ]]; then - local -a modules - modules=( - ${${=${(f)"$(_call_program modules $words[1] -c \ - 'from\ pydoc\ import\ help\;\ help\(\"modules\"\)')"}[2,-3]}:#\(package\)} - ) - _wanted modules expl module compadd -a modules && return -fi +case "$state" in + modules) + local -a modules + modules=( + ${${=${(f)"$(_call_program modules $words[1] -c \ + 'from\ pydoc\ import\ help\;\ help\(\"modules\"\)')"}[2,-3]}:#\(package\)} + ) + _wanted modules expl module compadd -a modules && return + ;; + normal) + if [[ -z "$opt_args[(I)-(c|m)]" ]]; then + shift words + (( CURRENT-- )) + fi + _normal && return + ;; +esac return 1 diff -Nru zsh-5.0.5/Completion/Unix/Command/_qemu zsh-5.0.7/Completion/Unix/Command/_qemu --- zsh-5.0.5/Completion/Unix/Command/_qemu 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_qemu 2014-10-07 18:11:30.000000000 +0000 @@ -47,7 +47,7 @@ '-S[do not start CPU at startup]' \ '-d[output log in /tmp/qemu.log]:log items:_qemu_log_items' \ '-hdachs[force hard disk 0 geometry (usually qemu can guess it)]:hd0 geometry c,h,s:' \ - '-std-vga[simulate standard VGA]' \ + '-vga[select video card type]:card type:(std cirrus vmware qxl xenfb none)' \ '-no-acpi[disable ACPI]' \ '-loadvm[start right away with a saved state]:file:_files' \ '-g[set initial graphic mode]:graphic mode:' \ diff -Nru zsh-5.0.5/Completion/Unix/Command/_quilt zsh-5.0.7/Completion/Unix/Command/_quilt --- zsh-5.0.5/Completion/Unix/Command/_quilt 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_quilt 2014-10-07 18:11:30.000000000 +0000 @@ -1,249 +1,206 @@ #compdef quilt -local -a tmp -local rc - -_quilt_applied () { - tmp=( ${(f)"$(quilt applied 2>&1)"} ) - rc=$? - if (( rc == 0 )); then - _wanted -V 'applied patches' expl 'patch' compadd "${tmp[@]}" - else - _message "No applied patches" - fi +local curcontext="$curcontext" state line +local help="(- : *)-h[show help information]" +local verbose='(-h)-v[verbose, more user friendly output]' +local color='(-h)--color=[use syntax coloring]:color:(always auto never)' +local pstyle='(-h)-p+[select patch style]:patch style:((0\:exclude\ top-level\ directory 1\:use\ .orig\ on\ top-level\ directory ab\:use\ a\ or\ b\ as\ top-level\ directory))' +local -a pform rcfile +pform=( + '(-U -c -C -h)-u[create a unified diff]' + '(-u -c -C -h)-U+[create a unified diff with num lines of context]:lines' + '(-u -U -C -h)-c[create a context diff]' + '(-u -U -c -h)-C+[create a context diff with num lines of context]:lines' +) +typeset -A opt_args + +_quilt_applied() { + local expl + _wanted -V patches expl patch compadd \ + ${(f)"$(_call_program patches quilt $rcfile applied)"} } -_quilt_series () { - _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} +_quilt_series() { + local expl + _wanted -V patches expl 'patch' compadd \ + ${(f)"$(_call_program patches quilt $rcfile series)"} } -_quilt_unapplied () { - tmp=( ${(f)"$(quilt unapplied 2>&1)"} ) - rc=$? - if (( rc == 0 )); then - _wanted -V 'unapplied patches' expl 'patch' compadd "${tmp[@]}" - else - _message "No unapplied patches" - fi +_quilt_unapplied() { + local expl + _wanted -V patches expl 'unapplied patch' compadd \ + ${(f)"$(_call_program patches quilt $rcfile unapplied)"} } -_arguments \ - '--trace[Runs the command in bash trace mode]' \ - '--quiltrc[Use the specified configuration file]:files:_files' \ - '--version[Print the version number and exit]' \ +_arguments $help \ + '--trace[run the command in bash trace mode]' \ + '--quiltrc=[use the specified configuration file]:files:_files' \ + '--version[print the version number and exit]' \ ':quilt command:(add annotate applied delete diff edit files fold fork graph grep header import mail new next patches pop previous push refresh remove rename revert series setup snapshot top unapplied upgrade)' \ - '*::subcmd:->subcmd' && return 0 + '*:: :->subcmd' && return -case "$state" in (subcmd) - case "$words[1]" in - (add) - _arguments '-h' \ - '-P[Patch to add files to]:quilt series:_quilt_series' \ - '*:files:_files' - ;; - (annotate) - _arguments '-h' \ - '-P[Stop checking for changes at the specified rather than the topmost patch]:quilt series:_quilt_series' \ - ':files:_files' - ;; - (applied) - _arguments '-h' \ - ':quilt series:_quilt_series' - ;; - (delete) - _arguments '-h' \ - '-n[Delete the next patch after topmost]' \ - '-r[Remove the deleted patch file from the patches directory as well]' \ - '--backup[Rename the patch file to patch~ rather than deleting it]' \ - ':quilt series:_quilt_series' - ;; - (diff) - _arguments '-h' \ - '-p[Select a patch style]:quilt patch style:(0 1 ab)' \ - '-u[Create a unified diff]' \ - '-U[Create a unified diff with num lines of context]:quilt unified diff: ' \ - '-c[Create a context diff]' \ - '-C[Create a context diff with num lines of context]:quilt context diff: ' \ - '--no-timestamps[Do not include file timestamps in patch headers]' \ - '--no-index[Do not output Index: lines]' \ - '-z[Write to standard output the changes that have been made relative to the topmost or specified patch]' \ - '-R[Create a reverse diff]' \ - '-P[Create a diff for the specified patch]:quilt series:_quilt_series' \ - '--combine[Create a combined diff for all patches between this patch and the patch specified with -P]:quilt series:_quilt_series' \ - '--snapshot[Diff against snapshot]' \ - '--diff=[Use the specified utility for generating the diff]:quilt select diff utility:_command_names -e' \ - '--color=[Use syntax coloring]:quilt select color:(always auto never)' \ - '--sort[Sort files by their name]' \ - '*:files:_files' - ;; - (edit) - _arguments '-h' \ - '*:files:_files' - ;; - (files) - _arguments '-h' \ - '-a[List all files in all applied patches]' \ - '-l[Add patch name to output]' \ - '-v[Verbose, more user friendly output]' \ - '--combine[Create a listing for all patches between this patch and the topmost or specified patch]:quilt series:_quilt_series' \ - ':quilt series:_quilt_series' - ;; - (fold) - _arguments '-h' \ - '-R[Apply patch in reverse]' \ - '-q[Quiet operation]' \ - '-f[Force apply]' \ - '-p[The number of pathname components to strip]:quilt select strip-level: ' - ;; - (fork) - _arguments '-h' - ;; - (graph) - _arguments '-h' \ - '--all[Generate a graph including all applied patches and their dependencies]' \ - '--reduce[Eliminate transitive edges from the graph]' \ - '--lines[Compute dependencies by looking at the lines the patches modify]:quilt select lines: ' \ - '--edge-labels=files[Label graph edges with the file names that the adjacent patches modify]' \ - '-T ps[Directly produce a PostScript output file]' \ - ':quilt series:_quilt_series' - ;; - (grep) - _arguments '-h' - ;; - (header) - _arguments '-h' \ - '-a[Append the exiting patch header]' \ - '-r[Replace the exiting patch header]' \ - '-e[Edit the header in $EDITOR]' \ - '--strip-diffstat[Strip diffstat output from the header]' \ - '--strip-trailing-whitespace[Strip trailing whitespace at the end of lines of the header]' \ - '--backup[Create a backup copy of the old version of a patch as patch~]' \ - ':quilt series:_quilt_series' - ;; - (import) - _arguments '-h' \ - '-p[Number of directory levels to strip when applying]:quilt select strip-level: ' \ - '-R[Apply patch in reverse]' \ - '-P[Patch filename to use inside quilt]:quilt select patch filename: ' \ - '-f[Overwrite/update existing patches]' \ - '-d[When overwriting in existing patch, keep the old (o), all (a), or new (n) patch header]:quilt select patch:(a n o)' \ - '*:files:_files' - ;; - (mail) - _arguments '-h' \ - '-m[Text to use as the text in the introduction]:quilt select text: ' \ - '-M[Like the -m option, but read the introduction from file]:files:_files' \ - '--prefix[Use an alternate prefix in the bracketed part of the subjects generated]:quilt select prefix: ' \ - '--mbox[Store all messages in the specified file in mbox format]:files:_files' \ - '--send[Send the messages directly]' \ - '--sender[The envelope sender address to use]:quilt select sender: ' \ - '--from[From header]:quilt select from: ' \ - '--subject[Subject header]:quilt select subject: ' \ - '--to[Append a recipient to the To header]:quilt select to: ' \ - '--cc[Append a recipient to the Cc header]:quilt select cc: ' \ - '--bcc[Append a recipient to the Bcc header]:quilt select bcc: ' \ - '--signature[Append the specified signature to messages]:files:_files' \ - '--reply-to[Add the appropriate headers to reply to the specified message]:quilt select reply-to: ' \ - '*:quilt series:_quilt_series' - ;; - (new) - _arguments '-h' \ - '-p[Select a patch style]:quilt patch style:(0 1 ab)' - ;; - (next) - _arguments '-h' \ - ':quilt series:_quilt_series' - ;; - (patches) - _arguments '-h' \ - '-v[Verbose, more user friendly output]' \ - ':files:_files' - ;; - (pop) - _arguments '-h' \ - '-a[Remove all applied patches]' \ - '-f[Force remove]' \ - '-R[Always verify if the patch removes cleanly]' \ - '-q[Quiet operation]' \ - '-v[Verbose operation]' \ - ':quilt applied:_quilt_applied' - ;; - (previous) - _arguments '-h' \ - ':quilt series:_quilt_series' - ;; - (push) - _arguments '-h' \ - '-a[Apply all patches in the series file]' \ - '-q[Quiet operation]' \ - '-f[Force apply, even if the patch has rejects]' \ - '-v[Verbose operation]' \ - '--fuzz[Set the maximum fuzz factor]' \ - '--merge=[Merge the patch file into the original files]:quilt select merge:(merge diff3)' \ - '--leave-rejects[Leave around the reject files patch produced]' \ - '--color=[Use syntax coloring]:quilt select color:(always auto never)' \ - ':quilt unapplied:_quilt_unapplied' - ;; - (refresh) - _arguments '-h' \ - '-p[Select a patch style]:quilt patch style:(0 1 ab)' \ - '-u[Create a unified diff]' \ - '-U[Create a unified diff with num lines of context]:quilt unified diff: ' \ - '-c[Create a context diff]' \ - '-C[Create a context diff with num lines of context]:quilt context diff: ' \ - '-z[Create a new patch containing the changes instead of refreshing the topmost patch]:quilt select new patch name: ' \ - '--no-timestamps[Do not include file timestamps in patch headers]' \ - '--no-index[Do not output Index: lines]' \ - '--diffstat[Add a diffstat section to the patch header, or replace the existing diffstat section]' \ - '-f[Enforce refreshing of a patch that is not on top]' \ - '--backup[Create a backup copy of the old version of a patch as patch~]' \ - '--sort[Sort files by their name instead of preserving the original order]' \ - '--strip-trailing-whitespace[Strip trailing whitespace at the end of lines]' \ - ':quilt series:_quilt_series' - ;; - (remove) - _arguments '-h' \ - '-P[Patch to remove]:quilt series:_quilt_series' - ;; - (rename) - _arguments '-h' \ - '-P[Patch to rename]:quilt series:_quilt_series' - ;; - (revert) - _arguments '-h' \ - '-P[Revert changes in the named patch]:quilt series:_quilt_series' \ - '*:files:_files' - ;; - (series) - _arguments '-h' \ - '-v[Verbose, more user friendly output]' - ;; - (setup) - _arguments '-h' \ - '-d[Optional path prefix for the resulting source tree]:quilt select path-prefix: ' \ - '--sourcedir[Directory that contains the package sources]:quilt select package sources directory: ' \ - '-v[Verbose debug output]' \ - '--fuzz[Set the maximum fuzz factor]' \ - ':files:_files' - ;; - (snapshot) - _arguments '-h' \ - '-d[Remove current snapshot]' - ;; - (top) - _arguments '-h' - ;; - (unapplied) - _arguments '-h' \ - ':quilt series:_quilt_series' - ;; - (upgrade) - _arguments '-h' - ;; - (*) - ;; - esac +[[ -z $state ]] && return 1 +rcfile=( ${opt_args[--quiltrc]:+--quiltrc=${opt_args[--quiltrc]}} ) +case $words[1] in + add) + _arguments -S $help \ + '-P+[specify patch to add files to]:patch:_quilt_applied' \ + '*:files:_files' && return + ;; + annotate) + _arguments $help \ + '-P[stop checking for changes at the specified rather than the topmost patch]:patch:_quilt_series' \ + ':files:_files' && return + ;; + applied) _arguments $help ':quilt series:_quilt_series' && return ;; + delete) + _arguments -s $help \ + '(:)-n[delete the next patch after topmost]' \ + '-r[remove the deleted patch file from the patches directory as well]' \ + '--backup[rename the patch file to patch~ rather than deleting it]' \ + '(-n):patch:_quilt_series' && return + ;; + diff) + _arguments -s $help $pstyle $pform $color \ + "--no-timestamps[don't include file timestamps in patch headers]" \ + "--no-index[don't output Index: lines]" \ + '(-P --snapshot)-z[show changes relative to the topmost or specified patch]' \ + '-R[create a reverse diff]' \ + '(-z --snapshot)-P[create a diff for the specified patch]:patch:_quilt_series' \ + '--combine[create a combined diff for all patches between this patch and the patch specified with -P]:patch:_quilt_series' \ + '(-P -z)--snapshot[diff against snapshot]' \ + '--diff=[use the specified utility for generating the diff]:diff utility:_command_names -e' \ + '--sort[sort files by name]' \ + '*:files:_files' && return + ;; + edit) _arguments $help '*:files:_files' && return ;; + files) + _arguments -s $help $verbose \ + '-a[list all files in all applied patches]' \ + '-l[add patch name to output]' \ + '--combine[create a listing for all patches between this patch and the topmost or specified patch]::patch:_quilt_series' \ + ':patch:_quilt_series' && return + ;; + fold) + _arguments -s $help \ + '-R[apply patch in reverse]' \ + '-q[quiet operation]' \ + '-f[force apply]' \ + '-p+[specify number of pathname components to strip]:components to strip' && return + ;; + fork) _arguments $help ':patch name' && return ;; + graph) + _arguments $help \ + '--all[include all applied patches and their dependencies]' \ + '--reduce[eliminate transitive edges from the graph]' \ + '--lines=-[compute dependencies by looking at lines patches modify]::number of lines' \ + '--edge-labels=files[label graph edges with file names that adjacent patches modify]' \ + '-T ps[produce a PostScript output file]' \ + ':patch:_quilt_series' && return + ;; + grep) _grep && return ;; + header) + _arguments $help \ + '(-r -e -h)-a[append to existing patch header]' \ + '(-a -e -h)-r[replace existing patch header]' \ + '(-a -r -h)-e[edit the header in $EDITOR]' \ + '--strip-diffstat[strip diffstat output from the header]' \ + '--strip-trailing-whitespace[strip trailing whitespace at the end of lines of the header]' \ + '--backup[create backup copy of patch with tilde suffix]' \ + ':patch:_quilt_series' && return + ;; + import) + _arguments $help \ + '-p+[number of directory levels to strip when applying]:quilt select strip-level: ' \ + '-R[apply patch in reverse]' \ + '-P+[patch filename to use inside quilt]:quilt select patch filename: ' \ + '-f[overwrite/update existing patches]' \ + '-d+[header resolution when overwriting in existing patch]:resolution:((a\:all\ headers n\:new\ headers o\:old\ headers))' \ + '*:files:_files' && return + ;; + mail) + _arguments $help \ + '(-h -M)-m[introduction text to use]:introduction text' \ + '(-h -m)-M[read introduction text from file]:file:_files' \ + '--prefix=[use an alternate prefix in the bracketed part of the subjects generated]:quilt select prefix: ' \ + '--mbox=[store all messages in the specified file in mbox format]:files:_files' \ + '--send[send the messages directly]' \ + '--sender=[specify envelope sender address to use]:sender:_email_addresses -c' \ + '--from=[from header]:address:_email_addresses' \ + '--subject=[subject header]:subject' \ + '*--to=[append a recipient to the To header]:recipient:_email_addresses' \ + '*--cc=[append a recipient to the Cc header]:recipient:_email_addresses' \ + '*--bcc=[append a recipient to the Bcc header]:recipient:_email_addresses' \ + '--signature=[append specified signature file to messages]:files:_files' \ + '--reply-to=[add reply address to message]:address:_email_addresses' \ + '*:patch:_quilt_series' && return + ;; + new) _arguments $help $pstyle ':patch name' && return ;; + next) _arguments $help ':patch:_quilt_series' && return ;; + patches) _arguments -S $help $verbose $color '*:files:_files' && return ;; + pop) + _arguments -s $help $verbose \ + '-a[remove all applied patches]' \ + '-f[force remove]' \ + '-R[always verify if the patch removes cleanly]' \ + '-q[quiet operation]' \ + ':patch:_quilt_applied' && return + ;; + previous) _arguments $help ':patch:_quilt_series' && return ;; + push) + _arguments $help $verbose $color \ + '-a[apply all patches in the series file]' \ + '-q[quiet operation]' \ + '-f[force apply, even if the patch has rejects]' \ + '--fuzz=[set the maximum fuzz factor]:factor [2]' \ + '--merge=[merge the patch file into the original files]::merge scheme:(merge diff3)' \ + '--leave-rejects[leave around the reject files patch produced]' \ + ':quilt unapplied:_quilt_unapplied' && return + ;; + refresh) + _arguments -s $help $pstyle $pform \ + '-z-[create a new patch containing the changes instead of refreshing the topmost patch]::new patch name' \ + '--no-timestamps[do not include file timestamps in patch headers]' \ + '--no-index[do not output Index: lines]' \ + '--diffstat[add a diffstat section to the patch header, or replace the existing diffstat section]' \ + '-f[enforce refreshing of a patch that is not on top]' \ + '--backup[create a backup copy of the old version of a patch as patch~]' \ + '--sort[sort files by their name instead of preserving the original order]' \ + '--strip-trailing-whitespace[strip trailing whitespace at the end of lines]' \ + ':patch:_quilt_series' && return + ;; + remove) + _arguments $help \ + '-P[patch to remove]:patch:_quilt_series' \ + '*:file:_files' && return + ;; + rename) + _arguments $help \ + '(-h)-P[patch to rename]:patch:_quilt_series' \ + ':new name' && return + ;; + revert) + _arguments $help \ + '-P[revert changes in the named patch]:patch:_quilt_series' \ + '*:files:_files' && return + ;; + series) _arguments $help $verbose $color && return ;; + setup) + _arguments $help $verbose \ + '-d[specify path prefix for resulting source tree]:prefix:_files -W / -P /' \ + '--sourcedir[specify location of package sources]:directory:_directories' \ + '--fuzz=[set the maximum fuzz factor]:factor' \ + ':files:_files' && return + ;; + snapshot) _arguments $help '-d[only remove current snapshot]' && return ;; + unapplied) _arguments $help ':patch:_quilt_series' && return ;; + top|upgrade) _arguments $help && return ;; + *) + _default + return ;; esac + +return 1 diff -Nru zsh-5.0.5/Completion/Unix/Command/_rm zsh-5.0.7/Completion/Unix/Command/_rm --- zsh-5.0.5/Completion/Unix/Command/_rm 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_rm 2014-10-07 18:11:30.000000000 +0000 @@ -32,13 +32,9 @@ case $state in (file) - declare -a ignored - ignored=() - ((CURRENT > 1)) && - ignored+=(${line[1,CURRENT-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - ((CURRENT < $#line)) && - ignored+=(${line[CURRENT+1,-1]//(#m)[\[\]()\\*?#<>~\^]/\\$MATCH}) - _files -F ignored && ret=0 + line[CURRENT]=() + line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} ) + _files -F line && ret=0 ;; esac diff -Nru zsh-5.0.5/Completion/Unix/Command/_rsync zsh-5.0.7/Completion/Unix/Command/_rsync --- zsh-5.0.5/Completion/Unix/Command/_rsync 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_rsync 2014-10-07 18:11:30.000000000 +0000 @@ -74,7 +74,8 @@ _arguments -s \ '*'{-v,--verbose}'[increase verbosity]' \ {--no-v,--no-verbose}'[turn off --verbose]' \ - '--bwlimit=[limit I/O bandwidth]:KBytes (etc.) per second' \ + '--bwlimit=[limit I/O bandwidth]:limit (KiB per second)' \ + '--outbuf=[set output buffering]:buffering:(none line block)' \ '--port=[specify alternate port number]:port:(873)' \ '--address=[bind to the specified address]:bind address:_bind_addresses' \ '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \ @@ -213,6 +214,7 @@ '--protocol=[force an older protocol version to be used]:number' \ '--info=[fine-grained informational verbosity]:comma-separated list' \ '--debug=[fine-grained debug verbosity]:comma-separated list' \ + '--msgs2stderr[special output handling for debugging]' \ '--munge-links[munge symlinks to make them safer, but unusable]' \ '--ignore-missing-args[ignore missing source args without error]' \ '--delete-missing-args[delete missing source args from destination]' \ @@ -222,6 +224,7 @@ '*'{-M=,--remote-option=}'[send option to the remote side only]:option string' \ '--preallocate[preallocate the full length of new files]' \ '--iconv=[request charset conversion of filenames]:number' \ + '--checksum-seed=:number' \ '--read-batch=[read a batched update from the specified file]:file:_files' } diff -Nru zsh-5.0.5/Completion/Unix/Command/_ruby zsh-5.0.7/Completion/Unix/Command/_ruby --- zsh-5.0.5/Completion/Unix/Command/_ruby 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_ruby 2014-10-07 18:11:30.000000000 +0000 @@ -1,43 +1,78 @@ -#compdef ruby -P -value-,RUBY(LIB|OPT|PATH),-default- +#compdef ruby irb erb -P (ruby|[ei]rb)[0-9.]# -value-,RUBY(LIB|OPT|PATH),-default- -# ruby 1.8.2 (2004-12-25) [i686-linux] - -local curcontext="$curcontext" state line expl ret=1 +local curcontext="$curcontext" state line expl desc RUBY ret=1 typeset -A opt_args +local -a opts irb all common charsets suf -local -a args opts +all=( + '*-r+[require the library before executing your script]:library name:->library' + '(--internal-encoding)-U[set internal encoding to UTF-8]' + '(-E --encoding -K --external-encoding)'{-E+,--encoding=}'[specify default external and internal character encodings]:charset:->charsets' + '(1 * -)'{-h,--help}'[print help message]' + '(1 * -)--version[print the version]' +) -args=( - '(-)1:script file:_files' - '*::script argument: _normal' +common=( + '*-I+[specify $LOAD_PATH directory (may be used more than once)]:library directory:_files -/' + '-w[turn warnings on for your script]' + '-W-[set warning level]:warning level:((0\:silent 1\:medium 2\:verbose))' + '(-)1:ruby script:_files -g "*.rb(-.)"' + '*::script argument:= ->normal' ) opts=( - '-0-[specify record separator]:input record separator in octal (default \0):' + '-0-[specify record separator]:input record separator in octal [default \0]' '-a[autosplit mode with -n or -p (splits $_ into $F)]' '-c[check syntax only]' - '-C+[cd to directory, before executing your script]:directory:_files -/' + '-C+[cd to directory before executing your script]:directory:_files -/' '(-d --debug)'{-d,--debug}'[set debugging flags (set $DEBUG to true)]' - "(1)*-e+[one line of script (several -e's allowed, omit program file)]:one line of script:" + "(1)*-e+[one line script (several -e's allowed, omit program file)]:one line of script" '-F-[split() pattern for autosplit (-a)]:input field separator:' '-i-[edit ARGV files in place (make backup if extension supplied)]:suffix for in-place-edit mode:(.bak)' - '*-I+[specify $LOAD_PATH directory (may be used more than once)]:library directory:_files -/' '-K-[specifies KANJI (Japanese) code-set]:KANJI encoding:((e\:EUC-JP s\:Shift_JIS u\:UTF-8 N\:None))' "-l[assume 'while gets(); ... end' loop around your script]" "(-p)-n[assume 'while gets(); ... end' loop around your script]" '(-n)-p[assume loop like -n but print line also like sed]' - '*-r+[require the library, before executing your script]:library name:->library' '-s[enable some switch parsing for switches after script name]' '-S[look for the script using PATH environment variable]' - '-T-[turn on tainting checks]:taint level (default 0):((0\:strings\ from\ streams/environment/ARGV\ are\ tainted 1\:no\ dangerous\ operation\ by\ tainted\ value 2\:process/file\ operations\ prohibited 3\:all\ generated\ objects\ are\ tainted 4\:no\ global\ \(non-tainted\)\ variable\ modification/no\ direct\ output))' + '-T-[turn on tainting checks]:taint level:((0\:strings\ from\ streams/environment/ARGV\ are\ tainted 1\:no\ dangerous\ operation\ by\ tainted\ value 2\:process/file\ operations\ prohibited 3\:all\ generated\ objects\ are\ tainted 4\:no\ global\ \(non-tainted\)\ variable\ modification/no\ direct\ output))' '(-v --verbose)'{-v,--verbose}'[print version number, then turn on verbose mode]' - '-w[turn warnings on for your script]' - '-W-[set warning level]:warning level (default 2):((0\:silent 1\:medium 2\:verbose))' - '(-y --yydebug)'{-y,--yydebug}'[enable yacc debugging in the parser]' '-x-[strip off text before #!ruby line and perhaps cd to directory]:directory:_files -/' '(1 * -)--copyright[print the copyright]' - '(1 * -)'{-h,--help}'[print help message]' - '(1 * -)--version[print the version]' + --{en,dis}able-{gems,rubyopt,all} + --{external,internal}'-encoding=:charset:->charsets' + '!'{-y,--yydebug} + '!--dump=:target:(version copyright usage yydebug syntax parsetree parsetree_with_comment insns)' +) + +irb=( + '-f[suppress read of ~/.irbrc]' + '(--noinspect)-m[bc mode (load mathn, fraction, matrix)]' + $opts[(r)*-d\[*] + '(--noinspect)--inspect[use inspect for output]' + "(--inspect)--noinspect[don't use inspect for output]" + '(--noreadline)--readline[use readline extension]' + "(--readline)--noreadline[don't use readline extension]" + '(--prompt --prompt-mode --inf-ruby-mode --simple-prompt --noprompt)'{--prompt,--prompt-mode}'[switch prompt mode]:prompt mode:(default simple xmp inf-ruby)' + '(--prompt --prompt-mode --inf-ruby-mode --simple-prompt --noprompt)'{--inf-ruby-mode,--simple-prompt,--noprompt} + '--tracer[display trace for each command execution]' + '--back-trace-limit[set limit for backtraces]:limit [16]:' + '!--irb_debug:level' + '--context-mode:n' + '(--noecho)--echo[show result]' + "(--echo)--noecho[don't show result]" + '--single-irb[share self with sub-irb]' + '(--noverbose)--verbose[show details]' + "(--verbose)--noverbose[don't show details]" +) + +erb=( + "-P[don't evaluate lines which start with %]" + '-S[specify safe level for running script]:level:(1 2 3 4)' + '-T[specify trim mode]:mode [0]:((0\:EOL\ remains 1\:EOL\ removed\ if\ line\ ends\ with\ %\> 2\:EOL\ removed\ if\ line\ starts\ with\ \<%\ and\ ends\ with\ %\> -\:EOL\ is\ removed\ if\ line\ ends\ with\ -%\>,\ leading\ whitespace\ removed\ after\ \<%-))' + '(-d --debug)'{-d,--debug}'[set debugging flags (set $DEBUG to true)]' + '-n[used with -x, prepends line number to output]' + '-x[convert eRuby to Ruby]' ) case "$service" in @@ -49,22 +84,48 @@ words=( fake "$words[@]" ) (( CURRENT++ )) _arguments -C -s : "${(@M)opts:#*-[IdvwrK](|[-+])\[*}" && ret=0 + RUBY=ruby + ;; + ruby[0-9.]#) + RUBY=$words[1] + _arguments -C -s -S : $opts $all $common && ret=0 + ;; + irb[0-9.]#) + RUBY=${words[1]/irb/ruby} + _arguments -C -s : $irb $all $common && ret=0 ;; - ruby) - _arguments -C -s -S : "$opts[@]" "$args[@]" && ret=0 + erb[0-9.]#) + RUBY=${words[1]/irb/ruby} + _arguments -C -s : $erb $all \ + '*:erb file:_files -g "*.erb(-.)"' && ret=0 ;; esac case "$state" in + normal) + if (( ! $+opt_args[-e] )); then + shift words + (( CURRENT-- )) + fi + _normal && ret=0 + ;; + charsets) + charsets=( $(_call_program charsets $RUBY -e 'puts\ Encoding.list' 2>/dev/null) ) + # could also add Encoding.aliases.map(&:first) for aliases + desc='charset' + if [[ $curcontext = *option-E-1 ]]; then + if compset -P '*:'; then + desc='internal charset' + else + desc='external charset' + compset -S ':*' || suf=( -S: ) + fi + fi + _wanted charsets expl $desc compadd $suf -a charsets && ret=0 + ;; library) local -a dirs - local cmd - if [[ "$service" = *RUBYOPT* ]]; then - cmd=ruby - else - cmd=$words[1] - fi - dirs=( $(_call_program directories $cmd -e 'puts\ \$:' 2>/dev/null) ${(s.:.)opt_args[-I]} ) + dirs=( $(_call_program libraries $RUBY -e 'puts\ \$:' 2>/dev/null) ${(s.:.)opt_args[-I]} ) _wanted libraries expl library _path_files -W dirs && ret=0 ;; esac diff -Nru zsh-5.0.5/Completion/Unix/Command/_ssh zsh-5.0.7/Completion/Unix/Command/_ssh --- zsh-5.0.5/Completion/Unix/Command/_ssh 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_ssh 2014-10-07 18:11:30.000000000 +0000 @@ -108,7 +108,7 @@ _arguments \ '-q[silence ssh-keygen]' \ "($cmds -P)-b[specify number of bits in key]:bits in key" \ - "($cmds -P)-t[specify the type of the key to create]:key type:(rsa1 rsa dsa ecdsa)" \ + "($cmds -P)-t[specify the type of the key to create]:key type:(rsa1 rsa dsa ecdsa ed25519)" \ "(${cmds#-p })-N[provide new passphrase]:new passphrase" \ "($cmds -b -t)-C[provide new comment]:new comment" \ '(-D)-f[key file]:key file:_files' \ @@ -223,6 +223,7 @@ 'ecdsa-sha2-nistp256-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp384-cert-v01@openssh.com' \ 'ecdsa-sha2-nistp521-cert-v01@openssh.com' \ + 'ssh-ed25519-cert-v01@openssh.com' \ 'ssh-rsa-cert-v01@openssh.com' \ 'ssh-dss-cert-v01@openssh.com' \ 'ssh-rsa-cert-v00@openssh.com' \ @@ -230,6 +231,7 @@ 'ecdsa-sha2-nistp256' \ 'ecdsa-sha2-nistp384' \ 'ecdsa-sha2-nistp521' \ + 'ssh-ed25519' \ 'ssh-rsa' \ 'ssh-dss' && ret=0 ;; diff -Nru zsh-5.0.5/Completion/Unix/Command/_stgit zsh-5.0.7/Completion/Unix/Command/_stgit --- zsh-5.0.5/Completion/Unix/Command/_stgit 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_stgit 2014-10-07 18:11:30.000000000 +0000 @@ -32,6 +32,17 @@ compadd $(stg series --noprefix 2> /dev/null) \ && ret=0 ;; + (ref*) + last_word="$words[$CURRENT-1]" + refresh_patch_options=( -p --patch ) + if [[ -n ${refresh_patch_options[(r)$last_word]} ]]; then + _wanted -V "applied patches" expl "patch" \ + compadd ${${(M)${(f)"$(stg series 2> /dev/null)"}##[+>] *}#[+>] } \ + && ret=0 + else + _files + fi + ;; (*) _files ;; diff -Nru zsh-5.0.5/Completion/Unix/Command/_sysctl zsh-5.0.7/Completion/Unix/Command/_sysctl --- zsh-5.0.5/Completion/Unix/Command/_sysctl 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_sysctl 2014-10-07 18:11:30.000000000 +0000 @@ -1,9 +1,9 @@ #compdef sysctl case $OSTYPE in - *freebsd[5-9].*|freebsd4.[4-9]*) + *freebsd<5->.*|freebsd4.[4-9]*) local -a sysctlvars - sysctlvars=( $(sysctl -aN) ) + sysctlvars=( $(_call_program sysctl-variables sysctl -aN) ) _arguments -s -A "-*" \ '(*)-a[list all]' \ '-b[binary output]' \ @@ -41,5 +41,8 @@ '(-w)-n[show only values]' \ '(-a -A -n)-w[write variable]' \ '(-a -A)*:sysctl variable:_multi_parts ${words[(r)-w]:+-S=} -i . _cache_sysctlvars' - ;; + ;; + *) + _default + ;; esac diff -Nru zsh-5.0.5/Completion/Unix/Command/_tmux zsh-5.0.7/Completion/Unix/Command/_tmux --- zsh-5.0.5/Completion/Unix/Command/_tmux 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_tmux 2014-10-07 18:11:30.000000000 +0000 @@ -573,12 +573,13 @@ local -a args args=( '-d[do not attach new session to current terminal]' + '-A[attach to existing session if it already exists]' '-n[name the initial window]:window name' - '-s[name the session]:session name' + '-s[name the session]:session name:__tmux-sessions' '-t[specify target session]:sessions:__tmux-sessions' '*:: :_command' ) - _arguments ${args} + _arguments -s ${args} } function _tmux-new-window() { diff -Nru zsh-5.0.5/Completion/Unix/Command/_wget zsh-5.0.7/Completion/Unix/Command/_wget --- zsh-5.0.5/Completion/Unix/Command/_wget 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_wget 2014-10-07 18:11:30.000000000 +0000 @@ -14,6 +14,7 @@ '(--quiet -q --verbose -v --no-verbose -nv)'{--quiet,-q}'[turn off output]' \ '(--quiet -q --verbose -v --no-verbose -nv)'{--verbose,-v}'[turn on verbose output]' \ '*-n+[turn off flags]:flags:->noflags' \ + '--report-speed=:type:(bits)' \ '(--input-file -i)'{--input-file=,-i+}'[specify input file]:file containing URLs:_files' \ '(--force-html -F)'{--force-html,-F}'[treat input file as html]' \ '(--base -B)'{--base=,-B+}'[prepend URL to relative links]:base URL:_urls' \ @@ -47,6 +48,7 @@ '--prefer-family[connect first to addresses of specified family]:address family:(IPv6 IPv4 none)' \ '(--http-user --ftp-user)--user[set both ftp and http user]:user' \ '(--http-password --ftp-password)--password[set both ftp and http password]:password' \ + '(--password --http-password --ftp-password)--ask-password:[prompt for passwords]' \ '--no-iri[turn off IRI support]' \ '--local-encoding=[specify local encoding for IRIs]:encoding' \ '--remote-encoding=[specify default remote encoding]:encoding' \ @@ -56,12 +58,13 @@ '(--directory-prefix -P)'{--directory-prefix=,-P+}'[specify prefix to save files to]:prefix:_files -/' \ '--cut-dirs=:number:' \ '(--user)--http-user=:user' \ - '(--password)--http-password=:password' \ + '(--password --ask-password)--http-password=:password' \ '--no-cache[disallow server-cached data]' \ '--default-page=[specify default page name, normally index.html]' \ '(--adjust-extension -E)'{--adjust-extension,-E}'[save all HTML/CSS documents with proper extensions]' \ "--ignore-length[ignore \`Content-Length' header field]" \ '*--header=:string' \ + '--max-redirect=:number' \ '--proxy-user=:user' \ '--proxy-password=:password' \ '--referer=:URL:_urls' \ @@ -74,9 +77,14 @@ '--keep-session-cookies[load and save session cookies]' \ '--post-data=[use the POST method with specified data]:data to send' \ '--post-file=[use the POST method; sending contents of a file]:file:_files' \ + '--method=[use specified HTTP method]:method:(GET POST HEAD DELETE)' \ + '(--body-file)--body-data=[send string as data]:string' \ + '(--body-data)--body-file=[send contents of file]:file:_files' \ '--content-disposition[honor the Content-Disposition header when choosing local file names]' \ + '--content-on-error[output received content on server errors]' \ "--auth-no-challenge[send basic HTTP authentication without first waiting for server's challenge]" \ '--secure-protocol=[choose secure protocol]:protocol:(SSLv2 SSLv3 TLSv1)' \ + --https-only \ "--no-check-certificate=[don't check the server certificate]" \ '--certificate=[specify client certificate]:client certificate file:_files' \ '--certificate-type=[specify client certificate type]:certificate type:(PEM DER)' \ @@ -87,22 +95,27 @@ '--random-file[specify file with random data for seeding generator]:file:_files' \ '--egd-file=[specify filename of EGD socket]:file:_files' \ '(--user)--ftp-user=:user' \ - '(--password)--ftp-password=:password' \ + '(--password --ask-password)--ftp-password=:password' \ "--no-remove-listing[don't remove \`.listing' files]" \ '--no-glob[turn off FTP file name globbing]' \ '--no-passive-ftp' \ - '--retr-symlinks' \ '--preserve-permissions[preserve remote file permissions with ftp]' \ + '--retr-symlinks' \ + '--warc-file=:file:_files' --warc-header=:string --warc-max-size=:number \ + --warc-cdx --warc-dedup=:file:_files --no-warc-compression --no-warc-digests \ + --no-warc-keep-log --warc-tempdir=:directory:_directories \ '(--recursive -r)'{--recursive,-r}'[recurse subdirectories]' \ '(--level -l)'{--level=,-l+}'[specify maximum recursion depth]:level' \ '--delete-after' \ '(--convert-links -k)'{--convert-links,-k}'[convert links to be relative]' \ + '--backups=:max backups' \ '(--backup-converted -K)'{--backup-converted,-K}'[backup files before conversion]' \ '(--mirror -m -r -N -l)'{--mirror,-m}'[mirror (-r -N -l inf --no-remove-listing)]' \ '(--page-requisites -p)'{--page-requisites,-p}'[get all images needed to display page]' \ '--strict-comments[turn on strict (SGML) handling of HTML comments]' \ '(--accept -A)'{--accept=,-A+}'[specify accepted extensions]:extensions' \ '(--reject -R)'{--reject=,-R+}'[specify rejected extensions]:extensions' \ + --{accept,reject}-regex=:regex '--regex-type=:regex type:(posix pcre)' \ '(--domains -D)'{--domains=,-D+}'[specify accepted domains]:domains:_domains' \ '--exclude-domains=:rejected domains:_domains' \ '--follow-ftp' \ diff -Nru zsh-5.0.5/Completion/Unix/Command/_zfs zsh-5.0.7/Completion/Unix/Command/_zfs --- zsh-5.0.5/Completion/Unix/Command/_zfs 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_zfs 2014-10-07 18:11:30.000000000 +0000 @@ -221,7 +221,7 @@ ("create") _arguments -A "-*" \ '-p[Create parent datasets]' \ - '-o[Set initial properties]:property:_values -s , "property" $create_properties' \ + '*-o[Set initial properties]:property:_values -s , "property" $create_properties' \ - set1 \ ':filesystem:_zfs_dataset -t fs -e "parent dataset"' \ - set2 \ @@ -246,7 +246,7 @@ ("snapshot") _arguments -A "-*" \ '-r[Recursively snapshot all descendant datasets]' \ - '-o[Set property]:property:_values -s , "property" $create_properties' \ + '*-o[Set property]:property:_values -s , "property" $create_properties' \ ':filesystem/volume:_zfs_dataset -t fs -t vol -S@' ;; @@ -263,7 +263,7 @@ _arguments -A "-*" \ '-p[Create parent datasets]' \ '-K[Create encryption key]' \ - '-o[Set property]:property:_values -s , "property" $create_properties' \ + '*-o[Set property]:property:_values -s , "property" $create_properties' \ ':snapshot:_zfs_dataset -t snap' \ ':filesystem/volume:_zfs_dataset -t fs -e "parent dataset"' ;; diff -Nru zsh-5.0.5/Completion/Unix/Command/_zip zsh-5.0.7/Completion/Unix/Command/_zip --- zsh-5.0.5/Completion/Unix/Command/_zip 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Command/_zip 2014-10-07 18:11:30.000000000 +0000 @@ -104,11 +104,8 @@ case $state in suffixes) - compset -P '*:' - compset -S ':*' || suf=":." suffixes=( *.*(N:e) ) - _wanted suffixes expl suffixes \ - compadd -S "$suf" -r ": \t" .$^suffixes && return + _sequence -s : _wanted -x suffixes expl suffix compadd - .$^suffixes && return ;; files) if [[ $service = zip ]] && (( ! ${+opt_args[-d]} )); then diff -Nru zsh-5.0.5/Completion/Unix/.distfiles zsh-5.0.7/Completion/Unix/.distfiles --- zsh-5.0.5/Completion/Unix/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/Unix/Type/.distfiles zsh-5.0.7/Completion/Unix/Type/.distfiles --- zsh-5.0.5/Completion/Unix/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,56 +1,2 @@ DISTFILES_SRC=' -.distfiles -_arch_archives -_arch_namespace -_bind_addresses -_canonical_paths -_ctags_tags -_dict_words -_diff_options -_dir_list -_directories -_domains -_email_addresses -_file_systems -_files -_global_tags -_groups -_have_glob_qual -_hosts -_java_class -_ld_debug -_list_files -_locales -_mailboxes -_mime_types -_my_accounts -_net_interfaces -_newsgroups -_other_accounts -_path_commands -_path_files -_pdf -_perl_basepods -_perl_modules -_pids -_ports -_postscript -_printers -_ps1234 -_pspdf -_remote_files -_services -_signals -_tar_archive -_terminals -_texi -_tilde_files -_time_zone -_urls -_user_at_host -_users -_users_on -_zfs_dataset -_zfs_keysource_props -_zfs_pool ' diff -Nru zsh-5.0.5/Completion/Unix/Type/_mime_types zsh-5.0.7/Completion/Unix/Type/_mime_types --- zsh-5.0.5/Completion/Unix/Type/_mime_types 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/_mime_types 2014-10-07 18:11:30.000000000 +0000 @@ -33,10 +33,10 @@ compset -p $(( ${#maintype} + 1 )) _wanted mime-subtypes expl 'MIME subtype' \ compadd -- $(sed -ne "s%^\(type=\|\)${maintype}/\([^ ]*\).*$%\2%p" \ - $type_files) + $type_files 2>/dev/null) else # Search for main type. _wanted mime-types expl 'MIME type' \ compadd -S/ -- $(sed -ne "s/^type=//" \ - -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files) + -e "s%^\(${PREFIX:-[a-z]}[^=\"]*\)/.*$%\1%p" $type_files 2>/dev/null) fi diff -Nru zsh-5.0.5/Completion/Unix/Type/_net_interfaces zsh-5.0.7/Completion/Unix/Type/_net_interfaces --- zsh-5.0.5/Completion/Unix/Type/_net_interfaces 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/_net_interfaces 2014-10-07 18:11:30.000000000 +0000 @@ -3,6 +3,10 @@ local expl list intf sep local -a disp +# Make sure needed tools are in the path. +local PATH=$PATH +PATH=/sbin:$PATH + case $OSTYPE in aix*) intf=( ${(f)"$(lsdev -C -c if -F 'name:description')"} ) @@ -14,17 +18,22 @@ ;; darwin*|freebsd*|dragonfly*) intf=( $(ifconfig -l) ) ;; irix*) intf=( ${${${(f)"$(/usr/etc/netstat -i)"}%% *}[2,-1]} ) ;; + *linux*) + if (( $+commands[ip] )); then + intf=( ${${(m)${(f)"$(ip -o link)"}#*: }%%: *} ) + fi + ;& *) - # Make sure ifconfig is in the path. - local PATH=$PATH - PATH=/sbin:$PATH - intf=( $(ifconfig -a 2>/dev/null | sed -n 's/^\([^ :]*\).*/\1/p') ) - if [[ ${#intf} -eq 0 && -d /proc/sys/net/ipv4/conf ]]; then - # On linux we used to use the following as the default. - # However, we now use ifconfig since it finds additional devices such - # as tunnels. So only do this if that didn't work. - intf=( /proc/sys/net/ipv4/conf/*~*(all|default)(N:t) ) + if [[ ${#intf} -eq 0 ]]; then + # linux's deprecated ifconfig may truncate long interface names + intf=( $(ifconfig -a 2>/dev/null | sed -n 's/^\([^ :]*\).*/\1/p') ) + if [[ -d /proc/sys/net/ipv4/conf ]]; then + # On linux we used to use the following as the default. + # However, we now use ip or ifconfig since it finds additional devices such + # as tunnels. So only do this if that didn't work. + intf=( /proc/sys/net/ipv4/conf/*~*(all|default)(N:t) ) + fi fi ;; esac diff -Nru zsh-5.0.5/Completion/Unix/Type/_path_files zsh-5.0.7/Completion/Unix/Type/_path_files --- zsh-5.0.5/Completion/Unix/Type/_path_files 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/_path_files 2014-10-07 18:11:30.000000000 +0000 @@ -15,13 +15,21 @@ # a bare glob qualifier. # The later test looks for an outstanding quote. if _have_glob_qual $PREFIX; then - compset -p ${#match[1]} - if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then - _globflags - else - _globquals - fi - return + local ret=1 + compset -p ${#match[1]} + if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then + _globflags && ret=0 + else + if [[ $_comp_caller_options[extendedglob] == on ]]; then + local -a flags + flags=( + '#:introduce glob flag' + ) + _describe -t globflags "glob flag" flags -Q -S '' && ret=0 + fi + _globquals && ret=0 + fi + return ret fi # Utility function for in-path completion. This allows `/u/l/b' @@ -564,9 +572,10 @@ ( "$ignpar" != *dir* || "$pats" = '*(-/)' ) && ( "$ignpar" != *..* || "$tmp1[1]" = *../* ) ]]; then - compfiles -i tmp1 _comp_ignore "$ignpar" "$prepath$realpath$donepath" + compfiles -i tmp1 ignore "$ignpar" "$prepath$realpath$donepath" + _comp_ignore+=( ${(@)ignore#$prepath$realpath$donepath} ) - (( $#_comp_ignore && $mopts[(I)-F] )) || + (( $#_comp_ignore && ! $mopts[(I)-F] )) && mopts=( "$mopts[@]" -F _comp_ignore ) fi diff -Nru zsh-5.0.5/Completion/Unix/Type/_pids zsh-5.0.7/Completion/Unix/Type/_pids --- zsh-5.0.5/Completion/Unix/Type/_pids 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/_pids 2014-10-07 18:11:30.000000000 +0000 @@ -20,25 +20,30 @@ nm="$compstate[nmatches]" fi -out=( "${(@f)$(_call_program processes ps 2>/dev/null)}" ) -desc="$out[1]" -out=( "${(@M)out[2,-1]:#${~match}}" ) +while _tags; do + if _requested processes; then + while _next_label processes expl 'process ID'; do + out=( "${(@f)$(_call_program $curtag ps 2>/dev/null)}" ) + desc="$out[1]" + out=( "${(@M)out[2,-1]:#${~match}}" ) -if [[ "$desc" = (#i)(|*[[:blank:]])pid(|[[:blank:]]*) ]]; then - pids=( "${(@)${(@M)out#${(l.${#desc[1,(r)(#i)[[:blank:]]pid]}..?.)~:-}[^[:blank:]]#}##*[[:blank:]]}" ) -else - pids=( "${(@)${(@M)out##[^0-9]#[0-9]#}##*[[:blank:]]}" ) -fi - -if zstyle -T ":completion:${curcontext}:processes" verbose; then - list=( "${(@Mr:COLUMNS-1:)out}" ) - desc=(-ld list) -else - desc=() -fi + if [[ "$desc" = (#i)(|*[[:blank:]])pid(|[[:blank:]]*) ]]; then + pids=( "${(@)${(@M)out#${(l.${#desc[1,(r)(#i)[[:blank:]]pid]}..?.)~:-}[^[:blank:]]#}##*[[:blank:]]}" ) + else + pids=( "${(@)${(@M)out##[^0-9]#[0-9]#}##*[[:blank:]]}" ) + fi -_wanted -V processes expl 'process ID' \ - compadd "$@" "$desc[@]" "$all[@]" -a - pids && ret=0 + if zstyle -T ":completion:${curcontext}:$curtag" verbose; then + list=( "${(@Mr:COLUMNS-1:)out}" ) + desc=(-ld list) + else + desc=() + fi + compadd "$@" "$expl[@]" "$desc[@]" "$all[@]" -a pids && ret=0 + done + fi + (( ret )) || break +done if [[ -n "$all" ]]; then zstyle -s ":completion:${curcontext}:processes" insert-ids out || out=menu diff -Nru zsh-5.0.5/Completion/Unix/Type/_users zsh-5.0.7/Completion/Unix/Type/_users --- zsh-5.0.5/Completion/Unix/Type/_users 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Unix/Type/_users 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,4 @@ -#compdef passwd groups userdel chage chfn chsh +#compdef passwd groups userdel chage chfn local expl users diff -Nru zsh-5.0.5/Completion/X/Command/.distfiles zsh-5.0.7/Completion/X/Command/.distfiles --- zsh-5.0.5/Completion/X/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,36 +1,2 @@ DISTFILES_SRC=' -.distfiles -_acroread -_dcop -_gnome-gv -_gqview -_gv -_kfmclient -_matlab -_mozilla -_mplayer -_nautilus -_nedit -_netscape -_okular -_pdftk -_qiv -_setxkbmap -_urxvt -_vnc -_x_utils -_xauth -_xclip -_xdvi -_xfig -_xloadimage -_xmodmap -_xournal -_xpdf -_xscreensaver -_xset -_xterm -_xv -_xwit -_xrandr ' diff -Nru zsh-5.0.5/Completion/X/Command/_mplayer zsh-5.0.7/Completion/X/Command/_mplayer --- zsh-5.0.5/Completion/X/Command/_mplayer 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/Command/_mplayer 2014-10-07 18:11:30.000000000 +0000 @@ -115,7 +115,7 @@ _tags files urls while _tags; do _requested files expl 'media file' _files -g \ - "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|ogv|qt|rm|ts|vob|wav|webm|wma|wmv)(-.)" && ret=0 + "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4a|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|ogv|qt|rm|ts|vob|wav|webm|wma|wmv)(-.)" && ret=0 if _requested urls; then while _next_label urls expl URL; do _urls "$expl[@]" && ret=0 diff -Nru zsh-5.0.5/Completion/X/Command/_x_utils zsh-5.0.7/Completion/X/Command/_x_utils --- zsh-5.0.5/Completion/X/Command/_x_utils 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/Command/_x_utils 2014-10-07 18:11:30.000000000 +0000 @@ -69,7 +69,7 @@ '-rv' ;; xhost) - local expl type ret=1 tmp match + local type tmp match if compset -P '-'; then tmp=(${(f)"$(xhost)"}) diff -Nru zsh-5.0.5/Completion/X/.distfiles zsh-5.0.7/Completion/X/.distfiles --- zsh-5.0.5/Completion/X/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/X/Type/.distfiles zsh-5.0.7/Completion/X/Type/.distfiles --- zsh-5.0.5/Completion/X/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,10 +1,2 @@ DISTFILES_SRC=' -.distfiles -_x_borderwidth _x_font _x_resource -_x_color _x_geometry _x_selection_timeout -_x_colormapid _x_keysym _x_title -_x_cursor _x_locale _x_window -_x_display _x_modifier _xt_session_id -_x_extension _x_name _x_visual -_xft_fonts ' diff -Nru zsh-5.0.5/Completion/X/Utility/.distfiles zsh-5.0.7/Completion/X/Utility/.distfiles --- zsh-5.0.5/Completion/X/Utility/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/X/Utility/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -_x_arguments _xt_arguments ' diff -Nru zsh-5.0.5/Completion/Zsh/Command/.distfiles zsh-5.0.7/Completion/Zsh/Command/.distfiles --- zsh-5.0.5/Completion/Zsh/Command/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,51 +1,2 @@ DISTFILES_SRC=' -.distfiles -_alias -_bindkey -_builtin -_cd -_command -_compdef -_dirs -_disable -_echotc -_echoti -_emulate -_enable -_fc -_hash -_jobs_builtin -_kill -_limit -_mere -_precommand -_print -_prompt -_read -_run-help -_sched -_set -_setopt -_source -_stat -_tcpsys -_trap -_ttyctl -_typeset -_ulimit -_unhash -_unsetopt -_vared -_wait -_which -_zattr -_zcompile -_zed -_zftp -_zle -_zmodload -_zmv -_zpty -_zstyle -_ztodo ' diff -Nru zsh-5.0.5/Completion/Zsh/Command/_kill zsh-5.0.7/Completion/Zsh/Command/_kill --- zsh-5.0.5/Completion/Zsh/Command/_kill 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/_kill 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,7 @@ #compdef kill local curcontext="$curcontext" line state ret=1 +typeset -A opt_args _arguments -C \ '(-s -l 1)-n[specify signal number]:signal number' \ @@ -10,9 +11,12 @@ '*:processes:->processes' && ret=0 if [[ -n "$state" ]]; then + local pgrp='process-groups:: _wanted ' + [[ -n "$opt_args[(i)-[ns]]${${(@)line:#--}}" && -prefix - ]] && pgrp+='-x ' + pgrp+="process-groups expl 'process-group' compadd - 0" _alternative \ 'processes:: _pids' \ - 'jobs:: _jobs -t' && ret=0 + 'jobs:: _jobs -t' $pgrp && ret=0 fi return ret diff -Nru zsh-5.0.5/Completion/Zsh/Command/_setopt zsh-5.0.7/Completion/Zsh/Command/_setopt --- zsh-5.0.5/Completion/Zsh/Command/_setopt 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/_setopt 2014-10-07 18:11:30.000000000 +0000 @@ -1,10 +1,16 @@ -#compdef setopt +#compdef setopt unsetopt -# If you first want to complete only unset options, un-comment the lines -# setting the _options_unset array and then use: -# -# _options_unset || _options -# -# here. +local expl ret=1 +local -a onopts offopts +onopts=( ${(k)_comp_caller_options[(R)on]} ) +offopts=( ${(k)_comp_caller_options[(R)off]} ) +case $service in + setopt) onopts=(no$onopts) ;; + unsetopt) offopts=(no$offopts) ;; +esac +_wanted zsh-options expl 'zsh options (set)' \ + compadd -J 'enabled options' -M 'M:_= M:{A-Z}={a-z}' -k - onopts && ret=0 +_wanted zsh-options expl 'zsh options (unset)' \ + compadd -J 'disabled options' -M 'M:_= M:{A-Z}={a-z}' -k - offopts && ret=0 -_options +return ret diff -Nru zsh-5.0.5/Completion/Zsh/Command/_typeset zsh-5.0.7/Completion/Zsh/Command/_typeset --- zsh-5.0.5/Completion/Zsh/Command/_typeset 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/_typeset 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,7 @@ #compdef autoload declare export functions integer float local readonly typeset local expl state line func i use curcontext="$curcontext" -local fopts="-f -k -z" +local fopts="-f -k -z +k +z" local popts="-A -E -F -L -R -T -Z -a -g -h -H -i -l -r -x" local -A allargs opt_args local -a args @@ -51,8 +51,9 @@ ;; float) use="EFHghlprtux";; functions) - use="UkmTtuz" + use="UkmTtuzM" func=f + allargs[M]='(-k -t -T -u -U -z -M +M +k +t +z)-+M[define mathematical function]' ;; integer) use="Hghilprtux" @@ -73,14 +74,20 @@ offopts=${(j..)${${words[1,CURRENT-1]:#^+*}##+}} for ((i=1;i<=$#use;++i)); do - args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[Uut]]:+$func}]} ) + args+=( ${allargs[${use[$i]}${${(s::)use[$i]}[(r)[UutT]]:+$func}]} ) done _arguments -C -s -A "-*" -S "${args[@]}" '*::vars:= ->vars_eq' if [[ "$state" = vars_eq ]]; then if [[ $func = f ]]; then - if (( $+opt_args[-w] ));then + if (( $+opt_args[+M] || ( $+opt_args[-M] && $+opt_args[-m] ) )); then + _wanted functions expl 'math function' compadd -F line - \ + ${${${(f)"$(functions -M)"}##*-M }%% *} + elif (( $+opt_args[-M] )); then + _arguments ':new math function:_functions' ':minimum arguments' \ + ':maximum arguments' ':shell function:_functions' + elif (( $+opt_args[-w] )); then _wanted files expl 'zwc file' _files -g '*.zwc(-.)' elif [[ $service = autoload || -n $opt_args[(i)-[uU]] ]]; then args=(${^fpath}/*(-.:t)) @@ -91,13 +98,13 @@ _wanted functions expl 'shell function' compadd -a args elif [[ -n $onopts$offopts ]]; then if [[ -n $offopts ]]; then - args=(${(f)"$(functions +$offopts)"}) + args=(${(f)"$(functions +${offopts//[^UXkmtTuz]/})"}) else args=(${(k)functions}) fi if [[ -n $onopts ]]; then local -a funckeys - funckeys=(${(f)"$(functions +$onopts)"}) + funckeys=(${(f)"$(functions +${onopts//[^UXkmtTuz]/})"}) args=(${args:|funckeys}) fi if zstyle -t ":completion:${curcontext}:functions" prefix-needed && diff -Nru zsh-5.0.5/Completion/Zsh/Command/_unsetopt zsh-5.0.7/Completion/Zsh/Command/_unsetopt --- zsh-5.0.5/Completion/Zsh/Command/_unsetopt 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/_unsetopt 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -#compdef unsetopt - -# If you first want to complete only unset options, uncomment the lines -# setting the _options_set array and then use: -# -# _options_set || _options -# -# here. - -_options diff -Nru zsh-5.0.5/Completion/Zsh/Command/_zstyle zsh-5.0.7/Completion/Zsh/Command/_zstyle --- zsh-5.0.5/Completion/Zsh/Command/_zstyle 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Command/_zstyle 2014-10-07 18:11:30.000000000 +0000 @@ -182,6 +182,8 @@ disable v:vcs disable-patterns v: check-for-changes v:bool + check-for-staged-changes + v:bool stagedstr v: unstagedstr v: command v:_command_names diff -Nru zsh-5.0.5/Completion/Zsh/Context/_brace_parameter zsh-5.0.7/Completion/Zsh/Context/_brace_parameter --- zsh-5.0.5/Completion/Zsh/Context/_brace_parameter 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Context/_brace_parameter 2014-10-07 18:11:30.000000000 +0000 @@ -185,6 +185,9 @@ ) _describe -t flags "parameter flag" flags -Q -S '' return +elif compset -P '*:'; then + _history_modifiers p + return fi _parameters -e diff -Nru zsh-5.0.5/Completion/Zsh/Context/.distfiles zsh-5.0.7/Completion/Zsh/Context/.distfiles --- zsh-5.0.5/Completion/Zsh/Context/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Context/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,19 +1,2 @@ DISTFILES_SRC=' -.distfiles -_assign -_autocd -_brace_parameter -_condition -_default -_dynamic_directory_name -_equal -_first -_in_vared -_math -_parameter -_redirect -_subscript -_tilde -_value -_zcalc_line ' diff -Nru zsh-5.0.5/Completion/Zsh/.distfiles zsh-5.0.7/Completion/Zsh/.distfiles --- zsh-5.0.5/Completion/Zsh/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' -.distfiles ' diff -Nru zsh-5.0.5/Completion/Zsh/Function/.distfiles zsh-5.0.7/Completion/Zsh/Function/.distfiles --- zsh-5.0.5/Completion/Zsh/Function/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Function/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,5 +1,2 @@ DISTFILES_SRC=' -.distfiles -_zargs -_zsh-mime-handler ' diff -Nru zsh-5.0.5/Completion/Zsh/Type/.distfiles zsh-5.0.7/Completion/Zsh/Type/.distfiles --- zsh-5.0.5/Completion/Zsh/Type/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Type/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,27 +1,2 @@ DISTFILES_SRC=' -.distfiles -_aliases -_arrays -_command_names -_delimiters -_directory_stack -_file_descriptors -_functions -_globflags -_globqual_delims -_globquals -_history_modifiers -_jobs -_jobs_bg -_jobs_fg -_limits -_math_params -_module_math_func -_options -_options_set -_options_unset -_parameters -_suffix_alias_files -_user_math_func -_vars ' diff -Nru zsh-5.0.5/Completion/Zsh/Type/_globquals zsh-5.0.7/Completion/Zsh/Type/_globquals --- zsh-5.0.5/Completion/Zsh/Type/_globquals 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Type/_globquals 2014-10-07 18:11:30.000000000 +0000 @@ -132,13 +132,13 @@ (L) # complete/skip file size - if ! compset -P '([kKmMpP]|)([-+]|)<->'; then + if ! compset -P '([kKmMgGtTpP]|)([-+]|)<->'; then # complete/skip size spec alts=() - if ! compset -P '[kKmMpP]' && [[ -z $PREFIX ]]; then + if ! compset -P '[kKmMgGtTpP]' && [[ -z $PREFIX ]]; then alts+=( "size-specifiers:size specifier:\ -((k\:kb m\:mb p\:512-byte\ blocks))") +((k\:kb m\:mb g\:gb t\:tb p\:512-byte\ blocks))") fi if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then alts+=("senses:sense:((-\:less\ than +\:more\ than))") @@ -251,6 +251,7 @@ "o:+ sort order, up" "O:+ sort order, down" "P:prepend word" + "Y:+ at most ARG matches" "[:+ range of files" "):end of qualifiers" "\::modifier" diff -Nru zsh-5.0.5/Completion/Zsh/Type/_parameters zsh-5.0.7/Completion/Zsh/Type/_parameters --- zsh-5.0.5/Completion/Zsh/Type/_parameters 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Completion/Zsh/Type/_parameters 2014-10-07 18:11:30.000000000 +0000 @@ -8,6 +8,11 @@ local expl pattern fakes faked tmp pfilt +if compset -P '*:'; then + _history_modifiers p + return +fi + pattern=(-g \*) zparseopts -D -K -E g:=pattern diff -Nru zsh-5.0.5/Config/defs.mk.in zsh-5.0.7/Config/defs.mk.in --- zsh-5.0.5/Config/defs.mk.in 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Config/defs.mk.in 2014-10-07 18:11:30.000000000 +0000 @@ -47,6 +47,7 @@ datarootdir = @datarootdir@ datadir = @datadir@ fndir = @fndir@ +fixed_sitefndir = @fixed_sitefndir@ sitefndir = @sitefndir@ scriptdir = @scriptdir@ sitescriptdir = @sitescriptdir@ @@ -95,7 +96,7 @@ MAKEDEFS = \ prefix='$(prefix)' exec_prefix='$(exec_prefix)' bindir='$(bindir)' \ libdir='$(libdir)' MODDIR='$(MODDIR)' infodir='$(infodir)' mandir='$(mandir)' \ -datadir='$(datadir)' fndir='$(fndir)' htmldir='$(htmldir)' \ +datadir='$(datadir)' fndir='$(fndir)' htmldir='$(htmldir)' runhelpdir='$(runhelpdir)' \ CC='$(CC)' CPPFLAGS='$(CPPFLAGS)' DEFS='$(DEFS)' CFLAGS='$(CFLAGS)' \ LDFLAGS='$(LDFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' \ DLCFLAGS='$(DLCFLAGS)' DLLDFLAGS='$(DLLDFLAGS)' \ diff -Nru zsh-5.0.5/Config/.distfiles zsh-5.0.7/Config/.distfiles --- zsh-5.0.5/Config/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Config/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,2 @@ DISTFILES_SRC=' - .distfiles .cvsignore - aczshoot.m4 - clean.mk config.mk defs.mk.in version.mk - installfns.sh uninstallfns.sh ' diff -Nru zsh-5.0.5/Config/version.mk zsh-5.0.7/Config/version.mk --- zsh-5.0.5/Config/version.mk 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Config/version.mk 2014-10-07 18:11:30.000000000 +0000 @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=5.0.5 -VERSION_DATE='January 5, 2014' +VERSION=5.0.7 +VERSION_DATE='October 7, 2014' diff -Nru zsh-5.0.5/configure.ac zsh-5.0.7/configure.ac --- zsh-5.0.5/configure.ac 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/configure.ac 2014-10-07 18:11:30.000000000 +0000 @@ -117,6 +117,17 @@ AC_DEFINE(ZSH_HEAP_DEBUG) fi]) +dnl Do you want to allow Valgrind to debug heap allocation? +ifdef([zsh-valgrind],[undefine([zsh-valgrind])])dnl +AH_TEMPLATE([ZSH_VALGRIND], +[Define to 1 if you want to add code for valgrind to debug heap memory.]) +AC_ARG_ENABLE(zsh-valgrind, +AC_HELP_STRING([--enable-zsh-valgrind], +[turn on support for valgrind debugging of heap memory]), +[if test x$enableval = xyes; then + AC_DEFINE(ZSH_VALGRIND) +fi]) + dnl Do you want debugging information on internal hash tables. dnl This turns on the `hashinfo' builtin command. ifdef([zsh-hash-debug],[undefine([zsh-hash-debug])])dnl @@ -129,6 +140,16 @@ AC_DEFINE(ZSH_HASH_DEBUG) fi]) +dnl Do you want to dynamically allocate memory on the stack where possible? +ifdef([stack-allocation],[undefine([stack-allocation])])dnl +AH_TEMPLATE([USE_STACK_ALLOCATION], +[Define to 1 if you want to allocate stack memory e.g. with `alloca'.]) +AC_ARG_ENABLE(stack-allocation, +AC_HELP_STRING([--enable-stack-allocation], [allocate stack memory e.g. with `alloca']), +[if test x$enableval = xyes; then + AC_DEFINE(USE_STACK_ALLOCATION) +fi]) + dnl Pathnames for global zsh scripts ifdef([etcdir],[undefine([etcdir])])dnl AC_ARG_ENABLE(etcdir, @@ -294,6 +315,24 @@ sitefndir="$enableval" fi], [sitefndir=${datadir}/${tzsh_name}/site-functions]) +dnl Add /usr/local/share/zsh/site-functions if not yet present +dnl owing to $sitefndir, whether or not explicitly given. +dnl If not explicitly given, it hasn't been expanded yet. +if test X$sitefndir = X/usr/local/share/zsh/site-functions +then fixed_sitefndir='' +elif test X$prefix != X/usr/local; then + if test X$prefix = XNONE && test X$ac_default_prefix = X/usr/local; then + if test X$tzsh_name != Xzsh + then fixed_sitefndir=/usr/local/share/zsh/site-functions + else fixed_sitefndir='' + fi + else fixed_sitefndir=/usr/local/share/zsh/site-functions + fi +elif test X$tzsh_name != Xzsh +then fixed_sitefndir=/usr/local/share/zsh/site-functions +else fixed_sitefndir='' +fi + ifdef([function_subdirs],[undefine([function_subdirs])]) AC_ARG_ENABLE(function-subdirs, AC_HELP_STRING([--enable-function-subdirs], [install functions in subdirectories])) @@ -319,6 +358,7 @@ AC_SUBST(additionalfpath)dnl AC_SUBST(fndir)dnl AC_SUBST(sitefndir)dnl +AC_SUBST(fixed_sitefndir)dnl AC_SUBST(FUNCTIONS_SUBDIRS)dnl dnl Directories for scripts such as newuser. @@ -756,7 +796,7 @@ AC_CACHE_CHECK(if _XOPEN_SOURCE_EXTENDED should not be defined, zsh_cv_no_xopen, [[case "$host_os" in - *openbsd*|*freebsd5*|*freebsd6.[012]*|*aix*) + *freebsd5*|*freebsd6.[012]*|*aix*) zsh_cv_no_xopen=yes ;; *) @@ -3160,9 +3200,12 @@ eval "zshbin1=${bindir}" eval "zshbin2=${zshbin1}" -eval "zshman=${mandir}" -eval "zshinfo=${infodir}" -eval "zshfndir=${fndir}" +eval "zshman1=${mandir}" +eval "zshman2=${zshman1}" +eval "zshinfo1=${infodir}" +eval "zshinfo2=${zshinfo1}" +eval "zshfndir1=${fndir}" +eval "zshfndir2=${zshfndir1}" echo " zsh configuration @@ -3187,10 +3230,10 @@ library flags : ${LIBS} installation basename : ${tzsh_name} binary install path : ${zshbin2} -man page install path : ${zshman} -info install path : ${zshinfo}" -if test "$zshfndir" != no; then - echo "functions install path : ${zshfndir}" +man page install path : ${zshman2} +info install path : ${zshinfo2}" +if test "$zshfndir2" != no; then + echo "functions install path : ${zshfndir2}" fi if test "x$additionalfpath" != x; then echo "additional fpath entries : ${additionalfpath}" diff -Nru zsh-5.0.5/debian/bin/commit2quilt zsh-5.0.7/debian/bin/commit2quilt --- zsh-5.0.5/debian/bin/commit2quilt 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/bin/commit2quilt 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,68 @@ +#!/bin/sh + +# commit2quilt, based on patch2quilt +# Copyright (c) 2011, Frank Terbeck +# Copyright (c) 2014, Axel Beckert +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# +# Often, we may want to backport a patch from upstream to our package. If +# that's just a matter of cherry-picking a patch from upstream, this script can +# help. We don't really want to git cherry-pick, but rather add a new patch to +# our quilt series. In short, this script automates doing that. +# +# Call it like this: +# % git fetch zsh +# % debian/bin/commit2quilt $commit_id +# +# `commit2quilt' requires `quilt', `git' and $GIT_EDITOR or +# emacsclient available. + +set -e + +for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do + if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then + export QUILT_PATCHES=debian/patches + break + fi +done + +export GIT_EDITOR=${GIT_EDITOR:-emacsclient} + +if [ $# -ne 1 ]; then + printf 'usage: patch2quilt \n' + exit 1 +fi + +commitid="$1" +shortid="`echo -n $commitid | cut -c1-8`" +desc="`git show $commitid | egrep '^ [^ ]' | head -1 | sed -e 's/^[- *:]*//'`" +filename="cherry-pick-$shortid-`echo "$desc" | tr -c 'a-zA-Z0-9' '-' | tr 'A-Z' 'a-z' | sed -e 's/--*/-/g;s/-$//'`.patch" +echo "$filename" + +if quilt series | fgrep -q "$filename"; then + echo "Patch $filename ($commitid) already existing" 1>&2 + exit 1 +fi + +git show "$commitid" | filterdiff -x a/ChangeLog > "${where}debian/patches/$filename" +echo "$filename" >> "${where}debian/patches/series" +sed -e '1 s/^commit/Origin: commit/; 4 d; 5 s/^ /Description: /; 6 d' -i "${where}debian/patches/$filename" +"${GIT_EDITOR}" "${where}debian/patches/$filename" +git add "${where}debian/patches/$filename" "${where}debian/patches/series" +quilt push -a +quilt pop -a +git commit -m "Cherry-pick $shortid ($desc) from upstream" -v --edit + +exit 0 + diff -Nru zsh-5.0.5/debian/bin/do-dch zsh-5.0.7/debian/bin/do-dch --- zsh-5.0.5/debian/bin/do-dch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/bin/do-dch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/sh +# This runs git-dch with appropriate options. +# +# All given options are handed over to git-dch without tampering. You +# should probably give a --since="..." definition, so the program knows +# were to start. Also, when you're planning on a release, pass `-R'. For +# snapshots, use `-S'. +# +# This script also takes care of weeding out [dch-ignore] lines from the +# generated changelog. +# +# At the end an editor is spawned on debian/changelog no matter what. + +git-dch \ + --spawn-editor=never \ + "$@" + +old="debian/changelog.old" +cl="debian/changelog" + +rm -f "$old" +cp "$cl" "$old" +sed -e '/^ \* \[[a-f0-9]*\] \[dch-ignored?\] /d' < "$old" > "$cl" +rm -f "$old" + +${VISUAL:-${EDITOR:-vi}} "$cl" diff -Nru zsh-5.0.5/debian/bin/urcl zsh-5.0.7/debian/bin/urcl --- zsh-5.0.5/debian/bin/urcl 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/bin/urcl 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,102 @@ +#!/bin/sh +# +# Seems like `git-dch' doesn't work well with non-linear histories. With +# pkg-zsh we do have merges everytime an upstream release is done. That's +# where "Upstream Release ChangeLog" comes into play. It takes a set of +# commit hashes and produces an initial changelog update for those +# situations in which an upstream release tag was merged. After that, +# the situation can be reduced to a linear history again and `git-dch' +# will do just fine. +# +# This script is pretty dumb, so some manual adjustments might be needed +# for "debian/changelog". + +if [ $# = 0 ]; then + printf 'usage: urcl [OPTIONS] \n\n' + printf 'Options:\n\n' + printf ' -n="..." Full name to be used for the changelog entry. (Defaults\n' + printf ' to "$DEBFULLNAME".)\n' + printf ' -m="..." Email address for the changelog entry. (Defaults to\n' + printf ' "$DEBEMAIL".)\n' + printf ' -p="..." Package name to use. (Defaults to "$PACKAGE".)\n' + printf ' -v="..." Version number to use. (Defaults to "$VERSION".)\n' + printf '\n' + exit 0 +fi + +case "$1" in + -*) isopt=1;; + *) isopt=0;; +esac + +while [ "$#" -gt 0 ] && [ "$isopt" = 1 ]; do + case "$1" in + -n=*) who="${1#-n=}" ;; + -m=*) ewho="${1#-m=}" ;; + -p=*) PACKAGE="${1#-p=}" ;; + -v=*) VERSION="${1#-v=}" ;; + -*) + printf 'Unknown option `%s'\''\n.' "$1" + ;; + esac + shift + case "$1" in + -*) isopt=1;; + *) isopt=0;; + esac +done + +if [ x"$who" = x ]; then + if [ x"$DEBFULLNAME" = x ]; then + printf '`$DEBFULLNAME'\'' is empty use -n=...\n' + exit 1 + fi + who=$DEBFULLNAME +fi +if [ x"$ewho" = x ]; then + if [ x"$DEBEMAIL" = x ]; then + printf '`$DEBEMAIL'\'' is empty use -m=...\n' + exit 1 + fi + ewho=$DEBEMAIL +fi + +if [ x"$PACKAGE" = x ]; then + printf '`$PACKAGE'\'' is empty use -p=...\n' + exit 1 +fi + +if [ x"$VERSION" = x ]; then + printf '`$VERSION'\'' is empty use -v=...\n' + exit 1 +fi + +DATE=$(date -R) + +ours="debian/changelog.urcl" +theirs="debian/changelog.old" +cl="debian/changelog" + +xecho () { + printf '%s\n' "$@" >> "$ours" +} + +rm -f "$ours" "$theirs" + +xecho "$PACKAGE ($VERSION) UNRELEASED; urgency=low" +xecho + +for rev; do + data=$(git log -1 --abbrev=8 --pretty=format:' * [%h] %s' "$rev") + [ $? = 0 ] && xecho "$data" +done + +xecho +xecho " -- ${who} <${ewho}> $DATE" +xecho + +cp "$cl" "$theirs" +cat "$ours" > "$cl" +cat "$theirs" >> "$cl" +rm -f "$ours" "$theirs" +${VISUAL:-${EDITOR:-vi}} "$cl" diff -Nru zsh-5.0.5/debian/changelog zsh-5.0.7/debian/changelog --- zsh-5.0.5/debian/changelog 2014-07-07 12:49:05.000000000 +0000 +++ zsh-5.0.7/debian/changelog 2014-12-06 18:34:50.000000000 +0000 @@ -1,3 +1,187 @@ +zsh (5.0.7-5ubuntu1) vivid; urgency=medium + + * Merge from Debian unstable, remaining changes: + - debian/zshrc: Enable completions by default, unless + skip_global_compinit is set + - Drop yodl from Build-Depends. + - Support cross-compiling: + - Adjust upstream autoconf cross-compile default fallbacks. + - Skip zcompile when cross-compiling. + - Add libelf-dev dependency. + - Add libncurses5-dev build-dep to avoid tgoto implicit function + declaration and thus, implicit integer to pointer conversion. zsh + should build with just ncursesw though. + - Use dh_autotools-dev_update|restoreconfig in addition to + dh_autoreconf to actually update config.sub|guess. + - prebuild docs. + + -- Dimitri John Ledkov Sat, 06 Dec 2014 18:32:18 +0000 + +zsh (5.0.7-5) unstable; urgency=medium + + * [ab70e9dc] Pre-Depend on dpkg >= 1.17.14 explicitly for using + symlink_to_dir with relative symlinks (Closes: #770226) + + -- Axel Beckert Tue, 25 Nov 2014 23:42:17 +0100 + +zsh (5.0.7-4) unstable; urgency=medium + + [ Simon McVittie ] + * [991d536c] Make zsh source package binNMU-safe (Closes: #768937) + + Do not use dh_installdocs --link-doc=zsh-common in + architecture-dependent packages + + Symlink zsh-common documentation files into /usr/share/doc/zsh + + Migrate /usr/share/doc/zsh and /usr/share/doc/zsh-dev from symlink + to directory using dpkg-maintscript-helper + + [ Axel Beckert ] + * [7b632623] Simplify Simon's patch by making /usr/share/doc/zsh/doc a + symlink to ../zsh-common/ in the zsh binary package. Avoids unpack + errors probably caused by having _two_ binary packages containing the + directory which was previously a symlink. (See the log of #768937.) + * [0e03e623,ad143a67] Add Pre-Depends: ${misc:Pre-Depends} for using + dpkg-maintscript-helper's symlink_to_dir. + * [af8ab9de] Also remove zsh4 alternative for rzsh (Closes: #768241) + * [353e05ab] Add a post-jessie TODO list to the source package + + -- Axel Beckert Thu, 13 Nov 2014 01:18:54 +0100 + +zsh (5.0.7-3) unstable; urgency=low + + * Upload to unstable again + * [5409996b ff.] Remove zsh4 and zsh4-static from list of alternatives + in the according postinst scripts. Also raise priorities of zsh5 and + zsh5-static alternatives by 1 so that they have a higher priority than + the old ones. (Closes: #766015) + * [29ce7d34] Mention https://wiki.debian.org/Zsh in README.Debian + * [b33dd34f] Switch the zsh and zsh-common binary package stanzas in + debian/control to get README.Debian installed again. (dh_installdocs + installs it into the first binary package listed in debian/control.) + + -- Axel Beckert Tue, 21 Oct 2014 02:39:51 +0200 + +zsh (5.0.7-2) experimental; urgency=low + + * [0e36f80d ff.] Workflow documentation: Many updates + * [438969ff] Add zsh4(-static) wrapper scripts to ease switch to zsh5 + (Closes: #707760) + * [180ad946] Add lintian overrides for unusual-interpreter in zsh4 + wrapper script + * [2bc52e92] Drop prebuild target from debian/rules (unused) + * [8ece55fe] Add a get-orig-source target to debian/rules + * [503d6807] Add debian/bin/commit2quilt for easier cherry-picking + * Cherry-pick a bunch of post-5.0.7 fixes from upstream: + + [46859b9c] a03227de/33405: vcs_info: Make sure maxexports is set + when VCS_INFO_set is called + + [849017f2] 22c4ea42/33403: be conservative about redirecting + _call_program stderr, the caller may have already done so + + [6f309d99] 605a73e4/33429: disallow non-integer values for HISTSIZE + and SAVEHIST of "fc -p", and fix crash on zero values for same + + [4a370a5f] 521313b4/33429: Tests for previous patch + + [adb27914] 2d14c085/33445: fix handling of -s when combined with -i + at shell invocation + * [35069efe] Add patch by Bart Schaefer which should further mitigate #759870 + + -- Axel Beckert Mon, 13 Oct 2014 23:15:06 +0200 + +zsh (5.0.7-1) experimental; urgency=low + + * [208bdede] New upstream release + + [2d470422] Drop all cherry-picked patches + + Cherry-pick 9982ab6f ("unposted: ChangeLog entry for 33365") as + patch as it adds one missing (and not unimportant) changelog entry + for the 5.0.7 release. + * [a563abd0] Add an initial README.source file + * [6696aa79, ff.] Revamp and update packaging workflow documentation and + convert it to Markdown. + * [97cc54f6] Drop patch2quilt helper script (unused) + * [b605fa17] Move all other helper scripts from debian/ to debian/bin/. + + -- Axel Beckert Wed, 08 Oct 2014 23:33:33 +0200 + +zsh (5.0.6-3) unstable; urgency=medium + + * [f5dacf9f] Do not run (already ignored) test suite on static build to + mitigate #760061. + * [79035529] Set ZTST_verbose=1 to get more details about where exactly + the test suite hangs. Seems also to reduce the likeliness for hangs + and hence further mitigates #760061. + * [16aa8c84] Cherry-pick git commit 87270496 from upstream: Fixes + hanging in freejob from TRAPCHLD. May mitigate or even fix #760061. + * [c3dea2bb] Convert debian/copyright into machine-readable DEP5 format. + * [abc8d1f6] Complete debian/copyright with individual copyrights and + licenses (Closes: #763191) + + -- Axel Beckert Thu, 02 Oct 2014 01:37:34 +0200 + +zsh (5.0.6-2) unstable; urgency=medium + + [ Axel Beckert ] + * [be93912f] Cherry-pick 4414e54e from upstream: Fixes regression with + shared or incremental history when trying to read .zsh_history with + hist_fcntl_lock (Closes: #761597) + * [0ef12ed3] Add test-suite wrapper and adequate test for DEP8 + as-installed testing + * [a6b77953] Declare packaging branch in Vcs-Git header + * [9a864f1e] Change Vcs-Browser to new cgit based repository viewer + * [a3cbb95b] Bump Standards-Version to 3.9.6 (no changes needed) + * [21e82382] Apply wrap-and-sort -a + + [ Wookey ] + * [2bbd5ddc] Use autotools-dev as well as autoreconf to ensure + configurey updates (Closes: #734765) + + -- Axel Beckert Sat, 20 Sep 2014 23:27:41 +0200 + +zsh (5.0.6-1) unstable; urgency=medium + + * New upstream release + * [f3708a11] Disable -fstack-protector-strong on s390x. It causes + endless loops in gcc-4.9. See #759870 for details. + * Upload to unstable again. + + -- Axel Beckert Sun, 31 Aug 2014 01:13:28 +0200 + +zsh (5.0.5-dev-3-1) experimental; urgency=medium + + * New upstream release candidate + * [52079263,7e2e5db0] Add command-not-found, environment-modules and + python-powerline to bug-script list of packages containing code meant + to be sourced in ".zshrc". + * [c9d0ce06] Add fixed Ubuntu bug report to previous changelog entry + + -- Axel Beckert Tue, 26 Aug 2014 19:02:19 +0200 + +zsh (5.0.5-dev-2-1) experimental; urgency=medium + + * New upstream release candidate + + [1584318b] fix crash in menu selection when number of terminal lines + is small (Closes: #527110) + + [2abc8530] Add some more recent dpkg options (Closes: #681518; + Thanks Sebastian Ramacher for the patch!) + + [d6c759fc] Expand aptitude completion by two boolean options + (Closes: #702760; Thanks Daniel Bolton for report and patch!) + + [35176b43] Match more shared library names (Closes: #755789; Thanks + Ansgar Burchardt for report and patch!) + + [d5886eb3] add --rsyncable to gzip completion (Closes: #702000; + Thanks Vincent Lefevre fort report and patch!) + + [0b62bde0] Update for axi-cache completion (Closes: #729921; Thanks + Felipe Sateler for report and patch!) + + [33351b14] Add completion for moosic (Closes: #630410; Thanks Omari + Norman for report and patch!) + + [a7d7c77b] Add completion for bpython and variants (Closes: #691714; + Thanks Sebastian Ramacher for report and patch!) + + [b63ff19d] Correct reload of backslash-continuation lines from + history, fix bad history write of events ending with backslashes + (LP: #1342724) + + [ Axel Beckert ] + * [73508e34,baa705db] Remove all patches which were cherry-picked from + or applied upstream + * [51b9ee37,baa705db] Refresh patch replace-texi2html-with-makeinfo + + -- Axel Beckert Wed, 13 Aug 2014 01:46:31 +0200 + zsh (5.0.5-4ubuntu1) utopic; urgency=medium * Merge from Debian unstable, remaining changes: diff -Nru zsh-5.0.5/debian/control zsh-5.0.7/debian/control --- zsh-5.0.5/debian/control 2014-07-07 12:34:24.000000000 +0000 +++ zsh-5.0.7/debian/control 2014-12-06 18:35:32.000000000 +0000 @@ -1,7 +1,8 @@ Source: zsh Section: shells Priority: optional -Build-Depends: bsdmainutils, +Build-Depends: autotools-dev, + bsdmainutils, cm-super-minimal, debhelper (>= 9~), dh-autoreconf, @@ -16,8 +17,8 @@ libpcre3-dev, texinfo (>= 5~), texlive-fonts-recommended, - texlive-latex-recommended, texlive-latex-base, + texlive-latex-recommended, Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Zsh Maintainers Uploaders: Michael Prokop , @@ -25,28 +26,16 @@ Clint Adams , Frank Terbeck , Richard Hartmann -Standards-Version: 3.9.5 +Standards-Version: 3.9.6 Homepage: http://www.zsh.org/ -Vcs-Git: git://anonscm.debian.org/collab-maint/zsh.git -Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/zsh.git - -Package: zsh -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, zsh-common (= ${source:Version}) -Recommends: ${shlibs:Recommends} -Suggests: zsh-doc -Description: shell with lots of features - Zsh is a UNIX command interpreter (shell) usable as an - interactive login shell and as a shell script command - processor. Of the standard shells, zsh most closely resembles - ksh but includes many enhancements. Zsh has command-line editing, - built-in spelling correction, programmable command completion, - shell functions (with autoloading), a history mechanism, and a - host of other features. +Vcs-Git: git://anonscm.debian.org/collab-maint/zsh.git -b debian +Vcs-Browser: https://anonscm.debian.org/cgit/collab-maint/zsh.git Package: zsh-common Architecture: all Depends: ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends}, + dpkg (>= 1.17.14) Replaces: zsh (<= 5.0.2-1) Recommends: zsh Suggests: zsh-doc @@ -62,10 +51,29 @@ This package contains the common zsh files shared by all architectures. +Package: zsh +Architecture: any +Depends: zsh-common (= ${source:Version}), + ${misc:Depends}, + ${shlibs:Depends} +Pre-Depends: ${misc:Pre-Depends}, + dpkg (>= 1.17.14) +Recommends: ${shlibs:Recommends} +Suggests: zsh-doc +Description: shell with lots of features + Zsh is a UNIX command interpreter (shell) usable as an + interactive login shell and as a shell script command + processor. Of the standard shells, zsh most closely resembles + ksh but includes many enhancements. Zsh has command-line editing, + built-in spelling correction, programmable command completion, + shell functions (with autoloading), a history mechanism, and a + host of other features. + Package: zsh-doc Architecture: all Section: doc -Depends: ${misc:Depends}, zsh-common (= ${source:Version}) +Depends: zsh-common (= ${source:Version}), + ${misc:Depends} Description: zsh documentation - info/HTML format Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command @@ -79,7 +87,8 @@ Package: zsh-static Architecture: any -Depends: zsh, ${misc:Depends} +Depends: zsh, + ${misc:Depends} Suggests: zsh-doc Built-Using: ${Built-Using} Description: shell with lots of features (static link) @@ -95,7 +104,10 @@ Package: zsh-dev Architecture: any -Depends: ${misc:Depends}, zsh-common (= ${source:Version}) +Depends: zsh-common (= ${source:Version}), + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends}, + dpkg (>= 1.17.14) Section: libdevel Description: shell with lots of features (development files) Zsh is a UNIX command interpreter (shell) usable as an @@ -113,7 +125,9 @@ Architecture: any Section: debug Priority: extra -Depends: zsh (= ${binary:Version}), ${misc:Depends}, zsh-common (= ${source:Version}) +Depends: zsh (= ${binary:Version}), + zsh-common (= ${source:Version}), + ${misc:Depends} Description: shell with lots of features (debugging symbols) Zsh is a UNIX command interpreter (shell) usable as an interactive login shell and as a shell script command @@ -130,7 +144,9 @@ Architecture: all Section: oldlibs Priority: extra -Depends: ${misc:Depends}, zsh (>= 5), zsh-common (= ${source:Version}) +Depends: zsh (>= 5), + zsh-common (= ${source:Version}), + ${misc:Depends} Suggests: zsh-beta-doc Description: transitional package to zsh The purpose of this package is solely the transition from the zsh-beta @@ -141,7 +157,9 @@ Architecture: all Section: oldlibs Priority: extra -Depends: ${misc:Depends}, zsh-doc, zsh-common (= ${source:Version}) +Depends: zsh-common (= ${source:Version}), + zsh-doc, + ${misc:Depends} Description: transitional package to zsh-doc The purpose of this package is solely the transition from the zsh-beta-doc package to the zsh-doc package. It can be safely diff -Nru zsh-5.0.5/debian/copyright zsh-5.0.7/debian/copyright --- zsh-5.0.5/debian/copyright 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/copyright 2014-12-06 18:25:17.000000000 +0000 @@ -1,36 +1,183 @@ -This is the Debian Linux prepackaged version of the Z Shell (zsh), a shell -with lots of features. - -This package was put together by Robert Leslie with sources -obtained from: - ftp://ftp.math.gatech.edu/pub/zsh/ - -Source can now be obtained from ftp://ftp.zsh.org/pub/zsh/ - -The following copyright and license apply to this software: - -The Z Shell is copyright (c) 1992-2000 Paul Falstad, Richard Coleman, -Zoltán Hidvégi, Andrew Main, Peter Stephenson, Sven Wischnowsky, and -others. All rights reserved. Individual authors, whether or not -specifically named, retain copyright in all changes; in what follows, they -are referred to as `the Zsh Development Group'. This is for convenience -only and this body has no legal status. The Z shell is distributed under -the following licence; any provisions made in individual files take -precedence. - -Permission is hereby granted, without written agreement and without -licence or royalty fees, to use, copy, modify, and distribute this -software and to distribute modified versions of this software for any -purpose, provided that the above copyright notice and the following -two paragraphs appear in all copies of this software. - -In no event shall the Zsh Development Group be liable to any party for -direct, indirect, special, incidental, or consequential damages arising out -of the use of this software and its documentation, even if and the Zsh -Development Group have been advised of the possibility of such damage. - -The Zsh Development Group specifically disclaim any warranties, including, -but not limited to, the implied warranties of merchantability and fitness -for a particular purpose. The software provided hereunder is on an "as is" -basis, and the Zsh Development Group have no obligation to provide -maintenance, support, updates, enhancements, or modifications. +Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: Zsh (Z Shell) +Upstream-Contact: zsh-workers@zsh.org +Source: http://www.zsh.org/pub/ + ftp://ftp.zsh.org/pub/ + http://sourceforge.net/projects/zsh/files/ + +Files: * +Copyright: 1992-2014 The Zsh Development Group (Paul Falstad, Richard + Coleman, Zoltán Hidvégi, Andrew Main, Peter W. Stephenson, + Sven Wischnowsky, and others). All rights reserved. + Individual authors, whether or not specifically named, + retain copyright in all changes. +Comment: + The Z shell is distributed under the following licence; any + provisions made in individual files take precedence. +License: Zsh + +Files: debian/* +Copyright: 1996 Robert Leslie + 1997-2011 Clint Adams + 2011-2012 Michael Prokop + 2011-2014 Frank Terbeck + 2011-2014 Axel Beckert + 2012-2013 Richard Hartmann +License: Expat + +Files: debian/patches/cherry-pick-* +Copyright: 1992-2014 The Zsh Development Group (Paul Falstad, Richard + Coleman, Zoltán Hidvégi, Andrew Main, Peter W. Stephenson, + Sven Wischnowsky, and others). All rights reserved. + Individual authors, whether or not specifically named, + retain copyright in all changes. +License: Zsh + +Files: Src/compat.c +Comment: This applies to portions of Src/compat.c, the remainder is + under the copyright of The Zsh Development Group and licensed under + the Zsh license as mentioned above. +Copyright: 1990, 1993 The Regents of the University of California +License: BSD-3 + +Files: Completion/Linux/Command/_docker +Copyright: 2013, Felix Riedel +License: BSD-3 + +Files: Completion/Unix/Command/_hg +Copyright: 2005, 2006 Steve Borho + 2006-2009 Brendan Cully +License: Zsh + +Files: Completion/Unix/Command/_darcs +Copyright: 2009 Nicolas Pouillard +License: GPL-2+ + +Files: Completion/openSUSE/Command/_osc +Copyright: 2009, 2010 Holger Macht +License: GPL-2 + +Files: Completion/openSUSE/Command/_zypper +Copyright: 2009 Holger Macht + 2014 Thomas Mitterfellner + 2014 Mariusz Fik +License: GPL-2 + +Files: Completion/Unix/Command/_systemd +Copyright: 2011 Foudil Bre'tel +License: GPL-3 + +Files: Misc/make-zsh-urls +Copyright: 1999 Adam Spiers +License: Artistic or GPL-1+ or Zsh +Comment: + This program is free software; you can redistribute it and/or modify + it under the same terms as Perl or zsh. + +Files: Etc/FAQ.yo +Copyright: 1995-2000, 2012 Peter W. Stephenson +License: PWS-Zsh-FAQ + This text originates in the U.K. and the author asserts his moral + rights under the Copyrights, Designs and Patents Act, 1988. + . + Permission is hereby granted, without written agreement and without + license or royalty fees, to use, copy, modify, and distribute this + documentation for any purpose, provided that the above copyright + notice appears in all copies of this documentation. + +License: Zsh + Permission is hereby granted, without written agreement and without + licence or royalty fees, to use, copy, modify, and distribute this + software and to distribute modified versions of this software for any + purpose, provided that the above copyright notice and the following + two paragraphs appear in all copies of this software. + . + In no event shall the copy right owners liable to any party for + direct, indirect, special, incidental, or consequential damages + arising out of the use of this software and its documentation, even + if and the copyright owners have been advised of the possibility of + such damage. + . + The copyright owners specifically disclaim any warranties, including, + but not limited to, the implied warranties of merchantability and + fitness for a particular purpose. The software provided hereunder is + on an "as is" basis, and the copyright owners have no obligation to + provide maintenance, support, updates, enhancements, or + modifications. + +License: Expat + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +License: BSD-3 + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the + distribution. + * Neither the name of the nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +License: GPL-3 + On Debian systems, the full text of the GNU General Public License + version 3 can be found in `/usr/share/common-licenses/GPL-3'. + +License: GPL-2+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at + your option) any later version. + . + On Debian systems, the full text of the GNU General Public License + version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +License: GPL-2 + On Debian systems, the full text of the GNU General Public License + version 2 can be found in `/usr/share/common-licenses/GPL-2'. + +License: GPL-1+ + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 1 of the License, or (at + your option) any later version. + . + On Debian systems, the full text of the GNU General Public License + version 1 can be found in `/usr/share/common-licenses/GPL-1'. + +License: Artistic + On Debian GNU/Linux systems, the complete text of the + Artistic Licence can be found in `/usr/share/common-licenses/Artistic'. diff -Nru zsh-5.0.5/debian/do-dch zsh-5.0.7/debian/do-dch --- zsh-5.0.5/debian/do-dch 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/do-dch 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#!/bin/sh -# This runs git-dch with appropriate options. -# -# All given options are handed over to git-dch without tampering. You -# should probably give a --since="..." definition, so the program knows -# were to start. Also, when you're planning on a release, pass `-R'. For -# snapshots, use `-S'. -# -# This script also takes care of weeding out [dch-ignore] lines from the -# generated changelog. -# -# At the end an editor is spawned on debian/changelog no matter what. - -git-dch \ - --spawn-editor=never \ - "$@" - -old="debian/changelog.old" -cl="debian/changelog" - -rm -f "$old" -cp "$cl" "$old" -sed -e '/^ \* \[[a-f0-9]*\] \[dch-ignored?\] /d' < "$old" > "$cl" -rm -f "$old" - -${VISUAL:-${EDITOR:-vi}} "$cl" diff -Nru zsh-5.0.5/debian/patch2quilt zsh-5.0.7/debian/patch2quilt --- zsh-5.0.5/debian/patch2quilt 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/patch2quilt 1970-01-01 00:00:00.000000000 +0000 @@ -1,99 +0,0 @@ -#!/bin/sh - -# patch2quilt -# Copyright (c) 2011, Frank Terbeck -# -# Permission to use, copy, modify, and/or distribute this software for any -# purpose with or without fee is hereby granted, provided that the above -# copyright notice and this permission notice appear in all copies. -# -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# -# Often, we may want to backport a patch from upstream to our package. If -# that's just a matter of cherry-picking a patch from upstream, this script can -# help. We don't really want to git cherry-pick, but rather add a new patch to -# our quilt series. In short, this script automates doing that. -# -# Call it like this: -# % ./debian/patch2quilt ../0000-git-patch.patch 0010-quilt-patch.diff -# -# Where `../0000-git-patch.patch' is a patch from git; `0010-quilt-patch.diff' -# is the to-be-added quilt patch. The script now does this: -# -# - Reset and clean the repository to a clean state. -# - Push the entire quilt series. -# - Add `0010-quilt-patch.diff' as a new patch in the quilt series. -# - Check which files are touched by `../0000-git-patch.patch' and add those -# to the newly added quilt patch. -# - Apply the git patch. -# - Refresh the quilt patch. -# - Pop the entire quilt series again. -# - Open the new quilt patch in ${VISUAL:-${EDITOR:-vi}} to add annotation. -# -# That's all. -# -# Note: If the patch file is located in the current repository, it will be -# deleted when the repository is cleaned up initially. So don't do that. -# -# Also, if we're just cherry picking stuff from upstream git, there are -# likely changes to ChangeLog, which will not apply cleanly. Just throw -# away all such hunks from the patch beforehand. -# -# `patch2quilt' requires `quilt', `git' and `diffstat' available. -# -# Call this script *only* from the git repository's base directory. - -QUILT_PATCHES=debian/patches -export QUILT_PATCHES - -if [ ! -d "${QUILT_PATCHES}" ]; then - printf 'No such directory: `%s'\''\n' "${QUILT_PATCHES}" - printf 'Quilt patches directory not found. Giving up.\n' - exit 1 -fi - -if [ $# -ne 2 ]; then - printf 'usage: patch2quilt \n' - exit 1 -fi - -gitpatch="$1" -quiltpatch="$2" - -git clean -xdf || exit 1 -git reset --hard || exit 1 - -quilt push -a || exit 1 - -quilt new "${quiltpatch}" || exit 1 - -diffstat -l -p1 "${gitpatch}" | while IFS= read -r file; do - quilt add "${file}" || exit 1 -done - -git apply "${gitpatch}" || exit 1 - -quilt refresh || exit 1 - -quilt pop -a || exit 1 - -${VISUAL:-${EDITOR:-vi}} "${QUILT_PATCHES}/${quiltpatch}" - -printf -- '\n---------------------------------------' -printf -- '---------------------------------------\n' -printf '\n New quilt patch `%s'\'' added. You\n' "${quiltpatch}" -printf ' should add it and its series file to git and commit the result.\n' -printf '\n Like this:\n\n' -printf ' %% git add "%s"\n' "${QUILT_PATCHES}/series" -printf ' %% git add "%s"\n' "${QUILT_PATCHES}/${quiltpatch}" -printf ' %% git commit\n' -printf '\n Write a useful commit message.' -printf ' Don'\''t forget `Closes:'\'' mentions!\n\n' - -exit 0 diff -Nru zsh-5.0.5/debian/patches/cherry-pick-0f73b35f-33391-vcs-info-git-fix-applied-patch-detection-on-git-am.patch zsh-5.0.7/debian/patches/cherry-pick-0f73b35f-33391-vcs-info-git-fix-applied-patch-detection-on-git-am.patch --- zsh-5.0.5/debian/patches/cherry-pick-0f73b35f-33391-vcs-info-git-fix-applied-patch-detection-on-git-am.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-0f73b35f-33391-vcs-info-git-fix-applied-patch-detection-on-git-am.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,51 @@ +Origin: commit 0f73b35f4e0d8adad216ee6650bfef4622df43b1 +Author: Marc Finet +Date: Thu Oct 9 00:24:45 2014 +0200 +Description: 33391: vcs_info git: fix applied patch detection on git am + git-am also uses .git/rebase-apply for patch list but + the file original-commit does not exist (as no commit exist). + This patch handles both git rebase and git am. Also: + - get the first line (rather than the first char) when the message + contains only one line; + - remove unused function (ironically that should have been used here). + +diff --git a/ChangeLog b/ChangeLog +index 445f1e7..57850eb 100644 +diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +index ee50be6..48d552f 100644 +--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git ++++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +@@ -195,14 +195,6 @@ fi + VCS_INFO_adjust + VCS_INFO_git_getaction ${gitdir} + +- +-VCS_INFO_get_get_rebase() +-{ +- if [[ -f "$1" ]]; then +- echo "$(< "$1")" +- fi +-} +- + local patchdir=${gitdir}/patches/${gitbranch} + if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \ + && [[ -f $patchdir/unapplied ]] +@@ -223,11 +215,16 @@ elif [[ -d "${gitdir}/rebase-apply" ]]; then + # Fake patch names for all but current patch + patchdir="${gitdir}/rebase-apply" + local cur=$(< "${patchdir}/next") +- local p ++ local p subject + for p in $(seq $(($cur - 1))); do + git_patches_applied+=("$(printf "%04d" $p) ?") + done +- git_patches_applied+=("$(< "${patchdir}/original-commit") ${${(f)$(< "${patchdir}/msg-clean")}[1]}") ++ subject="${$(< "${patchdir}/msg-clean")[(f)1]}" ++ if [[ -f "${patchdir}/original-commit" ]]; then ++ git_patches_applied+=("$(< ${patchdir}/original-commit) $subject") ++ else ++ git_patches_applied+=("? $subject") ++ fi + git_patches_unapplied=($(seq $cur $(< "${patchdir}/last"))) + + VCS_INFO_git_handle_patches diff -Nru zsh-5.0.5/debian/patches/cherry-pick-22c4ea42-33403-be-conservative-about-redirecting-call-program-stderr-the-caller-may-have-already-done-so.patch zsh-5.0.7/debian/patches/cherry-pick-22c4ea42-33403-be-conservative-about-redirecting-call-program-stderr-the-caller-may-have-already-done-so.patch --- zsh-5.0.5/debian/patches/cherry-pick-22c4ea42-33403-be-conservative-about-redirecting-call-program-stderr-the-caller-may-have-already-done-so.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-22c4ea42-33403-be-conservative-about-redirecting-call-program-stderr-the-caller-may-have-already-done-so.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,20 @@ +Origin: commit 22c4ea424ce2e8febce04d324c5ec9898f5d534b +Author: Barton E. Schaefer +Date: Thu Oct 9 17:54:47 2014 -0700 +Description: 33403: be conservative about redirecting _call_program stderr, the caller may have already done so + +diff --git a/Completion/Base/Utility/_call_program b/Completion/Base/Utility/_call_program +index b657648..010e094 100644 +--- a/Completion/Base/Utility/_call_program ++++ b/Completion/Base/Utility/_call_program +@@ -2,8 +2,8 @@ + + local tmp err_fd=-1 + +-if (( ${debug_fd:--1} > 2 )) +-then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is log file ++if (( ${debug_fd:--1} > 2 )) || [[ ! -t 2 ]] ++then exec {err_fd}>&2 # debug_fd is saved stderr, 2 is trace or redirect + else exec {err_fd}>/dev/null + fi + diff -Nru zsh-5.0.5/debian/patches/cherry-pick-2d14c085-33445-fix-handling-of-s-when-combined-with-i-at-shell-invocation.patch zsh-5.0.7/debian/patches/cherry-pick-2d14c085-33445-fix-handling-of-s-when-combined-with-i-at-shell-invocation.patch --- zsh-5.0.5/debian/patches/cherry-pick-2d14c085-33445-fix-handling-of-s-when-combined-with-i-at-shell-invocation.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-2d14c085-33445-fix-handling-of-s-when-combined-with-i-at-shell-invocation.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,66 @@ +Origin: commit 2d14c085b761c71e35cc362f87cd4fecbc8e0676 +Author: Barton E. Schaefer +Date: Sun Oct 12 11:18:30 2014 -0700 +Description: 33445: fix handling of -s when combined with -i at shell invocation + Fixes a long-standing (25+ years) bug where using -i -s together did have + the documented effect of disabling command line script files but also had + the side-effect of invoking ZLE, thereby ignoring the redirected input. + +diff --git a/Src/init.c b/Src/init.c +index 6d005dc..68d3612 100644 +--- a/Src/init.c ++++ b/Src/init.c +@@ -243,12 +243,24 @@ parseargs(char **argv, char **runscript) + */ + opts[MONITOR] = 2; /* may be unset in init_io() */ + opts[HASHDIRS] = 2; /* same relationship to INTERACTIVE */ ++ opts[USEZLE] = 1; /* see below, related to SHINSTDIN */ + opts[SHINSTDIN] = 0; + opts[SINGLECOMMAND] = 0; + + if (parseopts(NULL, &argv, opts, &cmd, NULL)) + exit(1); + ++ /* ++ * USEZLE remains set if the shell has access to a terminal and ++ * is not reading from some other source as indicated by SHINSTDIN. ++ * SHINSTDIN becomes set below if there is no command argument, ++ * but it is the explicit setting (or not) that matters to USEZLE. ++ * USEZLE may also become unset in init_io() if the shell is not ++ * interactive or the terminal cannot be re-opened read/write. ++ */ ++ if (opts[SHINSTDIN]) ++ opts[USEZLE] = (opts[USEZLE] && isatty(0)); ++ + paramlist = znewlinklist(); + if (*argv) { + if (unset(SHINSTDIN)) { +@@ -603,7 +615,7 @@ init_shout(void) + + if (SHTTY == -1) + { +- /* Since we're interative, it's nice to have somewhere to write. */ ++ /* Since we're interactive, it's nice to have somewhere to write. */ + shout = stderr; + return; + } +@@ -616,7 +628,8 @@ init_shout(void) + /* Associate terminal file descriptor with a FILE pointer */ + shout = fdopen(SHTTY, "w"); + #ifdef _IOFBF +- setvbuf(shout, shoutbuf, _IOFBF, BUFSIZ); ++ if (shout) ++ setvbuf(shout, shoutbuf, _IOFBF, BUFSIZ); + #endif + + gettyinfo(&shttyinfo); /* get tty state */ +@@ -1608,8 +1621,7 @@ zsh_main(UNUSED(int argc), char **argv) + emulate(zsh_name, 1, &emulation, opts); /* initialises most options */ + opts[LOGINSHELL] = (**argv == '-'); + opts[PRIVILEGED] = (getuid() != geteuid() || getgid() != getegid()); +- opts[USEZLE] = 1; /* may be unset in init_io() */ +- /* sets INTERACTIVE, SHINSTDIN and SINGLECOMMAND */ ++ /* sets ZLE, INTERACTIVE, SHINSTDIN and SINGLECOMMAND */ + parseargs(argv, &runscript); + + SHTTY = -1; diff -Nru zsh-5.0.5/debian/patches/cherry-pick-521313b4-tests-for-workers-33429.patch zsh-5.0.7/debian/patches/cherry-pick-521313b4-tests-for-workers-33429.patch --- zsh-5.0.5/debian/patches/cherry-pick-521313b4-tests-for-workers-33429.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-521313b4-tests-for-workers-33429.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,27 @@ +Origin: commit 521313b4b95817c9144ab43ab121da934f99bd51 +Author: Barton E. Schaefer +Date: Sat Oct 11 11:18:34 2014 -0700 +Description: Tests for workers/33429 + +diff --git a/Test/B06fc.ztst b/Test/B06fc.ztst +index eb73eaa..65ee43d 100644 +--- a/Test/B06fc.ztst ++++ b/Test/B06fc.ztst +@@ -9,3 +9,17 @@ + $ZTST_testdir/../Src/zsh -f ./fcl + 1:Checking that fc -l foo doesn't core dump when history is empty + ?./fcl:fc:1: event not found: foo ++ ++ $ZTST_testdir/../Src/zsh +Z -fsi <<< $'fc -p /dev/null 0 0\n:' ++0:Checking that fc -p doesn't core dump when history size is zero ++*?*%* ++ ++ $ZTST_testdir/../Src/zsh +Z -fsi <<< 'fc -p /dev/null a 0' ++1:Checking that fc -p rejects non-integer history size ++*?*% fc: HISTSIZE must be an integer ++*?*%* ++ ++ $ZTST_testdir/../Src/zsh +Z -fsi <<< 'fc -p /dev/null 0 a' ++1:Checking that fc -p rejects non-integer history save size ++*?*% fc: SAVEHIST must be an integer ++*?*%* diff -Nru zsh-5.0.5/debian/patches/cherry-pick-605a73e4-33429-disallow-non-integer-values-for-histsize-and-savehist-of-fc-p-and-fix-crash-on-zero-values-for-same.patch zsh-5.0.7/debian/patches/cherry-pick-605a73e4-33429-disallow-non-integer-values-for-histsize-and-savehist-of-fc-p-and-fix-crash-on-zero-values-for-same.patch --- zsh-5.0.5/debian/patches/cherry-pick-605a73e4-33429-disallow-non-integer-values-for-histsize-and-savehist-of-fc-p-and-fix-crash-on-zero-values-for-same.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-605a73e4-33429-disallow-non-integer-values-for-histsize-and-savehist-of-fc-p-and-fix-crash-on-zero-values-for-same.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,60 @@ +Origin: commit 605a73e415772a1d74cff39212618c8f1d58297b +Author: Barton E. Schaefer +Date: Fri Oct 10 23:12:57 2014 -0700 +Description: 33429: disallow non-integer values for HISTSIZE and SAVEHIST of "fc -p", and fix crash on zero values for same + +diff --git a/Src/builtin.c b/Src/builtin.c +index 4a10c7d..5b711ed 100644 +--- a/Src/builtin.c ++++ b/Src/builtin.c +@@ -1363,10 +1363,19 @@ bin_fc(char *nam, char **argv, Options ops, int func) + if (*argv) { + hf = *argv++; + if (*argv) { +- hs = zstrtol(*argv++, NULL, 10); +- if (*argv) +- shs = zstrtol(*argv++, NULL, 10); +- else ++ char *check; ++ hs = zstrtol(*argv++, &check, 10); ++ if (*check) { ++ zwarnnam("fc", "HISTSIZE must be an integer"); ++ return 1; ++ } ++ if (*argv) { ++ shs = zstrtol(*argv++, &check, 10); ++ if (*check) { ++ zwarnnam("fc", "SAVEHIST must be an integer"); ++ return 1; ++ } ++ } else + shs = hs; + if (*argv) { + zwarnnam("fc", "too many arguments"); +diff --git a/Src/hist.c b/Src/hist.c +index 4660fd0..0831756 100644 +--- a/Src/hist.c ++++ b/Src/hist.c +@@ -1110,8 +1110,11 @@ static void + putoldhistentryontop(short keep_going) + { + static Histent next = NULL; +- Histent he = keep_going? next : hist_ring->down; +- next = he->down; ++ Histent he = (keep_going || !hist_ring) ? next : hist_ring->down; ++ if (he) ++ next = he->down; ++ else ++ return; + if (isset(HISTEXPIREDUPSFIRST) && !(he->node.flags & HIST_DUP)) { + static zlong max_unique_ct = 0; + if (!keep_going) +@@ -1151,7 +1154,7 @@ prepnexthistent(void) + freehistnode(&hist_ring->node); + } + +- if (histlinect < histsiz) { ++ if (histlinect < histsiz || !hist_ring) { + he = (Histent)zshcalloc(sizeof *he); + if (!hist_ring) + hist_ring = he->up = he->down = he; diff -Nru zsh-5.0.5/debian/patches/cherry-pick-60bedea3e712178beac392af1ca6ed7291630459-apt-mark-completion zsh-5.0.7/debian/patches/cherry-pick-60bedea3e712178beac392af1ca6ed7291630459-apt-mark-completion --- zsh-5.0.5/debian/patches/cherry-pick-60bedea3e712178beac392af1ca6ed7291630459-apt-mark-completion 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-60bedea3e712178beac392af1ca6ed7291630459-apt-mark-completion 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -commit 60bedea3e712178beac392af1ca6ed7291630459 -Author: Sebastian Ramacher -Date: Sun Apr 6 18:04:39 2014 +0200 - - 32533: add completion for "apt-mark" - -diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt -index 6f0bded..bf5343a 100644 ---- a/Completion/Debian/Command/_apt -+++ b/Completion/Debian/Command/_apt -@@ -1,4 +1,4 @@ --#compdef apt apt-get apt-cache apt-cdrom apt-config -+#compdef apt apt-get apt-cache apt-cdrom apt-config apt-mark - - _apt () { - case "$service" in -@@ -7,6 +7,7 @@ _apt () { - apt-cache) _apt-cache "$@";; - apt-cdrom) _apt-cdrom "$@";; - apt-config) _apt-config "$@";; -+ apt-mark) _apt-mark "$@";; - *) _message "unknown command $service";; - esac - } -@@ -619,4 +620,34 @@ _apt_caching_policy () { - /var/lib/dpkg/available -nt "$1" ]] - } - -+_apt-mark () { -+ _apt_arguments _apt-mark_sm \ -+ -h,--help:bool \ -+ -v,--version:bool \ -+ -f,--file:configfile \ -+ -c,--config-file:configfile \ -+ -o,--option:arbitem \ -+ -qq:bool \ -+ -s:bool \ -+ -- \ -+ /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /"[]"/ ':argument-1::compadd "$expl_action[@]" auto manual hold unhold showauto showmanual showhold' -+ -+ _apt-mark () { -+ local expl_action expl_packages -+ _description actions expl_action 'action' -+ _description packages expl_packages 'package' -+ -+ _apt-mark_sm -+ } -+ -+ _apt-mark "$@" -+} -+ - _apt "$@" diff -Nru zsh-5.0.5/debian/patches/cherry-pick-7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2-INC_APPEND_HISTORY_TIME zsh-5.0.7/debian/patches/cherry-pick-7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2-INC_APPEND_HISTORY_TIME --- zsh-5.0.5/debian/patches/cherry-pick-7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2-INC_APPEND_HISTORY_TIME 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2-INC_APPEND_HISTORY_TIME 1970-01-01 00:00:00.000000000 +0000 @@ -1,141 +0,0 @@ -commit 7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2 -Author: Peter Stephenson -Date: Fri Jun 6 21:56:47 2014 +0100 - - 32682 with tweaks: Add INC_APPEND_HISTORY_TIME. - Revert INC_APPEND_HISTORY behaviour. - -Index: zsh/Doc/Zsh/options.yo -=================================================================== ---- zsh.orig/Doc/Zsh/options.yo 2014-06-09 22:49:42.443674688 +0200 -+++ zsh/Doc/Zsh/options.yo 2014-06-09 22:49:42.439674738 +0200 -@@ -971,6 +971,23 @@ - number of lines grows 20% beyond the value specified by - tt($SAVEHIST) (see also the HIST_SAVE_BY_COPY option). - ) -+pindex(INC_APPEND_HISTORY_TIME) -+pindex(NO_INC_APPEND_HISTORY_TIME) -+pindex(INCAPPENDHISTORYTIME) -+pindex(NOINCAPPENDHISTORYTIME) -+cindex(history, incremental appending to a file with time) -+item(tt(INC_APPEND_HISTORY_TIME))( -+This option is a variant of tt(INC_APPEND_HISTORY) in which, where -+possible, the history entry is written out to the file after the -+command is finished, so that the time taken by the command is recorded -+correctly in the history file in tt(EXTENDED_HISTORY) format. This -+means that the history entry will not be available immediately from -+other instances of the shell that are using the same history file. -+ -+This option is only useful if tt(INC_APPEND_HISTORY) and -+tt(SHARE_HISTORY) are turned off. The three options should be -+considered mutually exclusive. -+) - pindex(SHARE_HISTORY) - pindex(NO_SHARE_HISTORY) - pindex(SHAREHISTORY) -@@ -981,10 +998,10 @@ - - This option both imports new commands from the history file, and also - causes your typed commands to be appended to the history file (the --latter is like specifying tt(INC_APPEND_HISTORY)). --The history lines are also output with timestamps ala --tt(EXTENDED_HISTORY) (which makes it easier to find the spot where --we left off reading the file after it gets re-written). -+latter is like specifying tt(INC_APPEND_HISTORY), which should be turned -+off if this option is in effect). The history lines are also output -+with timestamps ala tt(EXTENDED_HISTORY) (which makes it easier to find -+the spot where we left off reading the file after it gets re-written). - - By default, history movement commands visit the imported lines as - well as the local lines, but you can toggle this on and off with the -@@ -994,8 +1011,9 @@ - - If you find that you want more control over when commands - get imported, you may wish to turn tt(SHARE_HISTORY) off, --tt(INC_APPEND_HISTORY) on, and then manually import --commands whenever you need them using `tt(fc -RI)'. -+tt(INC_APPEND_HISTORY) or tt(INC_APPEND_HISTORY_TIME) (see above) on, -+and then manually import commands whenever you need them using `tt(fc -+-RI)'. - ) - enditem() - -Index: zsh/Src/hist.c -=================================================================== ---- zsh.orig/Src/hist.c 2014-06-09 22:49:42.443674688 +0200 -+++ zsh/Src/hist.c 2014-06-09 22:49:42.439674738 +0200 -@@ -935,9 +935,11 @@ - - hf = getsparam("HISTFILE"); - /* -- * For INCAPPENDHISTORY, when interactive, save the history here -+ * For INCAPPENDHISTORYTIME, when interactive, save the history here - * as it gives a better estimate of the times of commands. - * -+ * If INCAPPENDHISTORY is also set we've already done it. -+ * - * If SHAREHISTORY is also set continue to do so in the - * standard place, because that's safer about reading and - * rewriting history atomically. -@@ -950,7 +952,8 @@ - * so that (correctly) nothing happens here. But it shows - * I thought about it. - */ -- if (isset(INCAPPENDHISTORY) && !isset(SHAREHISTORY) && -+ if (isset(INCAPPENDHISTORYTIME) && !isset(SHAREHISTORY) && -+ !isset(INCAPPENDHISTORY) && - !(histactive & HA_NOINC) && !strin && histsave_stack_pos == 0) - savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST); - } -@@ -1378,7 +1381,8 @@ - * For normal INCAPPENDHISTORY case and reasoning, see hbegin(). - */ - if (isset(SHAREHISTORY) ? histfileIsLocked() : -- (isset(INCAPPENDHISTORY) && histsave_stack_pos != 0)) -+ (isset(INCAPPENDHISTORY) || (isset(INCAPPENDHISTORYTIME) && -+ histsave_stack_pos != 0))) - savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST); - unlockhistfile(hf); /* It's OK to call this even if we aren't locked */ - /* -@@ -2541,7 +2545,7 @@ - } - if (writeflags & HFILE_USE_OPTIONS) { - if (isset(APPENDHISTORY) || isset(INCAPPENDHISTORY) -- || isset(SHAREHISTORY)) -+ || isset(INCAPPENDHISTORYTIME) || isset(SHAREHISTORY)) - writeflags |= HFILE_APPEND | HFILE_SKIPOLD; - else - histfile_linect = 0; -@@ -2577,7 +2581,7 @@ - tmpfile = NULL; - if (err) { - if (isset(APPENDHISTORY) || isset(INCAPPENDHISTORY) -- || isset(SHAREHISTORY)) -+ || isset(INCAPPENDHISTORYTIME) || isset(SHAREHISTORY)) - zerr("rewriting %s would change its ownership -- skipped", fn); - else - zerr("rewriting %s would change its ownership -- history not saved", fn); -Index: zsh/Src/options.c -=================================================================== ---- zsh.orig/Src/options.c 2014-06-09 22:49:42.443674688 +0200 -+++ zsh/Src/options.c 2014-06-09 22:49:42.439674738 +0200 -@@ -165,6 +165,7 @@ - {{NULL, "ignoreclosebraces", OPT_EMULATE}, IGNORECLOSEBRACES}, - {{NULL, "ignoreeof", 0}, IGNOREEOF}, - {{NULL, "incappendhistory", 0}, INCAPPENDHISTORY}, -+{{NULL, "incappendhistorytime", 0}, INCAPPENDHISTORYTIME}, - {{NULL, "interactive", OPT_SPECIAL}, INTERACTIVE}, - {{NULL, "interactivecomments",OPT_BOURNE}, INTERACTIVECOMMENTS}, - {{NULL, "ksharrays", OPT_EMULATE|OPT_BOURNE}, KSHARRAYS}, -Index: zsh/Src/zsh.h -=================================================================== ---- zsh.orig/Src/zsh.h 2014-06-09 22:49:42.443674688 +0200 -+++ zsh/Src/zsh.h 2014-06-09 22:49:42.439674738 +0200 -@@ -2092,6 +2092,7 @@ - IGNORECLOSEBRACES, - IGNOREEOF, - INCAPPENDHISTORY, -+ INCAPPENDHISTORYTIME, - INTERACTIVE, - INTERACTIVECOMMENTS, - KSHARRAYS, diff -Nru zsh-5.0.5/debian/patches/cherry-pick-9982ab6f-missing-changelog-entry zsh-5.0.7/debian/patches/cherry-pick-9982ab6f-missing-changelog-entry --- zsh-5.0.5/debian/patches/cherry-pick-9982ab6f-missing-changelog-entry 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-9982ab6f-missing-changelog-entry 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,30 @@ +Origin: commit 9982ab6fb5266298c056326ed265fc8560202603 +Author: Mikael Magnusson +Reviewd-by: Axel Beckert +Description: unposted: ChangeLog entry for 33365 + This patch is cherry-picked because it actually should belong to + 5.0.7 as it adds one missing (and not unimportant) changelog entry + for the 5.0.7 release. + . + This was initially part of the 5.0.7 merge from upstream into debian, + but Jenkins insisted on building against the zsh-5.0.7 tag. + . + We may need to cherry-pick 9982ab6f in the debian branch before + merging the zsh-5.0.8 tag. + +diff --git a/ChangeLog b/ChangeLog +index 2d25d1d..969273b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,6 +2,11 @@ + + * unposted: Config/version.mk: 5.0.7 + ++2014-10-06 Mikael Magnusson ++ ++ * 33365: Src/exec.c: avoid buffer overflow for very long fds in >& ++ fd syntax. ++ + 2014-10-06 Peter Stephenson + + * unposted (discussed offline): README: update description of diff -Nru zsh-5.0.5/debian/patches/cherry-pick-a03227de-33405-vcs-info-make-sure-maxexports-is-set-when-vcs-info-set-is-called.patch zsh-5.0.7/debian/patches/cherry-pick-a03227de-33405-vcs-info-make-sure-maxexports-is-set-when-vcs-info-set-is-called.patch --- zsh-5.0.5/debian/patches/cherry-pick-a03227de-33405-vcs-info-make-sure-maxexports-is-set-when-vcs-info-set-is-called.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-a03227de-33405-vcs-info-make-sure-maxexports-is-set-when-vcs-info-set-is-called.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,19 @@ +Origin: commit a03227de23f623370ab6a6eaf8d22e8d9b1a3aae +Author: Frank Terbeck +Date: Thu Oct 9 18:09:36 2014 +0200 +Description: 33405: vcs_info: Make sure maxexports is set when VCS_INFO_set is called + +diff --git a/ChangeLog b/ChangeLog +index 57850eb..b27895c 100644 +diff --git a/Functions/VCS_Info/vcs_info b/Functions/VCS_Info/vcs_info +index 5a421df..4693869 100644 +--- a/Functions/VCS_Info/vcs_info ++++ b/Functions/VCS_Info/vcs_info +@@ -94,6 +94,7 @@ vcs_info () { + + for pat in ${dps} ; do + if [[ ${PWD} == ${~pat} ]] ; then ++ VCS_INFO_maxexports + [[ -n ${vcs_info_msg_0_} ]] && VCS_INFO_set --nvcs + return 0 + fi diff -Nru zsh-5.0.5/debian/patches/cherry-pick-d397599cea5aa39492e5914c876a3991b8543445-apt-completion zsh-5.0.7/debian/patches/cherry-pick-d397599cea5aa39492e5914c876a3991b8543445-apt-completion --- zsh-5.0.5/debian/patches/cherry-pick-d397599cea5aa39492e5914c876a3991b8543445-apt-completion 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/patches/cherry-pick-d397599cea5aa39492e5914c876a3991b8543445-apt-completion 1970-01-01 00:00:00.000000000 +0000 @@ -1,59 +0,0 @@ -commit d397599cea5aa39492e5914c876a3991b8543445 -Author: Alessandro Ghedini -Date: Sun Apr 6 18:04:38 2014 +0200 - - 32532: completion for "apt" command - -diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt -index b51b2fc..6f0bded 100644 ---- a/Completion/Debian/Command/_apt -+++ b/Completion/Debian/Command/_apt -@@ -1,7 +1,8 @@ --#compdef apt-get apt-cache apt-cdrom apt-config -+#compdef apt apt-get apt-cache apt-cdrom apt-config - - _apt () { - case "$service" in -+ apt) _apt-cmd "$@";; - apt-get) _apt-get "$@";; - apt-cache) _apt-cache "$@";; - apt-cdrom) _apt-cdrom "$@";; -@@ -389,6 +390,38 @@ _apt_consume_long () { - return 0 - } - -+_apt-cmd () { -+ _apt_arguments _apt-cmd_sm \ -+ -h,--help:bool \ -+ -v,--version:bool \ -+ -c,--config-file:configfile \ -+ -o,--option:arbitem \ -+ -t,--target-release:release \ -+ -- \ -+ /$'list\0'/ \| \ -+ /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \ -+ /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \ -+ /$'update\0'/ \| \ -+ \( \ -+ /$'install\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \ -+ /$'[^\0/]#/'/ /$'[^\0/]#\0'/ ':release name::_apt_releases' \) \| \ -+ /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ -+ /$'upgrade\0'/ \| \ -+ /$'full-upgrade\0'/ \| \ -+ /$'edit-sources\0'/ \| \ -+ /"[]"/ ':argument-1::compadd "$expl_action[@]" list search show update install remove upgrade full-upgrade edit-sources' -+ -+ _apt-cmd () { -+ local expl_action expl_packages -+ _description actions expl_action 'action' -+ _description packages expl_packages 'package' -+ -+ _apt-cmd_sm -+ } -+ -+ _apt-cmd "$@" -+} -+ - _apt-get () { - _apt_arguments _apt-get_sm \ - -h,--help:bool \ diff -Nru zsh-5.0.5/debian/patches/further-mitigate-test-suite-hangs.patch zsh-5.0.7/debian/patches/further-mitigate-test-suite-hangs.patch --- zsh-5.0.5/debian/patches/further-mitigate-test-suite-hangs.patch 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/patches/further-mitigate-test-suite-hangs.patch 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,17 @@ +Origin: http://www.zsh.org/mla/workers/2014/msg01250.html +Author: Bart Schaefer +Bug-Debian: https://bugs.debian.org/759870 +Description: Add a sleep call which should prevent a race condition in coproc + +diff --git a/Test/A05execution.ztst b/Test/A05execution.ztst +index ca97f4f..0b40a73 100644 +--- a/Test/A05execution.ztst ++++ b/Test/A05execution.ztst +@@ -208,6 +208,7 @@ F:This similar test was triggering a reproducible failure with pipestatus. + print -u $ZTST_fd 'This test takes 5 seconds to fail...' + { printf "%d\n" {1..20000} } | ( read -e ) + hang(){ printf "%d\n" {2..20000} | cat }; hang | ( read -e ) ++ sleep 1 ;: avoid coproc exit race condition + print -p done + read -et 6 -p + 0:Bug regression: piping a shell construct to an external process may hang diff -Nru zsh-5.0.5/debian/patches/prebuild-docs.patch zsh-5.0.7/debian/patches/prebuild-docs.patch --- zsh-5.0.5/debian/patches/prebuild-docs.patch 2014-07-07 12:32:01.000000000 +0000 +++ zsh-5.0.7/debian/patches/prebuild-docs.patch 2014-12-06 18:30:40.000000000 +0000 @@ -1,8 +1,7 @@ -Description: prebuild docs using prebuild target -Author: Dimitri John Ledkov in zshop- ++ default emulation being native zsh, shown as in zshop- + tions(1)). Options that are on by default for the emulation are -+ shown with the prefix no only if they are off, while other ++ shown with the prefix no only if they are off, while other + options are shown without the prefix no and only if they are on. -+ In addition to options changed from the default state by the -+ user, any options activated automatically by the shell (for -+ example, SHIN STDIN or INTERACTIVE) will be shown in the list. -+ - -+ The format is further modified by the option KSH OPTION PRINT, -+ - - -+ however the rationale for choosing options with or without the ++ In addition to options changed from the default state by the ++ user, any options activated automatically by the shell (for ++ example, SHIN_STDIN or INTERACTIVE) will be shown in the list. ++ The format is further modified by the option KSH_OPTION_PRINT, ++ however the rationale for choosing options with or without the + no prefix remains the same in this case. + -+ If the -m flag is given the arguments are taken as patterns -+ (which should be quoted to protect them from filename expan- -+ sion), and all options with names matching these patterns are ++ If the -m flag is given the arguments are taken as patterns ++ (which should be quoted to protect them from filename expan- ++ sion), and all options with names matching these patterns are + set. + -+ Note that a bad option name does not cause execution of subse- -+ quent shell code to be aborted; this is behaviour is different -+ from that of `set -o'. This is because set is regarded as a ++ Note that a bad option name does not cause execution of subse- ++ quent shell code to be aborted; this is behaviour is different ++ from that of `set -o'. This is because set is regarded as a + special builtin by the POSIX standard, but setopt is not. --- /dev/null -+++ zsh-5.0.5/Doc/help/shift -@@ -0,0 +1,5 @@ -+shift [ n ] [ name ... ] -+ The positional parameters ${n+1} ... are renamed to $1 ..., -+ where n is an arithmetic expression that defaults to 1. If any -+ names are given then the arrays with these names are shifted ++++ zsh-5.0.7/Doc/help/shift +@@ -0,0 +1,8 @@ ++shift [ -p ] [ n ] [ name ... ] ++ The positional parameters ${n+1} ... are renamed to $1 ..., ++ where n is an arithmetic expression that defaults to 1. If any ++ names are given then the arrays with these names are shifted + instead of the positional parameters. ++ ++ If the option -p is given arguments are instead removed (popped) ++ from the end rather than the start of the array. --- /dev/null -+++ zsh-5.0.5/Doc/help/source ++++ zsh-5.0.7/Doc/help/source @@ -0,0 +1,4 @@ +source file [ arg ... ] + Same as `.', except that the current directory is always + searched and is always searched first, before directories in + $path. --- /dev/null -+++ zsh-5.0.5/Doc/help/stat ++++ zsh-5.0.7/Doc/help/stat @@ -0,0 +1 @@ +stat See the section `The zsh/stat Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/suspend ++++ zsh-5.0.7/Doc/help/suspend @@ -0,0 +1,4 @@ +suspend [ -f ] + Suspend the execution of the shell (send it a SIGTSTP) until it + receives a SIGCONT. Unless the -f option is given, this will + refuse to suspend a login shell. --- /dev/null -+++ zsh-5.0.5/Doc/help/test ++++ zsh-5.0.7/Doc/help/test @@ -0,0 +1,20 @@ +test [ arg ... ] +[ [ arg ... ] ] @@ -1814,13 +1762,13 @@ + cannot be relied on. Users are urged wherever possible to use + the `[[' test syntax which does not have these ambiguities. --- /dev/null -+++ zsh-5.0.5/Doc/help/times ++++ zsh-5.0.7/Doc/help/times @@ -0,0 +1,2 @@ +times Print the accumulated user and system times for the shell and + for processes run from the shell. --- /dev/null -+++ zsh-5.0.5/Doc/help/trap -@@ -0,0 +1,77 @@ ++++ zsh-5.0.7/Doc/help/trap +@@ -0,0 +1,72 @@ +trap [ arg ] [ sig ... ] + arg is a series of commands (usually quoted to protect it from + immediate evaluation by the shell) to be read and executed when @@ -1847,19 +1795,14 @@ + have no SIGERR signal (this is the usual case). + + If sig is DEBUG then arg will be executed before each command if -+ the option DEBUG BEFORE CMD is set (as it is by default), else -+ - - ++ the option DEBUG_BEFORE_CMD is set (as it is by default), else + after each command. Here, a `command' is what is described as a + `sublist' in the shell grammar, see the section SIMPLE COMMANDS -+ & PIPELINES in zshmisc(1). If DEBUG BEFORE CMD is set various -+ - - ++ & PIPELINES in zshmisc(1). If DEBUG_BEFORE_CMD is set various + additional features are available. First, it is possible to -+ skip the next command by setting the option ERR EXIT; see the -+ - -+ description of the ERR EXIT option in zshoptions(1). Also, the -+ - -+ shell parameter ZSH DEBUG CMD is set to the string corresponding -+ - - ++ skip the next command by setting the option ERR_EXIT; see the ++ description of the ERR_EXIT option in zshoptions(1). Also, the ++ shell parameter ZSH_DEBUG_CMD is set to the string corresponding + to the command to be executed following the trap. Note that + this string is reconstructed from the internal format and may + not be formatted the same way as the original text. The parame- @@ -1899,25 +1842,37 @@ + that for consistency users stick exclusively to one name or + another. --- /dev/null -+++ zsh-5.0.5/Doc/help/true ++++ zsh-5.0.7/Doc/help/true @@ -0,0 +1,2 @@ +true [ arg ... ] + Do nothing and return an exit status of 0. --- /dev/null -+++ zsh-5.0.5/Doc/help/ttyctl -@@ -0,0 +1,9 @@ ++++ zsh-5.0.7/Doc/help/ttyctl +@@ -0,0 +1,21 @@ +ttyctl -fu -+ The -f option freezes the tty, and -u unfreezes it. When the -+ tty is frozen, no changes made to the tty settings by external -+ programs will be honored by the shell, except for changes in the -+ size of the screen; the shell will simply reset the settings to -+ their previous values as soon as each command exits or is sus- -+ pended. Thus, stty and similar programs have no effect when the -+ tty is frozen. Without options it reports whether the terminal -+ is frozen or not. ++ The -f option freezes the tty (i.e. terminal or terminal emula- ++ tor), and -u unfreezes it. When the tty is frozen, no changes ++ made to the tty settings by external programs will be honored by ++ the shell, except for changes in the size of the screen; the ++ shell will simply reset the settings to their previous values as ++ soon as each command exits or is suspended. Thus, stty and sim- ++ ilar programs have no effect when the tty is frozen. Freezing ++ the tty does not cause the current state to be remembered: ++ instead, it causes future changes to the state to be blocked. ++ ++ Without options it reports whether the terminal is frozen or ++ not. ++ ++ Note that, regardless of whether the tty is frozen or not, the ++ shell needs to change the settings when the line editor starts, ++ so unfreezing the tty does not guarantee settings made on the ++ command line are preserved. Strings of commands run between ++ editing the command line will see a consistent tty state. See ++ also the shell variable STTY for a means of initialising the tty ++ before running external commands. --- /dev/null -+++ zsh-5.0.5/Doc/help/typeset -@@ -0,0 +1,264 @@ ++++ zsh-5.0.7/Doc/help/typeset +@@ -0,0 +1,258 @@ +typeset [ {+|-}AEFHUafghklprtuxmz ] [ -LRZi [ n ]] [ name[=value] ... ] +typeset -T [ {+|-}Urux ] [ -LRZ [ n ]] SCALAR[=value] array [ sep ] + Set or display attributes and values for shell parameters. @@ -1932,18 +1887,15 @@ + For each name=value assignment, the parameter name is set to + value. Note that arrays currently cannot be assigned in typeset + expressions, only scalars and integers. Unless the option -+ KSH TYPESET is set, normal expansion rules apply to assignment -+ - ++ KSH_TYPESET is set, normal expansion rules apply to assignment + arguments, so value may be split into separate words; if the + option is set, assignments which can be recognised when expan- + sion is performed are treated as single words. For example the + command typeset vbl=$(echo one two) is treated as having one -+ argument if KSH TYPESET is set, but otherwise is treated as hav- -+ - ++ argument if KSH_TYPESET is set, but otherwise is treated as hav- + ing the two arguments vbl=one and two. + -+ If the shell option TYPESET SILENT is not set, for each remain- -+ - ++ If the shell option TYPESET_SILENT is not set, for each remain- + ing name that refers to a parameter that is set, the name and + value of the parameter are printed in the form of an assignment. + Nothing is printed for newly-created parameters, or when any @@ -2003,8 +1955,7 @@ + If the -m flag is given the name arguments are taken as patterns + (which should be quoted). With no attribute flags, all parame- + ters (or functions with the -f flag) with matching names are -+ printed (the shell option TYPESET SILENT is not used in this -+ - ++ printed (the shell option TYPESET_SILENT is not used in this + case). Note that -m is ignored if no patterns are given. If + the +g flag is combined with -m, a new local parameter is cre- + ated for every matching parameter that is not already local. @@ -2090,8 +2041,7 @@ + tion `Functions'. The -k and -z flags make the function + be loaded using ksh-style or zsh-style autoloading + respectively. If neither is given, the setting of the -+ KSH AUTOLOAD option determines how the function is -+ - ++ KSH_AUTOLOAD option determines how the function is + loaded. + + -h Hide: only useful for special parameters (those marked @@ -2157,8 +2107,7 @@ + above. + + -x Mark for automatic export to the environment of subse- -+ quently executed commands. If the option GLOBAL EXPORT -+ - ++ quently executed commands. If the option GLOBAL_EXPORT + is set, this implies the option -g, unless +g is also + explicitly given; in other words the parameter is not + made local to the enclosing function. This is for com- @@ -2183,8 +2132,8 @@ +readonly + Same as typeset -r. --- /dev/null -+++ zsh-5.0.5/Doc/help/ulimit -@@ -0,0 +1,56 @@ ++++ zsh-5.0.7/Doc/help/ulimit +@@ -0,0 +1,59 @@ +ulimit [ [ -SHacdfiklmnpqsTtvwx | -N resource [ limit ] ... ] + Set or display resource limits of the shell and the processes + started by the shell. The value of limit can be a number in the @@ -2222,6 +2171,9 @@ + -n open file descriptors. + -p The number of pseudo-terminals. + -q Bytes in POSIX message queues. ++ -r Maximum real time priority. On some systems where this ++ is not available, such as NetBSD, this has the same ++ effect as -T for compatibility with sh. + -s Kilobytes on the size of the stack. + -T The number of simultaneous threads available to the user. + -t CPU seconds to be used. @@ -2242,7 +2194,7 @@ + piled into the shell. The shell will try to read or write the + limit anyway, and will report an error if this fails. --- /dev/null -+++ zsh-5.0.5/Doc/help/umask ++++ zsh-5.0.7/Doc/help/umask @@ -0,0 +1,8 @@ +umask [ -S ] [ mask ] + The umask is set to mask. mask can be either an octal number or @@ -2253,7 +2205,7 @@ + sions you specify are those which are to be allowed (not denied) + to the users specified. --- /dev/null -+++ zsh-5.0.5/Doc/help/unhash ++++ zsh-5.0.7/Doc/help/unhash @@ -0,0 +1,18 @@ +unhash [ -adfms ] name ... + Remove the element named name from an internal hash table. The @@ -2274,7 +2226,7 @@ +unfunction + Same as unhash -f. --- /dev/null -+++ zsh-5.0.5/Doc/help/unlimit ++++ zsh-5.0.7/Doc/help/unlimit @@ -0,0 +1,10 @@ +unlimit [ -hs ] resource ... + The resource limit for each resource is set to the hard limit. @@ -2287,7 +2239,7 @@ + shell starts in a mode emulating another shell. It can be made + available with the command `zmodload -F zsh/rlimits b:unlimit'. --- /dev/null -+++ zsh-5.0.5/Doc/help/unset ++++ zsh-5.0.7/Doc/help/unset @@ -0,0 +1,20 @@ +unset [ -fmv ] name ... + Each named parameter is unset. Local parameters remain local @@ -2310,10 +2262,9 @@ + + unset -f is equivalent to unfunction. --- /dev/null -+++ zsh-5.0.5/Doc/help/unsetopt -@@ -0,0 +1,9 @@ -+unsetopt [ {+|-}options | {+|-}o option name ] [ name ... ] -+ - ++++ zsh-5.0.7/Doc/help/unsetopt +@@ -0,0 +1,8 @@ ++unsetopt [ {+|-}options | {+|-}o option_name ] [ name ... ] + Unset the options for the shell. All options specified either + with flags or by name are unset. If no arguments are supplied, + the names of all options currently unset are printed. If the -m @@ -2322,11 +2273,11 @@ + terns), and all options with names matching these patterns are + unset. --- /dev/null -+++ zsh-5.0.5/Doc/help/vared ++++ zsh-5.0.7/Doc/help/vared @@ -0,0 +1 @@ +vared See the section `Zle Builtins' in zshzle(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/wait ++++ zsh-5.0.7/Doc/help/wait @@ -0,0 +1,6 @@ +wait [ job ... ] + Wait for the specified jobs or processes. If job is not given @@ -2335,7 +2286,7 @@ + in the job table. The exit status from this command is that of + the job waited for. --- /dev/null -+++ zsh-5.0.5/Doc/help/whence ++++ zsh-5.0.7/Doc/help/whence @@ -0,0 +1,43 @@ +whence [ -vcwfpams ] name ... + For each name, indicate how it would be interpreted if used as a @@ -2381,8 +2332,8 @@ +which [ -wpams ] name ... + Equivalent to whence -c. --- /dev/null -+++ zsh-5.0.5/Doc/help/zcompile -@@ -0,0 +1,112 @@ ++++ zsh-5.0.7/Doc/help/zcompile +@@ -0,0 +1,122 @@ +zcompile [ -U ] [ -z | -k ] [ -R | -M ] file [ name ... ] +zcompile -ca [ -m ] [ -R | -M ] file [ name ... ] +zcompile -t file [ name ... ] @@ -2418,8 +2369,7 @@ + file. If both -c and -a are given, names of both defined func- + tions and functions marked for autoloading may be given. In + either case, the functions in files written with the -c or -a -+ option will be autoloaded as if the KSH AUTOLOAD option were -+ - ++ option will be autoloaded as if the KSH_AUTOLOAD option were + unset. + + The reason for handling loaded and not-yet-loaded functions with @@ -2437,6 +2387,20 @@ + of all functions currently defined or marked as autoloaded will + be written. + ++ Note the second form cannot be used for compiling functions that ++ include redirections as part of the definition rather than ++ within the body of the function; for example ++ ++ fn1() { { ... } >~/logfile } ++ ++ can be compiled but ++ ++ fn1() { ... } >~/logfile ++ ++ cannot. It is possible to use the first form of zcompile to ++ compile autoloadable functions that include the full function ++ definition instead of just the body of the function. ++ + The third form, with the -t option, examines an existing com- + piled file. Without further arguments, the names of the origi- + nal files compiled into it are listed. The first line of output @@ -2472,17 +2436,14 @@ + -k + -z These options are used when the compiled file contains + functions which are to be autoloaded. If -z is given, the -+ function will be autoloaded as if the KSH AUTOLOAD option -+ - ++ function will be autoloaded as if the KSH_AUTOLOAD option + is not set, even if it is set at the time the compiled + file is read, while if the -k is given, the function will -+ be loaded as if KSH AUTOLOAD is set. These options also -+ - ++ be loaded as if KSH_AUTOLOAD is set. These options also + take precedence over any -k or -z options specified to + the autoload builtin. If neither of these options is + given, the function will be loaded as determined by the -+ setting of the KSH AUTOLOAD option at the time the com- -+ - ++ setting of the KSH_AUTOLOAD option at the time the com- + piled file is read. + + These options may also appear as many times as necessary @@ -2496,21 +2457,21 @@ + mapped, only one half of the file is actually used (and + mapped). --- /dev/null -+++ zsh-5.0.5/Doc/help/zformat ++++ zsh-5.0.7/Doc/help/zformat @@ -0,0 +1,2 @@ +zformat + See the section `The zsh/zutil Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zftp ++++ zsh-5.0.7/Doc/help/zftp @@ -0,0 +1 @@ +zftp See the section `The zsh/zftp Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zle ++++ zsh-5.0.7/Doc/help/zle @@ -0,0 +1 @@ +zle See the section `Zle Builtins' in zshzle(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zmodload -@@ -0,0 +1,305 @@ ++++ zsh-5.0.7/Doc/help/zmodload +@@ -0,0 +1,304 @@ +zmodload [ -dL ] [ ... ] +zmodload -F [ -lLme -P param ] module [+-]feature... +zmodload -e [ -A ] [ ... ] @@ -2548,8 +2509,7 @@ + effect. + + The named module is searched for in the same way a com- -+ mand is, using $module path instead of $path. However, -+ - ++ mand is, using $module_path instead of $path. However, + the path search is performed even when the module name + contains a `/', which it usually does. There is no way + to prevent the path search. @@ -2817,42 +2777,42 @@ + the module is autoloaded on these definitions). This is true + even for systems that don't support dynamic loading of modules. --- /dev/null -+++ zsh-5.0.5/Doc/help/zparseopts ++++ zsh-5.0.7/Doc/help/zparseopts @@ -0,0 +1,2 @@ +zparseopts + See the section `The zsh/zutil Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zprof ++++ zsh-5.0.7/Doc/help/zprof @@ -0,0 +1 @@ +zprof See the section `The zsh/zprof Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zpty ++++ zsh-5.0.7/Doc/help/zpty @@ -0,0 +1 @@ +zpty See the section `The zsh/zpty Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zregexparse ++++ zsh-5.0.7/Doc/help/zregexparse @@ -0,0 +1,2 @@ +zregexparse + See the section `The zsh/zutil Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zsocket ++++ zsh-5.0.7/Doc/help/zsocket @@ -0,0 +1,2 @@ +zsocket + See the section `The zsh/net/socket Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/zstyle ++++ zsh-5.0.7/Doc/help/zstyle @@ -0,0 +1 @@ +zstyle See the section `The zsh/zutil Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/help/ztcp ++++ zsh-5.0.7/Doc/help/ztcp @@ -0,0 +1 @@ +ztcp See the section `The zsh/net/tcp Module' in zshmodules(1). --- /dev/null -+++ zsh-5.0.5/Doc/version.yo ++++ zsh-5.0.7/Doc/version.yo @@ -0,0 +1,9 @@ +IFDEF(INCWSLEVEL)(INCWSLEVEL())(STARTDEF()) -+def(version)(0)(5.0.5) -+def(date)(0)(January 5, 2014) ++def(version)(0)(5.0.7) ++def(date)(0)(October 7, 2014) +def(zshenv)(0)(/etc/zshenv) +def(zprofile)(0)(/etc/zprofile) +def(zshrc)(0)(/etc/zshrc) @@ -2860,9 +2820,9 @@ +def(zlogout)(0)(/etc/zlogout) +IFDEF(DECWSLEVEL)(DECWSLEVEL())(ENDDEF())\ --- /dev/null -+++ zsh-5.0.5/Doc/zsh.1 ++++ zsh-5.0.7/Doc/zsh.1 @@ -0,0 +1,473 @@ -+.TH "ZSH" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++.TH "ZSH" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zsh \- the Z shell +.\" Yodl file: Zsh/intro.yo @@ -3119,7 +3079,7 @@ +Zsh tries to emulate \fBsh\fP or \fBksh\fP when it is invoked as +\fBsh\fP or \fBksh\fP respectively; more precisely, it looks at the first +letter of the name by which it was invoked, excluding any initial `\fBr\fP\&' -+(assumed to stand for `restricted\&'), and if that is `\fBs\fP' or `\fBk\fP' it ++(assumed to stand for `restricted\&'), and if that is `\fBb\fP', `\fBs\fP' or `\fBk\fP' it +will emulate \fBsh\fP or \fBksh\fP\&. Furthermore, if invoked as \fBsu\fP (which +happens on certain systems when the shell is executed by the \fBsu\fP +command), the shell will try to find an alternative name from the \fBSHELL\fP @@ -3336,8 +3296,8 @@ +Part 2: Shell and Utilities\fP, +IEEE Inc, 1993, ISBN 1\-55937\-255\-9\&. --- /dev/null -+++ zsh-5.0.5/Doc/zsh.texi -@@ -0,0 +1,36062 @@ ++++ zsh-5.0.7/Doc/zsh.texi +@@ -0,0 +1,36611 @@ +\input texinfo.tex +@c %**start of header +@iftex @@ -3368,8 +3328,8 @@ +@end iftex +@titlepage +@title The Z Shell Manual -+@subtitle Version 5.0.5 -+@subtitle Updated January 5, 2014 ++@subtitle Version 5.0.7 ++@subtitle Updated October 7, 2014 +@author Original documentation by Paul Falstad +@page +This is a texinfo version of the documentation for the Z Shell, originally by @@ -3390,6 +3350,7 @@ +Permission is granted to copy and distribute translations of this manual +into another language, under the above conditions for modified versions. +@end titlepage ++@contents +@c Yodl file: Zsh/manual.yo +@ifnottex +@node Top, The Z Shell Manual, (dir), (dir) @@ -3402,7 +3363,7 @@ + +@noindent +@cindex version -+Version 5.0.5, last updated January 5, 2014. ++Version 5.0.7, last updated October 7, 2014. +@end ifinfo + +@menu @@ -3849,8 +3810,6 @@ +@chapter Roadmap +@noindent +@cindex roadmap -+ -+@noindent +The Zsh Manual, like the shell itself, is large and often complicated. +This section of the manual provides some pointers to areas of the shell +that are likely to be of particular interest to new users, and indicates @@ -4208,7 +4167,7 @@ +Zsh tries to emulate @cite{sh} or @cite{ksh} when it is invoked as +@t{sh} or @t{ksh} respectively; more precisely, it looks at the first +letter of the name by which it was invoked, excluding any initial `@t{r}' -+(assumed to stand for `restricted'), and if that is `@t{s}' or `@t{k}' it ++(assumed to stand for `restricted'), and if that is `@t{b}', `@t{s}' or `@t{k}' it +will emulate @cite{sh} or @cite{ksh}. Furthermore, if invoked as @t{su} (which +happens on certain systems when the shell is executed by the @t{su} +command), the shell will try to find an alternative name from the @t{SHELL} @@ -4456,7 +4415,11 @@ +@cindex commands, simple +A @emph{simple command} is a sequence of optional parameter +assignments followed by blank-separated words, -+with optional redirections interspersed. ++with optional redirections interspersed. For a description ++of assignment, see the beginning of ++@ref{Parameters}. ++ ++@noindent +The first word is the command to be executed, and the remaining +words, if any, are arguments to the command. +If a command name is given, the parameter assignments modify @@ -4783,7 +4746,7 @@ + +@noindent +Regardless of @t{TRY_BLOCK_ERROR}, after the end of @t{always-list} the -+normal shell status @t{$?} is the value returned from @t{always-list}. ++normal shell status @t{$?} is the value returned from @t{try-list}. +This will be non-zero if there was an error, even if @t{TRY_BLOCK_ERROR} +was set to zero. + @@ -4826,6 +4789,20 @@ +there is a single @var{word}; otherwise, the parentheses will be treated as +forming a globbing pattern in that case. + ++@noindent ++In any of the forms above, a redirection may appear outside the ++function body, for example ++ ++@noindent ++@example ++func() @{ ... @} 2>&1 ++@end example ++ ++@noindent ++The redirection is stored with the function and applied whenever the ++function is executed. Any variables in the redirection are expanded ++at the point the function is executed, but outside the function scope. ++ +@cindex timing +@findex time +@item @t{time} [ @var{pipeline} ] @@ -4961,38 +4938,63 @@ + +@noindent +Fatal errors found in non-interactive shells include: -+@table @asis -+@item Failure to parse shell options passed when invoking the shell -+@item Failure to change options with the @t{set} builtin -+@item Parse errors of all sorts, including failures to parse ++ ++@noindent ++@itemize @bullet ++ ++@item ++Failure to parse shell options passed when invoking the shell ++@item ++Failure to change options with the @t{set} builtin ++@item ++Parse errors of all sorts, including failures to parse +mathematical expressions -+@item Failures to set or modify variable behaviour with @t{typeset}, ++@item ++Failures to set or modify variable behaviour with @t{typeset}, +@t{local}, @t{declare}, @t{export}, @t{integer}, @t{float} -+@item Execution of incorrectly positioned loop control structures ++@item ++Execution of incorrectly positioned loop control structures +(@t{continue}, @t{break}) -+@item Attempts to use regular expression with no regular expression ++@item ++Attempts to use regular expression with no regular expression +module available -+@item Disallowed operations when the @t{RESTRICTED} options is set -+@item Failure to create a pipe needed for a pipeline -+@item Failure to create a multio -+@item Failure to autoload a module needed for a declared shell feature -+@item Errors creating command or process substitutions -+@item Syntax errors in glob qualifiers -+@item File generation errors where not caught by the option @t{BAD_PATTERN} -+@item All bad patterns used for matching within case statements -+@item File generation failures where not caused by @t{NO_MATCH} or -+@item All file generation errors where the pattern was used to create a -+multio -+@item Memory errors where detected by the shell -+@item Invalid subscripts to shell variables -+@item Attempts to assign read-only variables -+@item Logical errors with variables such as assignment to the wrong type -+@item Use of invalid variable names -+@item Errors in variable substitution syntax -+@item Failure to convert characters in @t{$'}...@t{'} expressions ++@item ++Disallowed operations when the @t{RESTRICTED} options is set ++@item ++Failure to create a pipe needed for a pipeline ++@item ++Failure to create a multio ++@item ++Failure to autoload a module needed for a declared shell feature ++@item ++Errors creating command or process substitutions ++@item ++Syntax errors in glob qualifiers ++@item ++File generation errors where not caught by the option @t{BAD_PATTERN} ++@item ++All bad patterns used for matching within case statements ++@item ++File generation failures where not caused by @t{NO_MATCH} or +similar options -+@end table -+@sp 1 ++@item ++All file generation errors where the pattern was used to create a ++multio ++@item ++Memory errors where detected by the shell ++@item ++Invalid subscripts to shell variables ++@item ++Attempts to assign read-only variables ++@item ++Logical errors with variables such as assignment to the wrong type ++@item ++Use of invalid variable names ++@item ++Errors in variable substitution syntax ++@item ++Failure to convert characters in @t{$'}...@t{'} expressions ++@end itemize + +@noindent +If the @t{POSIX_BUILTINS} option is set, more errors associated with @@ -6335,6 +6337,37 @@ +base 8. + +@noindent ++The @var{base} may be replaced or followed by an underscore, which may ++itself be followed by a positive integer (if it is missing the value 3 ++is used). This indicates that underscores should be inserted into the ++output string, grouping the number for visual clarity. The following ++integer specifies the number of digits to group together. For example: ++ ++@noindent ++@example ++setopt cbases ++print $(( [#16_4] 65536 ** 2 )) ++@end example ++ ++@noindent ++outputs `@t{0x1_0000_0000}'. ++ ++@noindent ++The feature can be used with floating ++point numbers, in which case the base must be omitted; grouping ++is away from the decimal point. For example, ++ ++@noindent ++@example ++zmodload zsh/mathfunc ++print $(( [#_] sqrt(1e7) )) ++@end example ++ ++@noindent ++outputs `@t{3_162.277_660_168_379_5}' (the number of decimal places ++shown may vary). ++ ++@noindent +@pindex C_BASES, use of +@pindex OCTAL_ZEROES, use of +If the @t{C_BASES} option is set, hexadecimal numbers in the standard C @@ -6736,11 +6769,51 @@ +@end table + +@noindent ++For compatibility, if there is a single argument that is not ++syntactically significant, typically a variable, the condition is ++treated as a test for whether the expression expands as a string of ++non-zero length. In other words, @t{[[ $var ]]} is the same as @t{[[ -n ++$var ]]}. It is recommended that the second, explicit, form be used ++where possible. ++ ++@noindent +Normal shell expansion is performed on the @var{file}, @var{string} and +@var{pattern} arguments, but the result of each expansion is constrained to +be a single word, similar to the effect of double quotes. -+Filename generation is not performed on any form of argument to conditions. -+However, pattern metacharacters are active for the @var{pattern} arguments; ++ ++@noindent ++Filename generation is not performed on any form of argument to ++conditions. However, it can be forced in any case where normal shell ++expansion is valid and when the option @t{EXTENDED_GLOB} is in effect by ++using an explicit glob qualifier of the form @t{(#q)} at the ++end of the string. A normal glob qualifier expression may appear ++between the `@t{q}' and the closing parenthesis; if none appears the ++expression has no effect beyond causing filename generation. The ++results of filename generation are joined together to form a single ++word, as with the results of other forms of expansion. ++ ++@noindent ++This special use of filename generation is only available with the ++@t{[[} syntax. If the condition occurs within the @t{[} or @t{test} ++builtin commands then globbing occurs instead as part of normal command ++line expansion before the condition is evaluated. In this case it may ++generate multiple words which are likely to confuse the syntax of the ++test command. ++ ++@noindent ++For example, ++ ++@noindent ++@t{[[ -n file*(#qN) ]]} ++ ++@noindent ++produces status zero if and only if there is at least one file in the ++current directory beginning with the string `@t{file}'. The globbing ++qualifier @t{N} ensures that the expression is empty if there is ++no matching file. ++ ++@noindent ++Pattern metacharacters are active for the @var{pattern} arguments; +the patterns are the same as those used for filename generation, see +@ref{Filename Generation}, but there is no special behaviour +of `@t{/}' nor initial dots, and no glob qualifiers are allowed. @@ -6896,6 +6969,12 @@ +the full path; +@ref{Filename Expansion}. + ++@item @t{%e} ++Evaluation depth of the current sourced file, shell function, or @t{eval}. ++This is incremented or decremented every time the value of @t{%N} is ++set or reverted to a previous value, respectively. This is most useful ++for debugging as part of @t{$PS4}. ++ +@item @t{%h} +@itemx @t{%!} +Current history event number. @@ -6981,6 +7060,14 @@ +@end table + +@noindent ++In addition, if the system supports the POSIX @t{gettimeofday} system ++call, @t{%.} provides decimal fractions of a second since the epoch with ++leading zeroes. By default three decimal places are provided, but a ++number of digits up to 6 may be given following the @t{%}; hence @t{%6.} ++outputs microseconds. A typical example of this is the format ++`@t{%D@{%H:%M:%S.%.@}}'. ++ ++@noindent +The GNU extension that a `@t{-}' between the @t{%} and the +format character causes a leading zero or space to be stripped +is handled directly by the shell for the format characters @t{d}, @t{f}, @@ -7078,7 +7165,8 @@ + +@noindent +The left parenthesis may be preceded or followed by a positive integer @var{n}, -+which defaults to zero. A negative integer will be multiplied by -1. ++which defaults to zero. A negative integer will be multiplied by -1, except ++as noted below for `@t{l}'. +The test character @var{x} may be any of the following: + +@noindent @@ -7105,6 +7193,8 @@ +True if the month is equal to @var{n} (January = 0). +@item @t{d} +True if the day of the month is equal to @var{n}. ++@item @t{e} ++True if the evaluation depth is at least @var{n}. +@item @t{g} +True if the effective gid of the current process is @var{n}. +@item @t{j} @@ -7113,7 +7203,9 @@ +True if the @t{SHLVL} parameter is at least @var{n}. +@item @t{l} +True if at least @var{n} characters have already been -+printed on the current line. ++printed on the current line. When @var{n} is negative, true if at least ++@t{abs}@t{(}@var{n}@t{)} characters remain before the opposite ++margin (thus the left margin for @t{RPROMPT}). +@item @t{S} +True if the @t{SECONDS} parameter is at least @var{n}. +@item @t{T} @@ -7135,14 +7227,23 @@ +Specifies truncation behaviour for the remainder of the prompt string. +The third, deprecated, form is equivalent to `@t{%}@var{xstringx}', +i.e. @var{x} may be `@t{<}' or `@t{>}'. -+The numeric argument, which in the third form may appear immediately -+after the `@t{[}', specifies the maximum permitted length of -+the various strings that can be displayed in the prompt. +The @var{string} will be displayed in +place of the truncated portion of any string; note this does not +undergo prompt expansion. + +@noindent ++The numeric argument, which in the third form may appear immediately ++after the `@t{[}', specifies the maximum permitted length of ++the various strings that can be displayed in the prompt. ++In the first two forms, this numeric argument may be negative, in which ++case the truncation length is determined by subtracting the absolute ++value of the numeric argument from the number of character positions ++remaining on the current prompt line. If this results in a zero or ++negative length, a length of 1 is used. In other words, a negative ++argument arranges that after truncation at least @var{n} characters ++remain before the right margin (left margin for @t{RPROMPT}). ++ ++@noindent +The forms with `@t{<}' truncate at the left of the string, +and the forms with `@t{>}' truncate at the right of the string. +For example, if the current directory is `@t{/home/pike}', @@ -7164,12 +7265,21 @@ +construct, or to the next truncation encountered at the same grouping +level (i.e. truncations inside a `@t{%(}' are separate), which +ever comes first. In particular, a truncation with argument zero -+(e.g. `@t{%<<}') marks the end of the range of the string to be ++(e.g., `@t{%<<}') marks the end of the range of the string to be +truncated while turning off truncation from there on. For example, the +prompt '%10<...<%~%<<%# ' will print a truncated representation of the +current directory, followed by a `@t{%}' or `@t{#}', followed by a +space. Without the `@t{%<<}', those two characters would be included -+in the string to be truncated. ++in the string to be truncated. Note that `@t{%-0<<}' is a distinct ++ ++@noindent ++Truncation applies only within each individual line of the prompt, as ++delimited by embedded newlines (if any). If the total length of any line ++of the prompt after truncation is greater than the terminal width, or if ++the part to be truncated contains embedded newlines, truncation behavior ++is undefined and may change in a future version of the shell. Use ++`@t{%-@var{n}(l.@var{true-text}.@var{false-text})}' to remove parts ++of the prompt when the available space is less than @var{n}. + +@end table +@c (avoiding a yodl bug) @@ -7178,8 +7288,8 @@ + +@chapter Expansion +@noindent -+@cindex expansion + ++@cindex expansion +The following types of expansions are performed in the indicated order in +five steps: + @@ -7526,7 +7636,7 @@ +forms of expansion. + +@noindent -+Note that if a `@t{&}' is used within glob qualifers an extra backslash ++Note that if a `@t{&}' is used within glob qualifiers an extra backslash +is needed as a @t{&} is a special character in this case. + +@noindent @@ -7716,7 +7826,7 @@ +Another problem arises any time a job with a substitution that requires +a temporary file is disowned by the shell, including the case where +`@t{&!}' or `@t{&|}' appears at the end of a command containing a -+subsitution. In that case the temporary file will not be cleaned up as ++substitution. In that case the temporary file will not be cleaned up as +the shell no longer has any memory of the job. A workaround is to use +a subshell, for example, + @@ -7891,10 +8001,43 @@ +entire expression. + +@item @t{$@{}@var{name}@t{:*}@var{arrayname}@t{@}} -+Similar to the preceding subsitution, but in the opposite sense, ++Similar to the preceding substitution, but in the opposite sense, +so that entries present in both the original substitution and as +elements of @var{arrayname} are retained and others removed. + ++@item @t{$@{}@var{name}@t{:^}@var{arrayname}@t{@}} ++@itemx @t{$@{}@var{name}@t{:^^}@var{arrayname}@t{@}} ++Zips two arrays, such that the output array is twice as long as the ++shortest (longest for `@t{:^^}') of @t{name} and @t{arrayname}, with ++the elements alternatingly being picked from them. For `@t{:^}', if one ++of the input arrays is longer, the output will stop when the end of the ++shorter array is reached. Thus, ++ ++@noindent ++@example ++a=(1 2 3 4); b=(a b); print $@{a:^b@} ++@end example ++ ++@noindent ++will output `@t{1 a 2 b}'. For `@t{:^^}', then the input is repeated ++until all of the longer array has been used up and the above will output ++`@t{1 a 2 b 3 a 4 b}'. ++ ++@noindent ++Either or both inputs may be a scalar, they will be treated as an array ++of length 1 with the scalar as the only element. If either array is empty, ++the other array is output with no extra elements inserted. ++ ++@noindent ++Currently the following code will output `@t{a b}' and `@t{1}' as two separate ++elements, which can be unexpected. The second print provides a workaround which ++should continue to work if this is changed. ++ ++@noindent ++@example ++a=(a b); b=(1 2); print -l "$@{a:^b@}"; print -l "$@{$@{a:^b@}@}" ++@end example ++ +@item @t{$@{}@var{name}@t{:}@var{offset}@t{@}} +@itemx @t{$@{}@var{name}@t{:}@var{offset}@t{:}@var{length}@t{@}} +This syntax gives effects similar to parameter subscripting @@ -7946,7 +8089,7 @@ + +@noindent +all have the same effect, extracting the string starting at the fourth -+character of @t{$foo} if the substution would otherwise return a scalar, ++character of @t{$foo} if the substitution would otherwise return a scalar, +or the array starting at the fourth element if @t{$foo} would return an +array. Note that with the option @t{KSH_ARRAYS} @t{$foo} always returns +a scalar (regardless of the use of the offset syntax) and a form @@ -8186,7 +8329,7 @@ +@item @t{D} +Assume the string or array elements contain directories and attempt +to substitute the leading part of these by names. The remainder of -+the path (the whole of it if the leading part was not subsituted) ++the path (the whole of it if the leading part was not substituted) +is then quoted so that the whole string can be used as a shell +argument. This is the reverse of `@t{~}' substitution: see +@ref{Filename Expansion}. @@ -8394,15 +8537,16 @@ +follow this argument. + +@item @t{~} -+Force string arguments to any of the flags below that follow within -+the parentheses to be treated as patterns. Compare with a @t{~} ++Strings inserted into the expansion by any of the flags below are to ++be treated as patterns. This applies to the string arguments of flags ++that follow @t{~} within the same set of parentheses. Compare with @t{~} +outside parentheses, which forces the entire substituted string to +be treated as a pattern. Hence, for example, +@example +[[ "?" = $@{(~j.|.)array@} ]] +@end example -+with the @t{EXTENDED_GLOB} option set succeeds if and only if @t{$array} -+contains the string `@t{?}' as an element. The argument may be ++treats `@t{|}' as a pattern and succeeds if and only if @t{$array} ++contains the string `@t{?}' as an element. The @t{~} may be +repeated to toggle the behaviour; its effect only lasts to the +end of the parenthesised group. + @@ -8427,6 +8571,11 @@ +@var{string1} is used to produce any remaining padding. + +@noindent ++If either of @var{string1} or @t{string2} is present but empty, ++i.e. there are two delimiters together at that point, the first ++character of @t{$IFS} is used instead. ++ ++@noindent +If the @t{MULTIBYTE} option is in effect, the flag @t{m} may also +be given, in which case widths will be used for the calculation of +padding; otherwise individual multibyte characters are treated as occupying @@ -8725,16 +8874,21 @@ +If the result is still an array and one of the `@t{(o)}' or `@t{(O)}' flags +was present, the array is reordered. + -+@item @t{20.} @emph{Re-evaluation} ++@item @t{20.} @t{RC_EXPAND_PARAM} ++At this point the decision is made whether any resulting array elements ++are to be combined element by element with surrounding text, as given ++by either the @t{RC_EXPAND_PARAM} option or the `@t{^}' flag. ++ ++@item @t{21.} @emph{Re-evaluation} +Any `@t{(e)}' flag is applied to the value, forcing it to be re-examined +for new parameter substitutions, but also for command and arithmetic +substitutions. + -+@item @t{21.} @emph{Padding} ++@item @t{22.} @emph{Padding} +Any padding of the value by the `@t{(l.}@var{fill}@t{.)}' or +`@t{(r.}@var{fill}@t{.)}' flags is applied. + -+@item @t{22.} @emph{Semantic joining} ++@item @t{23.} @emph{Semantic joining} +In contexts where expansion semantics requires a single word to +result, all words are rejoined with the first character of @t{IFS} +between. So in `@t{$@{(P}@t{)$@{(f}@t{)lines@}@}}' @@ -8744,7 +8898,7 @@ +@noindent +If a single word is not required, this rule is skipped. + -+@item @t{23.} @emph{Empty argument removal} ++@item @t{24.} @emph{Empty argument removal} +If the substitution does not appear in double quotes, any resulting +zero-length argument, whether from a scalar or an element of an array, +is elided from the list of arguments inserted into the command line. @@ -8876,6 +9030,17 @@ +0 on either of the first two numbers (i.e. pad to two characters). + +@noindent ++An expression of the form `@t{@{}@var{c1}@t{..}@var{c2}@t{@}}', where ++@var{c1} and @var{c2} are single characters (which may be multibyte ++characters), is expanded to every character in the range from @var{c1} to ++@var{c2} in whatever character sequence is used internally. For ++characters with code points below 128 this is US ASCII (this is the only ++case most users will need). If any intervening character is not ++printable, appropriate quotation is used to render it printable. ++If the character sequence is reversed, the output is in reverse ++order, e.g. `@t{@{d..a@}}' is substituted as `@t{d c b a}'. ++ ++@noindent +If a brace expression matches none of the above forms, it is left +unchanged, unless the option @t{BRACE_CCL} (an abbreviation for `brace +character class') is set. @@ -9347,7 +9512,7 @@ + +@item @t{+(}...@t{)} +Match at least one occurrence. (Like `@t{(}...@t{)##}', -+except that recursive directory searching is not supported..) ++except that recursive directory searching is not supported.) + +@item @t{?(}...@t{)} +Match zero or one occurrence. (Like `@t{(|}...@t{)}'.) @@ -9729,7 +9894,13 @@ +recognised in this form even if a bare glob qualifier exists at the end of +the pattern, for example `@t{*(#q*)(.)}' will recognise executable regular +files if both options are set; however, mixed syntax should probably be -+avoided for the sake of clarity. ++avoided for the sake of clarity. Note that within conditions using the ++`@t{[[}' form the presence of a parenthesised expression ++@t{(#q...)} at the end of a string indicates that globbing ++should be performed; the expression may include glob qualifiers, but ++it is also valid if it is simply @t{(#q)}. This does ++not apply to the right hand side of pattern match operators as the ++syntax already has special significance. + +@noindent +A qualifier may be any one of the following: @@ -9959,10 +10130,12 @@ +exactly @var{n} bytes in length. + +@noindent -+If this flag is directly followed by a `@t{k}' (`@t{K}'), `@t{m}' -+(`@t{M}'), or `@t{p}' (`@t{P}') (e.g. `@t{Lk-50}') the check is performed -+with kilobytes, megabytes, or blocks (of 512 bytes) instead. In this -+case a file is regarded as "exactly" the size if the file size rounded up ++If this flag is directly followed by a @emph{size specifier} `@t{k}' (`@t{K}'), ++`@t{m}' (`@t{M}'), or `@t{p}' (`@t{P}') (e.g. `@t{Lk-50}') the check is ++performed with kilobytes, megabytes, or blocks (of 512 bytes) instead. ++(On some systems additional specifiers are available for gigabytes, ++`@t{g}' or `@t{G}', and terabytes, `@t{t}' or `@t{T}'.) If a size specifier ++is used a file is regarded as "exactly" the size if the file size rounded up +to the next unit is equal to the test size. Hence `@t{*(Lm1)}' +matches files from 1 byte up to 1 Megabyte inclusive. Note also that +the set of files "less than" the test size only includes files that would @@ -9996,9 +10169,17 @@ +sets the @t{NUMERIC_GLOB_SORT} option for the current pattern +@pindex NUMERIC_GLOB_SORT, setting in pattern + ++@item @t{Y}@var{n} ++enables short-circuit mode: the pattern will expand to at most @var{n} ++filenames. If more than @var{n} matches exist, only the first @var{n} ++matches in directory traversal order will be considered. ++ ++@noindent ++Implies @t{oN} when no @t{o}@var{c} qualifier is used. ++ +@item @t{o}@var{c} +specifies how the names of the files should be sorted. If @var{c} is -+@t{n} they are sorted by name (the default); if it is @t{L} they ++@t{n} they are sorted by name; if it is @t{L} they +are sorted depending on the size (length) of the files; if @t{l} +they are sorted by the number of links; if @t{a}, @t{m}, or @t{c} +they are sorted by the time of the last access, modification, or @@ -10014,6 +10195,10 @@ +specifiers may occur to resolve ties. + +@noindent ++The default sorting is @t{n} (by name) unless the @t{Y} glob qualifier is used, ++in which case it is @t{N} (unsorted). ++ ++@noindent +@t{oe} and @t{o+} are special cases; they are each followed by shell code, +delimited as for the @t{e} glob qualifier and the @t{+} glob qualifier +respectively (see above). The code is executed for each matched file with @@ -10052,6 +10237,13 @@ +of a file name; for example, the pattern `@t{*(P:-f:)}' produces the +command line arguments `@t{-f} @var{file1} @t{-f} @var{file2} ...' + ++@noindent ++If the modifier @t{^} is active, then @var{string} will be appended ++instead of prepended. Prepending and appending is done independently ++so both can be used on the same glob expression; for example by writing ++`@t{*(P:foo:^P:bar:^P:baz:)}' which produces the command line arguments ++`@t{foo} @t{baz} @var{file1} @t{bar} ...' ++ +@end table + +@noindent @@ -10164,14 +10356,21 @@ +@noindent +If the integer attribute, @t{-i}, is set for @var{name}, the @var{value} +is subject to arithmetic evaluation. Furthermore, by replacing `@t{=}' -+with `@t{+=}', a parameter can be added or appended to. See ++with `@t{+=}', a parameter can be added or appended to. ++ ++@noindent ++In scalar assignment, @var{value} is expanded as a single string, in ++which the elements of arrays are joined together; filename expansion is ++not performed unless the option @t{GLOB_ASSIGN} is set. See +@ref{Array Parameters} for additional forms of assignment. + +@noindent +To refer to the value of a parameter, write `@t{$}@var{name}' or +`@t{$@{}@var{name}@t{@}}'. See +@ref{Parameter Expansion} -+for complete details. ++for complete details. This section also explains the effect ++of the difference between scalar and array assignment on parameter ++expansion. + +@noindent +In the parameter lists that follow, the mark `' indicates that the @@ -10789,9 +10988,11 @@ + +@vindex 0 +@item @t{0} -+The name used to invoke the current shell. If the @t{FUNCTION_ARGZERO} option -+is set, this is set temporarily within a shell function to the name of the -+function, and within a sourced script to the name of the script. ++The name used to invoke the current shell, or as set by the @t{-c} command ++line option upon invocation. If the @t{FUNCTION_ARGZERO} option is set, ++@t{$0} is set upon entry to a shell function to the name of the function, ++and upon entry to a sourced script to the name of the script, and reset to ++its previous value when the function or script returns. + +@vindex status +@item @t{status} @@ -10847,9 +11048,10 @@ + +@vindex HISTCMD +@item @t{HISTCMD} -+The current history line number in an interactive shell, in other -+words the line number for the command that caused @t{$HISTCMD} -+to be read. ++The current history event number in an interactive shell, in other ++words the event number for the command that caused @t{$HISTCMD} ++to be read. If the current history event modifies the history, ++@t{HISTCMD} changes to the new maximum history event number. + +@vindex HOST +@item @t{HOST} @@ -10868,7 +11070,9 @@ +If the corresponding variable is not set in the environment of the +shell, it is initialized to the login name corresponding to the +current login session. This parameter is exported by default but -+this can be disabled using the @t{typeset} builtin. ++this can be disabled using the @t{typeset} builtin. The value ++is set to the string returned by the man page getlogin(3) system call ++if that is available. + +@vindex MACHTYPE +@item @t{MACHTYPE} @@ -11168,6 +11372,14 @@ +example just given files beginning with `@t{_}' in the current +directory would still be completed). + ++@vindex CORRECT_IGNORE_FILE ++@item @t{CORRECT_IGNORE_FILE} ++If set, is treated as a pattern during spelling correction of file names. ++Any file name that matches the pattern is never offered as a correction. ++For example, if the value is `@t{.*}' then dot file names will never be ++offered as spelling corrections. This is useful with the ++@t{CORRECT_ALL} option. ++ +@vindex DIRSTACKSIZE +@item @t{DIRSTACKSIZE} +The maximum size of the directory stack, by default there is no limit. If the @@ -11280,7 +11492,7 @@ +on the command line for the last one to be removed. + +@noindent -+For backward compabitility, if the @t{SUNKEYBOARDHACK} option is ++For backward compatibility, if the @t{SUNKEYBOARDHACK} option is +explicitly set, the value of @t{KEYBOARD_HACK} reverts to backquote. +If the option is explicitly unset, this variable is set to empty. + @@ -13024,6 +13236,10 @@ +@item @t{CORRECT_ALL} (@t{-O}) +Try to correct the spelling of all arguments in a line. + ++@noindent ++The shell variable @t{CORRECT_IGNORE_FILE} may be set to a pattern to ++match file names that will never be offered as corrections. ++ +@pindex DVORAK +@pindex NO_DVORAK +@pindex NODVORAK @@ -13100,7 +13316,7 @@ +@cindex hashing, of executables +@cindex executables, hashing +@item @t{HASH_EXECUTABLES_ONLY} -+When hashing commands because of @t{HASH_COMMANDS}, check that the ++When hashing commands because of @t{HASH_CMDS}, check that the +file to be hashed is actually an executable. This option +is unset by default as if the path contains a large number of commands, +or consists of many remote files, the additional tests can take @@ -13128,7 +13344,7 @@ +(assuming it exists). +Commands explicitly beginning with `@t{/}', `@t{./}' or `@t{../}' +are not subject to the path search. -+This also applies to the `@t{.}' builtin. ++This also applies to the `@t{.}' and @t{source} builtins. + +@noindent +Note that subdirectories of the current directory are always searched for @@ -13544,7 +13760,25 @@ +@cindex $0, setting +@item @t{FUNCTION_ARGZERO} +When executing a shell function or sourcing a script, set @t{$0} -+temporarily to the name of the function/script. ++temporarily to the name of the function/script. Note that toggling ++@t{FUNCTION_ARGZERO} from on to off (or off to on) does not change the ++current value of @t{$0}. Only the state upon entry to the function or ++script has an effect. Compare @t{POSIX_ARGZERO}. ++ ++@pindex LOCAL_LOOPS ++@pindex NO_LOCAL_LOOPS ++@pindex LOCALLOOPS ++@pindex NOLOCALLOOPS ++@cindex break, inside function ++@cindex continue, inside function ++@cindex function, scope of break and continue ++@item @t{LOCAL_LOOPS} ++When this option is not set, the effect of @t{break} and @t{continue} ++commands may propagate outside function scope, affecting loops in ++calling functions. When the option is set in a calling function, a ++@t{break} or a @t{continue} that is not caught within a called function ++(regardless of the setting of the option within that function) ++produces a warning and the effect is cancelled. + +@pindex LOCAL_OPTIONS +@pindex NO_LOCAL_OPTIONS @@ -13554,10 +13788,10 @@ +If this option is set at the point of return from a shell function, +most options (including this one) which were in force upon entry to +the function are restored; options that are not restored are -+@t{PRIVILEGED} and @t{RESTRICTED}. Otherwise, only this option and the -+@t{XTRACE} and @t{PRINT_EXIT_VALUE} options are restored. Hence -+if this is explicitly unset by a shell function the other options in -+force at the point of return will remain so. ++@t{PRIVILEGED} and @t{RESTRICTED}. Otherwise, only this option, ++and the @t{LOCAL_LOOPS}, @t{XTRACE} and @t{PRINT_EXIT_VALUE} options are ++restored. Hence if this is explicitly unset by a shell function the ++other options in force at the point of return will remain so. +A shell function can also guarantee itself a known shell configuration +with a formulation like `@t{emulate -L zsh}'; the @t{-L} activates +@t{LOCAL_OPTIONS}. @@ -13685,7 +13919,7 @@ +@cindex commands, tracing +@item @t{XTRACE} (@t{-x}, ksh: @t{-x}) +Print commands and their arguments as they are executed. The -+output is proceded by the value of @t{$PS4}, formatted as described ++output is preceded by the value of @t{$PS4}, formatted as described +in +@ref{Prompt Expansion}. + @@ -13897,6 +14131,30 @@ +in later lines. If in doubt, avoid use of aliases in non-interactive +code. + ++@pindex POSIX_ARGZERO ++@pindex NO_POSIX_ARGZERO ++@pindex POSIXARGZERO ++@pindex NOPOSIXARGZERO ++@cindex $0, using ++@item @t{POSIX_ARGZERO} ++This option may be used to temporarily disable @t{FUNCTION_ARGZERO} and ++thereby restore the value of @t{$0} to the name used to invoke the shell ++(or as set by the @t{-c} command line option). For compatibility with ++previous versions of the shell, emulations use @t{NO_FUNCTION_ARGZERO} ++instead of @t{POSIX_ARGZERO}, which may result in unexpected scoping of ++@t{$0} if the emulation mode is changed inside a function or script. ++To avoid this, explicitly enable @t{POSIX_ARGZERO} in the @t{emulate} ++command: ++ ++@noindent ++@example ++emulate sh -o POSIX_ARGZERO ++@end example ++ ++@noindent ++Note that @t{NO_POSIX_ARGZERO} has no effect unless @t{FUNCTION_ARGZERO} ++was already enabled upon entry to the function or script. ++ +@pindex POSIX_BUILTINS +@pindex NO_POSIX_BUILTINS +@pindex POSIXBUILTINS @@ -13980,7 +14238,7 @@ +@noindent +When this option is set, the @t{$'}@var{...}@t{'} expression is truncated at +the null character. Note that remaining parts of the same string -+beyond the termination of the quotes are not trunctated. ++beyond the termination of the quotes are not truncated. + +@noindent +For example, the command line argument @t{a$'b\0c'd} is treated with @@ -13998,7 +14256,10 @@ +traps for @t{EXIT} on exit from shell functions is suppressed. +In that case, manipulating @t{EXIT} traps always alters the global +trap for exiting the shell; the @t{LOCAL_TRAPS} option is -+ignored for the @t{EXIT} trap. ++ignored for the @t{EXIT} trap. Furthermore, a @t{return} statement ++executed in a trap with no argument passes back from the function the ++value from the surrounding context, not from code executed within the ++trap. + +@pindex SH_FILE_EXPANSION +@pindex NO_SH_FILE_EXPANSION @@ -14533,9 +14794,9 @@ + +@chapter Shell Builtin Commands +@noindent ++ +@cindex builtin commands +@cindex commands, builtin -+ +Some shell builtin commands take options as described in individual +entries; these are often referred to in the list below as `@t{flags}' to +avoid confusion with shell options, which may also have an effect on the @@ -15215,7 +15476,7 @@ +that it does not override globbing options; for example, `@t{enable -p +"~"}' does not cause the pattern character @t{~} to be active unless +the @t{EXTENDED_GLOB} option is also set. To enable all possible -+patterns (so that they may be invidually disabled with @t{disable -p}), ++patterns (so that they may be individually disabled with @t{disable -p}), +use `@t{setopt EXTENDED_GLOB KSH_GLOB NO_SH_GLOB}'. + +@findex eval @@ -15265,7 +15526,7 @@ +@cindex editing history +@item @t{fc} [ @t{-e} @var{ename} ] [ @t{-m} @var{match} ] [ @var{old}@t{=}@var{new} ... ] [ @var{first} [ @var{last} ] ] +@itemx @t{fc} @t{-l} [ @t{-nrdfEiD} ] [ @t{-t} @var{timefmt} ] [ @t{-m} @var{match} ] -+@itemx [ @var{old}@t{=}@var{new} ... ] [ @var{first} [ @var{last} ] ] ++@itemx @t{ }[ @var{old}@t{=}@var{new} ... ] [ @var{first} [ @var{last} ] ] +@itemx @t{fc} @t{-p} [ @t{-a} ] [ @var{filename} [ @var{histsize} [ @var{savehistsize} ] ] ] +@itemx @t{fc} @t{-P} +@itemx @t{fc} @t{-ARWI} [ @var{filename} ] @@ -15297,6 +15558,9 @@ +event), or to -16 if the @t{-l} flag is given. +If @var{last} is not specified, it will be set to @var{first}, +or to -1 if the @t{-l} flag is given. ++However, if the current event has added entries to the history with ++`@t{print -s}' or `@t{fc -R}', then the default @var{last} for @t{-l} ++includes all new history entries since the current event began. + +@noindent +The flag @t{-r} reverses the order of the commands and the @@ -15394,7 +15658,7 @@ +@item @t{functions} [ @{@t{+}|@t{-}@}@t{UXkmtTuz} ] [ @var{name} ... ] +@itemx @t{functions -M} @var{mathfn} [ @var{min} [ @var{max} [ @var{shellfn} ] ] ] +@itemx @t{functions -M} [ @t{-m} @var{pattern} ... ] -+@itemx @t{functions +M} [ @t{-m} ] @var{mathfn} ++@itemx @t{functions +M} [ @t{-m} ] @var{mathfn} ... +Equivalent to @t{typeset -f}, with the exception of the @t{-M} option. +Use of the @t{-M} option may not be combined with any of the options +handled by @t{typeset -f}. @@ -15975,8 +16239,7 @@ +character and are not removed. + +@item @t{-s} -+Don't echo back characters if reading from the terminal. Currently does -+not work with the @t{-q} option. ++Don't echo back characters if reading from the terminal. + +@item @t{-q} +Read only one character from the terminal and set @var{name} to @@ -16213,13 +16476,17 @@ + +@findex shift +@cindex parameters, positional -+@item @t{shift} [ @var{n} ] [ @var{name} ... ] ++@item @t{shift} [ @t{-p} ] [ @var{n} ] [ @var{name} ... ] +The positional parameters @t{$@{}@var{n}+1@t{@}} ... are renamed +to @t{$1} ..., where @var{n} is an arithmetic expression that +defaults to 1. +If any @var{name}s are given then the arrays with these names are +shifted instead of the positional parameters. + ++@noindent ++If the option @t{-p} is given arguments are instead removed (popped) ++from the end rather than the start of the array. ++ +@findex source +@item @t{source} @var{file} [ @var{arg} ... ] +Same as `@t{.}', except that the current directory is always searched and @@ -16366,14 +16633,28 @@ +@findex ttyctl +@cindex tty, freezing +@item @t{ttyctl} @t{-fu} -+The @t{-f} option freezes the tty, and @t{-u} unfreezes it. ++The @t{-f} option freezes the tty (i.e. terminal or terminal emulator), and ++@t{-u} unfreezes it. +When the tty is frozen, no changes made to the tty settings by +external programs will be honored by the shell, except for changes in the +size of the screen; the shell will +simply reset the settings to their previous values as soon as each +command exits or is suspended. Thus, @t{stty} and similar programs have -+no effect when the tty is frozen. Without options it reports whether the -+terminal is frozen or not. ++no effect when the tty is frozen. Freezing the tty does not cause ++the current state to be remembered: instead, it causes future changes ++to the state to be blocked. ++ ++@noindent ++Without options it reports whether the terminal is frozen or not. ++ ++@noindent ++Note that, regardless of whether the tty is frozen or not, the ++shell needs to change the settings when the line editor starts, so ++unfreezing the tty does not guarantee settings made on the ++command line are preserved. Strings of commands run between ++editing the command line will see a consistent tty state. ++See also the shell variable @t{STTY} for a means of initialising ++the tty before running external commands. + +@findex type +@item @t{type} [ @t{-wfpams} ] @var{name} ... @@ -16688,6 +16969,10 @@ +The number of pseudo-terminals. +@item @t{-q} +Bytes in POSIX message queues. ++@item @t{-r} ++Maximum real time priority. On some systems where this ++is not available, such as NetBSD, this has the same effect as @t{-T} ++for compatibility with @t{sh}. +@item @t{-s} +Kilobytes on the size of the stack. +@item @t{-T} @@ -16931,6 +17216,29 @@ +autoloaded will be written. + +@noindent ++Note the second form cannot be used for compiling functions that ++include redirections as part of the definition rather than within ++the body of the function; for example ++ ++@noindent ++@example ++fn1() @{ @{ ... @} >~/logfile @} ++@end example ++ ++@noindent ++can be compiled but ++ ++@noindent ++@example ++fn1() @{ ... @} >~/logfile ++@end example ++ ++@noindent ++cannot. It is possible to use the first form of @t{zcompile} to compile ++autoloadable functions that include the full function definition instead ++of just the body of the function. ++ ++@noindent +The third form, with the @t{-t} option, examines an existing +compiled file. Without further arguments, the names of the original +files compiled into it are listed. The first line of output shows @@ -17627,6 +17935,10 @@ +pushed back and treated as input to the line editor. +When @t{-R} is also used, interpret the @var{in-string}s as ranges. + ++@noindent ++Note that both @var{in-string} and @var{out-string} are subject to the same ++form of interpretation, as described below. ++ +@item @var{in-string command} ... +Bind each @var{in-string} to each @var{command}. +When @t{-R} is used, interpret the @var{in-string}s as ranges. @@ -17900,28 +18212,38 @@ + +@noindent +Installs @var{handler} (the name of a shell function) to handle input from -+file descriptor @var{fd}. When zle is attempting to read data, it will -+examine both the terminal and the list of handled @var{fd}'s. If data -+becomes available on a handled @var{fd}, zle will call @var{handler} with -+the fd which is ready for reading as the only argument. If the handler -+produces output to the terminal, it should call `@t{zle -I}' before doing -+so (see below). The handler should not attempt to read from the terminal. -+Note that zle makes no attempt to check whether this fd is actually ++file descriptor @var{fd}. Installing a handler for an @var{fd} which is ++already handled causes the existing handler to be replaced. Any number of ++handlers for any number of readable file descriptors may be installed. ++Note that zle makes no attempt to check whether this @var{fd} is actually +readable when installing the handler. The user must make their own +arrangements for handling the file descriptor when zle is not active. + +@noindent -+If the option @t{-w} is also given, the @var{handler} is instead a -+line editor widget, typically a shell function made into a widget using -+@t{zle -N}. In that case @var{handler} can use all the facilities of -+zle to update the current editing line. Note, however, that as handling -+@var{fd} takes place at a low level changes to the display will not -+automatically appear; the widget should call @t{zle -R} to force redisplay. -+ -+@noindent -+Any number of handlers for any number of readable file descriptors may be -+installed. Installing a handler for an @var{fd} which is already handled -+causes the existing handler to be replaced. ++When zle is attempting to read data, it will examine both the terminal and ++the list of handled @var{fd}'s. If data becomes available on a handled ++@var{fd}, zle calls @var{handler} with the fd which is ready for reading ++as the first argument. Under normal circumstances this is the only ++argument, but if an error was detected, a second argument provides ++details: `@t{hup}' for a disconnect, `@t{nval}' for a closed or otherwise ++invalid descriptor, or `@t{err}' for any other condition. Systems that ++support only the `select' system call always use `@t{err}'. ++ ++@noindent ++If the option @t{-w} is also given, the @var{handler} is instead a line ++editor widget, typically a shell function made into a widget using ++`@t{zle -N}'. In that case @var{handler} can use all the facilities of zle ++to update the current editing line. Note, however, that as handling @var{fd} ++takes place at a low level changes to the display will not automatically ++appear; the widget should call `@t{zle -R}' to force redisplay. As of this ++writing, widget handlers only support a single argument and thus are never ++passed a string for error state, so widgets must be prepared to test the ++descriptor themselves. ++ ++@noindent ++If either type of handler produces output to the terminal, it should call ++`@t{zle -I}' before doing so (see below). Handlers should not attempt to ++read from the terminal. + +@noindent +If no @var{handler} is given, but an @var{fd} is present, any handler for @@ -17940,7 +18262,8 @@ +@noindent +Note that this feature should be used with care. Activity on one of the +@var{fd}'s which is not properly handled can cause the terminal to become -+unusable. ++unusable. Removing an @var{fd} handler from within a signal trap may cause ++unpredictable behavior. + +@noindent +Here is a simple example of using this feature. A connection to a remote @@ -17950,6 +18273,8 @@ +that `select' will indicate that the file descriptor needs handling +if the remote side has closed the connection; we handle that by testing +for a failed read. ++ ++@noindent +@example +if ztcp pwspc 2811; then + tcpfd=$REPLY @@ -18157,17 +18482,19 @@ +@item @t{CONTEXT} (scalar) +The context in which zle was called to read a line; read-only. One of +the values: ++ ++@noindent +@table @asis -+@item start ++@item @t{start} +The start of a command line (at prompt @t{PS1}). + -+@item cont ++@item @t{cont} +A continuation to a command line (at prompt @t{PS2}). + -+@item select ++@item @t{select} +In a @t{select} loop. + -+@item vared ++@item @t{vared} +Editing a variable in @t{vared}. + +@end table @@ -18306,21 +18633,25 @@ +Each string consists of the following parts: + +@noindent -+@table @asis -+@item Optionally, a `@t{P}' to signify that the start and end offset that ++@itemize @bullet ++ ++@item ++Optionally, a `@t{P}' to signify that the start and end offset that +follow include any string set by the @t{PREDISPLAY} special parameter; +this is needed if the predisplay string itself is to be highlighted. +Whitespace may follow the `@t{P}'. -+@item A start offset in the same units as @t{CURSOR}, terminated by ++@item ++A start offset in the same units as @t{CURSOR}, terminated by +whitespace. -+@item An end offset in the same units as @t{CURSOR}, terminated by ++@item ++An end offset in the same units as @t{CURSOR}, terminated by +whitespace. -+@item A highlight specification in the same format as ++@item ++A highlight specification in the same format as +used for contexts in the parameter @t{zle_highlight}, +@ref{Character Highlighting}; +for example, @t{standout} or @t{fg=red,bold}. -+@end table -+@sp 1 ++@end itemize + +@noindent +For example, @@ -18775,9 +19106,13 @@ +Redisplay the command line, remaining in incremental search mode. + +@item @t{vi-cmd-mode} -+Toggle between the `@t{main}' and `@t{vicmd}' keymaps; ++Select the `@t{vicmd}' keymap; +the `@t{main}' keymap (insert mode) will be selected initially. + ++@noindent ++In addition, the modifications that were made while in vi insert mode are ++merged to form a single undo event. ++ +@item @t{vi-repeat-search} +@itemx @t{vi-rev-repeat-search} +Repeat the search. The direction of the search is indicated in the @@ -19729,6 +20064,13 @@ +@item @t{spell-word} (ESC-$ ESC-S ESC-s) (unbound) (unbound) +Attempt spelling correction on the current word. + ++@tindex split-undo ++@item @t{split-undo} ++Breaks the undo sequence at the current change. This is useful in vi mode as ++changes made in insert mode are coalesced on entering command mode. Similarly, ++@t{undo} will normally revert as one all the changes made by a user-defined ++widget. ++ +@tindex undefined-key +@item @t{undefined-key} +This command is executed when a key sequence that is not bound to any @@ -19741,6 +20083,11 @@ +of the undo history as returned by the @t{UNDO_CHANGE_NO} variable; +modifications are undone until that state is reached. + ++@noindent ++Note that when invoked from vi command mode, the full prior change made in ++insert mode is reverted, the changes having been merged when command mode was ++selected. ++ +@tindex redo +@item @t{redo} +Incrementally redo undone text modifications. @@ -19832,7 +20179,7 @@ + +@cindex completion removable suffix, highlighting +@cindex suffix, highlighting removable, in completion -+@cindex removable suffix, highlighting in completino ++@cindex removable suffix, highlighting in completion +@item @t{suffix} +This context is used in completion for characters that are +marked as suffixes that will be removed if the completion ends @@ -23489,9 +23836,9 @@ +@kindex matcher, completion style +@item @t{matcher} +This style is tested separately for each tag valid in the current -+context. Its value is added to any match specifications given by the ++context. Its value is tried before any match specifications given by the +@t{matcher-list} style. It should be in the form described in -+@ref{Completion Matching Control}. ++@ref{Completion Matching Control}. For examples of this, see the description of the @t{tag-order} style. + +@kindex matcher-list, completion style +@item @t{matcher-list} @@ -23515,14 +23862,16 @@ + +@noindent +@example -+zstyle ':completion:*' matcher-list @value{dsq} '+m@{a-z@}=@{A-Z@}' '+m@{A-Z@}=@{a-z@}' ++zstyle ':completion:*' matcher-list @value{dsq} '+m:@{a-z@}=@{A-Z@}' '+m:@{A-Z@}=@{a-z@}' +@end example + +@noindent +It is possible to create match specifications valid for particular -+completers by using the third field of the context. For example, to -+use the completers @t{_complete} and @t{_prefix} but only allow -+case-insensitive completion with @t{_complete}: ++completers by using the third field of the context. This applies only ++to completers that override the global matcher-list, which as of this ++writing includes only @t{_prefix} and @t{_ignored}. For example, to ++use the completers @t{_complete} and @t{_prefix} but allow ++case-insensitive completion only with @t{_complete}: + +@noindent +@example @@ -23887,7 +24236,7 @@ +should be completed. + +@noindent -+If it is a singe number, only the last @var{N} words from the history ++If it is a single number, only the last @var{N} words from the history +will be completed. + +@noindent @@ -23991,6 +24340,15 @@ +dictionary databases to be added separately. +The default for this style is `false'. + ++@kindex show-ambiguity, completion style ++@item @t{show-ambiguity} ++If the @t{zsh/complist} module is loaded, this style can be used to ++highlight the first ambiguous character in completion lists. The ++value is either a color indication such as those supported by the ++@t{list-colors} style or, with a value of @t{true}, a default of ++underlining is selected. The highlighting is only applied if the ++completion display strings correspond to the actual matches. ++ +@kindex show-completer, completion style +@item @t{show-completer} +Tested whenever a new completer is tried. If it is true, the completion @@ -24682,6 +25040,15 @@ +This function is also a bindable command, see +@ref{Bindable Commands}. + ++@findex _extensions ++@item @t{_extensions} ++If the cursor follows the string `@t{*.}', filename extensions are ++completed. The extensions are taken from files in current directory or a ++directory specified at the beginning of the current word. For exact matches, ++completion continues to allow other completers such as @t{_expand} to ++expand the pattern. The standard @t{add-space} and @t{prefix-hidden} ++styles are observed. ++ +@findex _history +@item @t{_history} +Complete words from the shell's command history. This completer @@ -26644,6 +27011,20 @@ +`@t{-r}', `@t{-R}', and `@t{-q}' and passes them on to the @t{compadd} +builtin used to add the matches. + ++@findex _sequence ++@item @t{_sequence} [ @t{-s} @var{sep} ] [ @t{-n} @var{max} ] [ @t{-d} ] @var{function} [ @t{-} ] ... ++This function is a wrapper to other functions for completing items in a ++separated list. The same function is used to complete each item in the ++list. The separator is specified with the @t{-s} option. If @t{-s} is ++omitted it will use `@t{,}'. Duplicate values are not matched unless ++@t{-d} is specified. If there is a fixed or maximum number of items in ++the list, this can be specified with the @t{-n} option. ++ ++@noindent ++Common @t{compadd} options are passed on to the function. It is possible ++to use @t{compadd} directly with @t{_sequence}, though @t{_values} may ++be more appropriate in this situation. ++ +@findex _setup +@item @t{_setup} @var{tag} [ @var{group} ] +This function sets up the special @@ -28502,12 +28883,12 @@ +@noindent +Once @t{compdescribe} has been called with either the @t{-i} or the +@t{-I} option, it can be repeatedly called with the @t{-g} option and -+the names of five arrays as its arguments. This will step through the -+different sets of matches and store the options in the first array, -+the strings with descriptions in the second, the matches for these in -+the third, the strings without descriptions in the fourth, and the -+matches for them in the fifth array. These are then directly given to -+@t{compadd} to register the matches with the completion code. ++the names of four parameters as its arguments. This will step through ++the different sets of matches and store the value of @t{compstate[list]} ++in the first scalar, the options for @t{compadd} in the second array, ++the matches in the third array, and the strings to be displayed in the ++completion listing in the fourth array. The arrays may then be directly ++given to @t{compadd} to register the matches with the completion code. + +@findex compfiles +@item @t{compfiles} @@ -29677,6 +30058,15 @@ +executed. The first element is the name of the function using the +parameter. + ++@noindent ++The standard shell array @t{zsh_eval_context} can be used to ++determine the type of shell construct being executed at each depth: ++note, however, that is in the opposite order, with the most recent ++item last, and it is more detailed, for example including an ++entry for @t{toplevel}, the main shell code being executed ++either interactively or from a script, which is not present ++in @t{$funcstack}. ++ +@vindex functrace +@item @t{functrace} +This array contains the names and line numbers of the callers @@ -29771,6 +30161,8 @@ + +@noindent +The @t{zsh/pcre} module makes available the following test condition: ++ ++@noindent +@table @asis +@findex pcre-match +@item expr @t{-pcre-match} pcre @@ -29780,7 +30172,18 @@ +For example, + +@noindent -+[[ "$text" -pcre-match ^d+$ ]] && print text variable contains only "d's". ++@example ++[[ "$text" -pcre-match ^d+$ ]] && ++print text variable contains only "d's". ++@end example ++ ++@noindent ++@pindex REMATCH_PCRE ++@pindex NO_CASE_MATCH ++If the @t{REMATCH_PCRE} option is set, the @t{=~} operator is equivalent to ++@t{-pcre-match}, and the @t{NO_CASE_MATCH} option may be used. Note that ++@t{NO_CASE_MATCH} never applies to the @t{pcre_match} builtin, instead use ++the @t{-i} switch of @t{pcre_compile}. + +@end table +@c (avoiding a yodl bug) @@ -29793,6 +30196,8 @@ +@cindex regular expressions +@cindex regex +The @t{zsh/regex} module makes available the following test condition: ++ ++@noindent +@table @asis +@findex regex-match +@item @var{expr} @t{-regex-match} @var{regex} @@ -29880,7 +30285,7 @@ +@noindent +@table @asis +@vindex zsh_scheduled_events -+@item zsh_scheduled_events ++@item @t{zsh_scheduled_events} +A readonly array corresponding to the events scheduled by the +@t{sched} builtin. The indices of the array correspond to the numbers +shown when @t{sched} is run with no arguments (provided that the @@ -31790,10 +32195,12 @@ +builtin. + +@item @t{-K} -+With this option, the arrays specified with the @t{-a} and @t{-A} -+options and with the `@t{=}@var{array}' forms are kept unchanged when none -+of the @var{specs} for them is used. This allows assignment of default -+values to them before calling @t{zparseopts}. ++With this option, the arrays specified with the @t{-a} option and with the ++`@t{=}@var{array}' forms are kept unchanged when none of the @var{specs} for ++them is used. Otherwise the entire array is replaced when any of the ++@var{specs} is used. Individual elements of associative arrays specified ++with the @t{-A} option are preserved by @t{-K}. This allows assignment of ++default values to arrays before calling @t{zparseopts}. + +@item @t{-M} +This changes the assignment rules to implement a map among equivalent @@ -31802,7 +32209,7 @@ +which is used to choose where to store the values. If no other @var{spec} +is found, the values are stored as usual. This changes only the way the +values are stored, not the way @t{$*} is parsed, so results may be -+unpredicable if the `@var{name}@t{+}' specifier is used inconsistently. ++unpredictable if the `@var{name}@t{+}' specifier is used inconsistently. + +@item @t{-E} +This changes the parsing rules to @emph{not} stop at the first string @@ -32558,44 +32965,47 @@ +parameter @t{reply} to an empty associative array. Otherwise, +it returns status 0 and sets elements of the associative +array @t{reply} as follows: ++ ++@noindent +@table @asis -+@item time ++@item @t{time} +The time as a string of digits in the same units as +@t{$EPOCHSECONDS} -+@item schedtime ++@item @t{schedtime} +The regularly scheduled time. This may differ from +the actual event time @t{time} if this is a recurring event and the next +occurrence has been rescheduled. Then @t{time} gives the actual time +and @t{schedtime} the time of the regular recurrence before modification. -+@item text1 ++@item @t{text1} +The text from the line not including the date and time of the +event, but including any @t{WARN} or @t{RPT} keywords and values. -+@item warntime ++@item @t{warntime} +Any warning time given by the @t{WARN} keyword as a string +of digits containing the time at which to warn in the same units as +@t{$EPOCHSECONDS}. (Note this is an absolute time, not the relative time +passed down.) Not set no @t{WARN} keyword and value were +matched. -+@item warnstr ++@item @t{warnstr} +The raw string matched after the @t{WARN} keyword, else unset. -+@item rpttime ++@item @t{rpttime} +Any recurrence time given by the @t{RPT} keyword as a string +of digits containing the time of the recurrence in the same units +as @t{$EPOCHSECONDS}. (Note this is an absolute time.) Not set if +no @t{RPT} keyword and value were matched. -+@item schedrpttime ++@item @t{schedrpttime} +The next regularly scheduled occurrence of a recurring +event before modification. This may differ from @t{rpttime}, which is the +actual time of the event that may have been rescheduled from the regular +time. -+@item rptstr ++@item @t{rptstr} +The raw string matched after the @t{RPT} keyword, else unset. -+@item text2 ++@item @t{text2} +The text from the line after removal of the date and any +keywords and values. + +@end table -+) ++ ++@noindent +@findex calendar_showdate +@item @t{calendar_showdate} [ @t{-r} ] [ @t{-f} @var{fmt} ] @var{date-spec ...} +The given @var{date-spec} is interpreted and the corresponding date and @@ -33313,7 +33723,7 @@ +more explicit method. + +@findex tcp_expect -+@item @t{tcp_expect [ -q ] [ -p} @var{var} @t{] [ -t } @var{to} @t{| -T} @var{TO}@t{]} ++@item @t{tcp_expect [ -q ] [ -p } @var{var} @t{ | -P } @var{var} @t{] [ -t } @var{to} @t{| -T} @var{TO}@t{]} +@itemx @t{ [ -a | -s} @var{sess} @t{... | -l} @var{sess}@t{,... ]} @var{pattern} ... +Wait for input matching any of the given @var{pattern}s from any of the +specified sessions. Input is ignored until an input line matches one of @@ -33350,7 +33760,17 @@ +@var{var} can be used; on return, @t{$var} is set to the number of the +pattern using ordinary zsh indexing, i.e. the first is 1, and so on. Note +the absence of a `@t{$}' in front of @var{var}. To avoid clashes, the -+parameter cannot begin with `@t{_expect}'. ++parameter cannot begin with `@t{_expect}'. The index -1 is used if ++there is a timeout and 0 if there is no match. ++ ++@noindent ++The option @t{-P} @var{var} works similarly to @t{-p}, but instead of ++numerical indexes the regular arguments must begin with a prefix ++followed by a colon: that prefix is then used as a tag to which @var{var} ++is set when the argument matches. The tag @t{timeout} is used if there ++is a timeout and the empty string if there is no match. Note it is ++acceptable for different arguments to start with the same prefix if the ++matches do not need to be distinguished. + +@noindent +The option @t{-q} is passed directly down to @t{tcp_read}. @@ -33729,6 +34149,11 @@ +`@t{%(c.-.+)}' which outputs `@t{+}' if the session is +the current one, else `@t{-}'. + ++@noindent ++If the prompt starts with @t{%P}, this is stripped and the complete ++result of the previous stage is passed through standard prompt @t{%}-style ++formatting before being output. ++ +@vindex TCP_READ_DEBUG +@item @t{TCP_READ_DEBUG} +May be set directly. If this has non-zero length, @t{tcp_read} will give @@ -34743,9 +35168,8 @@ +other tests to produce the most complete help possible for the command. + +@noindent -+There may already be a directory of help files on your system; look in -+@t{/usr/share/zsh} or @t{/usr/local/share/zsh} and subdirectories below -+those, or ask your system administrator. ++Help files are installed by default to a subdirectory of @t{/usr/share/zsh} ++or @t{/usr/local/share/zsh}. + +@noindent +To create your own help files with @t{helpfiles}, choose or create a @@ -34756,30 +35180,33 @@ +@noindent +@example +mkdir ~/zsh_help -+cd ~/zsh_help -+man zshall | colcrt - | \ -+perl ~/zsh-5.0.5/Util/helpfiles ++perl ~/zsh-5.0.7/Util/helpfiles ~/zsh_help ++@end example ++ ++@noindent ++@vindex HELPDIR ++The @t{HELPDIR} parameter tells @t{run-help} where to look for the help ++files. When unset, it uses the default installation path. ++To use your own set of help files, set this to the appropriate path ++in one of your startup files: ++ ++@noindent ++@example ++HELPDIR=~/zsh_help +@end example + +@noindent +@findex run-help, use of -+Next, to use the @t{run-help} function, you need to add lines something ++To use the @t{run-help} function, you need to add lines something +like the following to your @t{.zshrc} or equivalent startup file: + +@noindent +@example +unalias run-help +autoload run-help -+HELPDIR=~/zsh_help +@end example + +@noindent -+@vindex HELPDIR -+The @t{HELPDIR} parameter tells @t{run-help} where to look for the help -+files. If your system already has a help file directory installed, set -+@t{HELPDIR} to the path of that directory instead. -+ -+@noindent +Note that in order for `@t{autoload run-help}' to work, the @t{run-help} +file must be in one of the directories named in your @t{fpath} array (see +@ref{Parameters Used By The Shell}). This should already be the case if you have a standard zsh @@ -34914,7 +35341,7 @@ + +@noindent +@example -+zsh -f ~/zsh-5.0.5/Functions/Misc/zkbd ++zsh -f ~/zsh-5.0.7/Functions/Misc/zkbd +@end example + +@noindent @@ -34979,7 +35406,7 @@ + +@noindent +@example -+. ~/zsh-5.0.5/Util/reporter > zsh.report ++. ~/zsh-5.0.7/Util/reporter > zsh.report +@end example + +@noindent @@ -35727,8 +36154,8 @@ +If enabled, this style causes the @t{%c} and @t{%u} format escapes to show +when the working directory has uncommitted changes. The strings displayed by +these escapes can be controlled via the @t{stagedstr} and @t{unstagedstr} -+styles. The only backends that currently support this option are @t{git} and -+@t{hg} (@t{hg} only supports unstaged). ++styles. The only backends that currently support this option are @t{git}, ++@t{hg}, and @t{bzr} (the latter two only support unstaged). + +@noindent +For this style to be evaluated with the @t{hg} backend, the @t{get-revision} @@ -35736,10 +36163,28 @@ +latter is the default; the former is not. + +@noindent ++With the @t{bzr} backend, @emph{lightweight checkouts} only honor this style if ++the @t{use-server} style is set. ++ ++@noindent +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. + ++@kindex check-for-staged-changes ++@item @t{check-for-staged-changes} ++This style is like @t{check-for-changes}, but it never checks the worktree ++files, only the metadata in the @t{.$@{vcs@}} dir. Therefore, ++this style initializes only the @t{%c} escape (with @t{stagedstr}) but ++not the @t{%u} escape. This style is faster than @t{check-for-changes}. ++ ++@noindent ++In the @t{git} backend, this style checks for changes in the index. ++Other backends do not currently implement this style. ++ ++@noindent ++This style is disabled by default. ++ +@kindex stagedstr +@item @t{stagedstr} +This string will be used in the @t{%c} escape if there are staged changes in @@ -35768,7 +36213,7 @@ +@noindent +For example, this style can be used to use binaries from non-default +installation directories. Assume, @t{git} is installed in /usr/bin but -+your sysadmin installed a newer version in /usr/bin/local. Instead of ++your sysadmin installed a newer version in /usr/local/bin. Instead of +changing the order of your @t{$PATH} parameter, you can do this: +@example +zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git @@ -35789,6 +36234,10 @@ +directories of each Perforce client. See comments in the function +@t{VCS_INFO_detect_p4} for more detail. + ++@noindent ++The Bazaar backend (@t{bzr}) uses this to permit contacting the server ++about lightweight checkouts, see the @t{check-for-changes} style. ++ +@kindex use-simple +@item @t{use-simple} +If there are two different ways of gathering @@ -35861,6 +36310,8 @@ +(empty list) +@item @t{check-for-changes} +false ++@item @t{check-for-staged-changes} ++false +@item @t{stagedstr} +(string: "S") +@item @t{unstagedstr} @@ -36126,8 +36577,8 @@ +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 `@t{-a}' is used as the first -+argument, @t{all} occurances of the functions are unregistered. Otherwise -+only the last occurance is removed (if a function was registered to a hook ++argument, @t{all} occurrences of the functions are unregistered. Otherwise ++only the last occurrence is removed (if a function was registered to a hook +more than once) . The `@t{+vi-}' prefix needs to be left out here. See +@cite{Hooks in vcs_info} below for details. + @@ -36291,14 +36742,14 @@ +@noindent +When setting @t{ret} to non-zero, the string in +@t{$@{hook_com[hg-bookmark-string]@}} will be used in the @t{%m} escape in -+@t{formats} and @t{actionformats} and will be availabe in the global ++@t{formats} and @t{actionformats} and will be available in the global +@t{backend_misc} array as @t{$@{backend_misc[bookmarks]@}}. + +@item @t{gen-applied-string} -+Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backends -+and in @t{quilt} support when the @t{applied-string} is generated; the -+@t{use-quilt} zstyle must be true for @t{quilt} (the @t{mq} and @t{stgit} -+backends are active by default). ++Called in the @t{git} (with @t{stgit} or during rebase), and @t{hg} ++(with @t{mq}) backends and in @t{quilt} support when the @t{applied-string} ++is generated; the @t{use-quilt} zstyle must be true for @t{quilt} (the @t{mq} ++and @t{stgit} backends are active by default). + +@noindent +This hook gets the names of all applied patches which @t{vcs_info} collected @@ -36313,9 +36764,9 @@ +available as @t{%p} in the @t{patch-format} and @t{nopatch-format} styles. + +@item @t{gen-unapplied-string} -+Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backend -+and in @t{quilt} support when the @t{unapplied-string} is generated; the -+@t{get-unapplied} style must be true. ++Called in the @t{git} (with @t{stgit} or during rebase), and @t{hg} (with ++@t{mq}) backend and in @t{quilt} support when the @t{unapplied-string} is ++generated; the @t{get-unapplied} style must be true. + +@noindent +This hook gets the names of all unapplied patches which @t{vcs_info} @@ -36345,6 +36796,12 @@ +@noindent +The `hook_com' parameter is not used. + ++@item @t{post-backend} ++Called as soon as the backend has finished collecting information. ++ ++@noindent ++The `@t{hook_com}' keys available are as for the @t{set-message} hook. ++ +@item @t{post-quilt} +Called after the @t{quilt} support is done. The following information +is passed as arguments to the hook: 1. the quilt-support mode (`addon' or @@ -36565,22 +37022,15 @@ + # This makes the bookmarks string use only those + # bookmarks. If there's more than one, it + # concatenates them using commas. -+ local s i + # The bookmarks returned by `hg' are available in -+ # the functions positional parameters. -+ (( $# == 0 )) && return 0 -+ for i in "$@@"; do -+ if [[ $i == sh/* ]]; then -+ [[ -n $s ]] && s=$s, -+ s=$@{s@}$i -+ fi -+ done ++ # the function's positional parameters. ++ local s="$@{(Mj:,:)@@:#sh/*@}" + # Now, the communication with the code that calls + # the hook functions is done via the hook_com[] -+ # hash. The key, at which the `gen-hg-bookmark-string' -+ # hook looks at is `hg-bookmark-string'. So: ++ # hash. The key at which the `gen-hg-bookmark-string' ++ # hook looks is `hg-bookmark-string'. So: + hook_com[hg-bookmark-string]=$s -+ # And to signal, that we want to use the sting we ++ # And to signal that we want to use the string we + # just generated, set the special variable `ret' to + # something other than the default zero: + ret=1 @@ -37046,6 +37496,12 @@ +bindkey -M vicmd v edit-command-line +@end example + ++@tindex expand-absolute-path ++@item @t{expand-absolute-path} ++Expand the file name under the cursor to an absolute path, resolving ++symbolic links. Where possible, the initial path segment is turned ++into a named directory or reference to a user's home directory. ++ +@tindex history-beginning-search-backward-end +@tindex history-beginning-search-forward-end +@item @t{history-search-end} @@ -37630,6 +38086,39 @@ +not used. Hence it is still possible to call @t{executed-named-cmd} and +similar functions while reading a value. + ++@tindex replace-argument ++@tindex replace-argument-edit ++@item @t{replace-argument}, @t{replace-argument-edit} ++The function @t{replace-argument} can be used to replace a command ++line argument in the current command line or, if the current command ++line is empty, in the last command line executed (the new command line ++is not executed). Arguments are as delimited by standard shell syntax, ++ ++@noindent ++If a numeric argument is given, that specifies the argument to be ++replaced. 0 means the command name, as in history expansion. ++A negative numeric argument counts backward from the last word. ++ ++@noindent ++If no numeric argument is given, the current argument is replaced; ++this is the last argument if the previous history line is being used. ++ ++@noindent ++The function prompts for a replacement argument. ++ ++@noindent ++If the widget contains the string @t{edit}, for example is defined as ++ ++@noindent ++@example ++zle -N replace-argument-edit replace-argument ++@end example ++ ++@noindent ++then the function presents the current value of the argument for ++editing, otherwise the editing buffer for the replacement is ++initially empty. ++ +@tindex replace-string +@tindex replace-string-again +@tindex replace-pattern @@ -37795,6 +38284,26 @@ +may be set to an array to give the command and options that will be used to +investigate the command word found. The default is @t{whence -c}. + ++@tindex zcalc-auto-insert ++@item @t{zcalc-auto-insert} ++This function is useful together with the @t{zcalc} function described in ++@ref{Mathematical Functions}. ++It should be bound to a key representing a binary operator such ++as `@t{+}', `@t{-}', `@t{*}' or `@t{/}'. When running in zcalc, ++if the key occurs at the start of the line or immediately following ++an open parenthesis, the text @t{"ans "} is inserted before the ++representation of the key itself. This allows easy use of the ++answer from the previous calculation in the current line. The ++text to be inserted before the symbol typed can be modified by setting ++the variable @t{ZCALC_AUTO_INSERT_PREFIX}. ++ ++@noindent ++Hence, for example, typing `@t{+12}' followed by return adds 12 ++to the previous result. ++ ++@noindent ++When not in zcalc, the key simply inserts the symbol itself. ++ +@end table + +@noindent @@ -38519,7 +39028,7 @@ +flags, and quoted so that the output can be run as a complete zsh +command line. This is used by the completion system to decide how to +complete after a file handled by @t{zsh-mime-setup}. -+) ++ +@findex pick-web-browser +@item @t{pick-web-browser} +This function is separate from the two MIME functions described above @@ -38874,13 +39383,14 @@ +@t{colors} more than once. + +@noindent -+The eight base colors are: black, red, green, yellow, blue, magenta, cyan, -+and white. Each of these has codes for foreground and background. In -+addition there are eight intensity attributes: bold, faint, standout, -+underline, blink, reverse, and conceal. Finally, there are six codes used -+to negate attributes: none (reset all attributes to the defaults), normal -+(neither bold nor faint), no-standout, no-underline, no-blink, and -+no-reverse. ++The eight base colors are: @t{black}, @t{red}, @t{green}, @t{yellow}, ++@t{blue}, @t{magenta}, @t{cyan}, and @t{white}. Each of these has codes for ++foreground and background. In addition there are seven intensity attributes: ++@t{bold}, @t{faint}, @t{standout}, @t{underline}, @t{blink}, @t{reverse}, ++and @t{conceal}. Finally, there are seven codes used to negate attributes: ++@t{none} (reset all attributes to the defaults), @t{normal} ++(neither bold nor faint), @t{no-standout}, @t{no-underline}, @t{no-blink}, ++@t{no-reverse}, and @t{no-conceal}. + +@noindent +Some terminals do not support all combinations of colors and intensities. @@ -38890,8 +39400,8 @@ + +@noindent +@table @asis -+@item color -+@itemx colour ++@item @t{color} ++@itemx @t{colour} +Map all the color names to their integer codes, and integer codes to the +color names. The eight base names map to the foreground color codes, as +do names prefixed with `@t{fg-}', such as `@t{fg-red}'. Names prefixed @@ -38903,16 +39413,16 @@ +Although it is a misnomer to call them `colors', these arrays also map the +other fourteen attributes from names to codes and codes to names. + -+@item fg -+@itemx fg_bold -+@itemx fg_no_bold ++@item @t{fg} ++@itemx @t{fg_bold} ++@itemx @t{fg_no_bold} +Map the eight basic color names to ANSI terminal escape sequences that set +the corresponding foreground text properties. The @t{fg} sequences change +the color without changing the eight intensity attributes. + -+@item bg -+@itemx bg_bold -+@itemx bg_no_bold ++@item @t{bg} ++@itemx @t{bg_bold} ++@itemx @t{bg_no_bold} +Map the eight basic color names to ANSI terminal escape sequences that set +the corresponding background properties. The @t{bg} sequences change the +color without changing the eight intensity attributes. @@ -39398,12 +39908,11 @@ +@printindex ky +@c (avoiding a yodl bug) + -+@contents +@bye --- /dev/null -+++ zsh-5.0.5/Doc/zshall.1 ++++ zsh-5.0.7/Doc/zshall.1 @@ -0,0 +1,476 @@ -+.TH "ZSHALL" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++.TH "ZSHALL" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshall \- the Z shell meta\-man page +.\" Yodl file: Zsh/intro.yo @@ -39657,7 +40166,7 @@ +Zsh tries to emulate \fBsh\fP or \fBksh\fP when it is invoked as +\fBsh\fP or \fBksh\fP respectively; more precisely, it looks at the first +letter of the name by which it was invoked, excluding any initial `\fBr\fP' -+(assumed to stand for `restricted'), and if that is `\fBs\fP' or `\fBk\fP' it ++(assumed to stand for `restricted'), and if that is `\fBb\fP', `\fBs\fP' or `\fBk\fP' it +will emulate \fBsh\fP or \fBksh\fP\&. Furthermore, if invoked as \fBsu\fP (which +happens on certain systems when the shell is executed by the \fBsu\fP +command), the shell will try to find an alternative name from the \fBSHELL\fP @@ -39839,7 +40348,7 @@ +.so man1/zshtcpsys.1 +.so man1/zshzftpsys.1 +.so man1/zshcontrib.1 -+.TH "ZSHALL" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++.TH "ZSHALL" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.\" Yodl file: Zsh/filelist.yo +.SH "FILES" +.PD 0 @@ -39880,9 +40389,9 @@ +Part 2: Shell and Utilities\fP, +IEEE Inc, 1993, ISBN 1\-55937\-255\-9\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshbuiltins.1 -@@ -0,0 +1,2724 @@ -+.TH "ZSHBUILTINS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshbuiltins.1 +@@ -0,0 +1,2772 @@ ++.TH "ZSHBUILTINS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshbuiltins \- zsh built\-in commands +.\" Yodl file: Zsh/builtins.yo @@ -40538,7 +41047,7 @@ +that it does not override globbing options; for example, `\fBenable \-p +"~"\fP\&' does not cause the pattern character \fB~\fP to be active unless +the \fBEXTENDED_GLOB\fP option is also set\&. To enable all possible -+patterns (so that they may be invidually disabled with \fBdisable \-p\fP), ++patterns (so that they may be individually disabled with \fBdisable \-p\fP), +use `\fBsetopt EXTENDED_GLOB KSH_GLOB NO_SH_GLOB\fP\&'\&. +.RE +.TP @@ -40585,7 +41094,7 @@ +\fBfc\fP \fB\-l\fP [ \fB\-nrdfEiD\fP ] [ \fB\-t\fP \fItimefmt\fP ] [ \fB\-m\fP \fImatch\fP ] +.TP +.PD 0 -+ [ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] ++\fB \fP[ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] +.TP +.PD 0 +\fBfc\fP \fB\-p\fP [ \fB\-a\fP ] [ \fIfilename\fP [ \fIhistsize\fP [ \fIsavehistsize\fP ] ] ] @@ -40622,6 +41131,9 @@ +event), or to \-16 if the \fB\-l\fP flag is given\&. +If \fIlast\fP is not specified, it will be set to \fIfirst\fP, +or to \-1 if the \fB\-l\fP flag is given\&. ++However, if the current event has added entries to the history with ++`\fBprint \-s\fP\&' or `\fBfc \-R\fP', then the default \fIlast\fP for \fB\-l\fP ++includes all new history entries since the current event began\&. +.PP +The flag \fB\-r\fP reverses the order of the commands and the +flag \fB\-n\fP suppresses command numbers when listing\&. @@ -40721,7 +41233,7 @@ +\fBfunctions \-M\fP [ \fB\-m\fP \fIpattern\fP \&.\&.\&. ] +.TP +.PD -+\fBfunctions +M\fP [ \fB\-m\fP ] \fImathfn\fP ++\fBfunctions +M\fP [ \fB\-m\fP ] \fImathfn\fP \&.\&.\&. +Equivalent to \fBtypeset \-f\fP, with the exception of the \fB\-M\fP option\&. +Use of the \fB\-M\fP option may not be combined with any of the options +handled by \fBtypeset \-f\fP\&. @@ -41292,8 +41804,7 @@ +character and are not removed\&. +.TP +\fB\-s\fP -+Don\&'t echo back characters if reading from the terminal\&. Currently does -+not work with the \fB\-q\fP option\&. ++Don\&'t echo back characters if reading from the terminal\&. +.TP +\fB\-q\fP +Read only one character from the terminal and set \fIname\fP to @@ -41513,12 +42024,17 @@ +POSIX standard, but \fBsetopt\fP is not\&. +.RE +.TP -+\fBshift\fP [ \fIn\fP ] [ \fIname\fP \&.\&.\&. ] ++\fBshift\fP [ \fB\-p\fP ] [ \fIn\fP ] [ \fIname\fP \&.\&.\&. ] +The positional parameters \fB${\fP\fIn\fP+1\fB}\fP \&.\&.\&. are renamed +to \fB$1\fP \&.\&.\&., where \fIn\fP is an arithmetic expression that +defaults to 1\&. +If any \fIname\fPs are given then the arrays with these names are +shifted instead of the positional parameters\&. ++.RS ++.PP ++If the option \fB\-p\fP is given arguments are instead removed (popped) ++from the end rather than the start of the array\&. ++.RE +.TP +\fBsource\fP \fIfile\fP [ \fIarg\fP \&.\&.\&. ] +Same as `\fB\&.\fP\&', except that the current directory is always searched and @@ -41647,14 +42163,28 @@ +Do nothing and return an exit status of 0\&. +.TP +\fBttyctl\fP \fB\-fu\fP -+The \fB\-f\fP option freezes the tty, and \fB\-u\fP unfreezes it\&. ++The \fB\-f\fP option freezes the tty (i\&.e\&. terminal or terminal emulator), and ++\fB\-u\fP unfreezes it\&. +When the tty is frozen, no changes made to the tty settings by +external programs will be honored by the shell, except for changes in the +size of the screen; the shell will +simply reset the settings to their previous values as soon as each +command exits or is suspended\&. Thus, \fBstty\fP and similar programs have -+no effect when the tty is frozen\&. Without options it reports whether the -+terminal is frozen or not\&. ++no effect when the tty is frozen\&. Freezing the tty does not cause ++the current state to be remembered: instead, it causes future changes ++to the state to be blocked\&. ++.RS ++.PP ++Without options it reports whether the terminal is frozen or not\&. ++.PP ++Note that, regardless of whether the tty is frozen or not, the ++shell needs to change the settings when the line editor starts, so ++unfreezing the tty does not guarantee settings made on the ++command line are preserved\&. Strings of commands run between ++editing the command line will see a consistent tty state\&. ++See also the shell variable \fBSTTY\fP for a means of initialising ++the tty before running external commands\&. ++.RE +.TP +\fBtype\fP [ \fB\-wfpams\fP ] \fIname\fP \&.\&.\&. +Equivalent to \fBwhence \-v\fP\&. @@ -41963,6 +42493,11 @@ +\fB\-q\fP +Bytes in POSIX message queues\&. +.TP ++\fB\-r\fP ++Maximum real time priority\&. On some systems where this ++is not available, such as NetBSD, this has the same effect as \fB\-T\fP ++for compatibility with \fBsh\fP\&. ++.TP +\fB\-s\fP +Kilobytes on the size of the stack\&. +.TP @@ -42188,6 +42723,28 @@ +the definitions of all functions currently defined or marked as +autoloaded will be written\&. +.PP ++Note the second form cannot be used for compiling functions that ++include redirections as part of the definition rather than within ++the body of the function; for example ++.PP ++.RS ++.nf ++\fBfn1() { { \&.\&.\&. } >~/logfile }\fP ++.fi ++.RE ++.PP ++can be compiled but ++.PP ++.RS ++.nf ++\fBfn1() { \&.\&.\&. } >~/logfile\fP ++.fi ++.RE ++.PP ++cannot\&. It is possible to use the first form of \fBzcompile\fP to compile ++autoloadable functions that include the full function definition instead ++of just the body of the function\&. ++.PP +The third form, with the \fB\-t\fP option, examines an existing +compiled file\&. Without further arguments, the names of the original +files compiled into it are listed\&. The first line of output shows @@ -42607,9 +43164,9 @@ +\fBztcp\fP +See the section `The zsh/net/tcp Module\&' in \fIzshmodules\fP(1)\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshcalsys.1 -@@ -0,0 +1,970 @@ -+.TH "ZSHCALSYS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshcalsys.1 +@@ -0,0 +1,972 @@ ++.TH "ZSHCALSYS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshcalsys \- zsh calendar system +.\" Yodl file: Zsh/calsys.yo @@ -43213,52 +43770,55 @@ +parameter \fBreply\fP to an empty associative array\&. Otherwise, +it returns status 0 and sets elements of the associative +array \fBreply\fP as follows: ++.RS ++.PP +.PD 0 +.TP -+time ++\fBtime\fP +The time as a string of digits in the same units as +\fB$EPOCHSECONDS\fP +.TP -+schedtime ++\fBschedtime\fP +The regularly scheduled time\&. This may differ from +the actual event time \fBtime\fP if this is a recurring event and the next +occurrence has been rescheduled\&. Then \fBtime\fP gives the actual time +and \fBschedtime\fP the time of the regular recurrence before modification\&. +.TP -+text1 ++\fBtext1\fP +The text from the line not including the date and time of the +event, but including any \fBWARN\fP or \fBRPT\fP keywords and values\&. +.TP -+warntime ++\fBwarntime\fP +Any warning time given by the \fBWARN\fP keyword as a string +of digits containing the time at which to warn in the same units as +\fB$EPOCHSECONDS\fP\&. (Note this is an absolute time, not the relative time +passed down\&.) Not set no \fBWARN\fP keyword and value were +matched\&. +.TP -+warnstr ++\fBwarnstr\fP +The raw string matched after the \fBWARN\fP keyword, else unset\&. +.TP -+rpttime ++\fBrpttime\fP +Any recurrence time given by the \fBRPT\fP keyword as a string +of digits containing the time of the recurrence in the same units +as \fB$EPOCHSECONDS\fP\&. (Note this is an absolute time\&.) Not set if +no \fBRPT\fP keyword and value were matched\&. +.TP -+schedrpttime ++\fBschedrpttime\fP +The next regularly scheduled occurrence of a recurring +event before modification\&. This may differ from \fBrpttime\fP, which is the +actual time of the event that may have been rescheduled from the regular +time\&. +.TP -+rptstr ++\fBrptstr\fP +The raw string matched after the \fBRPT\fP keyword, else unset\&. +.TP -+text2 ++\fBtext2\fP +The text from the line after removal of the date and any +keywords and values\&. ++.RE +.PD -+) ++.PP +.TP +\fBcalendar_showdate\fP [ \fB\-r\fP ] [ \fB\-f\fP \fIfmt\fP ] \fIdate\-spec \&.\&.\&.\fP +The given \fIdate\-spec\fP is interpreted and the corresponding date and @@ -43555,7 +44115,6 @@ +the same (indicating a scheduled event), the function uses the +command \fBxmessage\fP to display a window with the event details\&. +.RE -+.RE +.PP +.SH "BUGS" +.PP @@ -43580,9 +44139,9 @@ +If called from a scheduled task, it should instead reschedule the event +that caused it\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshcompctl.1 -@@ -0,0 +1,739 @@ -+.TH "ZSHCOMPCTL" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshcompctl.1 +@@ -0,0 +1,738 @@ ++.TH "ZSHCOMPCTL" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshcompctl \- zsh programmable completion +.\" Yodl file: Zsh/compctl.yo @@ -43926,7 +44485,6 @@ +which forces completion to look back in the history list for a word if +no filename matches\&. +.RE -+.RE +.PP +.SS "Control Flags" +These do not directly specify types of name to be completed, but @@ -44322,9 +44880,9 @@ +.fi +.RE --- /dev/null -+++ zsh-5.0.5/Doc/zshcompsys.1 -@@ -0,0 +1,5213 @@ -+.TH "ZSHCOMPSYS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshcompsys.1 +@@ -0,0 +1,5238 @@ ++.TH "ZSHCOMPSYS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshcompsys \- zsh completion system +.\" Yodl file: Zsh/compsys.yo @@ -44834,7 +45392,6 @@ +Wherever applicable, the \fB\-a\fP option makes the \fIfunction\fP +autoloadable, equivalent to \fBautoload \-U \fP\fIfunction\fP\&. +.RE -+.RE +.PP +The function \fBcompdef\fP can be used to associate existing completion +functions with new commands\&. For example, @@ -46300,9 +46857,9 @@ +.TP +\fBmatcher\fP +This style is tested separately for each tag valid in the current -+context\&. Its value is added to any match specifications given by the ++context\&. Its value is tried before any match specifications given by the +\fBmatcher\-list\fP style\&. It should be in the form described in -+the section `Completion Matching Control\&' in \fIzshcompwid\fP(1)\&. ++the section `Completion Matching Control\&' in \fIzshcompwid\fP(1)\&. For examples of this, see the description of the \fBtag\-order\fP style\&. +.TP +\fBmatcher\-list\fP +This style can be set to a list of match specifications that are to @@ -46326,14 +46883,16 @@ +.PP +.RS +.nf -+\fBzstyle \&':completion:*' matcher\-list '' '+m{a\-z}={A\-Z}' '+m{A\-Z}={a\-z}'\fP ++\fBzstyle \&':completion:*' matcher\-list '' '+m:{a\-z}={A\-Z}' '+m:{A\-Z}={a\-z}'\fP +.fi +.RE +.PP +It is possible to create match specifications valid for particular -+completers by using the third field of the context\&. For example, to -+use the completers \fB_complete\fP and \fB_prefix\fP but only allow -+case\-insensitive completion with \fB_complete\fP: ++completers by using the third field of the context\&. This applies only ++to completers that override the global matcher\-list, which as of this ++writing includes only \fB_prefix\fP and \fB_ignored\fP\&. For example, to ++use the completers \fB_complete\fP and \fB_prefix\fP but allow ++case\-insensitive completion only with \fB_complete\fP: +.PP +.RS +.nf @@ -46672,7 +47231,7 @@ +should be completed\&. +.RS +.PP -+If it is a singe number, only the last \fIN\fP words from the history ++If it is a single number, only the last \fIN\fP words from the history +will be completed\&. +.PP +If it is a range of the form `\fImax\fP\fB:\fP\fIslice\fP\&', @@ -46769,6 +47328,14 @@ +dictionary databases to be added separately\&. +The default for this style is `false\&'\&. +.TP ++\fBshow\-ambiguity\fP ++If the \fBzsh/complist\fP module is loaded, this style can be used to ++highlight the first ambiguous character in completion lists\&. The ++value is either a color indication such as those supported by the ++\fBlist\-colors\fP style or, with a value of \fBtrue\fP, a default of ++underlining is selected\&. The highlighting is only applied if the ++completion display strings correspond to the actual matches\&. ++.TP +\fBshow\-completer\fP +Tested whenever a new completer is tried\&. If it is true, the completion +system outputs a progress message in the listing area showing what @@ -47413,6 +47980,14 @@ +the section `Bindable Commands\&' below\&. +.RE +.TP ++\fB_extensions\fP ++If the cursor follows the string `\fB*\&.\fP\&', filename extensions are ++completed\&. The extensions are taken from files in current directory or a ++directory specified at the beginning of the current word\&. For exact matches, ++completion continues to allow other completers such as \fB_expand\fP to ++expand the pattern\&. The standard \fBadd\-space\fP and \fBprefix\-hidden\fP ++styles are observed\&. ++.TP +\fB_history\fP +Complete words from the shell\&'s command history\&. This completer +can be controlled by the \fBremove\-all\-dups\fP, and \fBsort\fP styles as for the @@ -47566,7 +48141,6 @@ +.PP +.PD +.RE -+.RE +.PP +.SH "BINDABLE COMMANDS" +.PP @@ -48052,7 +48626,6 @@ +`\fB%d\fP\&' in it replaced by the \fImessage\fP of the first \fIoptarg\fP +that follows the \fIoptspec\fP; see below\&. +.RE -+.RE +.PP +It is possible for options with a literal `+\&' or `\fB=\fP' to +appear, but that character must be quoted, for example `\fB\-\e+\fP\&'\&. @@ -48123,8 +48696,6 @@ +are modified to refer only to the words covered by this description\&. +.RE +.RE -+.RE -+.RE +.PP +Any literal colon in an \fIoptname\fP, \fImessage\fP, or \fIaction\fP +must be preceded by a backslash, `\fB\e:\fP\&'\&. @@ -48291,7 +48862,6 @@ +typically in an expansion of the form `\fB$expl[@]\fP\&' which preserves empty +elements of the array\&. +.RE -+.RE +.PP +During the performance of the action the array `\fBline\fP\&' will be set to +the normal arguments from the command line, i\&.e\&. the words from the @@ -49296,6 +49866,20 @@ +builtin used to add the matches\&. +.RE +.TP ++\fB_sequence\fP [ \fB\-s\fP \fIsep\fP ] [ \fB\-n\fP \fImax\fP ] [ \fB\-d\fP ] \fIfunction\fP [ \fB\-\fP ] \&.\&.\&. ++This function is a wrapper to other functions for completing items in a ++separated list\&. The same function is used to complete each item in the ++list\&. The separator is specified with the \fB\-s\fP option\&. If \fB\-s\fP is ++omitted it will use `\fB,\fP\&'\&. Duplicate values are not matched unless ++\fB\-d\fP is specified\&. If there is a fixed or maximum number of items in ++the list, this can be specified with the \fB\-n\fP option\&. ++.RS ++.PP ++Common \fBcompadd\fP options are passed on to the function\&. It is possible ++to use \fBcompadd\fP directly with \fB_sequence\fP, though \fB_values\fP may ++be more appropriate in this situation\&. ++.RE ++.TP +\fB_setup\fP \fItag\fP [ \fIgroup\fP ] +This function sets up the special +parameters used by the completion system appropriately for the \fItag\fP @@ -49498,7 +50082,6 @@ +different name for the argument context field\&. The \fB\-x\fP option has +the same meaning as for \fB_description\fP\&. +.RE -+.RE +.PP +.SH "COMPLETION DIRECTORIES" +.PP @@ -49538,9 +50121,9 @@ +\fBLinux\fP and \fBDebian\fP directories, as well as the \fBX\fP directory, +may be useful on your system\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshcompwid.1 -@@ -0,0 +1,1212 @@ -+.TH "ZSHCOMPWID" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshcompwid.1 +@@ -0,0 +1,1211 @@ ++.TH "ZSHCOMPWID" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshcompwid \- zsh completion widgets +.\" Yodl file: Zsh/compwid.yo @@ -50386,7 +50969,6 @@ +.PP +Note that this builtin is defined by the \fBzsh/compctl\fP module\&. +.RE -+.RE +.PP +.SH "COMPLETION CONDITION CODES" +.PP @@ -50753,9 +51335,9 @@ +This function will complete files in the current directory matching the +current word\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshcontrib.1 -@@ -0,0 +1,4496 @@ -+.TH "ZSHCONTRIB" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshcontrib.1 +@@ -0,0 +1,4566 @@ ++.TH "ZSHCONTRIB" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshcontrib \- user contributions to zsh +.\" Yodl file: Zsh/contrib.yo @@ -50787,9 +51369,8 @@ +\fBFunctions/Misc\fP, searches for these helpfiles and performs several +other tests to produce the most complete help possible for the command\&. +.PP -+There may already be a directory of help files on your system; look in -+\fB/usr/share/zsh\fP or \fB/usr/local/share/zsh\fP and subdirectories below -+those, or ask your system administrator\&. ++Help files are installed by default to a subdirectory of \fB/usr/share/zsh\fP ++or \fB/usr/local/share/zsh\fP\&. +.PP +To create your own help files with \fBhelpfiles\fP, choose or create a +directory where the individual command help files will reside\&. For @@ -50799,27 +51380,31 @@ +.RS +.nf +\fBmkdir ~/zsh_help -+cd ~/zsh_help -+man zshall | colcrt \- | \e -+perl ~/zsh\-5\&.0\&.5/Util/helpfiles\fP ++perl ~/zsh\-5\&.0\&.7/Util/helpfiles ~/zsh_help\fP +.fi +.RE +.PP -+Next, to use the \fBrun\-help\fP function, you need to add lines something ++The \fBHELPDIR\fP parameter tells \fBrun\-help\fP where to look for the help ++files\&. When unset, it uses the default installation path\&. ++To use your own set of help files, set this to the appropriate path ++in one of your startup files: ++.PP ++.RS ++.nf ++\fBHELPDIR=~/zsh_help\fP ++.fi ++.RE ++.PP ++To use the \fBrun\-help\fP function, you need to add lines something +like the following to your \fB\&.zshrc\fP or equivalent startup file: +.PP +.RS +.nf +\fBunalias run\-help -+autoload run\-help -+HELPDIR=~/zsh_help\fP ++autoload run\-help\fP +.fi +.RE +.PP -+The \fBHELPDIR\fP parameter tells \fBrun\-help\fP where to look for the help -+files\&. If your system already has a help file directory installed, set -+\fBHELPDIR\fP to the path of that directory instead\&. -+.PP +Note that in order for `\fBautoload run\-help\fP\&' to work, the \fBrun\-help\fP +file must be in one of the directories named in your \fBfpath\fP array (see +\fIzshparam\fP(1))\&. This should already be the case if you have a standard zsh @@ -50890,7 +51475,6 @@ +Without the \fB\-p\fP option, \fBzrecompile\fP does not create function digests +that do not already exist, nor does it add new functions to the digest\&. +.RE -+.RE +.PP +The following shell loop is an example of a method for creating function +digests for all functions in your \fBfpath\fP, assuming that you have write @@ -50936,7 +51520,7 @@ +.PP +.RS +.nf -+\fBzsh \-f ~/zsh\-5\&.0\&.5/Functions/Misc/zkbd\fP ++\fBzsh \-f ~/zsh\-5\&.0\&.7/Functions/Misc/zkbd\fP +.fi +.RE +.PP @@ -50992,7 +51576,7 @@ +.PP +.RS +.nf -+\fB\&. ~/zsh\-5\&.0\&.5/Util/reporter > zsh\&.report\fP ++\fB\&. ~/zsh\-5\&.0\&.7/Util/reporter > zsh\&.report\fP +.fi +.RE +.PP @@ -51066,7 +51650,6 @@ +With the exception of `\fBall\fP\&', every \fIstate\fP can be abbreviated by +any prefix, even a single letter; thus \fBa\fP is the same as \fBaliases\fP, +\fBz\fP is the same as \fBzstyles\fP, etc\&. -+.RE +.PP +.SS "Manipulating Hook Functions" +.PP @@ -51104,7 +51687,6 @@ +\fBautoload\fP for \fIfunction\fP\&. For functions contributed with zsh, the +options \fB\-Uz\fP are appropriate\&. +.RE -+.RE +.PP +.SH "REMEMBERING RECENT DIRECTORIES" +.PP @@ -51672,19 +52254,35 @@ +If enabled, this style causes the \fB%c\fP and \fB%u\fP format escapes to show +when the working directory has uncommitted changes\&. The strings displayed by +these escapes can be controlled via the \fBstagedstr\fP and \fBunstagedstr\fP -+styles\&. The only backends that currently support this option are \fBgit\fP and -+\fBhg\fP (\fBhg\fP only supports unstaged)\&. ++styles\&. The only backends that currently support this option are \fBgit\fP, ++\fBhg\fP, and \fBbzr\fP (the latter two only support unstaged)\&. +.RS +.PP +For this style to be evaluated with the \fBhg\fP backend, the \fBget\-revision\fP +style needs to be set and the \fBuse\-simple\fP style needs to be unset\&. The +latter is the default; the former is not\&. +.PP ++With the \fBbzr\fP backend, \fIlightweight checkouts\fP only honor this style if ++the \fBuse\-server\fP style is set\&. ++.PP +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\&. +.RE +.TP ++\fBcheck\-for\-staged\-changes\fP ++This style is like \fBcheck\-for\-changes\fP, but it never checks the worktree ++files, only the metadata in the \fB\&.${vcs}\fP dir\&. Therefore, ++this style initializes only the \fB%c\fP escape (with \fBstagedstr\fP) but ++not the \fB%u\fP escape\&. This style is faster than \fBcheck\-for\-changes\fP\&. ++.RS ++.PP ++In the \fBgit\fP backend, this style checks for changes in the index\&. ++Other backends do not currently implement this style\&. ++.PP ++This style is disabled by default\&. ++.RE ++.TP +\fBstagedstr\fP +This string will be used in the \fB%c\fP escape if there are staged changes in +the repository\&. @@ -51708,7 +52306,7 @@ +.PP +For example, this style can be used to use binaries from non\-default +installation directories\&. Assume, \fBgit\fP is installed in /usr/bin but -+your sysadmin installed a newer version in /usr/bin/local\&. Instead of ++your sysadmin installed a newer version in /usr/local/bin\&. Instead of +changing the order of your \fB$PATH\fP parameter, you can do this: +.RS +.nf @@ -51730,6 +52328,11 @@ +\fBP4CONFIG\fP to a file name and have corresponding files in the root +directories of each Perforce client\&. See comments in the function +\fBVCS_INFO_detect_p4\fP for more detail\&. ++.RS ++.PP ++The Bazaar backend (\fBbzr\fP) uses this to permit contacting the server ++about lightweight checkouts, see the \fBcheck\-for\-changes\fP style\&. ++.RE +.TP +\fBuse\-simple\fP +If there are two different ways of gathering @@ -51803,6 +52406,9 @@ +\fBcheck\-for\-changes\fP +false +.TP ++\fBcheck\-for\-staged\-changes\fP ++false ++.TP +\fBstagedstr\fP +(string: "S") +.TP @@ -52067,8 +52673,8 @@ +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 `\fB\-a\fP\&' is used as the first -+argument, \fBall\fP occurances of the functions are unregistered\&. Otherwise -+only the last occurance is removed (if a function was registered to a hook ++argument, \fBall\fP occurrences of the functions are unregistered\&. Otherwise ++only the last occurrence is removed (if a function was registered to a hook +more than once) \&. The `\fB+vi\-\fP\&' prefix needs to be left out here\&. See +\fBHooks in vcs_info\fP below for details\&. +.TP @@ -52212,15 +52818,15 @@ +.PP +When setting \fBret\fP to non\-zero, the string in +\fB${hook_com[hg\-bookmark\-string]}\fP will be used in the \fB%m\fP escape in -+\fBformats\fP and \fBactionformats\fP and will be availabe in the global ++\fBformats\fP and \fBactionformats\fP and will be available in the global +\fBbackend_misc\fP array as \fB${backend_misc[bookmarks]}\fP\&. +.RE +.TP +\fBgen\-applied\-string\fP -+Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backends -+and in \fBquilt\fP support when the \fBapplied\-string\fP is generated; the -+\fBuse\-quilt\fP zstyle must be true for \fBquilt\fP (the \fBmq\fP and \fBstgit\fP -+backends are active by default)\&. ++Called in the \fBgit\fP (with \fBstgit\fP or during rebase), and \fBhg\fP ++(with \fBmq\fP) backends and in \fBquilt\fP support when the \fBapplied\-string\fP ++is generated; the \fBuse\-quilt\fP zstyle must be true for \fBquilt\fP (the \fBmq\fP ++and \fBstgit\fP backends are active by default)\&. +.RS +.PP +This hook gets the names of all applied patches which \fBvcs_info\fP collected @@ -52235,9 +52841,9 @@ +.RE +.TP +\fBgen\-unapplied\-string\fP -+Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backend -+and in \fBquilt\fP support when the \fBunapplied\-string\fP is generated; the -+\fBget\-unapplied\fP style must be true\&. ++Called in the \fBgit\fP (with \fBstgit\fP or during rebase), and \fBhg\fP (with ++\fBmq\fP) backend and in \fBquilt\fP support when the \fBunapplied\-string\fP is ++generated; the \fBget\-unapplied\fP style must be true\&. +.RS +.PP +This hook gets the names of all unapplied patches which \fBvcs_info\fP @@ -52268,6 +52874,13 @@ +The `hook_com\&' parameter is not used\&. +.RE +.TP ++\fBpost\-backend\fP ++Called as soon as the backend has finished collecting information\&. ++.RS ++.PP ++The `\fBhook_com\fP\&' keys available are as for the \fBset\-message\fP hook\&. ++.RE ++.TP +\fBpost\-quilt\fP +Called after the \fBquilt\fP support is done\&. The following information +is passed as arguments to the hook: 1\&. the quilt\-support mode (`addon\&' or @@ -52333,7 +52946,6 @@ +\fB${hook_com[message]}\fP will be used unchanged as the message by +\fBvcs_info\fP\&. +.RE -+.RE +.PP +If all of this sounds rather confusing, take a look at the \fBExamples\fP +section below and also in the Misc/vcs_info\-examples file in the Zsh source\&. @@ -52492,22 +53104,15 @@ + # This makes the bookmarks string use only those + # bookmarks\&. If there\&'s more than one, it + # concatenates them using commas\&. -+ local s i + # The bookmarks returned by `hg\&' are available in -+ # the functions positional parameters\&. -+ (( $# == 0 )) && return 0 -+ for i in "$@"; do -+ if [[ $i == sh/* ]]; then -+ [[ \-n $s ]] && s=$s, -+ s=${s}$i -+ fi -+ done ++ # the function\&'s positional parameters\&. ++ local s="${(Mj:,:)@:#sh/*}" + # Now, the communication with the code that calls + # the hook functions is done via the hook_com[] -+ # hash\&. The key, at which the `gen\-hg\-bookmark\-string\&' -+ # hook looks at is `hg\-bookmark\-string\&'\&. So: ++ # hash\&. The key at which the `gen\-hg\-bookmark\-string\&' ++ # hook looks is `hg\-bookmark\-string\&'\&. So: + hook_com[hg\-bookmark\-string]=$s -+ # And to signal, that we want to use the sting we ++ # And to signal that we want to use the string we + # just generated, set the special variable `ret\&' to + # something other than the default zero: + ret=1 @@ -52949,6 +53554,11 @@ +.RE +.RE +.TP ++\fBexpand\-absolute\-path\fP ++Expand the file name under the cursor to an absolute path, resolving ++symbolic links\&. Where possible, the initial path segment is turned ++into a named directory or reference to a user\&'s home directory\&. ++.TP +\fBhistory\-search\-end\fP +This function implements the widgets +\fBhistory\-beginning\-search\-backward\-end\fP and @@ -53619,6 +54229,35 @@ +similar functions while reading a value\&. +.RE +.TP ++\fBreplace\-argument\fP, \fBreplace\-argument\-edit\fP ++The function \fBreplace\-argument\fP can be used to replace a command ++line argument in the current command line or, if the current command ++line is empty, in the last command line executed (the new command line ++is not executed)\&. Arguments are as delimited by standard shell syntax, ++.RS ++.PP ++If a numeric argument is given, that specifies the argument to be ++replaced\&. 0 means the command name, as in history expansion\&. ++A negative numeric argument counts backward from the last word\&. ++.PP ++If no numeric argument is given, the current argument is replaced; ++this is the last argument if the previous history line is being used\&. ++.PP ++The function prompts for a replacement argument\&. ++.PP ++If the widget contains the string \fBedit\fP, for example is defined as ++.PP ++.RS ++.nf ++\fBzle \-N replace\-argument\-edit replace\-argument\fP ++.fi ++.RE ++.PP ++then the function presents the current value of the argument for ++editing, otherwise the editing buffer for the replacement is ++initially empty\&. ++.RE ++.TP +.PD 0 +\fBreplace\-string\fP, \fBreplace\-pattern\fP +.TP @@ -53778,6 +54417,24 @@ +may be set to an array to give the command and options that will be used to +investigate the command word found\&. The default is \fBwhence \-c\fP\&. +.RE ++.TP ++\fBzcalc\-auto\-insert\fP ++This function is useful together with the \fBzcalc\fP function described in ++the section Mathematical Functions\&. ++It should be bound to a key representing a binary operator such ++as `\fB+\fP\&', `\fB\-\fP', `\fB*\fP' or `\fB/\fP'\&. When running in zcalc, ++if the key occurs at the start of the line or immediately following ++an open parenthesis, the text \fB"ans "\fP is inserted before the ++representation of the key itself\&. This allows easy use of the ++answer from the previous calculation in the current line\&. The ++text to be inserted before the symbol typed can be modified by setting ++the variable \fBZCALC_AUTO_INSERT_PREFIX\fP\&. ++.RS ++.PP ++Hence, for example, typing `\fB+12\fP\&' followed by return adds 12 ++to the previous result\&. ++.PP ++When not in zcalc, the key simply inserts the symbol itself\&. +.RE +.PP +.SS "Utility Functions" @@ -53866,7 +54523,6 @@ +In practice the function \fBexpand\-dir\fP would probably not be defined +within the widget where \fBmodify\-current\-argument\fP is called\&. +.RE -+.RE +.PP +.SS "Styles" +.PP @@ -54063,7 +54719,6 @@ +Check the documentation for the calling widget or function to determine +whether the \fBwidget\fP style is used\&. +.RE -+.RE +.PP +.SH "EXCEPTION HANDLING" +.PP @@ -54281,7 +54936,7 @@ +file name is matched against the pattern, regardless of how the file +was passed to the handler\&. The file is resolved to a full path using +the \fB:A\fP modifier described in -+the subsection Modifers in \fIzshexpn\fP(1).RE; ++the subsection Modifiers in \fIzshexpn\fP(1); +this means that symbolic links are resolved where possible, so that +links into other file systems behave in the correct fashion\&. +.RE @@ -54447,7 +55102,7 @@ +flags, and quoted so that the output can be run as a complete zsh +command line\&. This is used by the completion system to decide how to +complete after a file handled by \fBzsh\-mime\-setup\fP\&. -+) ++.RE +.TP +\fBpick\-web\-browser\fP +This function is separate from the two MIME functions described above @@ -54541,7 +55196,6 @@ +Konqueror, \fBfirefox \-new\-tab %u\fP for Firefox, \fBopera \-newpage %u\fP +for Opera, and \fB%b \-remote "openUrl(%u)"\fP for all others\&. +.RE -+.RE +.PP +.SH "MATHEMATICAL FUNCTIONS" +.PP @@ -54701,7 +55355,6 @@ +suitable for restoring the definition\&. +The functions have not necessarily been defined by \fBzmathfuncdef\fP\&. +.RE -+.RE +.PP +.SH "USER CONFIGURATION FUNCTIONS" +.PP @@ -54751,7 +55404,6 @@ +options or parameters, and so on\&. The function itself does not attempt to +detect any such conflicts\&. +.RE -+.RE +.PP +.SH "OTHER FUNCTIONS" +.PP @@ -54771,13 +55423,14 @@ +\fBcolors\fP more than once\&. +.RS +.PP -+The eight base colors are: black, red, green, yellow, blue, magenta, cyan, -+and white\&. Each of these has codes for foreground and background\&. In -+addition there are eight intensity attributes: bold, faint, standout, -+underline, blink, reverse, and conceal\&. Finally, there are six codes used -+to negate attributes: none (reset all attributes to the defaults), normal -+(neither bold nor faint), no\-standout, no\-underline, no\-blink, and -+no\-reverse\&. ++The eight base colors are: \fBblack\fP, \fBred\fP, \fBgreen\fP, \fByellow\fP, ++\fBblue\fP, \fBmagenta\fP, \fBcyan\fP, and \fBwhite\fP\&. Each of these has codes for ++foreground and background\&. In addition there are seven intensity attributes: ++\fBbold\fP, \fBfaint\fP, \fBstandout\fP, \fBunderline\fP, \fBblink\fP, \fBreverse\fP, ++and \fBconceal\fP\&. Finally, there are seven codes used to negate attributes: ++\fBnone\fP (reset all attributes to the defaults), \fBnormal\fP ++(neither bold nor faint), \fBno\-standout\fP, \fBno\-underline\fP, \fBno\-blink\fP, ++\fBno\-reverse\fP, and \fBno\-conceal\fP\&. +.PP +Some terminals do not support all combinations of colors and intensities\&. +.PP @@ -54786,10 +55439,10 @@ +.PD 0 +.TP +.PD 0 -+color ++\fBcolor\fP +.TP +.PD -+colour ++\fBcolour\fP +Map all the color names to their integer codes, and integer codes to the +color names\&. The eight base names map to the foreground color codes, as +do names prefixed with `\fBfg\-\fP\&', such as `\fBfg\-red\fP'\&. Names prefixed @@ -54803,25 +55456,25 @@ +.RE +.TP +.PD 0 -+fg ++\fBfg\fP +.TP +.PD 0 -+fg_bold ++\fBfg_bold\fP +.TP +.PD -+fg_no_bold ++\fBfg_no_bold\fP +Map the eight basic color names to ANSI terminal escape sequences that set +the corresponding foreground text properties\&. The \fBfg\fP sequences change +the color without changing the eight intensity attributes\&. +.TP +.PD 0 -+bg ++\fBbg\fP +.TP +.PD 0 -+bg_bold ++\fBbg_bold\fP +.TP +.PD -+bg_no_bold ++\fBbg_no_bold\fP +Map the eight basic color names to ANSI terminal escape sequences that set +the corresponding background properties\&. The \fBbg\fP sequences change the +color without changing the eight intensity attributes\&. @@ -55224,7 +55877,6 @@ +\fIsubcontext\fP may be the empty string to re\-use the first context +unchanged\&. +.RE -+.RE +.PP +.SS "Styles" +.PP @@ -55252,9 +55904,9 @@ +(see +EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshexpn.1 -@@ -0,0 +1,2765 @@ -+.TH "ZSHEXPN" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshexpn.1 +@@ -0,0 +1,2845 @@ ++.TH "ZSHEXPN" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshexpn \- zsh expansion and substitution +.\" Yodl file: Zsh/expn.yo @@ -55558,7 +56210,7 @@ +the same record of the last \fIl\fP and \fIr\fP is maintained across all +forms of expansion\&. +.PP -+Note that if a `\fB&\fP\&' is used within glob qualifers an extra backslash ++Note that if a `\fB&\fP\&' is used within glob qualifiers an extra backslash +is needed as a \fB&\fP is a special character in this case\&. +.PP +If the option \fBHIST_SUBST_PATTERN\fP is set, \fIl\fP is treated as @@ -55732,7 +56384,7 @@ +Another problem arises any time a job with a substitution that requires +a temporary file is disowned by the shell, including the case where +`\fB&!\fP\&' or `\fB&|\fP' appears at the end of a command containing a -+subsitution\&. In that case the temporary file will not be cleaned up as ++substitution\&. In that case the temporary file will not be cleaned up as +the shell no longer has any memory of the job\&. A workaround is to use +a subshell, for example, +.PP @@ -55916,11 +56568,48 @@ +entire expression\&. +.TP +\fB${\fP\fIname\fP\fB:*\fP\fIarrayname\fP\fB}\fP -+Similar to the preceding subsitution, but in the opposite sense, ++Similar to the preceding substitution, but in the opposite sense, +so that entries present in both the original substitution and as +elements of \fIarrayname\fP are retained and others removed\&. +.TP +.PD 0 ++\fB${\fP\fIname\fP\fB:^\fP\fIarrayname\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB:^^\fP\fIarrayname\fP\fB}\fP ++Zips two arrays, such that the output array is twice as long as the ++shortest (longest for `\fB:^^\fP\&') of \fBname\fP and \fBarrayname\fP, with ++the elements alternatingly being picked from them\&. For `\fB:^\fP\&', if one ++of the input arrays is longer, the output will stop when the end of the ++shorter array is reached\&. Thus, ++.RS ++.PP ++.RS ++.nf ++\fBa=(1 2 3 4); b=(a b); print ${a:^b}\fP ++.fi ++.RE ++.PP ++will output `\fB1 a 2 b\fP\&'\&. For `\fB:^^\fP', then the input is repeated ++until all of the longer array has been used up and the above will output ++`\fB1 a 2 b 3 a 4 b\fP\&'\&. ++.PP ++Either or both inputs may be a scalar, they will be treated as an array ++of length 1 with the scalar as the only element\&. If either array is empty, ++the other array is output with no extra elements inserted\&. ++.PP ++Currently the following code will output `\fBa b\fP\&' and `\fB1\fP' as two separate ++elements, which can be unexpected\&. The second print provides a workaround which ++should continue to work if this is changed\&. ++.PP ++.RS ++.nf ++\fBa=(a b); b=(1 2); print \-l "${a:^b}"; print \-l "${${a:^b}}"\fP ++.fi ++.RE ++.RE ++.TP ++.PD 0 +\fB${\fP\fIname\fP\fB:\fP\fIoffset\fP\fB}\fP +.TP +.PD @@ -55969,7 +56658,7 @@ +.RE +.PP +all have the same effect, extracting the string starting at the fourth -+character of \fB$foo\fP if the substution would otherwise return a scalar, ++character of \fB$foo\fP if the substitution would otherwise return a scalar, +or the array starting at the fourth element if \fB$foo\fP would return an +array\&. Note that with the option \fBKSH_ARRAYS\fP \fB$foo\fP always returns +a scalar (regardless of the use of the offset syntax) and a form @@ -56108,7 +56797,6 @@ +\fB${${~foo}//\e*/*\&.c}\fP substitutes to the string \fB*\&.c\fP, which will not +be further expanded\&. +.RE -+.RE +.PP +If a \fB${\fP\&.\&.\&.\fB}\fP type parameter expression or a +\fB$(\fP\&.\&.\&.\fB)\fP type command substitution is used in place of @@ -56198,7 +56886,7 @@ +\fBD\fP +Assume the string or array elements contain directories and attempt +to substitute the leading part of these by names\&. The remainder of -+the path (the whole of it if the leading part was not subsituted) ++the path (the whole of it if the leading part was not substituted) +is then quoted so that the whole string can be used as a shell +argument\&. This is the reverse of `\fB~\fP\&' substitution: see +the section FILENAME EXPANSION below\&. @@ -56407,8 +57095,9 @@ +follow this argument\&. +.TP +\fB~\fP -+Force string arguments to any of the flags below that follow within -+the parentheses to be treated as patterns\&. Compare with a \fB~\fP ++Strings inserted into the expansion by any of the flags below are to ++be treated as patterns\&. This applies to the string arguments of flags ++that follow \fB~\fP within the same set of parentheses\&. Compare with \fB~\fP +outside parentheses, which forces the entire substituted string to +be treated as a pattern\&. Hence, for example, +.RS @@ -56416,8 +57105,8 @@ +\fB[[ "?" = ${(~j\&.|\&.)array} ]]\fP +.fi +.RE -+with the \fBEXTENDED_GLOB\fP option set succeeds if and only if \fB$array\fP -+contains the string `\fB?\fP\&' as an element\&. The argument may be ++treats `\fB|\fP\&' as a pattern and succeeds if and only if \fB$array\fP ++contains the string `\fB?\fP\&' as an element\&. The \fB~\fP may be +repeated to toggle the behaviour; its effect only lasts to the +end of the parenthesised group\&. +.TP @@ -56440,6 +57129,10 @@ +directly to the left of each word, truncated if necessary, before +\fIstring1\fP is used to produce any remaining padding\&. +.PP ++If either of \fIstring1\fP or \fBstring2\fP is present but empty, ++i\&.e\&. there are two delimiters together at that point, the first ++character of \fB$IFS\fP is used instead\&. ++.PP +If the \fBMULTIBYTE\fP option is in effect, the flag \fBm\fP may also +be given, in which case widths will be used for the calculation of +padding; otherwise individual multibyte characters are treated as occupying @@ -56737,16 +57430,21 @@ +If the result is still an array and one of the `\fB(o)\fP\&' or `\fB(O)\fP' flags +was present, the array is reordered\&. +.TP -+\fB20\&.\fP \fIRe\-evaluation\fP ++\fB20\&.\fP \fBRC_EXPAND_PARAM\fP ++At this point the decision is made whether any resulting array elements ++are to be combined element by element with surrounding text, as given ++by either the \fBRC_EXPAND_PARAM\fP option or the `\fB^\fP\&' flag\&. ++.TP ++\fB21\&.\fP \fIRe\-evaluation\fP +Any `\fB(e)\fP\&' flag is applied to the value, forcing it to be re\-examined +for new parameter substitutions, but also for command and arithmetic +substitutions\&. +.TP -+\fB21\&.\fP \fIPadding\fP ++\fB22\&.\fP \fIPadding\fP +Any padding of the value by the `\fB(l\&.\fP\fIfill\fP\fB\&.)\fP\&' or +`\fB(r\&.\fP\fIfill\fP\fB\&.)\fP\&' flags is applied\&. +.TP -+\fB22\&.\fP \fISemantic joining\fP ++\fB23\&.\fP \fISemantic joining\fP +In contexts where expansion semantics requires a single word to +result, all words are rejoined with the first character of \fBIFS\fP +between\&. So in `\fB${(P\fP\fB)${(f\fP\fB)lines}}\fP\&' @@ -56757,7 +57455,7 @@ +If a single word is not required, this rule is skipped\&. +.RE +.TP -+\fB23\&.\fP \fIEmpty argument removal\fP ++\fB24\&.\fP \fIEmpty argument removal\fP +If the substitution does not appear in double quotes, any resulting +zero\-length argument, whether from a scalar or an element of an array, +is elided from the list of arguments inserted into the command line\&. @@ -56767,7 +57465,6 @@ +other forms of substitution; the point to note here is simply that +it occurs after any of the above parameter operations\&. +.RE -+.RE +.PP +.SS "Examples" +The flag \fBf\fP is useful to split a double\-quoted substitution line by @@ -56862,6 +57559,16 @@ +to pad for example `\fB{\-99\&.\&.100\&.\&.01}\fP\&' which is not possible to specify by putting a +0 on either of the first two numbers (i\&.e\&. pad to two characters)\&. +.PP ++An expression of the form `\fB{\fP\fIc1\fP\fB\&.\&.\fP\fIc2\fP\fB}\fP\&', where ++\fIc1\fP and \fIc2\fP are single characters (which may be multibyte ++characters), is expanded to every character in the range from \fIc1\fP to ++\fIc2\fP in whatever character sequence is used internally\&. For ++characters with code points below 128 this is US ASCII (this is the only ++case most users will need)\&. If any intervening character is not ++printable, appropriate quotation is used to render it printable\&. ++If the character sequence is reversed, the output is in reverse ++order, e\&.g\&. `\fB{d\&.\&.a}\fP\&' is substituted as `\fBd c b a\fP'\&. ++.PP +If a brace expression matches none of the above forms, it is left +unchanged, unless the option \fBBRACE_CCL\fP (an abbreviation for `brace +character class\&') is set\&. @@ -57279,7 +57986,7 @@ +.TP +\fB+(\fP\&.\&.\&.\fB)\fP +Match at least one occurrence\&. (Like `\fB(\fP\&.\&.\&.\fB)##\fP\&', -+except that recursive directory searching is not supported\&.\&.) ++except that recursive directory searching is not supported\&.) +.TP +\fB?(\fP\&.\&.\&.\fB)\fP +Match zero or one occurrence\&. (Like `\fB(|\fP\&.\&.\&.\fB)\fP\&'\&.) @@ -57622,7 +58329,13 @@ +recognised in this form even if a bare glob qualifier exists at the end of +the pattern, for example `\fB*(#q*)(\&.)\fP\&' will recognise executable regular +files if both options are set; however, mixed syntax should probably be -+avoided for the sake of clarity\&. ++avoided for the sake of clarity\&. Note that within conditions using the ++`\fB[[\fP\&' form the presence of a parenthesised expression ++\fB(#q\&.\&.\&.)\fP at the end of a string indicates that globbing ++should be performed; the expression may include glob qualifiers, but ++it is also valid if it is simply \fB(#q)\fP\&. This does ++not apply to the right hand side of pattern match operators as the ++syntax already has special significance\&. +.PP +A qualifier may be any one of the following: +.PP @@ -57852,10 +58565,12 @@ +exactly \fIn\fP bytes in length\&. +.RS +.PP -+If this flag is directly followed by a `\fBk\fP\&' (`\fBK\fP'), `\fBm\fP' -+(`\fBM\fP\&'), or `\fBp\fP' (`\fBP\fP') (e\&.g\&. `\fBLk\-50\fP') the check is performed -+with kilobytes, megabytes, or blocks (of 512 bytes) instead\&. In this -+case a file is regarded as "exactly" the size if the file size rounded up ++If this flag is directly followed by a \fIsize specifier\fP `\fBk\fP\&' (`\fBK\fP'), ++`\fBm\fP\&' (`\fBM\fP'), or `\fBp\fP' (`\fBP\fP') (e\&.g\&. `\fBLk\-50\fP') the check is ++performed with kilobytes, megabytes, or blocks (of 512 bytes) instead\&. ++(On some systems additional specifiers are available for gigabytes, ++`\fBg\fP\&' or `\fBG\fP', and terabytes, `\fBt\fP' or `\fBT\fP'\&.) If a size specifier ++is used a file is regarded as "exactly" the size if the file size rounded up +to the next unit is equal to the test size\&. Hence `\fB*(Lm1)\fP\&' +matches files from 1 byte up to 1 Megabyte inclusive\&. Note also that +the set of files "less than" the test size only includes files that would @@ -57886,9 +58601,18 @@ +\fBn\fP +sets the \fBNUMERIC_GLOB_SORT\fP option for the current pattern +.TP ++\fBY\fP\fIn\fP ++enables short\-circuit mode: the pattern will expand to at most \fIn\fP ++filenames\&. If more than \fIn\fP matches exist, only the first \fIn\fP ++matches in directory traversal order will be considered\&. ++.RS ++.PP ++Implies \fBoN\fP when no \fBo\fP\fIc\fP qualifier is used\&. ++.RE ++.TP +\fBo\fP\fIc\fP +specifies how the names of the files should be sorted\&. If \fIc\fP is -+\fBn\fP they are sorted by name (the default); if it is \fBL\fP they ++\fBn\fP they are sorted by name; if it is \fBL\fP they +are sorted depending on the size (length) of the files; if \fBl\fP +they are sorted by the number of links; if \fBa\fP, \fBm\fP, or \fBc\fP +they are sorted by the time of the last access, modification, or @@ -57904,6 +58628,9 @@ +specifiers may occur to resolve ties\&. +.RS +.PP ++The default sorting is \fBn\fP (by name) unless the \fBY\fP glob qualifier is used, ++in which case it is \fBN\fP (unsorted)\&. ++.PP +\fBoe\fP and \fBo+\fP are special cases; they are each followed by shell code, +delimited as for the \fBe\fP glob qualifier and the \fB+\fP glob qualifier +respectively (see above)\&. The code is executed for each matched file with @@ -57942,7 +58669,12 @@ +A typical use for this is to prepend an option before all occurrences +of a file name; for example, the pattern `\fB*(P:\-f:)\fP\&' produces the +command line arguments `\fB\-f\fP \fIfile1\fP \fB\-f\fP \fIfile2\fP \&.\&.\&.\&' -+.RE ++.PP ++If the modifier \fB^\fP is active, then \fIstring\fP will be appended ++instead of prepended\&. Prepending and appending is done independently ++so both can be used on the same glob expression; for example by writing ++`\fB*(P:foo:^P:bar:^P:baz:)\fP\&' which produces the command line arguments ++`\fBfoo\fP \fBbaz\fP \fIfile1\fP \fBbar\fP \&.\&.\&.\&' +.RE +.PP +More than one of these lists can be combined, separated by commas\&. The @@ -58020,16 +58752,19 @@ +the base pattern matches the regular file \fBbuiltin\&.pro\fP, the shell will +print `\fBshmiltin\&.shmo\fP\&'\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshmisc.1 -@@ -0,0 +1,2504 @@ -+.TH "ZSHMISC" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshmisc.1 +@@ -0,0 +1,2638 @@ ++.TH "ZSHMISC" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshmisc \- everything and then some +.\" Yodl file: Zsh/grammar.yo +.SH "SIMPLE COMMANDS & PIPELINES" +A \fIsimple command\fP is a sequence of optional parameter +assignments followed by blank\-separated words, -+with optional redirections interspersed\&. ++with optional redirections interspersed\&. For a description ++of assignment, see the beginning of ++\fIzshparam\fP(1)\&. ++.PP +The first word is the command to be executed, and the remaining +words, if any, are arguments to the command\&. +If a command name is given, the parameter assignments modify @@ -58303,7 +59038,7 @@ +enclosing \fBalways\fP block)\&. +.PP +Regardless of \fBTRY_BLOCK_ERROR\fP, after the end of \fBalways\-list\fP the -+normal shell status \fB$?\fP is the value returned from \fBalways\-list\fP\&. ++normal shell status \fB$?\fP is the value returned from \fBtry\-list\fP\&. +This will be non\-zero if there was an error, even if \fBTRY_BLOCK_ERROR\fP +was set to zero\&. +.PP @@ -58349,6 +59084,19 @@ +whitespace may appear between between the left and right parentheses when +there is a single \fIword\fP; otherwise, the parentheses will be treated as +forming a globbing pattern in that case\&. ++.PP ++In any of the forms above, a redirection may appear outside the ++function body, for example ++.PP ++.RS ++.nf ++\fBfunc() { \&.\&.\&. } 2>&1\fP ++.fi ++.RE ++.PP ++The redirection is stored with the function and applied whenever the ++function is executed\&. Any variables in the redirection are expanded ++at the point the function is executed, but outside the function scope\&. +.RE +.TP +\fBtime\fP [ \fIpipeline\fP ] @@ -58462,60 +59210,84 @@ +behaviour can be recovered by setting the option \fBCONTINUE_ON_ERROR\fP\&. +.PP +Fatal errors found in non\-interactive shells include: ++.PP +.PD 0 +.TP ++.PD ++\(bu +Failure to parse shell options passed when invoking the shell +.TP ++\(bu +Failure to change options with the \fBset\fP builtin +.TP ++\(bu +Parse errors of all sorts, including failures to parse +mathematical expressions +.TP ++\(bu +Failures to set or modify variable behaviour with \fBtypeset\fP, +\fBlocal\fP, \fBdeclare\fP, \fBexport\fP, \fBinteger\fP, \fBfloat\fP +.TP ++\(bu +Execution of incorrectly positioned loop control structures +(\fBcontinue\fP, \fBbreak\fP) +.TP ++\(bu +Attempts to use regular expression with no regular expression +module available +.TP ++\(bu +Disallowed operations when the \fBRESTRICTED\fP options is set +.TP ++\(bu +Failure to create a pipe needed for a pipeline +.TP ++\(bu +Failure to create a multio +.TP ++\(bu +Failure to autoload a module needed for a declared shell feature +.TP ++\(bu +Errors creating command or process substitutions +.TP ++\(bu +Syntax errors in glob qualifiers +.TP ++\(bu +File generation errors where not caught by the option \fBBAD_PATTERN\fP +.TP ++\(bu +All bad patterns used for matching within case statements +.TP ++\(bu +File generation failures where not caused by \fBNO_MATCH\fP or ++similar options +.TP ++\(bu +All file generation errors where the pattern was used to create a +multio +.TP ++\(bu +Memory errors where detected by the shell +.TP ++\(bu +Invalid subscripts to shell variables +.TP ++\(bu +Attempts to assign read\-only variables +.TP ++\(bu +Logical errors with variables such as assignment to the wrong type +.TP ++\(bu +Use of invalid variable names +.TP ++\(bu +Errors in variable substitution syntax +.TP ++\(bu +Failure to convert characters in \fB$\&'\fP\&.\&.\&.\fB'\fP expressions -+similar options -+.PD +.PP +If the \fBPOSIX_BUILTINS\fP option is set, more errors associated with +shell builtin commands are treated as fatal, as specified by the POSIX @@ -59687,6 +60459,35 @@ +implicitly typed by the arithmetic evaluation, where it acquires the output +base 8\&. +.PP ++The \fIbase\fP may be replaced or followed by an underscore, which may ++itself be followed by a positive integer (if it is missing the value 3 ++is used)\&. This indicates that underscores should be inserted into the ++output string, grouping the number for visual clarity\&. The following ++integer specifies the number of digits to group together\&. For example: ++.PP ++.RS ++.nf ++\fBsetopt cbases ++print $(( [#16_4] 65536 ** 2 ))\fP ++.fi ++.RE ++.PP ++outputs `\fB0x1_0000_0000\fP\&'\&. ++.PP ++The feature can be used with floating ++point numbers, in which case the base must be omitted; grouping ++is away from the decimal point\&. For example, ++.PP ++.RS ++.nf ++\fBzmodload zsh/mathfunc ++print $(( [#_] sqrt(1e7) ))\fP ++.fi ++.RE ++.PP ++outputs `\fB3_162\&.277_660_168_379_5\fP\&' (the number of decimal places ++shown may vary)\&. ++.PP +If the \fBC_BASES\fP option is set, hexadecimal numbers in the standard C +format, for example \fB0xFF\fP instead of the usual `\fB16#FF\fP\&'\&. If the +option \fBOCTAL_ZEROES\fP is also set (it is not by default), octal numbers @@ -60085,11 +60886,44 @@ +\fIexp1\fP \fB||\fP \fIexp2\fP +true if either \fIexp1\fP or \fIexp2\fP is true\&. +.PP ++For compatibility, if there is a single argument that is not ++syntactically significant, typically a variable, the condition is ++treated as a test for whether the expression expands as a string of ++non\-zero length\&. In other words, \fB[[ $var ]]\fP is the same as \fB[[ \-n ++$var ]]\fP\&. It is recommended that the second, explicit, form be used ++where possible\&. ++.PP +Normal shell expansion is performed on the \fIfile\fP, \fIstring\fP and +\fIpattern\fP arguments, but the result of each expansion is constrained to +be a single word, similar to the effect of double quotes\&. -+Filename generation is not performed on any form of argument to conditions\&. -+However, pattern metacharacters are active for the \fIpattern\fP arguments; ++.PP ++Filename generation is not performed on any form of argument to ++conditions\&. However, it can be forced in any case where normal shell ++expansion is valid and when the option \fBEXTENDED_GLOB\fP is in effect by ++using an explicit glob qualifier of the form \fB(#q)\fP at the ++end of the string\&. A normal glob qualifier expression may appear ++between the `\fBq\fP\&' and the closing parenthesis; if none appears the ++expression has no effect beyond causing filename generation\&. The ++results of filename generation are joined together to form a single ++word, as with the results of other forms of expansion\&. ++.PP ++This special use of filename generation is only available with the ++\fB[[\fP syntax\&. If the condition occurs within the \fB[\fP or \fBtest\fP ++builtin commands then globbing occurs instead as part of normal command ++line expansion before the condition is evaluated\&. In this case it may ++generate multiple words which are likely to confuse the syntax of the ++test command\&. ++.PP ++For example, ++.PP ++\fB[[ \-n file*(#qN) ]]\fP ++.PP ++produces status zero if and only if there is at least one file in the ++current directory beginning with the string `\fBfile\fP\&'\&. The globbing ++qualifier \fBN\fP ensures that the expression is empty if there is ++no matching file\&. ++.PP ++Pattern metacharacters are active for the \fIpattern\fP arguments; +the patterns are the same as those used for filename generation, see +\fIzshexpn\fP(1), but there is no special behaviour +of `\fB/\fP\&' nor initial dots, and no glob qualifiers are allowed\&. @@ -60219,6 +61053,12 @@ +the full path; +see \fIDynamic\fP and \fIStatic named directories\fP in \fIzshexpn\fP(1)\&. +.TP ++\fB%e\fP ++Evaluation depth of the current sourced file, shell function, or \fBeval\fP\&. ++This is incremented or decremented every time the value of \fB%N\fP is ++set or reverted to a previous value, respectively\&. This is most useful ++for debugging as part of \fB$PS4\fP\&. ++.TP +.PD 0 +\fB%h\fP +.TP @@ -60314,6 +61154,13 @@ +the hour of the day on the 12\-hour clock +.PD +.PP ++In addition, if the system supports the POSIX \fBgettimeofday\fP system ++call, \fB%\&.\fP provides decimal fractions of a second since the epoch with ++leading zeroes\&. By default three decimal places are provided, but a ++number of digits up to 6 may be given following the \fB%\fP; hence \fB%6\&.\fP ++outputs microseconds\&. A typical example of this is the format ++`\fB%D{%H:%M:%S\&.%\&.}\fP\&'\&. ++.PP +The GNU extension that a `\fB\-\fP\&' between the \fB%\fP and the +format character causes a leading zero or space to be stripped +is handled directly by the shell for the format characters \fBd\fP, \fBf\fP, @@ -60322,7 +61169,6 @@ +present, so the handling is system dependent\&. Further GNU +extensions are not supported at present\&. +.RE -+.RE +.PP +.SS "Visual effects" +.PD 0 @@ -60384,7 +61230,6 @@ +output into single characters within each \fB%{\fP\&.\&.\&.\fB%}\fP group so that +the correct truncation point can be found\&. +.RE -+.RE +.PP +.SH "CONDITIONAL SUBSTRINGS IN PROMPTS" +.PD 0 @@ -60408,7 +61253,8 @@ +.RS +.PP +The left parenthesis may be preceded or followed by a positive integer \fIn\fP, -+which defaults to zero\&. A negative integer will be multiplied by \-1\&. ++which defaults to zero\&. A negative integer will be multiplied by \-1, except ++as noted below for `\fBl\fP\&'\&. +The test character \fIx\fP may be any of the following: +.PP +.PD 0 @@ -60446,6 +61292,9 @@ +\fBd\fP +True if the day of the month is equal to \fIn\fP\&. +.TP ++\fBe\fP ++True if the evaluation depth is at least \fIn\fP\&. ++.TP +\fBg\fP +True if the effective gid of the current process is \fIn\fP\&. +.TP @@ -60457,7 +61306,9 @@ +.TP +\fBl\fP +True if at least \fIn\fP characters have already been -+printed on the current line\&. ++printed on the current line\&. When \fIn\fP is negative, true if at least ++\fBabs\fP\fB(\fP\fIn\fP\fB)\fP characters remain before the opposite ++margin (thus the left margin for \fBRPROMPT\fP)\&. +.TP +\fBS\fP +True if the \fBSECONDS\fP parameter is at least \fIn\fP\&. @@ -60491,14 +61342,22 @@ +Specifies truncation behaviour for the remainder of the prompt string\&. +The third, deprecated, form is equivalent to `\fB%\fP\fIxstringx\fP\&', +i\&.e\&. \fIx\fP may be `\fB<\fP\&' or `\fB>\fP'\&. -+The numeric argument, which in the third form may appear immediately -+after the `\fB[\fP\&', specifies the maximum permitted length of -+the various strings that can be displayed in the prompt\&. +The \fIstring\fP will be displayed in +place of the truncated portion of any string; note this does not +undergo prompt expansion\&. +.RS +.PP ++The numeric argument, which in the third form may appear immediately ++after the `\fB[\fP\&', specifies the maximum permitted length of ++the various strings that can be displayed in the prompt\&. ++In the first two forms, this numeric argument may be negative, in which ++case the truncation length is determined by subtracting the absolute ++value of the numeric argument from the number of character positions ++remaining on the current prompt line\&. If this results in a zero or ++negative length, a length of 1 is used\&. In other words, a negative ++argument arranges that after truncation at least \fIn\fP characters ++remain before the right margin (left margin for \fBRPROMPT\fP)\&. ++.PP +The forms with `\fB<\fP\&' truncate at the left of the string, +and the forms with `\fB>\fP\&' truncate at the right of the string\&. +For example, if the current directory is `\fB/home/pike\fP\&', @@ -60518,18 +61377,25 @@ +construct, or to the next truncation encountered at the same grouping +level (i\&.e\&. truncations inside a `\fB%(\fP\&' are separate), which +ever comes first\&. In particular, a truncation with argument zero -+(e\&.g\&. `\fB%<<\fP\&') marks the end of the range of the string to be ++(e\&.g\&., `\fB%<<\fP\&') marks the end of the range of the string to be +truncated while turning off truncation from there on\&. For example, the +prompt \&'%10<\&.\&.\&.<%~%<<%# ' will print a truncated representation of the +current directory, followed by a `\fB%\fP\&' or `\fB#\fP', followed by a +space\&. Without the `\fB%<<\fP\&', those two characters would be included -+in the string to be truncated\&. -+.RE ++in the string to be truncated\&. Note that `\fB%\-0<<\fP\&' is a distinct ++.PP ++Truncation applies only within each individual line of the prompt, as ++delimited by embedded newlines (if any)\&. If the total length of any line ++of the prompt after truncation is greater than the terminal width, or if ++the part to be truncated contains embedded newlines, truncation behavior ++is undefined and may change in a future version of the shell\&. Use ++`\fB%\-\fIn\fP(l\&.\fItrue\-text\fP\&.\fIfalse\-text\fP)\fP\&' to remove parts ++of the prompt when the available space is less than \fIn\fP\&. +.RE --- /dev/null -+++ zsh-5.0.5/Doc/zshmodules.1 -@@ -0,0 +1,3798 @@ -+.TH "ZSHMODULES" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshmodules.1 +@@ -0,0 +1,3796 @@ ++.TH "ZSHMODULES" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshmodules \- zsh loadable modules +.\" Yodl file: Zsh/modules.yo @@ -60750,7 +61616,6 @@ +\fBclone\fP is mostly useful as a shell built\-in replacement for +openvt\&. +.RE -+.RE +.SH "THE ZSH/COMPCTL MODULE" +.\" Yodl file: Zsh/mod_compctl.yo + @@ -61227,12 +62092,12 @@ +.PP +Once \fBcompdescribe\fP has been called with either the \fB\-i\fP or the +\fB\-I\fP option, it can be repeatedly called with the \fB\-g\fP option and -+the names of five arrays as its arguments\&. This will step through the -+different sets of matches and store the options in the first array, -+the strings with descriptions in the second, the matches for these in -+the third, the strings without descriptions in the fourth, and the -+matches for them in the fifth array\&. These are then directly given to -+\fBcompadd\fP to register the matches with the completion code\&. ++the names of four parameters as its arguments\&. This will step through ++the different sets of matches and store the value of \fBcompstate[list]\fP ++in the first scalar, the options for \fBcompadd\fP in the second array, ++the matches in the third array, and the strings to be displayed in the ++completion listing in the fourth array\&. The arrays may then be directly ++given to \fBcompadd\fP to register the matches with the completion code\&. +.RE +.TP +\fBcompfiles\fP @@ -61543,7 +62408,6 @@ +color that apply to the character, as set with the subcommand \fBattr\fP, +appear as additional elements\&. +.RE -+.RE +.PP +.SS "Parameters" +.PP @@ -61614,7 +62478,6 @@ +If \fB\-s\fP \fIscalar\fP is given, assign the date string (or epoch time +in seconds if \fB\-r\fP is given) to \fIscalar\fP instead of printing it\&. +.RE -+.RE +.PP +The \fBzsh/datetime\fP module makes available several parameters; +all are readonly: @@ -61651,7 +62514,6 @@ +.RE +.PP +.RE -+.RE +.SH "THE ZSH/DELTOCHAR MODULE" +.\" Yodl file: Zsh/mod_deltochar.yo + @@ -61901,7 +62763,6 @@ +\fBALT_DIGITS\fP +.PP +.RE -+.RE +.SH "THE ZSH/MAPFILE MODULE" +.\" Yodl file: Zsh/mod_mapfile.yo + @@ -61940,7 +62801,6 @@ +empty field; this can be suppressed by using +`\fIarray\fP\fB=("${(f@)${mapfile[\fP\fIfilename\fP\fB]%$\&'\en'}}")\fP'\&. +.RE -+.RE +.PP +.SS "Limitations" +.PP @@ -62292,6 +63152,16 @@ +and (if \fBEVAL_LINENO\fP is set) \fBeval\fP commands\&. currently being +executed\&. The first element is the name of the function using the +parameter\&. ++.RS ++.PP ++The standard shell array \fBzsh_eval_context\fP can be used to ++determine the type of shell construct being executed at each depth: ++note, however, that is in the opposite order, with the most recent ++item last, and it is more detailed, for example including an ++entry for \fBtoplevel\fP, the main shell code being executed ++either interactively or from a script, which is not present ++in \fB$funcstack\fP\&. ++.RE +.TP +\fBfunctrace\fP +This array contains the names and line numbers of the callers @@ -62373,9 +63243,9 @@ +.fi +.RE +.RE -+.RE +.PP +The \fBzsh/pcre\fP module makes available the following test condition: ++.PP +.PD 0 +.TP +.PD @@ -62385,13 +63255,23 @@ +.PP +For example, +.PP -+[[ "$text" \-pcre\-match ^d+$ ]] && print text variable contains only "d\&'s"\&. ++.RS ++.nf ++\fB[[ "$text" \-pcre\-match ^d+$ ]] && ++print text variable contains only "d\&'s"\&.\fP ++.fi +.RE ++.PP ++If the \fBREMATCH_PCRE\fP option is set, the \fB=~\fP operator is equivalent to ++\fB\-pcre\-match\fP, and the \fBNO_CASE_MATCH\fP option may be used\&. Note that ++\fBNO_CASE_MATCH\fP never applies to the \fBpcre_match\fP builtin, instead use ++the \fB\-i\fP switch of \fBpcre_compile\fP\&. +.RE +.SH "THE ZSH/REGEX MODULE" +.\" Yodl file: Zsh/mod_regex.yo + +The \fBzsh/regex\fP module makes available the following test condition: ++.PP +.PD 0 +.TP +.PD @@ -62420,7 +63300,6 @@ +If \fBBASH_REMATCH\fP is set, then the array \fBBASH_REMATCH\fP will be set +instead of \fBMATCH\fP and \fBmatch\fP\&. +.RE -+.RE +.SH "THE ZSH/SCHED MODULE" +.\" Yodl file: Zsh/mod_sched.yo + @@ -62469,12 +63348,11 @@ +starts in a mode emulating another shell\&. It can be made available +with the command `\fBzmodload \-F zsh/sched b:sched\fP\&'\&. +.RE -+.RE +.PP +.PD 0 +.TP +.PD -+zsh_scheduled_events ++\fBzsh_scheduled_events\fP +A readonly array corresponding to the events scheduled by the +\fBsched\fP builtin\&. The indices of the array correspond to the numbers +shown when \fBsched\fP is run with no arguments (provided that the @@ -62490,7 +63368,6 @@ +that this will have an immediate effect on the contents of the array, +so that indices may become invalid\&. +.RE -+.RE +.SH "THE ZSH/NET/SOCKET MODULE" +.\" Yodl file: Zsh/mod_socket.yo + @@ -62521,7 +63398,6 @@ +.PP +In order to elicit more verbose output, use \fB\-v\fP\&. +.RE -+.RE +.PP +.SS "Inbound Connections" +.PP @@ -62559,7 +63435,6 @@ +.PP +In order to elicit more verbose output, use \fB\-v\fP\&. +.RE -+.RE +.SH "THE ZSH/STAT MODULE" +.\" Yodl file: Zsh/mod_stat.yo + @@ -62732,7 +63607,6 @@ +\fB\-T\fP +Never show the type names of the \fBstruct stat\fP elements\&. +.RE -+.RE +.SH "THE ZSH/SYSTEM MODULE" +.\" Yodl file: Zsh/mod_system.yo + @@ -62939,7 +63813,6 @@ +subshells\&. Compare \fB$PPID\fP, which returns the process ID of the parent +of the main shell process\&. +.RE -+.RE +.SH "THE ZSH/NET/TCP MODULE" +.\" Yodl file: Zsh/mod_tcp.yo + @@ -63006,7 +63879,6 @@ +The remote port +This is zero for a connection opened for listening\&. +.RE -+.RE +.PP +.SS "Outbound Connections" +.PP @@ -63026,7 +63898,6 @@ +.PP +In order to elicit more verbose output, use \fB\-v\fP\&. +.RE -+.RE +.PP +.SS "Inbound Connections" +.PP @@ -63066,7 +63937,6 @@ +.PP +In order to elicit more verbose output, use \fB\-v\fP\&. +.RE -+.RE +.PP +.SS "Closing Connections" +.PP @@ -63090,7 +63960,6 @@ +.PP +In order to elicit more verbose output, use \fB\-v\fP\&. +.RE -+.RE +.PP +.SS "Example" +Here is how to create a TCP connection between two instances of zsh\&. We @@ -63210,7 +64079,6 @@ +operation\&. See a description of the variable \fBZFTP_VERBOSE\fP for +more information on how responses from the server may be printed\&. +.RE -+.RE +.PP +.SS "Subcommands" +.PP @@ -63627,7 +64495,6 @@ +and all errors will be printed\&. A null string is valid and +specifies that no messages should be printed\&. +.RE -+.RE +.PP +.SS "Functions" +.PP @@ -63684,7 +64551,6 @@ +user to decide whether the function should be defined and to use +\fBunfunction\fP when necessary\&. +.RE -+.RE +.PP +.SS "Problems" +.PP @@ -63795,7 +64661,6 @@ +\fB\-c\fP option, the \fBzprof\fP builtin command will reset its internal +counters and will not show the listing\&. +.RE -+.RE +.SH "THE ZSH/ZPTY MODULE" +.\" Yodl file: Zsh/mod_zpty.yo + @@ -63954,7 +64819,6 @@ +the array will not be set (nor modified in any way)\&. If there was an error +in the select operation the appropriate error message is printed\&. +.RE -+.RE +.SH "THE ZSH/ZUTIL MODULE" +.\" Yodl file: Zsh/mod_zutil.yo + @@ -64223,7 +65087,6 @@ +A `\fB+\fP\&' as described above may appear between the \fIname\fP and the +first colon\&. +.RE -+.RE +.PP +The options of \fBzparseopts\fP itself are: +.PP @@ -64246,10 +65109,12 @@ +builtin\&. +.TP +\fB\-K\fP -+With this option, the arrays specified with the \fB\-a\fP and \fB\-A\fP -+options and with the `\fB=\fP\fIarray\fP\&' forms are kept unchanged when none -+of the \fIspecs\fP for them is used\&. This allows assignment of default -+values to them before calling \fBzparseopts\fP\&. ++With this option, the arrays specified with the \fB\-a\fP option and with the ++`\fB=\fP\fIarray\fP\&' forms are kept unchanged when none of the \fIspecs\fP for ++them is used\&. Otherwise the entire array is replaced when any of the ++\fIspecs\fP is used\&. Individual elements of associative arrays specified ++with the \fB\-A\fP option are preserved by \fB\-K\fP\&. This allows assignment of ++default values to arrays before calling \fBzparseopts\fP\&. +.TP +\fB\-M\fP +This changes the assignment rules to implement a map among equivalent @@ -64258,7 +65123,7 @@ +which is used to choose where to store the values\&. If no other \fIspec\fP +is found, the values are stored as usual\&. This changes only the way the +values are stored, not the way \fB$*\fP is parsed, so results may be -+unpredicable if the `\fIname\fP\fB+\fP\&' specifier is used inconsistently\&. ++unpredictable if the `\fIname\fP\fB+\fP\&' specifier is used inconsistently\&. +.TP +\fB\-E\fP +This changes the parsing rules to \fInot\fP stop at the first string @@ -64326,11 +65191,10 @@ +.fi +.RE +.RE -+.RE --- /dev/null -+++ zsh-5.0.5/Doc/zshoptions.1 -@@ -0,0 +1,1765 @@ -+.TH "ZSHOPTIONS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshoptions.1 +@@ -0,0 +1,1803 @@ ++.TH "ZSHOPTIONS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshoptions \- zsh options +.\" Yodl file: Zsh/options.yo @@ -64972,7 +65836,6 @@ +and then manually import commands whenever you need them using `\fBfc +\-RI\fP\&'\&. +.RE -+.RE +.PP +.SS "Initialisation" +.PD 0 @@ -65040,6 +65903,11 @@ +.TP +\fBCORRECT_ALL\fP (\fB\-O\fP) +Try to correct the spelling of all arguments in a line\&. ++.RS ++.PP ++The shell variable \fBCORRECT_IGNORE_FILE\fP may be set to a pattern to ++match file names that will never be offered as corrections\&. ++.RE +.TP +\fBDVORAK\fP +Use the Dvorak keyboard instead of the standard qwerty keyboard as a basis @@ -65082,7 +65950,7 @@ +Has no effect if neither \fBHASH_CMDS\fP nor \fBCORRECT\fP is set\&. +.TP +\fBHASH_EXECUTABLES_ONLY\fP -+When hashing commands because of \fBHASH_COMMANDS\fP, check that the ++When hashing commands because of \fBHASH_CMDS\fP, check that the +file to be hashed is actually an executable\&. This option +is unset by default as if the path contains a large number of commands, +or consists of many remote files, the additional tests can take @@ -65100,7 +65968,7 @@ +(assuming it exists)\&. +Commands explicitly beginning with `\fB/\fP\&', `\fB\&./\fP' or `\fB\&.\&./\fP' +are not subject to the path search\&. -+This also applies to the `\fB\&.\fP\&' builtin\&. ++This also applies to the `\fB\&.\fP\&' and \fBsource\fP builtins\&. +.RS +.PP +Note that subdirectories of the current directory are always searched for @@ -65225,7 +66093,6 @@ +if that job has already exited\&. This works even if the option is turned +on temporarily around the use of the \fBwait\fP builtin\&. +.RE -+.RE +.PP +.SS "Prompting" +.PD 0 @@ -65341,16 +66208,27 @@ +.TP +\fBFUNCTION_ARGZERO\fP +When executing a shell function or sourcing a script, set \fB$0\fP -+temporarily to the name of the function/script\&. ++temporarily to the name of the function/script\&. Note that toggling ++\fBFUNCTION_ARGZERO\fP from on to off (or off to on) does not change the ++current value of \fB$0\fP\&. Only the state upon entry to the function or ++script has an effect\&. Compare \fBPOSIX_ARGZERO\fP\&. ++.TP ++\fBLOCAL_LOOPS\fP ++When this option is not set, the effect of \fBbreak\fP and \fBcontinue\fP ++commands may propagate outside function scope, affecting loops in ++calling functions\&. When the option is set in a calling function, a ++\fBbreak\fP or a \fBcontinue\fP that is not caught within a called function ++(regardless of the setting of the option within that function) ++produces a warning and the effect is cancelled\&. +.TP +\fBLOCAL_OPTIONS\fP +If this option is set at the point of return from a shell function, +most options (including this one) which were in force upon entry to +the function are restored; options that are not restored are -+\fBPRIVILEGED\fP and \fBRESTRICTED\fP\&. Otherwise, only this option and the -+\fBXTRACE\fP and \fBPRINT_EXIT_VALUE\fP options are restored\&. Hence -+if this is explicitly unset by a shell function the other options in -+force at the point of return will remain so\&. ++\fBPRIVILEGED\fP and \fBRESTRICTED\fP\&. Otherwise, only this option, ++and the \fBLOCAL_LOOPS\fP, \fBXTRACE\fP and \fBPRINT_EXIT_VALUE\fP options are ++restored\&. Hence if this is explicitly unset by a shell function the ++other options in force at the point of return will remain so\&. +A shell function can also guarantee itself a known shell configuration +with a formulation like `\fBemulate \-L zsh\fP\&'; the \fB\-L\fP activates +\fBLOCAL_OPTIONS\fP\&. @@ -65436,7 +66314,7 @@ +.TP +\fBXTRACE\fP (\fB\-x\fP, ksh: \fB\-x\fP) +Print commands and their arguments as they are executed\&. The -+output is proceded by the value of \fB$PS4\fP, formatted as described ++output is preceded by the value of \fB$PS4\fP, formatted as described +in +the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. +.PP @@ -65571,6 +66449,27 @@ +code\&. +.RE +.TP ++\fBPOSIX_ARGZERO\fP ++This option may be used to temporarily disable \fBFUNCTION_ARGZERO\fP and ++thereby restore the value of \fB$0\fP to the name used to invoke the shell ++(or as set by the \fB\-c\fP command line option)\&. For compatibility with ++previous versions of the shell, emulations use \fBNO_FUNCTION_ARGZERO\fP ++instead of \fBPOSIX_ARGZERO\fP, which may result in unexpected scoping of ++\fB$0\fP if the emulation mode is changed inside a function or script\&. ++To avoid this, explicitly enable \fBPOSIX_ARGZERO\fP in the \fBemulate\fP ++command: ++.RS ++.PP ++.RS ++.nf ++\fBemulate sh \-o POSIX_ARGZERO\fP ++.fi ++.RE ++.PP ++Note that \fBNO_POSIX_ARGZERO\fP has no effect unless \fBFUNCTION_ARGZERO\fP ++was already enabled upon entry to the function or script\&. ++.RE ++.TP +\fBPOSIX_BUILTINS\fP +When this option is set the \fBcommand\fP builtin can be used to execute +shell builtin commands\&. Parameter assignments specified before shell @@ -65637,7 +66536,7 @@ +.PP +When this option is set, the \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP expression is truncated at +the null character\&. Note that remaining parts of the same string -+beyond the termination of the quotes are not trunctated\&. ++beyond the termination of the quotes are not truncated\&. +.PP +For example, the command line argument \fBa$\&'b\e0c'd\fP is treated with +the option off as the characters \fBa\fP, \fBb\fP, null, \fBc\fP, \fBd\fP, @@ -65649,7 +66548,10 @@ +traps for \fBEXIT\fP on exit from shell functions is suppressed\&. +In that case, manipulating \fBEXIT\fP traps always alters the global +trap for exiting the shell; the \fBLOCAL_TRAPS\fP option is -+ignored for the \fBEXIT\fP trap\&. ++ignored for the \fBEXIT\fP trap\&. Furthermore, a \fBreturn\fP statement ++executed in a trap with no argument passes back from the function the ++value from the surrounding context, not from code executed within the ++trap\&. +.TP +\fBSH_FILE_EXPANSION\fP +Perform filename expansion (e\&.g\&., ~ expansion) \fIbefore\fP @@ -66096,9 +66998,9 @@ +Used by \fBset\fP to sort positional parameters +.PD --- /dev/null -+++ zsh-5.0.5/Doc/zshparam.1 -@@ -0,0 +1,1573 @@ -+.TH "ZSHPARAM" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshparam.1 +@@ -0,0 +1,1588 @@ ++.TH "ZSHPARAM" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshparam \- zsh parameters +.\" Yodl file: Zsh/params.yo @@ -66124,13 +67026,19 @@ +.PP +If the integer attribute, \fB\-i\fP, is set for \fIname\fP, the \fIvalue\fP +is subject to arithmetic evaluation\&. Furthermore, by replacing `\fB=\fP\&' -+with `\fB+=\fP\&', a parameter can be added or appended to\&. See ++with `\fB+=\fP\&', a parameter can be added or appended to\&. ++.PP ++In scalar assignment, \fIvalue\fP is expanded as a single string, in ++which the elements of arrays are joined together; filename expansion is ++not performed unless the option \fBGLOB_ASSIGN\fP is set\&. See +the section `Array Parameters\&' for additional forms of assignment\&. +.PP +To refer to the value of a parameter, write `\fB$\fP\fIname\fP\&' or +`\fB${\fP\fIname\fP\fB}\fP\&'\&. See +\fIParameter Expansion\fP in \fIzshexpn\fP(1) -+for complete details\&. ++for complete details\&. This section also explains the effect ++of the difference between scalar and array assignment on parameter ++expansion\&. +.PP +In the parameter lists that follow, the mark `\&' indicates that the +parameter is special\&. @@ -66444,7 +67352,6 @@ +a single key rather than as a reference to all values\&. It may be used +for either purpose on the left side of an assignment\&. +.RE -+.RE +.PP +See \fIParameter Expansion Flags\fP (\fIzshexpn\fP(1)) for additional ways to manipulate the results of array subscripting\&. +.PP @@ -66679,9 +67586,11 @@ +The exit status returned by the last command\&. +.TP +\fB0\fP -+The name used to invoke the current shell\&. If the \fBFUNCTION_ARGZERO\fP option -+is set, this is set temporarily within a shell function to the name of the -+function, and within a sourced script to the name of the script\&. ++The name used to invoke the current shell, or as set by the \fB\-c\fP command ++line option upon invocation\&. If the \fBFUNCTION_ARGZERO\fP option is set, ++\fB$0\fP is set upon entry to a shell function to the name of the function, ++and upon entry to a sourced script to the name of the script, and reset to ++its previous value when the function or script returns\&. +.TP +\fBstatus\fP +Same as \fB?\fP\&. @@ -66728,9 +67637,10 @@ +group ID by `\fB(GID=\fP\fIgid\fP\fB; command)\fP\&' +.TP +\fBHISTCMD\fP -+The current history line number in an interactive shell, in other -+words the line number for the command that caused \fB$HISTCMD\fP -+to be read\&. ++The current history event number in an interactive shell, in other ++words the event number for the command that caused \fB$HISTCMD\fP ++to be read\&. If the current history event modifies the history, ++\fBHISTCMD\fP changes to the new maximum history event number\&. +.TP +\fBHOST\fP +The current hostname\&. @@ -66746,7 +67656,9 @@ +If the corresponding variable is not set in the environment of the +shell, it is initialized to the login name corresponding to the +current login session\&. This parameter is exported by default but -+this can be disabled using the \fBtypeset\fP builtin\&. ++this can be disabled using the \fBtypeset\fP builtin\&. The value ++is set to the string returned by the \fIgetlogin\fP(3) system call ++if that is available\&. +.TP +\fBMACHTYPE\fP +The machine type (microprocessor class or machine model), @@ -67013,6 +67925,13 @@ +example just given files beginning with `\fB_\fP\&' in the current +directory would still be completed)\&. +.TP ++\fBCORRECT_IGNORE_FILE\fP ++If set, is treated as a pattern during spelling correction of file names\&. ++Any file name that matches the pattern is never offered as a correction\&. ++For example, if the value is `\fB\&.*\fP\&' then dot file names will never be ++offered as spelling corrections\&. This is useful with the ++\fBCORRECT_ALL\fP option\&. ++.TP +\fBDIRSTACKSIZE\fP +The maximum size of the directory stack, by default there is no limit\&. If the +stack gets larger than this, it will be truncated automatically\&. @@ -67111,7 +68030,7 @@ +on the command line for the last one to be removed\&. +.RS +.PP -+For backward compabitility, if the \fBSUNKEYBOARDHACK\fP option is ++For backward compatibility, if the \fBSUNKEYBOARDHACK\fP option is +explicitly set, the value of \fBKEYBOARD_HACK\fP reverts to backquote\&. +If the option is explicitly unset, this variable is set to empty\&. +.RE @@ -67578,7 +68497,6 @@ +both separators must be present in any case\&. +.RE +.RE -+.RE +.TP +\fBWORDCHARS\fP +A list of non\-alphanumeric characters considered part of a word @@ -67670,15 +68588,13 @@ +Recent virtual terminals are more likely to handle this case correctly\&. +Some experimentation is necessary\&. +.RE -+.RE --- /dev/null -+++ zsh-5.0.5/Doc/zshroadmap.1 -@@ -0,0 +1,191 @@ -+.TH "ZSHROADMAP" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshroadmap.1 +@@ -0,0 +1,190 @@ ++.TH "ZSHROADMAP" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshroadmap \- informal introduction to the zsh manual +.\" Yodl file: Zsh/roadmap.yo -+.PP +The Zsh Manual, like the shell itself, is large and often complicated\&. +This section of the manual provides some pointers to areas of the shell +that are likely to be of particular interest to new users, and indicates @@ -67866,9 +68782,9 @@ +\fBzmv\fP +a command for renaming files by means of shell patterns\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshtcpsys.1 -@@ -0,0 +1,835 @@ -+.TH "ZSHTCPSYS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshtcpsys.1 +@@ -0,0 +1,845 @@ ++.TH "ZSHTCPSYS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshtcpsys \- zsh tcp system +.\" Yodl file: Zsh/tcpsys.yo @@ -68084,7 +69000,6 @@ +file(s) with \fB$TCP_OUTPUT\fP in front where appropriate, much +in the manner of \fB$TCP_PROMPT\fP\&. +.RE -+.RE +.PP +.SS "Session Management" +.PP @@ -68157,7 +69072,6 @@ +through as the appear to \fBtcp_sess\fP\&. The original session is restored +when \fBtcp_sess\fP exits\&. +.RE -+.RE +.PP +.SS "Advanced I/O" +.PP @@ -68179,7 +69093,7 @@ +.RE +.TP +.PD 0 -+\fBtcp_expect [ \-q ] [ \-p\fP \fIvar\fP \fB] [ \-t \fP \fIto\fP \fB| \-T\fP \fITO\fP\fB]\fP ++\fBtcp_expect [ \-q ] [ \-p \fP \fIvar\fP \fB | \-P \fP \fIvar\fP \fB] [ \-t \fP \fIto\fP \fB| \-T\fP \fITO\fP\fB]\fP +.TP +.PD +\fB [ \-a | \-s\fP \fIsess\fP \fB\&.\&.\&. | \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIpattern\fP \&.\&.\&. @@ -68215,7 +69129,16 @@ +\fIvar\fP can be used; on return, \fB$var\fP is set to the number of the +pattern using ordinary zsh indexing, i\&.e\&. the first is 1, and so on\&. Note +the absence of a `\fB$\fP\&' in front of \fIvar\fP\&. To avoid clashes, the -+parameter cannot begin with `\fB_expect\fP\&'\&. ++parameter cannot begin with `\fB_expect\fP\&'\&. The index \-1 is used if ++there is a timeout and 0 if there is no match\&. ++.PP ++The option \fB\-P\fP \fIvar\fP works similarly to \fB\-p\fP, but instead of ++numerical indexes the regular arguments must begin with a prefix ++followed by a colon: that prefix is then used as a tag to which \fIvar\fP ++is set when the argument matches\&. The tag \fBtimeout\fP is used if there ++is a timeout and the empty string if there is no match\&. Note it is ++acceptable for different arguments to start with the same prefix if the ++matches do not need to be distinguished\&. +.PP +The option \fB\-q\fP is passed directly down to \fBtcp_read\fP\&. +.PP @@ -68336,9 +69259,8 @@ +As these two functions do not require \fBtcp_open\fP to set up a TCP +connection first, they may need to be autoloaded separately\&. +.RE -+.RE +.PP -+.SH "TCP USER\e\-DEFINED FUNCTIONS" ++.SH "TCP USER\-DEFINED FUNCTIONS" +.PP +Certain functions, if defined by the user, will be called by the function +system in certain contexts\&. This facility depends on the module @@ -68468,7 +69390,6 @@ +The \fB\-S\fP and \fB\-F\fP options are used to pass in the session name and file +descriptor for possible replacement in the prompt\&. +.RE -+.RE +.PP +.SH "TCP USER PARAMETERS" +.PP @@ -68549,6 +69470,12 @@ +session, else 0; this is most useful in ternary expressions such as +`\fB%(c\&.\-\&.+)\fP\&' which outputs `\fB+\fP' if the session is +the current one, else `\fB\-\fP\&'\&. ++.RS ++.PP ++If the prompt starts with \fB%P\fP, this is stripped and the complete ++result of the previous stage is passed through standard prompt \fB%\fP\-style ++formatting before being output\&. ++.RE +.TP +\fBTCP_READ_DEBUG\fP +May be set directly\&. If this has non\-zero length, \fBtcp_read\fP will give @@ -68594,7 +69521,7 @@ +May be set directly\&. Currently this is only used by the function +\fBtcp_command\fP, see above\&. +.PP -+.SH "TCP USER\e\-DEFINED PARAMETERS" ++.SH "TCP USER\-DEFINED PARAMETERS" +.PP +The following parameters are not set by the function system, but have +a special effect if set by the user\&. @@ -68620,7 +69547,6 @@ +is still stored in \fBTCP_LINE\fP and \fBtcp_lines\fP; this occurs after all +\fBtcp_on_read\fP processing\&. +.RE -+.RE +.PP +.SH "TCP UTILITY PARAMETERS" +.PP @@ -68704,9 +69630,9 @@ +arriving in small amounts, the performance when large amounts of data are +being exchanged is likely to be extremely poor\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshzftpsys.1 -@@ -0,0 +1,667 @@ -+.TH "ZSHZFTPSYS" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshzftpsys.1 +@@ -0,0 +1,662 @@ ++.TH "ZSHZFTPSYS" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshzftpsys \- zftp function front\-end +.\" Yodl file: Zsh/zftpsys.yo @@ -68974,7 +69900,6 @@ +local directory \fIldir\fP retaining the same basenames\&. This assumes UNIX +directory semantics\&. +.RE -+.RE +.PP +.SS "Sending files" +.PD 0 @@ -69030,7 +69955,6 @@ +failure code 553 and a reply including the string `\fBIs a directory\fP\&', +then \fBzfpcp\fP will retry using the second form\&. +.RE -+.RE +.PP +.SS "Closing the connection" +.PD 0 @@ -69083,7 +70007,6 @@ +connections still be valid in a subshell, which is not the case under +versions of some operating systems, presumably due to a system bug\&. +.RE -+.RE +.PP +.SS "Bookmarks" +The two functions \fBzfmark\fP and \fBzfgoto\fP allow you to `bookmark\&' the @@ -69125,7 +70048,6 @@ +Note that there is no mechanism for adding or modifying \fBncftp\fP bookmarks +from the zftp functions\&. +.RE -+.RE +.PP +.SS "Other functions" +Mostly, these functions will not be called directly (apart from @@ -69291,7 +70213,6 @@ +so it will set the default value for the style to 1 if none exists +already\&. +.RE -+.RE +.PP +Note that there is also an associative array \fBzfconfig\fP which contains +values used by the function system\&. This should not be modified or @@ -69374,9 +70295,9 @@ +installed with the other functions of the completion system and hence +should automatically be available\&. --- /dev/null -+++ zsh-5.0.5/Doc/zshzle.1 -@@ -0,0 +1,2416 @@ -+.TH "ZSHZLE" "1" "January 5, 2014" "zsh 5\&.0\&.5" ++++ zsh-5.0.7/Doc/zshzle.1 +@@ -0,0 +1,2449 @@ ++.TH "ZSHZLE" "1" "October 7, 2014" "zsh 5\&.0\&.7" +.SH "NAME" +zshzle \- zsh command line editor +.\" Yodl file: Zsh/zle.yo @@ -69648,6 +70569,11 @@ +When \fIin\-string\fP is typed, \fIout\-string\fP will be +pushed back and treated as input to the line editor\&. +When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&. ++.RS ++.PP ++Note that both \fIin\-string\fP and \fIout\-string\fP are subject to the same ++form of interpretation, as described below\&. ++.RE +.TP +\fIin\-string command\fP \&.\&.\&. +Bind each \fIin\-string\fP to each \fIcommand\fP\&. @@ -69669,7 +70595,6 @@ +When the \fB\-L\fP option is used, the list is in the form of \fBbindkey\fP +commands to create the key bindings\&. +.RE -+.RE +.PP +When the \fB\-R\fP option is used as noted above, a valid range consists of +two characters, with an optional `\fB\-\fP\&' between them\&. All characters @@ -69945,26 +70870,35 @@ +.RS +.PP +Installs \fIhandler\fP (the name of a shell function) to handle input from -+file descriptor \fIfd\fP\&. When zle is attempting to read data, it will -+examine both the terminal and the list of handled \fIfd\fP\&'s\&. If data -+becomes available on a handled \fIfd\fP, zle will call \fIhandler\fP with -+the fd which is ready for reading as the only argument\&. If the handler -+produces output to the terminal, it should call `\fBzle \-I\fP\&' before doing -+so (see below)\&. The handler should not attempt to read from the terminal\&. -+Note that zle makes no attempt to check whether this fd is actually ++file descriptor \fIfd\fP\&. Installing a handler for an \fIfd\fP which is ++already handled causes the existing handler to be replaced\&. Any number of ++handlers for any number of readable file descriptors may be installed\&. ++Note that zle makes no attempt to check whether this \fIfd\fP is actually +readable when installing the handler\&. The user must make their own +arrangements for handling the file descriptor when zle is not active\&. +.PP -+If the option \fB\-w\fP is also given, the \fIhandler\fP is instead a -+line editor widget, typically a shell function made into a widget using -+\fBzle \-N\fP\&. In that case \fIhandler\fP can use all the facilities of -+zle to update the current editing line\&. Note, however, that as handling -+\fIfd\fP takes place at a low level changes to the display will not -+automatically appear; the widget should call \fBzle \-R\fP to force redisplay\&. -+.PP -+Any number of handlers for any number of readable file descriptors may be -+installed\&. Installing a handler for an \fIfd\fP which is already handled -+causes the existing handler to be replaced\&. ++When zle is attempting to read data, it will examine both the terminal and ++the list of handled \fIfd\fP\&'s\&. If data becomes available on a handled ++\fIfd\fP, zle calls \fIhandler\fP with the fd which is ready for reading ++as the first argument\&. Under normal circumstances this is the only ++argument, but if an error was detected, a second argument provides ++details: `\fBhup\fP\&' for a disconnect, `\fBnval\fP' for a closed or otherwise ++invalid descriptor, or `\fBerr\fP\&' for any other condition\&. Systems that ++support only the `select\&' system call always use `\fBerr\fP'\&. ++.PP ++If the option \fB\-w\fP is also given, the \fIhandler\fP is instead a line ++editor widget, typically a shell function made into a widget using ++`\fBzle \-N\fP\&'\&. In that case \fIhandler\fP can use all the facilities of zle ++to update the current editing line\&. Note, however, that as handling \fIfd\fP ++takes place at a low level changes to the display will not automatically ++appear; the widget should call `\fBzle \-R\fP\&' to force redisplay\&. As of this ++writing, widget handlers only support a single argument and thus are never ++passed a string for error state, so widgets must be prepared to test the ++descriptor themselves\&. ++.PP ++If either type of handler produces output to the terminal, it should call ++`\fBzle \-I\fP\&' before doing so (see below)\&. Handlers should not attempt to ++read from the terminal\&. +.PP +If no \fIhandler\fP is given, but an \fIfd\fP is present, any handler for +that \fIfd\fP is removed\&. If there is none, an error message is printed @@ -69979,7 +70913,8 @@ +.PP +Note that this feature should be used with care\&. Activity on one of the +\fIfd\fP\&'s which is not properly handled can cause the terminal to become -+unusable\&. ++unusable\&. Removing an \fIfd\fP handler from within a signal trap may cause ++unpredictable behavior\&. +.PP +Here is a simple example of using this feature\&. A connection to a remote +TCP port is created using the ztcp command; see @@ -69988,6 +70923,7 @@ +that `select\&' will indicate that the file descriptor needs handling +if the remote side has closed the connection; we handle that by testing +for a failed read\&. ++.PP +.RS +.nf +\fBif ztcp pwspc 2811; then @@ -70118,8 +71054,6 @@ +it should call the \fBbeep\fP widget directly\&. +.RE +.RE -+.RE -+.RE +.PP +.SH "WIDGETS" +All actions in the editor are performed by `widgets\&'\&. A widget's job is @@ -70139,7 +71073,7 @@ +shell function is executed, and can perform editing (or other) actions\&. +It is recommended that user\-defined widgets should not have names +starting with `\fB\&.\fP\&'\&. -+.SH "USER\e\-DEFINED WIDGETS" ++.SH "USER\-DEFINED WIDGETS" +User\-defined widgets, being implemented as shell functions, +can execute any normal shell command\&. They can also run other widgets +(whether built\-in or user\-defined) using the \fBzle\fP builtin command\&. @@ -70174,19 +71108,21 @@ +\fBCONTEXT\fP (scalar) +The context in which zle was called to read a line; read\-only\&. One of +the values: ++.RS ++.PP +.PD 0 +.TP +.PD -+start ++\fBstart\fP +The start of a command line (at prompt \fBPS1\fP)\&. +.TP -+cont ++\fBcont\fP +A continuation to a command line (at prompt \fBPS2\fP)\&. +.TP -+select ++\fBselect\fP +In a \fBselect\fP loop\&. +.TP -+vared ++\fBvared\fP +Editing a variable in \fBvared\fP\&. +.RE +.TP @@ -70307,22 +71243,26 @@ +.PP +.PD 0 +.TP ++.PD ++\(bu +Optionally, a `\fBP\fP\&' to signify that the start and end offset that +follow include any string set by the \fBPREDISPLAY\fP special parameter; +this is needed if the predisplay string itself is to be highlighted\&. +Whitespace may follow the `\fBP\fP\&'\&. +.TP ++\(bu +A start offset in the same units as \fBCURSOR\fP, terminated by +whitespace\&. +.TP ++\(bu +An end offset in the same units as \fBCURSOR\fP, terminated by +whitespace\&. +.TP ++\(bu +A highlight specification in the same format as +used for contexts in the parameter \fBzle_highlight\fP, +see Character Highlighting below; -+for example, \fBstandout\fP or \fBfg=red,bold\fP\&. -+.PD ++for example, \fBstandout\fP or \fBfg=red,bold\fP +.PP +For example, +.PP @@ -70385,7 +71325,6 @@ +.fi +.RE +.RE -+.RE +.PP +.SS "Special Widgets" +.PP @@ -70463,7 +71402,6 @@ +This can be used for detecting switches between the vi command +(\fBvicmd\fP) and insert (usually \fBmain\fP) keymaps\&. +.RE -+.RE +.PP +.SH "STANDARD WIDGETS" +The following is a list of all the standard widgets, @@ -70727,8 +71665,13 @@ +Redisplay the command line, remaining in incremental search mode\&. +.TP +\fBvi\-cmd\-mode\fP -+Toggle between the `\fBmain\fP\&' and `\fBvicmd\fP' keymaps; ++Select the `\fBvicmd\fP\&' keymap; +the `\fBmain\fP\&' keymap (insert mode) will be selected initially\&. ++.RS ++.PP ++In addition, the modifications that were made while in vi insert mode are ++merged to form a single undo event\&. ++.RE +.TP +.PD 0 +\fBvi\-repeat\-search\fP @@ -71226,7 +72169,6 @@ +.fi +.RE +.RE -+.RE +.SS "Completion" +.PD 0 +.TP @@ -71553,6 +72495,12 @@ +\fBspell\-word\fP (ESC\-$ ESC\-S ESC\-s) (unbound) (unbound) +Attempt spelling correction on the current word\&. +.TP ++\fBsplit\-undo\fP ++Breaks the undo sequence at the current change\&. This is useful in vi mode as ++changes made in insert mode are coalesced on entering command mode\&. Similarly, ++\fBundo\fP will normally revert as one all the changes made by a user\-defined ++widget\&. ++.TP +\fBundefined\-key\fP +This command is executed when a key sequence that is not bound to any +command is typed\&. By default it beeps\&. @@ -71562,6 +72510,12 @@ +user\-defined widget, takes an optional argument indicating a previous state +of the undo history as returned by the \fBUNDO_CHANGE_NO\fP variable; +modifications are undone until that state is reached\&. ++.RS ++.PP ++Note that when invoked from vi command mode, the full prior change made in ++insert mode is reverted, the changes having been merged when command mode was ++selected\&. ++.RE +.TP +\fBredo\fP +Incrementally redo undone text modifications\&. @@ -71793,7 +72747,7 @@ +above\&. +.PP --- /dev/null -+++ zsh-5.0.5/META-FAQ ++++ zsh-5.0.7/META-FAQ @@ -0,0 +1,117 @@ +------------------------ +META-FAQ for the Z Shell diff -Nru zsh-5.0.5/debian/patches/replace-texi2html-with-makeinfo zsh-5.0.7/debian/patches/replace-texi2html-with-makeinfo --- zsh-5.0.5/debian/patches/replace-texi2html-with-makeinfo 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/patches/replace-texi2html-with-makeinfo 2014-12-06 18:25:17.000000000 +0000 @@ -4,14 +4,14 @@ Index: zsh/Doc/Makefile.in =================================================================== ---- zsh.orig/Doc/Makefile.in 2013-12-02 15:26:29.000000000 +0100 -+++ zsh/Doc/Makefile.in 2013-12-02 15:26:29.000000000 +0100 +--- zsh.orig/Doc/Makefile.in 2014-08-11 17:45:12.000000000 +0200 ++++ zsh/Doc/Makefile.in 2014-08-11 17:45:12.000000000 +0200 @@ -41,7 +41,7 @@ MAKEINFO = makeinfo TEXI2DVI = texi2dvi DVIPS = dvips --TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files -+TEXI2HTML = makeinfo --html --output . --ifinfo --split=chapter --node-files +-TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files \ ++TEXI2HTML = makeinfo --html --output . --ifinfo --split=chapter --node-files \ + --init-file texi2html.conf .SUFFIXES: .yo .1 - diff -Nru zsh-5.0.5/debian/patches/series zsh-5.0.7/debian/patches/series --- zsh-5.0.5/debian/patches/series 2014-07-07 12:29:40.000000000 +0000 +++ zsh-5.0.7/debian/patches/series 2014-12-06 18:31:44.000000000 +0000 @@ -1,6 +1,10 @@ replace-texi2html-with-makeinfo -cherry-pick-d397599cea5aa39492e5914c876a3991b8543445-apt-completion -cherry-pick-60bedea3e712178beac392af1ca6ed7291630459-apt-mark-completion -cherry-pick-7f6dc0fe8e3c9aaec8aa295cc4459eabb8f2ada2-INC_APPEND_HISTORY_TIME -prebuild-docs.patch +cherry-pick-0f73b35f-33391-vcs-info-git-fix-applied-patch-detection-on-git-am.patch +cherry-pick-a03227de-33405-vcs-info-make-sure-maxexports-is-set-when-vcs-info-set-is-called.patch +cherry-pick-22c4ea42-33403-be-conservative-about-redirecting-call-program-stderr-the-caller-may-have-already-done-so.patch +cherry-pick-605a73e4-33429-disallow-non-integer-values-for-histsize-and-savehist-of-fc-p-and-fix-crash-on-zero-values-for-same.patch +cherry-pick-521313b4-tests-for-workers-33429.patch +cherry-pick-2d14c085-33445-fix-handling-of-s-when-combined-with-i-at-shell-invocation.patch +further-mitigate-test-suite-hangs.patch cross-compile.diff +prebuild-docs.patch diff -Nru zsh-5.0.5/debian/pkg-zsh-workflow.md zsh-5.0.7/debian/pkg-zsh-workflow.md --- zsh-5.0.5/debian/pkg-zsh-workflow.md 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/pkg-zsh-workflow.md 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,512 @@ +Branches +======== + +* **upstream**: The upstream sources from `git://zsh.git.sf.net/gitroot/zsh/zsh`. +* **debian**: The debian changes for the debian `zsh` package. Only + difference to the upstream branch is the `debian` directory. +* master: This is the _old_ repository's main branch. Only kept for + _historical_ reasons. +* Other branches: These branches are rather optional and not required + for basic maintenance for of the `zsh` package. Most likely feature + branches. + + +Workflow +======== + +This diagram outlines the workflow with git branches and +tags. Basically, the `debian` branch walks alongside the `upstream` +branch and upstream changes get merged into `debian` at defined points. +For the zsh package, this _must_ be upstream commit tags -- otherwise +Jenkins +[fails to build the source package](http://jenkins.grml.org/view/Debian/job/zsh-source/219/console). + + * debian/4.3.11-4 + | + | * debian/4.3.11-5 + | | + | | * debian/4.3.12-1 + | | | + | | | * debian/4.3.12-2 + | | | | + | | | | * debian/4.3.13-1 + | | | | | + | | | | | * debian/4.3.13-2 + | | | | | | + | | | | | | * debian/4.3.13-3 + | | | | | | | + | | | | | | | + a-b-c-d---e-f-g-h-i-------j-k-l-m-n-o-p debian + / / / + A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q upstream + | | | + | | | + | | * zsh-4.3.13 + | * zsh-4.3.12 + | + * zsh-4.3.11 + +Working on the package +---------------------- + +### Patching upstream code + +Every change to the source (outside the `debian` directory) must be +done by adding quilt patches. + +#### Patch naming conventions + +* File names of patches which are not meant for upstream should be + prefixed with `debian-`. +* File names of patches which are cherry-picked from upstream should be prefixed + with `cherry-pick-$shortcommitid` where `$shortcommitid` are the + first 8 characters of the upstream git commit id. + +In case a vast number of patches are required, quilt patches should be +prefixed by ascending numbers according to the order in which "quilt +series" would list them. + +#### Patch format + +Every patch should have +[DEP3 conforming patch headers](http://dep.debian.net/deps/dep3/) +above the actual unified diff content, outlining the status of the +patch. + +Except for the obvious case of a cherry-picked patch from upstream +(which should contain an `Origin: commit $commitid` header), it is +important that the fields `Forwarded` and `Applied-Upstream` are kept +uptodate to know whether a change is already applied upstream. This +helps to drop the right patches before merging a new upstream release +into the `debian` branch. + + +#### Example of adding a fix via a quilt patch + +Let's say, there is an issue _#12345_ which can be fixed by patching +`Functions/Misc/colors`. Here is how you could add that patch +(assuming clean git working directory): + +First, push all existing patches, so the new one is added on top. + + % quilt push -a + +Alternatively push the patches one by one (by calling `quilt push` +multiple times) until you are at the patch queue position where you +want to insert the patch. + +##### Adding a patch from a file or by editing + +Add the new patch (say, the topmost patch is 0002-foo.diff). + + % quilt new fix-colors.diff + +Tell quilt which files are going to be changed. + + % quilt add Functions/Misc/colors + +Import the fix either manually using your favourite editor… + + % $EDITOR Functions/Misc/colors + +… or by patching: + + % patch -p$n < ../patch_from_somewhere_else.diff + +##### Cherry-picking patches from upstream + +When there is an existing patch (e.g. from upstream's git repository), +the above can be largely automated if the patch applies to the current +state of the debian branch. + + % patchname="cherry-pick-$shortcommitid-description-with-dashes" + % git show $commitid | filterdiff -x a/ChangeLog > debian/patches/$patchname + % sed -e '1 s/^commit/Origin: commit/' -i debian/patches/$patchname + % echo $patchname >> debian/patches/series + % $EDITOR debian/patches/$patchname + % git add debian/patches/series debian/patches/$patchname + % git commit -v + +Patches from upstream will likely include changes to the ChangeLog +file. Those changes will probably not apply cleanly, so just open the +created patch file and delete all hunks that do changes in +ChangeLog. The `filterdiff` command above should catch that. + + % $EDITOR debian/patches/$patchname + +Check if the patch applies + + % quilt push + +All the above is mostly automated in `debian/bin/commit2patch`. + +##### Finish import of the patch + +Refresh the patch to get rid of any fuzz or offset: + + % quilt refresh + +Pop all patches again to clean up the upstream source. + + % quilt pop -a + +Edit the patch headers according to +[DEP3](http://dep.debian.net/deps/dep3/). + + % $EDITOR debian/patches/$patchname + +Commit the new patch and the changed `series` file to git. + + % git add debian/patches/fix-colors.diff + % git add debian/patches/series + % git commit -m 'Fixing foo in colors function (Closes: #12345)' + +That's all. + +### Releases + +When a change justifies the release of a new package version, the +debian/changelog file should be updated and the resulting commit +should be tagged `debian/${zsh_version}-${n+1}`. + + +### Updating debian/changelog + +This file should *not* be updated manually. The changes should be +inserted by running the `git-dch` tool from the package +`git-buildpackage` before a new release is about to be made. + +Changelog entries should be prefixed by a `[$hashsum] ` string, where +`$hashsum` is a string that represents the first eight characters of +commit the changelog entry was generated from. + +Also, if multiple authors are involved in a changelog entry-set, each +author should only appear once in the series with all her/his changes +listed below her/him in chronological order. + +Given that `debian/gbp.conf` is up-to-date, using the git-dch(1) tool +will result in the desired changelog format: + + % git-dch + +If you absolutely *must* make changelog entries by other means, you +should make sure that you prefix any resulting commits with +"[dch-ignore] ", so those commits can be weeded out easily. + +There is a helper script `debian/bin/do-dch` which takes care of all +formatting options as well as the "[dch-ignore] " weeding. The +script should be used unless there is a good reason not to. + + +Transitioning to a new upstream version +--------------------------------------- + +When upstream releases a new version, we should follow these steps: + +### Merging new upstream tag (`zsh-$version`) into our upstream branch + + % git checkout upstream + % git pull origin + % git fetch zsh + % git merge --ff-only zsh-$version + +If that doesn't do a fast-forward merge, a fast-forward merge can be +enforced as follows: + + % git checkout upstream + % git reset --hard zsh-$version + +### Create the fake orig tar ball (until we can work with upstream's tarball) + +This requires the upstream release to be properly tagged. + + % make -f debian/rules get-orig-source + +### Remove all quilt patches which are applied upstream + +All patches applied should be removed from `debian/patches` directory, +unless they fix an issue that was *not* addressed upstream and is +therefore missing from upstream's code base. + +### Merging the branch upstream into the branch debian + +After the `debian/patches` directory was cleaned up in the previous +step, merging `upstream` into `debian` should generally lead to a +working package again. + +If old patches were still around, that could lead to conflicts +when those would be applied during the build process. + +The message for the merge commit should be set to "New upstream +release" to allow `git-dch` to pick it up correctly later. **TODO**: +Doesn't really work. + +### Insert initial changelog for the new upstream release + +`git-dch` seems to be in trouble with non-linear histories. Therefore +we introduced a small helper script that will help `git-dch` to a +linear history again. + +Basically, you after merging the upstream release tag into the debian +branch, you'll be left with an history that looks something like this: + + * Updating autotools patches + M Merge commit 'zsh-4.3.13' into debian + |'* unposted: released 4.3.13 + | * … + | * … lots of other upstream commits … + | * … + * | Removing upstream patches due to new release + * | Last debian/4.3.12-* commit + * | … + * | … lot's of other debian/4.3.12-* commits + * | … + M´ Merge commit 'zsh-4.3.12' into debian + |'* unposted: released 4.3.12 + … older history + +And what you really want added to debian/changelog is the "Updating +autotools patches" and the "Removing upstream patches due to new +release" commits. You need to figure out the sha1 sums of the commits +and then call this: + + % debian/bin/urcl -p=zsh -v=4.3.13-1 b495ba1e f575f568 + +… where `4.3.13-1` is the version of the upcoming debian package and +`b495ba1e` and `f575f568` are the SHA1 hashsums of the wanted commits. + +At the end the script will drop you into an editor pointed at the +changelog file so you can sanity-check the generated output. + +At this point it would also make sense to add a line like this: + + * New upstream release + +or, if someone explicitly requested a package of this upstream +release, with mentioning of the according bug report number: + + * New upstream release (Closes: #1234567) + +If the upstream release fixes additional bugs reported in Debian or +security relevant bugs, the corresponding upstream commits should be +listed indented by two spaces, together with a short description and +the according bug report and/or CVE numbers, e.g. like this: + + * New upstream release + + [abcdefgh] Fixes foo (Closes: #1234567) + + [deadcafe] Adds Completion for bar (Closes: #987654) + + [babeabed] Fixes CVE-2014-9876 + +When creating a commit with these changelog changes, you may want to +prefix the commit message with `[dch-ignore] ` or add `-m "Git-Dch: +Ignore"` to the commit command so it doesn't come up in later git-dch +runs. + + +### Fix outstanding bugs + +If *any* outstanding bugs are known, they should be fixed before +releasing a new package. Obviously, if any of the known bugs are very +hard to fix and the issue is not serious in nature, releasing the +package with the issue may be more important. + +Again, all changes to non `debian/*` files should be done via quilt +patches. + + +### Verify that the package builds + +There are many ways to do this. Important is: + +* Use a clean and uptodate Debian Sid chroot (e.g. by using `sbuild`, + or `pbuilder` and friends) to make a comprehensive test or for + uploading. + + Axel prefers: `pdebuild --debbuildopts -j6` + +* For a quick sanity check, a simple `dpkg-buildpackage -B` (just + builds the architecture-dependent binary packages or a `debuild -uc + -us` (builds source and binary packages, runs `lintian` afterwards) + may suffice. + +* Use `gbp buildpackage` to automatically make sure, you are on the + correct branch and that the working directory is clean. + + +### Update changelog again for the release + +The `do-dch` helper script should be used to do this. It wraps git-dch +with appropriate options and weeds out any commits that are prefixed +with "[dch-ignore] ". All options to the script are turned over to +git-dch and at least `--since=…` should be used. + +At this particular point the sha1 of the previous initial changelog +update commit would be a good idea. Also "-R" to tell git-dch to +prepare the changelog for an actual commit. So: + + % debian/bin/do-dch --since=1234deadbeef -R + +You'll be dropped into an editor again to double check the generated +changelog. + + +### Tag debian/${new_zsh_version}-1 + +After fixes for all serious and trivially fixable issues have been +added and it has been verified that the package builds and `do-dch` +has updated `debian/changelog` and the resulting commit should be +tagged as `debian/${new_zsh_version}-1`. + + +Generating packages +------------------- + +### git-buildpackage aka gbp + +Alternatively, `git-buildpackage` (short `gbp`) also provides ways of +building packages from our packaging codebase. And since we are using +the `gbp dch` command (formerly `git-dch` tool from this utility suite +anyway, the tool should be available already. + +`git-buildpackage` allows building the package from within the +package repository and is currently avial + + % gbp buildpackage + +Make sure that the local repository is cleaned up after doing this +before working on the package again, to avoid accidentially committing +anything. See *Cleaning up the local repository* below for details. + +`git-buildpackage` is available as Debian package or from +https://honk.sigxcpu.org/piki/projects/git-buildpackage/ + + +Git repository setup +-------------------- + +Getting the basic pkg-zsh git repository is quite easy. If you want +a read only clone, use this: + + % gbp clone git://anonscm.debian.org/collab-maint/zsh.git pkg-zsh + +If you are reading this, though, you probably want write access. To +get a thusly cloned repository, first get an alioth login and upload +an ssh-public key. As soon as the key made it to all involved +machines, use this: + + % gbp clone $user@git.debian.org:/git/collab-maint/zsh.git pkg-zsh + +Where `$user` is your Alioth login. (Note, that this may be something +with a `-guest` suffix, in case you're not a Debian Developer.) + +### Branches + +Like described earlier, pkg-zsh development involves two branches; +`debian` and `upstream`. The former is checked out by default for +freshly cloned repositories. + +If you cloned the repository with `gbp clone` as shown above, gbp +already took care of also creating a local `upstream` branch. + +If you didn't, you can get a local version of the `upstream` branch by +calling + + % git checkout -b upstream origin/upstream + +This is useful to update the remote upstream branch with ongoing +development from the zsh project. + +### Remotes + +There is one remote repository with direct interest for pkg-zsh, and +that is the zsh project's git repository. Currently, this is only a +mirror of the project's cvs repository. But it is updated every ten +minutes by one of zsh's developers. (Also note, that there has been a +brief discussion about whether git may become the official VCS for git +after a bigger future release.) + +In order to have zsh's ongoing development available from within +your pkg-zsh repository, do this: + + % git remote add zsh.git git://zsh.git.sf.net/gitroot/zsh/zsh -t master + % git fetch zsh.git + +### Merging and pushing upstream changes + +To get updates back into `origin/upstream`, do this: + +Get the latest updates. + + % git fetch zsh.git + +Switch to the local `upstream` branch for integration. + + % git checkout upstream + +Merge upstream's changes (*). + + % git merge zsh.git/master + +Push the code into pkg-zsh's central repository. + + % git push origin + +Make sure the central repository also has all tags. + + % git push --tags origin + +(*) This step should *always* result in a fast-forward merge. If it +does not, something went terribly wrong. Investigate and fix the +situation *before* pushing to origin. + +### Dealing with quilt's .pc directory + +When quilt works, it keeps track of what it does in a directory by the +name `.pc`. This directory will show up in the output of `git status` +etc. It should *never* *ever* by committed to the git repository at +any point. + +We cannot add the directory to `.gitignore` because we would change +the zsh source directly instead of via `debian/patches`. + +To deal with the directory, there is another git-facility, that we can +use for fun and profit. + + % echo .pc/ >> .git/info/exclude + +Now git will ignore quilt's directory for this repository. +Unfortunately, this has to be done for each checkout. Luckily, this +only has an impact for people who want to work on *pkg-zsh*. Everyone +else can savely ignore the directory. + + +General Git Hints +----------------- + +### Keeping the local repository clean + +Before making changes of any kind, it should be made sure that the +local repository you are working on is in a clean state. To clean up +the local repository do this: + + % git clean -xdf + % git reset --hard + +That will make sure that any non-tracked files are removed and that +any changes in tracked files are reverted. The latter will also make +sure that no parts of a quilt patch-queue are still applied. + + +TODO +==== + +* How and when to tag releases → `gbp buildpackage --git-tag` or even + `gbp buildpackage --git-tag-only` only after the upload has been + uploaded/accepted. +* How and when to push tags. Debian Perl Group's `dpt push` (from the + package `pkg-perl-tools`) comes in handy. +* `git commit -m 'Something unimportant' -m 'Git-Dch: Ignore'` +* `export QUILT_PATCHES=debian/patches` should be mentioned under + *Repository setup*, not under *Verify that the package builds*. +* `* New upstream release` changelog entries should have the git + commit id of the upstream tag. diff -Nru zsh-5.0.5/debian/pkg-zsh-workflow.org zsh-5.0.7/debian/pkg-zsh-workflow.org --- zsh-5.0.5/debian/pkg-zsh-workflow.org 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/pkg-zsh-workflow.org 1970-01-01 00:00:00.000000000 +0000 @@ -1,540 +0,0 @@ -* Branches - - This is a quick overview of the branches that are being used for - debian's zsh package maintenance. This part does not go into much - detail on how the workflow works. For details about that, see the - `Workflow' part below. - - -** upstream - - The upstream sources from . - - -** debian - - The debian changes for the debian `zsh' package. - - -** others - - These branches are rather optional and not required for basic - maintenance for of the `zsh' package. - - -*** master - - This is the old repository's main branch. Kept for historical - reasons. - - -*** debian-beta - - This could basically do *exactly* the same thing as `debian' does, - but just merge more often. Such a branch *could* then be used to - keep the packaging information for `zsh-beta'. - - -* Workflow - - This is a diagram, that outlines the proposed workflow. Basically, - the `debian' branch walks alongside the `upstream' branch and - upstream changes get merged into `debian' at defined points (for the - non-beta zsh package, that should be upstream commit tags). - - -#+BEGIN_EXAMPLE - * debian/4.3.11-4 - | - | * debian/4.3.11-5 - | | - | | * debian/4.3.12-1 - | | | - | | | * debian/4.3.12-2 - | | | | - | | | | * debian/4.3.13-1 - | | | | | - | | | | | * debian/4.3.13-2 - | | | | | | - | | | | | | * debian/4.3.13-3 - | | | | | | | - | | | | | | | - a-b-c-d---e-f-g-h-i-------j-k-l-m-n-o-p `debian' - / / / - A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q `upstream' - | | | - | | | - | | * zsh-4.3.13 - | * zsh-4.3.12 - | - * zsh-4.3.11 -#+END_EXAMPLE - - -** Working on the package - - -*** Changes - - Every change to the source (non-debian-dir) should be done by - adding quilt patches. Permanent patches (patches that would be - kept in 4.3.12-1) should be named specially ("deb_*" comes to - mind). - - To keep order for cases in which a vast number of patches are - required, any quilt patch needs to be numbered according to the - order in which "quilt series" would list them. The format looks - like this: - - - NNNN_.diff - - deb_NNNN_.diff - - Where `N' is a digit from 0 to 9. Counting starts at `0000'. - - Debian-specific (i.e. deb_NNNN_.diff) patches should be - applied after patches targeted towards upstream since the patches - targeted for upstream should not be against debian-specific code. - - Every patch should have a short annotation above the actual - unified diff content, outlining the status of the patch. It is - especially important to know whether a change is already applied - upstream because if so, the patch in question must be dropped - before merging a new upstream release into the `debian' branch. - - -**** Dealing with quilt's .pc directory - - When quilt works, it keeps track of what it does in a directory - by the name `.pc'. This directory will show up in the output of - "git status" etc. It should *never* *ever* by committed to the - git repository at any point. - - We cannot add the directory to `.gitignore' because we would - change the zsh source directly instead of via `debian/patches'. - - To deal with the directory, there is another git-facility, that - we can use for fun and profit. - - % echo .pc/ >> .git/info/exclude - - Now git will ignore quilt's directory for this - repository. Unfortunately, this has to be done for each - checkout. Luckily, this only has an impact for people who want to - work on `pkg-zsh'. Everyone else can savely ignore the directory. - - -**** Example of adding a fix via a quilt patch - - Let's say, there is an issue `#12345' which can be fixed by - patching `Functions/Misc/colors'. Here is how you could add that - patch (assuming clean git working directory and the topmost patch - is 0002-foo.diff): - -#+BEGIN_EXAMPLE - ## First, add all existing non-debian patches, so the new one is - ## added on top. - - % quilt push 0002-foo.diff - - ## Add the new patch (say, the topmost patch is 0002-foo.diff). - % quilt new 0003-fix-colors.diff - - ## Tell quilt which files are going to be changed. - % quilt add Functions/Misc/colors - - ## Import the fix (manually by editor or by patching). - % vi Functions/Misc/colors - - ## Refresh the patch - % quilt refresh - - ## Pop all patches again to clean up the upstream source. - % quilt pop -a - - ## Commit the new patch and the changes `series' file to git. - % git add debian/patches/0003-fix-colors.diff - % git add debian/patches/series - % git commit -a -m'Fixing foo in colors function (Closes: #12345)' -#+END_EXAMPLE - - That's all. - - -**** Cherry-picking patches from upstream into quilt - - When there is an existing patch (e.g. from upstream's git - repository), the above can be largely automated if the patch - applies cleanly to the current state of the debian branch. - - The `./debian/patch2quilt' helper script takes care of that - task. It's called like this: - -#+BEGIN_EXAMPLE - % ./debian/patch2quilt ../existing.diff 0023-new-quilt.diff -#+END_EXAMPLE - - Here "../existing.diff" is the file containing the existing patch - and "0023-new-quilt.diff" is the name of the to-be-added quilt - series patch (make sure its nameing is in line with the - established conventions). - - The exact operation of the script is described at the top of the - script file. There are a few things to keep in mind: - - - At the end of successful operation you are dropped into an - editor which gives you the opportunity to add annotations at - the top of the patch file (like if the patch in question is - included upstream already). - - - Never *ever* run the script when you got uncommitted changes - in the worktree, which you don't plan on losing. The worktree - will be cleaned and reset first thing in the script. - - - As an extension of the previous point, don't put the existing - patch you're planing to import into the git working tree. It - would be wiped away, too. - - - Patches from upstream will likely include changes to the - ChangeLog file. Those changes will probably not apply - cleanly, which will break the scripts execution. Just open - the existing patch and delete all hunks that do changes in - ChangeLog. - - When the script finishes (after you exit your editor), it will - suggest how to commit the newly intoduced patch. Season to taste. - - -**** Keeping the local repository clean - - Before making changes of any kind, it should be made sure that - the local repository you are working on is in a clean state. To - clean up the local repository do this: - -#+BEGIN_EXAMPLE - % git clean -xdf - % git reset --hard -#+END_EXAMPLE - - That will make sure that any non-tracked files are removed and - that any changes in tracked files are reverted. The latter will - also make sure that no parts of a quilt patch-queue are still - applied. - - -*** Releases - - When a change justifies the release of a new package version, the - debian/changelog file should be updated and the resulting commit - should be tagged debian/-n+1. - - -*** Updating debian/changelog - - This file should *not* be updated manually. The changes should be - inserted by running the `git-dch' tool from the package - `git-buildpackage' before a new release is about to be made. - - Changelog entries should be prefixed by a "[hashsum] " string, - where `hashsum' is a string that represents the first eight - characters of commit the changelog entry was generated from. - - Also, if multiple authors are involved in a changelog entry-set, - each author should only appear once in the series with all her/his - changes listed below her/him in chronological order. - - Given that debian/gbp.conf is up-to-date, using the git-dch(1) - tool will result in the desired changelog format: - -#+BEGIN_EXAMPLE - % git-dch -#+END_EXAMPLE - - If you absolutely *must* make changelog entries by other means, you - should make sure that you prefix any resulting commits with - "[dch-ignore] ", so those commits can be weeded out easily. - - There is a helper script "debian/do-dch" which takes care of all - formatting options as well as the "[dch-ignore] " weeding. The - script should be used unless there is a good reason not to. - - -** Transitioning to a new upstream version - - When upstream releases a new version, we should follow these steps: - - -*** Removing non deb_* quilt patches - - All non deb_* patches should be removed from `debian/patches' - directory, unless they fix an issue that was *not* addressed - upstream and is therefore missing from upstream's code base. - - If such a change should prove to be required to be kept with the - package permanently (e.g. because upstream refuses to apply the - patch), the patch should eventually be renamed to match the - "deb_*" nameing convention. - - -*** Merging `upstream' into `debian' - - After the `debian/patches' directory was cleaned up in the - previous step, merging `upstream' into `debian' should generally - lead to a working package again. - - If old patches were still around, that could lead to conflicts - when those would be applied during the build process. - - -*** Insert initial changelog for the new upstream release - - `git-dch' seems to be in trouble with non-linear histories. Therefore - we introduced a small helper script that will help `git-dch' to a - linear history again. - - Basically, you after merging the upstream release tag into the debian - branch, you'll be left with an history that looks something like - this: - -#+BEGIN_EXAMPLE - * at2quilt: Updating autotools patches - M Merge commit 'zsh-4.3.13' into debian - |`* unposted: released 4.3.13 - | * ... - | * ... lots of other upstream commits ... - | * ... - * | Removing upstream patches due to new release - * | Last debian/4.3.12-* commit - * | ... - * | ... lot's of other debian/4.3.12-* commits - * | ... - M´ Merge commit 'zsh-4.3.12' into debian - |`* unposted: released 4.3.12 - ... older history -#+END_EXAMPLE - - And what you really want added to debian/changelog is the "atquilt: - Updating autotools patches" and the "Removing upstream patches due to - new release" commits. You need to figure out the sha1 sums of the - commits and then call this: - -#+BEGIN_EXAMPLE - % ./debian/urcl -p=zsh -v=4.3.13-1 b495ba1e f575f568 -#+END_EXAMPLE - - ...where "4.3.13-1" is the version of the upcoming debian package and - "b495ba1e" and "f575f568" are the sha1 sums of the wanted commits. - - At the end the script will drop you into an editor pointed at the - changelog file so you can sanity-check the generated output. - - At this point it would also make sense to add a line like this: - -#+BEGIN_EXAMPLE - * New upstream release -#+END_EXAMPLE - - or something like this if the release fixes outstanding bugs: - -#+BEGIN_EXAMPLE - * New upstream release (Closes: #1234567890) -#+END_EXAMPLE - - When creating a commit with these changelog changes, make sure you - prefix the commit message with "[dch-ignore] " so it doesn't come up - in later git-dch runs. - - -*** Update debian/gbp.conf - - The debian/gbp.conf file contains a reference pointing to the upstream - branch. Therefore the upstream-branch configuration inside debian/gbp.conf - needs to be adjusted for new upstream releases. - - -*** Fix outstanding bug - - If *any* outstanding bugs are known, they should be fixed before - releasing a new package. Obviously, if any of the known bugs are - very hard to fix and the issue is not serious in nature, releasing - the package with the issue may be more important. - - Again, all changes to non `debian/*' files should be done via - quilt patches. - - -*** Verify that the package builds - -#+BEGIN_EXAMPLE - % git reset --hard - % git clean -xdf - % QUILT_PATCHES=debian/patches - % export QUILT_PATCHES - % quilt push -a - % ./configure - % make all test -#+END_EXAMPLE - - -*** Update changelog again for the release - - The `do-dch' helper script should be used to do this. It wraps - git-dch with appropriate options and weeds out any commits that are - prefixed with "[dch-ignore] ". All options to the script are turned - over to git-dch and at least `--since=...' should be used. - - At this particular point the sha1 of the previous initial changelog - update commit would be a good idea. Also "-R" to tell git-dch to - prepare the changelog for an actual commit. So: - -#+BEGIN_EXAMPLE - % ./debian/do-dch --since=1234deadbeef -R -#+END_EXAMPLE - - You'll be dropped into an editor again to double check the generated - changelog. - - -*** Tag debian/-1 - - After fixes for all serious and trivially fixable issues have been - added and it has been verified that the package builds and `do-dch' - has updated `debian/changelog' and the resulting commit should be - tagged as `debian/-1'. - - -** Generating packages - -*** gitpkg - - `gitpkg' is a simple tool to help generating packages from debian - packages which are maintained in the git version control system. It - works quite well in this workflow. In fact, it works out of the box: - -#+BEGIN_EXAMPLE - % gitpkg debian/4.3.12-5 zsh-4.3.12 -#+END_EXAMPLE - - The first parameter (debian/4.3.12-5) is the debian tag which - points at the debian package version you want to build. The second - parameter is the tag of the upstream version of the corresponding - upstream release (zsh-4.3.12). - - Per default, `gitpkg' generates it's output in - `../deb-packages'. This location is configurable. - - Below directories for individual packages are created and in those, - data for individual package versions are created. For the above - example, this would look like this: - -#+BEGIN_EXAMPLE - ../deb-packages/zsh/ - ../deb-packages/zsh/zsh-4.3.12/ - ../deb-packages/zsh/zsh_4.3.12.orig.tar.gz - ../deb-packages/zsh/zsh_4.3.12-5.debian.tar.gz - ../deb-packages/zsh/zsh_4.3.12-5.dsc -#+END_EXAMPLE - - You may now change to `../deb-packages/zsh/zsh-4.3.12/' and build - binary package using `dpkg-buildpackage', `debuild' or the like. - - `gitpkg' is available as Debian package or from: - - - -*** git-buildpackage - - Alternatively, `git-buildpackage' also provides ways of building - packages from our packaging codebase. And since we are using the - `git-dch' tool from this utility suite anyway, the tool should be - available already. - - `git-buildpackage' allows building the package from within the - package repository: - -#+BEGIN_EXAMPLE - % git-buildpackage --debian-branch=debian -#+END_EXAMPLE - - Make sure that the local repository is cleaned up after doing this - before working on the package again, to avoid accidentially - committing anything. See "Cleaning up the local repository" above - for details. - - `git-buildpackage' is available as Debian package or from: - - - - -** Git repository setup - - Getting the basic pkg-zsh git repository is quite easy. If you want - a read only clone, use this: - -#+BEGIN_EXAMPLE - % git clone git://git.debian.org/collab-maint/zsh.git pkg-zsh -#+END_EXAMPLE - - If you are reading this, though, you probably want write access. To - get a thusly cloned repository, first get an alioth login and - upload an ssh-public key. As soon as the key made it to all - involved machines, use this: - -#+BEGIN_EXAMPLE - % git clone ssh://@git.debian.org/git/collab-maint/zsh.git pkg-zsh -#+END_EXAMPLE - - Where `' is your alioth login. (Note, that this may be - something with a `-guest' suffix, in case you're not a debian - developer.) - -*** Branches - - Like described earlier, pkg-zsh development involves two branches; - `debian' and `upstream'. The former is checked out by default for - freshly cloned repositories. To get a local version of the - `upstream' branch, use: - -#+BEGIN_EXAMPLE - % git checkout -b upstream origin/upstream -#+END_EXAMPLE - - This is useful to update the remote upstream branch with ongoing - development from the zsh project. - -*** Remotes - - There is one remote repository with direct interest for pkg-zsh, - and that is the zsh project's git repository. Currently, this is - only a mirror of the project's cvs repository. But it is updated - every ten minutes by one of zsh's developers. (Also note, that - there has been a brief discussion about whether git may become the - official VCS for git after a bigger future release.) - - In order to have zsh's ongoing development available from within - your pkg-zsh repository, do this: - -#+BEGIN_EXAMPLE - % git remote add zsh.git git://zsh.git.sf.net/gitroot/zsh/zsh -t master - % git fetch zsh.git -#+END_EXAMPLE - -*** Merging and pushing upstream changes - - To get updates back into origin/upstream, do this: - -#+BEGIN_EXAMPLE - ## Get the latest updates. - % git fetch zsh.git - ## Switch to the local `upstream' branch for integration. - % git checkout upstream - ## Merge upstream's changes (*). - % git merge zsh.git/master - ## Push the code into pkg-zsh's central repository. - % git push origin - ## Make sure the central repository also has all tags. - % git push --tags origin - - (*) This step should *always* result in a fast-forward merge. If - it does not, something went terribly wrong. Investigate and - fix the situation *before* pushing to origin. -#+END_EXAMPLE diff -Nru zsh-5.0.5/debian/README.Debian zsh-5.0.7/debian/README.Debian --- zsh-5.0.5/debian/README.Debian 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/README.Debian 2014-12-06 18:25:17.000000000 +0000 @@ -1,10 +1,16 @@ Zsh for Debian -------------- +You may find more uptodate information about Debian's zsh packages at +https://wiki.debian.org/Zsh + + -- Axel Beckert , Mon, 20 Oct 2014 14:40:42 +0200 + This version of zsh has been compiled with support for maildir folders in MAIL and MAILPATH. - -- Clint Adams + -- Clint Adams + How to use the zsh-dbg package ------------------------------ @@ -30,7 +36,7 @@ Now you can use the usual gdb commands like step / continue / ... to debug the Zsh process at source level. - -- Michael Prokop + -- Michael Prokop Load-path for functions from other packages diff -Nru zsh-5.0.5/debian/README.source zsh-5.0.7/debian/README.source --- zsh-5.0.5/debian/README.source 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/README.source 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,77 @@ +The Debian Zsh Package +====================== + +Debian's zsh package is team-maintained. This document describes some +of the resources the team uses. + +Versioning Control System +------------------------- + +The Debian Zsh Team uses a collab-maint Git repository on Alioth for +collaboratively maintaining the packaging code. The packaging lives in +the branch `debian`. + +* Web-based repository viewer: https://anonscm.debian.org/cgit/collab-maint/zsh.git +* Anonymous clone: `git clone -b debian git://anonscm.debian.org/collab-maint/zsh.git` +* Cloning via SSH: `git clone -b debian git.debian.org:/git/collab-maint/zsh.git` + +The `master` branch in this Git repository is ancient and just exists +for historical reasons. + +Workflow +-------- + +The workflow for working on the package is documented in +`debian/pkg-zsh-workflow.md`. + +Continuous Integration +---------------------- + +After every push, zsh packages are built by the Jenkins instance at +http://jenkins.grml.org/view/Debian/. + +### Jenkins-built zsh via APT + +You can install the Jenkins-built zsh packages by adding the following +lines to your `sources.list`: + + deb http://jenkins.grml.org/debian zsh main + deb-src http://jenkins.grml.org/debian zsh main + +You will need to import the GPG key of Grml's Jenkins instance into +APT. See http://jenkins.grml.org/view/Debian/job/zsh-binaries/ for +instructions and the current key id. + +Communication +------------- + +### IRC + +Usually all active team members are gathered in #pkg-zsh on Freenode +(irc.freenode.net). + +Feel free to join, but be patient when waiting for answers. May take a +couple of hours until someone answers -- depending on your timezone +and the current weekday. + +The channel is bi-lingual English and German as (by coincidence) all +active team members have German as mother tongue. So feel free to ask +questions in German. We though usually switch to English if someone +joins the channel who doesn't speak German (well). + +### Mailing Lists + +The priamry mailing list is pkg-zsh-devel@lists.alioth.debian.org. + +* Subscribe/unsubscribe at + https://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-zsh-devel +* Archive at https://lists.alioth.debian.org/pipermail/pkg-zsh-devel/ + +There's a secondary mailing list to which all git commits are sent to: +pkg-zsh-commits@lists.alioth.debian.org. + +* Subscribe/unsubscribe at + https://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-zsh-commits +* Archive at https://lists.alioth.debian.org/pipermail/pkg-zsh-devel/ + + -- Axel Beckert , Wed, 8 Oct 2014 23:33:12 +0200 diff -Nru zsh-5.0.5/debian/rules zsh-5.0.7/debian/rules --- zsh-5.0.5/debian/rules 2014-07-07 12:27:48.000000000 +0000 +++ zsh-5.0.7/debian/rules 2014-12-06 18:26:41.000000000 +0000 @@ -2,6 +2,12 @@ INSTALL = install INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +# Disable -fstack-protector-strong on s390x as it causes endless loops +# in gcc-4.9. See https://bugs.debian.org/759870 for details +ifeq (s390x,$(shell dpkg-architecture -qDEB_BUILD_ARCH)) +export DEB_BUILD_MAINT_OPTIONS=hardening=-stackprotectorstrong +endif + DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/architecture.mk @@ -48,7 +54,7 @@ build-arch: configure-stamp dh_auto_build -B obj --parallel if dpkg-architecture -qDEB_BUILD_ARCH_OS | grep -qv hurd; then \ - HOME="$(CURDIR)/obj/testhome" dh_auto_test -B obj --parallel; \ + HOME="$(CURDIR)/obj/testhome" ZTST_verbose=1 dh_auto_test -B obj --parallel; \ fi touch $@ @@ -59,7 +65,7 @@ build-static: configure-static-stamp dh_testdir dh_auto_build -B obj-static --parallel - HOME="$(CURDIR)/obj-static/testhome" dh_auto_test -B obj-static --parallel || true + #HOME="$(CURDIR)/obj-static/testhome" ZTST_verbose=1 dh_auto_test -B obj-static --parallel || true touch $@ build-debug: DEB_BUILD_OPTIONS+=debug @@ -67,6 +73,7 @@ configure: touch stamp-h.in + dh_autotools-dev_updateconfig dh_autoreconf dh_autotools-dev_updateconfig @@ -90,6 +97,7 @@ dh_testdir dh_autotools-dev_restoreconfig dh_autoreconf_clean + dh_autotools-dev_restoreconfig rm -f build build-static dh_auto_clean -B obj --parallel dh_auto_clean -B obj-static --parallel @@ -179,7 +187,8 @@ -dDepends debian/zsh/bin/* \ -dRecommends debian/zsh/usr/lib/*/zsh/*/zsh/*.so - dh_installdocs -pzsh -pzsh-dbg --link-doc=zsh-common + dh_installdocs -pzsh -pzsh-dbg --link-doc=zsh + dh_installchangelogs -pzsh binary-arch-static: build-static dh_testdir @@ -189,7 +198,8 @@ # Do not symlink /usr/share/doc/zsh-static to # /usr/share/doc/zsh-common because zsh-static has a unique, - # generated README.Debian + # generated README.Debian, and because --link-doc between + # arch-dep and arch-indep packages breaks binNMUs dh_installdocs -pzsh-static awk 'BEGIN { print "The following modules are statically-compiled into the static zsh binary:\n"; } /link=static/ { printf "%s (%s %s)\n", substr($$1,6), $$4, $$5; }' obj-static/config.modules >debian/zsh-static/usr/share/doc/zsh-static/README.Debian @@ -197,7 +207,9 @@ dh_install -pzsh-static dh_strip -pzsh-static - mv debian/zsh-static/bin/zsh debian/zsh-static/bin/zsh5-static + mv debian/zsh-static/bin/zsh debian/zsh-static/bin/zsh5-static + mv debian/zsh-static/bin/zsh4 debian/zsh-static/bin/zsh4-static + sed -e 's:#!/bin/zsh5:#!/bin/zsh5-static:' -i debian/zsh-static/bin/zsh4-static dh_installchangelogs -pzsh-static @@ -210,7 +222,8 @@ cd debian/zsh-dev/usr/share/aclocal; mv aczshoot.m4 zshoot.m4 - dh_installdocs -pzsh-dev --link-doc=zsh-common + dh_installdocs -pzsh-dev + dh_installchangelogs -pzsh-dev binary-arch: binary-arch-dynamic binary-arch-static binary-arch-dev dh_lintian -a @@ -235,4 +248,9 @@ sed -i 's/\(^Doc.*\)/#\1/;s/\(^META-FAQ\)/#\1/' debian/clean ./debian/rules clean -.PHONY: binary binary-arch binary-indep clean binary-arch-dynamic binary-arch-static prebuild binary-arch-dev +get-orig-source: version=$(shell git describe --tags --abbrev=0 --match='zsh-*' | sed -e 's/^zsh-//') +get-orig-source: + git archive --format=tar --output=../zsh_$(version).orig.tar --prefix=zsh-$(version)/ zsh-$(version) + xz -7v ../zsh_$(version).orig.tar + +.PHONY: binary binary-arch binary-indep clean binary-arch-dynamic binary-arch-static binary-arch-dev get-orig-source diff -Nru zsh-5.0.5/debian/tests/adequate zsh-5.0.7/debian/tests/adequate --- zsh-5.0.5/debian/tests/adequate 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/tests/adequate 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,6 @@ +#!/bin/sh + +# Very simple test to run adequate on all zsh packages. To be used with +# Debian's autopkgtest package. Author: Axel Beckert + +adequate `awk '$1 == "Package:" {print $2}' < debian/control` >&2 diff -Nru zsh-5.0.5/debian/tests/control zsh-5.0.7/debian/tests/control --- zsh-5.0.5/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/tests/control 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,5 @@ +Tests: run-testsuite +Depends: zsh + +Tests: adequate +Depends: @, adequate diff -Nru zsh-5.0.5/debian/tests/run-testsuite zsh-5.0.7/debian/tests/run-testsuite --- zsh-5.0.5/debian/tests/run-testsuite 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/tests/run-testsuite 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,58 @@ +#!/bin/sh + +set -e + +# Run zsh's test suite on installed zsh +# +# Code based upon check/test target in Test/Makefile.in + +#if test -n "$(DLLD)"; then +# cd $(dir_top) && DESTDIR= $(MAKE) MODDIR=`pwd`/$(subdir)/Modules install.modules +#fi + +if [ -z "$ADTTMP" -o ! -d "$ADTTMP" ]; then + echo '$ADTTMP ("'"$ADTTMP"'") is not set or not a directory' 1>&2 + exit 2 +fi + +ZTST_testdir="$ADTTMP/Test" +export ZTST_testdir + +cp -pvr Test "$ZTST_testdir" +cp -pvr Misc "$ADTTMP/Misc" +cd "$ADTTMP" + +ln -vfs /usr/lib/*/zsh/*.*.* "$ZTST_testdir/Modules" +ln -vfs /usr/share/zsh/functions Functions +ln -vfs /usr/share/zsh/functions/Completion . +mkdir -pv Src +for f in /bin/zsh*; do + ln -vfs "$f" Src/ +done + +cd "$ZTST_testdir" + +# For now skip a bunch of tests which require artefacts from the build +# config.modules maybe mocked by creating it from the installed modules. +rm -v V01zmodload.ztst + +# Drop explicit fpath setting from some files +for f in ztst.zsh comptest; do + perl -E 'local $/; my $code = <>; $code =~ s{\n *fpath=\(.*?\n\n}{\n\n}s; print $code' -i $f +done + +ZTST_testlist="`for f in $ZTST_testdir/$TESTNUM*.ztst; do echo $f; done`" \ +ZTST_srcdir="$ZTST_testdir" +ZTST_exe=/bin/zsh +export ZTST_testlist +export ZTST_srcdir +export ZTST_exe + +if "$ZTST_exe" +Z -f "$ZTST_testdir/runtests.zsh"; then + stat=0 +else + stat=1 +fi +sleep 1 +rm -rf Modules .zcompdump +exit $stat diff -Nru zsh-5.0.5/debian/TODO.md zsh-5.0.7/debian/TODO.md --- zsh-5.0.5/debian/TODO.md 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/TODO.md 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,14 @@ +Debian Zsh TODO +=============== + +After the Jessie-Release +------------------------ + +* Remove zsh-beta* packages +* Remove alternatives system properly +* Remove zsh4* wrappers + +Decisions +--------- + +* Do we want to continue providing a static build (zsh-static)? diff -Nru zsh-5.0.5/debian/urcl zsh-5.0.7/debian/urcl --- zsh-5.0.5/debian/urcl 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/urcl 1970-01-01 00:00:00.000000000 +0000 @@ -1,102 +0,0 @@ -#!/bin/sh -# -# Seems like `git-dch' doesn't work well with non-linear histories. With -# pkg-zsh we do have merges everytime an upstream release is done. That's -# where "Upstream Release ChangeLog" comes into play. It takes a set of -# commit hashes and produces an initial changelog update for those -# situations in which an upstream release tag was merged. After that, -# the situation can be reduced to a linear history again and `git-dch' -# will do just fine. -# -# This script is pretty dumb, so some manual adjustments might be needed -# for "debian/changelog". - -if [ $# = 0 ]; then - printf 'usage: urcl [OPTIONS] \n\n' - printf 'Options:\n\n' - printf ' -n="..." Full name to be used for the changelog entry. (Defaults\n' - printf ' to "$DEBFULLNAME".)\n' - printf ' -m="..." Email address for the changelog entry. (Defaults to\n' - printf ' "$DEBEMAIL".)\n' - printf ' -p="..." Package name to use. (Defaults to "$PACKAGE".)\n' - printf ' -v="..." Version number to use. (Defaults to "$VERSION".)\n' - printf '\n' - exit 0 -fi - -case "$1" in - -*) isopt=1;; - *) isopt=0;; -esac - -while [ "$#" -gt 0 ] && [ "$isopt" = 1 ]; do - case "$1" in - -n=*) who="${1#-n=}" ;; - -m=*) ewho="${1#-m=}" ;; - -p=*) PACKAGE="${1#-p=}" ;; - -v=*) VERSION="${1#-v=}" ;; - -*) - printf 'Unknown option `%s'\''\n.' "$1" - ;; - esac - shift - case "$1" in - -*) isopt=1;; - *) isopt=0;; - esac -done - -if [ x"$who" = x ]; then - if [ x"$DEBFULLNAME" = x ]; then - printf '`$DEBFULLNAME'\'' is empty use -n=...\n' - exit 1 - fi - who=$DEBFULLNAME -fi -if [ x"$ewho" = x ]; then - if [ x"$DEBEMAIL" = x ]; then - printf '`$DEBEMAIL'\'' is empty use -m=...\n' - exit 1 - fi - ewho=$DEBEMAIL -fi - -if [ x"$PACKAGE" = x ]; then - printf '`$PACKAGE'\'' is empty use -p=...\n' - exit 1 -fi - -if [ x"$VERSION" = x ]; then - printf '`$VERSION'\'' is empty use -v=...\n' - exit 1 -fi - -DATE=$(date -R) - -ours="debian/changelog.urcl" -theirs="debian/changelog.old" -cl="debian/changelog" - -xecho () { - printf '%s\n' "$@" >> "$ours" -} - -rm -f "$ours" "$theirs" - -xecho "$PACKAGE ($VERSION) UNRELEASED; urgency=low" -xecho - -for rev; do - data=$(git log -1 --abbrev=8 --pretty=format:' * [%h] %s' "$rev") - [ $? = 0 ] && xecho "$data" -done - -xecho -xecho " -- ${who} <${ewho}> $DATE" -xecho - -cp "$cl" "$theirs" -cat "$ours" > "$cl" -cat "$theirs" >> "$cl" -rm -f "$ours" "$theirs" -${VISUAL:-${EDITOR:-vi}} "$cl" diff -Nru zsh-5.0.5/debian/zsh4 zsh-5.0.7/debian/zsh4 --- zsh-5.0.5/debian/zsh4 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh4 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,26 @@ +#!/bin/zsh5 -f + +# This wrapper's sole purpose is to ease the migration of zsh's binary +# location from /bin/zsh4 to /bin/zsh5 between Debian Wheezy and Jessie. +# +# See https://bugs.debian.org/707760 for reasoning, details and +# discussion. + +if [[ "$0" == *zsh4* ]]; then + static='' + if [[ "$0" == *static* ]]; then + static=-static + fi + + echo "" + echo " ####" + echo " #### $0 is deprecated, please switch to /bin/zsh${static} (or /usr/bin/zsh)" + if [[ "$1" == "-l" || "$0" == -* ]]; then + echo ' #### Use "chsh -s '"/bin/zsh${static}"'" to change your login shell' + fi + echo " #### This command ($0) will disappear eventually!" + echo " ####" + echo "" +fi 1>&2 + +exec "/bin/zsh5${static}" "$@" diff -Nru zsh-5.0.5/debian/zsh.bug-script zsh-5.0.7/debian/zsh.bug-script --- zsh-5.0.5/debian/zsh.bug-script 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh.bug-script 2014-12-06 18:25:17.000000000 +0000 @@ -3,20 +3,36 @@ exec 1>&3 exec 2>&3 +list_packages() { + text="$1" + shift + if [ -n "$1" ]; then + printf "$text:\n\n" + dpkg-query -l "$@" + if [ -x /usr/bin/debsums ]; then + FILES="$(debsums -ce "$@")" + if [ -n "$FILES" ]; then + printf "\nThe following files were modified:\n\n$FILES\n" + fi + fi + fi + printf "\n" +} + if [ -x /usr/bin/aptitude ]; then - echo "*** Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc ***" - aptitude -q search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i' + TEXT="Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc" + PKGS=$(aptitude -q -F '%p' search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i') else - echo "*** Packages which provide code meant to be sourced in .zshrc ***" + TEXT="Packages which provide code meant to be sourced in .zshrc" # Hardcoded list of (future) packages containing code meant to be # sourced in .zshrc - dpkg-query -l fizsh oh-my-zsh zsh-antigen autojump zec 'grml-*' + PKGS=$(dpkg-query -W -f '${Package}\n' fizsh oh-my-zsh zsh-antigen autojump zec python-powerline command-not-found environment-modules 'grml-*' 2>/dev/null) fi -echo "" -echo "*** Packages which provide vendor completions ***" -dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "$TEXT" $PKGS + +list_packages "Packages which provide vendor completions" \ +$(dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g') -echo "" -echo "*** Packages which provide vendor functions ***" -dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "Packages which provide vendor functions" \ +$(dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g') diff -Nru zsh-5.0.5/debian/zsh-common.bug-script zsh-5.0.7/debian/zsh-common.bug-script --- zsh-5.0.5/debian/zsh-common.bug-script 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-common.bug-script 2014-12-06 18:25:17.000000000 +0000 @@ -3,20 +3,36 @@ exec 1>&3 exec 2>&3 +list_packages() { + text="$1" + shift + if [ -n "$1" ]; then + printf "$text:\n\n" + dpkg-query -l "$@" + if [ -x /usr/bin/debsums ]; then + FILES="$(debsums -ce "$@")" + if [ -n "$FILES" ]; then + printf "\nThe following files were modified:\n\n$FILES\n" + fi + fi + fi + printf "\n" +} + if [ -x /usr/bin/aptitude ]; then - echo "*** Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc ***" - aptitude -q search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i' + TEXT="Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc" + PKGS=$(aptitude -q -F '%p' search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i') else - echo "*** Packages which provide code meant to be sourced in .zshrc ***" + TEXT="Packages which provide code meant to be sourced in .zshrc" # Hardcoded list of (future) packages containing code meant to be # sourced in .zshrc - dpkg-query -l fizsh oh-my-zsh zsh-antigen autojump zec 'grml-*' + PKGS=$(dpkg-query -W -f '${Package}\n' fizsh oh-my-zsh zsh-antigen autojump zec python-powerline command-not-found environment-modules 'grml-*' 2>/dev/null) fi -echo "" -echo "*** Packages which provide vendor completions ***" -dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "$TEXT" $PKGS + +list_packages "Packages which provide vendor completions" \ +$(dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g') -echo "" -echo "*** Packages which provide vendor functions ***" -dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "Packages which provide vendor functions" \ +$(dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g') diff -Nru zsh-5.0.5/debian/zsh-common.install zsh-5.0.7/debian/zsh-common.install --- zsh-5.0.5/debian/zsh-common.install 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-common.install 2014-12-06 18:25:17.000000000 +0000 @@ -1,6 +1,6 @@ +debian/newuser.zshrc.recommended etc/zsh debian/zlogin etc/zsh debian/zlogout etc/zsh debian/zprofile etc/zsh debian/zshenv etc/zsh debian/zshrc etc/zsh -debian/newuser.zshrc.recommended etc/zsh diff -Nru zsh-5.0.5/debian/zsh-common.maintscript zsh-5.0.7/debian/zsh-common.maintscript --- zsh-5.0.5/debian/zsh-common.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh-common.maintscript 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1 @@ +symlink_to_dir /usr/share/doc/zsh zsh-common 5.0.7-3 diff -Nru zsh-5.0.5/debian/zsh-dev.install zsh-5.0.7/debian/zsh-dev.install --- zsh-5.0.5/debian/zsh-dev.install 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-dev.install 2014-12-06 18:25:17.000000000 +0000 @@ -1,10 +1,10 @@ -obj/Src/*.epro usr/include/zsh -obj/Src/sigcount.h usr/include/zsh +Config/aczshoot.m4 usr/share/aclocal Src/hashtable.h usr/include/zsh +Src/makepro.awk usr/share/zsh-dev Src/prototypes.h usr/include/zsh Src/signals.h usr/include/zsh -Src/zsh_system.h usr/include/zsh Src/zsh.h usr/include/zsh +Src/zsh_system.h usr/include/zsh Src/ztype.h usr/include/zsh -Src/makepro.awk usr/share/zsh-dev -Config/aczshoot.m4 usr/share/aclocal +obj/Src/*.epro usr/include/zsh +obj/Src/sigcount.h usr/include/zsh diff -Nru zsh-5.0.5/debian/zsh-dev.maintscript zsh-5.0.7/debian/zsh-dev.maintscript --- zsh-5.0.5/debian/zsh-dev.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh-dev.maintscript 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1 @@ +symlink_to_dir /usr/share/doc/zsh-dev zsh-common 5.0.7-3 diff -Nru zsh-5.0.5/debian/zsh.install zsh-5.0.7/debian/zsh.install --- zsh-5.0.5/debian/zsh.install 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh.install 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1 @@ +debian/zsh4 bin diff -Nru zsh-5.0.5/debian/zsh.links zsh-5.0.7/debian/zsh.links --- zsh-5.0.5/debian/zsh.links 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh.links 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1,3 @@ +/usr/share/doc/zsh-common/changelog.gz /usr/share/doc/zsh/changelog.gz +/usr/share/doc/zsh-common/examples /usr/share/doc/zsh/examples +/usr/share/doc/zsh-common /usr/share/doc/zsh/doc diff -Nru zsh-5.0.5/debian/zsh.lintian-overrides zsh-5.0.7/debian/zsh.lintian-overrides --- zsh-5.0.5/debian/zsh.lintian-overrides 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh.lintian-overrides 2014-12-06 18:25:17.000000000 +0000 @@ -2,3 +2,6 @@ zsh: hardening-no-fortify-functions usr/lib*/zsh/*/zsh/zleparameter.so # False positive zsh: spelling-error-in-binary usr/lib/*/zsh/*/zsh/zle.so tEH the +# Just a migration wrapper which is not meant to be used +zsh: binary-without-manpage bin/zsh4 +zsh: unusual-interpreter bin/zsh4 #!/bin/zsh5 diff -Nru zsh-5.0.5/debian/zsh.maintscript zsh-5.0.7/debian/zsh.maintscript --- zsh-5.0.5/debian/zsh.maintscript 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/debian/zsh.maintscript 2014-12-06 18:25:17.000000000 +0000 @@ -0,0 +1 @@ +symlink_to_dir /usr/share/doc/zsh zsh-common 5.0.7-3 diff -Nru zsh-5.0.5/debian/zsh.postinst zsh-5.0.7/debian/zsh.postinst --- zsh-5.0.5/debian/zsh.postinst 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh.postinst 2014-12-06 18:25:17.000000000 +0000 @@ -21,10 +21,12 @@ update-alternatives --remove zsh /usr/bin/zsh update-alternatives --remove ksh /usr/bin/zsh update-alternatives --remove ksh /bin/zsh4 -update-alternatives --install /bin/zsh zsh /bin/zsh5 50 \ +update-alternatives --install /bin/zsh zsh /bin/zsh5 51 \ --slave /usr/bin/zsh zsh-usrbin /bin/zsh5 -update-alternatives --install /bin/rzsh rzsh /bin/zsh5 50 \ +update-alternatives --install /bin/rzsh rzsh /bin/zsh5 51 \ --slave /usr/share/man/man1/rzsh.1.gz rzsh.1.gz /usr/share/man/man1/zsh.1.gz +update-alternatives --remove zsh /bin/zsh4 +update-alternatives --remove rzsh /bin/zsh4 # Replace documentation directory with symlink docdir="/usr/share/doc/zsh" diff -Nru zsh-5.0.5/debian/zsh-static.bug-script zsh-5.0.7/debian/zsh-static.bug-script --- zsh-5.0.5/debian/zsh-static.bug-script 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-static.bug-script 2014-12-06 18:25:17.000000000 +0000 @@ -3,20 +3,36 @@ exec 1>&3 exec 2>&3 +list_packages() { + text="$1" + shift + if [ -n "$1" ]; then + printf "$text:\n\n" + dpkg-query -l "$@" + if [ -x /usr/bin/debsums ]; then + FILES="$(debsums -ce "$@")" + if [ -n "$FILES" ]; then + printf "\nThe following files were modified:\n\n$FILES\n" + fi + fi + fi + printf "\n" +} + if [ -x /usr/bin/aptitude ]; then - echo "*** Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc ***" - aptitude -q search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i' + TEXT="Packages which depend, recommend, suggest or enhance a zsh package and hence may provide code meant to be sourced in .zshrc" + PKGS=$(aptitude -q -F '%p' search '( ?enhances(?name(^zsh)) | ?depends(?name(^zsh)) | ?recommends(?name(^zsh)) | ?suggests(?name(^zsh)) ) !?source-package(^zsh$) ~i') else - echo "*** Packages which provide code meant to be sourced in .zshrc ***" + TEXT="Packages which provide code meant to be sourced in .zshrc" # Hardcoded list of (future) packages containing code meant to be # sourced in .zshrc - dpkg-query -l fizsh oh-my-zsh zsh-antigen autojump zec 'grml-*' + PKGS=$(dpkg-query -W -f '${Package}\n' fizsh oh-my-zsh zsh-antigen autojump zec python-powerline command-not-found environment-modules 'grml-*' 2>/dev/null) fi -echo "" -echo "*** Packages which provide vendor completions ***" -dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "$TEXT" $PKGS + +list_packages "Packages which provide vendor completions" \ +$(dpkg-query -S /usr/share/zsh/vendor-completions/ | awk -F: '{print $1}' | sed -e 's/,//g') -echo "" -echo "*** Packages which provide vendor functions ***" -dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g' | xargs -r dpkg-query -l +list_packages "Packages which provide vendor functions" \ +$(dpkg-query -S /usr/share/zsh/vendor-functions/ | awk -F: '{print $1}' | sed -e 's/,//g') diff -Nru zsh-5.0.5/debian/zsh-static.install zsh-5.0.7/debian/zsh-static.install --- zsh-5.0.5/debian/zsh-static.install 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-static.install 2014-12-06 18:25:17.000000000 +0000 @@ -1 +1,2 @@ obj-static/Src/zsh bin +debian/zsh4 bin diff -Nru zsh-5.0.5/debian/zsh-static.lintian-overrides zsh-5.0.7/debian/zsh-static.lintian-overrides --- zsh-5.0.5/debian/zsh-static.lintian-overrides 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-static.lintian-overrides 2014-12-06 18:25:17.000000000 +0000 @@ -3,3 +3,6 @@ zsh-static: package-contains-broken-symlink usr/share/man/man1/zsh5-static.1.gz zsh.1.gz # False positive zsh-static: spelling-error-in-binary bin/zsh5-static tEH the +# Just a migration wrapper which is not meant to be used +zsh-static: binary-without-manpage bin/zsh4-static +zsh-static: unusual-interpreter bin/zsh4-static #!/bin/zsh5-static diff -Nru zsh-5.0.5/debian/zsh-static.postinst zsh-5.0.7/debian/zsh-static.postinst --- zsh-5.0.5/debian/zsh-static.postinst 2014-07-07 11:01:51.000000000 +0000 +++ zsh-5.0.7/debian/zsh-static.postinst 2014-12-06 18:25:17.000000000 +0000 @@ -19,7 +19,8 @@ ;; esac -update-alternatives --install /bin/zsh-static zsh-static /bin/zsh5-static 40 +update-alternatives --install /bin/zsh-static zsh-static /bin/zsh5-static 41 +update-alternatives --remove zsh-static /bin/zsh4-static #DEBHELPER# diff -Nru zsh-5.0.5/.distfiles zsh-5.0.7/.distfiles --- zsh-5.0.5/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,8 +1,4 @@ DISTFILES_SRC=' - .cvsignore .distfiles .editorconfig .gitignore .preconfig Makefile.in - ChangeLog - FEATURES INSTALL LICENCE MACHINES META-FAQ NEWS README - aclocal.m4 aczsh.m4 configure.ac + META-FAQ configure config.h.in stamp-h.in - config.guess config.sub install-sh mkinstalldirs ' diff -Nru zsh-5.0.5/Doc/.distfiles zsh-5.0.7/Doc/.distfiles --- zsh-5.0.5/Doc/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,11 +1,5 @@ DISTFILES_SRC=' - .cvsignore .distfiles Makefile.in - META-FAQ.yo intro.ms - version.yo zmacros.yo zman.yo ztexi.yo - zsh.yo zshbuiltins.yo zshcalsys.yo - zshcompctl.yo zshcompsys.yo zshcompwid.yo - zshexpn.yo zshmisc.yo zshmodules.yo zshoptions.yo zshparam.yo - zshroadmap.yo zshzftpsys.yo zshzle.yo zshcontrib.yo zshtcpsys.yo + version.yo zsh.texi zsh.1 zshbuiltins.1 zshcalsys.1 zshcompctl.1 zshcompsys.1 zshcompwid.1 zshexpn.1 diff -Nru zsh-5.0.5/Doc/help/.distfiles zsh-5.0.7/Doc/help/.distfiles --- zsh-5.0.5/Doc/help/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/help/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,5 +1,3 @@ DISTFILES_SRC=' - .cvsignore - .distfiles [_a-zA-Z0-9]* ' diff -Nru zsh-5.0.5/Doc/Makefile.in zsh-5.0.7/Doc/Makefile.in --- zsh-5.0.5/Doc/Makefile.in 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Makefile.in 2014-10-07 18:11:30.000000000 +0000 @@ -41,7 +41,8 @@ MAKEINFO = makeinfo TEXI2DVI = texi2dvi DVIPS = dvips -TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files +TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files \ + --init-file texi2html.conf .SUFFIXES: .yo .1 @@ -118,8 +119,10 @@ .PHONY: texi $(sdir)/zsh.texi: version.yo - $(YODL) -o $@ -I$(sdir) -w ztexi.yo version.yo zsh.yo; \ - test -f $@ + case '$(YODL)' in :*) touch $@ ;; *) \ + $(YODL) -o $@ -I$(sdir) -w ztexi.yo version.yo zsh.yo; \ + test -f $@ \ + ;; esac info: zsh.info .PHONY: info @@ -159,7 +162,7 @@ html: zsh_toc.html .PHONY: html -zsh_toc.html: $(sdir)/zsh.texi +zsh_toc.html: $(sdir)/zsh.texi texi2html.conf $(TEXI2HTML) $(sdir)/zsh.texi zshall.1: zsh.yo @@ -191,7 +194,8 @@ @-rm -f $(sdir)/help.txt $(sdir)/help/* perl $(sdir_top)/Util/helpfiles \ $(sdir)/zshbuiltins.1 $(sdir)/help $(sdir)/help.txt \ - || { rm -f $(sdir)/help.txt $(sdir)/help/*; false; } + || rm -f $(sdir)/help.txt $(sdir)/help/* + touch $(sdir)/$@ $(MAN): zmacros.yo zman.yo @@ -247,6 +251,10 @@ echo 'IFDEF(DECWSLEVEL)(DECWSLEVEL())(ENDDEF())#' | tr '#' '\\'; \ ) > $(sdir)/version.yo +texi2html.conf: $(sdir_top)/Config/version.mk + echo '$$PRE_BODY_CLOSE = "Zsh version $(VERSION), released on $(VERSION_DATE).";' \ + > $@ + Zsh/modlist.yo: $(MODDOCSRC) ( \ echo "startitem()"; \ @@ -387,6 +395,7 @@ rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.log rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs rm -rf infodir + rm -f texi2html.conf .PHONY: clean-here distclean-here: clean-here diff -Nru zsh-5.0.5/Doc/zman.yo zsh-5.0.7/Doc/zman.yo --- zsh-5.0.5/Doc/zman.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/zman.yo 2014-10-07 18:11:30.000000000 +0000 @@ -69,7 +69,7 @@ COMMENT(--- the "" works around a yodl bug in versions before 2 ---) def(sect)(1)(\ IFDEF(INCWSLEVEL)(\ - NOTRANS(.SH )"UPPERCASE(ARG1)(0)"+NL()\ + NOTRANS(.SH )"UPPERCASE(NOTRANS(ARG1))(0)"+NL()\ )(\ NOTRANS(.SH )UPPERCASE(ARG1)(0)""+NL()\ )\ @@ -110,7 +110,7 @@ def(enditem)(0)(\ ENDITEM()\ STDPAR()\ - +redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR())\ + +redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR()redef(ENDITEM)(0)(CMT()))\ ) def(item)(2)(\ NOTRANS(.TP)+NL()\ @@ -121,7 +121,7 @@ +redef(PARAGRAPH)(0)(\ NL()NOTRANS(.RS)+NL()NOTRANS(.PP)+NL()\ STDPAR()\ - +redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR())\ + +redef(ENDITEM)(0)(NOTRANS(.RE)STDPAR()redef(ENDITEM)(0)(CMT()))\ )\ ARG2\ +ENDITEM()\ diff -Nru zsh-5.0.5/Doc/Zsh/arith.yo zsh-5.0.7/Doc/Zsh/arith.yo --- zsh-5.0.5/Doc/Zsh/arith.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/arith.yo 2014-10-07 18:11:30.000000000 +0000 @@ -76,6 +76,27 @@ implicitly typed by the arithmetic evaluation, where it acquires the output base 8. +The var(base) may be replaced or followed by an underscore, which may +itself be followed by a positive integer (if it is missing the value 3 +is used). This indicates that underscores should be inserted into the +output string, grouping the number for visual clarity. The following +integer specifies the number of digits to group together. For example: + +example(setopt cbases +print $(( [#16_4] 65536 ** 2 ))) + +outputs `tt(0x1_0000_0000)'. + +The feature can be used with floating +point numbers, in which case the base must be omitted; grouping +is away from the decimal point. For example, + +example(zmodload zsh/mathfunc +print $(( [#_] sqrt+LPAR()1e7+RPAR() ))) + +outputs `tt(3_162.277_660_168_379_5)' (the number of decimal places +shown may vary). + pindex(C_BASES, use of) pindex(OCTAL_ZEROES, use of) If the tt(C_BASES) option is set, hexadecimal numbers in the standard C diff -Nru zsh-5.0.5/Doc/Zsh/builtins.yo zsh-5.0.7/Doc/Zsh/builtins.yo --- zsh-5.0.5/Doc/Zsh/builtins.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/builtins.yo 2014-10-07 18:11:30.000000000 +0000 @@ -3,8 +3,6 @@ ifzman(\ sect(Shell Builtin Commands) )\ -cindex(builtin commands) -cindex(commands, builtin) def(prefix)(1)(\ item(tt(ARG1) var(simple command))( See noderef(Precommand Modifiers). @@ -29,6 +27,8 @@ )\ )\ +cindex(builtin commands) +cindex(commands, builtin) Some shell builtin commands take options as described in individual entries; these are often referred to in the list below as `tt(flags)' to avoid confusion with shell options, which may also have an effect on the @@ -603,7 +603,7 @@ that it does not override globbing options; for example, `tt(enable -p "~")' does not cause the pattern character tt(~) to be active unless the tt(EXTENDED_GLOB) option is also set. To enable all possible -patterns (so that they may be invidually disabled with tt(disable -p)), +patterns (so that they may be individually disabled with tt(disable -p)), use `tt(setopt EXTENDED_GLOB KSH_GLOB NO_SH_GLOB)'. ) findex(eval) @@ -653,7 +653,7 @@ cindex(editing history) xitem(tt(fc) [ tt(-e) var(ename) ] [ tt(-m) var(match) ] [ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ]) xitem(tt(fc) tt(-l) [ tt(-nrdfEiD) ] [ tt(-t) var(timefmt) ] [ tt(-m) var(match) ]) -xitem( [ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ]) +xitem(tt( )[ var(old)tt(=)var(new) ... ] [ var(first) [ var(last) ] ]) xitem(tt(fc) tt(-p) [ tt(-a) ] [ var(filename) [ var(histsize) [ var(savehistsize) ] ] ]) xitem(tt(fc) tt(-P)) item(tt(fc) tt(-ARWI) [ var(filename) ])( @@ -683,6 +683,9 @@ event), or to -16 if the tt(-l) flag is given. If var(last) is not specified, it will be set to var(first), or to -1 if the tt(-l) flag is given. +However, if the current event has added entries to the history with +`tt(print -s)' or `tt(fc -R)', then the default var(last) for tt(-l) +includes all new history entries since the current event began. The flag tt(-r) reverses the order of the commands and the flag tt(-n) suppresses command numbers when listing. @@ -770,7 +773,7 @@ xitem(tt(functions) [ {tt(PLUS())|tt(-)}tt(UXkmtTuz) ] [ var(name) ... ]) xitem(tt(functions -M) var(mathfn) [ var(min) [ var(max) [ var(shellfn) ] ] ]) xitem(tt(functions -M) [ tt(-m) var(pattern) ... ]) -item(tt(functions +M) [ tt(-m) ] var(mathfn))( +item(tt(functions +M) [ tt(-m) ] var(mathfn) ... )( Equivalent to tt(typeset -f), with the exception of the tt(-M) option. Use of the tt(-M) option may not be combined with any of the options handled by tt(typeset -f). @@ -1285,8 +1288,7 @@ character and are not removed. ) item(tt(-s))( -Don't echo back characters if reading from the terminal. Currently does -not work with the tt(-q) option. +Don't echo back characters if reading from the terminal. ) item(tt(-q))( Read only one character from the terminal and set var(name) to @@ -1500,12 +1502,15 @@ ) findex(shift) cindex(parameters, positional) -item(tt(shift) [ var(n) ] [ var(name) ... ])( +item(tt(shift) [ tt(-p) ] [ var(n) ] [ var(name) ... ])( The positional parameters tt(${)var(n)PLUS()1tt(}) ... are renamed to tt($1) ..., where var(n) is an arithmetic expression that defaults to 1. If any var(name)s are given then the arrays with these names are shifted instead of the positional parameters. + +If the option tt(-p) is given arguments are instead removed (popped) +from the end rather than the start of the array. ) findex(source) item(tt(source) var(file) [ var(arg) ... ])( @@ -1634,14 +1639,26 @@ findex(ttyctl) cindex(tty, freezing) item(tt(ttyctl) tt(-fu))( -The tt(-f) option freezes the tty, and tt(-u) unfreezes it. +The tt(-f) option freezes the tty (i.e. terminal or terminal emulator), and +tt(-u) unfreezes it. When the tty is frozen, no changes made to the tty settings by external programs will be honored by the shell, except for changes in the size of the screen; the shell will simply reset the settings to their previous values as soon as each command exits or is suspended. Thus, tt(stty) and similar programs have -no effect when the tty is frozen. Without options it reports whether the -terminal is frozen or not. +no effect when the tty is frozen. Freezing the tty does not cause +the current state to be remembered: instead, it causes future changes +to the state to be blocked. + +Without options it reports whether the terminal is frozen or not. + +Note that, regardless of whether the tty is frozen or not, the +shell needs to change the settings when the line editor starts, so +unfreezing the tty does not guarantee settings made on the +command line are preserved. Strings of commands run between +editing the command line will see a consistent tty state. +See also the shell variable tt(STTY) for a means of initialising +the tty before running external commands. ) findex(type) item(tt(type) [ tt(-wfpams) ] var(name) ...)( @@ -1934,6 +1951,9 @@ sitem(tt(-n))(open file descriptors.) sitem(tt(-p))(The number of pseudo-terminals.) sitem(tt(-q))(Bytes in POSIX message queues.) +sitem(tt(-r))(Maximum real time priority. On some systems where this +is not available, such as NetBSD, this has the same effect as tt(-T) +for compatibility with tt(sh).) sitem(tt(-s))(Kilobytes on the size of the stack.) sitem(tt(-T))(The number of simultaneous threads available to the user.) sitem(tt(-t))(CPU seconds to be used.) @@ -2154,6 +2174,20 @@ the definitions of all functions currently defined or marked as autoloaded will be written. +Note the second form cannot be used for compiling functions that +include redirections as part of the definition rather than within +the body of the function; for example + +example(fn1() { { ... } >~/logfile }) + +can be compiled but + +example(fn1() { ... } >~/logfile) + +cannot. It is possible to use the first form of tt(zcompile) to compile +autoloadable functions that include the full function definition instead +of just the body of the function. + The third form, with the tt(-t) option, examines an existing compiled file. Without further arguments, the names of the original files compiled into it are listed. The first line of output shows diff -Nru zsh-5.0.5/Doc/Zsh/calsys.yo zsh-5.0.7/Doc/Zsh/calsys.yo --- zsh-5.0.5/Doc/Zsh/calsys.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/calsys.yo 2014-10-07 18:11:30.000000000 +0000 @@ -547,35 +547,36 @@ parameter tt(reply) to an empty associative array. Otherwise, it returns status 0 and sets elements of the associative array tt(reply) as follows: + startsitem() -sitem(time)(The time as a string of digits in the same units as +sitem(tt(time))(The time as a string of digits in the same units as tt($EPOCHSECONDS)) -sitem(schedtime)(The regularly scheduled time. This may differ from +sitem(tt(schedtime))(The regularly scheduled time. This may differ from the actual event time tt(time) if this is a recurring event and the next occurrence has been rescheduled. Then tt(time) gives the actual time and tt(schedtime) the time of the regular recurrence before modification.) -sitem(text1)(The text from the line not including the date and time of the +sitem(tt(text1))(The text from the line not including the date and time of the event, but including any tt(WARN) or tt(RPT) keywords and values.) -sitem(warntime)(Any warning time given by the tt(WARN) keyword as a string +sitem(tt(warntime))(Any warning time given by the tt(WARN) keyword as a string of digits containing the time at which to warn in the same units as tt($EPOCHSECONDS). (Note this is an absolute time, not the relative time passed down.) Not set no tt(WARN) keyword and value were matched.) -sitem(warnstr)(The raw string matched after the tt(WARN) keyword, else unset.) -sitem(rpttime)(Any recurrence time given by the tt(RPT) keyword as a string +sitem(tt(warnstr))(The raw string matched after the tt(WARN) keyword, else unset.) +sitem(tt(rpttime))(Any recurrence time given by the tt(RPT) keyword as a string of digits containing the time of the recurrence in the same units as tt($EPOCHSECONDS). (Note this is an absolute time.) Not set if no tt(RPT) keyword and value were matched.) -sitem(schedrpttime)(The next regularly scheduled occurrence of a recurring +sitem(tt(schedrpttime))(The next regularly scheduled occurrence of a recurring event before modification. This may differ from tt(rpttime), which is the actual time of the event that may have been rescheduled from the regular time.) -sitem(rptstr)(The raw string matched after the tt(RPT) keyword, else unset.) -sitem(text2)(The text from the line after removal of the date and any +sitem(tt(rptstr))(The raw string matched after the tt(RPT) keyword, else unset.) +sitem(tt(text2))(The text from the line after removal of the date and any keywords and values.) ) endsitem() -) + findex(calendar_showdate) item(tt(calendar_showdate) [ tt(-r) ] [ tt(-f) var(fmt) ] var(date-spec ...))( The given var(date-spec) is interpreted and the corresponding date and diff -Nru zsh-5.0.5/Doc/Zsh/compat.yo zsh-5.0.7/Doc/Zsh/compat.yo --- zsh-5.0.5/Doc/Zsh/compat.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/compat.yo 2014-10-07 18:11:30.000000000 +0000 @@ -6,7 +6,7 @@ Zsh tries to emulate bf(sh) or bf(ksh) when it is invoked as tt(sh) or tt(ksh) respectively; more precisely, it looks at the first letter of the name by which it was invoked, excluding any initial `tt(r)' -(assumed to stand for `restricted'), and if that is `tt(s)' or `tt(k)' it +(assumed to stand for `restricted'), and if that is `tt(b)', `tt(s)' or `tt(k)' it will emulate bf(sh) or bf(ksh). Furthermore, if invoked as tt(su) (which happens on certain systems when the shell is executed by the tt(su) command), the shell will try to find an alternative name from the tt(SHELL) diff -Nru zsh-5.0.5/Doc/Zsh/compsys.yo zsh-5.0.7/Doc/Zsh/compsys.yo --- zsh-5.0.5/Doc/Zsh/compsys.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/compsys.yo 2014-10-07 18:11:30.000000000 +0000 @@ -1995,11 +1995,11 @@ kindex(matcher, completion style) item(tt(matcher))( This style is tested separately for each tag valid in the current -context. Its value is added to any match specifications given by the +context. Its value is tried before any match specifications given by the tt(matcher-list) style. It should be in the form described in ifzman(the section `Completion Matching Control' in zmanref(zshcompwid))\ ifnzman(noderef(Completion Matching Control))\ -. +. For examples of this, see the description of the tt(tag-order) style. ) kindex(matcher-list, completion style) item(tt(matcher-list))( @@ -2019,12 +2019,14 @@ Hence it is possible to create increasingly general specifications without repetition: -example(zstyle ':completion:*' matcher-list '' '+m{a-z}={A-Z}' '+m{A-Z}={a-z}') +example(zstyle ':completion:*' matcher-list '' '+m:{a-z}={A-Z}' '+m:{A-Z}={a-z}') It is possible to create match specifications valid for particular -completers by using the third field of the context. For example, to -use the completers tt(_complete) and tt(_prefix) but only allow -case-insensitive completion with tt(_complete): +completers by using the third field of the context. This applies only +to completers that override the global matcher-list, which as of this +writing includes only tt(_prefix) and tt(_ignored). For example, to +use the completers tt(_complete) and tt(_prefix) but allow +case-insensitive completion only with tt(_complete): example(zstyle ':completion:*' completer _complete _prefix zstyle ':completion:*:complete:*' matcher-list \ @@ -2344,7 +2346,7 @@ tt(_history_complete_word) bindable command to decide which words should be completed. -If it is a singe number, only the last var(N) words from the history +If it is a single number, only the last var(N) words from the history will be completed. If it is a range of the form `var(max)tt(:)var(slice)', @@ -2440,6 +2442,15 @@ dictionary databases to be added separately. The default for this style is `false'. ) +kindex(show-ambiguity, completion style) +item(tt(show-ambiguity))( +If the tt(zsh/complist) module is loaded, this style can be used to +highlight the first ambiguous character in completion lists. The +value is either a color indication such as those supported by the +tt(list-colors) style or, with a value of tt(true), a default of +underlining is selected. The highlighting is only applied if the +completion display strings correspond to the actual matches. +) kindex(show-completer, completion style) item(tt(show-completer))( Tested whenever a new completer is tried. If it is true, the completion @@ -3038,6 +3049,15 @@ ifzman(the section `Bindable Commands' below)\ ifnzman(noderef(Bindable Commands)). ) +findex(_extensions) +item(tt(_extensions))( +If the cursor follows the string `tt(*.)', filename extensions are +completed. The extensions are taken from files in current directory or a +directory specified at the beginning of the current word. For exact matches, +completion continues to allow other completers such as tt(_expand) to +expand the pattern. The standard tt(add-space) and tt(prefix-hidden) +styles are observed. +) findex(_history) item(tt(_history))( Complete words from the shell's command history. This completer @@ -4721,6 +4741,19 @@ `tt(-r)', `tt(-R)', and `tt(-q)' and passes them on to the tt(compadd) builtin used to add the matches. ) +findex(_sequence) +item(tt(_sequence) [ tt(-s) var(sep) ] [ tt(-n) var(max) ] [ tt(-d) ] var(function) [ tt(-) ] ...)( +This function is a wrapper to other functions for completing items in a +separated list. The same function is used to complete each item in the +list. The separator is specified with the tt(-s) option. If tt(-s) is +omitted it will use `tt(,)'. Duplicate values are not matched unless +tt(-d) is specified. If there is a fixed or maximum number of items in +the list, this can be specified with the tt(-n) option. + +Common tt(compadd) options are passed on to the function. It is possible +to use tt(compadd) directly with tt(_sequence), though tt(_values) may +be more appropriate in this situation. +) findex(_setup) item(tt(_setup) var(tag) [ var(group) ])( This function sets up the special diff -Nru zsh-5.0.5/Doc/Zsh/cond.yo zsh-5.0.7/Doc/Zsh/cond.yo --- zsh-5.0.5/Doc/Zsh/cond.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/cond.yo 2014-10-07 18:11:30.000000000 +0000 @@ -186,11 +186,44 @@ ) enditem() +For compatibility, if there is a single argument that is not +syntactically significant, typically a variable, the condition is +treated as a test for whether the expression expands as a string of +non-zero length. In other words, tt([[ $var ]]) is the same as tt([[ -n +$var ]]). It is recommended that the second, explicit, form be used +where possible. + Normal shell expansion is performed on the var(file), var(string) and var(pattern) arguments, but the result of each expansion is constrained to be a single word, similar to the effect of double quotes. -Filename generation is not performed on any form of argument to conditions. -However, pattern metacharacters are active for the var(pattern) arguments; + +Filename generation is not performed on any form of argument to +conditions. However, it can be forced in any case where normal shell +expansion is valid and when the option tt(EXTENDED_GLOB) is in effect by +using an explicit glob qualifier of the form tt(LPAR()#q+RPAR()) at the +end of the string. A normal glob qualifier expression may appear +between the `tt(q)' and the closing parenthesis; if none appears the +expression has no effect beyond causing filename generation. The +results of filename generation are joined together to form a single +word, as with the results of other forms of expansion. + +This special use of filename generation is only available with the +tt([[) syntax. If the condition occurs within the tt([) or tt(test) +builtin commands then globbing occurs instead as part of normal command +line expansion before the condition is evaluated. In this case it may +generate multiple words which are likely to confuse the syntax of the +test command. + +For example, + +tt([[ -n file*(#qN) ]]) + +produces status zero if and only if there is at least one file in the +current directory beginning with the string `tt(file)'. The globbing +qualifier tt(N) ensures that the expression is empty if there is +no matching file. + +Pattern metacharacters are active for the var(pattern) arguments; the patterns are the same as those used for filename generation, see ifzman(\ zmanref(zshexpn)\ diff -Nru zsh-5.0.5/Doc/Zsh/contrib.yo zsh-5.0.7/Doc/Zsh/contrib.yo --- zsh-5.0.5/Doc/Zsh/contrib.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/contrib.yo 2014-10-07 18:11:30.000000000 +0000 @@ -45,9 +45,8 @@ tt(Functions/Misc), searches for these helpfiles and performs several other tests to produce the most complete help possible for the command. -There may already be a directory of help files on your system; look in -tt(/usr/share/zsh) or tt(/usr/local/share/zsh) and subdirectories below -those, or ask your system administrator. +Help files are installed by default to a subdirectory of tt(/usr/share/zsh) +or tt(/usr/local/share/zsh). To create your own help files with tt(helpfiles), choose or create a directory where the individual command help files will reside. For @@ -55,22 +54,22 @@ distribution in your home directory, you would use the commands: example(mkdir ~/zsh_help -cd ~/zsh_help -man zshall | colcrt - | \ -perl ~/zsh-version()/Util/helpfiles) +perl ~/zsh-version()/Util/helpfiles ~/zsh_help) + +vindex(HELPDIR) +The tt(HELPDIR) parameter tells tt(run-help) where to look for the help +files. When unset, it uses the default installation path. +To use your own set of help files, set this to the appropriate path +in one of your startup files: + +example(HELPDIR=~/zsh_help) findex(run-help, use of) -Next, to use the tt(run-help) function, you need to add lines something +To use the tt(run-help) function, you need to add lines something like the following to your tt(.zshrc) or equivalent startup file: example(unalias run-help -autoload run-help -HELPDIR=~/zsh_help) - -vindex(HELPDIR) -The tt(HELPDIR) parameter tells tt(run-help) where to look for the help -files. If your system already has a help file directory installed, set -tt(HELPDIR) to the path of that directory instead. +autoload run-help) Note that in order for `tt(autoload run-help)' to work, the tt(run-help) file must be in one of the directories named in your tt(fpath) array (see @@ -827,17 +826,32 @@ If enabled, this style causes the tt(%c) and tt(%u) format escapes to show when the working directory has uncommitted changes. The strings displayed by these escapes can be controlled via the tt(stagedstr) and tt(unstagedstr) -styles. The only backends that currently support this option are tt(git) and -tt(hg) (tt(hg) only supports unstaged). +styles. The only backends that currently support this option are tt(git), +tt(hg), and tt(bzr) (the latter two only support unstaged). For this style to be evaluated with the tt(hg) backend, the tt(get-revision) style needs to be set and the tt(use-simple) style needs to be unset. The latter is the default; the former is not. +With the tt(bzr) backend, em(lightweight checkouts) only honor this style if +the tt(use-server) style is set. + 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. ) +kindex(check-for-staged-changes) +item(tt(check-for-staged-changes))( +This style is like tt(check-for-changes), but it never checks the worktree +files, only the metadata in the tt(.${vcs}) dir. Therefore, +this style initializes only the tt(%c) escape (with tt(stagedstr)) but +not the tt(%u) escape. This style is faster than tt(check-for-changes). + +In the tt(git) backend, this style checks for changes in the index. +Other backends do not currently implement this style. + +This style is disabled by default. +) kindex(stagedstr) item(tt(stagedstr))( This string will be used in the tt(%c) escape if there are staged changes in @@ -863,7 +877,7 @@ For example, this style can be used to use binaries from non-default installation directories. Assume, tt(git) is installed in /usr/bin but -your sysadmin installed a newer version in /usr/bin/local. Instead of +your sysadmin installed a newer version in /usr/local/bin. Instead of changing the order of your tt($PATH) parameter, you can do this: example(zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git) ) @@ -881,6 +895,9 @@ tt(P4CONFIG) to a file name and have corresponding files in the root directories of each Perforce client. See comments in the function tt(VCS_INFO_detect_p4) for more detail. + +The Bazaar backend (tt(bzr)) uses this to permit contacting the server +about lightweight checkouts, see the tt(check-for-changes) style. ) kindex(use-simple) item(tt(use-simple))( @@ -942,6 +959,7 @@ sitem(tt(disable))((empty list)) sitem(tt(disable-patterns))((empty list)) sitem(tt(check-for-changes))(false) +sitem(tt(check-for-staged-changes))(false) sitem(tt(stagedstr))((string: "S")) sitem(tt(unstagedstr))((string: "U")) sitem(tt(command))((empty string)) @@ -1138,8 +1156,8 @@ 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 +argument, tt(all) occurrences of the functions are unregistered. Otherwise +only the last occurrence is removed (if a function was registered to a hook more than once) . The `tt(+vi-)' prefix needs to be left out here. See bf(Hooks in vcs_info) below for details. ) @@ -1274,14 +1292,14 @@ When setting tt(ret) to non-zero, the string in tt(${hook_com[hg-bookmark-string]}) will be used in the tt(%m) escape in -tt(formats) and tt(actionformats) and will be availabe in the global +tt(formats) and tt(actionformats) and will be available in the global tt(backend_misc) array as tt(${backend_misc[bookmarks]}). ) item(tt(gen-applied-string))( -Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backends -and in tt(quilt) support when the tt(applied-string) is generated; the -tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq) and tt(stgit) -backends are active by default). +Called in the tt(git) (with tt(stgit) or during rebase), and tt(hg) +(with tt(mq)) backends and in tt(quilt) support when the tt(applied-string) +is generated; the tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq) +and tt(stgit) backends are active by default). This hook gets the names of all applied patches which tt(vcs_info) collected so far in the opposite order, which means that the first argument is the @@ -1294,9 +1312,9 @@ available as tt(%p) in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(gen-unapplied-string))( -Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backend -and in tt(quilt) support when the tt(unapplied-string) is generated; the -tt(get-unapplied) style must be true. +Called in the tt(git) (with tt(stgit) or during rebase), and tt(hg) (with +tt(mq)) backend and in tt(quilt) support when the tt(unapplied-string) is +generated; the tt(get-unapplied) style must be true. This hook gets the names of all unapplied patches which tt(vcs_info) collected so far in the opposite order, which mean that the first argument is @@ -1321,6 +1339,11 @@ The `hook_com' parameter is not used. ) +item(tt(post-backend))( +Called as soon as the backend has finished collecting information. + +The `tt(hook_com)' keys available are as for the tt(set-message) hook. +) 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 @@ -1481,22 +1504,15 @@ # This makes the bookmarks string use only those # bookmarks. If there's more than one, it # concatenates them using commas. - local s i # The bookmarks returned by `hg' are available in - # the functions positional parameters. - (( $# == 0 )) && return 0 - for i in "$@"; do - if [[ $i == sh/* ]]; then - [[ -n $s ]] && s=$s, - s=${s}$i - fi - done + # the function's positional parameters. + local s="${(Mj:,:)@:#sh/*}" # Now, the communication with the code that calls # the hook functions is done via the hook_com[] - # hash. The key, at which the `gen-hg-bookmark-string' - # hook looks at is `hg-bookmark-string'. So: + # hash. The key at which the `gen-hg-bookmark-string' + # hook looks is `hg-bookmark-string'. So: hook_com[hg-bookmark-string]=$s - # And to signal, that we want to use the sting we + # And to signal that we want to use the string we # just generated, set the special variable `ret' to # something other than the default zero: ret=1 @@ -1874,6 +1890,12 @@ example(bindkey -M vicmd v edit-command-line) ) +tindex(expand-absolute-path) +item(tt(expand-absolute-path))( +Expand the file name under the cursor to an absolute path, resolving +symbolic links. Where possible, the initial path segment is turned +into a named directory or reference to a user's home directory. +) tindex(history-beginning-search-backward-end) tindex(history-beginning-search-forward-end) item(tt(history-search-end))( @@ -2306,6 +2328,32 @@ not used. Hence it is still possible to call tt(executed-named-cmd) and similar functions while reading a value. ) +tindex(replace-argument) +tindex(replace-argument-edit) +item(tt(replace-argument), tt(replace-argument-edit)) +( +The function tt(replace-argument) can be used to replace a command +line argument in the current command line or, if the current command +line is empty, in the last command line executed (the new command line +is not executed). Arguments are as delimited by standard shell syntax, + +If a numeric argument is given, that specifies the argument to be +replaced. 0 means the command name, as in history expansion. +A negative numeric argument counts backward from the last word. + +If no numeric argument is given, the current argument is replaced; +this is the last argument if the previous history line is being used. + +The function prompts for a replacement argument. + +If the widget contains the string tt(edit), for example is defined as + +example(zle -N replace-argument-edit replace-argument) + +then the function presents the current value of the argument for +editing, otherwise the editing buffer for the replacement is +initially empty. +) tindex(replace-string) tindex(replace-string-again) tindex(replace-pattern) @@ -2444,6 +2492,25 @@ may be set to an array to give the command and options that will be used to investigate the command word found. The default is tt(whence -c). ) +tindex(zcalc-auto-insert) +item(tt(zcalc-auto-insert))( +This function is useful together with the tt(zcalc) function described in +ifzman(the section Mathematical Functions)\ +ifnzman(noderef(Mathematical Functions)). +It should be bound to a key representing a binary operator such +as `tt(PLUS())', `tt(-)', `tt(*)' or `tt(/)'. When running in zcalc, +if the key occurs at the start of the line or immediately following +an open parenthesis, the text tt("ans ") is inserted before the +representation of the key itself. This allows easy use of the +answer from the previous calculation in the current line. The +text to be inserted before the symbol typed can be modified by setting +the variable tt(ZCALC_AUTO_INSERT_PREFIX). + +Hence, for example, typing `tt(PLUS()12)' followed by return adds 12 +to the previous result. + +When not in zcalc, the key simply inserts the symbol itself. +) enditem() subsect(Utility Functions) @@ -2898,8 +2965,8 @@ file name is matched against the pattern, regardless of how the file was passed to the handler. The file is resolved to a full path using the tt(:A) modifier described in -ifzman(the subsection Modifers in zmanref(zshexpn))\ -ifnzman(noderef(Modifiers))); +ifzman(the subsection Modifiers in zmanref(zshexpn))\ +ifnzman(noderef(Modifiers)); this means that symbolic links are resolved where possible, so that links into other file systems behave in the correct fashion. ) @@ -3370,21 +3437,22 @@ ifnzman(noderef(Prompt Themes))). You seldom should need to run tt(colors) more than once. -The eight base colors are: black, red, green, yellow, blue, magenta, cyan, -and white. Each of these has codes for foreground and background. In -addition there are eight intensity attributes: bold, faint, standout, -underline, blink, reverse, and conceal. Finally, there are six codes used -to negate attributes: none (reset all attributes to the defaults), normal -(neither bold nor faint), no-standout, no-underline, no-blink, and -no-reverse. +The eight base colors are: tt(black), tt(red), tt(green), tt(yellow), +tt(blue), tt(magenta), tt(cyan), and tt(white). Each of these has codes for +foreground and background. In addition there are seven intensity attributes: +tt(bold), tt(faint), tt(standout), tt(underline), tt(blink), tt(reverse), +and tt(conceal). Finally, there are seven codes used to negate attributes: +tt(none) (reset all attributes to the defaults), tt(normal) +(neither bold nor faint), tt(no-standout), tt(no-underline), tt(no-blink), +tt(no-reverse), and tt(no-conceal). Some terminals do not support all combinations of colors and intensities. The associative arrays are: startitem() -xitem(color) -item(colour)( +xitem(tt(color)) +item(tt(colour))( Map all the color names to their integer codes, and integer codes to the color names. The eight base names map to the foreground color codes, as do names prefixed with `tt(fg-)', such as `tt(fg-red)'. Names prefixed @@ -3395,16 +3463,16 @@ Although it is a misnomer to call them `colors', these arrays also map the other fourteen attributes from names to codes and codes to names. ) -xitem(fg) -xitem(fg_bold) -item(fg_no_bold)( +xitem(tt(fg)) +xitem(tt(fg_bold)) +item(tt(fg_no_bold))( Map the eight basic color names to ANSI terminal escape sequences that set the corresponding foreground text properties. The tt(fg) sequences change the color without changing the eight intensity attributes. ) -xitem(bg) -xitem(bg_bold) -item(bg_no_bold)( +xitem(tt(bg)) +xitem(tt(bg_bold)) +item(tt(bg_no_bold))( Map the eight basic color names to ANSI terminal escape sequences that set the corresponding background properties. The tt(bg) sequences change the color without changing the eight intensity attributes. diff -Nru zsh-5.0.5/Doc/Zsh/.distfiles zsh-5.0.7/Doc/Zsh/.distfiles --- zsh-5.0.5/Doc/Zsh/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,73 +1,5 @@ DISTFILES_SRC=' -.cvsignore -.distfiles -arith.yo -builtins.yo -calsys.yo -compat.yo -compctl.yo -compsys.yo -compwid.yo -cond.yo -contrib.yo -exec.yo -expn.yo -filelist.yo -files.yo -ftp_sites.yo -func.yo -grammar.yo -index.yo -intro.yo -invoke.yo -jobs.yo manmodmenu.yo -manual.yo -metafaq.yo -mod_attr.yo -mod_cap.yo -mod_clone.yo -mod_compctl.yo -mod_complete.yo -mod_complist.yo -mod_computil.yo -mod_curses.yo -mod_datetime.yo -mod_deltochar.yo -mod_example.yo -mod_files.yo -mod_langinfo.yo modlist.yo -mod_mapfile.yo -mod_mathfunc.yo modmenu.yo -mod_newuser.yo -mod_parameter.yo -mod_pcre.yo -mod_regex.yo -mod_sched.yo -mod_socket.yo -mod_stat.yo -mod_system.yo -mod_tcp.yo -mod_termcap.yo -mod_terminfo.yo -modules.yo -mod_zftp.yo -mod_zleparameter.yo -mod_zle.yo -mod_zprof.yo -mod_zpty.yo -mod_zselect.yo -mod_zutil.yo -options.yo -params.yo -prompt.yo -redirect.yo -restricted.yo -roadmap.yo -seealso.yo -tcpsys.yo -zftpsys.yo -zle.yo ' diff -Nru zsh-5.0.5/Doc/Zsh/expn.yo zsh-5.0.7/Doc/Zsh/expn.yo --- zsh-5.0.5/Doc/Zsh/expn.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/expn.yo 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,7 @@ texinode(Expansion)(Parameters)(Prompt Expansion)(Top) chapter(Expansion) -cindex(expansion) ifnztexi(sect(Description)) +cindex(expansion) The following types of expansions are performed in the indicated order in five steps: @@ -316,7 +316,7 @@ the same record of the last var(l) and var(r) is maintained across all forms of expansion. -Note that if a `tt(&)' is used within glob qualifers an extra backslash +Note that if a `tt(&)' is used within glob qualifiers an extra backslash is needed as a tt(&) is a special character in this case. If the option tt(HIST_SUBST_PATTERN) is set, var(l) is treated as @@ -475,7 +475,7 @@ Another problem arises any time a job with a substitution that requires a temporary file is disowned by the shell, including the case where `tt(&!)' or `tt(&|)' appears at the end of a command containing a -subsitution. In that case the temporary file will not be cleaned up as +substitution. In that case the temporary file will not be cleaned up as the shell no longer has any memory of the job. A workaround is to use a subshell, for example, @@ -632,10 +632,34 @@ entire expression. ) item(tt(${)var(name)tt(:*)var(arrayname)tt(}))( -Similar to the preceding subsitution, but in the opposite sense, +Similar to the preceding substitution, but in the opposite sense, so that entries present in both the original substitution and as elements of var(arrayname) are retained and others removed. ) +xitem(tt(${)var(name)tt(:^)var(arrayname)tt(})) +item(tt(${)var(name)tt(:^^)var(arrayname)tt(}))( +Zips two arrays, such that the output array is twice as long as the +shortest (longest for `tt(:^^)') of tt(name) and tt(arrayname), with +the elements alternatingly being picked from them. For `tt(:^)', if one +of the input arrays is longer, the output will stop when the end of the +shorter array is reached. Thus, + +example(a=(1 2 3 4); b=(a b); print ${a:^b}) + +will output `tt(1 a 2 b)'. For `tt(:^^)', then the input is repeated +until all of the longer array has been used up and the above will output +`tt(1 a 2 b 3 a 4 b)'. + +Either or both inputs may be a scalar, they will be treated as an array +of length 1 with the scalar as the only element. If either array is empty, +the other array is output with no extra elements inserted. + +Currently the following code will output `tt(a b)' and `tt(1)' as two separate +elements, which can be unexpected. The second print provides a workaround which +should continue to work if this is changed. + +example(a=(a b); b=(1 2); print -l "${a:^b}"; print -l "${${a:^b}}") +) xitem(tt(${)var(name)tt(:)var(offset)tt(})) item(tt(${)var(name)tt(:)var(offset)tt(:)var(length)tt(}))( This syntax gives effects similar to parameter subscripting @@ -677,7 +701,7 @@ print ${foo:$(echo 1 + 2)}) all have the same effect, extracting the string starting at the fourth -character of tt($foo) if the substution would otherwise return a scalar, +character of tt($foo) if the substitution would otherwise return a scalar, or the array starting at the fourth element if tt($foo) would return an array. Note that with the option tt(KSH_ARRAYS) tt($foo) always returns a scalar (regardless of the use of the offset syntax) and a form @@ -900,7 +924,7 @@ item(tt(D))( Assume the string or array elements contain directories and attempt to substitute the leading part of these by names. The remainder of -the path (the whole of it if the leading part was not subsituted) +the path (the whole of it if the leading part was not substituted) is then quoted so that the whole string can be used as a shell argument. This is the reverse of `tt(~)' substitution: see ifnzman(noderef(Filename Expansion))\ @@ -1102,13 +1126,14 @@ follow this argument. ) item(tt(~))( -Force string arguments to any of the flags below that follow within -the parentheses to be treated as patterns. Compare with a tt(~) +Strings inserted into the expansion by any of the flags below are to +be treated as patterns. This applies to the string arguments of flags +that follow tt(~) within the same set of parentheses. Compare with tt(~) outside parentheses, which forces the entire substituted string to be treated as a pattern. Hence, for example, example([[ "?" = ${(~j.|.)array} ]]) -with the tt(EXTENDED_GLOB) option set succeeds if and only if tt($array) -contains the string `tt(?)' as an element. The argument may be +treats `tt(|)' as a pattern and succeeds if and only if tt($array) +contains the string `tt(?)' as an element. The tt(~) may be repeated to toggle the behaviour; its effect only lasts to the end of the parenthesised group. ) @@ -1131,6 +1156,10 @@ directly to the left of each word, truncated if necessary, before var(string1) is used to produce any remaining padding. +If either of var(string1) or tt(string2) is present but empty, +i.e. there are two delimiters together at that point, the first +character of tt($IFS) is used instead. + If the tt(MULTIBYTE) option is in effect, the flag tt(m) may also be given, in which case widths will be used for the calculation of padding; otherwise individual multibyte characters are treated as occupying @@ -1407,16 +1436,21 @@ If the result is still an array and one of the `tt((o))' or `tt((O))' flags was present, the array is reordered. ) -item(tt(20.) em(Re-evaluation))( +item(tt(20.) tt(RC_EXPAND_PARAM))( +At this point the decision is made whether any resulting array elements +are to be combined element by element with surrounding text, as given +by either the tt(RC_EXPAND_PARAM) option or the `tt(^)' flag. +) +item(tt(21.) em(Re-evaluation))( Any `tt((e))' flag is applied to the value, forcing it to be re-examined for new parameter substitutions, but also for command and arithmetic substitutions. ) -item(tt(21.) em(Padding))( +item(tt(22.) em(Padding))( Any padding of the value by the `tt(LPAR()l.)var(fill)tt(.RPAR())' or `tt(LPAR()r.)var(fill)tt(.RPAR())' flags is applied. ) -item(tt(22.) em(Semantic joining))( +item(tt(23.) em(Semantic joining))( In contexts where expansion semantics requires a single word to result, all words are rejoined with the first character of tt(IFS) between. So in `tt(${LPAR()P)tt(RPAR()${LPAR()f)tt(RPAR()lines}})' @@ -1425,7 +1459,7 @@ If a single word is not required, this rule is skipped. ) -item(tt(23.) em(Empty argument removal))( +item(tt(24.) em(Empty argument removal))( If the substitution does not appear in double quotes, any resulting zero-length argument, whether from a scalar or an element of an array, is elided from the list of arguments inserted into the command line. @@ -1539,6 +1573,16 @@ to pad for example `tt({-99..100..01})' which is not possible to specify by putting a 0 on either of the first two numbers (i.e. pad to two characters). +An expression of the form `tt({)var(c1)tt(..)var(c2)tt(})', where +var(c1) and var(c2) are single characters (which may be multibyte +characters), is expanded to every character in the range from var(c1) to +var(c2) in whatever character sequence is used internally. For +characters with code points below 128 this is US ASCII (this is the only +case most users will need). If any intervening character is not +printable, appropriate quotation is used to render it printable. +If the character sequence is reversed, the output is in reverse +order, e.g. `tt({d..a})' is substituted as `tt(d c b a)'. + If a brace expression matches none of the above forms, it is left unchanged, unless the option tt(BRACE_CCL) (an abbreviation for `brace character class') is set. @@ -1962,7 +2006,7 @@ ) item(tt(PLUS()LPAR())...tt(RPAR()))( Match at least one occurrence. (Like `tt(LPAR())...tt(RPAR()##)', -except that recursive directory searching is not supported..) +except that recursive directory searching is not supported.) ) item(tt(?LPAR())...tt(RPAR()))( Match zero or one occurrence. (Like `tt(LPAR()|)...tt(RPAR())'.) @@ -2295,7 +2339,13 @@ recognised in this form even if a bare glob qualifier exists at the end of the pattern, for example `tt(*(#q*)(.))' will recognise executable regular files if both options are set; however, mixed syntax should probably be -avoided for the sake of clarity. +avoided for the sake of clarity. Note that within conditions using the +`tt([[)' form the presence of a parenthesised expression +tt(LPAR()#q...+RPAR()) at the end of a string indicates that globbing +should be performed; the expression may include glob qualifiers, but +it is also valid if it is simply tt(LPAR()#q+RPAR()). This does +not apply to the right hand side of pattern match operators as the +syntax already has special significance. A qualifier may be any one of the following: @@ -2511,10 +2561,12 @@ files less than var(n) bytes (tt(-)), more than var(n) bytes (tt(PLUS())), or exactly var(n) bytes in length. -If this flag is directly followed by a `tt(k)' (`tt(K)'), `tt(m)' -(`tt(M)'), or `tt(p)' (`tt(P)') (e.g. `tt(Lk-50)') the check is performed -with kilobytes, megabytes, or blocks (of 512 bytes) instead. In this -case a file is regarded as "exactly" the size if the file size rounded up +If this flag is directly followed by a em(size specifier) `tt(k)' (`tt(K)'), +`tt(m)' (`tt(M)'), or `tt(p)' (`tt(P)') (e.g. `tt(Lk-50)') the check is +performed with kilobytes, megabytes, or blocks (of 512 bytes) instead. +(On some systems additional specifiers are available for gigabytes, +`tt(g)' or `tt(G)', and terabytes, `tt(t)' or `tt(T)'.) If a size specifier +is used a file is regarded as "exactly" the size if the file size rounded up to the next unit is equal to the test size. Hence `tt(*LPAR()Lm1+RPAR())' matches files from 1 byte up to 1 Megabyte inclusive. Note also that the set of files "less than" the test size only includes files that would @@ -2548,9 +2600,16 @@ sets the tt(NUMERIC_GLOB_SORT) option for the current pattern pindex(NUMERIC_GLOB_SORT, setting in pattern) ) +item(tt(Y)var(n))( +enables short-circuit mode: the pattern will expand to at most var(n) +filenames. If more than var(n) matches exist, only the first var(n) +matches in directory traversal order will be considered. + +Implies tt(oN) when no tt(o)var(c) qualifier is used. +) item(tt(o)var(c))( specifies how the names of the files should be sorted. If var(c) is -tt(n) they are sorted by name (the default); if it is tt(L) they +tt(n) they are sorted by name; if it is tt(L) they are sorted depending on the size (length) of the files; if tt(l) they are sorted by the number of links; if tt(a), tt(m), or tt(c) they are sorted by the time of the last access, modification, or @@ -2565,6 +2624,9 @@ order, following any symbolic links. Unless tt(oN) is used, multiple order specifiers may occur to resolve ties. +The default sorting is tt(n) (by name) unless the tt(Y) glob qualifier is used, +in which case it is tt(N) (unsorted). + tt(oe) and tt(o+) are special cases; they are each followed by shell code, delimited as for the tt(e) glob qualifier and the tt(+) glob qualifier respectively (see above). The code is executed for each matched file with @@ -2601,6 +2663,12 @@ A typical use for this is to prepend an option before all occurrences of a file name; for example, the pattern `tt(*(P:-f:))' produces the command line arguments `tt(-f) var(file1) tt(-f) var(file2) ...' + +If the modifier tt(^) is active, then var(string) will be appended +instead of prepended. Prepending and appending is done independently +so both can be used on the same glob expression; for example by writing +`tt(*(P:foo:^P:bar:^P:baz:))' which produces the command line arguments +`tt(foo) tt(baz) var(file1) tt(bar) ...' ) enditem() diff -Nru zsh-5.0.5/Doc/Zsh/grammar.yo zsh-5.0.7/Doc/Zsh/grammar.yo --- zsh-5.0.5/Doc/Zsh/grammar.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/grammar.yo 2014-10-07 18:11:30.000000000 +0000 @@ -19,7 +19,11 @@ cindex(commands, simple) A em(simple command) is a sequence of optional parameter assignments followed by blank-separated words, -with optional redirections interspersed. +with optional redirections interspersed. For a description +of assignment, see the beginning of +ifnzman(noderef(Parameters))\ +ifzman(zmanref(zshparam)). + The first word is the command to be executed, and the remaining words, if any, are arguments to the command. If a command name is given, the parameter assignments modify @@ -312,7 +316,7 @@ enclosing tt(always) block). Regardless of tt(TRY_BLOCK_ERROR), after the end of tt(always-list) the -normal shell status tt($?) is the value returned from tt(always-list). +normal shell status tt($?) is the value returned from tt(try-list). This will be non-zero if there was an error, even if tt(TRY_BLOCK_ERROR) was set to zero. @@ -348,6 +352,15 @@ whitespace may appear between between the left and right parentheses when there is a single var(word); otherwise, the parentheses will be treated as forming a globbing pattern in that case. + +In any of the forms above, a redirection may appear outside the +function body, for example + +example(func+LPAR()RPAR() { ... } 2>&1) + +The redirection is stored with the function and applied whenever the +function is executed. Any variables in the redirection are expanded +at the point the function is executed, but outside the function scope. ) cindex(timing) findex(time) @@ -465,37 +478,38 @@ behaviour can be recovered by setting the option tt(CONTINUE_ON_ERROR). Fatal errors found in non-interactive shells include: -startlist() -list(Failure to parse shell options passed when invoking the shell) -list(Failure to change options with the tt(set) builtin) -list(Parse errors of all sorts, including failures to parse + +startitemize() +itemiz(Failure to parse shell options passed when invoking the shell) +itemiz(Failure to change options with the tt(set) builtin) +itemiz(Parse errors of all sorts, including failures to parse mathematical expressions) -list(Failures to set or modify variable behaviour with tt(typeset), +itemiz(Failures to set or modify variable behaviour with tt(typeset), tt(local), tt(declare), tt(export), tt(integer), tt(float)) -list(Execution of incorrectly positioned loop control structures +itemiz(Execution of incorrectly positioned loop control structures (tt(continue), tt(break))) -list(Attempts to use regular expression with no regular expression +itemiz(Attempts to use regular expression with no regular expression module available) -list(Disallowed operations when the tt(RESTRICTED) options is set) -list(Failure to create a pipe needed for a pipeline) -list(Failure to create a multio) -list(Failure to autoload a module needed for a declared shell feature) -list(Errors creating command or process substitutions) -list(Syntax errors in glob qualifiers) -list(File generation errors where not caught by the option tt(BAD_PATTERN)) -list(All bad patterns used for matching within case statements) -list(File generation failures where not caused by tt(NO_MATCH) or -list(All file generation errors where the pattern was used to create a -multio) -list(Memory errors where detected by the shell) -list(Invalid subscripts to shell variables) -list(Attempts to assign read-only variables) -list(Logical errors with variables such as assignment to the wrong type) -list(Use of invalid variable names) -list(Errors in variable substitution syntax) -list(Failure to convert characters in tt($')...tt(') expressions) +itemiz(Disallowed operations when the tt(RESTRICTED) options is set) +itemiz(Failure to create a pipe needed for a pipeline) +itemiz(Failure to create a multio) +itemiz(Failure to autoload a module needed for a declared shell feature) +itemiz(Errors creating command or process substitutions) +itemiz(Syntax errors in glob qualifiers) +itemiz(File generation errors where not caught by the option tt(BAD_PATTERN)) +itemiz(All bad patterns used for matching within case statements) +itemiz(File generation failures where not caused by tt(NO_MATCH) or similar options) -endlist() +itemiz(All file generation errors where the pattern was used to create a +multio) +itemiz(Memory errors where detected by the shell) +itemiz(Invalid subscripts to shell variables) +itemiz(Attempts to assign read-only variables) +itemiz(Logical errors with variables such as assignment to the wrong type) +itemiz(Use of invalid variable names) +itemiz(Errors in variable substitution syntax) +itemiz(Failure to convert characters in tt($')...tt(') expressions) +enditemize() If the tt(POSIX_BUILTINS) option is set, more errors associated with shell builtin commands are treated as fatal, as specified by the POSIX diff -Nru zsh-5.0.5/Doc/Zsh/mod_computil.yo zsh-5.0.7/Doc/Zsh/mod_computil.yo --- zsh-5.0.5/Doc/Zsh/mod_computil.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_computil.yo 2014-10-07 18:11:30.000000000 +0000 @@ -33,12 +33,12 @@ Once tt(compdescribe) has been called with either the tt(-i) or the tt(-I) option, it can be repeatedly called with the tt(-g) option and -the names of five arrays as its arguments. This will step through the -different sets of matches and store the options in the first array, -the strings with descriptions in the second, the matches for these in -the third, the strings without descriptions in the fourth, and the -matches for them in the fifth array. These are then directly given to -tt(compadd) to register the matches with the completion code. +the names of four parameters as its arguments. This will step through +the different sets of matches and store the value of tt(compstate[list]) +in the first scalar, the options for tt(compadd) in the second array, +the matches in the third array, and the strings to be displayed in the +completion listing in the fourth array. The arrays may then be directly +given to tt(compadd) to register the matches with the completion code. ) findex(compfiles) item(tt(compfiles))( diff -Nru zsh-5.0.5/Doc/Zsh/mod_parameter.yo zsh-5.0.7/Doc/Zsh/mod_parameter.yo --- zsh-5.0.5/Doc/Zsh/mod_parameter.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_parameter.yo 2014-10-07 18:11:30.000000000 +0000 @@ -212,6 +212,14 @@ and (if tt(EVAL_LINENO) is set) tt(eval) commands. currently being executed. The first element is the name of the function using the parameter. + +The standard shell array tt(zsh_eval_context) can be used to +determine the type of shell construct being executed at each depth: +note, however, that is in the opposite order, with the most recent +item last, and it is more detailed, for example including an +entry for tt(toplevel), the main shell code being executed +either interactively or from a script, which is not present +in tt($funcstack). ) vindex(functrace) item(tt(functrace))( diff -Nru zsh-5.0.5/Doc/Zsh/mod_pcre.yo zsh-5.0.7/Doc/Zsh/mod_pcre.yo --- zsh-5.0.5/Doc/Zsh/mod_pcre.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_pcre.yo 2014-10-07 18:11:30.000000000 +0000 @@ -72,6 +72,7 @@ enditem() The tt(zsh/pcre) module makes available the following test condition: + startitem() findex(pcre-match) item(expr tt(-pcre-match) pcre)( @@ -79,6 +80,14 @@ For example, -[[ "$text" -pcre-match ^d+$ ]] && print text variable contains only "d's". +example([[ "$text" -pcre-match ^d+$ ]] && +print text variable contains only "d's".) + +pindex(REMATCH_PCRE) +pindex(NO_CASE_MATCH) +If the tt(REMATCH_PCRE) option is set, the tt(=~) operator is equivalent to +tt(-pcre-match), and the tt(NO_CASE_MATCH) option may be used. Note that +tt(NO_CASE_MATCH) never applies to the tt(pcre_match) builtin, instead use +the tt(-i) switch of tt(pcre_compile). ) enditem() diff -Nru zsh-5.0.5/Doc/Zsh/mod_regex.yo zsh-5.0.7/Doc/Zsh/mod_regex.yo --- zsh-5.0.5/Doc/Zsh/mod_regex.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_regex.yo 2014-10-07 18:11:30.000000000 +0000 @@ -4,6 +4,7 @@ cindex(regular expressions) cindex(regex) The tt(zsh/regex) module makes available the following test condition: + startitem() findex(regex-match) item(var(expr) tt(-regex-match) var(regex))( diff -Nru zsh-5.0.5/Doc/Zsh/mod_sched.yo zsh-5.0.7/Doc/Zsh/mod_sched.yo --- zsh-5.0.5/Doc/Zsh/mod_sched.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_sched.yo 2014-10-07 18:11:30.000000000 +0000 @@ -48,7 +48,7 @@ startitem() vindex(zsh_scheduled_events) -item(zsh_scheduled_events)( +item(tt(zsh_scheduled_events))( A readonly array corresponding to the events scheduled by the tt(sched) builtin. The indices of the array correspond to the numbers shown when tt(sched) is run with no arguments (provided that the diff -Nru zsh-5.0.5/Doc/Zsh/mod_zutil.yo zsh-5.0.7/Doc/Zsh/mod_zutil.yo --- zsh-5.0.5/Doc/Zsh/mod_zutil.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/mod_zutil.yo 2014-10-07 18:11:30.000000000 +0000 @@ -251,10 +251,12 @@ builtin. ) item(tt(-K))( -With this option, the arrays specified with the tt(-a) and tt(-A) -options and with the `tt(=)var(array)' forms are kept unchanged when none -of the var(specs) for them is used. This allows assignment of default -values to them before calling tt(zparseopts). +With this option, the arrays specified with the tt(-a) option and with the +`tt(=)var(array)' forms are kept unchanged when none of the var(specs) for +them is used. Otherwise the entire array is replaced when any of the +var(specs) is used. Individual elements of associative arrays specified +with the tt(-A) option are preserved by tt(-K). This allows assignment of +default values to arrays before calling tt(zparseopts). ) item(tt(-M))( This changes the assignment rules to implement a map among equivalent @@ -263,7 +265,7 @@ which is used to choose where to store the values. If no other var(spec) is found, the values are stored as usual. This changes only the way the values are stored, not the way tt($*) is parsed, so results may be -unpredicable if the `var(name)tt(+)' specifier is used inconsistently. +unpredictable if the `var(name)tt(+)' specifier is used inconsistently. ) item(tt(-E))( This changes the parsing rules to em(not) stop at the first string diff -Nru zsh-5.0.5/Doc/Zsh/options.yo zsh-5.0.7/Doc/Zsh/options.yo --- zsh-5.0.5/Doc/Zsh/options.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/options.yo 2014-10-07 18:11:30.000000000 +0000 @@ -971,6 +971,23 @@ number of lines grows 20% beyond the value specified by tt($SAVEHIST) (see also the HIST_SAVE_BY_COPY option). ) +pindex(INC_APPEND_HISTORY_TIME) +pindex(NO_INC_APPEND_HISTORY_TIME) +pindex(INCAPPENDHISTORYTIME) +pindex(NOINCAPPENDHISTORYTIME) +cindex(history, incremental appending to a file with time) +item(tt(INC_APPEND_HISTORY_TIME))( +This option is a variant of tt(INC_APPEND_HISTORY) in which, where +possible, the history entry is written out to the file after the +command is finished, so that the time taken by the command is recorded +correctly in the history file in tt(EXTENDED_HISTORY) format. This +means that the history entry will not be available immediately from +other instances of the shell that are using the same history file. + +This option is only useful if tt(INC_APPEND_HISTORY) and +tt(SHARE_HISTORY) are turned off. The three options should be +considered mutually exclusive. +) pindex(SHARE_HISTORY) pindex(NO_SHARE_HISTORY) pindex(SHAREHISTORY) @@ -981,10 +998,10 @@ This option both imports new commands from the history file, and also causes your typed commands to be appended to the history file (the -latter is like specifying tt(INC_APPEND_HISTORY)). -The history lines are also output with timestamps ala -tt(EXTENDED_HISTORY) (which makes it easier to find the spot where -we left off reading the file after it gets re-written). +latter is like specifying tt(INC_APPEND_HISTORY), which should be turned +off if this option is in effect). The history lines are also output +with timestamps ala tt(EXTENDED_HISTORY) (which makes it easier to find +the spot where we left off reading the file after it gets re-written). By default, history movement commands visit the imported lines as well as the local lines, but you can toggle this on and off with the @@ -994,8 +1011,9 @@ If you find that you want more control over when commands get imported, you may wish to turn tt(SHARE_HISTORY) off, -tt(INC_APPEND_HISTORY) on, and then manually import -commands whenever you need them using `tt(fc -RI)'. +tt(INC_APPEND_HISTORY) or tt(INC_APPEND_HISTORY_TIME) (see above) on, +and then manually import commands whenever you need them using `tt(fc +-RI)'. ) enditem() @@ -1098,6 +1116,9 @@ pindex(NOCORRECTALL) item(tt(CORRECT_ALL) (tt(-O)))( Try to correct the spelling of all arguments in a line. + +The shell variable tt(CORRECT_IGNORE_FILE) may be set to a pattern to +match file names that will never be offered as corrections. ) pindex(DVORAK) pindex(NO_DVORAK) @@ -1174,7 +1195,7 @@ cindex(hashing, of executables) cindex(executables, hashing) item(tt(HASH_EXECUTABLES_ONLY))( -When hashing commands because of tt(HASH_COMMANDS), check that the +When hashing commands because of tt(HASH_CMDS), check that the file to be hashed is actually an executable. This option is unset by default as if the path contains a large number of commands, or consists of many remote files, the additional tests can take @@ -1202,7 +1223,7 @@ (assuming it exists). Commands explicitly beginning with `tt(/)', `tt(./)' or `tt(../)' are not subject to the path search. -This also applies to the `tt(.)' builtin. +This also applies to the `tt(.)' and tt(source) builtins. Note that subdirectories of the current directory are always searched for executables specified in this form. This takes place before any search @@ -1605,7 +1626,25 @@ cindex($0, setting) item(tt(FUNCTION_ARGZERO) )( When executing a shell function or sourcing a script, set tt($0) -temporarily to the name of the function/script. +temporarily to the name of the function/script. Note that toggling +tt(FUNCTION_ARGZERO) from on to off (or off to on) does not change the +current value of tt($0). Only the state upon entry to the function or +script has an effect. Compare tt(POSIX_ARGZERO). +) +pindex(LOCAL_LOOPS) +pindex(NO_LOCAL_LOOPS) +pindex(LOCALLOOPS) +pindex(NOLOCALLOOPS) +cindex(break, inside function) +cindex(continue, inside function) +cindex(function, scope of break and continue) +item(tt(LOCAL_LOOPS))( +When this option is not set, the effect of tt(break) and tt(continue) +commands may propagate outside function scope, affecting loops in +calling functions. When the option is set in a calling function, a +tt(break) or a tt(continue) that is not caught within a called function +(regardless of the setting of the option within that function) +produces a warning and the effect is cancelled. ) pindex(LOCAL_OPTIONS) pindex(NO_LOCAL_OPTIONS) @@ -1615,10 +1654,10 @@ If this option is set at the point of return from a shell function, most options (including this one) which were in force upon entry to the function are restored; options that are not restored are -tt(PRIVILEGED) and tt(RESTRICTED). Otherwise, only this option and the -tt(XTRACE) and tt(PRINT_EXIT_VALUE) options are restored. Hence -if this is explicitly unset by a shell function the other options in -force at the point of return will remain so. +tt(PRIVILEGED) and tt(RESTRICTED). Otherwise, only this option, +and the tt(LOCAL_LOOPS), tt(XTRACE) and tt(PRINT_EXIT_VALUE) options are +restored. Hence if this is explicitly unset by a shell function the +other options in force at the point of return will remain so. A shell function can also guarantee itself a known shell configuration with a formulation like `tt(emulate -L zsh)'; the tt(-L) activates tt(LOCAL_OPTIONS). @@ -1741,7 +1780,7 @@ cindex(commands, tracing) item(tt(XTRACE) (tt(-x), ksh: tt(-x)))( Print commands and their arguments as they are executed. The -output is proceded by the value of tt($PS4), formatted as described +output is preceded by the value of tt($PS4), formatted as described in ifzman(the section EXPANSION OF PROMPT SEQUENCES in zmanref(zshmisc))\ ifnzman(noderef(Prompt Expansion)). @@ -1942,6 +1981,26 @@ in later lines. If in doubt, avoid use of aliases in non-interactive code. ) +pindex(POSIX_ARGZERO) +pindex(NO_POSIX_ARGZERO) +pindex(POSIXARGZERO) +pindex(NOPOSIXARGZERO) +cindex($0, using) +item(tt(POSIX_ARGZERO))( +This option may be used to temporarily disable tt(FUNCTION_ARGZERO) and +thereby restore the value of tt($0) to the name used to invoke the shell +(or as set by the tt(-c) command line option). For compatibility with +previous versions of the shell, emulations use tt(NO_FUNCTION_ARGZERO) +instead of tt(POSIX_ARGZERO), which may result in unexpected scoping of +tt($0) if the emulation mode is changed inside a function or script. +To avoid this, explicitly enable tt(POSIX_ARGZERO) in the tt(emulate) +command: + +example(emulate sh -o POSIX_ARGZERO) + +Note that tt(NO_POSIX_ARGZERO) has no effect unless tt(FUNCTION_ARGZERO) +was already enabled upon entry to the function or script. +) pindex(POSIX_BUILTINS) pindex(NO_POSIX_BUILTINS) pindex(POSIXBUILTINS) @@ -2020,7 +2079,7 @@ When this option is set, the tt($')var(...)tt(') expression is truncated at the null character. Note that remaining parts of the same string -beyond the termination of the quotes are not trunctated. +beyond the termination of the quotes are not truncated. For example, the command line argument tt(a$'b\0c'd) is treated with the option off as the characters tt(a), tt(b), null, tt(c), tt(d), @@ -2037,7 +2096,10 @@ traps for tt(EXIT) on exit from shell functions is suppressed. In that case, manipulating tt(EXIT) traps always alters the global trap for exiting the shell; the tt(LOCAL_TRAPS) option is -ignored for the tt(EXIT) trap. +ignored for the tt(EXIT) trap. Furthermore, a tt(return) statement +executed in a trap with no argument passes back from the function the +value from the surrounding context, not from code executed within the +trap. ) pindex(SH_FILE_EXPANSION) pindex(NO_SH_FILE_EXPANSION) diff -Nru zsh-5.0.5/Doc/Zsh/params.yo zsh-5.0.7/Doc/Zsh/params.yo --- zsh-5.0.5/Doc/Zsh/params.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/params.yo 2014-10-07 18:11:30.000000000 +0000 @@ -21,14 +21,20 @@ If the integer attribute, tt(-i), is set for var(name), the var(value) is subject to arithmetic evaluation. Furthermore, by replacing `tt(=)' -with `tt(+=)', a parameter can be added or appended to. See +with `tt(+=)', a parameter can be added or appended to. + +In scalar assignment, var(value) is expanded as a single string, in +which the elements of arrays are joined together; filename expansion is +not performed unless the option tt(GLOB_ASSIGN) is set. See noderef(Array Parameters) for additional forms of assignment. To refer to the value of a parameter, write `tt($)var(name)' or `tt(${)var(name)tt(})'. See ifzman(em(Parameter Expansion) in zmanref(zshexpn))\ ifnzman(noderef(Parameter Expansion)) -for complete details. +for complete details. This section also explains the effect +of the difference between scalar and array assignment on parameter +expansion. In the parameter lists that follow, the mark `' indicates that the parameter is special. @@ -541,9 +547,11 @@ ) vindex(0) item(tt(0) )( -The name used to invoke the current shell. If the tt(FUNCTION_ARGZERO) option -is set, this is set temporarily within a shell function to the name of the -function, and within a sourced script to the name of the script. +The name used to invoke the current shell, or as set by the tt(-c) command +line option upon invocation. If the tt(FUNCTION_ARGZERO) option is set, +tt($0) is set upon entry to a shell function to the name of the function, +and upon entry to a sourced script to the name of the script, and reset to +its previous value when the function or script returns. ) vindex(status) item(tt(status) )( @@ -599,9 +607,10 @@ ) vindex(HISTCMD) item(tt(HISTCMD))( -The current history line number in an interactive shell, in other -words the line number for the command that caused tt($HISTCMD) -to be read. +The current history event number in an interactive shell, in other +words the event number for the command that caused tt($HISTCMD) +to be read. If the current history event modifies the history, +tt(HISTCMD) changes to the new maximum history event number. ) vindex(HOST) item(tt(HOST))( @@ -620,7 +629,9 @@ If the corresponding variable is not set in the environment of the shell, it is initialized to the login name corresponding to the current login session. This parameter is exported by default but -this can be disabled using the tt(typeset) builtin. +this can be disabled using the tt(typeset) builtin. The value +is set to the string returned by the manref(getlogin)(3) system call +if that is available. ) vindex(MACHTYPE) item(tt(MACHTYPE))( @@ -914,6 +925,14 @@ example just given files beginning with `tt(_)' in the current directory would still be completed). ) +vindex(CORRECT_IGNORE_FILE) +item(tt(CORRECT_IGNORE_FILE))( +If set, is treated as a pattern during spelling correction of file names. +Any file name that matches the pattern is never offered as a correction. +For example, if the value is `tt(.*)' then dot file names will never be +offered as spelling corrections. This is useful with the +tt(CORRECT_ALL) option. +) vindex(DIRSTACKSIZE) item(tt(DIRSTACKSIZE))( The maximum size of the directory stack, by default there is no limit. If the @@ -1023,7 +1042,7 @@ doublequote or backquote, there must also be an odd number of them on the command line for the last one to be removed. -For backward compabitility, if the tt(SUNKEYBOARDHACK) option is +For backward compatibility, if the tt(SUNKEYBOARDHACK) option is explicitly set, the value of tt(KEYBOARD_HACK) reverts to backquote. If the option is explicitly unset, this variable is set to empty. ) diff -Nru zsh-5.0.5/Doc/Zsh/prompt.yo zsh-5.0.7/Doc/Zsh/prompt.yo --- zsh-5.0.5/Doc/Zsh/prompt.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/prompt.yo 2014-10-07 18:11:30.000000000 +0000 @@ -108,6 +108,12 @@ ifzman(see em(Dynamic) and em(Static named directories) in zmanref(zshexpn))\ ifnzman(noderef(Filename Expansion)). ) +item(tt(%e))( +Evaluation depth of the current sourced file, shell function, or tt(eval). +This is incremented or decremented every time the value of tt(%N) is +set or reverted to a previous value, respectively. This is most useful +for debugging as part of tt($PS4). +) xitem(tt(%h)) item(tt(%!))( Current history event number. @@ -185,6 +191,13 @@ sitem(tt(%L))(the hour of the day on the 12-hour clock) endsitem() +In addition, if the system supports the POSIX tt(gettimeofday) system +call, tt(%.) provides decimal fractions of a second since the epoch with +leading zeroes. By default three decimal places are provided, but a +number of digits up to 6 may be given following the tt(%); hence tt(%6.) +outputs microseconds. A typical example of this is the format +`tt(%D{%H:%M:%S.%.})'. + The GNU extension that a `tt(-)' between the tt(%) and the format character causes a leading zero or space to be stripped is handled directly by the shell for the format characters tt(d), tt(f), @@ -273,7 +286,8 @@ sequences, including further ternary expressions. The left parenthesis may be preceded or followed by a positive integer var(n), -which defaults to zero. A negative integer will be multiplied by -1. +which defaults to zero. A negative integer will be multiplied by -1, except +as noted below for `tt(l)'. The test character var(x) may be any of the following: startsitem() @@ -291,11 +305,14 @@ counted as 0 elements.) sitem(tt(D))(True if the month is equal to var(n) (January = 0).) sitem(tt(d))(True if the day of the month is equal to var(n).) +sitem(tt(e))(True if the evaluation depth is at least var(n).) sitem(tt(g))(True if the effective gid of the current process is var(n).) sitem(tt(j))(True if the number of jobs is at least var(n).) sitem(tt(L))(True if the tt(SHLVL) parameter is at least var(n).) sitem(tt(l))(True if at least var(n) characters have already been -printed on the current line.) +printed on the current line. When var(n) is negative, true if at least +tt(abs)tt(LPAR())var(n)tt(RPAR()) characters remain before the opposite +margin (thus the left margin for tt(RPROMPT)).) sitem(tt(S))(True if the tt(SECONDS) parameter is at least var(n).) sitem(tt(T))(True if the time in hours is equal to var(n).) sitem(tt(t))(True if the time in minutes is equal to var(n).) @@ -311,13 +328,21 @@ Specifies truncation behaviour for the remainder of the prompt string. The third, deprecated, form is equivalent to `tt(%)var(xstringx)', i.e. var(x) may be `tt(<)' or `tt(>)'. -The numeric argument, which in the third form may appear immediately -after the `tt([)', specifies the maximum permitted length of -the various strings that can be displayed in the prompt. The var(string) will be displayed in place of the truncated portion of any string; note this does not undergo prompt expansion. +The numeric argument, which in the third form may appear immediately +after the `tt([)', specifies the maximum permitted length of +the various strings that can be displayed in the prompt. +In the first two forms, this numeric argument may be negative, in which +case the truncation length is determined by subtracting the absolute +value of the numeric argument from the number of character positions +remaining on the current prompt line. If this results in a zero or +negative length, a length of 1 is used. In other words, a negative +argument arranges that after truncation at least var(n) characters +remain before the right margin (left margin for tt(RPROMPT)). + The forms with `tt(<)' truncate at the left of the string, and the forms with `tt(>)' truncate at the right of the string. For example, if the current directory is `tt(/home/pike)', @@ -337,11 +362,19 @@ construct, or to the next truncation encountered at the same grouping level (i.e. truncations inside a `tt(%LPAR())' are separate), which ever comes first. In particular, a truncation with argument zero -(e.g. `tt(%<<)') marks the end of the range of the string to be +(e.g., `tt(%<<)') marks the end of the range of the string to be truncated while turning off truncation from there on. For example, the prompt '%10<...<%~%<<%# ' will print a truncated representation of the current directory, followed by a `tt(%)' or `tt(#)', followed by a space. Without the `tt(%<<)', those two characters would be included -in the string to be truncated. +in the string to be truncated. Note that `tt(%-0<<)' is a distinct + +Truncation applies only within each individual line of the prompt, as +delimited by embedded newlines (if any). If the total length of any line +of the prompt after truncation is greater than the terminal width, or if +the part to be truncated contains embedded newlines, truncation behavior +is undefined and may change in a future version of the shell. Use +`tt(%-var(n)LPAR()l.var(true-text).var(false-text)RPAR())' to remove parts +of the prompt when the available space is less than var(n). ) enditem() diff -Nru zsh-5.0.5/Doc/Zsh/roadmap.yo zsh-5.0.7/Doc/Zsh/roadmap.yo --- zsh-5.0.5/Doc/Zsh/roadmap.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/roadmap.yo 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,6 @@ texinode(Roadmap)(Invocation)(Introduction)(Top) chapter(Roadmap) cindex(roadmap) - The Zsh Manual, like the shell itself, is large and often complicated. This section of the manual provides some pointers to areas of the shell that are likely to be of particular interest to new users, and indicates diff -Nru zsh-5.0.5/Doc/Zsh/tcpsys.yo zsh-5.0.7/Doc/Zsh/tcpsys.yo --- zsh-5.0.5/Doc/Zsh/tcpsys.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/tcpsys.yo 2014-10-07 18:11:30.000000000 +0000 @@ -299,7 +299,7 @@ more explicit method. ) findex(tcp_expect) -xitem(tt(tcp_expect [ -q ] [ -p) var(var) tt(] [ -t ) var(to) tt(| -T) var(TO)tt(])) +xitem(tt(tcp_expect [ -q ] [ -p ) var(var) tt( | -P ) var(var) tt(] [ -t ) var(to) tt(| -T) var(TO)tt(])) item(tt( [ -a | -s) var(sess) tt(... | -l) var(sess)tt(,... ]) var(pattern) ...)( Wait for input matching any of the given var(pattern)s from any of the specified sessions. Input is ignored until an input line matches one of @@ -332,7 +332,16 @@ var(var) can be used; on return, tt($var) is set to the number of the pattern using ordinary zsh indexing, i.e. the first is 1, and so on. Note the absence of a `tt($)' in front of var(var). To avoid clashes, the -parameter cannot begin with `tt(_expect)'. +parameter cannot begin with `tt(_expect)'. The index -1 is used if +there is a timeout and 0 if there is no match. + +The option tt(-P) var(var) works similarly to tt(-p), but instead of +numerical indexes the regular arguments must begin with a prefix +followed by a colon: that prefix is then used as a tag to which var(var) +is set when the argument matches. The tag tt(timeout) is used if there +is a timeout and the empty string if there is no match. Note it is +acceptable for different arguments to start with the same prefix if the +matches do not need to be distinguished. The option tt(-q) is passed directly down to tt(tcp_read). @@ -666,6 +675,10 @@ session, else 0; this is most useful in ternary expressions such as `tt(%LPAR()c.-.PLUS()RPAR())' which outputs `tt(PLUS())' if the session is the current one, else `tt(-)'. + +If the prompt starts with tt(%P), this is stripped and the complete +result of the previous stage is passed through standard prompt tt(%)-style +formatting before being output. ) vindex(TCP_READ_DEBUG) item(tt(TCP_READ_DEBUG))( diff -Nru zsh-5.0.5/Doc/Zsh/zle.yo zsh-5.0.7/Doc/Zsh/zle.yo --- zsh-5.0.5/Doc/Zsh/zle.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/Zsh/zle.yo 2014-10-07 18:11:30.000000000 +0000 @@ -252,6 +252,9 @@ When var(in-string) is typed, var(out-string) will be pushed back and treated as input to the line editor. When tt(-R) is also used, interpret the var(in-string)s as ranges. + +Note that both var(in-string) and var(out-string) are subject to the same +form of interpretation, as described below. ) item(var(in-string command) ...)( Bind each var(in-string) to each var(command). @@ -492,26 +495,35 @@ calls; most modern systems do. Installs var(handler) (the name of a shell function) to handle input from -file descriptor var(fd). When zle is attempting to read data, it will -examine both the terminal and the list of handled var(fd)'s. If data -becomes available on a handled var(fd), zle will call var(handler) with -the fd which is ready for reading as the only argument. If the handler -produces output to the terminal, it should call `tt(zle -I)' before doing -so (see below). The handler should not attempt to read from the terminal. -Note that zle makes no attempt to check whether this fd is actually +file descriptor var(fd). Installing a handler for an var(fd) which is +already handled causes the existing handler to be replaced. Any number of +handlers for any number of readable file descriptors may be installed. +Note that zle makes no attempt to check whether this var(fd) is actually readable when installing the handler. The user must make their own arrangements for handling the file descriptor when zle is not active. -If the option tt(-w) is also given, the var(handler) is instead a -line editor widget, typically a shell function made into a widget using -tt(zle -N). In that case var(handler) can use all the facilities of -zle to update the current editing line. Note, however, that as handling -var(fd) takes place at a low level changes to the display will not -automatically appear; the widget should call tt(zle -R) to force redisplay. - -Any number of handlers for any number of readable file descriptors may be -installed. Installing a handler for an var(fd) which is already handled -causes the existing handler to be replaced. +When zle is attempting to read data, it will examine both the terminal and +the list of handled var(fd)'s. If data becomes available on a handled +var(fd), zle calls var(handler) with the fd which is ready for reading +as the first argument. Under normal circumstances this is the only +argument, but if an error was detected, a second argument provides +details: `tt(hup)' for a disconnect, `tt(nval)' for a closed or otherwise +invalid descriptor, or `tt(err)' for any other condition. Systems that +support only the `select' system call always use `tt(err)'. + +If the option tt(-w) is also given, the var(handler) is instead a line +editor widget, typically a shell function made into a widget using +`tt(zle -N)'. In that case var(handler) can use all the facilities of zle +to update the current editing line. Note, however, that as handling var(fd) +takes place at a low level changes to the display will not automatically +appear; the widget should call `tt(zle -R)' to force redisplay. As of this +writing, widget handlers only support a single argument and thus are never +passed a string for error state, so widgets must be prepared to test the +descriptor themselves. + +If either type of handler produces output to the terminal, it should call +`tt(zle -I)' before doing so (see below). Handlers should not attempt to +read from the terminal. If no var(handler) is given, but an var(fd) is present, any handler for that var(fd) is removed. If there is none, an error message is printed @@ -526,7 +538,8 @@ Note that this feature should be used with care. Activity on one of the var(fd)'s which is not properly handled can cause the terminal to become -unusable. +unusable. Removing an var(fd) handler from within a signal trap may cause +unpredictable behavior. Here is a simple example of using this feature. A connection to a remote TCP port is created using the ztcp command; see @@ -536,6 +549,7 @@ that `select' will indicate that the file descriptor needs handling if the remote side has closed the connection; we handle that by testing for a failed read. + example(if ztcp pwspc 2811; then tcpfd=$REPLY handler+LPAR()RPAR() { @@ -716,17 +730,18 @@ item(tt(CONTEXT) (scalar))( The context in which zle was called to read a line; read-only. One of the values: + startitem() -item(start)( +item(tt(start))( The start of a command line (at prompt tt(PS1)). ) -item(cont)( +item(tt(cont))( A continuation to a command line (at prompt tt(PS2)). ) -item(select)( +item(tt(select))( In a tt(select) loop. ) -item(vared)( +item(tt(vared))( Editing a variable in tt(vared). ) enditem() @@ -863,21 +878,21 @@ Each string consists of the following parts: -startlist() -list(Optionally, a `tt(P)' to signify that the start and end offset that +startitemize() +itemiz(Optionally, a `tt(P)' to signify that the start and end offset that follow include any string set by the tt(PREDISPLAY) special parameter; this is needed if the predisplay string itself is to be highlighted. Whitespace may follow the `tt(P)'.) -list(A start offset in the same units as tt(CURSOR), terminated by +itemiz(A start offset in the same units as tt(CURSOR), terminated by whitespace.) -list(An end offset in the same units as tt(CURSOR), terminated by +itemiz(An end offset in the same units as tt(CURSOR), terminated by whitespace.) -list(A highlight specification in the same format as +itemiz(A highlight specification in the same format as used for contexts in the parameter tt(zle_highlight), ifnzman(noderef(Character Highlighting))\ ifzman(see Character Highlighting below); for example, tt(standout) or tt(fg=red,bold)). -endlist() +enditemize() For example, @@ -1293,8 +1308,11 @@ Redisplay the command line, remaining in incremental search mode. ) item(tt(vi-cmd-mode))( -Toggle between the `tt(main)' and `tt(vicmd)' keymaps; +Select the `tt(vicmd)' keymap; the `tt(main)' keymap (insert mode) will be selected initially. + +In addition, the modifications that were made while in vi insert mode are +merged to form a single undo event. ) xitem(tt(vi-repeat-search)) item(tt(vi-rev-repeat-search))( @@ -2191,6 +2209,13 @@ item(tt(spell-word) (ESC-$ ESC-S ESC-s) (unbound) (unbound))( Attempt spelling correction on the current word. ) +tindex(split-undo) +item(tt(split-undo))( +Breaks the undo sequence at the current change. This is useful in vi mode as +changes made in insert mode are coalesced on entering command mode. Similarly, +tt(undo) will normally revert as one all the changes made by a user-defined +widget. +) tindex(undefined-key) item(tt(undefined-key))( This command is executed when a key sequence that is not bound to any @@ -2202,6 +2227,10 @@ user-defined widget, takes an optional argument indicating a previous state of the undo history as returned by the tt(UNDO_CHANGE_NO) variable; modifications are undone until that state is reached. + +Note that when invoked from vi command mode, the full prior change made in +insert mode is reverted, the changes having been merged when command mode was +selected. ) tindex(redo) item(tt(redo))( @@ -2286,7 +2315,7 @@ ) cindex(completion removable suffix, highlighting) cindex(suffix, highlighting removable, in completion) -cindex(removable suffix, highlighting in completino) +cindex(removable suffix, highlighting in completion) item(tt(suffix))( This context is used in completion for characters that are marked as suffixes that will be removed if the completion ends diff -Nru zsh-5.0.5/Doc/zsh.yo zsh-5.0.7/Doc/zsh.yo --- zsh-5.0.5/Doc/zsh.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/zsh.yo 2014-10-07 18:11:30.000000000 +0000 @@ -41,6 +41,7 @@ Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions. texiendtitlepage() +NOTRANS(@contents) )\ ifnzman(includefile(Zsh/manual.yo)) includefile(Zsh/intro.yo) diff -Nru zsh-5.0.5/Doc/ztexi.yo zsh-5.0.7/Doc/ztexi.yo --- zsh-5.0.5/Doc/ztexi.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Doc/ztexi.yo 2014-10-07 18:11:30.000000000 +0000 @@ -16,7 +16,6 @@ ATEXIT(\ NL()\ - NOTRANS(@contents)+NL()\ NOTRANS(@bye)NL()\ ) diff -Nru zsh-5.0.5/Etc/.distfiles zsh-5.0.7/Etc/.distfiles --- zsh-5.0.5/Etc/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Etc/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,28 +1,7 @@ DISTFILES_SRC=' -.cvsignore -.distfiles -BUGS -CONTRIBUTORS -ChangeLog-3.0 -ChangeLog-3.1 -ChangeLog-4.1 -ChangeLog-4.3 FAQ -FAQ.yo -FTP-README -Makefile.in -NEWS-4.3 -STD-TODO TODO -changelog2html.pl -completion-style-guide -pubring.pgp -relnote_4.3.5.txt -relnote_4.3.6.txt -relnote_4.3.7.txt -relnote_4.3.8.txt -relnote_4.3.9.txt -relnote_4.3.10.txt -relnote_4.3.12.txt -relnote_5.0.0.txt -zsh-development-guide +' + +DISTFILES_DOC=' +FAQ*.html ' diff -Nru zsh-5.0.5/Etc/FAQ.yo zsh-5.0.7/Etc/FAQ.yo --- zsh-5.0.5/Etc/FAQ.yo 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Etc/FAQ.yo 2014-10-07 18:11:30.000000000 +0000 @@ -302,7 +302,7 @@ sect(What's the latest version?) - Zsh 5.0.5 is the latest production version. For details of all the + Zsh 5.0.7 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 diff -Nru zsh-5.0.5/Etc/.gitignore zsh-5.0.7/Etc/.gitignore --- zsh-5.0.5/Etc/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Etc/.gitignore 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1 @@ +FAQ*.html diff -Nru zsh-5.0.5/Etc/zsh-development-guide zsh-5.0.7/Etc/zsh-development-guide --- zsh-5.0.5/Etc/zsh-development-guide 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Etc/zsh-development-guide 2014-10-07 18:11:30.000000000 +0000 @@ -931,18 +931,22 @@ To indicate which files should be distributed, each directory in the git tree includes a file .distfiles that sets any number of a set of Bourne shell (scalar) parameters. The value of the parameter is expanded as a -set of standard command line arguments. Basic globbing is allowed in the -values. +set of standard command line arguments. Apart from DISTFILES_NOT, which +must be an explicit list of files separated by whitespace, basic +globbing is allowed in the values. + +Because of the way DISTFILES_SRC is constructed it is only possible +to make a release from a git checkout. The following parameters are currently used: - DISTFILES_SRC is a list of files from the directory for the "src" - distribution. + distribution. However, if the file .distfiles is present in + a directory, all files known to git will be added to DISTFILES_SRC + except for files listed explicitly in DISTFILES_NOT. - DISTFILES_DOC is a list of files from the directory for the "doc" distribution. - DISTFILES_NOT is a list of files that will not be included in a - distribution, but that need to be present in the git tree. This - variable is not used by the zsh build process and is present for - the convenience of external checks. + distribution even though they are present in the git tree. diff -Nru zsh-5.0.5/Functions/Calendar/.distfiles zsh-5.0.7/Functions/Calendar/.distfiles --- zsh-5.0.5/Functions/Calendar/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Calendar/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,14 +1,2 @@ DISTFILES_SRC=' -.distfiles -age -calendar -calendar_add -calendar_edit -calendar_lockfiles -calendar_parse -calendar_read -calendar_scandate -calendar_show -calendar_showdate -calendar_sort ' diff -Nru zsh-5.0.5/Functions/Chpwd/.distfiles zsh-5.0.7/Functions/Chpwd/.distfiles --- zsh-5.0.5/Functions/Chpwd/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Chpwd/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,9 +1,2 @@ DISTFILES_SRC=' -.distfiles -cdr -_cdr -chpwd_recent_add -chpwd_recent_dirs -chpwd_recent_filehandler -zsh_directory_name_cdr ' diff -Nru zsh-5.0.5/Functions/Compctl/.distfiles zsh-5.0.7/Functions/Compctl/.distfiles --- zsh-5.0.5/Functions/Compctl/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Compctl/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -cdmatch cdmatch2 multicomp ' diff -Nru zsh-5.0.5/Functions/.distfiles zsh-5.0.7/Functions/.distfiles --- zsh-5.0.5/Functions/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,3 +1,2 @@ DISTFILES_SRC=' - .cvsignore .distfiles README.zftp ' diff -Nru zsh-5.0.5/Functions/Example/.distfiles zsh-5.0.7/Functions/Example/.distfiles --- zsh-5.0.5/Functions/Example/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Example/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,6 +1,2 @@ DISTFILES_SRC=' -.distfiles -acx cx pushd yp zless -cat proto randline yu zls -zpgrep ' diff -Nru zsh-5.0.5/Functions/Exceptions/.distfiles zsh-5.0.7/Functions/Exceptions/.distfiles --- zsh-5.0.5/Functions/Exceptions/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Exceptions/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -catch throw ' diff -Nru zsh-5.0.5/Functions/MIME/.distfiles zsh-5.0.7/Functions/MIME/.distfiles --- zsh-5.0.5/Functions/MIME/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/MIME/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,2 @@ DISTFILES_SRC=' -.distfiles -pick-web-browser -zsh-mime-contexts -zsh-mime-handler -zsh-mime-setup ' diff -Nru zsh-5.0.5/Functions/Misc/.distfiles zsh-5.0.7/Functions/Misc/.distfiles --- zsh-5.0.5/Functions/Misc/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Misc/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,34 +1,2 @@ DISTFILES_SRC=' -.distfiles -add-zsh-hook -allopt -checkmail -colors -getjobs -harden -is-at-least -mere -nslookup -promptnl -regexp-replace -relative -run-help -run-help-git -run-help-openssl -run-help-p4 -run-help-sudo -run-help-svk -run-help-svn -sticky-note -tetris -xtermctl -zargs -zcalc -zed -zkbd -zmathfuncdef -zmv -zrecompile -zstyle+ -ztodo ' diff -Nru zsh-5.0.5/Functions/Misc/zcalc zsh-5.0.7/Functions/Misc/zcalc --- zsh-5.0.5/Functions/Misc/zcalc 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Misc/zcalc 2014-10-07 18:11:30.000000000 +0000 @@ -96,6 +96,9 @@ emulate -L zsh setopt extendedglob +# For testing in ZLE functions. +local ZCALC_ACTIVE=1 + # TODO: make local variables that shouldn't be visible in expressions # begin with _. local line ans base defbase forms match mbegin mend psvar optlist opt arg @@ -196,8 +199,8 @@ # special cases # Set default base if `[#16]' or `[##16]' etc. on its own. # Unset it if `[#]' or `[##]'. - if [[ $line = (#b)[[:blank:]]#('[#'(\#|)(<->|)']')[[:blank:]]#(*) ]]; then - if [[ -z $match[4] ]]; then + if [[ $line = (#b)[[:blank:]]#('[#'(\#|)((<->|)(|_|_<->))']')[[:blank:]]#(*) ]]; then + if [[ -z $match[6] ]]; then if [[ -z $match[3] ]]; then defbase= else diff -Nru zsh-5.0.5/Functions/Newuser/.distfiles zsh-5.0.7/Functions/Newuser/.distfiles --- zsh-5.0.5/Functions/Newuser/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Newuser/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -zsh-newuser-install ' diff -Nru zsh-5.0.5/Functions/Prompts/.distfiles zsh-5.0.7/Functions/Prompts/.distfiles --- zsh-5.0.5/Functions/Prompts/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Prompts/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,20 +1,2 @@ DISTFILES_SRC=' -.distfiles -prompt_adam1_setup -prompt_adam2_setup -prompt_bart_setup -prompt_bigfade_setup -prompt_clint_setup -prompt_elite2_setup -prompt_elite_setup -prompt_fade_setup -prompt_fire_setup -prompt_off_setup -prompt_oliver_setup -prompt_pws_setup -prompt_redhat_setup -prompt_special_chars -prompt_suse_setup -prompt_walters_setup -prompt_zefram_setup -promptinit' +' diff -Nru zsh-5.0.5/Functions/TCP/.distfiles zsh-5.0.7/Functions/TCP/.distfiles --- zsh-5.0.5/Functions/TCP/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/TCP/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,2 @@ DISTFILES_SRC=' -.distfiles -tcp_command tcp_log tcp_proxy tcp_send tcp_talk -tcp_alias tcp_expect tcp_open tcp_read tcp_sess tcp_wait -tcp_close tcp_fd_handler tcp_output tcp_rename tcp_spam -tcp_point tcp_shoot ' diff -Nru zsh-5.0.5/Functions/TCP/tcp_expect zsh-5.0.7/Functions/TCP/tcp_expect --- zsh-5.0.5/Functions/TCP/tcp_expect 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/TCP/tcp_expect 2014-10-07 18:11:30.000000000 +0000 @@ -25,6 +25,15 @@ # set it to 0. # To avoid namespace clashes, the parameter's name must # not begin with `_expect'. +# -P pv This is similar to -p, however in this case the +# arguments to tcp_expect following the options are expected +# to start with a prefix ":". The parameter $pv is +# then set to the value "" rather than the numeric +# index of the parameter. The string "timeout" is used +# as the tag for a timeout specified by -t and -T and +# on a failed match the variable is set to the empty string. +# It is not an error for multiple arguments to have +# the same tag or to use a reserved value of the tag. # -q Quiet, passed down to tcp_read. Bad option and argument # usage is always reported. # -s sess @@ -45,18 +54,18 @@ fi # Variables are all named _expect_* to avoid problems with the -p param. -local _expect_opt _expect_pvar +local _expect_opt _expect_pvar _expect_state _expect_arg _expect_ind local -a _expect_read_args float _expect_to1 _expect_to_all _expect_to _expect_new_to -integer _expect_i _expect_stat +integer _expect_i _expect_stat _expect_states -while getopts "al:p:qs:t:T:" _expect_opt; do +while getopts "al:p:P:qs:t:T:" _expect_opt; do case $_expect_opt in (a) _expect_read_args+=(-a) ;; (l) _expect_read_args+=(-l $OPTARG) ;; - (p) _expect_pvar=$OPTARG + ([pP]) _expect_pvar=$OPTARG if [[ $_expect_pvar != [a-zA-Z_][a-zA-Z_0-9]# ]]; then print "invalid parameter name: $_expect_pvar" >&2 return 1 @@ -65,7 +74,12 @@ print "$0: parameter names staring \`_expect' are reserved." return 1 fi - eval "$_expect_pvar=0" + if [[ $_expect_opt = "P" ]]; then + eval "$_expect_pvar=0" + _expect_states=1 + else + eval "$_expect_pvar=" + fi ;; (q) _expect_read_args+=(-q) ;; @@ -112,8 +126,15 @@ fi tcp_expect_lines+=($TCP_LINE) for (( _expect_i = 1; _expect_i <= $#; _expect_i++ )); do - if [[ "$TCP_LINE" = ${~argv[_expect_i]} ]]; then - [[ -n $_expect_pvar ]] && eval "$_expect_pvar=\$_expect_i" + if [[ _expect_states -ne 0 && $argv[_expect_i] = (#b)([^:]#):(*) ]]; then + _expect_ind=$match[1] + _expect_arg=$match[2] + else + _expect_ind=$_expect_i + _expect_arg=$argv[_expect_i] + fi + if [[ "$TCP_LINE" = ${~_expect_arg} ]]; then + [[ -n $_expect_pvar ]] && eval "$_expect_pvar=\$_expect_ind" return 0 fi done diff -Nru zsh-5.0.5/Functions/TCP/tcp_output zsh-5.0.7/Functions/TCP/tcp_output --- zsh-5.0.5/Functions/TCP/tcp_output 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/TCP/tcp_output 2014-10-07 18:11:30.000000000 +0000 @@ -35,6 +35,9 @@ cursess="c:0" fi zformat -f REPLY $tprompt "s:$sess" "f:$read_fd" $cursess + if [[ $REPLY = %P* ]]; then + REPLY=${(%)${REPLY##%P}} + fi # We will pass this back up. REPLY="$REPLY$*" else diff -Nru zsh-5.0.5/Functions/VCS_Info/Backends/.distfiles zsh-5.0.7/Functions/VCS_Info/Backends/.distfiles --- zsh-5.0.5/Functions/VCS_Info/Backends/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/Backends/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,27 +1,2 @@ DISTFILES_SRC=' -.distfiles -VCS_INFO_detect_bzr -VCS_INFO_detect_cdv -VCS_INFO_detect_cvs -VCS_INFO_detect_darcs -VCS_INFO_detect_fossil -VCS_INFO_detect_git -VCS_INFO_detect_hg -VCS_INFO_detect_mtn -VCS_INFO_detect_p4 -VCS_INFO_detect_svk -VCS_INFO_detect_svn -VCS_INFO_detect_tla -VCS_INFO_get_data_bzr -VCS_INFO_get_data_cdv -VCS_INFO_get_data_cvs -VCS_INFO_get_data_darcs -VCS_INFO_get_data_fossil -VCS_INFO_get_data_git -VCS_INFO_get_data_hg -VCS_INFO_get_data_mtn -VCS_INFO_get_data_p4 -VCS_INFO_get_data_svk -VCS_INFO_get_data_svn -VCS_INFO_get_data_tla ' diff -Nru zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_detect_hg zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_detect_hg --- zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_detect_hg 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_detect_hg 2014-10-07 18:11:30.000000000 +0000 @@ -7,7 +7,7 @@ [[ $1 == '--flavours' ]] && { print -l hg-git hg-hgsubversion hg-hgsvn; return 0 } VCS_INFO_check_com ${vcs_comm[cmd]} || return 1 -vcs_comm[detect_need_file]="store data" +vcs_comm[detect_need_file]="store data sharedpath" VCS_INFO_bydir_detect '.hg' || return 1 if [[ -d ${vcs_comm[basedir]}/.hg/svn ]] ; then diff -Nru zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_get_data_git zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_get_data_git --- zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_get_data_git 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_get_data_git 2014-10-07 18:11:30.000000000 +0000 @@ -3,8 +3,9 @@ ## Distributed under the same BSD-ish license as zsh itself. setopt localoptions extendedglob NO_shwordsplit -local gitdir gitbase gitbranch gitaction gitunstaged gitstaged gitsha1 -local stgitpatch stgitunapplied +local gitdir gitbase gitbranch gitaction gitunstaged gitstaged gitsha1 gitmisc +local -i querystaged queryunstaged +local -a git_patches_applied git_patches_unapplied local -A hook_com VCS_INFO_git_getaction () { @@ -61,6 +62,11 @@ return 0 fi + if [[ -d "${gitdir}/sequencer" ]] ; then + gitaction="cherry-or-revert" + return 0 + fi + return 1 } @@ -96,7 +102,7 @@ gitbranch="$(${(z)gitsymref} 2> /dev/null)" if [[ $? -ne 0 ]] ; then - gitbranch="refs/tags/$(${vcs_comm[cmd]} describe --exact-match HEAD 2>/dev/null)" + gitbranch="refs/tags/$(${vcs_comm[cmd]} describe --all --exact-match HEAD 2>/dev/null)" if [[ $? -ne 0 ]] ; then gitbranch="${${"$(< $gitdir/HEAD)"}[1,7]}..." @@ -107,8 +113,48 @@ return 0 } +VCS_INFO_git_handle_patches () { + local git_applied_s git_unapplied_s gitmsg git_all + git_patches_applied=(${(Oa)git_patches_applied}) + git_patches_unapplied=(${(Oa)git_patches_unapplied}) + (( git_all = ${#git_patches_applied} + ${#git_patches_unapplied} )) + + if VCS_INFO_hook 'gen-applied-string' "${git_patches_applied[@]}"; then + if (( ${#git_patches_applied} )); then + git_applied_s=${git_patches_applied[1]} + else + git_applied_s="" + fi + else + git_applied_s=${hook_com[applied-string]} + fi + hook_com=() + if VCS_INFO_hook 'gen-unapplied-string' "${git_patches_unapplied[@]}"; then + git_patches_unapplied=${#git_patches_unapplied} + else + git_patches_unapplied=${hook_com[unapplied-string]} + fi + + if (( ${#git_patches_applied} )); then + zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" patch-format gitmsg || gitmsg="%p (%n applied)" + else + zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" nopatch-format gitmsg || gitmsg="no patch applied" + fi + hook_com=( applied "${git_applied_s}" unapplied "${git_patches_unapplied}" + applied-n ${#git_patches_applied} unapplied-n ${#git_patches_unapplied} all-n ${git_all} ) + if VCS_INFO_hook 'set-patch-format' "${gitmsg}"; then + zformat -f gitmisc "${gitmsg}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \ + "n:${#git_patches_applied}" "c:${#git_patches_unapplied}" "a:${git_all}" + else + gitmisc=${hook_com[patch-replace]} + fi + hook_com=() +} + gitdir=${vcs_comm[gitdir]} VCS_INFO_git_getbranch ${gitdir} +gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel ) +rrn=${gitbase:t} if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" get-revision ; then gitsha1=$(${vcs_comm[cmd]} rev-parse --quiet --verify HEAD) else @@ -120,67 +166,75 @@ return 1 fi -if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \ - [[ "$(${vcs_comm[cmd]} rev-parse --is-inside-git-dir 2> /dev/null)" != 'true' ]] && \ - ${vcs_comm[cmd]} rev-parse --quiet --verify HEAD &> /dev/null ; then +if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" ; then + querystaged=1 + queryunstaged=1 +elif zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-staged-changes" ; then + querystaged=1 +fi +if (( querystaged || queryunstaged )) && \ + [[ "$(${vcs_comm[cmd]} rev-parse --is-inside-work-tree 2> /dev/null)" == 'true' ]] ; then # Default: off - these are potentially expensive on big repositories - ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules --quiet --exit-code || - gitunstaged=1 - ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules HEAD 2> /dev/null - (( $? && $? != 128 )) && gitstaged=1 + if (( queryunstaged )) ; then + ${vcs_comm[cmd]} diff --no-ext-diff --ignore-submodules=dirty --quiet --exit-code || + gitunstaged=1 + fi + if (( querystaged )) ; then + if ${vcs_comm[cmd]} rev-parse --quiet --verify HEAD &> /dev/null ; then + ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules=dirty HEAD 2> /dev/null + (( $? && $? != 128 )) && gitstaged=1 + else + # empty repository (no commits yet) + # 4b825dc642cb6eb9a060e54bf8d69288fbee4904 is the git empty tree. + ${vcs_comm[cmd]} diff-index --cached --quiet --ignore-submodules=dirty 4b825dc642cb6eb9a060e54bf8d69288fbee4904 2>/dev/null + (( $? && $? != 128 )) && gitstaged=1 + fi + fi fi VCS_INFO_adjust VCS_INFO_git_getaction ${gitdir} -gitbase=$( ${vcs_comm[cmd]} rev-parse --show-toplevel ) -rrn=${gitbase:t} + + +VCS_INFO_get_get_rebase() +{ + if [[ -f "$1" ]]; then + echo "$(< "$1")" + fi +} local patchdir=${gitdir}/patches/${gitbranch} if [[ -d $patchdir ]] && [[ -f $patchdir/applied ]] \ && [[ -f $patchdir/unapplied ]] then - local -a stgit_applied stgit_unapplied stgit_all - - stgit_applied=(${(f)"$(< "${patchdir}/applied")"}) - stgit_applied=( ${(Oa)stgit_applied} ) - stgit_unapplied=(${(f)"$(< "${patchdir}/unapplied")"}) - stgit_unapplied=( ${(oa)stgit_unapplied} ) - stgit_all=( ${(Oa)stgit_applied} ${stgit_unapplied} ) - - if VCS_INFO_hook 'gen-applied-string' "${stgit_applied[@]}"; then - if (( ${#stgit_applied} )); then - stgitpatch=${stgit_applied[1]} - else - stgitpatch="" - fi - else - stgitpatch=${hook_com[patch-string]} - fi - hook_com=() - if VCS_INFO_hook 'gen-unapplied-string' "${stgit_unapplied[@]}"; then - stgitunapplied=${#stgit_unapplied} - else - stgitunapplied=${hook_com[unapplied-string]} - fi + git_patches_applied=(${(f)"$(< "${patchdir}/applied")"}) + git_patches_unapplied=(${(f)"$(< "${patchdir}/unapplied")"}) + VCS_INFO_git_handle_patches +elif [[ -d "${gitdir}/rebase-merge" ]]; then + patchdir="${gitdir}/rebase-merge" + local p + for p in ${(f)"$(< "${patchdir}/done")"}; do + # remove action + git_patches_applied+=("${${(s: :)p}[2,-1]}") + done + git_patches_unapplied=(${(f)"$(grep -v '^$' "${patchdir}/git-rebase-todo" | grep -v '^#')"}) + VCS_INFO_git_handle_patches +elif [[ -d "${gitdir}/rebase-apply" ]]; then + # Fake patch names for all but current patch + patchdir="${gitdir}/rebase-apply" + local cur=$(< "${patchdir}/next") + local p + for p in $(seq $(($cur - 1))); do + git_patches_applied+=("$(printf "%04d" $p) ?") + done + git_patches_applied+=("$(< "${patchdir}/original-commit") ${${(f)$(< "${patchdir}/msg-clean")}[1]}") + git_patches_unapplied=($(seq $cur $(< "${patchdir}/last"))) - if (( ${#stgit_applied} )); then - zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" patch-format stgitmsg || stgitmsg="%p (%n applied)" - else - zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" nopatch-format stgitmsg || stgitmsg="no patch applied" - fi - hook_com=( applied "${stgitpatch}" unapplied "${stgitunapplied}" - applied-n ${#stgit_applied} unapplied-n ${#stgit_unapplied} all-n ${#stgit_all} ) - if VCS_INFO_hook 'set-patch-format' "${stgitmsg}"; then - zformat -f stgitmsg "${stgitmsg}" "p:${hook_com[applied]}" "u:${hook_com[unapplied]}" \ - "n:${#stgit_applied}" "c:${#stgit_unapplied}" "a:${#stgit_all}" - else - stgitmsg=${hook_com[patch-replace]} - fi - hook_com=() + VCS_INFO_git_handle_patches else - stgitmsg='' + gitmisc='' fi -backend_misc[patches]="${stgitmsg}" -VCS_INFO_formats "${gitaction}" "${gitbranch}" "${gitbase}" "${gitstaged}" "${gitunstaged}" "${gitsha1}" "${stgitmsg}" +backend_misc[patches]="${gitmisc}" +VCS_INFO_formats "${gitaction}" "${gitbranch}" "${gitbase}" "${gitstaged}" "${gitunstaged}" "${gitsha1}" "${gitmisc}" return 0 diff -Nru zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn --- zsh-5.0.5/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/Backends/VCS_INFO_get_data_svn 2014-10-07 18:11:30.000000000 +0000 @@ -7,7 +7,7 @@ setopt localoptions noksharrays extendedglob NO_shwordsplit local svnbase svnbranch a b rrn local -i rc -local -A svninfo parentinfo +local -A svninfo parentinfo cwdinfo local -xA hook_com svnbase="."; @@ -28,24 +28,34 @@ #rc=${pipestatus[1]} #(( rc != 0 )) && return 1 -while [[ -d "${svnbase}/../.svn" ]]; do - parentinfo=() - ${vcs_comm[cmd]} info --non-interactive "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done - [[ ${parentinfo[Repository_UUID]} != ${svninfo[Repository_UUID]} ]] && break - svninfo=(${(kv)parentinfo}) - svnbase="${svnbase}/.." -done +cwdinfo=(${(kv)svninfo}) + +# Set svnbase to the wcroot path and svninfo to its `svn info`. +if (( ${+svninfo[Working_Copy_Root_Path]} )); then + # svn 1.7+ + svnbase=${svninfo[Working_Copy_Root_Path]} + ${vcs_comm[cmd]} info --non-interactive -- "${svnbase}" | while IFS=: read a b; do svninfo[${a// /_}]="${b## #}"; done +else + # svn 1.0-1.6 + while [[ -d "${svnbase}/../.svn" ]]; do + parentinfo=() + ${vcs_comm[cmd]} info --non-interactive -- "${svnbase}/.." | while IFS=: read a b; do parentinfo[${a// /_}]="${b## #}"; done + [[ ${parentinfo[Repository_UUID]} != ${svninfo[Repository_UUID]} ]] && break + svninfo=(${(kv)parentinfo}) + svnbase="${svnbase}/.." + done +fi svnbase="$(VCS_INFO_realpath ${svnbase})" rrn=${svnbase:t} zstyle -s ":vcs_info:${vcs}:${usercontext}:${rrn}" branchformat svnbranch || svnbranch="%b:%r" -hook_com=( branch "${svninfo[URL]##*/}" revision "${svninfo[Revision]}" ) +hook_com=( branch "${svninfo[URL]##*/}" revision "${cwdinfo[Revision]}" ) if VCS_INFO_hook 'set-branch-format' "${svnbranch}"; then zformat -f svnbranch "${svnbranch}" "b:${hook_com[branch]}" "r:${hook_com[revision]}" else svnbranch=${hook_com[branch-replace]} fi hook_com=() -VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${svninfo[Revision]}" '' +VCS_INFO_formats '' "${svnbranch}" "${svnbase}" '' '' "${cwdinfo[Revision]}" '' return 0 diff -Nru zsh-5.0.5/Functions/VCS_Info/.distfiles zsh-5.0.7/Functions/VCS_Info/.distfiles --- zsh-5.0.5/Functions/VCS_Info/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,21 +1,2 @@ DISTFILES_SRC=' -.distfiles -vcs_info -vcs_info_hookadd -vcs_info_hookdel -VCS_INFO_adjust -VCS_INFO_bydir_detect -VCS_INFO_check_com -VCS_INFO_formats -VCS_INFO_get_cmd -VCS_INFO_hook -vcs_info_lastmsg -VCS_INFO_maxexports -VCS_INFO_nvcsformats -vcs_info_printsys -VCS_INFO_quilt -VCS_INFO_realpath -VCS_INFO_reposub -VCS_INFO_set -vcs_info_setsys ' diff -Nru zsh-5.0.5/Functions/VCS_Info/VCS_INFO_quilt zsh-5.0.7/Functions/VCS_Info/VCS_INFO_quilt --- zsh-5.0.5/Functions/VCS_Info/VCS_INFO_quilt 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/VCS_INFO_quilt 2014-10-07 18:11:30.000000000 +0000 @@ -70,13 +70,11 @@ olddir=${vcs_comm[basedir]} vcs_comm[basedir]='' - if [[ -n "${file}" ]]; then - oldfile=${vcs_comm[detect_need_file]} - vcs_comm[detect_need_file]=${file} - fi + oldfile=${vcs_comm[detect_need_file]} + vcs_comm[detect_need_file]=${file} VCS_INFO_bydir_detect ${dir} ret=$? - [[ -n "${file}" ]] && vcs_comm[detect_need_file]=${oldfile} + vcs_comm[detect_need_file]=${oldfile} printf '%s' ${vcs_comm[basedir]} vcs_comm[basedir]="${olddir}" return ${ret} diff -Nru zsh-5.0.5/Functions/VCS_Info/VCS_INFO_reposub zsh-5.0.7/Functions/VCS_Info/VCS_INFO_reposub --- zsh-5.0.5/Functions/VCS_Info/VCS_INFO_reposub 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/VCS_Info/VCS_INFO_reposub 2014-10-07 18:11:30.000000000 +0000 @@ -3,11 +3,12 @@ ## Distributed under the same BSD-ish license as zsh itself. setopt localoptions extendedglob NO_shwordsplit -local base=${1%%/##} +local base=${1%%/##} tmp -[[ $(pwd -P) == ${base}/* ]] || { +tmp="$(pwd -P)" +[[ $tmp == ${base}/* ]] || { printf '.' return 1 } -printf '%s' ${$(pwd -P)#$base/} +printf '%s' ${tmp#$base/} return 0 diff -Nru zsh-5.0.5/Functions/Zftp/.distfiles zsh-5.0.7/Functions/Zftp/.distfiles --- zsh-5.0.5/Functions/Zftp/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Zftp/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,10 +1,2 @@ DISTFILES_SRC=' -.distfiles -zfanon zfdir zfinit zfrglob zftype -zfautocheck zffcache zfls zfrtime zfuget -zfcd zfgcp zfmark zfsession zfuput -zfcd_match zfget zfopen zfstat -zfcget zfget_match zfparams zftp_chpwd -zfclose zfgoto zfpcp zftp_progress -zfcput zfhere zfput zftransfer ' diff -Nru zsh-5.0.5/Functions/Zle/.distfiles zsh-5.0.7/Functions/Zle/.distfiles --- zsh-5.0.5/Functions/Zle/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Zle/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,47 +1,2 @@ DISTFILES_SRC=' -.distfiles -backward-kill-word-match -backward-word-match -capitalize-word-match -copy-earlier-word -cycle-completion-positions -define-composed-chars -delete-whole-word-match -down-case-word-match -down-line-or-beginning-search -edit-command-line -forward-word-match -history-beginning-search-menu -history-pattern-search -history-search-end -incarg -incremental-complete-word -insert-composed-char -insert-files -insert-unicode-char -keeper -keymap+widget -kill-word-match -match-word-context -match-words-by-style -modify-current-argument -move-line-in-buffer -narrow-to-region -narrow-to-region-invisible -predict-on -quote-and-complete-word -read-from-minibuffer -replace-string -replace-string-again -select-word-style -send-invisible -smart-insert-last-word -split-shell-arguments -transpose-lines -transpose-words-match -up-case-word-match -up-line-or-beginning-search -url-quote-magic -which-command -zed-set-file-name ' diff -Nru zsh-5.0.5/Functions/Zle/expand-absolute-path zsh-5.0.7/Functions/Zle/expand-absolute-path --- zsh-5.0.5/Functions/Zle/expand-absolute-path 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Functions/Zle/expand-absolute-path 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,19 @@ +# expand-absolute-path +# This is a ZLE widget to expand the absolute path to a file, +# using directory naming to shorten the path where possible. + +emulate -L zsh +setopt extendedglob cbases + +autoload -Uz modify-current-argument + +if (( ! ${+functions[glob-expand-absolute-path]} )); then + glob-expand-absolute-path() { + local -a files + files=(${~1}(N:A)) + (( ${#files} )) || return + REPLY=${(D)files[1]} + } +fi + +modify-current-argument glob-expand-absolute-path diff -Nru zsh-5.0.5/Functions/Zle/read-from-minibuffer zsh-5.0.7/Functions/Zle/read-from-minibuffer --- zsh-5.0.5/Functions/Zle/read-from-minibuffer 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Functions/Zle/read-from-minibuffer 2014-10-07 18:11:30.000000000 +0000 @@ -20,7 +20,9 @@ (( OPTIND > 1 )) && shift $(( OPTIND - 1 )) local readprompt="$1" lbuf_init="$2" rbuf_init="$3" +integer changeno=$UNDO_CHANGE_NO +{ # Use anonymous function to make sure special values get restored, # even if this function is called as a widget. # local +h ensures special parameters stay special. @@ -39,10 +41,17 @@ read -k $keys stat=$? else + local NUMERIC + unset NUMERIC zle recursive-edit -K main stat=$? (( stat )) || REPLY=$BUFFER fi } +} always { + # This removes the edits relating to the read from the undo history. + # These aren't useful once we get back to the main editing buffer. + zle undo $changeno +} return $stat diff -Nru zsh-5.0.5/Functions/Zle/replace-argument zsh-5.0.7/Functions/Zle/replace-argument --- zsh-5.0.5/Functions/Zle/replace-argument 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Functions/Zle/replace-argument 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,48 @@ +# Replace an argument to a command, delimited by normal shell syntax. +# Prompts for the replacement. +# With no numeric argument, replace the current argument. +# With a numeric argument, replace that argument: 0 = command word, +# as in history expansion. +# If editing buffer is empty, use previous history line. + +autoload -Uz split-shell-arguments read-from-minibuffer + +if (( ${#BUFFER} == 0 )); then + (( HISTNO-- )) + CURSOR=${#BUFFER} +fi + +local widget=$WIDGET numeric +integer cursor=CURSOR +if (( ${+NUMERIC} )); then + numeric=$NUMERIC +fi +local reply REPLY REPLY2 +integer index +split-shell-arguments + +if [[ -n $numeric ]]; then + if (( numeric < 0 )); then + (( index = ${#reply} - 1 + 2*(numeric+1) )) + else + (( index = 2 + 2*numeric )) + fi +else + (( index = REPLY & ~1 )) +fi + +local edit +if [[ $widget = *edit* ]]; then + edit=$reply[$index] +fi +read-from-minibuffer "Replace $reply[$index] with: " $edit || return 1 + +integer diff=$(( ${#REPLY} - ${#reply[$index]} )) +reply[$index]=$REPLY + +BUFFER=${(j..)reply} +if (( cursor > REPLY2 )); then + (( CURSOR = cursor + diff )) +else + (( CURSOR = REPLY2 )) +fi diff -Nru zsh-5.0.5/Functions/Zle/zcalc-auto-insert zsh-5.0.7/Functions/Zle/zcalc-auto-insert --- zsh-5.0.5/Functions/Zle/zcalc-auto-insert 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Functions/Zle/zcalc-auto-insert 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,8 @@ +# Bind to a binary operator keystroke for use with zcalc + +if [[ -n $ZCALC_ACTIVE ]]; then + if [[ $CURSOR -eq 0 || $LBUFFER[-1] = "(" ]]; then + LBUFFER+=${ZCALC_AUTO_INSERT_PREFIX:-"ans "} + fi +fi +zle .self-insert diff -Nru zsh-5.0.5/.gitignore zsh-5.0.7/.gitignore --- zsh-5.0.5/.gitignore 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/.gitignore 2014-10-07 18:11:30.000000000 +0000 @@ -39,6 +39,7 @@ Doc/intro.us.pdf Doc/intro.us.ps Doc/version.yo +Doc/texi2html.conf Doc/zsh*.1 Doc/zsh.texi Doc/zsh.info* diff -Nru zsh-5.0.5/Misc/.distfiles zsh-5.0.7/Misc/.distfiles --- zsh-5.0.5/Misc/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Misc/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,7 +1,2 @@ DISTFILES_SRC=' - .distfiles - bash2zshprompt - c2z compctl-examples globtests globtests.ksh - job-control-tests lete2ctl make-zsh-urls - vcs_info-examples ' diff -Nru zsh-5.0.5/Misc/vcs_info-examples zsh-5.0.7/Misc/vcs_info-examples --- zsh-5.0.5/Misc/vcs_info-examples 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Misc/vcs_info-examples 2014-10-07 18:11:30.000000000 +0000 @@ -266,6 +266,10 @@ zstyle ':vcs_info:*' check-for-changes true zstyle ':vcs_info:*' get-revision true +# Alternatively, the following would set only %c, but is faster: +#zstyle ':vcs_info:*' check-for-changes false +#zstyle ':vcs_info:*' check-for-staged-changes true + # Default to running vcs_info. If possible we prevent running it later for # speed reasons. If set to a non empty value vcs_info is run. @@ -297,7 +301,7 @@ # If we got to this point, running vcs_info was not forced, so now we # default to not running it and selectively choose when we want to run - # it (ret=1 means run it, ret=0 means don't). + # it (ret=0 means run it, ret=1 means don't). ret=1 # If a git/hg command was run then run vcs_info as the status might # need to be updated. diff -Nru zsh-5.0.5/NEWS zsh-5.0.7/NEWS --- zsh-5.0.5/NEWS 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/NEWS 2014-10-07 18:11:30.000000000 +0000 @@ -7,57 +7,112 @@ Changes since 5.0.0 ------------------- -Numeric constants encountered in mathematical expressions (but not other -contexts) can contain underscores as separators that will be ignored on -evaluation, as allowed in other scripting languages. For example, -0xFFFF_FFFF, or 3.141_592_654. - -"functions -T" turns on tracing for the specified function(s) only, -similar to "functions -t" except that tracing is turned off for any -functions called from the specified one(s) that don't also have the -t -or -T flag. - -The option FORCE_FLOAT has been added to force all arithmetic constants -to be treated as floating point. This is most useful locally within -functions or scripts performing floating point calculations. - -Individual pattern characters can be disabled. For example, to allow '^' -to be an ordinary character even if the option EXTENDED_GLOB is set, use -"disable -p '^'". - -The variable editing builtin vared can be given custom editing widgets -for initialisation and finishing. - -The line editor's capability for listening on file descriptors -additional to the terminal has been enhanced so that the handler for -such file descriptors can be a line editor widget. Previously the -handler always behaved as a standard shell function. - -Hooks for adding history (the function zshaddhistory and the -array zshaddhistory_functions) can return status 2 to indicate that -history is to be saved internally within the shell but not written. - -In file completion, the recursive-files style can be set to an array of -patterns to match against "$PWD/". In any matched location, it is -possibly to complete files in arbitrarily deep subdirectories without -needing to type the directory prefix. See example in the zshcompsys -manual. - -The _user_expand completer now allows expansion functions in the -user-expand files to return a string in REPLY that will be used to name -the set of expansions returned. - -The parameter HISTORY_IGNORE may be set to a pattern which matches -lines in the internal history that are to be omitted from the history -file at file write time. This differs from history changes made in -the zshaddhistory hook or by the HIST_IGNORE_* options, all of which -take effect immediately on the internal history list itself. - -The parameter ZLE_RPROMPT_INDENT can be set to 0 to remove the space -between the right hand side of the screen (this causes problems with -some terminals). It is not special and is not set by default; the -effect in that case is as if it was 1, as in previous versions. - +- Numeric constants encountered in mathematical expressions (but not other + contexts) can contain underscores as separators that will be ignored on + evaluation, as allowed in other scripting languages. For example, + 0xFFFF_FFFF, or 3.141_592_654. From 5.0.6 this is also available + in output, e.g. + setopt cbases + zmodload zsh/mathfunc + print $(( [#16_4] 2**32 - 1 )) $(( [#_3] 4 * atan(1.0) )) + +- "functions -T" turns on tracing for the specified function(s) only, + similar to "functions -t" except that tracing is turned off for any + functions called from the specified one(s) that don't also have the -t + or -T flag. + +- The option FORCE_FLOAT has been added to force all arithmetic constants + to be treated as floating point. This is most useful locally within + functions or scripts performing floating point calculations. + +- The default $fpath/$FPATH is now designed always to include + /usr/local/share/zsh/site-functions. This directory does not need to + exist. Sites that set an explicit site directory can put that in + /etc/zshenv as before. The intention of the new path element is to + increase the likelihood that locally added functions can be found with + the shell running "out of the box", no matter how the shell was + configured. + +- Individual pattern characters can be disabled. For example, to allow '^' + to be an ordinary character even if the option EXTENDED_GLOB is set, use + "disable -p '^'". + +- The variable editing builtin vared can be given custom editing widgets + for initialisation and finishing. + +- The line editor's capability for listening on file descriptors + additional to the terminal has been enhanced so that the handler for + such file descriptors can be a line editor widget. Previously the + handler always behaved as a standard shell function. + +- Hooks for adding history (the function zshaddhistory and the + array zshaddhistory_functions) can return status 2 to indicate that + history is to be saved internally within the shell but not written. + +- In file completion, the recursive-files style can be set to an array of + patterns to match against "$PWD/". In any matched location, it is + possible to complete files in arbitrarily deep subdirectories without + needing to type the directory prefix. See example in the zshcompsys + manual. + +- The _user_expand completer now allows expansion functions in the + user-expand files to return a string in REPLY that will be used to name + the set of expansions returned. + +- The parameter HISTORY_IGNORE may be set to a pattern which matches + lines in the internal history that are to be omitted from the history + file at file write time. This differs from history changes made in + the zshaddhistory hook or by the HIST_IGNORE_* options, all of which + take effect immediately on the internal history list itself. + +- The parameter ZLE_RPROMPT_INDENT can be set to 0 to remove the space + before the right hand side of the screen (this causes problems with + some terminals). It is not special and is not set by default; the + effect in that case is as if it was 1, as in previous versions. + +- If the option EXTENDED_GLOB is in effect, it is possible to force + globbing within conditional code using the [[ ... ]] syntax by flagging + that a certain string is a glob using the (#q) glob qualifier syntax. + The resulting glob is treated as a single argument. For example, + [[ -n *.c(#qN) ]] tests whether there are any .c files in the current + directory. + +- In prompt strings, the %N(l.true.false) conditional (line length) and + the %N<..< and %N>..> truncation operators now accept negative values + of N, which count the remaining space to the opposite margin (positive + values of N still count the space used since the start of the prompt). + In PS1 and PROMPT, this counts to the right margin, whereas in RPS1 and + RPROMPT, it counts to the left margin (not to the opposite prompt). + +- Also in prompt strings, %e or the equivalent test %(e..) are used to + output or test the execution / evaluation depth of a shell + construct within functions etc. This is useful in $PS4. + +- Another new prompt feature is the %. escape within time strings, for + example %D{%H:%M:%S.%.}. It provides zero-padded decimal fractions of a + second; by default milliseconds are shown, but the number of digits may + be indicated from 1 to 6, e.g. "%6.". (Note this is part of the + extensions to strftime() formats rather than basic prompt escapes.) + +- The operators :^ and :^^ in parameter substitution allow for array + zipping in the form ${name:^array}. With the :^ operator, all entries + in $name and $array will be output in alternating order. With :^ the + longer array is trimmed whereas the :^^ operator repeats the shorter + array enough to match the longer array. + +- The value of $? when a job becomes stopped is now the signal number plus + 128, for compatibility with other shells. Note that different operating + systems use different values e.g. for SIGTSTP, so it is not possible in + portable scripts to detect stopped jobs by comparing to a fixed number. + Also, the value of $pipestatus is now updated when a job stops, not just + when it exits. + +- Redirections applied to function definitions take effect when the + function is executed, not when it is defined. Other shells already + work this way. For example, + fn() { echo hello } >~/logfile + Running fn writes "hello" to logfile. In older versions of the shell + it would create an empty file at the point of definition. Changes between 4.2 and 5.0.0 ----------------------------- diff -Nru zsh-5.0.5/README zsh-5.0.7/README --- zsh-5.0.5/README 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/README 2014-10-07 18:11:30.000000000 +0000 @@ -5,10 +5,16 @@ Version ------- -This is version 5.0.5 of the shell. This is a stable release. -There are minor new features as well as bug fixes since 5.0.2. -5.0.3 and 5.0.4 were short-lived releases with most of the features of -5.0.5 that were replaced owing to significant bugs. +This is version 5.0.7 of the shell. This is a stable release. +There are minor new features as well as bug fixes since 5.0.6. + +Note in particular there is a security fix to disallow evaluation of the +initial values of integer variables imported from the environment (they +are instead treated as literal numbers). That could allow local +privilege escalation, under some specific and atypical conditions where +zsh is being invoked in privilege elevation contexts when the +environment has not been properly sanitized, such as when zsh is invoked +by sudo on systems where "env_reset" has been disabled. Installing Zsh -------------- diff -Nru zsh-5.0.5/Scripts/.distfiles zsh-5.0.7/Scripts/.distfiles --- zsh-5.0.5/Scripts/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Scripts/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' -.distfiles -newuser ' diff -Nru zsh-5.0.5/Src/builtin.c zsh-5.0.7/Src/builtin.c --- zsh-5.0.5/Src/builtin.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/builtin.c 2014-10-07 18:11:30.000000000 +0000 @@ -111,7 +111,7 @@ 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), BUILTIN("setopt", 0, bin_setopt, 0, -1, BIN_SETOPT, NULL, NULL), - BUILTIN("shift", BINF_PSPECIAL, bin_shift, 0, -1, 0, NULL, NULL), + BUILTIN("shift", BINF_PSPECIAL, bin_shift, 0, -1, 0, "p", NULL), BUILTIN("source", BINF_PSPECIAL, bin_dot, 1, -1, 0, NULL, NULL), BUILTIN("suspend", 0, bin_suspend, 0, 0, 0, "f", NULL), BUILTIN("test", BINF_HANDLES_OPTS, bin_test, 0, -1, BIN_TEST, NULL, NULL), @@ -1422,6 +1422,10 @@ unqueue_signals(); return 0; } + if (OPT_ISSET(ops,'I')) { + zwarnnam(nam, "-I requires one of -R/-W/-A"); + return 1; + } if (zleactive) { zwarnnam(nam, "no interactive history within ZLE"); @@ -1727,7 +1731,7 @@ if (tdfmt != NULL) { struct tm *ltm; ltm = localtime(&ent->stim); - if (ztrftime(timebuf, 256, tdfmt, ltm)) + if (ztrftime(timebuf, 256, tdfmt, ltm, 0L)) fprintf(f, "%s ", timebuf); } /* display the time taken by the command, if required */ @@ -2755,7 +2759,7 @@ tokenize(*argv); if ((pprog = patcompile(*argv, PAT_STATIC, 0))) { queue_signals(); - for (p = mathfuncs, q = NULL; p; q = p, p = p->next) { + for (p = mathfuncs, q = NULL; p; q = p) { MathFunc next; do { next = NULL; @@ -2770,6 +2774,8 @@ } /* if we deleted one, retry with the new p */ } while (next); + if (p) + p = p->next; } unqueue_signals(); } else { @@ -4509,7 +4515,7 @@ /**/ int -bin_shift(char *name, char **argv, UNUSED(Options ops), UNUSED(int func)) +bin_shift(char *name, char **argv, Options ops, UNUSED(int func)) { int num = 1, l, ret = 0; char **s; @@ -4533,7 +4539,19 @@ ret++; continue; } - s = zarrdup(s + num); + if (OPT_ISSET(ops,'p')) { + char **s2, **src, **dst; + int count; + l = arrlen(s); + src = s; + dst = s2 = (char **)zalloc((l - num + 1) * sizeof(char *)); + for (count = l - num; count; count--) + *dst++ = ztrdup(*src++); + *dst = NULL; + s = s2; + } else { + s = zarrdup(s + num); + } setaparam(*argv, s); } } else { @@ -4542,9 +4560,16 @@ ret = 1; } else { s = zalloc((l - num + 1) * sizeof(char *)); - memcpy(s, pparams + num, (l - num + 1) * sizeof(char *)); - while (num--) - zsfree(pparams[num]); + if (OPT_ISSET(ops,'p')) { + memcpy(s, pparams, (l - num) * sizeof(char *)); + s[l-num] = NULL; + while (num--) + zsfree(pparams[l-1-num]); + } else { + memcpy(s, pparams + num, (l - num + 1) * sizeof(char *)); + while (num--) + zsfree(pparams[num]); + } zfree(pparams, (l + 1) * sizeof(char *)); pparams = s; } @@ -4669,9 +4694,10 @@ int bin_break(char *name, char **argv, UNUSED(Options ops), int func) { - int num = lastval, nump = 0; + int num = lastval, nump = 0, implicit; /* handle one optional numeric argument */ + implicit = !*argv; if (*argv) { num = mathevali(*argv++); nump = 1; @@ -4702,7 +4728,13 @@ retflag = 1; breaks = loops; lastval = num; - if (trap_state == TRAP_STATE_PRIMED && trap_return == -2) { + if (trap_state == TRAP_STATE_PRIMED && trap_return == -2 + /* + * With POSIX, "return" on its own in a trap doesn't + * update $? --- we keep the status from before the + * trap. + */ + && !(isset(POSIXTRAPS) && implicit)) { trap_state = TRAP_STATE_FORCE_RETURN; trap_return = lastval; } @@ -6069,8 +6101,9 @@ } /* display a time, provided in units of 1/60s, as minutes and seconds */ -#define pttime(X) printf("%ldm%ld.%02lds",((long) (X))/3600,\ - ((long) (X))/60%60,((long) (X))*100/60%100) +#define pttime(X) printf("%ldm%ld.%02lds",((long) (X))/(60 * clktck),\ + ((long) (X))/clktck%clktck,\ + ((long) (X))*100/clktck%100) /* times: display, in a two-line format, the times provided by times(3) */ @@ -6079,6 +6112,7 @@ bin_times(UNUSED(char *name), UNUSED(char **argv), UNUSED(Options ops), UNUSED(int func)) { struct tms buf; + long clktck = get_clktck(); /* get time accounting information */ if (times(&buf) == -1) diff -Nru zsh-5.0.5/Src/Builtins/.distfiles zsh-5.0.7/Src/Builtins/.distfiles --- zsh-5.0.5/Src/Builtins/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Builtins/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,5 +1,2 @@ DISTFILES_SRC=' - .cvsignore .distfiles .exrc - rlimits.mdd rlimits.c rlimits.awk - sched.mdd sched.c ' diff -Nru zsh-5.0.5/Src/Builtins/rlimits.c zsh-5.0.7/Src/Builtins/rlimits.c --- zsh-5.0.5/Src/Builtins/rlimits.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Builtins/rlimits.c 2014-10-07 18:11:30.000000000 +0000 @@ -32,12 +32,17 @@ #if defined(HAVE_GETRLIMIT) && defined(RLIM_INFINITY) -#ifdef RLIMIT_POSIXLOCKS +#if defined(HAVE_RLIMIT_POSIXLOCKS) && !defined(HAVE_RLIMIT_LOCKS) # define RLIMIT_LOCKS RLIMIT_POSIXLOCKS +# define HAVE_RLIMIT_LOCKS 1 #endif -#ifdef RLIMIT_NTHR +#if defined(HAVE_RLIMIT_NTHR) && !defined(HAVE_RLIMIT_PTHREAD) # define RLIMIT_PTHREAD RLIMIT_NTHR +# define HAVE_RLIMIT_PTHREAD 1 +# define THREAD_FMT "-T: threads " +#else +# define THREAD_FMT "-T: threads per process " #endif enum { @@ -367,13 +372,13 @@ # ifdef HAVE_RLIMIT_SBSIZE case RLIMIT_SBSIZE: if (head) - printf("-b: socket buffer size (bytes) ", RLIMIT_SBSIZE); + printf("-b: socket buffer size (bytes) "); break; # endif /* HAVE_RLIMIT_SBSIZE */ # ifdef HAVE_RLIMIT_PTHREAD case RLIMIT_PTHREAD: if (head) - printf("-T: threads per process "); + printf("%s", THREAD_FMT); break; # endif /* HAVE_RLIMIT_PTHREAD */ # ifdef HAVE_RLIMIT_NICE @@ -860,6 +865,13 @@ case 'r': res = RLIMIT_RTPRIO; break; +# else +# ifdef HAVE_RLIMIT_NTHR + /* For compatibility with sh on NetBSD */ + case 'r': + res = RLIMIT_NTHR; + break; +# endif /* HAVE_RLIMIT_NTHR */ # endif # ifdef HAVE_RLIMIT_NPTS case 'p': @@ -876,6 +888,11 @@ res = RLIMIT_KQUEUES; break; # endif +# ifdef HAVE_RLIMIT_PTHREAD + case 'T': + res = RLIMIT_PTHREAD; + break; +# endif default: /* unrecognised limit */ zwarnnam(name, "bad option: -%c", *options); diff -Nru zsh-5.0.5/Src/Builtins/sched.c zsh-5.0.7/Src/Builtins/sched.c --- zsh-5.0.5/Src/Builtins/sched.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Builtins/sched.c 2014-10-07 18:11:30.000000000 +0000 @@ -211,7 +211,7 @@ t = sch->time; tmp = localtime(&t); - ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp); + ztrftime(tbuf, 40, "%a %b %e %k:%M:%S", tmp, 0L); if (sch->flags & SCHEDFLAG_TRASH_ZLE) flagstr = "-o "; else diff -Nru zsh-5.0.5/Src/compat.c zsh-5.0.7/Src/compat.c --- zsh-5.0.5/Src/compat.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/compat.c 2014-10-07 18:11:30.000000000 +0000 @@ -37,7 +37,7 @@ char * strstr(const char *s, const char *t) { - char *p1, *p2; + const char *p1, *p2; for (; *s; s++) { for (p1 = s, p2 = t; *p2; p1++, p2++) diff -Nru zsh-5.0.5/Src/cond.c zsh-5.0.7/Src/cond.c --- zsh-5.0.5/Src/cond.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/cond.c 2014-10-07 18:11:30.000000000 +0000 @@ -37,6 +37,21 @@ "-ne", "-lt", "-gt", "-le", "-ge", "=~" }; +static void cond_subst(char **strp, int glob_ok) +{ + if (glob_ok && + checkglobqual(*strp, strlen(*strp), 1, NULL)) { + LinkList args = newlinklist(); + addlinknode(args, *strp); + prefork(args, 0); + while (!errflag && args && nonempty(args) && + has_token((char *)peekfirst(args))) + zglob(args, firstnode(args), 0); + *strp = sepjoin(hlinklist2array(args, 0), NULL, 1); + } else + singsub(strp); +} + /* * Evaluate a conditional expression given the arguments. * If fromtest is set, the caller is the test or [ builtin; @@ -177,13 +192,13 @@ } left = ecgetstr(state, EC_DUPTOK, &htok); if (htok) { - singsub(&left); + cond_subst(&left, !fromtest); untokenize(left); } if (ctype <= COND_GE && ctype != COND_STREQ && ctype != COND_STRNEQ) { right = ecgetstr(state, EC_DUPTOK, &htok); if (htok) { - singsub(&right); + cond_subst(&right, !fromtest); untokenize(right); } } @@ -194,7 +209,7 @@ fprintf(xtrerr, " %s ", condstr[ctype]); if (ctype == COND_STREQ || ctype == COND_STRNEQ) { char *rt = dupstring(ecrawstr(state->prog, state->pc, NULL)); - singsub(&rt); + cond_subst(&rt, !fromtest); quote_tokenized_output(rt, xtrerr); } else @@ -282,8 +297,7 @@ right = dupstring(opat = ecrawstr(state->prog, state->pc, &htok)); - if (htok) - singsub(&right); + singsub(&right); save = (!(state->prog->flags & EF_HEAP) && !strcmp(opat, right) && pprog != dummy_patprog2); diff -Nru zsh-5.0.5/Src/.distfiles zsh-5.0.7/Src/.distfiles --- zsh-5.0.5/Src/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,53 +1,2 @@ DISTFILES_SRC=' -.cvsignore -.distfiles -.exrc -.indent.pro -Makefile.in -Makemod.in.in -signames1.awk -signames2.awk -modentry.c -builtin.c -compat.c -cond.c -exec.c -glob.c -hashtable.c -hashtable.h -hashnameddir.c -hist.c -init.c -input.c -jobs.c -lex.c -linklist.c -loop.c -main.c -makepro.awk -math.c -mem.c -mkbltnmlst.sh -mkmakemod.sh -module.c -options.c -params.c -parse.c -pattern.c -prompt.c -prototypes.h -signals.c -signals.h -sort.c -string.c -subst.c -text.c -utils.c -watch.c -zsh.h -zsh.mdd -zsh_system.h -ztype.h -zsh.rc -zsh.ico ' diff -Nru zsh-5.0.5/Src/exec.c zsh-5.0.7/Src/exec.c --- zsh-5.0.5/Src/exec.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/exec.c 2014-10-07 18:11:30.000000000 +0000 @@ -198,7 +198,8 @@ /* Execution functions. */ static int (*execfuncs[WC_COUNT-WC_CURSH]) _((Estate, int)) = { - execcursh, exectime, execfuncdef, execfor, execselect, + execcursh, exectime, NULL /* execfuncdef handled specially */, + execfor, execselect, execwhile, execrepeat, execcase, execif, execcond, execarith, execautofn, exectry }; @@ -1005,6 +1006,8 @@ signal_default(SIGTERM); if (!(sigtrapped[SIGINT] & ZSIG_IGNORED)) signal_default(SIGINT); + if (!(sigtrapped[SIGPIPE])) + signal_default(SIGPIPE); } if (!(sigtrapped[SIGQUIT] & ZSIG_IGNORED)) signal_default(SIGQUIT); @@ -1116,8 +1119,11 @@ fflush(xtrerr); } lv = (errflag ? errflag : cmdoutval); - } else + } else if (code == WC_FUNCDEF) { + lv = execfuncdef(state, NULL); + } else { lv = (execfuncs[code - WC_CURSH])(state, 0); + } thisjob = otj; @@ -2346,7 +2352,7 @@ { if (strs) { prefork(strs, esprefork); - if (esglob) { + if (esglob && !errflag) { LinkList ostrs = strs; globlist(strs, 0); strs = ostrs; @@ -2783,6 +2789,58 @@ errflag = 1; } + if (type == WC_FUNCDEF) { + /* + * The first word of a function definition is a list of + * names. If this is empty, we're doing an anonymous function: + * in that case redirections are handled normally. + * If not, it's a function definition: then we don't do + * redirections here but pass in the list of redirections to + * be stored for recall with the function. + */ + if (*state->pc != 0) { + /* Nonymous, don't do redirections here */ + redir = NULL; + } + } else if (is_shfunc || type == WC_AUTOFN) { + Shfunc shf; + if (is_shfunc) + shf = (Shfunc)hn; + else { + shf = loadautofn(state->prog->shf, 1, 0); + if (shf) + state->prog->shf = shf; + else { + /* + * This doesn't set errflag, so just return now. + */ + lastval = 1; + if (oautocont >= 0) + opts[AUTOCONTINUE] = oautocont; + return; + } + } + /* + * A function definition may have a list of additional + * redirections to apply, so retrieve it. + */ + if (shf->redir) { + struct estate s; + LinkList redir2; + + s.prog = shf->redir; + s.pc = shf->redir->prog; + s.strs = shf->redir->strs; + redir2 = ecgetredirs(&s); + if (!redir) + redir = redir2; + else { + while (nonempty(redir2)) + addlinknode(redir, ugetnode(redir2)); + } + } + } + if (errflag) { lastval = 1; if (oautocont >= 0) @@ -3050,7 +3108,7 @@ break; case REDIR_CLOSE: if (fn->varid) { - char *s = fn->varid; + char *s = fn->varid, *t; struct value vbuf; Value v; int bad = 0; @@ -3060,13 +3118,25 @@ } else if (v->pm->node.flags & PM_READONLY) { bad = 2; } else { - fn->fd1 = (int)getintvalue(v); + s = getstrvalue(v); if (errflag) bad = 1; - else if (fn->fd1 <= max_zsh_fd) { - if (fn->fd1 >= 10 && - fdtable[fn->fd1] == FDT_INTERNAL) - bad = 3; + else { + fn->fd1 = zstrtol(s, &t, 0); + if (s == t) + bad = 1; + else if (*t) { + /* Check for base#number format */ + if (*t == '#' && *s != '0') + fn->fd1 = zstrtol(s = t+1, &t, fn->fd1); + if (s == t || *t) + bad = 1; + } + if (!bad && fn->fd1 <= max_zsh_fd) { + if (fn->fd1 >= 10 && + fdtable[fn->fd1] == FDT_INTERNAL) + bad = 3; + } } } if (bad) { @@ -3131,7 +3201,7 @@ fil = movefd(dup(fd)); } if (fil == -1) { - char fdstr[4]; + char fdstr[DIGBUFSIZE]; closemnodes(mfds); fixfds(save); @@ -3226,10 +3296,44 @@ flags |= ESUB_REVERTPGRP; entersubsh(flags); } - if (type >= WC_CURSH) { + if (type == WC_FUNCDEF) { + Eprog redir_prog; + if (!redir && wc_code(*beg) == WC_REDIR) { + /* + * We're not using a redirection from the currently + * parsed environment, which is what we'd do for an + * anonymous function, but there are redirections we + * should store with the new function. + */ + struct estate s; + + s.prog = state->prog; + s.pc = beg; + s.strs = state->prog->strs; + + /* + * The copy uses the wordcode parsing area, so save and + * restore state. + */ + lexsave(); + redir_prog = eccopyredirs(&s); + lexrestore(); + } else + redir_prog = NULL; + + lastval = execfuncdef(state, redir_prog); + } + else if (type >= WC_CURSH) { if (last1 == 1) do_exec = 1; - lastval = (execfuncs[type - WC_CURSH])(state, do_exec); + if (type == WC_AUTOFN) { + /* + * We pre-loaded this to get any redirs. + * So we execuate a simplified function here. + */ + lastval = execautofn_basic(state, do_exec); + } else + lastval = (execfuncs[type - WC_CURSH])(state, do_exec); } else if (is_builtin || is_shfunc) { LinkList restorelist = 0, removelist = 0; /* builtin or shell function */ @@ -3569,8 +3673,11 @@ for (i = 10; i <= max_zsh_fd; i++) if (fdtable[i] != FDT_UNUSED && - (how == FDT_UNUSED || fdtable[i] == how)) + (how == FDT_UNUSED || fdtable[i] == how)) { + if (i == SHTTY) + SHTTY = -1; zclose(i); + } } /* convert here document into a here string */ @@ -3867,8 +3974,10 @@ int fd; char *s; - if (thisjob == -1) + if (thisjob == -1){ + zerr("process substitution %s cannot be used here", cmd); return NULL; + } if (!(prog = parsecmd(cmd, eptr))) return NULL; if (!(nam = gettempname(NULL, 0))) @@ -3939,11 +4048,13 @@ char *tnam = gettempname(NULL, 1); # ifdef HAVE_MKFIFO - if (mkfifo(tnam, 0600) < 0) + if (mkfifo(tnam, 0600) < 0){ # else - if (mknod(tnam, 0010600, 0) < 0) + if (mknod(tnam, 0010600, 0) < 0){ # endif + zerr("failed to create named pipe: %s, %e", tnam, errno); return NULL; + } return tnam; } #endif /* ! PATH_DEV_FD && HAVE_FIFOS */ @@ -3966,9 +4077,10 @@ #ifndef PATH_DEV_FD int fd; - - if (thisjob == -1) + if (thisjob == -1) { + zerr("process substitution %s cannot be used here", cmd); return NULL; + } if (!(pnam = namedpipe())) return NULL; if (!(prog = parsecmd(cmd, eptr))) @@ -3993,8 +4105,10 @@ #else /* PATH_DEV_FD */ int pipes[2], fd; - if (thisjob == -1) + if (thisjob == -1) { + zerr("process substitution %s cannot be used here", cmd); return NULL; + } pnam = hcalloc(strlen(PATH_DEV_FD) + 6); if (!(prog = parsecmd(cmd, eptr))) return NULL; @@ -4213,11 +4327,12 @@ /**/ static int -execfuncdef(Estate state, UNUSED(int do_exec)) +execfuncdef(Estate state, Eprog redir_prog) { Shfunc shf; char *s = NULL; int signum, nprg, sbeg, nstrs, npats, len, plen, i, htok = 0, ret = 0; + int nfunc = 0; Wordcode beg = state->pc, end; Eprog prog; Patprog *pp; @@ -4234,9 +4349,16 @@ plen = nprg * sizeof(wordcode); len = plen + (npats * sizeof(Patprog)) + nstrs; - if (htok && names) + if (htok && names) { execsubst(names); + if (errflag) { + state->pc = end; + return 1; + } + } + DPUTS(!names && redir_prog, + "Passing redirection to anon function definition."); while (!names || (s = (char *) ugetnode(names))) { if (!names) { prog = (Eprog) zhalloc(sizeof(*prog)); @@ -4278,6 +4400,15 @@ shf->node.flags = 0; shf->filename = ztrdup(scriptfilename); shf->lineno = lineno; + /* + * redir_prog is permanently allocated --- but if + * this function has multiple names we need an additional + * one. + */ + if (nfunc++ && redir_prog) + shf->redir = dupeprog(redir_prog, 0); + else + shf->redir = redir_prog; shfunc_set_sticky(shf); if (!names) { @@ -4291,8 +4422,13 @@ end += *state->pc++; args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok); - if (htok && args) + if (htok && args) { execsubst(args); + if (errflag) { + state->pc = end; + return 1; + } + } if (!args) args = newlinklist(); @@ -4303,6 +4439,8 @@ ret = lastval; freeeprog(shf->funcdef); + if (shf->redir) /* shouldn't be */ + freeeprog(shf->redir); zsfree(shf->filename); zfree(shf, sizeof(*shf)); break; @@ -4326,6 +4464,10 @@ shfunctab->addnode(shfunctab, ztrdup(s), shf); } } + if (!nfunc && redir_prog) { + /* For completeness, shouldn't happen */ + freeeprog(redir_prog); + } state->pc = end; return ret; } @@ -4422,21 +4564,28 @@ deletefilelist(last_file_list, 0); } -/* Function to execute the special type of command that represents an * - * autoloaded shell function. The command structure tells us which * - * function it is. This function is actually called as part of the * - * execution of the autoloaded function itself, so when the function * - * has been autoloaded, its list is just run with no frills. */ +/* + * Function to execute the special type of command that represents an + * autoloaded shell function. The command structure tells us which + * function it is. This function is actually called as part of the + * execution of the autoloaded function itself, so when the function + * has been autoloaded, its list is just run with no frills. + * + * There are two cases because if we are doing all-singing, all-dancing + * non-simple code we load the shell function early in execcmd() (the + * action also present in the non-basic version) to check if + * there are redirections that need to be handled at that point. + * Then we call execautofn_basic() to do the rest. + */ /**/ static int -execautofn(Estate state, UNUSED(int do_exec)) +execautofn_basic(Estate state, UNUSED(int do_exec)) { Shfunc shf; char *oldscriptname, *oldscriptfilename; - if (!(shf = loadautofn(state->prog->shf, 1, 0))) - return 1; + shf = state->prog->shf; /* * Probably we didn't know the filename where this function was @@ -4456,6 +4605,19 @@ } /**/ +static int +execautofn(Estate state, UNUSED(int do_exec)) +{ + Shfunc shf; + + if (!(shf = loadautofn(state->prog->shf, 1, 0))) + return 1; + + state->prog->shf = shf; + return execautofn_basic(state, 0); +} + +/**/ Shfunc loadautofn(Shfunc shf, int fksh, int autol) { @@ -4597,7 +4759,7 @@ char *name = shfunc->node.nam; int flags = shfunc->node.flags, ooflags; char *fname = dupstring(name); - int obreaks, saveemulation, restore_sticky; + int obreaks, ocontflag, oloops, saveemulation, restore_sticky; Eprog prog; struct funcstack fstack; static int oflags; @@ -4609,7 +4771,9 @@ pushheap(); oargv0 = NULL; - obreaks = breaks;; + obreaks = breaks; + ocontflag = contflag; + oloops = loops; if (trap_state == TRAP_STATE_PRIMED) trap_return--; oldlastval = lastval; @@ -4797,6 +4961,17 @@ opts[XTRACE] = saveopts[XTRACE]; opts[PRINTEXITVALUE] = saveopts[PRINTEXITVALUE]; opts[LOCALOPTIONS] = saveopts[LOCALOPTIONS]; + opts[LOCALLOOPS] = saveopts[LOCALLOOPS]; + } + + if (opts[LOCALLOOPS]) { + if (contflag) + zwarn("`continue' active at end of function scope"); + if (breaks) + zwarn("`break' active at end of function scope"); + breaks = obreaks; + contflag = ocontflag; + loops = oloops; } endtrapscope(); diff -Nru zsh-5.0.5/Src/glob.c zsh-5.0.7/Src/glob.c --- zsh-5.0.5/Src/glob.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/glob.c 2014-10-07 18:11:30.000000000 +0000 @@ -120,6 +120,8 @@ #define TT_POSIX_BLOCKS 1 #define TT_KILOBYTES 2 #define TT_MEGABYTES 3 +#define TT_GIGABYTES 4 +#define TT_TERABYTES 5 typedef int (*TestMatchFunc) _((char *, struct stat *, off_t, char *)); @@ -176,7 +178,7 @@ int gd_gf_numsort; int gd_gf_follow, gd_gf_sorts, gd_gf_nsorts; struct globsort gd_gf_sortlist[MAX_SORTS]; - LinkList gd_gf_pre_words; + LinkList gd_gf_pre_words, gd_gf_post_words; char *gd_glob_pre, *gd_glob_suf; }; @@ -208,6 +210,7 @@ #define gf_nsorts (curglobdata.gd_gf_nsorts) #define gf_sortlist (curglobdata.gd_gf_sortlist) #define gf_pre_words (curglobdata.gd_gf_pre_words) +#define gf_post_words (curglobdata.gd_gf_post_words) /* and macros for save/restore */ @@ -443,6 +446,7 @@ break; } unqueue_signals(); + return; } /* Do the globbing: scanner is called recursively * @@ -451,7 +455,7 @@ /**/ static void -scanner(Complist q) +scanner(Complist q, int shortcircuit) { Patprog p; int closure; @@ -459,16 +463,19 @@ int errssofar = errsfound; struct dirsav ds; - init_dirsav(&ds); if (!q) return; + init_dirsav(&ds); if ((closure = q->closure)) { /* (foo/)# - match zero or more dirs */ if (q->closure == 2) /* (foo/)## - match one or more dirs */ q->closure = 1; - else - scanner(q->next); + else { + scanner(q->next, shortcircuit); + if (shortcircuit && shortcircuit == matchct) + return; + } } p = q->pat; /* Now the actual matching for the current path section. */ @@ -513,8 +520,11 @@ } if (add) { addpath(str, l); - if (!closure || !statfullpath("", NULL, 1)) - scanner((q->closure) ? q : q->next); + if (!closure || !statfullpath("", NULL, 1)) { + scanner((q->closure) ? q : q->next, shortcircuit); + if (shortcircuit && shortcircuit == matchct) + return; + } pathbuf[pathpos = oppos] = '\0'; } } @@ -522,6 +532,8 @@ if (str[l]) str = dupstrpfx(str, l); insert(str, 0); + if (shortcircuit && shortcircuit == matchct) + return; } } else { /* Do pattern matching on current path section. */ @@ -609,9 +621,12 @@ memcpy(subdirs + subdirlen, (char *)&errsfound, sizeof(int)); subdirlen += sizeof(int); - } else + } else { /* if the last filename component, just add it */ insert(fn, 1); + if (shortcircuit && shortcircuit == matchct) + return; + } } } closedir(lock); @@ -624,7 +639,10 @@ fn += l + 1; memcpy((char *)&errsfound, fn, sizeof(int)); fn += sizeof(int); - scanner((q->closure) ? q : q->next); /* scan next level */ + /* scan next level */ + scanner((q->closure) ? q : q->next, shortcircuit); + if (shortcircuit && shortcircuit == matchct) + return; pathbuf[pathpos = oppos] = '\0'; } hrealloc(subdirs, subdirlen, 0); @@ -638,6 +656,7 @@ close(ds.dirfd); pathbufcwd = pbcwdsav; } + return; } /* This function tokenizes a zsh glob pattern */ @@ -881,6 +900,9 @@ /* Count slashes. Trailing slashes don't count. */ while (*aptr && *aptr == *bptr) aptr++, bptr++; + /* Like I just said... */ + if ((!*aptr || !*bptr) && aptr > a->name && aptr[-1] == '/') + aptr--, bptr--; if (*aptr) for (; aptr[1]; aptr++) if (*aptr == '/') { @@ -1056,7 +1078,75 @@ } } - insertlinknode(list, next, data); + next = insertlinknode(list, next, data); + + if (gf_post_words) { + LinkNode added; + for (added = firstnode(gf_post_words); added; incnode(added)) { + next = insertlinknode(list, next, dupstring(getdata(added))); + } + } +} + +/* + * Return + * 1 if str ends in bare glob qualifiers + * 2 if str ends in non-bare glob qualifiers (#q) + * 0 otherwise. + * + * str is the string to check. + * sl is its length (to avoid recalculation). + * nobareglob is 1 if bare glob qualifiers are not allowed. + * *sp, if sp is not null, will be a pointer to the opening parenthesis. + */ + +/**/ +int +checkglobqual(char *str, int sl, int nobareglob, char **sp) +{ + char *s; + int paren, ret = 1; + + if (str[sl - 1] != Outpar) + return 0; + + /* Check these are really qualifiers, not a set of * + * alternatives or exclusions. We can be more * + * lenient with an explicit (#q) than with a bare * + * set of qualifiers. */ + paren = 0; + for (s = str + sl - 2; *s && (*s != Inpar || paren); s--) { + switch (*s) { + case Outpar: + paren++; /*FALLTHROUGH*/ + case Bar: + if (!zpc_disables[ZPC_BAR]) + nobareglob = 1; + break; + case Tilde: + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_TILDE]) + nobareglob = 1; + break; + case Inpar: + paren--; + break; + } + if (s == str) + break; + } + if (*s != Inpar) + return 0; + if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH] && s[1] == Pound) { + if (s[2] != 'q') + return 0; + ret = 2; + } else if (nobareglob) + return 0; + + if (sp) + *sp = s; + + return ret; } /* Main entry point to the globbing code for filename globbing. * @@ -1078,6 +1168,8 @@ /* and index+1 of the last match */ struct globdata saved; /* saved glob state */ int nobareglob = !isset(BAREGLOBQUAL); + int shortcircuit = 0; /* How many files to match; */ + /* 0 means no limit */ if (unset(GLOBOPT) || !haswilds(ostr) || unset(EXECOPT)) { if (!nountok) @@ -1109,14 +1201,14 @@ gf_noglobdots = unset(GLOBDOTS); gf_numsort = isset(NUMERICGLOBSORT); gf_sorts = gf_nsorts = 0; - gf_pre_words = NULL; + gf_pre_words = gf_post_words = NULL; /* Check for qualifiers */ while (!nobareglob || (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH])) { struct qual *newquals; char *s; - int sense, paren; + int sense, qualsfound; off_t data; char *sdata, *newcolonmod; int (*func) _((char *, Statptr, off_t, char *)); @@ -1146,40 +1238,7 @@ newquals = qo = qn = ql = NULL; sl = strlen(str); - if (str[sl - 1] != Outpar) - break; - - /* Check these are really qualifiers, not a set of * - * alternatives or exclusions. We can be more * - * lenient with an explicit (#q) than with a bare * - * set of qualifiers. */ - paren = 0; - for (s = str + sl - 2; *s && (*s != Inpar || paren); s--) { - switch (*s) { - case Outpar: - paren++; /*FALLTHROUGH*/ - case Bar: - if (!zpc_disables[ZPC_BAR]) - nobareglob = 1; - break; - case Tilde: - if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_TILDE]) - nobareglob = 1; - break; - case Inpar: - paren--; - break; - } - } - if (*s != Inpar) - break; - if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH] && s[1] == Pound) { - if (s[2] == 'q') { - *s = 0; - s += 2; - } else - break; - } else if (nobareglob) + if (!(qualsfound = checkglobqual(str, sl, nobareglob, &s))) break; /* Real qualifiers found. */ @@ -1192,6 +1251,8 @@ str[sl-1] = 0; *s++ = 0; + if (qualsfound == 2) + s += 2; while (*s && !newcolonmod) { func = (int (*) _((char *, Statptr, off_t, char *)))0; if (idigit(*s)) { @@ -1362,7 +1423,7 @@ /* Find matching delimiters */ tt = get_strarg(s, &arglen); if (!*tt) { - zerr("missing end of name"); + zerr("missing delimiter for 'u' glob qualifier"); data = 0; } else { #ifdef USE_GETPWNAM @@ -1402,7 +1463,7 @@ tt = get_strarg(s, &arglen); if (!*tt) { - zerr("missing end of name"); + zerr("missing delimiter for 'g' glob qualifier"); data = 0; } else { #ifdef USE_GETGRNAM @@ -1459,6 +1520,23 @@ /* Numeric glob sort */ gf_numsort = !(sense & 1); break; + case 'Y': + { + /* Short circuit: limit number of matches */ + const char *s_saved = s; + shortcircuit = !(sense & 1); + if (shortcircuit) { + /* Parse the argument. */ + data = qgetnum(&s); + if ((shortcircuit = data) != data) { + /* Integer overflow */ + zerr("value too big: Y%s", s_saved); + restore_globstate(saved); + return; + } + } + break; + } case 'a': /* Access time in given range */ g_amc = 0; @@ -1486,6 +1564,12 @@ g_units = TT_KILOBYTES, ++s; else if (*s == 'm' || *s == 'M') g_units = TT_MEGABYTES, ++s; +#if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) + else if (*s == 'g' || *s == 'G') + g_units = TT_GIGABYTES, ++s; + else if (*s == 't' || *s == 'T') + g_units = TT_TERABYTES, ++s; +#endif getrange: /* Get time multiplier */ if (g_amc >= 0) { @@ -1549,9 +1633,10 @@ restore_globstate(saved); return; } + if ((sense & 2) && + (t & (GS_SIZE|GS_ATIME|GS_MTIME|GS_CTIME|GS_LINKS))) + t <<= GS_SHIFT; /* HERE: GS_EXEC? */ if (t != GS_EXEC) { - if ((sense & 2) && !(t & (GS_NAME|GS_DEPTH))) - t <<= GS_SHIFT; /* HERE: GS_EXEC? */ if (gf_sorts & t) { zerr("doubled sort specifier"); restore_globstate(saved); @@ -1605,9 +1690,10 @@ if (tt != NULL) { - if (!gf_pre_words) - gf_pre_words = newlinklist(); - addlinknode(gf_pre_words, tt); + LinkList *words = sense & 1 ? &gf_post_words : &gf_pre_words; + if (!*words) + *words = newlinklist(); + addlinknode(*words, tt); } break; } @@ -1709,7 +1795,7 @@ return; } if (!gf_nsorts) { - gf_sortlist[0].tp = gf_sorts = GS_NAME; + gf_sortlist[0].tp = gf_sorts = (shortcircuit ? GS_NONE : GS_NAME); gf_nsorts = 1; } /* Initialise receptacle for matched files, * @@ -1721,7 +1807,7 @@ /* The actual processing takes place here: matches go into * * matchbuf. This is the only top-level call to scanner(). */ - scanner(q); + scanner(q, shortcircuit); /* Deal with failures to match depending on options */ if (matchct) @@ -1832,6 +1918,8 @@ matchptr++; } } + } else if (!badcshglob && !isset(NOMATCH) && matchct == 1) { + insert_glob_match(list, node, (--matchptr)->name); } free(matchbuf); @@ -1895,6 +1983,8 @@ switch (*str++) { case Inbrace: if (!lbr) { + if (bracechardots(str-1, NULL, NULL)) + return 1; lbr = str - 1; if (*str == '-') str++; @@ -2027,6 +2117,68 @@ return ret; } +/* + * Check for a brace expansion of the form {..}. + * On input str must be positioned at an Inbrace, but the sequence + * of characters beyond that has not necessarily been checked. + * Return 1 if found else 0. + * + * The other parameters are optionaland if the function returns 1 are + * used to return: + * - *c1p: the first character in the expansion. + * - *c2p: the final character in the expansion. + */ + +/**/ +static int +bracechardots(char *str, convchar_t *c1p, convchar_t *c2p) +{ + convchar_t cstart, cend; + char *pnext = str + 1, *pconv, convstr[2]; + if (itok(*pnext)) { + if (*pnext == Inbrace) + return 0; + convstr[0] = ztokens[*pnext - Pound]; + convstr[1] = '\0'; + pconv = convstr; + } else + pconv = pnext; + MB_METACHARINIT(); + pnext += MB_METACHARLENCONV(pconv, &cstart); + if ( +#ifdef MULTIBYTE_SUPPORT + cstart == WEOF || +#else + !cstart || +#endif + pnext[0] != '.' || pnext[1] != '.') + return 0; + pnext += 2; + if (itok(*pnext)) { + if (*pnext == Inbrace) + return 0; + convstr[0] = ztokens[*pnext - Pound]; + convstr[1] = '\0'; + pconv = convstr; + } else + pconv = pnext; + MB_METACHARINIT(); + pnext += MB_METACHARLENCONV(pconv, &cend); + if ( +#ifdef MULTIBYTE_SUPPORT + cend == WEOF || +#else + !cend || +#endif + *pnext != Outbrace) + return 0; + if (c1p) + *c1p = cstart; + if (c2p) + *c2p = cend; + return 1; +} + /* brace expansion */ /**/ @@ -2060,10 +2212,57 @@ char *dots, *p, *dots2 = NULL; LinkNode olast = last; /* Get the first number of the range */ - zlong rstart = zstrtol(str+1,&dots,10), rend = 0; + zlong rstart, rend; int err = 0, rev = 0, rincr = 1; - int wid1 = (dots - str) - 1, wid2 = (str2 - dots) - 2, wid3 = 0; - int strp = str - str3; + int wid1, wid2, wid3, strp; + convchar_t cstart, cend; + + if (bracechardots(str, &cstart, &cend)) { + int lenalloc; + /* + * This is a character range. + */ + if (cend < cstart) { + convchar_t ctmp = cend; + cend = cstart; + cstart = ctmp; + rev = 1; + } + uremnode(list, node); + strp = str - str3; + lenalloc = strp + strlen(str2+1) + 1; + do { +#ifdef MULTIBYTE_SUPPORT + char *ncptr; + int nclen; + mb_metacharinit(); + ncptr = wcs_nicechar(cend, NULL, NULL); + nclen = strlen(ncptr); + p = zhalloc(lenalloc + nclen); + memcpy(p, str3, strp); + memcpy(p + strp, ncptr, nclen); + strcpy(p + strp + nclen, str2 + 1); +#else + p = zhalloc(lenalloc + 1); + memcpy(p, str3, strp); + sprintf(p + strp, "%c", cend); + strcat(p + strp, str2 + 1); +#endif + insertlinknode(list, last, p); + if (rev) /* decreasing: add in reverse order. */ + last = nextnode(last); + } while (cend-- > cstart); + *np = nextnode(olast); + return; + } + + /* Get the first number of the range */ + rstart = zstrtol(str+1,&dots,10); + rend = 0; + wid1 = (dots - str) - 1; + wid2 = (str2 - dots) - 2; + wid3 = 0; + strp = str - str3; if (dots == str + 1 || *dots != '.' || dots[1] != '.') err++; @@ -3443,9 +3642,9 @@ static int qualsize(UNUSED(char *name), struct stat *buf, off_t size, UNUSED(char *dummy)) { -#if defined(LONG_IS_64_BIT) || defined(OFF_T_IS_64_BIT) +#if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) # define QS_CAST_SIZE() - off_t scaled = buf->st_size; + zlong scaled = buf->st_size; #else # define QS_CAST_SIZE() (unsigned long) unsigned long scaled = (unsigned long)buf->st_size; @@ -3464,6 +3663,16 @@ scaled += 1048575l; scaled /= 1048576l; break; +#if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) + case TT_GIGABYTES: + scaled += ZLONG_CONST(1073741823); + scaled /= ZLONG_CONST(1073741824); + break; + case TT_TERABYTES: + scaled += ZLONG_CONST(1099511627775); + scaled /= ZLONG_CONST(1099511627776); + break; +#endif } return (g_range < 0 ? scaled < QS_CAST_SIZE() size : diff -Nru zsh-5.0.5/Src/hashtable.c zsh-5.0.7/Src/hashtable.c --- zsh-5.0.5/Src/hashtable.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/hashtable.c 2014-10-07 18:11:30.000000000 +0000 @@ -887,6 +887,8 @@ zsfree(shf->node.nam); if (shf->funcdef) freeeprog(shf->funcdef); + if (shf->redir) + freeeprog(shf->redir); zsfree(shf->filename); if (shf->sticky) { if (shf->sticky->n_on_opts) @@ -954,10 +956,19 @@ printf(" \"$@\""); } } - printf("\n}\n"); + printf("\n}"); } else { - printf(" () { }\n"); + printf(" () { }"); } + if (f->redir) { + t = getpermtext(f->redir, NULL, 1); + if (t) { + zputs(t, stdout); + zsfree(t); + } + } + + putchar('\n'); } /**************************************/ diff -Nru zsh-5.0.5/Src/hist.c zsh-5.0.7/Src/hist.c --- zsh-5.0.5/Src/hist.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/hist.c 2014-10-07 18:11:30.000000000 +0000 @@ -935,9 +935,11 @@ hf = getsparam("HISTFILE"); /* - * For INCAPPENDHISTORY, when interactive, save the history here + * For INCAPPENDHISTORYTIME, when interactive, save the history here * as it gives a better estimate of the times of commands. * + * If INCAPPENDHISTORY is also set we've already done it. + * * If SHAREHISTORY is also set continue to do so in the * standard place, because that's safer about reading and * rewriting history atomically. @@ -950,7 +952,8 @@ * so that (correctly) nothing happens here. But it shows * I thought about it. */ - if (isset(INCAPPENDHISTORY) && !isset(SHAREHISTORY) && + if (isset(INCAPPENDHISTORYTIME) && !isset(SHAREHISTORY) && + !isset(INCAPPENDHISTORY) && !(histactive & HA_NOINC) && !strin && histsave_stack_pos == 0) savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST); } @@ -1378,7 +1381,8 @@ * For normal INCAPPENDHISTORY case and reasoning, see hbegin(). */ if (isset(SHAREHISTORY) ? histfileIsLocked() : - (isset(INCAPPENDHISTORY) && histsave_stack_pos != 0)) + (isset(INCAPPENDHISTORY) || (isset(INCAPPENDHISTORYTIME) && + histsave_stack_pos != 0))) savehistfile(hf, 0, HFILE_USE_OPTIONS | HFILE_FAST); unlockhistfile(hf); /* It's OK to call this even if we aren't locked */ /* @@ -1764,7 +1768,8 @@ str++; } - *junkptr = metafy(bicat(real, nonreal), -1, META_HEAPDUP); + *junkptr = metafy(str = bicat(real, nonreal), -1, META_HEAPDUP); + zsfree(str); #ifdef HAVE_CANONICALIZE_FILE_NAME free(real); #endif @@ -2303,8 +2308,7 @@ } else { buf[len - 1] = '\0'; - if (len > 1 && buf[len - 2] == '\\' && - (len < 3 || buf[len - 3] != '\\')) { + if (len > 1 && buf[len - 2] == '\\') { buf[--len - 1] = '\n'; if (!feof(in)) return readhistline(len, bufp, bufsiz, in); @@ -2486,6 +2490,9 @@ struct flock lck; int ctr = keep_trying ? 9 : 0; + if (flock_fd >= 0) + return 0; /* already locked */ + if ((flock_fd = open(unmeta(fn), O_RDWR | O_NOCTTY)) < 0) return errno == ENOENT ? 0 : 2; /* "successfully" locked missing file */ @@ -2541,7 +2548,7 @@ } if (writeflags & HFILE_USE_OPTIONS) { if (isset(APPENDHISTORY) || isset(INCAPPENDHISTORY) - || isset(SHAREHISTORY)) + || isset(INCAPPENDHISTORYTIME) || isset(SHAREHISTORY)) writeflags |= HFILE_APPEND | HFILE_SKIPOLD; else histfile_linect = 0; @@ -2577,7 +2584,7 @@ tmpfile = NULL; if (err) { if (isset(APPENDHISTORY) || isset(INCAPPENDHISTORY) - || isset(SHAREHISTORY)) + || isset(INCAPPENDHISTORYTIME) || isset(SHAREHISTORY)) zerr("rewriting %s would change its ownership -- skipped", fn); else zerr("rewriting %s would change its ownership -- history not saved", fn); @@ -2586,7 +2593,12 @@ out = NULL; } else { int fd = open(tmpfile, O_CREAT | O_WRONLY | O_EXCL, 0600); - out = fd >= 0 ? fdopen(fd, "w") : NULL; + if (fd >=0) { + out = fdopen(fd, "w"); + if (!out) + close(fd); + } else + out = NULL; } #ifdef HAVE_FCHMOD @@ -2613,6 +2625,8 @@ ret = 0; for (; he && he->histnum <= xcurhist; he = down_histent(he)) { + int count_backslashes = 0; + if ((writeflags & HFILE_SKIPDUPS && he->node.flags & HIST_DUP) || (writeflags & HFILE_SKIPFOREIGN && he->node.flags & HIST_FOREIGN) || he->node.flags & HIST_TMPSTORE) @@ -2644,9 +2658,18 @@ if (*t == '\n') if ((ret = fputc('\\', out)) < 0) break; + if (*t == '\\') + count_backslashes++; + else + count_backslashes = 0; if ((ret = fputc(*t, out)) < 0) break; } + if (ret < 0) + break; + if (count_backslashes && (count_backslashes % 2 == 0)) + if ((ret = fputc(' ', out)) < 0) + break; if (ret < 0 || (ret = fputc('\n', out)) < 0) break; } @@ -2719,6 +2742,25 @@ static int lockhistct; +static int +checklocktime(char *lockfile, time_t then) +{ + time_t now = time(NULL); + + if (now + 10 < then) { + /* File is more than 10 seconds in the future? */ + errno = EEXIST; + return -1; + } + + if (now - then < 10) + sleep(1); + else + unlink(lockfile); + + return 0; +} + /* * Lock history file. Return 0 on success, 1 on failure to lock this * time, 2 on permanent failure (e.g. permission). @@ -2734,14 +2776,6 @@ if (!fn && !(fn = getsparam("HISTFILE"))) return 1; -#ifdef HAVE_FCNTL_H - if (isset(HISTFCNTLLOCK) && flock_fd < 0) { - ret = flockhistfile(fn, keep_trying); - if (ret) - return ret; - } -#endif - if (!lockhistct++) { struct stat sb; int fd; @@ -2754,6 +2788,11 @@ # endif #endif +#ifdef HAVE_FCNTL_H + if (isset(HISTFCNTLLOCK)) + return flockhistfile(fn, keep_trying); +#endif + lockfile = bicat(unmeta(fn), ".LOCK"); /* NOTE: only use symlink locking on a link()-having host in order to * avoid a change from open()-based locking to symlink()-based. */ @@ -2775,10 +2814,10 @@ continue; break; } - if (time(NULL) - sb.st_mtime < 10) - sleep(1); - else - unlink(lockfile); + if (checklocktime(lockfile, sb.st_mtime) < 0) { + ret = 1; + break; + } } if (fd < 0) lockhistct--; @@ -2803,10 +2842,10 @@ continue; ret = 2; } else { - if (time(NULL) - sb.st_mtime < 10) - sleep(1); - else - unlink(lockfile); + if (checklocktime(lockfile, sb.st_mtime) < 0) { + ret = 1; + break; + } continue; } lockhistct--; @@ -2831,10 +2870,10 @@ ret = 2; break; } - if (time(NULL) - sb.st_mtime < 10) - sleep(1); - else - unlink(lockfile); + if (checklocktime(lockfile, sb.st_mtime) < 0) { + ret = 1; + break; + } } if (fd < 0) lockhistct--; diff -Nru zsh-5.0.5/Src/init.c zsh-5.0.7/Src/init.c --- zsh-5.0.5/Src/init.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/init.c 2014-10-07 18:11:30.000000000 +0000 @@ -77,7 +77,7 @@ /**/ int tclines, tccolumns; /**/ -mod_export int hasam, hasxn, hasye; +mod_export int hasam, hasbw, hasxn, hasye; /* Value of the Co (max_colors) entry: may not be set */ @@ -226,7 +226,7 @@ char **x; LinkList paramlist; - argzero = *argv++; + argzero = posixzero = *argv++; SHIN = 0; /* There's a bit of trickery with opts[INTERACTIVE] here. It starts * @@ -252,6 +252,7 @@ paramlist = znewlinklist(); if (*argv) { if (unset(SHINSTDIN)) { + posixzero = *argv; if (cmd) argzero = *argv; else @@ -275,6 +276,7 @@ while ((*x++ = (char *)getlinknode(paramlist))); free(paramlist); argzero = ztrdup(argzero); + posixzero = ztrdup(posixzero); } /* Insert into list in order of pointer value */ @@ -698,6 +700,7 @@ /* check whether terminal has automargin (wraparound) capability */ hasam = tgetflag("am"); + hasbw = tgetflag("bw"); hasxn = tgetflag("xn"); /* also check for newline wraparound glitch */ hasye = tgetflag("YE"); /* print in last column does carriage return */ @@ -749,9 +752,8 @@ tcstr[TCCLEARSCREEN] = ztrdup("\14"); tclen[TCCLEARSCREEN] = 1; } -#if 0 /* This might work, but there may be more to it */ - rprompt_indent = (hasye || !tccan(TCLEFT)) ? 1 : 0; -#endif + /* This might work, but there may be more to it */ + rprompt_indent = ((hasam && !hasbw) || hasye || !tccan(TCLEFT)); } return 1; } @@ -768,7 +770,8 @@ struct timezone dummy_tz; char *ptr; int i, j; -#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined (ADDITIONAL_FPATH) +#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined (ADDITIONAL_FPATH) || defined(FIXED_FPATH_DIR) +#define FPATH_NEEDS_INIT 1 char **fpathptr; # if defined(FPATH_DIR) && defined(FPATH_SUBDIRS) char *fpath_subdirs[] = FPATH_SUBDIRS; @@ -777,11 +780,17 @@ char *more_fndirs[] = ADDITIONAL_FPATH; int more_fndirs_len; # endif +# ifdef FIXED_FPATH_DIR +# define FIXED_FPATH_LEN 1 +# else +# define FIXED_FPATH_LEN 0 +# endif # ifdef SITEFPATH_DIR - int fpathlen = 1; +# define SITE_FPATH_LEN 1 # else - int fpathlen = 0; +# define SITE_FPATH_LEN 0 # endif + int fpathlen = FIXED_FPATH_LEN + SITE_FPATH_LEN; #endif int close_fds[10], tmppipe[2]; @@ -860,23 +869,27 @@ manpath = mkarray(NULL); fignore = mkarray(NULL); -#if defined(SITEFPATH_DIR) || defined(FPATH_DIR) || defined(ADDITIONAL_FPATH) +#ifdef FPATH_NEEDS_INIT # ifdef FPATH_DIR # ifdef FPATH_SUBDIRS fpathlen += sizeof(fpath_subdirs)/sizeof(char *); -# else +# else /* FPATH_SUBDIRS */ fpathlen++; -# endif -# endif +# endif /* FPATH_SUBDIRS */ +# endif /* FPATH_DIR */ # if defined(ADDITIONAL_FPATH) more_fndirs_len = sizeof(more_fndirs)/sizeof(char *); fpathlen += more_fndirs_len; -# endif +# endif /* ADDITONAL_FPATH */ fpath = fpathptr = (char **)zalloc((fpathlen+1)*sizeof(char *)); +# ifdef FIXED_FPATH_DIR + *fpathptr++ = ztrdup(FIXED_FPATH_DIR); + fpathlen--; +# endif # ifdef SITEFPATH_DIR *fpathptr++ = ztrdup(SITEFPATH_DIR); fpathlen--; -# endif +# endif /* SITEFPATH_DIR */ # if defined(ADDITIONAL_FPATH) for (j = 0; j < more_fndirs_len; j++) *fpathptr++ = ztrdup(more_fndirs[j]); @@ -895,9 +908,9 @@ # endif # endif *fpathptr = NULL; -#else +#else /* FPATH_NEEDS_INIT */ fpath = mkarray(NULL); -#endif +#endif /* FPATH_NEEDS_INIT */ mailpath = mkarray(NULL); watch = mkarray(NULL); @@ -1003,15 +1016,6 @@ setiparam("COLUMNS", zterm_columns); setiparam("LINES", zterm_lines); #endif - { - /* Import from environment, overrides init_term() */ - struct value vbuf; - char *name = "ZLE_RPROMPT_INDENT"; - if (getvalue(&vbuf, &name, 1) && !(vbuf.flags & PM_UNSET)) - rprompt_indent = getintvalue(&vbuf); - else - rprompt_indent = 1; - } #ifdef HAVE_GETRLIMIT for (i = 0; i != RLIM_NLIMITS; i++) { @@ -1130,6 +1134,7 @@ winch_block(); /* See utils.c:preprompt() */ #endif if (interact) { + install_handler(SIGPIPE); install_handler(SIGALRM); signal_ignore(SIGTERM); } @@ -1535,7 +1540,7 @@ mod_export int fallback_compctlread(char *name, UNUSED(char **args), UNUSED(Options ops), UNUSED(char *reply)) { - zwarnnam(name, "option valid only in functions called from completion"); + zwarnnam(name, "no loaded module provides read for completion context"); return 1; } diff -Nru zsh-5.0.5/Src/jobs.c zsh-5.0.7/Src/jobs.c --- zsh-5.0.5/Src/jobs.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/jobs.c 2014-10-07 18:11:30.000000000 +0000 @@ -384,9 +384,11 @@ Process p; for (p = jn->procs, i = 0; p && i < MAX_PIPESTATS; p = p->next, i++) { - jpipestats[i] = ((WIFSIGNALED(p->status)) ? + jpipestats[i] = (WIFSIGNALED(p->status) ? 0200 | WTERMSIG(p->status) : - WEXITSTATUS(p->status)); + (WIFSTOPPED(p->status) ? + 0200 | WEXITSTATUS(p->status) : + WEXITSTATUS(p->status))); if (jpipestats[i]) pipefail = jpipestats[i]; } @@ -436,8 +438,11 @@ if (WIFSTOPPED(pn->status)) /* some processes are stopped */ somestopped = 1; /* so job is not done, but entry needs updating */ if (!pn->next) /* last job in pipeline determines exit status */ - val = (WIFSIGNALED(pn->status)) ? 0200 | WTERMSIG(pn->status) : - WEXITSTATUS(pn->status); + val = (WIFSIGNALED(pn->status) ? + 0200 | WTERMSIG(pn->status) : + (WIFSTOPPED(pn->status) ? + 0200 | WEXITSTATUS(pn->status) : + WEXITSTATUS(pn->status))); if (pn->pid == jn->gleader) /* if this process is process group leader */ status = pn->status; } @@ -537,7 +542,7 @@ return; jn->stat |= (somestopped) ? STAT_CHANGED | STAT_STOPPED : STAT_CHANGED | STAT_DONE; - if (jn->stat & STAT_DONE) { + if (jn->stat & (STAT_DONE|STAT_STOPPED)) { /* This may be redundant with printjob() but note that inforeground * is true here for STAT_CURSH jobs even when job != thisjob, most * likely because thisjob = -1 from exec.c:execsimple() trickery. @@ -618,13 +623,11 @@ } /**/ -#ifndef HAVE_GETRUSAGE -static long clktck = 0; - -/**/ -static void -set_clktck(void) +long +get_clktck(void) { + static long clktck; + #ifdef _SC_CLK_TCK if (!clktck) /* fetch clock ticks per second from * @@ -646,9 +649,9 @@ # endif # endif #endif + + return clktck; } -/**/ -#endif /**/ static void @@ -698,11 +701,13 @@ percent = 100.0 * total_time / (real->tv_sec + real->tv_usec / 1000000.0); #else - set_clktck(); - user_time = ti->ut / (double) clktck; - system_time = ti->st / (double) clktck; - percent = 100.0 * (ti->ut + ti->st) - / (clktck * real->tv_sec + clktck * real->tv_usec / 1000000.0); + { + long clktck = get_clktck(); + user_time = ti->ut / (double) clktck; + system_time = ti->st / (double) clktck; + percent = 100.0 * (ti->ut + ti->st) + / (clktck * real->tv_sec + clktck * real->tv_usec / 1000000.0); + } #endif queue_signals(); @@ -910,8 +915,10 @@ reporttime--; return reporttime <= 0; #else - set_clktck(); - return ((j->procs->ti.ut + j->procs->ti.st) / clktck >= reporttime); + { + clktck = get_clktck(); + return ((j->procs->ti.ut + j->procs->ti.st) / clktck >= reporttime); + } #endif } @@ -1620,8 +1627,10 @@ } if (!hasprocs(thisjob)) deletejob(jobtab + thisjob, 0); - else + else { jobtab[thisjob].stat |= STAT_LOCKED; + pipecleanfilelist(jobtab[thisjob].filelist); + } thisjob = -1; } diff -Nru zsh-5.0.5/Src/lex.c zsh-5.0.7/Src/lex.c --- zsh-5.0.5/Src/lex.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/lex.c 2014-10-07 18:11:30.000000000 +0000 @@ -30,6 +30,8 @@ #include "zsh.mdh" #include "lex.pro" +#define LEX_HEAP_SIZE (32) + /* tokens */ /**/ @@ -323,66 +325,70 @@ mod_export void lexrestore(void) { - struct lexstack *ln; + struct lexstack *ln = lstack; DPUTS(!lstack, "BUG: lexrestore() without lexsave()"); - incmdpos = lstack->incmdpos; - incond = lstack->incond; - incasepat = lstack->incasepat; - dbparens = lstack->dbparens; - isfirstln = lstack->isfirstln; - isfirstch = lstack->isfirstch; - histactive = lstack->histactive; - histdone = lstack->histdone; - lexflags = lstack->lexflags; - stophist = lstack->stophist; - chline = lstack->hline; - hptr = lstack->hptr; + + queue_signals(); + lstack = lstack->next; + + if (!lstack) { + /* Back to top level: don't need special ZLE value */ + DPUTS(ln->hline != zle_chline, "BUG: Ouch, wrong chline for ZLE"); + zle_chline = NULL; + } + + incmdpos = ln->incmdpos; + incond = ln->incond; + incasepat = ln->incasepat; + dbparens = ln->dbparens; + isfirstln = ln->isfirstln; + isfirstch = ln->isfirstch; + histactive = ln->histactive; + histdone = ln->histdone; + lexflags = ln->lexflags; + stophist = ln->stophist; + chline = ln->hline; + hptr = ln->hptr; if (cmdstack) - free(cmdstack); - cmdstack = lstack->cstack; - cmdsp = lstack->csp; - tok = lstack->tok; - isnewlin = lstack->isnewlin; - tokstr = lstack->tokstr; - zshlextext = lstack->zshlextext; - bptr = lstack->bptr; - bsiz = lstack->bsiz; - len = lstack->len; - chwords = lstack->chwords; - chwordlen = lstack->chwordlen; - chwordpos = lstack->chwordpos; - hwgetword = lstack->hwgetword; - lexstop = lstack->lexstop; - hdocs = lstack->hdocs; - hgetc = lstack->hgetc; - hungetc = lstack->hungetc; - hwaddc = lstack->hwaddc; - hwbegin = lstack->hwbegin; - hwend = lstack->hwend; - addtoline = lstack->addtoline; + zfree(cmdstack, CMDSTACKSZ); + cmdstack = ln->cstack; + cmdsp = ln->csp; + tok = ln->tok; + isnewlin = ln->isnewlin; + tokstr = ln->tokstr; + zshlextext = ln->zshlextext; + bptr = ln->bptr; + bsiz = ln->bsiz; + len = ln->len; + chwords = ln->chwords; + chwordlen = ln->chwordlen; + chwordpos = ln->chwordpos; + hwgetword = ln->hwgetword; + lexstop = ln->lexstop; + hdocs = ln->hdocs; + hgetc = ln->hgetc; + hungetc = ln->hungetc; + hwaddc = ln->hwaddc; + hwbegin = ln->hwbegin; + hwend = ln->hwend; + addtoline = ln->addtoline; if (ecbuf) zfree(ecbuf, eclen); - eclen = lstack->eclen; - ecused = lstack->ecused; - ecnpats = lstack->ecnpats; - ecbuf = lstack->ecbuf; - ecstrs = lstack->ecstrs; - ecsoffs = lstack->ecsoffs; - ecssub = lstack->ecssub; - ecnfunc = lstack->ecnfunc; - hlinesz = lstack->hlinesz; - toklineno = lstack->toklineno; + eclen = ln->eclen; + ecused = ln->ecused; + ecnpats = ln->ecnpats; + ecbuf = ln->ecbuf; + ecstrs = ln->ecstrs; + ecsoffs = ln->ecsoffs; + ecssub = ln->ecssub; + ecnfunc = ln->ecnfunc; + hlinesz = ln->hlinesz; + toklineno = ln->toklineno; errflag = 0; + free(ln); - ln = lstack->next; - if (!ln) { - /* Back to top level: don't need special ZLE value */ - DPUTS(chline != zle_chline, "BUG: Ouch, wrong chline for ZLE"); - zle_chline = NULL; - } - free(lstack); - lstack = ln; + unqueue_signals(); } /**/ @@ -721,7 +727,7 @@ /* word includes the last character read and possibly \ before ! */ if (dbparens) { len = 0; - bptr = tokstr = (char *) hcalloc(bsiz = 32); + bptr = tokstr = (char *) hcalloc(bsiz = LEX_HEAP_SIZE); hungetc(c); cmdpush(CS_MATH); c = dquote_parse(infor ? ';' : ')', 0); @@ -775,7 +781,7 @@ if (lexflags & LEXFLAGS_COMMENTS_KEEP) { len = 0; - bptr = tokstr = (char *)hcalloc(bsiz = 32); + bptr = tokstr = (char *)hcalloc(bsiz = LEX_HEAP_SIZE); add(c); } hwend(); @@ -877,7 +883,7 @@ } if (incmdpos || (isset(SHGLOB) && !isset(KSHGLOB))) { len = 0; - bptr = tokstr = (char *) hcalloc(bsiz = 32); + bptr = tokstr = (char *) hcalloc(bsiz = LEX_HEAP_SIZE); switch (cmd_or_math(CS_MATH)) { case 1: return DINPAR; @@ -1027,7 +1033,7 @@ peek = STRING; if (!sub) { len = 0; - bptr = tokstr = (char *) hcalloc(bsiz = 32); + bptr = tokstr = (char *) hcalloc(bsiz = LEX_HEAP_SIZE); } for (;;) { int act; diff -Nru zsh-5.0.5/Src/loop.c zsh-5.0.7/Src/loop.c --- zsh-5.0.5/Src/loop.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/loop.c 2014-10-07 18:11:30.000000000 +0000 @@ -73,7 +73,7 @@ matheval(str); if (errflag) { state->pc = end; - return lastval = errflag; + return 1; } cond = ecgetstr(state, EC_NODUP, &ctok); advance = ecgetstr(state, EC_NODUP, &atok); @@ -87,8 +87,13 @@ state->pc = end; return 0; } - if (htok) + if (htok) { execsubst(args); + if (errflag) { + state->pc = end; + return 1; + } + } } else { char **x; @@ -97,7 +102,7 @@ addlinknode(args, dupstring(*x)); } } - lastval = 0; + /* lastval = 0; */ loops++; pushheap(); cmdpush(CS_FOR); @@ -223,15 +228,20 @@ state->pc = end; return 0; } - if (htok) + if (htok) { execsubst(args); + if (errflag) { + state->pc = end; + return 1; + } + } } if (!args || empty(args)) { state->pc = end; return 1; } loops++; - lastval = 0; + /* lastval = 0; */ pushheap(); cmdpush(CS_SELECT); usezle = interact && SHTTY != -1 && isset(USEZLE); diff -Nru zsh-5.0.5/Src/math.c zsh-5.0.7/Src/math.c --- zsh-5.0.5/Src/math.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/math.c 2014-10-07 18:11:30.000000000 +0000 @@ -556,6 +556,9 @@ int outputradix; /**/ +int outputunderscore; + +/**/ static int zzlex(void) { @@ -713,7 +716,7 @@ return EOI; case '[': { - int n; + int n, checkradix = 0; if (idigit(*ptr)) { n = zstrtol(ptr, &ptr, 10); @@ -730,9 +733,19 @@ n = -1; ptr++; } - if (!idigit(*ptr)) + if (!idigit(*ptr) && *ptr != '_') goto bofs; - outputradix = n * zstrtol(ptr, &ptr, 10); + if (idigit(*ptr)) { + outputradix = n * zstrtol(ptr, &ptr, 10); + checkradix = 1; + } + if (*ptr == '_') { + ptr++; + if (idigit(*ptr)) + outputunderscore = zstrtol(ptr, &ptr, 10); + else + outputunderscore = 3; + } } else { bofs: zerr("bad output format specification"); @@ -740,11 +753,13 @@ } if(*ptr != ']') goto bofs; - n = (outputradix < 0) ? -outputradix : outputradix; - if (n < 2 || n > 36) { - zerr("invalid base (must be 2 to 36 inclusive): %d", - outputradix); - return EOI; + if (checkradix) { + n = (outputradix < 0) ? -outputradix : outputradix; + if (n < 2 || n > 36) { + zerr("invalid base (must be 2 to 36 inclusive): %d", + outputradix); + return EOI; + } } ptr++; break; @@ -1337,9 +1352,9 @@ char *junk; mnumber x; int xmtok = mtok; - /* maintain outputradix across levels of evaluation */ + /* maintain outputradix and outputunderscore across levels of evaluation */ if (!mlevel) - outputradix = 0; + outputradix = outputunderscore = 0; if (!*s) { x.type = MN_INTEGER; diff -Nru zsh-5.0.5/Src/mem.c zsh-5.0.7/Src/mem.c --- zsh-5.0.5/Src/mem.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/mem.c 2014-10-07 18:11:30.000000000 +0000 @@ -226,6 +226,9 @@ #else zfree(h, HEAPSIZE); #endif +#ifdef ZSH_VALGRIND + VALGRIND_DESTROY_MEMPOOL((char *)h); +#endif } heaps = old; #ifdef ZSH_HEAP_DEBUG @@ -319,23 +322,26 @@ h_free++; #endif - /* At this point we used to do: - fheap = NULL; - * + /* * When pushheap() is called, it sweeps over the entire heaps list of * arenas and marks every one of them with the amount of free space in * that arena at that moment. zhalloc() is then allowed to grab bits * out of any of those arenas that have free space. * - * With the above reset of fheap, the loop below sweeps back over the + * Whenever fheap is NULL here, the loop below sweeps back over the * entire heap list again, resetting the free space in every arena to * the amount stashed by pushheap() and finding the first arena with * free space to optimize zhalloc()'s next search. When there's a lot * of stuff already on the heap, this is an enormous amount of work, * and performance goes to hell. * - * However, there doesn't seem to be any reason to reset fheap before - * beginning this loop. Either it's already correct, or it has never + * However, if the arena to which fheap points is unused, we want to + * free it, so we have no choice but to do the sweep for a new fheap. + */ + if (fheap && !fheap->sp) + fheap = NULL; /* We used to do this unconditionally */ + /* + * In other cases, either fheap is already correct, or it has never * been set and this loop will do it, or it'll be reset from scratch * on the next popheap(). So all that's needed here is to pick up * the scan wherever the last pass [or the last popheap()] left off. @@ -344,6 +350,10 @@ hn = h->next; if (h->sp) { #ifdef ZSH_MEM_DEBUG +#ifdef ZSH_VALGRIND + VALGRIND_MAKE_MEM_UNDEFINED((char *)arena(h) + h->sp->used, + h->used - h->sp->used); +#endif memset(arena(h) + h->sp->used, 0xff, h->used - h->sp->used); #endif h->used = h->sp->used; @@ -366,12 +376,18 @@ h->heap_id = new_id; } #endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_TRIM((char *)h, (char *)arena(h), h->used); +#endif } else { #ifdef USE_MMAP munmap((void *) h, h->size); #else zfree(h, HEAPSIZE); #endif +#ifdef ZSH_VALGRIND + VALGRIND_DESTROY_MEMPOOL((char *)h); +#endif } } if (hl) @@ -403,6 +419,10 @@ if ((hs = h->sp)) { h->sp = hs->next; #ifdef ZSH_MEM_DEBUG +#ifdef ZSH_VALGRIND + VALGRIND_MAKE_MEM_UNDEFINED((char *)arena(h) + hs->used, + h->used - hs->used); +#endif memset(arena(h) + hs->used, 0xff, h->used - hs->used); #endif h->used = hs->used; @@ -414,6 +434,9 @@ } h->heap_id = hs->heap_id; #endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_TRIM((char *)h, (char *)arena(h), h->used); +#endif if (!fheap && h->used < ARENA_SIZEOF(h)) fheap = h; zfree(hs, sizeof(*hs)); @@ -425,6 +448,9 @@ #else zfree(h, HEAPSIZE); #endif +#ifdef ZSH_VALGRIND + VALGRIND_DESTROY_MEMPOOL((char *)h); +#endif } } if (hl) @@ -496,6 +522,12 @@ { Heap h; size_t n; +#ifdef ZSH_VALGRIND + size_t req_size = size; + + if (size == 0) + return NULL; +#endif size = (size + H_ISIZE - 1) & ~(H_ISIZE - 1); @@ -523,6 +555,9 @@ HEAPID_FMT ".\n", h->heap_id); } #endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_ALLOC((char *)h, (char *)ret, req_size); +#endif return ret; } } @@ -561,6 +596,12 @@ h->heap_id); } #endif +#ifdef ZSH_VALGRIND + VALGRIND_CREATE_MEMPOOL((char *)h, 0, 0); + VALGRIND_MAKE_MEM_NOACCESS((char *)arena(h), + n - ((char *)arena(h)-(char *)h)); + VALGRIND_MEMPOOL_ALLOC((char *)h, (char *)arena(h), req_size); +#endif if (hp) hp->next = h; @@ -586,13 +627,21 @@ { Heap h, ph; +#ifdef ZSH_VALGRIND + size_t new_req = new; +#endif + old = (old + H_ISIZE - 1) & ~(H_ISIZE - 1); new = (new + H_ISIZE - 1) & ~(H_ISIZE - 1); if (old == new) return p; if (!old && !p) +#ifdef ZSH_VALGRIND + return zhalloc(new_req); +#else return zhalloc(new); +#endif /* find the heap with p */ @@ -615,14 +664,33 @@ */ if (p + old < arena(h) + h->used) { if (new > old) { +#ifdef ZSH_VALGRIND + char *ptr = (char *) zhalloc(new_req); +#else char *ptr = (char *) zhalloc(new); +#endif memcpy(ptr, p, old); #ifdef ZSH_MEM_DEBUG memset(p, 0xff, old); #endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_FREE((char *)h, (char *)p); + /* + * zhalloc() marked h,ptr,new as an allocation so we don't + * need to do that here. + */ +#endif unqueue_signals(); return ptr; } else { +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_FREE((char *)h, (char *)p); + if (p) { + VALGRIND_MEMPOOL_ALLOC((char *)h, (char *)p, + new_req); + VALGRIND_MAKE_MEM_DEFINED((char *)h, (char *)p); + } +#endif unqueue_signals(); return new ? p : NULL; } @@ -657,10 +725,14 @@ #else zfree(h, HEAPSIZE); #endif +#ifdef ZSH_VALGRIND + VALGRIND_DESTROY_MEMPOOL((char *)h); +#endif unqueue_signals(); return NULL; } if (new > ARENA_SIZEOF(h)) { + Heap hnew; /* * Not enough memory in this heap. Allocate a new * one of sufficient size. @@ -682,17 +754,23 @@ * a mmap'd segment be extended, so simply allocate * a new one and copy. */ - Heap hnew; - hnew = mmap_heap_alloc(&n); /* Copy the entire heap, header (with next pointer) included */ memcpy(hnew, h, h->size); munmap((void *)h, h->size); - h = hnew; } #else - h = (Heap) realloc(h, n); + hnew = (Heap) realloc(h, n); +#endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_FREE((char *)h, p); + VALGRIND_DESTROY_MEMPOOL((char *)h); + VALGRIND_CREATE_MEMPOOL((char *)hnew, 0, 0); + VALGRIND_MEMPOOL_ALLOC((char *)hnew, (char *)arena(hnew), + new_req); + VALGRIND_MAKE_MEM_DEFINED((char *)hnew, (char *)arena(hnew)); #endif + h = hnew; h->size = n; if (ph) @@ -700,6 +778,13 @@ else heaps = h; } +#ifdef ZSH_VALGRIND + else { + VALGRIND_MEMPOOL_FREE((char *)h, (char *)p); + VALGRIND_MEMPOOL_ALLOC((char *)h, (char *)p, new_req); + VALGRIND_MAKE_MEM_DEFINED((char *)h, (char *)p); + } +#endif h->used = new; #ifdef ZSH_HEAP_DEBUG h->heap_id = heap_id; @@ -713,6 +798,11 @@ if (h->used + (new - old) <= ARENA_SIZEOF(h)) { h->used += new - old; unqueue_signals(); +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_FREE((char *)h, (char *)p); + VALGRIND_MEMPOOL_ALLOC((char *)h, (char *)p, new_req); + VALGRIND_MAKE_MEM_DEFINED((char *)h, (char *)p); +#endif return p; } else { char *t = zhalloc(new); @@ -721,6 +811,10 @@ #ifdef ZSH_MEM_DEBUG memset(p, 0xff, old); #endif +#ifdef ZSH_VALGRIND + VALGRIND_MEMPOOL_FREE((char *)h, (char *)p); + /* t already marked as allocated by zhalloc() */ +#endif unqueue_signals(); return t; } @@ -856,7 +950,10 @@ ptr = NULL; } else { /* If ptr is NULL, then behave like malloc */ - ptr = malloc(size); + if (!(ptr = (void *) malloc(size))) { + zerr("fatal error: out of memory"); + exit(1); + } } unqueue_signals(); @@ -1505,7 +1602,7 @@ MALLOC_RET_T realloc(MALLOC_RET_T p, MALLOC_ARG_T size) { - struct m_hdr *m = (struct m_hdr *)(((char *)p) - M_ISIZE), *mp, *mt; + struct m_hdr *m = (struct m_hdr *)(((char *)p) - M_ISIZE), *mt; char *r; int i, l = 0; @@ -1521,10 +1618,10 @@ /* check if we are reallocating a small block, if we do, we have to compute the size of the block from the sort of block it is in */ for (i = 0; i < M_NSMALL; i++) { - for (mp = NULL, mt = m_small[i]; + for (mt = m_small[i]; mt && (((char *)mt) > ((char *)p) || (((char *)mt) + mt->len) < ((char *)p)); - mp = mt, mt = mt->next); + mt = mt->next); if (mt) { l = M_BSLEN(mt->len); diff -Nru zsh-5.0.5/Src/mkmakemod.sh zsh-5.0.7/Src/mkmakemod.sh --- zsh-5.0.5/Src/mkmakemod.sh 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/mkmakemod.sh 2014-10-07 18:11:30.000000000 +0000 @@ -307,10 +307,10 @@ echo "\$(SYMS_${mddname}): \$(PROTODEPS)" echo echo "${mddname}.export: \$(SYMS_${mddname})" - echo " ( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@" + echo " @( echo '#!'; cat \$(SYMS_${mddname}) | sed -n '/^X/{s/^X//;p;}' | sort -u ) > \$@" echo echo "modobjs.${mddname}: \$(MODOBJS_${mddname})" - echo " echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp" + echo " @echo '' \$(MODOBJS_${mddname}) $modobjs_sed>> \$(dir_src)/stamp-modobjs.tmp" echo if test -z "$alwayslink"; then case " $all_modules" in *" ${mddname}."*) diff -Nru zsh-5.0.5/Src/Modules/datetime.c zsh-5.0.7/Src/Modules/datetime.c --- zsh-5.0.5/Src/Modules/datetime.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/datetime.c 2014-10-07 18:11:30.000000000 +0000 @@ -130,7 +130,7 @@ buffer = zalloc(bufsize); for (x=0; x < 4; x++) { - if (ztrftime(buffer, bufsize, argv[0], t) >= 0) + if (ztrftime(buffer, bufsize, argv[0], t, 0L) >= 0) break; buffer = zrealloc(buffer, bufsize *= 2); } diff -Nru zsh-5.0.5/Src/Modules/.distfiles zsh-5.0.7/Src/Modules/.distfiles --- zsh-5.0.5/Src/Modules/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,61 +1,2 @@ DISTFILES_SRC=' -.cvsignore -.distfiles -.exrc -attr.mdd -attr.c -cap.mdd -cap.c -clone.mdd -clone.c -curses.mdd -curses.c -curses_keys.awk -datetime.mdd -datetime.c -db_gdbm.mdd -db_gdbm.c -example.mdd -example.c -files.mdd -files.c -langinfo.mdd -langinfo.c -mapfile.mdd -mapfile.c -mathfunc.mdd -mathfunc.c -newuser.mdd -newuser.c -parameter.mdd -parameter.c -pcre.mdd -pcre.c -regex.mdd -regex.c -socket.mdd -socket.c -stat.mdd -stat.c -system.mdd -system.c -errnames1.awk -errnames2.awk -tcp.mdd -tcp.c -tcp.h -termcap.mdd -termcap.c -terminfo.mdd -terminfo.c -zftp.mdd -zftp.c -zprof.mdd -zprof.c -zselect.mdd -zselect.c -zutil.mdd -zutil.c -zpty.mdd -zpty.c ' diff -Nru zsh-5.0.5/Src/Modules/parameter.c zsh-5.0.7/Src/Modules/parameter.c --- zsh-5.0.5/Src/Modules/parameter.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/parameter.c 2014-10-07 18:11:30.000000000 +0000 @@ -106,7 +106,7 @@ pm->u.str = paramtypestr(rpm); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -224,7 +224,7 @@ } } else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -392,25 +392,41 @@ ((shf->node.flags & PM_TAGGED) ? "t" : ""))); } else { char *t = getpermtext(shf->funcdef, NULL, 1), *n, *h; + char *start; + + if (shf->redir) + start = "{\n\t"; + else + start = "\t"; if (shf->funcdef->flags & EF_RUN) { n = nicedupstring(name); - h = (char *) zhalloc(strlen(t) + strlen(n) + 9); - h[0] = '\t'; - strcpy(h + 1, t); + h = (char *) zhalloc(strlen(start) + strlen(t) + strlen(n) + 8); + strcpy(h, start); + strcat(h, t); strcat(h, "\n\t"); strcat(h, n); strcat(h, " \"$@\""); } else - h = dyncat("\t", t); + h = dyncat(start, t); zsfree(t); + /* + * TBD: Is this unmetafy correct? Surely as this + * is a parameter value it stays metafied? + */ unmetafy(h, NULL); + if (shf->redir) { + t = getpermtext(shf->redir, NULL, 1); + h = zhtricat(h, "\n}", t); + zsfree(t); + } + pm->u.str = h; } } else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -456,21 +472,38 @@ ((shf->node.flags & PM_TAGGED) ? "Ut" : "U") : ((shf->node.flags & PM_TAGGED) ? "t" : ""))); } else { - char *t = getpermtext(((Shfunc) hn)->funcdef, NULL, 1); - char *n; + Shfunc shf = (Shfunc)hn; + char *t = getpermtext(shf->funcdef, NULL, 1); + char *n, *start; + + if (shf->redir) + start = "{\n\t"; + else + start = "\t"; - if (((Shfunc) hn)->funcdef->flags & EF_RUN) { + if (shf->funcdef->flags & EF_RUN) { n = nicedupstring(hn->nam); - pm.u.str = (char *) zhalloc(strlen(t) + strlen(n) + 9); - pm.u.str[0] = '\t'; - strcpy(pm.u.str + 1, t); + pm.u.str = (char *) zhalloc( + strlen(start) + strlen(t) + strlen(n) + 8); + strcpy(pm.u.str, start); + strcat(pm.u.str, t); strcat(pm.u.str, "\n\t"); strcat(pm.u.str, n); strcat(pm.u.str, " \"$@\""); } else - pm.u.str = dyncat("\t", t); + pm.u.str = dyncat(start, t); + /* + * TBD: Is this unmetafy correct? Surely as this + * is a parameter value it stays metafied? + */ unmetafy(pm.u.str, NULL); zsfree(t); + + if (shf->redir) { + t = getpermtext(shf->redir, NULL, 1); + pm.u.str = zhtricat(pm.u.str, "\n}", t); + zsfree(t); + } } } func(&pm.node, flags); @@ -661,7 +694,7 @@ pm->u.str = dupstring(t); } else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -876,7 +909,7 @@ } else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -934,7 +967,7 @@ pm->u.str = dupstring(type); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1048,7 +1081,7 @@ pm->u.str = dupstring(he->node.nam); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1158,7 +1191,7 @@ pm->u.str = pmjobtext(job); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1259,7 +1292,7 @@ pm->u.str = pmjobstate(job); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1325,7 +1358,7 @@ pm->u.str = pmjobdir(job); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1451,7 +1484,7 @@ pm->u.str = dupstring(nd->dir); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1502,7 +1535,7 @@ pm->u.str = dupstring(nd->dir); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1754,7 +1787,7 @@ pm->u.str = dupstring(al->text); else { pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); } return &pm->node; } @@ -1950,7 +1983,7 @@ if (!gs) { zerr("failed to retrieve groups for user: %e", errno); pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); return &pm->node; } @@ -1965,7 +1998,7 @@ } pm->u.str = dupstring(""); - pm->node.flags |= PM_UNSET; + pm->node.flags |= (PM_UNSET|PM_SPECIAL); return &pm->node; } diff -Nru zsh-5.0.5/Src/Modules/pcre.c zsh-5.0.7/Src/Modules/pcre.c --- zsh-5.0.5/Src/Modules/pcre.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/pcre.c 2014-10-07 18:11:30.000000000 +0000 @@ -289,14 +289,11 @@ matched_portion = OPT_ARG(ops,c); } if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */ - offset_start = getposint(OPT_ARG(ops,c), nam); + if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0) + return 1; } /* For the entire match, 'Return' the offset byte positions instead of the matched string */ if(OPT_ISSET(ops,'b')) want_offset_pair = 1; - - if(!*args) { - zwarnnam(nam, "not enough arguments"); - } if ((ret = pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount))) { @@ -311,7 +308,7 @@ unmetafy(plaintext, NULL); subject_len = (int)strlen(plaintext); - if (offset_start < 0 || offset_start >= subject_len) + if (offset_start > 0 && offset_start >= subject_len) ret = PCRE_ERROR_NOMATCH; else ret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize); @@ -345,6 +342,8 @@ if (zpcre_utf8_enabled()) pcre_opts |= PCRE_UTF8; + if (isset(REMATCHPCRE) && !isset(CASEMATCH)) + pcre_opts |= PCRE_CASELESS; lhstr = cond_str(a,0,0); rhre = cond_str(a,1,0); diff -Nru zsh-5.0.5/Src/Modules/stat.c zsh-5.0.7/Src/Modules/stat.c --- zsh-5.0.5/Src/Modules/stat.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/stat.c 2014-10-07 18:11:30.000000000 +0000 @@ -198,7 +198,7 @@ if (flags & STF_STRING) { char *oend = outbuf + strlen(outbuf); ztrftime(oend, 40, timefmt, (flags & STF_GMT) ? gmtime(&tim) : - localtime(&tim)); + localtime(&tim), 0L); if (flags & STF_RAW) strcat(oend, ")"); } diff -Nru zsh-5.0.5/Src/Modules/zutil.c zsh-5.0.7/Src/Modules/zutil.c --- zsh-5.0.5/Src/Modules/zutil.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Modules/zutil.c 2014-10-07 18:11:30.000000000 +0000 @@ -30,6 +30,55 @@ #include "zutil.mdh" #include "zutil.pro" +typedef struct { + char **match; + char **mbegin; + char **mend; +} MatchData; + +static void +savematch(MatchData *m) +{ + char **a; + + queue_signals(); + a = getaparam("match"); + m->match = a ? zarrdup(a) : NULL; + a = getaparam("mbegin"); + m->mbegin = a ? zarrdup(a) : NULL; + a = getaparam("mend"); + m->mend = a ? zarrdup(a) : NULL; + unqueue_signals(); +} + +static void +restorematch(MatchData *m) +{ + if (m->match) + setaparam("match", m->match); + else + unsetparam("match"); + if (m->mbegin) + setaparam("mbegin", m->mbegin); + else + unsetparam("mbegin"); + if (m->mend) + setaparam("mend", m->mend); + else + unsetparam("mend"); +} + +static void +freematch(MatchData *m) +{ + if (m->match) + freearray(m->match); + if (m->mbegin) + freearray(m->mbegin); + if (m->mend) + freearray(m->mend); +} + /* Style stuff. */ typedef struct stypat *Stypat; @@ -370,15 +419,21 @@ { Style s; Stypat p; + char **found = NULL; s = (Style)zstyletab->getnode2(zstyletab, style); - if (!s) - return NULL; - for (p = s->pats; p; p = p->next) - if (pattry(p->prog, ctxt)) - return (p->eval ? evalstyle(p) : p->vals); + if (s) { + MatchData match; + savematch(&match); + for (p = s->pats; p; p = p->next) + if (pattry(p->prog, ctxt)) { + found = (p->eval ? evalstyle(p) : p->vals); + break; + } + restorematch(&match); + } - return NULL; + return found; } static int @@ -915,55 +970,6 @@ /* Zregexparse stuff. */ typedef struct { - char **match; - char **mbegin; - char **mend; -} MatchData; - -static void -savematch(MatchData *m) -{ - char **a; - - queue_signals(); - a = getaparam("match"); - m->match = a ? zarrdup(a) : NULL; - a = getaparam("mbegin"); - m->mbegin = a ? zarrdup(a) : NULL; - a = getaparam("mend"); - m->mend = a ? zarrdup(a) : NULL; - unqueue_signals(); -} - -static void -restorematch(MatchData *m) -{ - if (m->match) - setaparam("match", m->match); - else - unsetparam("match"); - if (m->mbegin) - setaparam("mbegin", m->mbegin); - else - unsetparam("mbegin"); - if (m->mend) - setaparam("mend", m->mend); - else - unsetparam("mend"); -} - -static void -freematch(MatchData *m) -{ - if (m->match) - freearray(m->match); - if (m->mbegin) - freearray(m->mbegin); - if (m->mend) - freearray(m->mend); -} - -typedef struct { int cutoff; char *pattern; Patprog patprog; @@ -1543,6 +1549,45 @@ } } +/* + * For "zparseopts -K -A assoc ..." this function copies the keys and + * values from the default and allocates the extra space for any parsed + * values having the same keys. If there are no new values, creates an + * empty array. Returns a pointer to the NULL element marking the end. + * + * aval = pointer to the newly allocated array + * assoc = name of the default hash param to copy + * keep = whether we need to make the copy at all + * num = count of new values to add space for + */ +static char ** +zalloc_default_array(char ***aval, char *assoc, int keep, int num) +{ + char **ap = 0; + + *aval = 0; + if (keep && num) { + struct value vbuf; + Value v = fetchvalue(&vbuf, &assoc, 0, + SCANPM_WANTKEYS|SCANPM_WANTVALS|SCANPM_MATCHMANY); + if (v && v->isarr) { + char **dp, **dval = getarrvalue(v); + int dnum = (dval ? arrlen(dval) : 0) + 1; + *aval = (char **) zalloc(((num * 2) + dnum) * sizeof(char *)); + for (ap = *aval, dp = dval; dp && *dp; dp++) { + *ap = (char *) zalloc(strlen(*dp) + 1); + strcpy(*ap++, *dp); + } + *ap = NULL; + } + } + if (!ap) { + ap = *aval = (char **) zalloc(((num * 2) + 1) * sizeof(char *)); + *ap = NULL; + } + return ap; +} + static int bin_zparseopts(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { @@ -1825,8 +1870,8 @@ num++; if (!keep || num) { - aval = (char **) zalloc(((num * 2) + 1) * sizeof(char *)); - for (ap = aval, d = opt_descs; d; d = d->next) { + ap = zalloc_default_array(&aval, assoc, keep, num); + for (d = opt_descs; d; d = d->next) { if (d->vals) { *ap++ = n = (char *) zalloc(strlen(d->name) + 2); *n = '-'; diff -Nru zsh-5.0.5/Src/options.c zsh-5.0.7/Src/options.c --- zsh-5.0.5/Src/options.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/options.c 2014-10-07 18:11:30.000000000 +0000 @@ -165,6 +165,7 @@ {{NULL, "ignoreclosebraces", OPT_EMULATE}, IGNORECLOSEBRACES}, {{NULL, "ignoreeof", 0}, IGNOREEOF}, {{NULL, "incappendhistory", 0}, INCAPPENDHISTORY}, +{{NULL, "incappendhistorytime", 0}, INCAPPENDHISTORYTIME}, {{NULL, "interactive", OPT_SPECIAL}, INTERACTIVE}, {{NULL, "interactivecomments",OPT_BOURNE}, INTERACTIVECOMMENTS}, {{NULL, "ksharrays", OPT_EMULATE|OPT_BOURNE}, KSHARRAYS}, @@ -179,6 +180,7 @@ {{NULL, "listrowsfirst", 0}, LISTROWSFIRST}, {{NULL, "listtypes", OPT_ALL}, LISTTYPES}, {{NULL, "localoptions", OPT_EMULATE|OPT_KSH}, LOCALOPTIONS}, +{{NULL, "localloops", OPT_EMULATE}, LOCALLOOPS}, {{NULL, "localpatterns", OPT_EMULATE}, LOCALPATTERNS}, {{NULL, "localtraps", OPT_EMULATE|OPT_KSH}, LOCALTRAPS}, {{NULL, "login", OPT_SPECIAL}, LOGINSHELL}, @@ -207,6 +209,7 @@ {{NULL, "pathscript", OPT_EMULATE|OPT_BOURNE}, PATHSCRIPT}, {{NULL, "pipefail", OPT_EMULATE}, PIPEFAIL}, {{NULL, "posixaliases", OPT_EMULATE|OPT_BOURNE}, POSIXALIASES}, +{{NULL, "posixargzero", OPT_EMULATE}, POSIXARGZERO}, {{NULL, "posixbuiltins", OPT_EMULATE|OPT_BOURNE}, POSIXBUILTINS}, {{NULL, "posixcd", OPT_EMULATE|OPT_BOURNE}, POSIXCD}, {{NULL, "posixidentifiers", OPT_EMULATE|OPT_BOURNE}, POSIXIDENTIFIERS}, diff -Nru zsh-5.0.5/Src/params.c zsh-5.0.7/Src/params.c --- zsh-5.0.5/Src/params.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/params.c 2014-10-07 18:11:30.000000000 +0000 @@ -46,7 +46,7 @@ /**/ mod_export int locallevel; - + /* Variables holding values of special parameters */ /**/ @@ -67,6 +67,7 @@ /**/ mod_export char *argzero, /* $0 */ + *posixzero, /* $0 */ *home, /* $HOME */ *nullcmd, /* $NULLCMD */ *oldpwd, /* $OLDPWD */ @@ -194,6 +195,8 @@ static const struct gsu_integer ttyidle_gsu = { ttyidlegetfn, nullintsetfn, stdunsetfn }; +static const struct gsu_scalar argzero_gsu = +{ argzerogetfn, nullstrsetfn, nullunsetfn }; static const struct gsu_scalar username_gsu = { usernamegetfn, usernamesetfn, stdunsetfn }; static const struct gsu_scalar dash_gsu = @@ -263,7 +266,7 @@ #define NULL_GSU BR((GsuScalar)(void *)NULL) #define IPDEF1(A,B,C) {{NULL,A,PM_INTEGER|PM_SPECIAL|C},BR(NULL),GSU(B),10,0,NULL,NULL,NULL,0} IPDEF1("#", pound_gsu, PM_READONLY), -IPDEF1("ERRNO", errno_gsu, 0), +IPDEF1("ERRNO", errno_gsu, PM_UNSET), IPDEF1("GID", gid_gsu, PM_DONTIMPORT | PM_RESTRICTED), IPDEF1("EGID", egid_gsu, PM_DONTIMPORT | PM_RESTRICTED), IPDEF1("HISTSIZE", histsize_gsu, PM_RESTRICTED), @@ -279,12 +282,13 @@ IPDEF2("-", dash_gsu, PM_READONLY), IPDEF2("histchars", histchars_gsu, PM_DONTIMPORT), IPDEF2("HOME", home_gsu, PM_UNSET), -IPDEF2("TERM", term_gsu, 0), +IPDEF2("TERM", term_gsu, PM_UNSET), IPDEF2("TERMINFO", terminfo_gsu, PM_UNSET), IPDEF2("WORDCHARS", wordchars_gsu, 0), IPDEF2("IFS", ifs_gsu, PM_DONTIMPORT), -IPDEF2("_", underscore_gsu, PM_READONLY), +IPDEF2("_", underscore_gsu, PM_DONTIMPORT), IPDEF2("KEYBOARD_HACK", keyboard_hack_gsu, PM_DONTIMPORT), +IPDEF2("0", argzero_gsu, 0), #ifdef USE_LOCALE # define LCIPDEF(name) IPDEF2(name, lc_blah_gsu, PM_UNSET) @@ -321,25 +325,28 @@ IPDEF5("COLUMNS", &zterm_columns, zlevar_gsu), IPDEF5("LINES", &zterm_lines, zlevar_gsu), IPDEF5U("ZLE_RPROMPT_INDENT", &rprompt_indent, zlevar_gsu), -IPDEF5("OPTIND", &zoptind, varinteger_gsu), IPDEF5("SHLVL", &shlvl, varinteger_gsu), -IPDEF5("TRY_BLOCK_ERROR", &try_errflag, varinteger_gsu), + +/* Don't import internal integer status variables. */ +#define IPDEF6(A,B,F) {{NULL,A,PM_INTEGER|PM_SPECIAL|PM_DONTIMPORT},BR((void *)B),GSU(F),10,0,NULL,NULL,NULL,0} +IPDEF6("OPTIND", &zoptind, varinteger_gsu), +IPDEF6("TRY_BLOCK_ERROR", &try_errflag, varinteger_gsu), #define IPDEF7(A,B) {{NULL,A,PM_SCALAR|PM_SPECIAL},BR((void *)B),GSU(varscalar_gsu),0,0,NULL,NULL,NULL,0} +#define IPDEF7U(A,B) {{NULL,A,PM_SCALAR|PM_SPECIAL|PM_UNSET},BR((void *)B),GSU(varscalar_gsu),0,0,NULL,NULL,NULL,0} IPDEF7("OPTARG", &zoptarg), IPDEF7("NULLCMD", &nullcmd), -IPDEF7("POSTEDIT", &postedit), +IPDEF7U("POSTEDIT", &postedit), IPDEF7("READNULLCMD", &readnullcmd), IPDEF7("PS1", &prompt), -IPDEF7("RPS1", &rprompt), -IPDEF7("RPROMPT", &rprompt), +IPDEF7U("RPS1", &rprompt), +IPDEF7U("RPROMPT", &rprompt), IPDEF7("PS2", &prompt2), -IPDEF7("RPS2", &rprompt2), -IPDEF7("RPROMPT2", &rprompt2), +IPDEF7U("RPS2", &rprompt2), +IPDEF7U("RPROMPT2", &rprompt2), IPDEF7("PS3", &prompt3), IPDEF7("PS4", &prompt4), IPDEF7("SPROMPT", &sprompt), -IPDEF7("0", &argzero), #define IPDEF8(A,B,C,D) {{NULL,A,D|PM_SCALAR|PM_SPECIAL},BR((void *)B),GSU(colonarr_gsu),0,0,NULL,C,NULL,0} IPDEF8("CDPATH", &cdpath, "cdpath", 0), @@ -738,7 +745,8 @@ if (!idigit(*iname) && isident(iname) && !strchr(iname, '[')) { if ((!(pm = (Param) paramtab->getnode(paramtab, iname)) || !(pm->node.flags & PM_DONTIMPORT || pm->node.flags & PM_EXPORTED)) && - (pm = setsparam(iname, metafy(ivalue, -1, META_DUP)))) { + (pm = assignsparam(iname, metafy(ivalue, -1, META_DUP), + ASSPM_ENV_IMPORT))) { pm->node.flags |= PM_EXPORTED; if (pm->node.flags & PM_SPECIAL) pm->env = mkenvstr (pm->node.nam, @@ -2267,6 +2275,13 @@ mod_export void setstrvalue(Value v, char *val) { + assignstrvalue(v, val, 0); +} + +/**/ +mod_export void +assignstrvalue(Value v, char *val, int flags) +{ if (unset(EXECOPT)) return; if (v->pm->node.flags & PM_READONLY) { @@ -2343,7 +2358,13 @@ break; case PM_INTEGER: if (val) { - v->pm->gsu.i->setfn(v->pm, mathevali(val)); + zlong ival; + if (flags & ASSPM_ENV_IMPORT) { + char *ptr; + ival = zstrtol_underscore(val, &ptr, 0, 1); + } else + ival = mathevali(val); + v->pm->gsu.i->setfn(v->pm, ival); if ((v->pm->node.flags & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) && !v->pm->width) v->pm->width = strlen(val); @@ -2355,7 +2376,13 @@ case PM_EFLOAT: case PM_FFLOAT: if (val) { - mnumber mn = matheval(val); + mnumber mn; + if (flags & ASSPM_ENV_IMPORT) { + char *ptr; + mn.type = MN_FLOAT; + mn.u.d = strtod(val, &ptr); + } else + mn = matheval(val); v->pm->gsu.f->setfn(v->pm, (mn.type & MN_FLOAT) ? mn.u.d : (double)mn.u.l); if ((v->pm->node.flags & (PM_LEFT | PM_RIGHT_B | PM_RIGHT_Z)) && @@ -2416,9 +2443,10 @@ if ((val.type & MN_INTEGER) || outputradix) { if (!(val.type & MN_INTEGER)) val.u.l = (zlong) val.u.d; - convbase(p = buf, val.u.l, outputradix); + p = convbase_underscore(buf, val.u.l, outputradix, + outputunderscore); } else - p = convfloat(val.u.d, 0, 0, NULL); + p = convfloat_underscore(val.u.d, outputunderscore); setstrvalue(v, ztrdup(p)); break; case PM_INTEGER: @@ -2737,8 +2765,8 @@ } } } - - setstrvalue(v, val); + + assignstrvalue(v, val, flags); unqueue_signals(); return v->pm; } @@ -3979,6 +4007,17 @@ } #endif /* USE_LOCALE */ +/* Function to get value for special parameter `0' */ + +/**/ +static char * +argzerogetfn(UNUSED(Param pm)) +{ + if (isset(POSIXARGZERO)) + return posixzero; + return argzero; +} + /* Function to get value for special parameter `HISTSIZE' */ /**/ @@ -4245,7 +4284,7 @@ pipestatgetfn(UNUSED(Param pm)) { char **x = (char **) zhalloc((numpipestats + 1) * sizeof(char *)); - char buf[20], **p; + char buf[DIGBUFSIZE], **p; int *q, i; for (p = x, q = pipestats, i = numpipestats; i--; p++, q++) { @@ -4555,9 +4594,14 @@ */ } +/* + * Guts of convbase: this version can return the number of digits + * sans any base discriminator. + */ + /**/ -mod_export void -convbase(char *s, zlong v, int base) +void +convbase_ptr(char *s, zlong v, int base, int *ndigits) { int digs = 0; zulong x; @@ -4583,6 +4627,8 @@ x /= base; if (!digs) digs = 1; + if (ndigits) + *ndigits = digs; s[digs--] = '\0'; x = v; while (digs >= 0) { @@ -4594,6 +4640,64 @@ } /* + * Basic conversion of integer to a string given a base. + * If 0 base is 10. + * If negative no base discriminator is output. + */ + +/**/ +mod_export void +convbase(char *s, zlong v, int base) +{ + convbase_ptr(s, v, base, NULL); +} + +/* + * Add underscores to converted integer for readability with given spacing. + * s is as for convbase: at least BDIGBUFSIZE. + * If underscores were added, returned value with underscores comes from + * heap, else the returned value is s. + */ + +/**/ +char * +convbase_underscore(char *s, zlong v, int base, int underscore) +{ + char *retptr, *sptr, *dptr; + int ndigits, nunderscore, mod, len; + + convbase_ptr(s, v, base, &ndigits); + + if (underscore <= 0) + return s; + + nunderscore = (ndigits - 1) / underscore; + if (!nunderscore) + return s; + len = strlen(s); + retptr = zhalloc(len + nunderscore + 1); + mod = 0; + memcpy(retptr, s, len - ndigits); + sptr = s + len; + dptr = retptr + len + nunderscore; + /* copy the null */ + *dptr-- = *sptr--; + for (;;) { + *dptr = *sptr; + if (!--ndigits) + break; + dptr--; + sptr--; + if (++mod == underscore) { + mod = 0; + *dptr-- = '_'; + } + } + + return retptr; +} + +/* * Convert a floating point value for output. * Unlike convbase(), this has its own internal storage and returns * a value from the heap. @@ -4659,6 +4763,83 @@ return ret; } +/* + * convert float to string with basic options but inserting underscores + * for readability. + */ + +/**/ +char *convfloat_underscore(double dval, int underscore) +{ + int ndigits_int = 0, ndigits_frac = 0, nunderscore, len; + char *s, *retptr, *sptr, *dptr; + + s = convfloat(dval, 0, 0, NULL); + if (underscore <= 0) + return s; + + /* + * Count the number of digits before and after the decimal point, if any. + */ + sptr = s; + if (*sptr == '-') + sptr++; + while (idigit(*sptr)) { + ndigits_int++; + sptr++; + } + if (*sptr == '.') { + sptr++; + while (idigit(*sptr)) { + ndigits_frac++; + sptr++; + } + } + + /* + * Work out how many underscores to insert --- remember we + * put them in integer and fractional parts separately. + */ + nunderscore = (ndigits_int-1) / underscore + (ndigits_frac-1) / underscore; + if (!nunderscore) + return s; + len = strlen(s); + dptr = retptr = zhalloc(len + nunderscore + 1); + + /* + * Insert underscores in integer part. + * Grouping starts from the point in both directions. + */ + sptr = s; + if (*sptr == '-') + *dptr++ = *sptr++; + while (ndigits_int) { + *dptr++ = *sptr++; + if (--ndigits_int && !(ndigits_int % underscore)) + *dptr++ = '_'; + } + if (ndigits_frac) { + /* + * Insert underscores in the fractional part. + */ + int mod = 0; + /* decimal point, we already checked */ + *dptr++ = *sptr++; + while (ndigits_frac) { + *dptr++ = *sptr++; + mod++; + if (--ndigits_frac && mod == underscore) { + *dptr++ = '_'; + mod = 0; + } + } + } + /* Copy exponent and anything else up to null */ + while ((*dptr++ = *sptr++)) + ; + return retptr; +} + /* Start a parameter scope */ /**/ diff -Nru zsh-5.0.5/Src/parse.c zsh-5.0.7/Src/parse.c --- zsh-5.0.5/Src/parse.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/parse.c 2014-10-07 18:11:30.000000000 +0000 @@ -202,7 +202,7 @@ * sublists is that they can be executed faster, see exec.c. In the * parser, the test if a list can be simplified is done quite simply * by passing a int* around which gets set to non-zero if the thing - * just parsed is `complex', i.e. may need to be run by forking or + * just parsed is `cmplx', i.e. may need to be run by forking or * some such. * * In each of the above, strings are encoded as one word code. For empty @@ -375,6 +375,8 @@ /* Build eprog. */ +/* careful: copy_ecstr is from arg1 to arg2, unlike memcpy */ + static void copy_ecstr(Eccstr s, char *p) { @@ -386,24 +388,25 @@ } static Eprog -bld_eprog(void) +bld_eprog(int heap) { Eprog ret; int l; ecadd(WCB_END()); - ret = (Eprog) zhalloc(sizeof(*ret)); + ret = heap ? (Eprog) zhalloc(sizeof(*ret)) : (Eprog) zalloc(sizeof(*ret)); ret->len = ((ecnpats * sizeof(Patprog)) + (ecused * sizeof(wordcode)) + ecsoffs); ret->npats = ecnpats; - ret->nref = -1; /* Eprog is on the heap */ - ret->pats = (Patprog *) zhalloc(ret->len); + ret->nref = heap ? -1 : 1; + ret->pats = heap ? (Patprog *) zhalloc(ret->len) : + (Patprog *) zshcalloc(ret->len); ret->prog = (Wordcode) (ret->pats + ecnpats); ret->strs = (char *) (ret->prog + ecused); ret->shf = NULL; - ret->flags = EF_HEAP; + ret->flags = heap ? EF_HEAP : EF_REAL; ret->dump = NULL; for (l = 0; l < ecnpats; l++) ret->pats[l] = dummy_patprog1; @@ -455,7 +458,7 @@ clear_hdocs(); return NULL; } - return bld_eprog(); + return bld_eprog(1); } /**/ @@ -534,7 +537,7 @@ yyerror(0); return NULL; } - return bld_eprog(); + return bld_eprog(1); } /* @@ -553,7 +556,7 @@ clear_hdocs(); return NULL; } - return bld_eprog(); + return bld_eprog(1); } /* This adds a list wordcode. The important bit about this is that it also @@ -561,9 +564,9 @@ /**/ static void -set_list_code(int p, int type, int complex) +set_list_code(int p, int type, int cmplx) { - if (!complex && (type == Z_SYNC || type == (Z_SYNC | Z_END)) && + if (!cmplx && (type == Z_SYNC || type == (Z_SYNC | Z_END)) && WC_SUBLIST_TYPE(ecbuf[p + 1]) == WC_SUBLIST_END) { int ispipe = !(WC_SUBLIST_FLAGS(ecbuf[p + 1]) & WC_SUBLIST_SIMPLE); ecbuf[p] = WCB_LIST((type | Z_SIMPLE), ecused - 2 - p); @@ -578,9 +581,9 @@ /**/ static void -set_sublist_code(int p, int type, int flags, int skip, int complex) +set_sublist_code(int p, int type, int flags, int skip, int cmplx) { - if (complex) + if (cmplx) ecbuf[p] = WCB_SUBLIST(type, flags, skip); else { ecbuf[p] = WCB_SUBLIST(type, (flags | WC_SUBLIST_SIMPLE), skip); @@ -594,7 +597,7 @@ /**/ static int -par_list(int *complex) +par_list(int *cmplx) { int p, lp = -1, c; @@ -607,10 +610,10 @@ c = 0; if (par_sublist(&c)) { - *complex |= c; + *cmplx |= c; if (tok == SEPER || tok == AMPER || tok == AMPERBANG) { if (tok != SEPER) - *complex = 1; + *cmplx = 1; set_list_code(p, ((tok == SEPER) ? Z_SYNC : (tok == AMPER) ? Z_ASYNC : (Z_ASYNC | Z_DISOWN)), c); @@ -635,13 +638,13 @@ /**/ static int -par_list1(int *complex) +par_list1(int *cmplx) { int p = ecadd(0), c = 0; if (par_sublist(&c)) { set_list_code(p, (Z_SYNC | Z_END), c); - *complex |= c; + *cmplx |= c; return 1; } else { ecused--; @@ -655,7 +658,7 @@ /**/ static int -par_sublist(int *complex) +par_sublist(int *cmplx) { int f, p, c = 0; @@ -664,7 +667,7 @@ if ((f = par_sublist2(&c)) != -1) { int e = ecused; - *complex |= c; + *cmplx |= c; if (tok == DBAR || tok == DAMPER) { enum lextok qtok = tok; int sl; @@ -673,7 +676,7 @@ zshlex(); while (tok == SEPER) zshlex(); - sl = par_sublist(complex); + sl = par_sublist(cmplx); set_sublist_code(p, (sl ? (qtok == DBAR ? WC_SUBLIST_OR : WC_SUBLIST_AND) : WC_SUBLIST_END), @@ -694,20 +697,20 @@ /**/ static int -par_sublist2(int *complex) +par_sublist2(int *cmplx) { int f = 0; if (tok == COPROC) { - *complex = 1; + *cmplx = 1; f |= WC_SUBLIST_COPROC; zshlex(); } else if (tok == BANG) { - *complex = 1; + *cmplx = 1; f |= WC_SUBLIST_NOT; zshlex(); } - if (!par_pline(complex) && !f) + if (!par_pline(cmplx) && !f) return -1; return f; @@ -719,19 +722,19 @@ /**/ static int -par_pline(int *complex) +par_pline(int *cmplx) { int p; zlong line = toklineno; p = ecadd(0); - if (!par_cmd(complex)) { + if (!par_cmd(cmplx, 0)) { ecused--; return 0; } if (tok == BAR) { - *complex = 1; + *cmplx = 1; cmdpush(CS_PIPE); zshlex(); while (tok == SEPER) @@ -739,7 +742,7 @@ ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0)); ecispace(p + 1, 1); ecbuf[p + 1] = ecused - 1 - p; - if (!par_pline(complex)) { + if (!par_pline(cmplx)) { tok = LEXERR; } cmdpop(); @@ -755,7 +758,7 @@ ecbuf[r + 1] = 2; ecbuf[r + 2] = ecstrcode("1"); - *complex = 1; + *cmplx = 1; cmdpush(CS_ERRPIPE); zshlex(); while (tok == SEPER) @@ -763,7 +766,7 @@ ecbuf[p] = WCB_PIPE(WC_PIPE_MID, (line >= 0 ? line + 1 : 0)); ecispace(p + 1, 1); ecbuf[p + 1] = ecused - 1 - p; - if (!par_pline(complex)) { + if (!par_pline(cmplx)) { tok = LEXERR; } cmdpop(); @@ -777,18 +780,20 @@ /* * cmd : { redir } ( for | case | if | while | repeat | * subsh | funcdef | time | dinbrack | dinpar | simple ) { redir } + * + * zsh_construct is passed through to par_subsh(), q.v. */ /**/ static int -par_cmd(int *complex) +par_cmd(int *cmplx, int zsh_construct) { int r, nr = 0; r = ecused; if (IS_REDIROP(tok)) { - *complex = 1; + *cmplx = 1; while (IS_REDIROP(tok)) { nr += par_redir(&r, NULL); } @@ -796,57 +801,57 @@ switch (tok) { case FOR: cmdpush(CS_FOR); - par_for(complex); + par_for(cmplx); cmdpop(); break; case FOREACH: cmdpush(CS_FOREACH); - par_for(complex); + par_for(cmplx); cmdpop(); break; case SELECT: - *complex = 1; + *cmplx = 1; cmdpush(CS_SELECT); - par_for(complex); + par_for(cmplx); cmdpop(); break; case CASE: cmdpush(CS_CASE); - par_case(complex); + par_case(cmplx); cmdpop(); break; case IF: - par_if(complex); + par_if(cmplx); break; case WHILE: cmdpush(CS_WHILE); - par_while(complex); + par_while(cmplx); cmdpop(); break; case UNTIL: cmdpush(CS_UNTIL); - par_while(complex); + par_while(cmplx); cmdpop(); break; case REPEAT: cmdpush(CS_REPEAT); - par_repeat(complex); + par_repeat(cmplx); cmdpop(); break; case INPAR: - *complex = 1; + *cmplx = 1; cmdpush(CS_SUBSH); - par_subsh(complex); + par_subsh(cmplx, zsh_construct); cmdpop(); break; case INBRACE: cmdpush(CS_CURSH); - par_subsh(complex); + par_subsh(cmplx, zsh_construct); cmdpop(); break; case FUNC: cmdpush(CS_FUNCDEF); - par_funcdef(complex); + par_funcdef(cmplx); cmdpop(); break; case DINBRACK: @@ -864,7 +869,7 @@ static int inpartime = 0; if (!inpartime) { - *complex = 1; + *cmplx = 1; inpartime = 1; par_time(); inpartime = 0; @@ -877,13 +882,13 @@ { int sr; - if (!(sr = par_simple(complex, nr))) { + if (!(sr = par_simple(cmplx, nr))) { if (!nr) return 0; } else { /* Take account of redirections */ if (sr > 1) { - *complex = 1; + *cmplx = 1; r += sr - 1; } } @@ -891,7 +896,7 @@ break; } if (IS_REDIROP(tok)) { - *complex = 1; + *cmplx = 1; while (IS_REDIROP(tok)) (void)par_redir(&r, NULL); } @@ -909,7 +914,7 @@ /**/ static void -par_for(int *complex) +par_for(int *cmplx) { int oecused = ecused, csh = (tok == FOREACH), p, sel = (tok == SELECT); int type; @@ -994,25 +999,28 @@ zshlex(); if (tok == DOLOOP) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != DONE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (tok == INBRACE) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != OUTBRACE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (csh || isset(CSHJUNKIELOOPS)) { - par_save_list(complex); + par_save_list(cmplx); if (tok != ZEND) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (unset(SHORTLOOPS)) { YYERRORV(oecused); } else - par_save_list1(complex); + par_save_list1(cmplx); ecbuf[p] = (sel ? WCB_SELECT(type, ecused - 1 - p) : @@ -1028,7 +1036,7 @@ /**/ static void -par_case(int *complex) +par_case(int *cmplx) { int oecused = ecused, brflag, p, pp, n = 1, type; int ona, onc; @@ -1145,7 +1153,7 @@ pp = ecadd(0); ecstr(str); ecadd(ecnpats++); - par_save_list(complex); + par_save_list(cmplx); n++; if (tok == SEMIAMP) type = WC_CASE_AND; @@ -1175,7 +1183,7 @@ /**/ static void -par_if(int *complex) +par_if(int *cmplx) { int oecused = ecused, p, pp, type, usebrace = 0; enum lextok xtok; @@ -1186,9 +1194,12 @@ for (;;) { xtok = tok; cmdpush(xtok == IF ? CS_IF : CS_ELIF); - zshlex(); - if (xtok == FI) + if (xtok == FI) { + incmdpos = 0; + zshlex(); break; + } + zshlex(); if (xtok == ELSE) break; while (tok == SEPER) @@ -1199,7 +1210,7 @@ } pp = ecadd(0); type = (xtok == IF ? WC_IF_IF : WC_IF_ELIF); - par_save_list(complex); + par_save_list(cmplx); incmdpos = 1; if (tok == ENDINPUT) { cmdpop(); @@ -1214,7 +1225,7 @@ cmdpop(); cmdpush(nc); zshlex(); - par_save_list(complex); + par_save_list(cmplx); ecbuf[pp] = WCB_IF(type, ecused - 1 - pp); incmdpos = 1; cmdpop(); @@ -1223,12 +1234,13 @@ cmdpop(); cmdpush(nc); zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != OUTBRACE) { cmdpop(); YYERRORV(oecused); } ecbuf[pp] = WCB_IF(type, ecused - 1 - pp); + /* command word (else) allowed to follow immediately */ zshlex(); incmdpos = 1; if (tok == SEPER) @@ -1240,7 +1252,7 @@ } else { cmdpop(); cmdpush(nc); - par_save_list1(complex); + par_save_list1(cmplx); ecbuf[pp] = WCB_IF(type, ecused - 1 - pp); incmdpos = 1; break; @@ -1254,18 +1266,19 @@ zshlex(); if (tok == INBRACE && usebrace) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != OUTBRACE) { cmdpop(); YYERRORV(oecused); } } else { - par_save_list(complex); + par_save_list(cmplx); if (tok != FI) { cmdpop(); YYERRORV(oecused); } } + incmdpos = 0; ecbuf[pp] = WCB_IF(WC_IF_ELSE, ecused - 1 - pp); zshlex(); cmdpop(); @@ -1280,31 +1293,33 @@ /**/ static void -par_while(int *complex) +par_while(int *cmplx) { int oecused = ecused, p; int type = (tok == UNTIL ? WC_WHILE_UNTIL : WC_WHILE_WHILE); p = ecadd(0); zshlex(); - par_save_list(complex); + par_save_list(cmplx); incmdpos = 1; while (tok == SEPER) zshlex(); if (tok == DOLOOP) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != DONE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (tok == INBRACE) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != OUTBRACE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (isset(CSHJUNKIELOOPS)) { - par_save_list(complex); + par_save_list(cmplx); if (tok != ZEND) YYERRORV(oecused); zshlex(); @@ -1320,7 +1335,7 @@ /**/ static void -par_repeat(int *complex) +par_repeat(int *cmplx) { int oecused = ecused, p; @@ -1337,25 +1352,27 @@ zshlex(); if (tok == DOLOOP) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != DONE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (tok == INBRACE) { zshlex(); - par_save_list(complex); + par_save_list(cmplx); if (tok != OUTBRACE) YYERRORV(oecused); + incmdpos = 0; zshlex(); } else if (isset(CSHJUNKIELOOPS)) { - par_save_list(complex); + par_save_list(cmplx); if (tok != ZEND) YYERRORV(oecused); zshlex(); } else if (unset(SHORTLOOPS)) { YYERRORV(oecused); } else - par_save_list1(complex); + par_save_list1(cmplx); ecbuf[p] = WCB_REPEAT(ecused - 1 - p); } @@ -1363,11 +1380,15 @@ /* * subsh : INPAR list OUTPAR | * INBRACE list OUTBRACE [ "always" INBRACE list OUTBRACE ] + * + * With zsh_construct non-zero, we're doing a zsh special in which + * the following token is not considered in command position. This + * is used for arguments of anonymous functions. */ /**/ static void -par_subsh(int *complex) +par_subsh(int *cmplx, int zsh_construct) { enum lextok otok = tok; int oecused = ecused, p, pp; @@ -1376,11 +1397,11 @@ /* Extra word only needed for always block */ pp = ecadd(0); zshlex(); - par_list(complex); + par_list(cmplx); ecadd(WCB_END()); if (tok != ((otok == INPAR) ? OUTPAR : OUTBRACE)) YYERRORV(oecused); - incmdpos = 1; + incmdpos = !zsh_construct; zshlex(); /* Optional always block. No intervening SEPERs allowed. */ @@ -1397,7 +1418,7 @@ cmdpush(CS_ALWAYS); zshlex(); - par_save_list(complex); + par_save_list(cmplx); while (tok == SEPER) zshlex(); @@ -1420,7 +1441,7 @@ /**/ static void -par_funcdef(int *complex) +par_funcdef(int *cmplx) { int oecused = ecused, num = 0, onp, p, c = 0; int so, oecssub = ecssub; @@ -1471,7 +1492,6 @@ if (num == 0) { /* Anonymous function, possibly with arguments */ incmdpos = 0; - *complex = 1; } zshlex(); } else if (unset(SHORTLOOPS)) { @@ -1503,6 +1523,8 @@ num++; zshlex(); } + if (num > 0) + *cmplx = 1; ecbuf[parg] = ecused - parg; /*?*/ ecbuf[parg+1] = num; } @@ -1564,15 +1586,15 @@ /**/ static int -par_simple(int *complex, int nr) +par_simple(int *cmplx, int nr) { int oecused = ecused, isnull = 1, r, argc = 0, p, isfunc = 0, sr = 0; - int c = *complex, nrediradd, assignments = 0; + int c = *cmplx, nrediradd, assignments = 0; r = ecused; for (;;) { if (tok == NOCORRECT) { - *complex = c = 1; + *cmplx = c = 1; nocorrect = 1; } else if (tok == ENVSTRING) { char *p, *name, *str; @@ -1600,7 +1622,7 @@ */ if (p[1] == Inpar && (*p == Equals || *p == Inang || *p == OutangProc)) { - *complex = 1; + *cmplx = 1; break; } } @@ -1612,10 +1634,10 @@ int oldcmdpos = incmdpos, n, type2; /* - * We consider array setting complex because it can + * We consider array setting cmplx because it can * contain process substitutions, which need a valid job. */ - *complex = c = 1; + *cmplx = c = 1; p = ecadd(0); incmdpos = 0; if ((type2 = strlen(tokstr) - 1) && tokstr[type2] == '+') { @@ -1647,7 +1669,7 @@ if (tok == STRING) { int redir_var = 0; - *complex = 1; + *cmplx = 1; incmdpos = 0; if (!isset(IGNOREBRACES) && *tokstr == Inbrace) @@ -1666,7 +1688,7 @@ if (IS_REDIROP(tok) && tokfd == -1) { - *complex = c = 1; + *cmplx = c = 1; nrediradd = par_redir(&r, idstring); p += nrediradd; sr += nrediradd; @@ -1687,7 +1709,7 @@ zshlex(); } } else if (IS_REDIROP(tok)) { - *complex = c = 1; + *cmplx = c = 1; nrediradd = par_redir(&r, NULL); p += nrediradd; sr += nrediradd; @@ -1702,7 +1724,7 @@ if (assignments) YYERROR(oecused); - *complex = c; + *cmplx = c; lineno = 0; incmdpos = 1; cmdpush(CS_FUNCDEF); @@ -1736,7 +1758,6 @@ if (argc == 0) { /* Anonymous function, possibly with arguments */ incmdpos = 0; - *complex = 1; } zshlex(); } else { @@ -1746,10 +1767,21 @@ sl = ecadd(0); (void)ecadd(WCB_PIPE(WC_PIPE_END, 0)); - if (!par_cmd(&c)) { + if (!par_cmd(&c, argc == 0)) { cmdpop(); YYERROR(oecused); } + if (argc == 0) { + /* + * Anonymous function, possibly with arguments. + * N.B. for cmplx structures in particular + * ( ... ) we rely on lower level code doing this + * to get the immediately following word (the + * first token after the ")" has already been + * read). + */ + incmdpos = 0; + } set_sublist_code(sl, WC_SUBLIST_END, 0, ecused - 1 - sl, c); set_list_code(ll, (Z_SYNC | Z_END), c); @@ -1776,6 +1808,8 @@ argc++; zshlex(); } + if (argc > 0) + *cmplx = 1; ecbuf[parg] = ecused - parg; /*?*/ ecbuf[parg+1] = argc; } @@ -2068,6 +2102,9 @@ /* one argument: [ foo ] is equivalent to [ -n foo ] */ s1 = tokstr; condlex(); + /* ksh behavior: [ -t ] means [ -t 1 ]; bash disagrees */ + if (unset(POSIXBUILTINS) && !strcmp(s1, "-t")) + return par_cond_double(s1, dupstring("1")); return par_cond_double(dupstring("-n"), s1); } if (testargs[1]) { @@ -2086,6 +2123,10 @@ return par_cond_triple(s1, s2, s3); } } + /* + * We fall through here on any non-numeric infix operator + * or any other time there are at least two arguments. + */ } if (tok == BANG) { /* @@ -2114,18 +2155,20 @@ condlex(); return r; } + s1 = tokstr; + dble = (s1 && *s1 == '-' + && (condlex != testlex + || strspn(s1+1, "abcdefghknoprstuwxzLONGS") == 1) + && !s1[2]); if (tok != STRING) { - if (tok && tok != LEXERR && condlex == testlex) { - s1 = tokstr; + /* Check first argument for [[ STRING ]] re-interpretation */ + if (s1 /* tok != DOUTBRACK && tok != DAMPER && tok != DBAR */ + && tok != LEXERR && (!dble || condlex == testlex)) { condlex(); - return par_cond_double("-n", s1); + return par_cond_double(dupstring("-n"), s1); } else YYERROR(ecused); } - s1 = tokstr; - if (condlex == testlex) - dble = (*s1 == '-' && strspn(s1+1, "abcdefghknoprstuwxzLONGS") == 1 - && !s1[2]); condlex(); if (tok == INANG || tok == OUTANG) { enum lextok xtok = tok; @@ -2140,15 +2183,21 @@ return 1; } if (tok != STRING) { - if (tok != LEXERR && condlex == testlex) { - if (!dble) - return par_cond_double("-n", s1); - else if (!strcmp(s1, "-t")) - return par_cond_double(s1, "1"); + /* + * Check second argument in case semantics e.g. [ = -a = ] + * mean we have to go back and fix up the first one + */ + if (tok != LEXERR) { + if (!dble || condlex == testlex) + return par_cond_double(dupstring("-n"), s1); + else + return par_cond_multi(s1, newlinklist()); } else YYERROR(ecused); } - s2 = tokstr; + s2 = tokstr; + if (condlex != testlex) + dble = (s2 && *s2 == '-' && !s2[2]); incond++; /* parentheses do globbing */ condlex(); incond--; /* parentheses do grouping */ @@ -2527,6 +2576,73 @@ return ret; } +/* + * Copy the consecutive set of redirections in the state at s. + * Return NULL if none, else an Eprog consisting only of the + * redirections from permanently allocated memory. + * + * s is left in the state ready for whatever follows the redirections. + */ + +/**/ +Eprog +eccopyredirs(Estate s) +{ + Wordcode pc = s->pc; + wordcode code = *pc; + int ncode, ncodes = 0, r, type; + + if (wc_code(code) != WC_REDIR) + return NULL; + + init_parse(); + + while (wc_code(code) == WC_REDIR) { + type = WC_REDIR_TYPE(code); + + DPUTS(type == REDIR_HEREDOC || type == REDIR_HEREDOCDASH, + "unexpanded here document"); + + if (WC_REDIR_FROM_HEREDOC(code)) + ncode = 5; + else + ncode = 3; + if (WC_REDIR_VARID(code)) + ncode++; + pc += ncode; + ncodes += ncode; + code = *pc; + } + r = ecused; + ecispace(r, ncodes); + + code = *s->pc; + while (wc_code(code) == WC_REDIR) { + s->pc++; + + ecbuf[r++] = code; + /* fd1 */ + ecbuf[r++] = *s->pc++; + /* name or HERE string */ + /* No DUP needed as we'll copy into Eprog immediately below */ + ecbuf[r++] = ecstrcode(ecgetstr(s, EC_NODUP, NULL)); + if (WC_REDIR_FROM_HEREDOC(code)) + { + /* terminator, raw */ + ecbuf[r++] = ecstrcode(ecgetstr(s, EC_NODUP, NULL)); + /* terminator, munged */ + ecbuf[r++] = ecstrcode(ecgetstr(s, EC_NODUP, NULL)); + } + if (WC_REDIR_VARID(code)) + ecbuf[r++] = ecstrcode(ecgetstr(s, EC_NODUP, NULL)); + + code = *s->pc; + } + + /* bld_eprog() appends a useful WC_END marker */ + return bld_eprog(0); +} + /**/ mod_export struct eprog dummy_eprog; @@ -3519,4 +3635,3 @@ } return ret; } - diff -Nru zsh-5.0.5/Src/pattern.c zsh-5.0.7/Src/pattern.c --- zsh-5.0.5/Src/pattern.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/pattern.c 2014-10-07 18:11:30.000000000 +0000 @@ -2223,6 +2223,8 @@ return ret; } else { + int q = queue_signal_level(); + /* * Test for a `must match' string, unless we're scanning for a match * in which case we don't need to do this each time. @@ -2270,6 +2272,8 @@ patinput = patinstart; + dont_queue_signals(); + if (patmatch((Upat)progstr)) { /* * we were lazy and didn't save the globflags if an exclusion @@ -2406,6 +2410,8 @@ } else ret = 0; + restore_queue_signals(q); + if (tryalloced) zfree(tryalloced, unmetalen + unmetalenp); @@ -2485,7 +2491,7 @@ zrange_t from, to, comp; patint_t nextch; - while (scan) { + while (scan && !errflag) { next = PATNEXT(scan); if (!globdots && P_NOTDOT(scan) && patinput == patinstart && @@ -3006,6 +3012,16 @@ break; case P_STAR: /* Handle specially for speed, although really P_ONEHASH+P_ANY */ + while (P_OP(next) == P_STAR) { + /* + * If there's another * following we can optimise it + * out. Chains of *'s can give pathologically bad + * performance. + */ + scan = next; + next = PATNEXT(scan); + } + /*FALLTHROUGH*/ case P_ONEHASH: case P_TWOHASH: /* diff -Nru zsh-5.0.5/Src/prompt.c zsh-5.0.7/Src/prompt.c --- zsh-5.0.5/Src/prompt.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/prompt.c 2014-10-07 18:11:30.000000000 +0000 @@ -270,6 +270,8 @@ char *ss, *hostnam; int t0, arg, test, sep, j, numjobs; struct tm *tm; + struct timezone dummy_tz; + struct timeval tv; time_t timet; Nameddir nd; @@ -365,9 +367,22 @@ case 'l': *bv->bp = '\0'; countprompt(bv->bufline, &t0, 0, 0); + if (minus) + t0 = zterm_columns - t0; if (t0 >= arg) test = 1; break; + case 'e': + { + Funcstack fsptr = funcstack; + test = arg; + while (fsptr && test > 0) { + test--; + fsptr = fsptr->prev; + } + test = !test; + } + break; case 'L': if (shlvl >= arg) test = 1; @@ -558,6 +573,14 @@ break; case '<': case '>': + /* Test (minus) here so -0 means "at the right margin" */ + if (minus) { + *bv->bp = '\0'; + countprompt(bv->bufline, &t0, 0, 0); + arg = zterm_columns - t0 + arg; + if (arg <= 0) + arg = 1; + } if (!prompttrunc(arg, *bv->fm, doprint, endchar, txtchangep)) return *bv->fm; break; @@ -636,8 +659,8 @@ tmfmt = "%l:%M%p"; break; } - timet = time(NULL); - tm = localtime(&timet); + gettimeofday(&tv, &dummy_tz); + tm = localtime(&tv.tv_sec); /* * Hack because strftime won't say how * much space it actually needs. Try to add it @@ -647,7 +670,7 @@ */ for(j = 0, t0 = strlen(tmfmt)*8; j < 3; j++, t0*=2) { addbufspc(t0); - if (ztrftime(bv->bp, t0, tmfmt, tm) >= 0) + if (ztrftime(bv->bp, t0, tmfmt, tm, tv.tv_usec) >= 0) break; } /* There is enough room for this because addbufspc(t0) @@ -774,6 +797,19 @@ if(bv->Rstring) stradd(bv->Rstring); break; + case 'e': + { + int depth = 0; + Funcstack fsptr = funcstack; + while (fsptr) { + depth++; + fsptr = fsptr->prev; + } + addbufspc(DIGBUFSIZE); + sprintf(bv->bp, "%d", depth); + bv->bp += strlen(bv->bp); + break; + } case 'I': if (funcstack && funcstack->tp != FS_SOURCE && !IN_EVAL_TRAP()) { @@ -1172,7 +1208,7 @@ addbufspc(1); *bv->bp++ = '<'; } - ptr = bv->buf + w; /* addbv->bufspc() may have realloc()'d bv->buf */ + ptr = bv->buf + w; /* addbufspc() may have realloc()'d bv->buf */ /* * Now: * bv->buf is the start of the output prompt buffer @@ -1187,7 +1223,7 @@ bv->trunccount = bv->dontcount; putpromptchar(doprint, endchar, txtchangep); bv->trunccount = 0; - ptr = bv->buf + w; /* putpromptchar() may have realloc()'d */ + ptr = bv->buf + w; /* putpromptchar() may have realloc()'d */ *bv->bp = '\0'; /* * Now: @@ -1280,12 +1316,11 @@ */ for (;;) { *ptr++ = *fulltextptr; - if (*fulltextptr == Outpar || - *fulltextptr == '\0') + if (*fulltextptr == '\0' || + *fulltextptr++ == Outpar) break; - if (*fulltextptr == Nularg) + if (fulltextptr[-1] == Nularg) remw--; - fulltextptr++; } } else { #ifdef MULTIBYTE_SUPPORT @@ -1361,12 +1396,11 @@ if (*skiptext == Inpar) { /* see comment on left truncation above */ for (;;) { - if (*skiptext == Outpar || - *skiptext == '\0') + if (*skiptext == '\0' || + *skiptext++ == Outpar) break; - if (*skiptext == Nularg) + if (skiptext[-1] == Nularg) maxwidth--; - skiptext++; } } else { #ifdef MULTIBYTE_SUPPORT @@ -1473,7 +1507,7 @@ /* Now we have to trick it into matching endchar again */ bv->fm--; } else { - if (*bv->fm != ']') + if (*bv->fm != endchar) bv->fm++; while(*bv->fm && *bv->fm != truncchar) { if (*bv->fm == '\\' && bv->fm[1]) diff -Nru zsh-5.0.5/Src/prototypes.h zsh-5.0.7/Src/prototypes.h --- zsh-5.0.5/Src/prototypes.h 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/prototypes.h 2014-10-07 18:11:30.000000000 +0000 @@ -130,5 +130,5 @@ /***************************************************/ #ifndef HAVE_MEMMOVE -extern void bcopy _((const void *, void *, int)); +extern void bcopy _((const void *, void *, size_t)); #endif diff -Nru zsh-5.0.5/Src/signals.c zsh-5.0.7/Src/signals.c --- zsh-5.0.5/Src/signals.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/signals.c 2014-10-07 18:11:30.000000000 +0000 @@ -369,7 +369,7 @@ #ifdef POSIX_SIGNALS # ifdef BROKEN_POSIX_SIGSUSPEND sigprocmask(SIG_SETMASK, &set, &oset); - pause(); + ret = pause(); sigprocmask(SIG_SETMASK, &oset, NULL); # else /* not BROKEN_POSIX_SIGSUSPEND */ ret = sigsuspend(&set); @@ -594,6 +594,17 @@ wait_for_processes(); break; + case SIGPIPE: + if (!handletrap(SIGPIPE)) { + if (!interact) + _exit(SIGPIPE); + else if (!isatty(SHTTY)) { + stopmsg = 1; + zexit(SIGPIPE, 1); + } + } + break; + case SIGHUP: if (!handletrap(SIGHUP)) { stopmsg = 1; @@ -752,7 +763,7 @@ Shfunc shf, newshf = NULL; if ((shf = (Shfunc)gettrapnode(sig, 1))) { /* Copy the node for saving */ - newshf = (Shfunc) zalloc(sizeof(*newshf)); + newshf = (Shfunc) zshcalloc(sizeof(*newshf)); newshf->node.nam = ztrdup(shf->node.nam); newshf->node.flags = shf->node.flags; newshf->funcdef = dupeprog(shf->funcdef, 0); @@ -897,6 +908,8 @@ noholdintr(); } else if (sig == SIGHUP) install_handler(sig); + else if (sig == SIGPIPE && interact && !forklevel) + install_handler(sig); else if (sig && sig <= SIGCOUNT && #ifdef SIGWINCH sig != SIGWINCH && @@ -1155,6 +1168,7 @@ char *name, num[4]; int obreaks = breaks; int oretflag = retflag; + int olastval = lastval; int isfunc; int traperr, new_trap_state, new_trap_return; @@ -1261,6 +1275,13 @@ } else { if (traperr && !EMULATION(EMULATE_SH)) lastval = 1; + else { + /* + * With no explicit forced return, we keep the + * lastval from before the trap ran. + */ + lastval = olastval; + } if (try_tryflag) errflag = traperr; breaks += obreaks; diff -Nru zsh-5.0.5/Src/subst.c zsh-5.0.7/Src/subst.c --- zsh-5.0.5/Src/subst.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/subst.c 2014-10-07 18:11:30.000000000 +0000 @@ -169,7 +169,7 @@ if (errflag) return NULL; if (!subst) - subst = ""; + rest = subst = ""; sublen = strlen(subst); restlen = strlen(rest); @@ -1522,6 +1522,7 @@ * unset. I don't quite understand why (v == NULL) isn't * good enough, but there are places where we seem to need * to second guess whether a value is a real value or not. + * See in particular the (colf && !vunset) test below. */ int vunset = 0; /* @@ -2638,8 +2639,10 @@ * - (array) contains no elements * - (scalar) contains an empty string */ - if (colf && !vunset) + if (colf && !vunset) { vunset = (isarr) ? !*aval : !*val || (*val == Nularg && !val[1]); + vunset *= -1; /* Record that vunset was originally false */ + } switch (s[-1]) { case '+': @@ -2862,7 +2865,7 @@ getmatcharr(&aval, s, flags, flnum, replstr); } else { if (vunset) { - if (unset(UNSET)) { + if (vunset > 0 && unset(UNSET)) { *idend = '\0'; zerr("%s: parameter not set", idbeg); return NULL; @@ -2878,6 +2881,67 @@ } break; } + } else if (inbrace && (*s == '^' || *s == Hat)) { + char **zip; + int shortest = 1; + ++s; + if (*s == '^' || *s == Hat) { + shortest = 0; + ++s; + } + if (*itype_end(s, IIDENT, 0)) { + untokenize(s); + zerr("not an identifier: %s", s); + return NULL; + } + if (vunset) { + if (vunset > 0 && unset(UNSET)) { + *idend = '\0'; + zerr("%s: parameter not set", idbeg); + return NULL; + } + val = dupstring(""); + } else { + char *sval; + zip = getaparam(s); + if (!zip) { + sval = getsparam(s); + if (sval) + zip = hmkarray(sval); + } + if (!isarr) aval = mkarray(val); + if (zip) { + char **out; + int alen, ziplen, outlen, i = 0; + alen = arrlen(aval); + ziplen = arrlen(zip); + outlen = shortest ^ (alen > ziplen) ? alen : ziplen; + if (!shortest && (alen == 0 || ziplen == 0)) { + if (ziplen) + aval = arrdup(zip); + } else { + out = zhalloc(sizeof(char *) * (2 * outlen + 1)); + while (i < outlen) { + if (copied) + out[i*2] = aval[i % alen]; + else + out[i*2] = dupstring(aval[i % alen]); + out[i*2+1] = dupstring(zip[i % ziplen]); + i++; + } + out[i*2] = NULL; + aval = out; + copied = 1; + isarr = 1; + } + } else { + if (unset(UNSET)) { + zerr("%s: parameter not set", s); + return NULL; + } + val = dupstring(""); + } + } } else if (inbrace && (*s == '|' || *s == Bar || *s == '*' || *s == Star)) { int intersect = (*s == '*' || *s == Star); @@ -2913,7 +2977,7 @@ *ap = NULL; } else { if (vunset) { - if (unset(UNSET)) { + if (vunset > 0 && unset(UNSET)) { *idend = '\0'; zerr("%s: parameter not set", idbeg); deletehashtable(ht); @@ -2935,14 +2999,14 @@ */ if (!vunset) { if (isarr) { - aval = mkarray(NULL); + aval = hmkarray(NULL); } else { val = dupstring(""); } } } if (vunset) { - if (unset(UNSET)) { + if (vunset > 0 && unset(UNSET)) { *idend = '\0'; zerr("%s: parameter not set", idbeg); return NULL; @@ -2959,7 +3023,7 @@ val = dupstring(vunset ? "0" : "1"); isarr = 0; } else if (vunset) { - if (unset(UNSET)) { + if (vunset > 0 && unset(UNSET)) { *idend = '\0'; zerr("%s: parameter not set", idbeg); return NULL; @@ -3754,19 +3818,19 @@ arithsubst(char *a, char **bptr, char *rest) { char *s = *bptr, *t; - char buf[BDIGBUFSIZE], *b = buf; + char buf[BDIGBUFSIZE], *b; mnumber v; singsub(&a); v = matheval(a); if ((v.type & MN_FLOAT) && !outputradix) - b = convfloat(v.u.d, 0, 0, NULL); + b = convfloat_underscore(v.u.d, outputunderscore); else { if (v.type & MN_FLOAT) v.u.l = (zlong) v.u.d; - convbase(buf, v.u.l, outputradix); + b = convbase_underscore(buf, v.u.l, outputradix, outputunderscore); } - t = *bptr = (char *) hcalloc(strlen(*bptr) + strlen(b) + + t = *bptr = (char *) hcalloc(strlen(*bptr) + strlen(b) + strlen(rest) + 1); t--; while ((*++t = *s++)); diff -Nru zsh-5.0.5/Src/utils.c zsh-5.0.7/Src/utils.c --- zsh-5.0.5/Src/utils.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/utils.c 2014-10-07 18:11:30.000000000 +0000 @@ -716,53 +716,58 @@ } /* expands symlinks and .. or . expressions */ -/* if flag = 0, only expand .. and . expressions */ /**/ static int xsymlinks(char *s) { char **pp, **opp; - char xbuf2[PATH_MAX*2], xbuf3[PATH_MAX*2]; + char xbuf2[PATH_MAX*3], xbuf3[PATH_MAX*2]; int t0, ret = 0; + zulong xbuflen = strlen(xbuf); opp = pp = slashsplit(s); - for (; *pp; pp++) { - if (!strcmp(*pp, ".")) { - zsfree(*pp); + for (; xbuflen < sizeof(xbuf) && *pp; pp++) { + if (!strcmp(*pp, ".")) continue; - } if (!strcmp(*pp, "..")) { char *p; - zsfree(*pp); if (!strcmp(xbuf, "/")) continue; if (!*xbuf) continue; - p = xbuf + strlen(xbuf); - while (*--p != '/'); + p = xbuf + xbuflen; + while (*--p != '/') + xbuflen--; *p = '\0'; continue; } sprintf(xbuf2, "%s/%s", xbuf, *pp); t0 = readlink(unmeta(xbuf2), xbuf3, PATH_MAX); if (t0 == -1) { - strcat(xbuf, "/"); - strcat(xbuf, *pp); - zsfree(*pp); + zulong pplen = strlen(*pp) + 1; + if ((xbuflen += pplen) < sizeof(xbuf)) { + strcat(xbuf, "/"); + strcat(xbuf, *pp); + } else { + *xbuf = 0; + ret = -1; + break; + } } else { ret = 1; metafy(xbuf3, t0, META_NOALLOC); if (*xbuf3 == '/') { strcpy(xbuf, ""); - xsymlinks(xbuf3 + 1); + if (xsymlinks(xbuf3 + 1) < 0) + ret = -1; } else - xsymlinks(xbuf3); - zsfree(*pp); + if (xsymlinks(xbuf3) < 0) + ret = -1; } } - free(opp); + freearray(opp); return ret; } @@ -778,7 +783,8 @@ if (*s != '/') return NULL; *xbuf = '\0'; - xsymlinks(s + 1); + if (xsymlinks(s + 1) < 0) + zwarn("path expansion failed, using root directory"); if (!*xbuf) return ztrdup("/"); return ztrdup(xbuf); @@ -790,7 +796,7 @@ { if (*s == '/') { *xbuf = '\0'; - if (xsymlinks(s + 1)) + if (xsymlinks(s + 1) > 0) printf(" -> "), zputs(*xbuf ? xbuf : "/", stdout); } } @@ -2486,7 +2492,7 @@ static int d; static char *guess, *best; -static Patprog spckpat; +static Patprog spckpat, spnamepat; /**/ static void @@ -2557,6 +2563,13 @@ } else spckpat = NULL; + if ((correct_ignore = getsparam("CORRECT_IGNORE_FILE")) != NULL) { + tokenize(correct_ignore = dupstring(correct_ignore)); + remnulargs(correct_ignore); + spnamepat = patcompile(correct_ignore, 0, NULL); + } else + spnamepat = NULL; + if (**s == String && !*t) { guess = *s + 1; if (itype_end(guess, IIDENT, 1) == guess) @@ -2698,10 +2711,13 @@ /**/ mod_export int -ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm) +ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm, long usec) { - int hr12, decr; -#ifndef HAVE_STRFTIME + int hr12; +#ifdef HAVE_STRFTIME + int decr; + char tmp[4]; +#else static char *astr[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; static char *estr[] = @@ -2709,12 +2725,12 @@ "Aug", "Sep", "Oct", "Nov", "Dec"}; #endif char *origbuf = buf; - char tmp[4]; while (*fmt) if (*fmt == '%') { int strip; + int digs = 3; fmt++; if (*fmt == '-') { @@ -2722,6 +2738,17 @@ fmt++; } else strip = 0; + if (idigit(*fmt)) { + /* Digit --- only useful with . */ + char *dstart = fmt; + char *dend = fmt+1; + while (idigit(*dend)) + dend++; + if (*dend == '.') { + fmt = dend; + digs = atoi(dstart); + } + } /* * Assume this format will take up at least two * characters. Not always true, but if that matters @@ -2731,6 +2758,20 @@ if (ztrftimebuf(&bufsize, 2)) return -1; switch (*fmt++) { + case '.': + if (ztrftimebuf(&bufsize, digs)) + return -1; + if (digs > 6) + digs = 6; + if (digs < 6) { + int trunc; + for (trunc = 5 - digs; trunc; trunc--) + usec /= 10; + usec = (usec + 5) / 10; + } + sprintf(buf, "%0*ld", digs, usec); + buf += digs; + break; case 'd': if (tm->tm_mday > 9 || !strip) *buf++ = '0' + tm->tm_mday / 10; @@ -3332,6 +3373,17 @@ } /**/ +mod_export char ** +hmkarray(char *s) +{ + char **t = (char **) zhalloc((s) ? (2 * sizeof s) : (sizeof s)); + + if ((*t = s)) + t[1] = NULL; + return t; +} + +/**/ mod_export void zbeep(void) { @@ -3372,12 +3424,12 @@ return 0; } -static int specialcomma; /* the ztypes table */ /**/ mod_export short int typtab[256]; +static int typtab_flags = 0; /* initialize the ztypes table */ @@ -3388,8 +3440,15 @@ int t0; char *s; - for (t0 = 0; t0 != 256; t0++) - typtab[t0] = 0; + if (!(typtab_flags & ZTF_INIT)) { + typtab_flags = ZTF_INIT; + if (interact && isset(SHINSTDIN)) + typtab_flags |= ZTF_INTERACT; + } + + queue_signals(); + + memset(typtab, 0, sizeof(typtab)); for (t0 = 0; t0 != 32; t0++) typtab[t0] = typtab[t0 + 128] = ICNTRL; typtab[127] = ICNTRL; @@ -3462,20 +3521,43 @@ #endif for (s = SPECCHARS; *s; s++) typtab[STOUC(*s)] |= ISPECIAL; - if (specialcomma) + if (typtab_flags & ZTF_SP_COMMA) typtab[STOUC(',')] |= ISPECIAL; - if (isset(BANGHIST) && bangchar && interact && isset(SHINSTDIN)) + if (isset(BANGHIST) && bangchar && (typtab_flags & ZTF_INTERACT)) { + typtab_flags |= ZTF_BANGCHAR; typtab[bangchar] |= ISPECIAL; + } else + typtab_flags &= ~ZTF_BANGCHAR; + + unqueue_signals(); } /**/ mod_export void makecommaspecial(int yesno) { - if ((specialcomma = yesno) != 0) + if (yesno != 0) { + typtab_flags |= ZTF_SP_COMMA; typtab[STOUC(',')] |= ISPECIAL; - else + } else { + typtab_flags &= ~ZTF_SP_COMMA; typtab[STOUC(',')] &= ~ISPECIAL; + } +} + +/**/ +mod_export void +makebangspecial(int yesno) +{ + /* Name and call signature for congruence with makecommaspecial(), + * but in this case when yesno is nonzero we defer to the state + * saved by inittyptab(). + */ + if (yesno == 0) { + typtab[bangchar] &= ~ISPECIAL; + } else if (typtab_flags & ZTF_BANGCHAR) { + typtab[bangchar] |= ISPECIAL; + } } @@ -3778,6 +3860,8 @@ if (!(dd = opendir(unmeta(dir)))) return mindistd; while ((fn = zreaddir(dd, 0))) { + if (spnamepat && pattry(spnamepat, fn)) + continue; nd = spdist(fn, mindistguess, (int)strlen(mindistguess) / 4 + 1); if (nd <= mindistd) { @@ -4256,6 +4340,12 @@ zreaddir(DIR *dir, int ignoredots) { struct dirent *de; +#if defined(HAVE_ICONV) && defined(__APPLE__) + static iconv_t conv_ds = (iconv_t)0; + static char *conv_name = 0; + char *conv_name_ptr, *orig_name_ptr; + size_t conv_name_len, orig_name_len; +#endif do { de = readdir(dir); @@ -4264,6 +4354,30 @@ } while(ignoredots && de->d_name[0] == '.' && (!de->d_name[1] || (de->d_name[1] == '.' && !de->d_name[2]))); +#if defined(HAVE_ICONV) && defined(__APPLE__) + if (!conv_ds) + conv_ds = iconv_open("UTF-8", "UTF-8-MAC"); + if (conv_ds != (iconv_t)(-1)) { + /* Force initial state in case re-using conv_ds */ + (void) iconv(conv_ds, 0, &orig_name_len, 0, &conv_name_len); + + orig_name_ptr = de->d_name; + orig_name_len = strlen(de->d_name); + conv_name = zrealloc(conv_name, orig_name_len+1); + conv_name_ptr = conv_name; + conv_name_len = orig_name_len; + if (iconv(conv_ds, + &orig_name_ptr, &orig_name_len, + &conv_name_ptr, &conv_name_len) != (size_t)(-1) && + orig_name_len == 0) { + /* Completely converted, metafy and return */ + *conv_name_ptr = '\0'; + return metafy(conv_name, -1, META_STATIC); + } + /* Error, or conversion incomplete, keep the original name */ + } +#endif + return metafy(de->d_name, -1, META_STATIC); } diff -Nru zsh-5.0.5/Src/watch.c zsh-5.0.7/Src/watch.c --- zsh-5.0.5/Src/watch.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/watch.c 2014-10-07 18:11:30.000000000 +0000 @@ -330,7 +330,7 @@ } timet = getlogtime(u, inout); tm = localtime(&timet); - ztrftime(buf, 40, fm2, tm); + ztrftime(buf, 40, fm2, tm, 0L); printf("%s", (*buf == ' ') ? buf + 1 : buf); break; case '%': diff -Nru zsh-5.0.5/Src/Zle/compcore.c zsh-5.0.7/Src/Zle/compcore.c --- zsh-5.0.5/Src/Zle/compcore.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/compcore.c 2014-10-07 18:11:30.000000000 +0000 @@ -702,6 +702,7 @@ } zsfree(compprefix); zsfree(compsuffix); + makebangspecial(0); if (unset(COMPLETEINWORD)) { tmp = (linwhat == IN_MATH ? dupstring(s) : multiquote(s, 0)); untokenize(tmp); @@ -722,6 +723,7 @@ untokenize(ss); compsuffix = ztrdup(ss); } + makebangspecial(1); zsfree(complastprefix); zsfree(complastsuffix); complastprefix = ztrdup(compprefix); @@ -1260,6 +1262,20 @@ ispar = (br >= 2 ? 2 : 1); b[we-wb] = '\0'; return b; + } else if (offs > e - s && *e == ':') { + /* + * Guess whether we are in modifiers. + * If the name is followed by a : and the stuff after + * that is either colons or alphanumerics we probably are. + * This is a very rough guess. + */ + char *offsptr = s + offs; + for (; e < offsptr; e++) { + if (*e != ':' && !ialnum(*e)) + break; + } + ispar = (br >= 2 ? 2 : 1); + return NULL; } } return NULL; diff -Nru zsh-5.0.5/Src/Zle/compctl.c zsh-5.0.7/Src/Zle/compctl.c --- zsh-5.0.5/Src/Zle/compctl.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/compctl.c 2014-10-07 18:11:30.000000000 +0000 @@ -193,7 +193,7 @@ /* only allowed to be called for completion */ if (!incompctlfunc) { - zwarnnam(name, "option valid only in functions called for completion"); + zwarnnam(name, "option valid only in functions called via compctl"); return 1; } @@ -3391,7 +3391,7 @@ mflags |= CMF_FILE; for (n = firstnode(l); n; incnode(n)) addmatch(getdata(n), NULL); - mflags &= !CMF_FILE; + mflags &= ~CMF_FILE; } opts[NULLGLOB] = ng; } else { @@ -3416,7 +3416,7 @@ *npp++ = tp; pp++; } - *npp = '\0'; + *npp = NULL; } } if (!dirs) { diff -Nru zsh-5.0.5/Src/Zle/complist.c zsh-5.0.7/Src/Zle/complist.c --- zsh-5.0.5/Src/Zle/complist.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/complist.c 2014-10-07 18:11:30.000000000 +0000 @@ -383,12 +383,25 @@ } else if (*s == '=') { char *p = ++s, *t, *cols[MAX_POS]; int ncols = 0; + int nesting = 0; Patprog prog; /* This is for a pattern. */ - while (*s && *s != '=') - s++; + while (*s && (nesting || *s != '=')) { + switch (*s++) { + case '\\': + if (*s) + s++; + break; + case '(': + nesting++; + break; + case ')': + nesting--; + break; + } + } if (!*s) return s; *s++ = '\0'; @@ -2500,7 +2513,7 @@ mlbeg--; } } - if ((space = zterm_lines - pl - mhasstat)) + if ((space = zterm_lines - pl - mhasstat) > 0) while (mline >= mlbeg + space) if ((mlbeg += step) + space > mlines) mlbeg = mlines - space; diff -Nru zsh-5.0.5/Src/Zle/compresult.c zsh-5.0.7/Src/Zle/compresult.c --- zsh-5.0.5/Src/Zle/compresult.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/compresult.c 2014-10-07 18:11:30.000000000 +0000 @@ -1131,7 +1131,7 @@ /* If a suffix was added, and is removable, let * * `,' and `}' remove it. */ if (isset(AUTOPARAMKEYS)) - addsuffix(SUFTYP_POSSTR, 0, ZWS(",}"), 2, suffixnoinslen); + addsuffix(SUFTYP_POSSTR, 0, ZWS(",}"), 2, suffixlen); } else if (!menucmp) { /*{{*/ /* Otherwise, add a `,' suffix, and let `}' remove it. */ diff -Nru zsh-5.0.5/Src/Zle/computil.c zsh-5.0.7/Src/Zle/computil.c --- zsh-5.0.5/Src/Zle/computil.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/computil.c 2014-10-07 18:11:30.000000000 +0000 @@ -1500,9 +1500,11 @@ nodopts++; /* If this is for single-letter option we also store a - * pointer for the definition in the array for fast lookup. */ + * pointer for the definition in the array for fast lookup. + * But don't treat '--' as a single option called '-' */ - if (single && name[1] && !name[2]) + + if (single && name[1] && !name[2] && name[1] != '-') ret->single[STOUC(name[1])] = opt; if (again == 1) { @@ -2034,7 +2036,9 @@ state.optbeg = state.argbeg = state.inopt = cur; state.argend = argend; state.singles = (d->single && (!pe || !*pe) && - state.curopt->name[1] && !state.curopt->name[2]); + state.curopt->name[1] && !state.curopt->name[2] && + /* Don't treat '--' as a single option called '-' */ + state.curopt->name[1] != '-'); if (!state.oargs[state.curopt->num]) state.oargs[state.curopt->num] = znewlinklist(); diff -Nru zsh-5.0.5/Src/Zle/.distfiles zsh-5.0.7/Src/Zle/.distfiles --- zsh-5.0.5/Src/Zle/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,14 +1,2 @@ DISTFILES_SRC=' - .cvsignore .distfiles .exrc - comp.h complete.mdd complete.c - compcore.c compmatch.c compresult.c - compctl.mdd compctl.c compctl.h - complist.mdd complist.c - computil.mdd computil.c - deltochar.mdd deltochar.c - zleparameter.mdd zleparameter.c - zle.mdd iwidgets.list zle.h zle_bindings.c zle_hist.c - zle_keymap.c zle_main.c zle_misc.c zle_move.c zle_params.c - zle_refresh.c zle_things.sed zle_thingy.c zle_tricky.c - zle_utils.c zle_vi.c zle_widget.sed zle_word.c ' diff -Nru zsh-5.0.5/Src/Zle/iwidgets.list zsh-5.0.7/Src/Zle/iwidgets.list --- zsh-5.0.5/Src/Zle/iwidgets.list 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/iwidgets.list 2014-10-07 18:11:30.000000000 +0000 @@ -102,6 +102,7 @@ "self-insert-unmeta", selfinsertunmeta, ZLE_MENUCMP | ZLE_KEEPSUFFIX "send-break", sendbreak, 0 "set-mark-command", setmarkcommand, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_LASTCOL +"split-undo", splitundo, ZLE_MENUCMP | ZLE_KEEPSUFFIX | ZLE_NOTCOMMAND "spell-word", spellword, 0 "set-local-history", setlocalhistory, 0 "transpose-chars", transposechars, 0 diff -Nru zsh-5.0.5/Src/Zle/zle_hist.c zsh-5.0.7/Src/Zle/zle_hist.c --- zsh-5.0.5/Src/Zle/zle_hist.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_hist.c 2014-10-07 18:11:30.000000000 +0000 @@ -890,6 +890,10 @@ free(s); free(lineadd); clearlist = 1; + if (stackhist != -1) { + histline = stackhist; + stackhist = -1; + } } return 0; } diff -Nru zsh-5.0.5/Src/Zle/zle_main.c zsh-5.0.7/Src/Zle/zle_main.c --- zsh-5.0.5/Src/Zle/zle_main.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_main.c 2014-10-07 18:11:30.000000000 +0000 @@ -157,10 +157,10 @@ /**/ int stackhist, stackcs; -/* != 0 if we are making undo records */ +/* position in undo stack from when the current vi change started */ /**/ -int undoing; +zlong vistartchange; /* current modifier status */ @@ -525,7 +525,8 @@ #endif #ifndef HAVE_POLL # ifdef HAVE_SELECT - fd_set foofd; + fd_set foofd, errfd; + FD_ZERO(&errfd); # endif #endif @@ -613,11 +614,14 @@ if (!errtry) { for (i = 0; i < nwatch; i++) { int fd = watch_fds[i].fd; + if (FD_ISSET(fd, &errfd)) + continue; FD_SET(fd, &foofd); if (fd > fdmax) fdmax = fd; } } + FD_ZERO(&errfd); if (tmout.tp != ZTM_NONE) { expire_tv.tv_sec = tmout.exp100ths / 100; @@ -732,9 +736,10 @@ Watch_fd lwatch_fd = lwatch_fds + i; if ( # ifdef HAVE_POLL - (fds[i+1].revents & POLLIN) + (fds[i+1].revents & (POLLIN|POLLERR|POLLHUP|POLLNVAL)) # else - FD_ISSET(lwatch_fd->fd, &foofd) + FD_ISSET(lwatch_fd->fd, &foofd) || + FD_ISSET(lwatch_fd->fd, &errfd) # endif ) { /* Handle the fd. */ @@ -765,6 +770,9 @@ if (fds[i+1].revents & POLLNVAL) zaddlinknode(funcargs, ztrdup("nval")); # endif +# else + if (FD_ISSET(lwatch_fd->fd, &errfd)) + zaddlinknode(funcargs, ztrdup("err")); # endif callhookfunc(lwatch_fd->func, funcargs, 0, NULL); freelinklist(funcargs, freestr); @@ -786,6 +794,31 @@ for (i = 0; i < lnwatch; i++) zsfree(lwatch_fds[i].func); zfree(lwatch_fds, lnwatch*sizeof(struct watch_fd)); + +# ifdef HAVE_POLL + /* Function may have added or removed handlers */ + nfds = 1 + nwatch; + if (nfds > 1) { + fds = zrealloc(fds, sizeof(struct pollfd) * nfds); + for (i = 0; i < nwatch; i++) { + /* + * This is imperfect because it assumes fds[] and + * watch_fds[] remain in sync, which may be false + * if handlers are shuffled. However, it should + * be harmless (e.g., produce one extra pass of + * the loop) in the event they fall out of sync. + */ + if (fds[i+1].fd == watch_fds[i].fd && + (fds[i+1].revents & (POLLERR|POLLHUP|POLLNVAL))) { + fds[i+1].events = 0; /* Don't poll this */ + } else { + fds[i+1].fd = watch_fds[i].fd; + fds[i+1].events = POLLIN; + } + fds[i+1].revents = 0; + } + } +# endif } } # ifdef HAVE_POLL @@ -1080,8 +1113,7 @@ if (invicmdmode() && zlecs > findbol() && (zlecs == zlell || zleline[zlecs] == ZWC('\n'))) DECCS(); - if (undoing) - handleundo(); + handleundo(); } else { errflag = 1; break; @@ -1190,7 +1222,7 @@ zlereadflags = flags; zlecontext = context; histline = curhist; - undoing = 1; + vistartchange = -1; zleline = (ZLE_STRING_T)zalloc(((linesz = 256) + 2) * ZLE_CHAR_SIZE); *zleline = ZWC('\0'); virangeflag = lastcmd = done = zlecs = zlell = mark = 0; @@ -1198,14 +1230,7 @@ viinsbegin = 0; statusline = NULL; selectkeymap("main", 1); - /* - * If main is linked to the viins keymap, we need to register - * explicitly that we're now in vi insert mode as there's - * no user operation to indicate this. - */ - if (openkeymap("main") == openkeymap("viins")) - viinsert(NULL); - selectlocalmap(NULL); + initundo(); fixsuffix(); if ((s = getlinknode(bufstack))) { setline(s, ZSL_TOEND); @@ -1222,7 +1247,14 @@ stackhist = -1; } } - initundo(); + /* + * If main is linked to the viins keymap, we need to register + * explicitly that we're now in vi insert mode as there's + * no user operation to indicate this. + */ + if (openkeymap("main") == openkeymap("viins")) + viinsert_init(); + selectlocalmap(NULL); if (isset(PROMPTCR)) putc('\r', shout); if (tmout) diff -Nru zsh-5.0.5/Src/Zle/zle_misc.c zsh-5.0.7/Src/Zle/zle_misc.c --- zsh-5.0.5/Src/Zle/zle_misc.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_misc.c 2014-10-07 18:11:30.000000000 +0000 @@ -1249,10 +1249,14 @@ /* Length associated with the suffix function */ static int suffixfunclen; -/* Length associated with uninsertable characters */ +/* Whether to remove suffix on uninsertable characters */ +/**/ +int suffixnoinsrem; + +/* Length of the currently active, auto-removable suffix. */ /**/ mod_export int -suffixnoinslen; +suffixlen; /**/ mod_export void @@ -1309,7 +1313,8 @@ if ((suffixchars = getsparam("ZLE_SPACE_SUFFIX_CHARS")) && *suffixchars) addsuffixstring(SUFTYP_POSSTR, SUFFLAGS_SPACE, suffixchars, n); - suffixnoinslen = n; + suffixlen = n; + suffixnoinsrem = 1; } /* Set up suffix for parameter names: the last n characters are a suffix * @@ -1358,15 +1363,10 @@ s = metafy(s, i, META_USEHEAP); ws = stringaszleline(s, 0, &i, NULL, NULL); - if (z) - suffixnoinslen = inv ? 0 : n; - else if (inv) { - /* - * negative match, \- wasn't present, so it *should* - * have this suffix length - */ - suffixnoinslen = n; - } + /* Remove suffix on uninsertable characters if \- was given * + * and the character class wasn't negated -- or vice versa. */ + suffixnoinsrem = z ^ inv; + suffixlen = n; lasts = wptr = ws; while (i) { @@ -1444,7 +1444,7 @@ struct suffixset *ss; if (c == NO_INSERT_CHAR) { - sl = suffixnoinslen; + sl = suffixnoinsrem ? suffixlen : 0; } else { ZLE_CHAR_T ch = c; /* @@ -1538,5 +1538,5 @@ suffixlist = next; } - suffixfunclen = suffixnoinslen = 0; + suffixfunclen = suffixnoinsrem = suffixlen = 0; } diff -Nru zsh-5.0.5/Src/Zle/zle_params.c zsh-5.0.7/Src/Zle/zle_params.c --- zsh-5.0.5/Src/Zle/zle_params.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_params.c 2014-10-07 18:11:30.000000000 +0000 @@ -363,7 +363,7 @@ static char * get_widget(UNUSED(Param pm)) { - return bindk->nam; + return bindk ? bindk->nam : ""; } /**/ diff -Nru zsh-5.0.5/Src/Zle/zle_refresh.c zsh-5.0.7/Src/Zle/zle_refresh.c --- zsh-5.0.5/Src/Zle/zle_refresh.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_refresh.c 2014-10-07 18:11:30.000000000 +0000 @@ -258,7 +258,6 @@ static const REFRESH_ELEMENT zr_dt = { ZWC('.'), 0 }; static const REFRESH_ELEMENT zr_nl = { ZWC('\n'), 0 }; static const REFRESH_ELEMENT zr_sp = { ZWC(' '), 0 }; -static const REFRESH_ELEMENT zr_ht = { ZWC('\t'), 0 }; static const REFRESH_ELEMENT zr_zr = { ZWC('\0'), 0 }; /* @@ -429,7 +428,7 @@ digbuf1, digbuf2); (void)output_highlight(rhp->atr, *arrp + strlen(*arrp)); } - *arrp = '\0'; + *arrp = NULL; return retarr; } @@ -444,6 +443,7 @@ set_region_highlight(UNUSED(Param pm), char **aval) { int len; + char **av = aval; struct region_highlight *rhp; len = aval ? arrlen(aval) : 0; @@ -490,6 +490,8 @@ match_highlight(strp, &rhp->atr); } + + freearray(av); } @@ -977,7 +979,7 @@ int tmpalloced; /* flag to free tmpline when finished */ int remetafy; /* flag that zle line is metafied */ int txtchange; /* attributes set after prompts */ - int rprompt_off; /* Offset of rprompt from right of screen */ + int rprompt_off = 1; /* Offset of rprompt from right of screen */ struct rparams rpms; #ifdef MULTIBYTE_SUPPORT int width; /* width of wide character */ @@ -1046,8 +1048,8 @@ region_highlights[1].start = region_highlights[1].end = -1; } /* check for an active completion suffix */ - if (suffixnoinslen) { - region_highlights[2].start = zlecs - suffixnoinslen; + if (suffixlen) { + region_highlights[2].start = zlecs - suffixlen; region_highlights[2].end = zlecs; } else { region_highlights[2].start = region_highlights[2].end = -1; diff -Nru zsh-5.0.5/Src/Zle/zle_tricky.c zsh-5.0.7/Src/Zle/zle_tricky.c --- zsh-5.0.5/Src/Zle/zle_tricky.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_tricky.c 2014-10-07 18:11:30.000000000 +0000 @@ -611,8 +611,6 @@ active = 1; comprecursive = 0; makecommaspecial(0); - if (undoing) - setlastline(); /* From the C-code's point of view, we can only use compctl as a default * type of completion. Load it if it hasn't been loaded already and @@ -1164,7 +1162,7 @@ * being separated by tokens | & &! |& || &&). The loop stops when * * the end of the command containing the cursor is reached. What * * makes this messy is checking for things like redirections, loops * - * and whatnot. */ + * and whatnot. */ do { qsub = noword = 0; @@ -2797,6 +2795,7 @@ if (!err) { zlemetacs = excs; if (strcmp(zlemetaline, ol)) { + zle_free_positions(); unmetafy_line(); /* For vi mode -- reset the beginning-of-insertion pointer * * to the beginning of the line. This seems a little silly, * diff -Nru zsh-5.0.5/Src/Zle/zle_utils.c zsh-5.0.7/Src/Zle/zle_utils.c --- zsh-5.0.5/Src/Zle/zle_utils.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_utils.c 2014-10-07 18:11:30.000000000 +0000 @@ -710,6 +710,27 @@ } /* + * Discard positions previously saved, the line has been updated. + */ + +/**/ +mod_export void +zle_free_positions(void) +{ + struct zle_position *oldpos = zle_positions; + struct zle_region *oldrhp; + + zle_positions = oldpos->next; + oldrhp = oldpos->regions; + while (oldrhp) { + struct zle_region *nextrhp = oldrhp->next; + zfree(oldrhp, sizeof(*oldrhp)); + oldrhp = nextrhp; + } + zfree(oldpos, sizeof(*oldpos)); +} + +/* * Basic utility functions for adding to line or removing from line. * At this level the counts supplied are raw character counts, so * the calling code must be aware of combining characters where @@ -1354,7 +1375,10 @@ /* head of the undo list, and the current position */ -static struct change *changes, *curchange; +/**/ +struct change *curchange; + +static struct change *changes; /* list of pending changes, not yet in the undo system */ @@ -1629,6 +1653,32 @@ return undo(args); } +/**/ +int +splitundo(char **args) +{ + if (vistartchange >= 0) { + mergeundo(); + vistartchange = (curchange && curchange->prev) ? + curchange->prev->changeno : 0; + } + handleundo(); + return 0; +} + +/**/ +void +mergeundo(void) +{ + struct change *current; + for (current = curchange->prev; + current && current->prev && current->changeno > vistartchange+1; + current = current->prev) { + current->flags |= CH_PREV; + current->prev->flags |= CH_NEXT; + } +} + /* * Call a ZLE hook: a user-defined widget called at a specific point * within the line editor. diff -Nru zsh-5.0.5/Src/Zle/zle_vi.c zsh-5.0.7/Src/Zle/zle_vi.c --- zsh-5.0.5/Src/Zle/zle_vi.c 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/Zle/zle_vi.c 2014-10-07 18:11:30.000000000 +0000 @@ -67,15 +67,23 @@ static struct modifier lastmod; static int inrepeat, vichgrepeat; +/** + * im: >= 0: is an insertmode + * -1: skip setting insert mode + * -2: entering viins at start of editing from clean --- don't use + * inrepeat or lastchar, synthesise an i to enter insert mode. + */ + /**/ static void startvichange(int im) { if (im != -1) { - insmode = im; vichgflag = 1; + if (im > -1) + insmode = im; } - if (inrepeat) { + if (inrepeat && im != -2) { zmod = lastmod; inrepeat = vichgflag = 0; vichgrepeat = 1; @@ -84,7 +92,12 @@ if (vichgbuf) free(vichgbuf); vichgbuf = (char *)zalloc(vichgbufsz = 16); - vichgbuf[0] = lastchar; + if (im == -2) { + vichgbuf[0] = + zlell ? (insmode ? (zlecs < zlell ? 'i' : 'a') : 'R') : 'o'; + } else { + vichgbuf[0] = lastchar; + } vichgbufptr = 1; vichgrepeat = 0; } @@ -96,7 +109,7 @@ { startvichange(im); selectkeymap("main", 1); - undoing = 0; + vistartchange = (curchange && curchange->prev) ? curchange->prev->changeno : 0; viinsbegin = zlecs; } @@ -303,6 +316,18 @@ return 0; } +/* + * Go to vi insert mode when we first start the line editor. + * Iniialises some other stuff. + */ + +/**/ +void +viinsert_init(void) +{ + startvitext(-2); +} + /**/ int viinsertbol(UNUSED(char **args)) @@ -376,7 +401,7 @@ forekill(c2 - zlecs, CUT_RAW); selectkeymap("main", 1); viinsbegin = zlecs; - undoing = 0; + vistartchange = (curchange && curchange->prev) ? curchange->prev->changeno : 0; } return ret; } @@ -561,7 +586,7 @@ { if (invicmdmode() || selectkeymap("vicmd", 0)) return 1; - undoing = 1; + mergeundo(); vichgflag = 0; if (zlecs != findbol()) DECCS(); diff -Nru zsh-5.0.5/Src/zsh.h zsh-5.0.7/Src/zsh.h --- zsh-5.0.5/Src/zsh.h 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/zsh.h 2014-10-07 18:11:30.000000000 +0000 @@ -33,9 +33,6 @@ /* * Our longest integer type: will be a 64 bit either if long already is, * or if we found some alternative such as long long. - * Currently we only define this to be longer than a long if - * --enable-largefile * was given. That enables internal use of 64-bit - * types even if no actual large file support is present. */ #ifdef ZSH_64_BIT_TYPE typedef ZSH_64_BIT_TYPE zlong; @@ -50,6 +47,32 @@ #endif /* + * Work out how to define large integer constants that will fit + * in a zlong. + */ +#if defined(ZSH_64_BIT_TYPE) || defined(LONG_IS_64_BIT) +/* We have some 64-bit type */ +#ifdef LONG_IS_64_BIT +/* It's long */ +#define ZLONG_CONST(x) x ## l +#else +/* It's long long */ +#ifdef ZLONG_IS_LONG_LONG +#define ZLONG_CONST(x) x ## ll +#else +/* + * There's some 64-bit type, but we don't know what it is. + * We'll just cast it and hope the compiler does the right thing. + */ +#define ZLONG_CONST(x) ((zlong)x) +#endif +#endif +#else +/* We're stuck with long */ +#define ZLONG_CONST(x) (x ## l) +#endif + +/* * Double float support requires 64-bit alignment, so if longs and * pointers are less we need to pad out. */ @@ -1116,6 +1139,7 @@ char *filename; /* Name of file located in */ zlong lineno; /* line number in above file */ Eprog funcdef; /* function definition */ + Eprog redir; /* redirections to apply */ Emulation_options sticky; /* sticky emulation definitions, if any */ }; @@ -1797,7 +1821,8 @@ */ enum { ASSPM_AUGMENT = 1 << 0, - ASSPM_WARN_CREATE = 1 << 1 + ASSPM_WARN_CREATE = 1 << 1, + ASSPM_ENV_IMPORT = 1 << 2 }; /* node for named directory hash table (nameddirtab) */ @@ -2092,6 +2117,7 @@ IGNORECLOSEBRACES, IGNOREEOF, INCAPPENDHISTORY, + INCAPPENDHISTORYTIME, INTERACTIVE, INTERACTIVECOMMENTS, KSHARRAYS, @@ -2105,6 +2131,7 @@ LISTPACKED, LISTROWSFIRST, LISTTYPES, + LOCALLOOPS, LOCALOPTIONS, LOCALPATTERNS, LOCALTRAPS, @@ -2128,6 +2155,7 @@ PATHSCRIPT, PIPEFAIL, POSIXALIASES, + POSIXARGZERO, POSIXBUILTINS, POSIXCD, POSIXIDENTIFIERS, diff -Nru zsh-5.0.5/Src/zsh.mdd zsh-5.0.7/Src/zsh.mdd --- zsh-5.0.5/Src/zsh.mdd 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/zsh.mdd 2014-10-07 18:11:30.000000000 +0000 @@ -44,7 +44,7 @@ cp -f $(sdir)/$@.release $@; \ else \ echo '#define ZSH_PATCHLEVEL "'`cd $(sdir) && git describe --tags --long`'"' > $@.tmp; \ - cmp $@ $@.tmp 2>/dev/null && rm -f $@.tmp || mv $@.tmp $@; \ + cmp $@ $@.tmp >/dev/null 2>&1 && rm -f $@.tmp || mv $@.tmp $@; \ fi FORCE: @@ -73,6 +73,9 @@ @if test x$(sitefndir) != xno; then \ echo '#define SITEFPATH_DIR "'$(sitefndir)'"' >> zshpaths.h.tmp; \ fi + @if test x$(fixed_sitefndir) != x; then \ + echo '#define FIXED_FPATH_DIR "'$(fixed_sitefndir)'"' >> zshpaths.h.tmp; \ + fi @if test x$(fndir) != xno; then \ echo '#define FPATH_DIR "'$(fndir)'"' >> zshpaths.h.tmp; \ if test x$(FUNCTIONS_SUBDIRS) != x && \ diff -Nru zsh-5.0.5/Src/zsh_system.h zsh-5.0.7/Src/zsh_system.h --- zsh-5.0.5/Src/zsh_system.h 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/zsh_system.h 2014-10-07 18:11:30.000000000 +0000 @@ -286,11 +286,15 @@ # include #endif +#ifdef USE_STACK_ALLOCATION #ifdef HAVE_VARIABLE_LENGTH_ARRAYS # define VARARR(X,Y,Z) X (Y)[Z] #else # define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) #endif +#else +# define VARARR(X,Y,Z) X *(Y) = (X *) zhalloc(sizeof(X) * (Z)) +#endif /* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ /* but this is too much trouble */ @@ -708,7 +712,10 @@ #endif #ifndef HAVE_MEMMOVE -# define memmove(dest, src, len) bcopy((src), (dest), (len)) +# ifndef memmove +static char *zmmv; +# define memmove(dest, src, len) (bcopy((src), zmmv = (dest), (len)), zmmv) +# endif #endif #ifndef offsetof @@ -874,3 +881,8 @@ # endif # endif #endif + +#ifdef ZSH_VALGRIND +# include "valgrind/valgrind.h" +# include "valgrind/memcheck.h" +#endif diff -Nru zsh-5.0.5/Src/ztype.h zsh-5.0.7/Src/ztype.h --- zsh-5.0.5/Src/ztype.h 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Src/ztype.h 2014-10-07 18:11:30.000000000 +0000 @@ -59,6 +59,15 @@ #define iwsep(X) zistype(X,IWSEP) #define inull(X) zistype(X,INULL) +/* + * Bit flags for typtab_flags --- preserved after + * shell initialisation. + */ +#define ZTF_INIT (0x0001) /* One-off initialisation done */ +#define ZTF_INTERACT (0x0002) /* Shell interative and reading from stdin */ +#define ZTF_SP_COMMA (0x0004) /* Treat comma as a special characters */ +#define ZTF_BANGCHAR (0x0008) /* Treat bangchar as a special character */ + #ifdef MULTIBYTE_SUPPORT #define WC_ZISTYPE(X,Y) wcsitype((X),(Y)) #define WC_ISPRINT(X) iswprint(X) diff -Nru zsh-5.0.5/StartupFiles/.distfiles zsh-5.0.7/StartupFiles/.distfiles --- zsh-5.0.5/StartupFiles/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/StartupFiles/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,2 @@ DISTFILES_SRC=' - .distfiles - zlogin zshenv zshrc ' diff -Nru zsh-5.0.5/Test/A04redirect.ztst zsh-5.0.7/Test/A04redirect.ztst --- zsh-5.0.5/Test/A04redirect.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/A04redirect.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -54,7 +54,7 @@ 0:Here-documents stripping tabs >barbar - cat <<-$'$HERE '`$(THERE) `'$((AND)) '"\EVERYWHERE" + cat <<-$'$HERE '`$(THERE) `'$((AND)) '"\EVERYWHERE" # # tabs again. sorry about the max miller. Here's a funny thing. Here is a funny thing. I went home last night. There's a funny thing. @@ -455,3 +455,79 @@ [input1 + () { + local var + read var + print I just read $var + } output1 + print Nothing output yet + cat output1 +0:anonymous function redirections are applied immediately +>Nothing output yet +>I just read any old rubbish + + redirfn() { + local var + read var + print I want to tell you about $var + print Also, this might be an error >&2 + } output2 2>&1 + print something I heard on the radio >input2 + redirfn + print No output until after this + cat output2 +0:redirections with normal function definition +>No output until after this +>I want to tell you about something I heard on the radio +>Also, this might be an error + + which redirfn +0:text output of function with redirections +>redirfn () { +> local var +> read var +> print I want to tell you about $var +> print Also, this might be an error >&2 +>} < input2 > output2 2>&1 + + 1func 2func 3func() { print Ich heisse $0 } >output3 + for i in 1 2 3; do + f=${i}func + print Running $f + $f + cat output3 + unfunction $f + done +0:multiply named functions with redirection +>Running 1func +>Ich heisse 1func +>Running 2func +>Ich heisse 2func +>Running 3func +>Ich heisse 3func + + redirfn2() { print The latest output; } >&3 + redirfn2 3>output4 + print No output yet + cat output4 +0:Redirections in both function definition and command line +>No output yet +>The latest output + +# This relies on the fact that the test harness always loads +# the zsh/parameter module. + print $functions[redirfn] +0:Output from $functions[] for definition with redirection +>{ +> local var +> read var +> print I want to tell you about $var +> print Also, this might be an error >&2 +>} < input2 > output2 2>&1 + + noredirfn() { print This rather boring function has no redirection.; } + print $functions[noredirfn] +0:Output from $functions[] for definition with no redirection +> print This rather boring function has no redirection. diff -Nru zsh-5.0.5/Test/A05execution.ztst zsh-5.0.7/Test/A05execution.ztst --- zsh-5.0.5/Test/A05execution.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/A05execution.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -204,15 +204,43 @@ F:This similar test was triggering a reproducible failure with pipestatus. { unsetopt MONITOR } 2>/dev/null - coproc { read -Et 5 || kill -INT $$ } + coproc { read -et 5 || { print -u $ZTST_fd KILLED; kill -HUP -$$ } } print -u $ZTST_fd 'This test takes 5 seconds to fail...' - { printf "%d\n" {1..20000} } | ( read -E ) - hang(){ printf "%d\n" {2..20000} | cat }; hang | ( read -E ) + { printf "%d\n" {1..20000} } | ( read -e ) + hang(){ printf "%d\n" {2..20000} | cat }; hang | ( read -e ) print -p done - read -Ep + read -et 6 -p 0:Bug regression: piping a shell construct to an external process may hang >1 >2 >done F:This test checks for a file descriptor leak that could cause the left F:side of a pipe to block on write after the right side has exited + + { setopt MONITOR } 2>/dev/null + if [[ -o MONITOR ]] + then + ( while :; do print "This is a line"; done ) | () : & + sleep 1 + jobs -l + else + print -u $ZTST_fd "Skipping pipe leak test, requires MONITOR option" + print "[0] 0 0" + fi +0:Bug regression: piping to anonymous function; piping to backround function +*>\[<->\] <-> <-> +F:This test checks for two different bugs, a parser segfault piping to an +F:anonymous function, and a descriptor leak when backgrounding a pipeline + + print "autoload_redir() { print Autoloaded ksh style; } >autoload.log" >autoload_redir + autoload -Uk autoload_redir + autoload_redir + print No output yet + cat autoload.log + functions autoload_redir +0: +>No output yet +>Autoloaded ksh style +>autoload_redir () { +> print Autoloaded ksh style +>} > autoload.log diff -Nru zsh-5.0.5/Test/A07control.ztst zsh-5.0.7/Test/A07control.ztst --- zsh-5.0.5/Test/A07control.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/A07control.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -23,12 +23,12 @@ >start 255 >255 - fn() { + $ZTST_testdir/../Src/zsh -fc 'fn() { continue } - fn + fn' 1:continue outside loop -?fn:continue:1 not in while, until, select, or repeat loop +?fn:continue:1: not in while, until, select, or repeat loop for outer in 0 1 2 3; do print outer $outer diff -Nru zsh-5.0.5/Test/B08shift.ztst zsh-5.0.7/Test/B08shift.ztst --- zsh-5.0.5/Test/B08shift.ztst 1970-01-01 00:00:00.000000000 +0000 +++ zsh-5.0.7/Test/B08shift.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -0,0 +1,33 @@ +# Test the shift builtin. + +%test + + set -- one two three four five six seven eight nine ten + shift + print $* + shift 2 + print $* + shift -p 3 + print $* + shift -p + print $* +0:shifting positional parameters +>two three four five six seven eight nine ten +>four five six seven eight nine ten +>four five six seven +>four five six + + array=(yan tan tether mether pip azer sezar akker conter dick) + shift 2 array + print $array + shift array + print $array + shift -p 3 array + print $array + shift -p array + print $array +0:shifting array +>tether mether pip azer sezar akker conter dick +>mether pip azer sezar akker conter dick +>mether pip azer sezar +>mether pip azer diff -Nru zsh-5.0.5/Test/C01arith.ztst zsh-5.0.7/Test/C01arith.ztst --- zsh-5.0.5/Test/C01arith.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/C01arith.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -266,3 +266,23 @@ >48.5 >77.5 >63.5 + + underscore_integer() { + setopt cbases localoptions + print $(( [#_] 1000000 )) + print $(( [#16_] 65536 )) + print $(( [#16_4] 65536 * 32768 )) + } + underscore_integer +0:Grouping output with underscores: integers +>1_000_000 +>0x10_000 +>0x8000_0000 + + print $(( [#_] (5. ** 10) / 16. )) +0:Grouping output with underscores: floating point +>610_351.562_5 + + env SHLVL=1+RANDOM $ZTST_testdir/../Src/zsh -f -c 'print $SHLVL' +0:Imported integer functions are not evaluated +>2 diff -Nru zsh-5.0.5/Test/C02cond.ztst zsh-5.0.7/Test/C02cond.ztst --- zsh-5.0.5/Test/C02cond.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/C02cond.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -349,6 +349,14 @@ >0 >1 + foo='' + [[ $foo ]] || print foo is empty + foo=full + [[ $foo ]] && print foo is full +0:bash compatibility with single [[ ... ]] argument +>foo is empty +>foo is full + %clean # This works around a bug in rm -f in some versions of Cygwin chmod 644 unmodish diff -Nru zsh-5.0.5/Test/C04funcdef.ztst zsh-5.0.7/Test/C04funcdef.ztst --- zsh-5.0.5/Test/C04funcdef.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/C04funcdef.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -208,6 +208,11 @@ >Da de da >Do be do + () (cat $1 $2) <(print process expanded) =(print expanded to file) +0:Process substitution with anonymous functions +>process expanded +>expanded to file + () { print This has arguments $*; } of all sorts; print After the function function { print More stuff $*; } and why not; print Yet more 0:Anonymous function with arguments @@ -267,6 +272,16 @@ >ignorebraces is off >ignorebraces is still on here +# lsfoo should not be expanded as an anonymous function argument + alias lsfoo='This is not ls.' + () (echo anon func; echo "$@") lsfoo +0:Anonmous function with arguments in a form nobody sane would ever use but unfortunately we have to support anyway +>anon func +>lsfoo + + print foo | () cat +0:Simple anonymous function should not simplify enclosing pipeline +>foo %clean diff -Nru zsh-5.0.5/Test/comptest zsh-5.0.7/Test/comptest --- zsh-5.0.5/Test/comptest 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/comptest 2014-10-07 18:11:30.000000000 +0000 @@ -69,12 +69,15 @@ zle -R } zle-finish () { - print -lr "" "BUFFER: $BUFFER" "CURSOR: $CURSOR" - (( region_active )) && print -lr "MARK: $MARK" - zle -K main - zle kill-whole-line + local buffer="$BUFFER" cursor="$CURSOR" mark="$MARK" + (( region_active)) || unset mark + BUFFER="" + zle -I zle clear-screen - zle -R + zle redisplay + print -lr "" "BUFFER: $buffer" "CURSOR: $cursor" + (( $+mark )) && print -lr "MARK: $mark" + zle accept-line } zle -N expand-or-complete-with-report zle -N list-choices-with-report @@ -83,20 +86,41 @@ bindkey "^I" expand-or-complete-with-report bindkey "^D" list-choices-with-report bindkey "^Z" comp-finish -bindkey "^M" zle-finish -bindkey -a "^M" zle-finish +bindkey "^X" zle-finish +bindkey -a "^X" zle-finish ' } +zpty_flush() { + local junk + if zpty -r -t zsh junk \*; then + (( ZTST_verbose > 2 )) && print -n -u $ZTST_fd "$*: ${(V)junk}" + while zpty -r -t zsh junk \* ; do + (( ZTST_verbose > 2 )) && print -n -u $ZTST_fd "${(V)junk}" + done + (( ZTST_verbose > 2 )) && print -u $ZTST_fd '' + fi +} + +zpty_run() { + zpty -w zsh "$*" + zpty -r -m zsh log "**" || { + print "prompt hasn't appeared." + return 1 + } +} + comptesteval () { local tmp=/tmp/comptest.$$ print -lr - "$@" > $tmp + # zpty_flush Before comptesteval zpty -w zsh ". $tmp" zpty -r -m zsh log_eval "**" || { print "prompt hasn't appeared." return 1 } + zpty_flush After comptesteval rm $tmp } @@ -136,10 +160,12 @@ zletest () { input="$*" - zpty -n -w zsh "$input"$'\C-M' + # zpty_flush Before zletest + zpty -n -w zsh "$input"$'\C-X' zpty -r -m zsh log "***" || { print "failed to invoke finish widget." return 1 } + # zpty_flush After zletest print -lr "${(@)${(ps:\r\n:)log##*}[1,-2]}" } diff -Nru zsh-5.0.5/Test/D02glob.ztst zsh-5.0.7/Test/D02glob.ztst --- zsh-5.0.5/Test/D02glob.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/D02glob.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -431,6 +431,7 @@ mkdir glob.tmp/dir5 touch glob.tmp/dir5/N123 print glob.tmp/dir5/N<->(N) + rm -rf glob.tmp/dir5 0:Numeric glob is not usurped by process substitution. >glob.tmp/dir5/N123 @@ -526,3 +527,48 @@ >+bus+bus matches +(+bus|-car) >@sinhats matches @(@sinhats|wrensinfens) >!kerror matches !(!somethingelse) + + ( + setopt extendedglob + cd glob.tmp + [[ -n a*(#qN) ]] && print File beginning with a + [[ -z z*(#qN) ]] && print No file beginning with z + setopt nonomatch + [[ -n z*(#q) ]] && print Normal string if nullglob not set + ) +0:Force glob expansion in conditions using (#q) +>File beginning with a +>No file beginning with z +>Normal string if nullglob not set + + (){ print $#@ } glob.tmp/dir*(Y1) + (){ print $#@ } glob.tmp/file*(NY1) + (){ [[ "$*" == */dir?\ */dir? ]] && print Returns matching filenames } glob.tmp/dir*(Y2) + (){ print "Limit is upper bound:" ${(o)@:t} } glob.tmp/dir*(Y5) + (){ print "Negated:" $@:t } glob.tmp/dir*(Y1^Y) + (){ print "Sorting:" $@:t } glob.tmp/dir*(Y4On) + (){ [[ $#@ -eq 1 ]] && print Globs before last path component } glob.tmp/dir?/subdir(NY1) + (){ [[ $#@ -eq 0 ]] && print Respects qualifiers } glob.tmp/dir*(NY1.) + (print -- *(Y)) 2>/dev/null || print "Argument required" +0:short-circuit modifier +>1 +>0 +>Returns matching filenames +>Limit is upper bound: dir1 dir2 dir3 dir4 +>Negated: dir1 dir2 dir3 dir4 +>Sorting: dir4 dir3 dir2 dir1 +>Globs before last path component +>Respects qualifiers +>Argument required + + [[ "ce fichier n'existe pas" = (#b)ce\ (f[^ ]#)\ *s(#q./) ]] + print $match[1] +0:(#q) is ignored completely in conditional pattern matching +>fichier + +# The following should not cause excessive slowdown. + print glob.tmp/*.* + print glob.tmp/**************************.************************* +0:Optimisation to squeeze multiple *'s used as ordinary glob wildcards. +>glob.tmp/ra=1.0_et=3.5 +>glob.tmp/ra=1.0_et=3.5 diff -Nru zsh-5.0.5/Test/D04parameter.ztst zsh-5.0.7/Test/D04parameter.ztst --- zsh-5.0.5/Test/D04parameter.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/D04parameter.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -1560,3 +1560,79 @@ 0:Intersection and disjunction with empty parameters >0 >0 + + foo=(a b c) + bar=(1 2 3) + print ${foo:^bar} + print ${foo:^^bar} + foo=(a b c d) + bar=(1 2) + print ${foo:^bar} + print ${foo:^^bar} + foo=('a a' b) + bar=(1 '2 2') + print -l "${foo:^bar}" + print -l "${(@)foo:^bar}" +0:Zipping arrays, correct output +>a 1 b 2 c 3 +>a 1 b 2 c 3 +>a 1 b 2 +>a 1 b 2 c 1 d 2 +# maybe this should be changed to output "a a b 1" +>a a b +>1 +>a a +>1 +>b +>2 2 + + foo=(a b c) + bar=() + print ${foo:^bar} + print ${foo:^^bar} + print ${bar:^foo} + print ${bar:^^foo} + print ${bar:^bar} + print ${bar:^^bar} +0:Zipping arrays, one or both inputs empty +> +>a b c +> +>a b c +> +> + + foo=text + bar=() + print ${foo:^bar} + print ${bar:^^foo} + bar=other + print ${foo:^bar} + bar=(array elements) + print ${foo:^bar} + print ${foo:^^bar} + print ${bar:^foo} + print ${bar:^^foo} +0:Zipping arrays, scalar input +> +>text +>text other +>text array +>text array text elements +>array text +>array text elements text + + foo=(a b c) + print ${foo:^^^bar} +1:Zipping arrays, parsing +?(eval):2: not an identifier: ^bar + + (setopt nounset + print ${foo:^noexist}) +1:Zipping arrays, NO_UNSET part 1 +?(eval):2: noexist: parameter not set + + (setopt nounset + print ${noexist:^foo}) +1:Zipping arrays, NO_UNSET part 2 +?(eval):2: noexist: parameter not set diff -Nru zsh-5.0.5/Test/D09brace.ztst zsh-5.0.7/Test/D09brace.ztst --- zsh-5.0.5/Test/D09brace.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/D09brace.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -97,3 +97,18 @@ 0:BRACE_CCL off >X{za-q521}Y + print -r hey{a..j}there +0:{char..char} ranges, simple case +>heyathere heybthere heycthere heydthere heyethere heyfthere heygthere heyhthere heyithere heyjthere + + print -r gosh{1,{Z..a},2}cripes +0:{char..char} ranges, ASCII ordering +>gosh1cripes goshZcripes gosh[cripes gosh\cripes gosh]cripes gosh^cripes gosh_cripes gosh`cripes goshacripes gosh2cripes + + print -r crumbs{y..p}ooh +0:{char..char} ranges, reverse +>crumbsyooh crumbsxooh crumbswooh crumbsvooh crumbsuooh crumbstooh crumbssooh crumbsrooh crumbsqooh crumbspooh + + print -r left{[..]}right +0:{char..char} ranges with tokenized characters +>left[right left\right left]right diff -Nru zsh-5.0.5/Test/.distfiles zsh-5.0.7/Test/.distfiles --- zsh-5.0.5/Test/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,51 +1,2 @@ DISTFILES_SRC=' -.cvsignore -.distfiles -A01grammar.ztst -A02alias.ztst -A03quoting.ztst -A04redirect.ztst -A05execution.ztst -A06assign.ztst -A07control.ztst -B01cd.ztst -B02typeset.ztst -B03print.ztst -B04read.ztst -B05eval.ztst -B06fc.ztst -B07emulate.ztst -C01arith.ztst -C02cond.ztst -C03traps.ztst -C04funcdef.ztst -C05debug.ztst -D01prompt.ztst -D02glob.ztst -D03procsubst.ztst -D04parameter.ztst -D05array.ztst -D06subscript.ztst -D07multibyte.ztst -D08cmdsubst.ztst -D09brace.ztst -E01options.ztst -E02xtrace.ztst -Makefile.in -README -V01zmodload.ztst -V02zregexparse.ztst -V03mathfunc.ztst -V04features.ztst -V05styles.ztst -V06parameter.ztst -V07pcre.ztst -V08zpty.ztst -X02zlevi.ztst -Y01completion.ztst -Y02compmatch.ztst -Y03arguments.ztst -comptest -runtests.zsh -ztst.zsh ' diff -Nru zsh-5.0.5/Test/E01options.ztst zsh-5.0.7/Test/E01options.ztst --- zsh-5.0.5/Test/E01options.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/E01options.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -430,7 +430,7 @@ foo unfunction foo 0:FUNCTION_ARGZERO option ->My name is ZTST_execchunk +>My name is (anon) >My name is foo setopt _NO_glob_ @@ -1114,3 +1114,45 @@ >1 >1 >2 + + for (( i = 0; i < 10; i++ )); do + () { + print $i + break + } + done +0:NO_LOCAL_LOOPS +>0 + + () { + emulate -L zsh + setopt localloops + for (( i = 0; i < 10; i++ )); do + () { + setopt nolocalloops # ignored in parent + print $i + break + } + done + } +0:LOCAL_LOOPS +>0 +>1 +>2 +>3 +>4 +>5 +>6 +>7 +>8 +>9 +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope +?(anon):4: `break' active at end of function scope diff -Nru zsh-5.0.5/Test/V07pcre.ztst zsh-5.0.7/Test/V07pcre.ztst --- zsh-5.0.5/Test/V07pcre.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/V07pcre.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -108,3 +108,12 @@ >1 >0 xo→t →t >0 Xo→t →t + + string="The following zip codes: 78884 90210 99513" + pcre_compile -m "\d{5}" + pcre_match -b -- $string && print "$MATCH; ZPCRE_OP: $ZPCRE_OP" + pcre_match -b -n $ZPCRE_OP[(w)2] -- $string || print failed + print "$MATCH; ZPCRE_OP: $ZPCRE_OP" +0:pcre_match -b and pcre_match -n +>78884; ZPCRE_OP: 25 30 +>90210; ZPCRE_OP: 31 36 diff -Nru zsh-5.0.5/Test/X02zlevi.ztst zsh-5.0.7/Test/X02zlevi.ztst --- zsh-5.0.5/Test/X02zlevi.ztst 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/X02zlevi.ztst 2014-10-07 18:11:30.000000000 +0000 @@ -10,6 +10,63 @@ %test + zletest $'word\euaend' +0:undo initial change +>BUFFER: end +>CURSOR: 3 + + zletest $'text\e.' +0:repeat initial edit +>BUFFER: text +>text +>CURSOR: 8 + + zpty_run 'print -z before' + zletest $'after\e.' +0:repeat initial edit with non-blank starting line +>BUFFER: beforeafterafter +>CURSOR: 15 + + zpty_run 'setopt overstrike;print -z bung' + zletest $'ing\e2|.' +0:repeat initial edit with overstrike set +>BUFFER: binging +>CURSOR: 3 + + zpty_run 'bindkey "^_" undo' + zletest $'undoc\037e' +0:use of undo in vi insert mode +>BUFFER: undoe +>CURSOR: 5 + + zletest $'one\euatwo\e0clthree' +0:vi mode undo of initial and subsequent change +>BUFFER: threewo +>CURSOR: 5 + + zletest $'xxx\euiyyy\euAz' +0:undo invoked twice +>BUFFER: z +>CURSOR: 1 + + zpty_run 'bindkey -a "^K" redo' + zletest $'123\C-_\e\C-k' +0:undo in insert mode, redo in command +>BUFFER: 123 +>CURSOR: 2 + + zpty_run 'bindkey "^Y" redo' + zletest $'pre\eA123\C-_\C-y\eu' +0:undo and redo in insert mode, undo in command +>BUFFER: pre +>CURSOR: 2 + + zpty_run 'bindkey "^Gu" split-undo' + zletest $'one\C-gutwo\eu' +0:split the undo sequence +>BUFFER: one +>CURSOR: 2 + zletest $'one two\ebmt3|`tx``' 0:setting mark and returning to original position >BUFFER: one wo diff -Nru zsh-5.0.5/Test/ztst.zsh zsh-5.0.7/Test/ztst.zsh --- zsh-5.0.5/Test/ztst.zsh 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Test/ztst.zsh 2014-10-07 18:11:30.000000000 +0000 @@ -260,8 +260,12 @@ # Execute an indented chunk. Redirections will already have # been set up, but we need to handle the options. ZTST_execchunk() { + setopt localloops # don't let continue & break propagate out options=($ZTST_testopts) - eval "$ZTST_code" + () { + unsetopt localloops + eval "$ZTST_code" + } ZTST_status=$? # careful... ksh_arrays may be in effect. ZTST_testopts=(${(kv)options[*]}) diff -Nru zsh-5.0.5/Util/.distfiles zsh-5.0.7/Util/.distfiles --- zsh-5.0.5/Util/.distfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Util/.distfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,10 +1,4 @@ DISTFILES_SRC=' - .distfiles - check_exports - helpfiles - mkdisttree.sh - preconfig - reporter ' DISTFILES_NOT=' difflog.pl diff -Nru zsh-5.0.5/Util/helpfiles zsh-5.0.7/Util/helpfiles --- zsh-5.0.5/Util/helpfiles 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Util/helpfiles 2014-10-07 18:11:30.000000000 +0000 @@ -1,4 +1,4 @@ -#!/usr/local/bin/perl -- -*-perl-*- +#!/usr/bin/env perl # helpfiles: make help files for Z-shell builtins from the manual entries. @@ -16,24 +16,10 @@ # If a third arg is given, the symlink is not created, but a # list of symlinks is put into the file specified by that arg. -# Example usage: -# cd ~/zsh-4.0.1 # or wherever -# mkdir Help -# cd Help -# man zshbuiltins | colcrt - | helpfiles -# run-help() { -# typeset zhelp=~/zsh-4.0.1/Help # or wherever -# [[ $1 = . ]] && 1=dot -# [[ $1 = : ]] && 1=colon -# if [[ $1 = compctl ]]; then -# man zshcompctl -# elif [[ -f $zhelp/$1 ]]; then -# ${=PAGER:-more} $zhelp/$1 -# else -# man $1 -# fi -# } -# now -h works for shell builtins. +# This script is called automatically during `make install' +# unless specified otherwise. + +# For usage and and more information see zshcontrib(1). sub Usage { print(STDERR "Usage: helpfiles zshbuiltins.1 dest-dir [link-file]\n"); @@ -81,17 +67,17 @@ } $args = "$mantmp >$coltmp"; unlink($coltmp); -&Info('attempting colcrt ', $args); -if(system('colcrt ' . $args) || !(-s $coltmp)) { - unlink($coltmp); - &Info('attempting col -bx <', $args); +&Info('attempting col -bx <', $args); # The x is necessary so that spaces don't turn into tabs, which messes # up the calculations of indentation on machines which randomly wrap lines # round to the previous line (so you see what we're up against). - if(system('col -bx <' . $args) || !(-s $coltmp)) { +if(system('col -bx <' . $args) || !(-s $coltmp)) { + unlink($coltmp); + &Info('attempting colcrt - ', $args); + if(system('colcrt - ' . $args) || !(-s $coltmp)) { unlink($mantmp); unlink($coltmp); - &Die('colcrt and col -bx both failed'); + &Die('col -bx and colcrt - both failed'); } } unlink($mantmp) || &Die('cannot remove tempfile ', $mantmp); diff -Nru zsh-5.0.5/Util/mkdisttree.sh zsh-5.0.7/Util/mkdisttree.sh --- zsh-5.0.5/Util/mkdisttree.sh 2014-01-05 18:24:59.000000000 +0000 +++ zsh-5.0.7/Util/mkdisttree.sh 2014-10-07 18:11:30.000000000 +0000 @@ -51,9 +51,15 @@ ( while read dfn; do subdir=`echo $dfn | sed 's,/\.distfiles$,,'` echo >&2 "Processing directory $subdir..." - eval "DISTFILES_$type=" + eval "DISTFILES_$type= DISTFILES_NOT=" . $sdir_top/$dfn eval "distfiles=\$DISTFILES_$type" + if [ $type = SRC ]; then + # All files in git appear in the source bundle, unless + # explicitly excluded with DISTFILES_NOT. + distfiles="$distfiles + `cd $sdir_top/$subdir; git ls-files | grep -v /`" + fi if test -n "$distfiles"; then cmds=`echo "$distfiles" | sed -e "$sed_separate"` eval "$cmds" @@ -62,6 +68,11 @@ fi $sdir_top/mkinstalldirs $disttree/$subdir || exit 1 for f in $deplist `test -z "$globlist" || ( cd $dir_top/$subdir && eval "echo $globlist")`; do + for fnot in $DISTFILES_NOT; do + if [ $fnot = $f ]; then + continue 2 + fi + done if test -f $dir_top/$subdir/$f; then # ln $dir_top/$subdir/$f $disttree/$subdir/$f || \ cp -p $dir_top/$subdir/$f $disttree/$subdir/$f || exit 1