diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2000-04-01 20:43:43 +0000 |
commit | e025336f2f6d9f107ee1e03b9900f04af0544ba9 (patch) | |
tree | 37b0ce74587d42d4bcb024991526d2361fcdf04a | |
parent | 20c5fbe688f24010c578c48d4b4d228f0e1a56c3 (diff) | |
download | zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.gz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.tar.xz zsh-e025336f2f6d9f107ee1e03b9900f04af0544ba9.zip |
Updated from list as far as 10376
97 files changed, 17745 insertions, 3805 deletions
diff --git a/ChangeLog b/ChangeLog index a1a22e495..a811be6ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7003 @@ +2000-04-01 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 10376: LICENCE: new file, with licence as it appears + in some (but not all) files in distribution. + + * Bart: 10372: Doc/Zsh/builtins.yo, Doc/Zsh/mod_zutil.yo: + cross-reference builtin descriptions in modules. + + * Chmouel: 10370: zsh-3.1.6-dev-20/Completion/Linux/_rpm: rpm -p + handling. + + * Bart: 10368: Doc/Zsh/mod_zle.yo: improved bindkey -R description. + + * Oliver: 10367: Completion/Builtins/_nothing, + Completion/Builtins/_cd, Completion/Builtins/_emulate, + Completion/Builtins/_enable, Completion/Builtins/_disable, + Completion/Builtins/_fc: update some functions to use _arguments. + + * Bart: 10366: Doc/Zsh/builtins.yo: reword 10364. + + * Sven: 10364: Doc/Zsh/builtins.yo, Src/parse.c: -c and -a flags + for current and autoloadable functions are now orthogonal. + + * Bart: 10360: Doc/zsh.yo, Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/manual.yo, Doc/Zsh/mod_compctl.yo, + Doc/Zsh/modules.yo, Doc/Zsh/zftpsys.yo, Doc/Zsh/zle.yo: reorder + completion manual entries. + + * Sven: 10358: Doc/Zsh/params.yo, Src/jobs.c, Src/params.c, + Src/zsh.h: $pipestatus gives return values for all commands in + pipeline. + + * Sven: 10353: Completion/Commands/_history_complete_word: + updated to use latest tags mechanism. + + * Sven: 10352: Src/exec.c: fix 10331 for script names. + +2000-03-30 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 10335: Functions/Misc/zrecompile: -[rm] should be -[RM] in + one more place. + + * Sven: 10332: Completion/Core/compinstall: temporary fix-up for + old compinstall. + + * Sven: 10331: Src/exec.c: keep old script name for autoloading. + + * Sven: 10329, 10334: Src/Zle/compmatch.c: ** in match specs. + + * Sven: 10328: Src/Zle/iwidgets.list, Src/Zle/zle_utils.c: undo + fixes for completion (don't need double undo any more) and + for history stuff. + + * Sven: 10327: Completion/Builtins/_autoload, + Completion/Builtins/_zcompile, Completion/Core/_path_files: new + and improved completions. + + * Bart: 10322: Test/11glob.ztst, Test/53completion.ztst: + more comprehensive globbing tests, plus problem when TERM is + too dumb in completion test. + +2000-03-29 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 10320: Src/pattern.c: freeing of buffer was messed up in + 10284. + +2000-03-28 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Bart: 10319: Doc/Zsh/compsys.yo: add kindex entry for tag-order. + + * Bart: 10317: Test/11glob.ztst: real glob tests to pick up ** and + ~ things. + + * Sven: 10311: Doc/Zsh/builtins.yo, Src/builtin.c, Src/parse.c: + zcompile -a to force functions marked for autoloading to be dumped + as wordcode. + + * Sven: 10310: Src/exec.c: arguments in kshautoloaded function + problem: keep old zsh way of doing things for now. + + * Sven: 10309: Completion/Base/_arguments, + Completion/Base/_describe, Completion/Base/_jobs, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_compdef, + Completion/Builtins/_pids, Completion/Builtins/_popd, + Completion/Builtins/_sched, Completion/Builtins/_signals, + Completion/Builtins/_stat, Completion/Builtins/_zftp, + Completion/Builtins/_zpty, Completion/Builtins/_zstyle, + Completion/Core/.distfiles, Completion/Core/_alternative, + Completion/Core/_path_files, Completion/Core/_requested, + Completion/Core/_wanted, Completion/User/_gdb, + Completion/User/_getconf, Completion/User/_groups, + Completion/User/_lp, Completion/User/_make, Completion/User/_mh, + Completion/User/_netscape, Completion/User/_tiff, + Completion/User/_urls, Completion/User/_users, + Completion/User/_users_on, Completion/X/_x_colormapid, + Completion/X/_x_extension, Completion/X/_x_font, + Completion/X/_x_keysym, Completion/X/_x_window, + Completion/X/_xmodmap, Completion/X/_xutils, Completion/X/_xwit, + Doc/Zsh/compsys.yo, Etc/completion-style-guide, + Functions/Zftp/zfcd_match, Functions/Zftp/zfget_match: + rename _try by _next_label and _loop by _all_labels; files + themselves also renamed. + + * Clint: 10303: Doc/Zsh/params.yo, Src/params.c: restore + $MACHTYPE, run-time determination of $CPUTYPE. + +2000-03-27 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 10297: Doc/Zsh/builtins.yo, Functions/Misc/zrecompile, + Src/parse.c: restrict -c option not to work with -k, swap -r -m + and -R -M options. + + * Sven: 10294: Doc/Zsh/builtins.yo, Src/Modules/parameter.c, + Src/builtin.c, Src/cond.c, Src/exec.c, Src/hashtable.c, + Src/loop.c, Src/parse.c, Src/zsh.h: natural behaviour of autoload + +X for ksh-style autoloading. + + * Sven: 10293: Completion/Base/_default, + Completion/Commands/_complete_help, + Completion/Core/_main_complete, Doc/Zsh/compsys.yo: improve help + formatting and information content. + + * Sven: 10292: Completion/Core/_approximate, + Completion/Core/_complete, Completion/Core/_correct, + Completion/Core/_expand, Completion/Core/_ignored, + Completion/Core/_list, Completion/Core/_main_complete, + Completion/Core/_match, Completion/Core/_menu, + Completion/Core/_oldlist, Completion/Core/_path_files, + Completion/Core/_prefix, Doc/Zsh/compsys.yo: aliases for + completers; allow more flexibility with contexts at upper + levels. + +2000-03-26 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 10284: Src/pattern.c: exclusions with absolute path + didn't work; closures after exclusions in subdirectories crashed + the shell. + + * Sven: 10272, 10275: Doc/Zsh/builtins.yo, Src/builtin.c, Src/exec.c: + autoload can force zsh/ksh styles with -z, -k; integrate + execautofn() and loadautofn(). Side effect that -kX must run the + code to get at the function defintion. + + * Sven: 10273: Src/Zle/complete.c: problem with test for empty + prefix. + + * Sven: 10271: Completion/Core/_expand: _requested problem. + + * Sven: 10267: Completion/Builtins/_zstyle, + Completion/Commands/_next_tags, Completion/Core/_files, + Completion/Core/_tags, Doc/Zsh/compsys.yo, Src/Zle/computil.c: + better consistency between _file tags and other tags using + improved file-patterns style; remove tag-aliases style, better + done in other way.s + + * Bart: 10266: Doc/Zsh/compsys.yo: update for 10263. + + * Sven: 10265: Completion/Builtins/_zstyle, + Completion/Core/_approximate, Doc/Zsh/compsys.yo: tag-order and + file-patterns completions; subst-glob-only and _approximate + improvements. + + * Sven: 10264: Completion/Core/_call, Completion/Core/compdump, + Completion/Core/compinit, Doc/Zsh/compsys.yo, + Functions/Zle/incremental-complete-word, Functions/Zle/predict-on: + Allow options to #autoload tag; fix uses of force-list. + + * Bart: 10263: Doc/Zsh/compsys.yo, Doc/Zsh/index.yo, + Doc/Zsh/manual.yo, Doc/Zsh/zftpsys.yo: style and tags index, + removed unused key index. + + * Sven: 10262: Src/Zle/compcore.c: compadd -D problem. + + * Sven: 10260: Doc/Zsh/compwid.yo: resolve incompatibilities + between 10258 and 10230. + + * Sven: 10179: Src/text.c: a bit more safety in printing wordcode + structures. + + * Sven: 10233: Completion/X/_x_colormapid, Completion/X/_xwit: + some uses of tag aliases. + + * Sven: 10231: Completion/Builtins/_zstyle, + Completion/Commands/_next_tags, Completion/Core/_tags, + Doc/Zsh/compsys.yo, Src/Zle/computil.c: tag-order can take + patterns, new tag-aliases style, aliases starting with a hyphen + are appended to existing tag. + + * Sven: 10230: Completion/Builtins/_zstyle, + Completion/Core/_description, Completion/Core/_ignored, + Completion/Core/_main_complete, Completion/Core/_path_files, + Completion/Core/_prefix, Completion/Core/_setup, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, + Functions/Zle/incremental-complete-word, Src/Zle/comp.h, + Src/Zle/compcore.c, Src/Zle/complete.c, Src/Zle/compresult.c: + Remove builtin alternate matching and implement as _ignored + completer. + + * Bart: 10258: Doc/ztexi.yo, Doc/Zsh/builtins.yo, + Doc/Zsh/compctl.yo, Doc/Zsh/compwid.yo, Doc/Zsh/expn.yo, + Doc/Zsh/filelist.yo, Doc/Zsh/files.yo, Doc/Zsh/redirect.yo, + Doc/Zsh/zle.yo: more enhanced documentation. + + * Bart: 10250: Doc/Zsh/builtins.yo, Doc/Zsh/files.yo, + Doc/Zsh/func.yo: improved documentation for new wordcode dumping + and loading. + +2000-03-24 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Bart: 10243: Completion/User/_groups, Src/Modules/zpty.c: + 9897 and 10089 weren't merged properly; bit which got missed + out of 9981 because it was applied by hand. + + * Clint: 10242: configure.in, Src/params.c: determine $MACHTYPE at + run time. + +2000-03-23 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: 3.1.6-dev-20 + + * Tanaka Akira: 10234, 10236: Completion/X/_xwit: _message passing. + + * Tanaka Akira; 10232: Test/comptest, Test/ztst.zsh, ChangeLog(!): + minor test fixes and typo. + + * Sven: 10226: Completion/Core/_path_files: quoting problem. + + * Sven: 10225: Completion/Core/_path_files: dot problems with + files. + + * Tanaka Akira: 10223: Completion/Base/_regex_arguments, + Completion/X/_x_colormapid, Completion/X/_xwit: + new X completions. + + * Bart: 10218: Src/prompt.c: possible realloc() in + putpromptchar(). + +2000-03-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 10215: Completion/User/_nedit: and this one. + + * Sven: 10214: Completion/Builtins/_cd, + Completion/Builtins/_zstyle, Completion/User/_pbm, + Completion/User/_pspdf, Completion/User/_tiff, + Completion/User/_zdump: some _path_files calls now need loop for + tags. + + * Sven: 10210: Completion/Commands/_next_tags, + Completion/Core/_main_complete, Completion/Core/compinit, + Doc/Zsh/compsys.yo: _next_tags doesn't need to be in completer + list any more; $compprefuncs array does pre-completion functions. + + * Sven: 10209: Completion/Core/_loop, Completion/Core/_try: + missing functions form 10195. + + * 10204: Completion/Base/_arguments, Completion/Base/_values, + Completion/Core/_alternative, Completion/Core/_tags, + Completion/Core/_wanted, Src/Zle/computil.c: additions to 10195. + + * Sven: 10195: Completion/Base/_arguments, + Completion/Base/_brace_parameter, Completion/Base/_condition, + Completion/Base/_default, Completion/Base/_describe, + Completion/Base/_first, Completion/Base/_jobs, + Completion/Base/_math, Completion/Base/_parameter, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_arrays, + Completion/Builtins/_autoload, Completion/Builtins/_bindkey, + Completion/Builtins/_builtin, Completion/Builtins/_cd, + Completion/Builtins/_command, Completion/Builtins/_compdef, + Completion/Builtins/_echotc, Completion/Builtins/_functions, + Completion/Builtins/_hash, Completion/Builtins/_limits, + Completion/Builtins/_pids, Completion/Builtins/_popd, + Completion/Builtins/_sched, Completion/Builtins/_signals, + Completion/Builtins/_stat, Completion/Builtins/_vars, + Completion/Builtins/_zftp, Completion/Builtins/_zle, + Completion/Builtins/_zmodload, Completion/Builtins/_zpty, + Completion/Builtins/_zstyle, Completion/Commands/_next_tags, + Completion/Core/_alternative, Completion/Core/_files, + Completion/Core/_main_complete, Completion/Core/_multi_parts, + Completion/Core/_options, Completion/Core/_parameters, + Completion/Core/_path_files, Completion/Core/_requested, + Completion/Core/_sep_parts, Completion/Core/_set_options, + Completion/Core/_setup, Completion/Core/_tags, + Completion/Core/_unset_options, Completion/Core/_wanted, + Completion/Debian/_apt, Completion/Debian/_deb_packages, + Completion/Linux/_rpm, Completion/User/_archie, + Completion/User/_cvs, Completion/User/_dd, + Completion/User/_domains, Completion/User/_gcc, + Completion/User/_gdb, Completion/User/_getconf, + Completion/User/_gprof, Completion/User/_groups, + Completion/User/_gs, Completion/User/_hosts, Completion/User/_lp, + Completion/User/_mailboxes, Completion/User/_make, + Completion/User/_man, Completion/User/_mh, Completion/User/_mount, + Completion/User/_mutt, Completion/User/_mysql_utils, + Completion/User/_netscape, Completion/User/_nslookup, + Completion/User/_pbm, Completion/User/_perl_basepods, + Completion/User/_perl_builtin_funcs, + Completion/User/_perl_modules, Completion/User/_ports, + Completion/User/_rcs, Completion/User/_rlogin, + Completion/User/_socket, Completion/User/_ssh, + Completion/User/_stty, Completion/User/_tar, + Completion/User/_telnet, Completion/User/_tiff, + Completion/User/_urls, Completion/User/_user_at_host, + Completion/User/_users, Completion/User/_users_on, + Completion/User/_whois, Completion/User/_yp, + Completion/X/_x_color, Completion/X/_x_cursor, + Completion/X/_x_display, Completion/X/_x_extension, + Completion/X/_x_font, Completion/X/_x_keysym, + Completion/X/_x_modifier, Completion/X/_x_window, + Completion/X/_xmodmap, Completion/X/_xutils, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_zutil.yo, Etc/completion-style-guide, + Functions/Zftp/zfcd_match, Functions/Zftp/zfget_match, + Src/Modules/zutil.c, Src/Zle/computil.c: implement tag aliases, + which allows neat tricks with styles. + + * Sven: 10197: Src/exec.c, Src/init.c: %_ sometimes got cmdstack + wrong in source(); $(...) didn't show up at all. + + * Bart: 10193: Src/prompt.c: prompttrunc() didn't track realloc()'s. + + * Bart: 10181: Functions/Prompts/prompt_bart_setup: Bart's Theme + and Variations. + + * Sven: 10178: Completion/Commands/_next_tags, Doc/Zsh/compsys.yo: + don't bind _next_tags by default and add some more docs. + + * Sven: 10176: Src/Zle/compresult.c, Src/init.c, Src/parse.c: + optimize list-packed. + + * Sven: 10174: Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo: tweaks on + completer and -V. + + * Bart: 10173: Functions/Prompts/prompt_bart_setup, + Functions/Prompts/promptinit: Bart's Theme. + + * Sven: 10172: Completion/Core/_main_complete: typo. + + * Bart: 10168: Src/init.c: move hbegin() to get it right in + precmd. + + * Oliver: 10166: Completion/X/_xt_arguments, + Completion/User/_nedit: new and improved. + + * Bart: 10165: Doc/Zsh/builtins.yo, Doc/Zsh/compsys.yo: move doc + for using a completer twice; zcompile doc tweak. + + * Oliver: 10162: Completion/Core/_expand: use nullglob option + instead of (N) so that user's qualifiers work. + + * Sven: 10159: Src/Zle/compresult.c: wrong calculation of display + length when not using zsh/complist. + + * Sven: 10156: Src/exec.c: possible invalid field in function + definition when loading. + + * Zefram: 10152: Src/mem.c: fix ordering ambiguity ANSI wouldn't + have liked. + + * Bart: 10150: Src/exec.c, Test/51xtrace.ztst: `one last' xtrace + redirection fix. + + * Sven: 10149: Doc/Zsh/builtins.yo, Src/builtin.c, Src/exec.c, + Src/parse.c: allows native and ksh-like wordcode function styles. + + * Sven: 10148: Src/Zle/comp.h, Src/Zle/compcore.c, Src/mem.c: + optimization for added matches where things didn't change. + + * Sven: 10146: Completion/Core/_sort_tags, Completion/Core/_tags, + Doc/Zsh/compsys.yo: return value of function called by _tags used + to decide dispositions. + + * Sven: 10145: Doc/Zsh/mod_zle.yo: confess to users that zle input + is on a stack. + + * Sven: 10144: Doc/Zsh/builtins.yo, Src/Modules/parameter.c, + Src/builtin.c, Src/exec.c, Src/linklist.c, Src/parse.c: dump + functions from current shell. + + * Sven: 10143: Src/init.c, Src/math.c: better ignoring of bits + that shouldn't get evaluated in math expressions. + + * Sven: 10135: Doc/Zsh/compsys.yo, Src/Zle/computil.c: complex + argument handling expressions. + + * Sven: 10131: Src/Modules/stat.c, Src/Modules/zpty.c, + Src/Modules/zutil.c, Src/Zle/compctl.c, Src/Zle/complete.c, + Src/Zle/computil.c, Src/Zle/zle_main.c, Src/Zle/zle_thingy.c, + Src/parse.c: more consistent zerrnam/zwarnnam usage. + + * Sven: 10129: Doc/Zsh/builtins.yo, Src/builtin.c, Src/parse.c: + autoload -w can mark all functions in .zwc files for autoloading. + + * Sven: 10128: Doc/Zsh/zle.yo, Src/Zle/zle_main.c, Src/init.c, + Src/signals.c, Src/zsh.h: zle parameters available readonly in + traps. + + * Sven: 10127: Doc/Zsh/zle.yo, Src/Zle/compresult.c, + Src/Zle/iwidgets.list, Src/Zle/zle_main.c, Src/Zle/zle_misc.c, + Src/Zle/zle_refresh.c, Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c: + end-of-list widget to display prompt under command line, plus + $MARK documentation. + + * Sven: 10126: Src/Zle/compcore.c: quotes in $PREFIX and $SUFFIX. + + * Sven: 10125: Src/math.c, Src/params.c: restore old cruddy + behaviour removed in 10104, but using recursion counter. + + * Sven: 10120: Src/exec.c, Src/loop.c, Src/parse.c: state not + tested properly in some constructs. + + * Sven: 10117: Doc/Zsh/mod_zle.yo, Src/Zle/zle_params.c, + Src/Zle/zle_thingy.c: zle on its own returns zle status; + MARK parameter; disallow widgets in traps. + + * Oliver: 10116: Completion/Builtins/_source: wasn't looking + through the path. + + * Sven: 10112: Completion/Base/_condition, Src/Zle/zle_tricky.c: + fix up altmodische _condition; `[[ ... && ' thought it was in + command position for completion. + + * Sven: 10108: Completion/Commands/.distfiles, + Completion/Commands/_next_tags, Completion/Core/_files, + Completion/Core/_main_complete, Completion/Core/_requested, + Completion/Core/_wanted, Doc/Zsh/compsys.yo, + Functions/Misc/.distfiles: _next_tags allows you to cycle through + sets of completions according to the tags. + + * Sven: 10107: Doc/Zsh/compwid.yo, Src/Zle/complete.c, + Src/Zle/compmatch.c: ** in match spec allows matching including + the anchor as well. + + * Sven: 10106: Functions/Misc/zrecompile, Src/exec.c, Src/parse.c, + Src/zsh.h: recompilation of wordcode files and related bugs. + + * Sven: 10105: Src/lex.c: single exclamation marks in conditions. + + * Sven: 10104: Src/math.c, Src/params.c: retrieve parameters in + math evaluations more directly rather than recursively calling + matheval(), which was kind of stupid, so stupid I could quite + possible have put it in myself, but I don't think I did this time. + + * Sven: 10103: Src/glob.c: bad handling of ./ and ../ in + closures. + + * Bart: 10098: configure.in, Src/cond.c: check for AIX's + faccessx() and neaten configure library function tests. + + * Oliver: 10088: Completion/User/_groups, + Completion/Base/_condition: better handling of files after + conditions, checking of use of NIS. + + * Adam: 10087: Completion/User/_perl_modules, + Completion/User/_perl: new and enhanced perl completions. + + * Oliver: 10073: Src/cond.c: /dev/fd emulation for access tests. + + * Adam: 10072: Completion/User/_mysql_utils: new completion + function for something with suspcicious `SQL' bit in its name. + + * Bart: 10071: Src/exec.c: xtrace output redirection problem. + + * Sven: 10059: Src/builtin.c, Src/lex.c, Src/parse.c, Src/text.c, + Src/zsh.h: bugs found by ksh tests: typeset -Ai didn't create + assocs (still doesn't create ints), some heredoc difficulties, |& + difficulties. + + * Alexandre: 10058: Completion/User/_prcs, Completion/User/_diff, + Completion/User/_diff_options: another solution for the GNU diff + completion problem. + + * Bart: 10056: Etc/MACHINES: RLIM_INFINITY incompatibility with + some Linux/GNU libraries. + + * Sven: 10044: Completion/User/_diff, Completion/User/_use_lo: + gdiff should use diff completion, pretty obviously. + + * Sven: 10041: Doc/Zsh/builtins.yo, Doc/Zsh/files.yo, + Doc/Zsh/func.yo, Src/init.c, Src/parse.c: enhancements for digest + files including digests of sourced files. Or maybe digestion of + sauce. + + * Sven: 10040: Completion/User/_diff_options: can test for GNU + diff. + + * Oliver: 10029: Src/utils.c: bad handling of '^^' in keystring + parsing. + + * Andrej: 10028: Completion/Builtins/_cd: remove local directory + from cdpath. + + * Sven: 10025: Functions/Misc/nslookup, Src/Modules/zpty.c: + optimizations for pty reads. + + * Sven: 10017: Doc/Zsh/builtins.yo, Src/lex.c, Src/parse.c: + fix buffer problem for autoloading and unportable macro. + + * Oliver: 10013: Completion/Builtins/_compdef, + Completion/Builtins/_zpty, Completion/User/_getconf: two new + functions and one updated. + + * Andrej: 10011: Completion/User/_sudo: options for recent sudo. + + * Bart: 10009: Completion/Base/_subscript: didn't get arrays the + right length. + + * Bart: 10006: configure.in, Src/utils.c: use mktemp() if + available. + + * Bart: 9992: Functions/Zle/predict-on: tweaks. + + * Bart: 9990: Test/07cond.ztst: compatibility fix for chmod g+s. + + * Bart: 9982: Test/53completion.ztst, Test/Makefile.in, + Test/comptest, Test/ztst.zsh: better handling of uninstalled + modules. + + * Andrej: 9981: Src/Modules/zpty.c: SYSV-related pty stuff. + + * Bart: 9980: Src/Makefile.in: separate mymods.conf and xmods.conf + dependencies. + + * Sven: 9966: Doc/Zsh/builtins.yo, Doc/Zsh/func.yo, Src/parse.c: + require .zwc ending for digest files. + + * Bart: 9963: Test/11glob.ztst: existing globbing tests run under + new test harness. + + * Bart: 9961: INSTALL, Src/Makefile.in, Test/53completion.ztst, + Test/comptest: errors trying to load zpty for static shell in + tests; INSTALL didn't describe mymods.conf properly. + + * Tanaka Akira: 9960: Test/comptest, Test/53completion.ztst: avoid + zpty timing problem. + + * Sven: 9958: Src/parse.c: sharing strings made test fail with + new wordcode. + + * Tanaka Akira: 9957: Test/comptest: clear to end. + + * Sven: 9953: Src/Zle/complist.c: was incorrectly omitting some + display sequences. + + * Tanaka Akira: 9952: Test/comptest: compatibility, quoting and + debugging fixes. + + * Sven: 9951: Completion/Core/_multi_parts: was producing + mysterious blank entries. + + * Sven: 9948: Src/exec.c, Src/parse.c: stripkshdef() was broken. + + * Sven: 9947: Completion/Core/compdump, Completion/Core/compinit, + Doc/Zsh/builtins.yo, Doc/Zsh/func.yo, Src/builtin.c, Src/cond.c, + Src/exec.c, Src/glob.c, Src/lex.c, Src/loop.c, Src/math.c, + Src/mem.c, Src/parse.c, Src/text.c, Src/utils.c, Src/zsh.h: + Wordcode compilation for functions using .zwc or `digest + functions' in $fpath. + + * Bart: 9946: Src/subst.c: return type in 9937. + + * Bart: 9945: Src/prompt.c: truncation messed up non-literal + parts of the prompt. + + * Bart: 9942: Src/prompt.c: truncation in true part of ternary + expression incorrectly showed false part and closing parenthesis. + + * Sven: 9937: Src/subst.c: parsing problem with parameter + substitution which showed up in file completion. + + * Sven: 9938: Src/Modules/parameter.c: problem assigning to + dirstack. + + * Tanaka Akira: 9936: Src/Zle/complist.c, Test/comptest, + Test/53completion.ztst: tests for completion using zpty. + + * Tanaka Akira: 9935: Test/52zregexparse.ztst: tests for + zregexparse. + +2000-03-21 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9920: Completion/Core/.distfiles, Completion/Core/_call: + the function needed for 9897. + + * Bart: 9912: Completion/User/_mailboxes: further improvements. + + * Sven: 9904: Src/utils.c: getquery() and rmstarsilent. + + * Sven: 9902: Completion/Core/_path_files: _files -g problem. + + * Sven: 9900, 9903: Src/exec.c: parsing oddity in here documents. + + * 9897: Completion/Base/_arguments, Completion/Builtins/_pids, + Completion/Linux/_rpm, Completion/User/_a2ps, + Completion/User/_archie, Completion/User/_diff_options, + Completion/User/_finger, Completion/User/_groups, + Completion/User/_gs, Completion/User/_killall, + Completion/User/_lp, Completion/User/_telnet, + Completion/User/_users_on, Completion/User/_yp, + Completion/X/_x_font, Completion/X/_x_window, Doc/Zsh/compsys.yo: + use _call function and `command' style to override command + used in various completions. + + * Sven: 9895: Completion/Base/_combination, + Completion/Builtins/_zstyle, Completion/User/_telnet, + Doc/Zsh/compsys.yo: usage of combination styles. + + * Sven: 9893: Completion/Core/_multi_parts: return values. + + * Sven: 9892: Completion/Core/_main_complete, + Completion/Core/_path_files, Completion/Core/compdump, + Completion/Core/compinit: improved fix for 9886; typo in + _main_complete; compdump uses (q) flag; remove compstyle; update + compconf. + + * Bart: 9891: Completion/User/_cvs: kshautoload problem. + + * Bart: 9889: acconfig.h, configure.in, Src/exec.c, + Src/prototypes.h: from 3.0.8: detect mknod(), minor redirection + tweaks. + + * Bart: 9886: Completion/Core/_path_files: matcher problem. + + * Tanaka Akira: 9885: Completion/User/_dvi, Completion/User/_lynx, + Completion/X/_xutils: extra arguments for completion functions. + + * Alexandre: 9882: Completion/User/_prcs: error messages. + + * Sven: 9880: Completion/Core/_path_files: error message with + ~unknown. + + * Sven: 9879: Completion/User/_tilde_files: use of magicequalsubst + with completion. + + * Sven: 9877: Src/parse.c: wordcode bug in functions with failed + builtins. + + * Sven: 9876: Completion/Base/_combination, + Completion/User/_rlogin, Completion/User/_ssh, + Completion/User/_user_at_host, Doc/Zsh/compsys.yo: more flexible + handling of separators in combinations. + + * Sven: 9870: Completion/Core/_path_files, + Completion/User/.distfiles, Completion/User/_dd, + Completion/User/_tilde_files, Src/Zle/compresult.c: better + handling of paths beginning ~ in various places. + + * Sven: 9865: Completion/Builtins/_zstyle, + Completion/Core/_main_complete, Completion/Core/_setup, + Doc/Zsh/compsys.yo, Src/Zle/compcore.c, Src/Zle/compresult.c: + implement prefer-ignored style to prefer alternative matches + to going on to another completer. + + * Sven: 9863: Src/parse.c, Src/text.c: wordcode problems, using + old code. + + * Sven: 9861: Completion/Core/_main_complete: interaction of + _main_complete and _oldlist. + + * Sven: 9860: Src/Zle/compctl.c: storing of match and display list. + + * Sven: 9855: Completion/Core/_multi_parts, Doc/Zsh/compsys.yo: + _multi_parts accepts -f. + +2000-02-23 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9845: Functions/Zle/incremental-complete-word: another + context change. + + * Sven: 9844: Functions/Zle/predict-on: rationalize 9837. + + * Sven: 9840: config.sub: test for alphaev6 systems. + + * Sven: 9839: Src/Builtins/sched.c, Src/Modules/example.c, + Src/Modules/mapfile.c, Src/Modules/parameter.c, + Src/Modules/zftp.c, Src/Modules/zprof.c, Src/Modules/zpty.c, + Src/Modules/zutil.c, Src/Zle/compcore.c, Src/Zle/compctl.c, + Src/Zle/complete.c, Src/Zle/complist.c, Src/Zle/compresult.c, + Src/Zle/computil.c, Src/Zle/zle_hist.c, Src/Zle/zle_main.c, + Src/Zle/zle_misc.c, Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, + Src/Zle/zleparameter.c, Src/builtin.c, Src/cond.c, Src/exec.c, + Src/glob.c, Src/hist.c, Src/init.c, Src/jobs.c, Src/lex.c, + Src/linklist.c, Src/loop.c, Src/main.c, Src/math.c, Src/mem.c, + Src/module.c, Src/params.c, Src/parse.c, Src/pattern.c, + Src/prompt.c, Src/signals.c, Src/subst.c, Src/utils.c, Src/zsh.h: + Eliminate `useheap' variable and consequent HEAPALLOC/PERMALLOC + usage throughout the shell (hooray!) All memory allocation is + either explicitly on the heap or permanent. + + * Sven: 9838: Src/Modules/parameter.c, Src/Zle/computil.c, + Src/Zle/zle_main.c, Src/builtin.c, Src/cond.c, Src/exec.c, + Src/glob.c, Src/hashtable.c, Src/init.c, Src/jobs.c, Src/lex.c, + Src/linklist.c, Src/loop.c, Src/params.c, Src/parse.c, + Src/signals.c, Src/signals.h, Src/subst.c, Src/text.c, + Src/version.h, Src/zsh.h: parser now emits wordcode directly; a + whole heap of optimisations of the execution tree. + + * Sven: 9837: Completion/User/_gunzip, Functions/Zle/predict-on: + no. of colons in predict-on, typo in _gunzip. + + * Sven: 9835: Completion/Builtins/_zstyle, + Completion/Core/_main_complete, Doc/Zsh/compsys.yo: document + single-ignored style, better handling of descriptions with + warnings about no matches. + + * Bart: 2930: Completion/User/_ssh: basic completion for remote + files. + +2000-02-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9831: Completion/Core/_multi_parts: better separator + removal. + + * Sven: 9830: Completion/X/_x_arguments: reverse 9824, but use + _default instead of _files if no special arguments. + + * Bart: 9828: Completion/User/_mailboxes: $i -> "$i" missed out. + +2000-02-21 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Clint: 9824: Completion/X/_x_arguments: `*/X11/*' was too broad + a definition for X commands taking standard arguments to be + useful. + + * Clint: 9823: configure.in: open fifo read/write in test to avoid + possible (unconfirmed) hang. + + * Bart: 9822: Completion/User/_mailboxes: add completions for mush + and tkrat; allow pine to complete mh folders. + + * Sven: 9816: Completion/Core/_multi_parts, + Completion/User/_mailboxes: improved version of 9812/9815. + + * Bart: 9812, 9815: Completion/User/_mailboxes, + Completion/User/_mutt: improved mailbox completion for all sorts + of types, currently only used for mutt. + + * Sven: 9810: Completion/Core/_multi_parts: difficulties with + separator as initial character. + + * Sven: 9809: Completion/Builtins/_popd, + Completion/Core/_approximate, Doc/Zsh/compsys.yo: documentation + improvements and typo fixes. + + * Tanaka Akira/Sven: 9807: Completion/Core/_main_complete: + single-ignored style, as yet undocumented, for handling of + alternate match set. + + * Sven: 9806: Completion/Core/_multi_parts: problems with literal + (parenthesised) arrays. + + * Sven: 9805: Completion/Core/_path_files: difficulties with + suffixes when expanding paths. + + * Sven: 9802: Src/utils.c: no need to quote !'s in ${(qq)...} + because they're not active in single quotes. + + * Bart: 9799: Src/utils.c: better interpretation of typeahead when + querying user e.g. for spell checking. + + * Adam: 9798: Doc/Makefile.in: use `texi' and `html' for targets + to avoid duplicated name complaint by gmake. + +2000-02-20 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: 3.1.6-dev-19. + + * Bart: 9794: Src/exec.c, Test/.distfiles, Test/51xtrace.ztst: + pick up some problems with 9792. + +2000-02-19 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Bart: 9792: Src/builtin.c, Src/cond.c, Src/exec.c, Src/init.c, + Src/loop.c, Src/utils.c: `xtrerr' replaces stderr for output from + xtrace, to avoid problems with redirection. + + * Sven: 9791: Completion/X/_x_arguments: complete filenames by + default. + + * Sven: 9790: Completion/Builtins/_zstyle, + Completion/Core/.distfiles, Completion/Core/_message, + Completion/X/_x_borderwidth, Completion/X/_x_geometry, + Completion/X/_x_locale, Completion/X/_x_name, + Completion/X/_x_resource, Completion/X/_x_selection_timeout, + Completion/X/_x_title, Doc/Zsh/compsys.yo: arguments problem with + _x_geometry; matcher-list completed in zstyle. + + * Sven: 9787: Completion/Core/_expand, Src/utils.c: parameter + expansion problems expanding; problem quoting in backquoted + expressions. + + * Chmouel: 9784: Completion/User/_tar, + Completion/User/_tar_archive: obsolete -y option for bzip2 filter. + + * Chmouel: 9781: Completion/Linux/_rpm: add --freshen. + +2000-02-17 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9777: Src/Zle/compctl.c, Src/Zle/zle_tricky.c, Src/exec.c, + Src/glob.c, Src/subst.c: yet more difficulties with completing + brace-expanded expressions. + + * Sven: 9776: Completion/Core/_main_complete, Src/glob.c, + Src/params.c: substitution bugs: ${foo[1,1]...} was treated + incorrectly as a scalar rather than an array slice; extra + duplication required when performing replacement on parameter. + + * Sven: 9775: Completion/Core/_path_files: extra array copy + required. + + * Sven: 9774: Src/Zle/compresult.c: completion inserted some + incorrect strings. + + * Sven: 9773: Completion/Core/_multi_parts, + Completion/User/_groups, Completion/User/_ports, + Completion/User/_users, Doc/Zsh/compsys.yo: remove some + unnecessary tags which are more logically expressed by an empty + tag field in the context. + + * Sven: 9772: Completion/Core/_approximate, + Completion/Core/_description, Completion/Core/_expand, + Completion/Core/_list, Completion/Core/_main_complete, + Completion/Core/_match, Completion/Core/_menu, + Completion/Core/_oldlist, Completion/Core/_prefix, + Doc/Zsh/compsys.yo: matcher-list style replaces matcher; + _matcher completer is now defunct. + + * Sven: 9770: Src/Zle/computil.c: bogus empty descriptions. + + * Sven: 9768: Completion/Core/_path_files: completing empty + directories. + +2000-02-16 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Oliver: 9761: Completion/Core/_expand: auto-removable suffixes. + + * Oliver: 9752: Completion/Core/_expand: subst-globs-only style + bails out if no globs expanded. + + * Sven: 9765: Completion/Core/_sep_parts: problems with separators + with metacharacters. + + * Sven: 9764: Completion/Core/_multi_parts, + Completion/Core/_path_files, Doc/Zsh/compsys.yo: problems with + _oldlist in _multi_parts; new -i option to complete _multi_parts + bits in one go if possible. + + * Sven: 9763: Src/subst.c: addition to 9757. + + * Sven: 9759: Completion/Base/_default, Doc/Zsh/compsys.yo, + Src/Zle/comp.h, Src/Zle/compcore.c, Src/Zle/compctl.c, + Src/Zle/complete.c: use-compctl style to use existing compctls; + on by default if zsh/compctl is loaded; extra hook needed to allow + compctl to clear up if invoked via new completion. + + * Sven: 9757: Src/subst.c: quoting with ${(e)...}. + +2000-02-15 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9755: Completion/Core/_sep_parts: typo. + + * Bart: 9750: Src/jobs.c, Src/signames2.awk, + Src/Modules/parameter.c: better handling for signals received by + shell which were not in the range found when configuring (e.g. if + OS was upgraded). + + * Sven: 9749: Src/Zle/zle_tricky.c: completion in braces. + + * Sven: 9746: Src/Zle/compctl.c: broken old-style completion. + + * Sven: 9734: Doc/Zsh/compwid.yo: descriptions for matching. + + * Sven: 9733: Completion/Core/_main_complete, + Completion/Core/_setup: can't set defaults ZLS_COLORS and + SELECTMIN inside completion functions, because they may already + have been set. + + * Sven: 9732: Src/Zle/complist.c: bad test without + alwayslastprompt. + + * Sven: 9731: Completion/Base/_arguments, + Completion/Base/_describe, Completion/Base/_jobs, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Builtins/_pids, Completion/Builtins/_popd, + Completion/Builtins/_sched, Completion/Builtins/_signals, + Completion/Builtins/_stat, Completion/Core/_approximate, + Completion/Core/_files, Completion/Core/_main_complete, + Completion/Core/_normal, Completion/Core/_path_files, + Completion/Core/_setup, Completion/Core/_tags, + Completion/Core/compinit, Completion/Debian/_apt, + Completion/User/_lp, Completion/User/_socket, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_zutil.yo, Src/Modules/zutil.c: Style defaults are now + hard-wired in, so all user styles take precedence without having + to delete existing patterns; _complete is now the default + completer in every context, including non-completion widgets. + +2000-02-14 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9722: Completion/Commands/_expand_word, + Src/Zle/compcore.c, Src/Zle/complist.c: last_prompt, expansion + problems. + + * Sven: 9713: Completion/Base/_arguments, Src/Zle/computil.c: two + more arguments problems. + + * Sven: 9711: Completion/Commands/_complete_help: number of colons + in context brought up to date. + + * Sven: 9710: Completion/Core/_files, Completion/Core/_path_files, + Src/Modules/zutil.c: a few random bugs: sorting of styles, bad + directory completion, globbing problems. + + * Zefram: 9709: Src/mkmodindex.sh: should be global subst in 9701. + + * Sven: 9705: Src/exec.c: comment esprefork, esglob. + + * Sven: 9704: Completion/Core/_path_files: incorrect parameter + name. + +2000-02-13 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9701: INSTALL, configure.in, Config/defs.mk.in, + Src/Makefile.in, Src/mkmodindex.sh: allow --enable-omit-modules=foo,... + to omit a list of modules from compilation and installation. + + * Tanaka Akira: 9697: Completion/User/.distfiles, + Completion/User/_ps, Completion/User/_psutils: completion for all + psutils commands. + + * Bart: 9694: Src/init.c: more portable attempt to force shell to + suspend if running interactively in background. + + * Oliver: 9693: Src/params.c, Src/Zle/compcore.c, + Src/Zle/complete.c: AIX module exports. + +2000-02-11 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Bart: 9684: Completion/User/_mailboxes: sort of help find + mailboxes with + prefix. + + * Bart: 2913: Completion/User/_mutt: don't set muttrc. + + * pws: Config/version.mk: 3.1.6-dev-18 + + * Tanaka Akira: 9683: Completion/User/_diff_options: shut up error + messages (after other attempts from Oliver and Bart). + + * Alexandre: 9681: Completion/User/_prcs: argument handling. + + * Sven: 9680: Completion/Core/_files, + Completion/Core/_multi_parts, Completion/Core/_path_files, + Completion/Core/_sep_parts: use of -M option. + + * Sven: 9677, 9679: Completion/Commands/_read_comp, + Completion/Core/_approximate, Completion/Core/_expand, + Completion/Core/_main_complete, Completion/Core/_match, + Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, + Src/Zle/comp.h, Src/Zle/compcore.c, Src/Zle/compctl.c, + Src/Zle/complete.c: $compmatchers bites the dust, use new matcher + style. + + * Sven: 9676: Src/Zle/computil.c: yet more argument subtleties. + + * Tanaka Akira: 9674: Test/10prompt.ztst: some nameless idiot got + the bits of the date wrong. + + * Sven: 9664: Completion/Core/_path_files: optimisation with + arrays. + + * Sven: 9659: Doc/Zsh/compsys.yo: mention complete-in-words + behaviour. + + * Sven: 9657: Completion/Core/_approximate, + Completion/Core/_description, Completion/Core/_main_complete, + Completion/Core/_matcher, Completion/Core/_path_files, + Completion/Core/_prefix, Doc/Zsh/compsys.yo, Src/Zle/complete.c + (plus Completion/Core/.distfiles change by hand): new _matcher + completer allows more control along the lines of $compmatchers. + + * Johan: 9653: Functions/Misc/is-at-least, + Functions/Misc/.distfiles (added by hand): function to check + version numbers. + + * Johan: 9651: Completion/User/_cvs: handle no CVS tags case better. + + * Sven: 9650: Completion/User/_gunzip, Completion/User/_gzip: + handle .tgz files. + + * Sven: 9648: Completion/Core/_files, + Completion/Core/_multi_parts, Completion/Core/_path_files, + Completion/Core/_sep_parts, Doc/Zsh/mod_zutil.yo, + Src/Modules/zutil.c: Bartised version of zparseopts; + fix _path_files -S ''. + + * Bart: 9639: Doc/Zsh/options.yo, Doc/Zsh/redirect.yo: typos in + 9625. + + * Tanaka Akira: 9638: Completion/User/_cvs: _cvs_rtag had no + default implementation. + + * Sven: 9635: Completion/Core/_description, + Completion/Core/_files, Completion/Core/_multi_parts, + Completion/Core/_path_files, Completion/Core/_sep_parts, + Doc/Zsh/mod_zutil.yo, Src/Modules/zutil.c, Src/Modules/zutil.mdd: + improved performance for completion functions; option-parsing + builtin. + + * Akim Demaille <akim@epita.fr>: 9634: Src/builtin.c: trap '' 1 + segfaulted. + + * Sven: 9633: Src/init.c: change logic in 9591. + + * Sven: 9632: Test/05command.ztst: error spotted by improved + autoload error checking. + + * Alexandre: 9625: Src/zsh.h, Src/options.c, Src/init.c, + Src/exec.c, Doc/Zsh/redirect.yo, Doc/Zsh/options.yo: SHNULLCMD and + CSHNULLCMD options to allow better sh/csh emulation without + fiddling with parameters. + + * Sven: 9623: Completion/Core/_path_files: another version of + 9616. + + * Sven: 9621: Src/Zle/computil.c: completion incorrectly adding + space. + + * Sven: 9619: Completion/User/_texi: completion for texinfo; + added Completion/User/.distfiles by hand. + + * Sven: 9618: Src/Zle/computil.c: memory leak in caching. + + * Sven: 9616: Completion/Core/_path_files: bad test with a + pattern. + + * Sven: 9615: Completion/Builtins/_zstyle, Doc/Zsh/compsys.yo: + rename and document some styles. + + * Sven: 9614: Src/exec.c: esglob wasn't initialised properly. + + * Alexandre: 9606: Completion/Builtins/_zstyle: two missing + styles. + + * Sven: 9600: Src/exec.c: wordcode problem in execpline(). + + * Bart: 9591: Src/init.c: zsh/compctl didn't get loaded + automatically any more. + + * Geoff: 9589: Doc/Makefile.in: put back ^A's from 9584. + + * Tanaka Akira: 9585: Doc/Makefile.in: possible logic problems + with 9584. + + * Geoff: 9584: Doc/Makefile.in: sh problems with creating + modlist.yo. + + * Alexandre: 9583: Functions/Misc/nslookup: fix context name for + new scheme. + + * Sven: 9390, 9394, hunk from 9396: ./Doc/Makefile.in, + Doc/Zsh/mod_zpty.yo, Doc/Zsh/.distfiles, Functions/Misc/nslookup, + Src/Modules/.distfiles, Src/Modules/zpty.c, Src/Modules/zpty.mdd, + Src/builtin.c, Src/init.c, Src/zsh.h: zpty module. + +2000-02-05 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9579: Completion/Debian/_deb_packages: was using + bad cache variable. + +2000-02-04 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9569: Completion/Core/_main_complete, + Completion/Core/_prefix, Doc/Zsh/compsys.yo, Src/Zle/compcore.c: + new complete-prefix completer _prefix; fix suffix matching + problems. + + * Sven: 9568: Src/Zle/computil.c: fix difficulties with remaining + arguments. + + * Sven: 9562: Completion/Base/_arg_compile, + Completion/Base/_arguments, Completion/Base/_command_names, + Completion/Builtins/_hash, Completion/User/_gdb, + Completion/User/_ssh, Completion/User/_strip, Completion/X/_xrdb, + Completion/X/_xutils, Src/Zle/computil.c: failure to follow links + completing commands; bad long option handling in some cases + + * Sven: 9560 (second hunk only): Src/Zle/computil.c: more + argument fixes. + + * Sven: 9559: Doc/Zsh/compsys.yo: better documentation for `+' + argument handling. + + * Sven: 9558: Src/exec.c, Src/parse.c: trapping of autoloading + errors wasn't up to scratch. + + * Alexandre: 9557: Completion/User/_flex: problem handling + `+' argument. + +2000-02-03 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Oliver: 9547: Src/parse.c, Src/hist.c: more fixups for exporting + on AIX. + + * Sven: 9546: Completion/Base/_arguments, + Completion/Base/_combination, Completion/Base/_describe, + Completion/Base/_first, Completion/Base/_jobs, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_pids, + Completion/Builtins/_popd, Completion/Builtins/_sched, + Completion/Builtins/_signals, Completion/Builtins/_stat, + Completion/Builtins/_zftp, Completion/Builtins/_zstyle, + Completion/Commands/_complete_help, + Completion/Commands/_correct_word, + Completion/Commands/_expand_word, + Completion/Commands/_history_complete_word, + Completion/Core/_alternative, Completion/Core/_approximate, + Completion/Core/_complete, Completion/Core/_correct, + Completion/Core/_description, Completion/Core/_expand, + Completion/Core/_files, Completion/Core/_list, + Completion/Core/_main_complete, Completion/Core/_match, + Completion/Core/_menu, Completion/Core/_message, + Completion/Core/_normal, Completion/Core/_oldlist, + Completion/Core/_path_files, Completion/Core/_setup, + Completion/Core/_sort_tags, Completion/Core/_tags, + Completion/Core/compinit, Completion/Debian/_apt, + Completion/Debian/_deb_packages, Completion/User/_cvs, + Completion/User/_domains, Completion/User/_groups, + Completion/User/_hosts, Completion/User/_ports, + Completion/User/_socket, Completion/User/_urls, + Completion/User/_users, Completion/X/_x_color, Doc/Zsh/compsys.yo, + Etc/completion-style-guide, + Functions/Zle/incremental-complete-word, Functions/Zle/predict-on: + more consistent form for style contexts in completion system, + :completion:<func>:<completer>:<command>:<argument>:<tag>. + + * Sven: 9545: Src/Modules/zutil.c: don't use freed structs. + + * Tanaka Akira: 9544: Src/Modules/zutil.c: handle case for + undefined match data in zregexparse. + + * Sven: 9542: Src/Zle/complete.c: use permanently allocated memory + for copied special parameters. + + * Sven: 9541: Src/Modules/zutil.c: zstyle looks up style names + first. + +2000-02-02 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: version 3.1.6-dev-17 + + * Bart: 9533: Src/signals.c: make sure shell doesn't send itself + SIGHUP when exiting. + + * Sven: 9528: Completion/Core/_files: missing variable + initialization. + + * Sven: 9527: Doc/Zsh/compsys.yo: extra description for styles. + + * Sven: 9526: Src/Zle/computil.c: missing tokenization in + completion listing. + + * Sven: 9524: Src/text.c: wordcode bug outputting function + definitions. + + * Sven: 9522: Src/utils.c: return on various conditions when + reading a character from the terminal. + + * Sven: 9521: Src/exec.c: another job-waiting fix. + +2000-02-01 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9518: Test/.distfiles, Test/10prompt.ztst: test for prompt + escapes. + + * Clint/Sven: 9500 rewritten as 9505: Src/mem.c: more graceful exit + after mmap() failure when used for heap allocation. + + * Alexandre: 9504: Completion/Builtins/_zstyle: complete name of + packageset style. + + * Sven: 9503: Src/exec.c: problem updating job entry without any + processes. + + * Alexandre: 9502: Completion/User/_urls, + Completion/Core/compinit, Completion/Core/_menu, + Completion/Core/_match, Completion/Base/_combination: fix 9463 + to use ':completion:...' prefix with zstyle. + +2000-01-31 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9496: Src/loop.c: failure to check for return status in + for loop. + + * Bart: 9495: Src/exec.c: re-block after waiting for jobs. + + * Sven: 9494: Src/Zle/computil.c: extraneous space with option + description. + + * Bart: 9493: Test/09funcdef.ztst: regression test for function + definition. + + * Sven: 9489: Src/Zle/complist.c, Src/Zle/compresult.c: avoid menu + selection with no list and asking whether to list twice. + + * Sven: 9488: Src/exec.c: remove unnecessary child_block(). + + * Sven: 9487: Src/exec.c: wordcode fix: expand names in function + definitions. + + * Sven: 9486: Doc/Zsh/compwid.yo: fix docs for compadd -1 with -J + +2000-01-30 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9476: Completion/User/_cvs, + Completion/User/_patch: prefer LC_ALL to LANG as the former + overrides the latter. + + * Tanaka Akira: 9475: Completion/User/_telnet: simplify by using + (K) parameter flag. + + * Tanaka Akira: 9473: Completion/User/_patch: improved support for + different versions of `patch'. + + * Bart: 9472: Doc/Makefile.in: dependencies on texinfo files when + building out of source tree. + + * Tanaka Akira: 9470: Completion/Debian/_deb_packages: updage + should be update throughout. + + * Clint: 9469: Completion/Debian/_deb_packages, + Completion/Debian/_dpkg, Doc/Zsh/compsys.yo: new packageset style + to select Debian package. + +2000-01-29 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Alexandre: 1684: Completion/User/.distfiles: add _diff and + _diff_options. + + * Alexandre: 9463: Completion/User/_urls, + Completion/Core/compinit, Completion/Core/_menu, + Completion/Core/_match, Completion/Base/_combination: switch to + using zstyle instead of compstyle in various functions. + + * Sven: 9458: Src/Zle/complete.c, Src/Zle/compresult.c: used freed + memory in completion; should have been using heaps all along. + + * Sven: 9457: Src/params.c: tokenisation problem with patterns + using parameter flag (K). + + * Sven: 9454: Completion/Core/_path_files: handling path prefixes + with patterns more cleverly. + + * Sven: 9452: Completion/Base/_arguments: `--exclude=' shouldn't + show both argument list and completions of --exclude.... + + * Bart: 9448: Makefile.in: treat Test subdirectory along with + others in make procedures (notably distclean). + + * Sven: 9442: Src/Zle/compresult.c: problems with suffixes when + cursor style set. + + * Sven: 9441: Completion/Core/_files, + Completion/User/_diff_options: _files sometimes didn't use + ignored-patterns; use $(command diff) just in case, plus more + verbose descriptions. + + * Alexandre: 9436: Completion/User/_prcs, + Completion/User/_diff_options, Completion/User/_diff: prcs + enhancements with builtin diff support, plus diff options for use + directly with GNU diff. + +2000-01-25 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Etc/FAQ.yo: updated from latest posted version. + + * Sven: 9424: Src/Modules/parameter.c: problems with 9421 with + aliases and dir parameters. + +2000-01-24 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9421: Src/params.c: PM_REMOVABLE parameters are freeable + since they were created by an ordinary createparam() (fixes + memory leak). + + * Alexandre: 9419: Src/Zle/complist.c: more problems with + backreferences in list-colors: aborts after failed backref, + nested backrefs not handled. + + * Sven: 9417: Src/Zle/compcore.c: prefix code confused by matcher + specifications. + + * Sven: 9416: Completion/Core/_setup, Src/Zle/complist.c: problems + using backreferences in list-colors, check zsh/complist is loaded + if needed. + + * Sven: 9415: Doc/Zsh/mod_complist.yo: typo in pattern example. + + * Sven: 9414: Completion/Core/_path_files: use _comp_ignore. + + * Sven: 9413: Functions/Zftp/zfinit, Src/Modules/zutil.c, + Src/loop.c: cleanups for module name, new completion test, + compilation warnings. + + * Sven: 9361: Src/exec.c: simplifty getoutput() test. + +2000-01-23 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk, Src/Modules/.distfiles: 3.1.6-dev-16; + zprof.mdd, zfprof.c finally added to distribution. + +2000-01-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9408: Src/pattern.c, Doc/Zsh/expn.yo: failed + backreferences, such as (...)# matching zero times or (|(...)) + matching first part of branch now set match to null string and + indices to -1 instead of crashing the shell. + + * Clint: 9405: Makefile.in: $(DESTDIR) missing in front of + $(sitefndir). + + * Tanaka Akira: 9404: Completion/Core/_path_files: `%' missing in + parameter expansion. + +2000-01-21 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9403: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + brace problems with squeeze-slashes. + + * Sven: 9402: Completion/Builtins/_zstyle, + Completion/Core/_path_files, Doc/Zsh/compsys.yo: ignore-parents + style for more tunable path completion. + + * Sven: 9401: Src/Modules/parameter.c, Src/exec.c, Src/zsh.h: use + list-based instead of function-based system for shell function + wrappers. + + * Tanaka Akira: 9400: Completion/User/.distfiles: add _finger + + * Sven: 9399: Functions/Zftp/zfinit: bad reverse index. + + * Sven: 9398: Functions/Zftp/zfcd_match, + Functions/Zftp/zfget_match: fix _description calls + + * Sven: 9397: Functions/Zftp/zfinit: incorrect zmodload for + autoloaded builtin + + * Sven: 9396: Doc/Zsh/mod_zle.yo, Src/Zle/zle_main.c: better + retrieval of history in vared. + + * Sven: 9395: Src/exec.c, Src/parse.c, Src/text.c: problems with + ksh-format autoload and core dump due to bad termination in + function execution. + + * Sven: 9388, 9389: Completion/User/_domains: try to completion + host domains better. + +2000-01-20 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Alexandre: 9387: Doc/Zsh/compsys.yo: document brace problems + with 9383. + + * Sven: 9386: Completion/Core/_multi_parts, + Completion/Core/_sep_parts: both functions support -F option. + + * Alexandre: 9385: Completion/User/_prcs: tilde expansion in prcs + repository path. + + * Alexandre: 9383: Doc/Zsh/compsys.yo, Completion/Core/_path_files, + Completion/Builtins/_zstyle: add squeeze-slashes style not to take + multiple slashes as multiple completable directories; add + file-patterns to zstyle completion. + + * Sven: 9382: Src/Modules/parameter.c, Src/exec.c, Src/mem.c, + Src/parse.c, Src/text.c: fix problems with empty lists in wordcode + programmes and some comments. + + * Sven: 9381: Src/Zle/compresult.c: don't expand parameters quite + so often for tests. + +2000-01-19 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9373: Src/Modules/parameter.c: missing keys with special + parameters. + + * Sven: 9371: Completion/Core/_files, Completion/Core/_path_files, + Doc/Zsh/compsys.yo: file-patterns style for overriding choices for + file completion built into completion functions. + + * Sven: 9370: Src/text.c: missing tstack initialisation. + + * pws: 9367: Src/cond.c, Src/parse.c, Test/04redirect.ztst, + Test/07cond.ztst: fixes for 9332: `[' tests didn't work, skipping + conditions with `&&' and `||' didn't work, always use WC_END + marker to terminate code. + + * Tanaka Akira: 9360: Completion/User/_cvs: new -C option to cvs + update, better descriptions. + + * Tanaka Akira: 9359: Completion/Debian/_apt, + Completion/Base/_regex_arguments: argument handling for apt-cache. + +2000-01-18 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9354: Etc/MACHINES: problems reported on SPARC. + + * Sven: 9336: Src/signals.c: addition to 9332. + + * Sven: 9332: Src/Modules/example.c, Src/Modules/parameter.c, + Src/Modules/zftp.c, Src/Modules/zprof.c, Src/Zle/compcore.c, + Src/Zle/compctl.c, Src/Zle/complete.c, Src/Zle/zle_main.c, + Src/Zle/zle_misc.c, Src/builtin.c, Src/cond.c, Src/exec.c, + Src/glob.c, Src/hashtable.c, Src/init.c, Src/loop.c, Src/parse.c, + Src/signals.c, Src/text.c, Src/utils.c, Src/zsh.h: Use word code + instead of structs for passing executable chunks around. + + * Sven: 9353: Completion/Base/_jobs: bad prefix test + + * Sven: 9348: Src/Modules/zutil.c: various minor regex fixes + + * Sven: 9345: Src/exec.c, Src/jobs.c, Src/zsh.h: + bug with job control when group leader exits; other problems + with subshells. + + * Alexandre: 9340: Src/Zle/computil.c: bug with adding `=' after + options. + + * Sven: 9335: Completion/Core/_path_files: fix special-dirs style. + +2000-01-17 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Clint: 9333: Completion/User/_a2ps: a2ps can take PostScript + input files. + + * Johan Sundström: 9331: Doc/Zsh/compwid.yo: typo. + + * Sven: 9330: Src/mem.c: debugging message not needed when using + mmap(). + + * Sven: 9329: Src/Modules/parameter.c, Src/Zle/complete.c, + Src/Zle/zleparameter.c, Src/glob.c, Src/mem.c: memory management + fixes for hashtables and heaps. + +2000-01-16 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9328: Completion/User/_finger, + Completion/User/_other_accounts: new finger completion. + .distfiles also updated. + +2000-01-15 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9325: Src/init.c: misspelled SITEFPATH_DIR + + * Alexandre: 9324: Completion/User/_tar_archive: .tgz completion + didn't work. + +2000-01-14 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9322: INSTALL, Makefile.in, configure.in, + Config/defs.mk.in, Config/funcinst.mk, Config/installfns.sh, + Config/uninstallfns.sh, Src/init.c, Src/zsh.mdd: install.fns + creates site-functions, parallel to /usr/share/zsh/3.1.6-dev-15 + or wherever; no functions.old directory saved or used; functions + directory is version-specific anyway, so just delete old one. + + * Sven: 9318: Src/exec.c, Src/init.c, Src/zsh.h: cases where we + don't need to make up the job text. + + * Tanaka Akira: 9317: Completion/User/_urls: don't quote bookmarks + when inserted. + + * Tanaka Akira: 9316: Completion/User/_cvs: detects zsh/stat + module more carefully. + + * Sven: 9315: Src/module.c: bad error status when using zmodload + in static shell. + + * Tanaka Akira: 9311: Completion/Builtins/_zmodload, + Doc/Makefile.in, Test/.distfiles: missing stuff in 3.1.6-dev-15: + unused parameter in _zmodload, deleting too many files with clean + in Doc, 08traps.ztst wasn't in distribution list. + +2000-01-13 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9309: Completion/Core/_path_files, + Completion/Builtins/_zstyle: fixes for 9298: test for non-zero + $FIGNORE, zstyle completion for ignored-patterns. + + * Sven: 9306: Doc/Zsh/mod_zle.yo, Src/Zle/zle_thingy.c: allow + permanent (until next return) message with zle -M. + + * Sven: 9305: Src/Zle/compcore.c: sometimes failed to switch to + alternate match set. + +2000-01-12 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: 3.1.6-dev-15. + + * pws: 9301: configure.in: use quoted '${VERSION}' in function + directory to be determined at compile time, avoids having to + re-make config.status. + + * Sven: 9298: Completion/Core/_description, + Completion/Core/_main_complete, Completion/Core/_path_files, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, Src/Zle/compcore.c: + ignored-suffixes becomes ignored-patterns for more general + ignorance. + + * Sven: 9297: Completion/Core/_alternative: typo. + + * Sven: 9296: Src/Zle/compmatch.c: matcher ignores backslashes by + default. + +2000-01-11 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9295: Doc/Zsh/grammar.yo, Src/loop.c, + Src/Modules/parameter.c: problem with aliased options with + negative number when retrieving $options; bad test for use of + terminal with `select'; defective description of tests for + alternative forms using if ... { ... } etc. + + * Sven: 9291: Completion/Core/_main_complete: insufficient care + with ksharrays affected _cd completion. + + * Sven: 9287: Src/exec.c: unbalanced use of heaps. + +2000-01-10 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Sven: 9283: Src/mem.c: hrealloc() problem with mmap(). + + * Tanaka Akira: 9281, 9282: Completion/Builtins/_popd: too eager + to insert slash suffix. + +2000-01-09 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9280: Src/subst.c: failed to copy parameter properly using + ${(P)...} flag. + + * pws: 9279: Src/mem.c: use munmap() instead of zfree() for + one more heap reference. + + * pws: 9278: Completion/Core/_path_files: overenthusiastic use of + $fignore on explicitly globbed files. + + * Tanaka Akira: 9274: Completion/X/_xutils: completing options of + X commands didn't work. + + * Tanaka Akira: 9273: Completion/User/_cvs: various tweaks. + + * Bart: 9272: Src/Aliases/alias.mdd.in: file missed in 9253. + + * Bart: 9270: Doc/Zsh/.cvsignore, Doc/Zsh/.distfiles, + Doc/Makefile.in: Doc/Zsh/manmodmenu.yo is a generated file. + +2000-01-08 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9269: Completion/User/_pack: bogus space in _pack. + +2000-01-07 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9267: Src/signals.c, Test/08traps.ztst, Test/50cd.ztst, + Test/ztst.zsh: fix remaining(?) trap issues by simplifying + save/restore code; add tests for traps (with unpleasantness + testing trap triggering). + + * pws: 9266: configure.in, INSTALL: move $ZSH_VERSION to before + functions, to allow other zsh versioned stuff to be collected. + + * Sven: 9264 (minus `make clean' hunk): ./Doc/Makefile.in, + Doc/Zsh/manual.yo: remove yodl comments to avoid makeinfo + problems. + + * Sven: 9263: Completion/Builtins/_zmodload, + Completion/Core/_files, Completion/Core/_path_files: _path_files + handles (:r) modifier; _files handles -/g; _zmodload handles + hierarchical modules. + + * Sven: 9262: Completion/Builtins/_hash, Completion/Linux/_rpm, + Completion/User/_dd, Completion/User/_gs, Completion/User/_make: + 9260 add-on for various uses of compset. + + * Sven: 9261: Completion/User/_a2ps: missing backslash. + + * Sven: 9260: Completion/Core/_main_complete: completion after `='. + +2000-01-06 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9256: configure.in, INSTALL: add $ZSH_VERSION to default + function install path. + + * Oliver: 9253: Src/Aliases/cap.mdd, Src/Aliases/clone.mdd, + Src/Aliases/compctl.mdd, Src/Aliases/complete.mdd, + Src/Aliases/complist.mdd, Src/Aliases/computil.mdd, + Src/Aliases/deltochar.mdd, Src/Aliases/example.mdd, + Src/Aliases/files.mdd, Src/Aliases/mapfile.mdd, + Src/Aliases/mathfunc.mdd, Src/Aliases/parameter.mdd, + Src/Aliases/rlimits.mdd, Src/Aliases/sched.mdd, + Src/Aliases/stat.mdd, Src/Aliases/zftp.mdd, Src/Aliases/zle.mdd, + Src/Aliases/zleparameter.mdd, Src/Aliases/zutil.mdd, + Src/linklist.c, Src/mkmakemod.sh, Src/params.c, Src/utils.c: more + fixes for dynamical linking on AIX. + + * Tanaka Akira: 9252: Completion/User/_lp: typo in 9242. + + * Sven: 9250: Src/Zle/complete.c: extend 9237 for compset. + + * Sven: 9248: Completion/Core/_tags, Doc/Zsh/compsys.yo: simplify + undoability of 9245 and suchlike by making `!tag' valid in + tag-order style. + + * Sven: 9245: Completion/Base/_command_names, + Completion/Base/_parameter: complete parameters in command + position (now undoable using styles). + + * Sven: 9244: Completion/Builtins/_zstyle: partial word completion + for style names. + + * Sven: 9242: Completion/User/_lp: better completion of printer + names. + + * Alexandre: 9240: Completion/User/_urls: handle URLs from + bookmarks with spaces by quoting. + + * Sven: 9237: Doc/Zsh/compwid.yo, Src/Zle/compcore.c: fix literal + handling of completion prefix/suffix. + + * Sven: 9236: Src/Zle/compresult.c, Src/Zle/zle_misc.c: + listmatches called with bogus list, plus extra paranoia. + + * Tanaka Akira: 9235: Test/07cond.ztst: chgrp to workaround + inherited groups. + + * Tanaka Akira: 9228: Completion/Builtins/_popd: probllem listing + directories. + + * Tanaka Akira: 9227: Test/04redirect.ztst: problem with .nfs* + files remaining when deleting directory. + + * Tanaka Akira: 9226: Completion/User/_lp: explanation typo. + + * Tanaka Akira: 9225: Completion/Core/_path_files, + Doc/Zsh/compsys.yo: file completion in root directory. + +2000-01-05 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: zsh-3.1.6-dev-14 (note change of + string). + + * Sven: 9219: Functions/Zle/predict-on: zstyle typo. + + * Sven: 9217: Completion/User/_lp, Doc/Zsh/compsys.yo: additions + to foregoing. + + * Sven: zsh-users/2830: Completion/User/.distfiles, + Completion/User/_lp, Completion/User/_ps: completion for printer + commands. + + * Alexandre: 9216: Src/Zle/computil.c, Completion/User/.distfiles, + Completion/User/_prcs: Don't skip too many characters at start of + option; completion for prcs revision control. + +2000-01-04 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9212: Src/zsh.h, Src/Zle/zle_main.c, Src/Zle/zle_hist.c: + make cleaner use of flags to zleread(). + + * pws: 9209: Src/Makefile.in, Src/Makemod.in.in, Doc/Makefile.in: + rearrange 9181 to better order. + + * Tanaka Akira: 9206 (+ tweaks): Src/zsh.h: use __attribute__ + to get alignment for struct heap for gcc. + + * Gene Cohler: 9200: Src/module.c: fix for dynamic linking on + latest HP-UX 11 systems. + + * Sven: 9199: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + allow sorting with sort style for files. + + * Sven: 9198: Completion/Base/_arguments, Completion/Base/_values, + Completion/Core/_alternative: avoid mangling spaces with evals. + + * Sven: 9197: Completion/Core/_multi_parts, + Completion/Core/_path_files, Completion/Core/_sep_parts: + tweak approximation for file completion etc. + + * Sven: 9195: Src/Zle/compcore.c: PS to 9189. + + * Sven: 9193: Completion/Builtins/_zstyle: fix typos etc. + + * Sven: 9191: Completion/Base/_default, + Completion/Core/_description, Completion/Core/_path_files, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, Src/Zle/complete.c: + style control of matcher specification. + + * Sven: 9190: Completion/Core/compinit: tweak default completion + styles. + + * Sven: 2826: Completion/Commands/_complete_help: help is more + helpful about what functions completion is in. + + * Sven: 9189: Src/Zle/compcore.c: problem with not recognizing + prefix lengths when adding matches from patterns. + + * Sven: 9188: Src/loop.c: repeat with a negative count. + + * Sven: 9187: Src/Zle/computil.c: bug with :*pat: patterns + in styles. + + * Helmut: 9186: Src/zsh.h: heaps struct was no longer properly + aligned. + +2000-01-02 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9181: Src/Makefile.in, Src/Makemod.in.in, Doc/Makefile.in: + add .PHONY targets to prevent GNU make creating them sometimes. + +2000-01-01 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9174: Test/ztst.zsh: missing `$'. + + * Geoff: 9173: Completion/User/_tar: bogus `}'. + + * Tanaka Akira: 9170: Completion/Builtins/_unhash, + Completion/User/_mutt: typos. + + * Geoff: 9169: Completion/Builtins/_stat: bogus `fi'. + +1999-12-29 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9166: Completion/Builtins/_zstyle, + Doc/Zsh/compsys.yo, Doc/Zsh/mod_zutil.yo: remove unnecessary + cache-path tag. + + * Clint: 9165: Completion/Debian/_dpkg: dpkg improvement. + + * Tanaka Akira: 9164: Test/01grammar.ztst: use zsh instead of sh + to check - modifier. + + * Tanaka Akira: 9163: Test/ztst.zsh: use absolute path for test + directory. + +1999-12-28 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9162: Completion/Base/_regex_arguments, + Src/Modules/zutil.c: rename regexparse to zregexparse. + + * Tanaka Akira: 9161: Completion/Debian/_apt, + Completion/Debian/_deb_packages: improved 9160. + + * Clint: 9160: Completion/Debian/_deb_packages: handle -J option. + + * Vin Shelton: 9159: Test/Makefile.in, Test/ztst.zsh, + Test/07cond.ztst: fix testing when source and build tree are + separate. + + * Tanaka Akira: 9158: Src/Modules/zutil.mdd: fix module + dependencies (showed up only in static linking). + + * Tanaka Akira: 9154, 9156: Completion/Base/_regex_arguments, + Src/Modules/zutil.c: re-implement parsing for _regex_arguments in + C. + +1999-12-23 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: zsh-3.1.6-pws-13. + + * Zefram: 9143: Util/mkdisttree.sh: same find change here. + + * Andrej: 9142: Util/preconfig: work around probably find bug + + * Alexandre: 9139: Functions/Zftp/zftp_chpwd, Etc/FAQ.yo: + kterm understands xterm sequences. + + * pws: 9150: Completion/Builtins/.distfiles, + Completion/Builtins/_zstyle, Test/.distfiles: added _zstyle + for zstyle completion, also some missed .distfiles entries + for 9129. + + * pws: 9149: Completion/Builtins/_cd, Completion/Core/_path_files: + _cd wouldn't complete in $cdpath and _path_files messed up + array entries with spaces. + +1999-12-22 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Tanaka Akira: 9138: Util/preconfig: problem with pattern + matching `.' in find. + + * Tanaka Akira: 9137: Test/07cond.ztst: compatibility fixes for + tests in 9129. + + * Clint: 9136: Completion/Debian/_dpkg: handle dpkg-deb options. + + * Zefram: 9134: Src/Makefile.in, Src/mkbltnmlst.sh, + Src/xmods.conf, Src/zsh.mdd: aliased libraries with static + linking. + +1999-12-21 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 9129: Src/math.c, Test/04redirect.ztst, + Test/05command.ztst, Test/06arith.ztst, Test/07cond.ztst, + Test/ztst.zsh: fix bug with `(( 4 : 3 ))'; some more tests + for shell basics. + +1999-12-20 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Clint: 9121: Functions/Zftp/zfdir: some idiot messed up + selection of pager. + + * Zefram: 9120: .distfiles, .preconfig, INSTALL, Util/.distfiles, + Util/preconfig: better pre-configuration support. + + * Zefram: 9119: Doc/Zsh/intro.yo: zshzftpsys manual omitted. + + * Zefram: 9118: Doc/Makefile.in, Doc/Zsh/builtins.yo, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, Doc/Zsh/mod_cap.yo, + Doc/Zsh/mod_clone.yo, Doc/Zsh/mod_compctl.yo, + Doc/Zsh/mod_complete.yo, Doc/Zsh/mod_complist.yo, + Doc/Zsh/mod_computil.yo, Doc/Zsh/mod_deltochar.yo, + Doc/Zsh/mod_example.yo, Doc/Zsh/mod_files.yo, + Doc/Zsh/mod_mapfile.yo, Doc/Zsh/mod_mathfunc.yo, + Doc/Zsh/mod_parameter.yo, Doc/Zsh/mod_sched.yo, + Doc/Zsh/mod_stat.yo, Doc/Zsh/mod_zftp.yo, Doc/Zsh/mod_zle.yo, + Doc/Zsh/mod_zleparameter.yo, Doc/Zsh/mod_zprof.yo, + Doc/Zsh/mod_zutil.yo, Doc/Zsh/params.yo, Doc/Zsh/zftpsys.yo, + Doc/Zsh/zle.yo: proper names for info files. + + * Zefram: 9117: Src/mkmakemod.sh: remove unnecessary blanks. + + * Adam: 9109: Completion/User/_hosts: globsubst problem. + + * Sven: 9107: Completion/Core/compinit: fix SELECTMIN. + + * Zefram: 9105: Src/mkbltnmlst.sh: non-existent module problems. + + * Sven: 9099: Src/mem.c, Src/zsh.h: heap memory uses mmap() + as long as MAP_ANONYMOUS is available. + + * Sven: 9098: Src/lex.c: double input buffer with inbufct as + maximum when more memory required. + + * pws: 9123: Src/Modules/mathfunc.c, Doc/Zsh/mod_mathfunc.yo: + removed drem() as not present on Solaris. + + * Clint: 9094: Completion/User/_tar: handle -Cf. + + * Clint: 9093: Completion/User/_tar_archive: bzip2 support + + * Oliver: 9088: Completion/Core/_description: failed to sort + listings numerically. + + * Oliver: 9087: Src/module.c, Src/Modules/zutil.mdd: more + dependency problems with .export files. + + * Sven: 9086: ./Doc/Makefile.in, Doc/Zsh/.distfiles, + Doc/Zsh/mod_zprof.yo: zprof doc. + + * Sven: 9085: Doc/Zsh/compsys.yo: :completion missing, default tag + doc. + + * Zefram: 9084: Src/Aliases/.cvsignore, Src/Aliases/.distfiles, + Src/Aliases/.exrc, Src/Aliases/.preconfig, Src/Aliases/alias.c.in, + Src/Aliases/alias.mdd.in, Src/xmods.conf: alias old modules to new + hierarchical names, zle -> zsh/zle etc. + + * Zefram: 9083: Completion/User/_cvs, Doc/Makefile.in, + Doc/Zsh/builtins.yo, Doc/Zsh/mod_cap.yo, Doc/Zsh/mod_clone.yo, + Doc/Zsh/mod_compctl.yo, Doc/Zsh/mod_complete.yo, + Doc/Zsh/mod_complist.yo, , Doc/Zsh/mod_computil.yo, + Doc/Zsh/mod_deltochar.yo, Doc/Zsh/mod_example.yo, + Doc/Zsh/mod_files.yo, Doc/Zsh/mod_mapfile.yo, + Doc/Zsh/mod_mathfunc.yo, Doc/Zsh/mod_parameter.yo, + Doc/Zsh/mod_sched.yo, Doc/Zsh/mod_stat.yo, Doc/Zsh/mod_zftp.yo, + Doc/Zsh/mod_zle.yo, Doc/Zsh/mod_zleparameter.yo, + Doc/Zsh/mod_zutil.yo, Doc/Zsh/modules.yo, Doc/Zsh/options.yo, + Doc/Zsh/restricted.yo, Doc/Zsh/zftpsys.yo, + Etc/zsh-development-guide, Functions/Misc/zls, + Functions/Zftp/zfinit, Src/Builtins/rlimits.c, + Src/Builtins/rlimits.mdd, Src/Builtins/sched.c, + Src/Builtins/sched.mdd, Src/Makemod.in.in, Src/Modules/cap.c, + Src/Modules/cap.mdd, Src/Modules/clone.c, Src/Modules/clone.mdd, + Src/Modules/example.c, Src/Modules/example.mdd, + Src/Modules/files.c, Src/Modules/files.mdd, Src/Modules/mapfile.c, + Src/Modules/mapfile.mdd, Src/Modules/mathfunc.c, + Src/Modules/mathfunc.mdd, Src/Modules/parameter.c, + Src/Modules/parameter.mdd, Src/Modules/stat.c, + Src/Modules/stat.mdd, Src/Modules/zftp.c, Src/Modules/zftp.mdd, + Src/Modules/zutil.c, Src/Modules/zutil.mdd, Src/Zle/compctl.c, + Src/Zle/compctl.mdd, Src/Zle/complete.c, Src/Zle/complete.mdd, + Src/Zle/complist.c, Src/Zle/complist.mdd, Src/Zle/computil.c, + Src/Zle/computil.mdd, Src/Zle/deltochar.c, Src/Zle/deltochar.mdd, + Src/Zle/zle.mdd, Src/Zle/zle_main.c, Src/Zle/zle_thingy.c, + Src/Zle/zleparameter.c, Src/Zle/zleparameter.mdd, Src/init.c, + Src/makepro.awk, Src/mkbltnmlst.sh, Src/mkmakemod.sh, + Src/mkmodindex.sh, Src/module.c, Src/xmods.conf, Src/zsh.mdd, + Test/ztst.zsh, configure.in, Src/Modules/zprof.c, + Src/Modules/zprof.mdd: Improved hierarchical naming scheme for + modules. + + * Sven: 9019: Src/Modules/zprof.c, Src/Modules/zprof.mdd: + profiling module, documentation to follow. + + * Zefram: 9081: Src/Modules/parameter.mdd: make sure parameter + jobdirs autoloads parameter module. + + * Sven: 9079: Src/exec.c, Src/lex.c: memory allocation for token + strings and input lines changed; autoloading didn't free source + code; more pushing and popping of heaps; saves ca. 800KB with + completion loaded. + + * Sven: 9078: Completion/Commands/.distfile, + Completion/Commands/_verbose_list: _verbose_list is not needed any + more. + + * Sven: 9077: Src/Zle/compresult.c, Src/Zle/computil.c, + Src/Zle/zle_main.c, Src/Zle/zle_tricky.c, Src/pattern.c: + `unitialised' warnings and unnecessary function. + + * Sven: 9076: Src/Zle/compcore.c: better handling of globbing and + approximation together. + + * Sven: 9075: Completion/Core/compinit: use ZLS_COLORS for style + defaults. + + * Sven: 9074: Functions/Zle/predict-on: tidier 9064 + +1999-12-15 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: version 3.1.6-pws-12. + + * pws: 9067: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfanon, + Functions/Zftp/zfcd, Functions/Zftp/zfcget, + Functions/Zftp/zfclose, Functions/Zftp/zfcput, + Functions/Zftp/zfdir, Functions/Zftp/zfgcp, Functions/Zftp/zfget, + Functions/Zftp/zfgoto, Functions/Zftp/zfhere, + Functions/Zftp/zfinit, Functions/Zftp/zfls, Functions/Zftp/zfmark, + Functions/Zftp/zfopen, Functions/Zftp/zfparams, + Functions/Zftp/zfpcp, Functions/Zftp/zfput, + Functions/Zftp/zfsession, Functions/Zftp/zfstat, + Functions/Zftp/zftp_chpwd, Functions/Zftp/zftp_progress, + Functions/Zftp/zftransfer, Functions/Zftp/zftype, + Functions/Zftp/zfuget, Functions/Zftp/zfuput: use _patcomps in + zfinit differently due to 9035; zfput -r does recursive put; + use styles instead of zfconfig entries; new styles titlebar + and chpwd. + + * Clint: 9065: Src/builtin.c: change order of tests in 9028. + + * Bart: 9064: Functions/Zle/predict-on: shouldn't use _style any + more. + + * Sven: 9058: Completion/Base/_arguments, + Completion/Base/_combination, Completion/Base/_command_names, + Completion/Base/_jobs, Completion/Base/_tilde, + Completion/Builtins/_cd, Completion/Builtins/_kill, + Completion/Builtins/_stat, Completion/Builtins/_wait, + Completion/Core/_path_files, Completion/Core/_sort_tags, + Completion/Core/_tags, Completion/Core/compinit, + Doc/Zsh/compsys.yo, Src/Makemod.in: Many small cleanups, plus + change sort-tags to tag-order and add to syntax a bit. + + * Tanaka Akira: 9054: Test/50cd.ztst: get PWD without symlinks, to + avoid messing up cd tests. + +1999-12-14 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Oliver: 9047: Src/Zle/compcore.c, Src/Zle/compresult.c, + Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, Src/mkmakemod.sh: + hack .export files to be made in time for use. + + * Sven: 9039: Doc/Zsh/mod_compctl.yo: description change. + + * Sven: 9035: Completion/Core/_main_complete, + Completion/Core/_normal, Completion/Core/compdump, + Completion/Core/compinit: more small optimisations: _patcomps, + postpatcomps are assocs; avoid post-processing in _main_complete; + fix command name in _normal. + + * Sven: 9031: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + complete .. only for special-dirs. + + * Clint: 9028: Src/builtin.c: hack to be able to change to + subdirectories even when the current directory is renamed. + Hopefully to be replaced by something more elegant eventually. + + * pws: 9048: Completion/Core/_sort_tags, Completion/Core/compinit, + Completion/User/_mh, Doc/Zsh/compsys.yo, + Functions/Zle/incremental-complete-word: assorted completion + fixes, documentation improvement, plus sort-tags style. + +1999-12-13 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Zefram: 9023: Doc/Makefile.in, Doc/Zsh/.cvsignore, + Doc/Zsh/.distfiles, Doc/Zsh/manual.yo, Doc/Zsh/mod_cap.yo, + Doc/Zsh/mod_clone.yo, Doc/Zsh/mod_compctl.yo, + Doc/Zsh/mod_complete.yo, Doc/Zsh/mod_complist.yo, + Doc/Zsh/mod_computil.yo, Doc/Zsh/mod_deltochar.yo, + Doc/Zsh/mod_example.yo, Doc/Zsh/mod_files.yo, + Doc/Zsh/mod_mapfile.yo, Doc/Zsh/mod_mathfunc.yo, + Doc/Zsh/mod_parameter.yo, Doc/Zsh/mod_sched.yo, + Doc/Zsh/mod_stat.yo, Doc/Zsh/mod_zftp.yo, Doc/Zsh/mod_zle.yo, + Doc/Zsh/mod_zleparameter.yo, Doc/Zsh/mod_zutil.yo, + Doc/Zsh/modules.yo: generate module documentation automatically + from a single list in the makefile. + + * Sven: 9020: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + special-dirs style allows completion of . and .. + + * Sven: 9018: Completion/Builtins/_pids, + Completion/Core/_path_files, Completion/User/_cvs, + Completion/User/_pbm: completion optimisations. + + * Zefram: 9013: patching file Doc/Zsh/mod_files.yo, + Src/Modules/files.c: use . as alternative to : for user and group + separator. + + * Sven: 2776: Completion/Core/_path_files: handling of . and .. in + path. + + * Felix: 1 chunk of 9008: Doc/Zsh/mod_parameter.yo: docs for $jobdirs. + + * Felix: (most of) 9007: Src/Modules/parameter.c, + Src/modules/parameter.mdd, mod_parameter.yo: jobdirs special assoc + array. + + * Bart: 9005: Src/exec.c: problem backgrounding shell script. + + * Tanaka Akira: 9004: Test/Makefile.in: run tests with zsh -f. + + * pws: 9024: Etc/zsh-development-guide, Test/.distfiles, + Test/01grammar.ztst, Test/02alias.ztst, Test/03quoting.ztst, + Test/50cd.ztst, Test/cd.ztst, Test/ztst.zsh: new tests for basic + shell stuff. + +1999-12-10 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: 8997: Src/builtin.c, Src/exec.c, Src/params.c: exported + values respect upper-/lowercase flags at the point at which they + are set. + + * Alexandre: 8994: Functions/Zftp/zftp_chpwd, Etc/FAQ.yo, + Doc/Zsh/zftpsys.yo: extend 8993. + + * Clint: 8993: Functions/Zftp/zftp_chpwd: titlebar support in more + general xterm-like emulators. + + * Sven: 8992: Completion/Base/_arguments, + Completion/Base/_combination, Completion/Base/_describe, + Completion/Base/_first, Completion/Base/_jobs, + Completion/Base/_regex_arguments, Completion/Base/_subscript, + Completion/Base/_tilde, Completion/Builtins/_pids, + Completion/Builtins/_popd, Completion/Builtins/_sched, + Completion/Builtins/_signals, Completion/Builtins/_stat, + Completion/Commands/_history_complete_word, + Completion/Core/_approximate, Completion/Core/_description, + Completion/Core/_expand, Completion/Core/_list, + Completion/Core/_main_complete, Completion/Core/_match, + Completion/Core/_message, Completion/Core/_oldlist, + Completion/Core/_path_files, Completion/Core/_requested, + Completion/Core/_setup, Completion/Core/_tags, + Completion/Core/compinit, Completion/Debian/_apt, + Completion/User/_cvs, Completion/User/_groups, + Completion/User/_hosts, Completion/User/_ports, + Completion/User/_socket, Completion/User/_urls, + Completion/User/_users, Completion/X/_x_color, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_clone.yo, Doc/Zsh/mod_complete.yo, + Doc/Zsh/mod_computil.yo, Doc/Zsh/mod_zutil.yo, Doc/Zsh/modules.yo, + Etc/completion-style-guide, + Functions/Zle/incremental-complete-word, Src/Modules/zutil.c, + Src/Modules/zutil.mdd, Src/Zle/complist.c, Src/Zle/computil.c, + Src/Zle/computil.mdd, Src/xmods.conf: compstyle is now + implemented in terms of the new zstyle and zformat commands in + the new zutil module. + + * Tanaka Akira: 8990: Completion/User/_ports, + Completion/User/_socket: completion after `socket hosts'. + +1999-12-09 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Zefram: 8982: Doc/Zsh/mod_files.yo, Src/Modules/files.c, + Src/Modules/files.mdd, Src/system.h, configure.in: chown and + chgrp are implemented as builtins in the files module. + + * Sven: 8981: Src/Zle/complist.c: don't use old list with + accept-and-infer-next-history's completion form. + + * Andrej: 8973: Completion/User/_sudo: revised version. + + * Zefram: 8968: Config/config.mk: dependencies for rebuilding + defs.mk from defs.mk.in. + + * Zefram: 8966: Config/defs.mk.in, Doc/Makefile.in, Makefile.in: + proper install.html. + + * Sven: 8965: Completion/Core/_description, + Completion/Core/_files, Completion/Core/_main_complete, + Completion/Core/_multi_parts, Completion/Core/_path_files, + Completion/Core/_sep_parts, Doc/Zsh/compsys.yo, + Etc/completion-style-guide: doc cleanup and tweak some option + passing. + + * Tanaka Akira: 8962: cd to test directory before removing + temporaries. + + * Tanaka Akira: 8957: Completion/User/.distfiles, Src/Makefile.in: + _sudo missed out of 3.1.6-pws-11, and Src/Makefile.in didn't + get patched properly. + +1999-12-08 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Config/version.mk: version 3.1.6-pws-11. + + * pws: 8955: Src/Modules/zftp.c: command name buffer wasn't large + enough for "zftp session". + + * pws: 8954: Makefile.in, Etc/zsh-development-guide, Test/Makefile.in: + targets for testing should be `check' and `test', which are there + already. + + * Zefram: 8952: Util/mkdisttree.sh: portability and error handling + improvements. + + * Zefram: 8950: Config/defs.mk.in, Doc/.cvsignore, Doc/.distfiles, + Doc/Makefile.in, Makefile.in, Src/Makefile.in: revised name + transformation: nothing in the build tree and everything out of + it is transformed; also fix make portability problems. + + * Zefram: 8946: Makefile.in: distclean in Test; old stamp-h.in + creation bug. + + * Sven: 8945: Doc/Zsh/mod_complist.yo, Src/Zle/compcore.c, + Src/Zle/complist.c: `mu'ltiple is now `du'plicate. + + * Sven: 8944: Completion/Core/_main_complete, + Completion/Core/_setup, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_complist.yo: more detailed choices for when to use + menu completion via menu style. One mod_complist.yo hunk + omitted due to clash with 8942. + + * Bart: 8942: Doc/Zsh/mod_complist.yo: completion doc fixes. + + * Sven: 8939: Doc/Zsh/mod_complist.yo, Src/Zle/comp.h, + Src/Zle/compcore.c, Src/Zle/complist.c, Src/Zle/compresult.c: + menu selection with hidden entries. + +1999-12-07 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Clint: 8933: Doc/Makefile.in: make man pages refer to one + another when transforming file name. + + * Sven: 8932: Src/Zle/computil.c, Src/Zle/zle_tricky.c, + Functions/Zle/incremental-complete-word, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_computil.yo, Completion/Core/_approximate, + Completion/Core/_description, Completion/Core/_expand, + Completion/Core/_message, Completion/Core/_tags: + More standard styles used in _expand and _approximate; + hidden style can apply to any tag; _description does + more printf-type formatting and tests a `format' tag. + + * Clint: 8931: Doc/Makefile.in: sed portability. + + * pws: 8936: configure.in, Etc/zsh-development-guide, + Test/Makefile.in, Test/cd.ztst, Test/ztst.zsh (plus + unposted Test/.cvsignore and Test/.distfiles): basis for + new testing system. + + * Sven: 8930: Completion/Core/_setup, Doc/Zsh/compsys.yo: + _setup gets one argument and has doc. + +1999-12-06 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Bart: 8923: aczsh.m4, configure.in: configuration for + program_transform_name. + + * Bart: 8917: Doc/Makefile.in: better transforming for installed + filenames. + + * Clint: 8915: Doc/Makefile.in: more name transformation stuff + for manual names. + + * Sven: 8911: Src/Zle/comp.h, Src/Zle/compcore.c, + Src/Zle/complete.c, Src/Zle/compresult.c, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/params.yo, + Completion/Commands/_complete_help, + Completion/Core/_approximate, Completion/Core/_expand, + Completion/Core/_list, Completion/Core/_main_complete, + Completion/Core/_message, Completion/Core/_setup, + Completion/Core/_style: added some completion styles and + some compstate keys. + + * Sven: 8910: Src/Modules/parameter.c, Src/builtin.c, Src/exec.c, + Src/module.c: don't try to unload modules when shell exits + normally; fix bug with parameter module that old parameters + didn't get removed properly. + + * Sven: 8906: Completion/Core/_path_files: trailing / in vars with + _path_files -W varname now optional. + + * Bart: 8903, 8904, 8905: Makefile.in, configure.in, Doc/.cvsignore, + Doc/.distfiles, Doc/Makefile.in, Src/Makefile.in: More + consistent renaming when altering programme name. + + * Adam: 8902: Completion/Commands/_history_complete_word: + directions broken. + +1999-12-05 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Andrej/Sven/Clint: 8892: Completion/User/_sudo: completion + for sudo. + +1999-12-03 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: unposted: Completion/User/.distfiles, + Completion/Core/.distfiles: add _zdump and _setup. + + * Clint: 8889: Completion/User/_zdump: completion for zdump. + + * Clint: 8879: configure.in: fix some sub-makes in configure.in. + + * Sven: 8876, 8883: Completion/Core/_approximate, + Completion/Core/_expand, Completion/Core/_setup, + Doc/Zsh/compsys.yo: better grouping support in _expand and + _approximate using _setup. + + * Sven: 8874: Completion/Base/_arguments, Completion/User/_use_lo: + fix with _arguments --. + + * Sven: 8869: Completion/Builtins/_cd, Doc/Zsh/compsys.yo: + local-directories and path-directories tags for cd completion. + + * Sven: 8868: Src/Zle/complist.c: better memory of which colour + was just used. + + * Sven: 8864: Completion/Core/_description, + Completion/Core/_files, Completion/Core/_main_complete, + Completion/Core/compinit, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/mod_complist.yo, Src/Zle/computil.c: + list-colors style sets up ZLS_COLO[U]RS appropriately. + + * Clint: 8863: Makefile.in, configure.in, Doc/Makefile.in, + Src/Makefile.in: only calculate basename of renamed zsh once. + + * Clint: 8862: Src/builtin.c: fix problem failing to unload zle + with abrupt shell termination. + + * Bart: 8860: Doc/Makefile.in: fix zsh.info build with 8857. + + * Bart: 8857: Doc/Makefile.in: fix zsh.yo.in reference when + source and build trees are separate. + + * Sven: 8852: Src/Zle/complist.c, Src/pattern.c, + Doc/Zsh/mod_complist.yo: whacky colouring of different parts + of listing strings. + + * Sven: 8851: Src/Zle/compcore.c, Src/Zle/complist.c, + Doc/Zsh/mod_complist.yo: grouping possible in ZLS_COLO[U]RS + + * Zefram: 8843: Etc/zsh-development-guide, Src/.cvsignore, + Src/.distfiles, Src/Builtins/.cvsignore, Src/Makefile.in, + Src/Makemod.in.in, Src/Modules/.cvsignore, + Src/Zle/.cvsignore, Src/Zle/.distfiles, + Src/Zle/compcore.c, Src/Zle/complete.c, + Src/Zle/complete.mdd, Src/Zle/compmatch.c, + Src/Zle/compresult.c, Src/Zle/zle.mdd, + Src/Zle/zle_bindings.c, Src/Zle/zle_keymap.c, + Src/Zle/zle_main.c, Src/Zle/zle_misc.c, + Src/Zle/zle_params.c, Src/Zle/zle_refresh.c, + Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, + Src/Zle/zle_utils.c, Src/builtin.c, Src/compat.c, + Src/cond.c, Src/exec.c, Src/glob.c, Src/hashtable.c, + Src/hist.c, Src/init.c, Src/input.c, Src/jobs.c, + Src/lex.c, Src/linklist.c, Src/loop.c, Src/makepro.awk, + Src/math.c, Src/mem.c, Src/mkmakemod.sh, Src/module.c, + Src/options.c, Src/params.c, Src/parse.c, Src/pattern.c, + Src/prompt.c, Src/signals.c, Src/signames2.awk, + Src/subst.c, Src/text.c, Src/utils.c, Src/zsh.h: + use mod_export keyword to generate symbols in .export + files automatically. + + * Clint: 8842: Completion/Debian/_dupload, + Completion/Debian/.distfiles: completion for dupload. + + * Clint: 8841: Doc/zsh.yo.in: patch to 8827. + + * Sven: 8840: Src/Zle/compcore.c, Doc/Zsh/compsys.yo, + Etc/completion-style-guide, Completion/Base/_arguments, + Completion/Base/_brace_parameter, Completion/Base/_describe, + Completion/Base/_first, Completion/Base/_jobs, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_popd, + Completion/Commands/_history_complete_word, + Completion/Core/_alternative, Completion/Core/_description, + Completion/Core/_files, Completion/Core/_parameters, + Completion/Core/_path_files, Completion/Core/_requested, + Completion/Core/_tags, Completion/Core/_wanted, + Completion/Core/compinit, Completion/Debian/_apt, + Completion/Linux/_rpm, Completion/User/_bunzip2, + Completion/User/_bzip2, Completion/User/_compress, + Completion/User/_dd, Completion/User/_dvi, Completion/User/_gdb, + Completion/User/_gprof, Completion/User/_gs, + Completion/User/_gunzip, Completion/User/_gzip, + Completion/User/_mh, Completion/User/_mutt, + Completion/User/_netscape, Completion/User/_nslookup, + Completion/User/_pack, Completion/User/_pbm, + Completion/User/_pdf, Completion/User/_ps, + Completion/User/_pspdf, Completion/User/_ssh, + Completion/User/_strip, Completion/User/_tar_archive, + Completion/User/_tex, Completion/User/_tiff, + Completion/User/_uncompress, Completion/User/_unpack, + Completion/User/_users_on, Completion/X/_x_window, + Completion/X/_xmodmap: tags can now be used to define groups for + display. + + * Zefram: 8839: Src/.cvsignore, Src/Builtins/.cvsignore, + Src/Makemod.in.in, Src/Modules/.cvsignore, Src/Zle/.cvsignore, + Src/Zle/compcore.c, Src/Zle/compctl.c, Src/Zle/complete.c, + Src/Zle/compmatch.c, Src/Zle/compresult.c, Src/makepro.awk, + Src/mkmakemod.sh, Src/zsh.mdd: separate local and global + prototype files. + + * Sven: 8838: Doc/Zsh/compsys.yo: colons in argument specifiers. + + * Alexandre: 8836: Completion/User/_prompt: fix for _arguments + use. + + * Sven: 8834: Src/Zle/compcore.c, Src/Zle/complete.c: make sure + grouping commands create groups. + + * Zefram: 8833: Src/Modules/zftp.c: forward declaration of + struct in_addr. + +1999-11-30 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * Clint: 8827: Makefile.in, Doc/.cvsignore, Doc/.distfiles, + Doc/Makefile.in, Src/Makefile.in: partial program transform + support in texinfo docs. + + * Zefram: 8826: configure.in, Src/Modules/zftp.c: workaround + for systems without inet_aton(). + + * Clint: 8824: Src/Makefile.in: use AC_ARG_PROGRAM, already set + by configure. + +1999-11-29 Peter Stephenson <pws@pwstephenson.fsnet.co.uk> + + * pws: Convig/version.mk: version 3.1.6-pws-10 + + * Sven: 8796: Src/Zle/computil.c, Src/utils.c: make freearray() + safer w.r.t. null pointers. + + * pws: 8794: Completion/User/_man: handle .bz2 files. + + * pws: 8793: Src/jobs.c: matheval called incorrectly with + heap allocation. + +1999-11-26 Peter Stephenson <pws@supanet.com> + + * Sven: 8787: Completion/Core/_approximate, + Completion/Core/_correct, Completion/Core/_expand, + Completion/Core/_main_complete: don't prepend completer name if + there; save/restore $curcontext; typo. + + * Tanaka Akira: 8786: Completion/User/_gs: ghostscript can handle + PDF. + + * Tanaka Akira: 8785: Completion/Debian/_apt: quoting typo. + + * Bart: 8782, 8783: Src/lex.c: fix line numbers for `unmatched + ...' errors. + + * Clint: 8779: Src/utils.c: more compiler like error messages. + + * Sven: 8777: Completion/Core/_normal, Completion/Core/_sort_tags, + Doc/Zsh/compsys.yo: extra colon in ordinary argument contexts + for consistency. + + * Sven: 8776: Src/mkbltnmlst.sh, Src/module.c: error in static + shell loading unknown module; don't use autoload stuff in + static shells. + +1999-11-24 Peter Stephenson <pws@supanet.com> + + * Sven: 8770: Src/Builtins/rlimits.c, Src/Builtins/sched.c, + Src/Modules/cap.c, Src/Modules/clone.c, Src/Modules/example.c, + Src/Modules/files.c, Src/Modules/mapfile.c, + Src/Modules/mathfunc.c, Src/Modules/parameter.c, + Src/Modules/stat.c, Src/Modules/zftp.c, Src/Zle/compctl.c, + Src/Zle/complete.c, Src/Zle/complist.c, Src/Zle/computil.c, + Src/Zle/deltochar.c, Src/Zle/zle_hist.c, Src/Zle/zle_keymap.c, + Src/Zle/zle_main.c, Src/Zle/zle_thingy.c, + Src/Zle/zleparameter.c, Src/builtin.c, Src/exec.c, Src/init.c, + Src/mkbltnmlst.sh, Src/module.c, Src/params.c, Src/zsh.h, + Doc/Zsh/builtins.yo, Etc/zsh-development-guide: zmodload now + behaves same for builtin as for dynamically loaded modules + (need to call `zmodload' or autoload explicitly even in statically + linked shells). + + * Sven: 8768: Completion/Core/_complete: change the current + context only if called from _main_complete. + + * Sven: 8766: Src/module.c: don't try to load linked-in module. + + * Zefram: 8764: Src/Modules/zftp.c, acconfig.h, configure.in: + Support for IPv6 in zftp. + +1999-11-23 Peter Stephenson <pws@supanet.com> + + * Adam: 8756: Doc/Zsh/compsys.yo: typo. + + * Sven: 8754: INSTALL: this really does remove comp1, and rewrites + the instructions for systems where module symbols are not + intervisible. + + * Tanaka Akira: more funky telnet options. + + * Sven: 8750: Completion/User/_perldoc: update. + + * Sven: 8749: Src/Zle/computil.c, Completion/Base/_arguments: + mixing single-letter and long options. + + * Sven: 8747: INSTALL: remove comp1 references. + + * Sven: 8746: Src/Zle/computil.c, Completion/Base/_arguments: + (not compsys.yo hunk): escape :'s in computils; fix nesting of + loops in arguments. + + * Oliver: 8745: Completion/User/_mount: handles IRIX 5.3 and AIX, + improves Linux. + + * Sven: 8744: Src/init.c: make compctlreadptr visible after 8741. + + * Sven/Alexandre: 8742: Completion/Builtins/_pids: added more + matches than descriptions; also use command ps. + + * Adam: 8741: Src/init.c: remove references to deleted comp1 + module. + + * pws: 8738: Completion/Builtins/_vars, Completion/User/_make, + Doc/Zsh/compsys.yo, Src/math.c, configure.in: parts missing + in 3.1.6-pws-9. + +1999-11-22 Peter Stephenson <pws@supanet.com> + + * Alexandre: 8728: Completion/Base/_arguments: extra local. + + * Oliver: 8726: Completion/User/_netscape: was broken. + + * Oliver: 8725: Src/zsh.export, Src/Zle/compctl.mdd, + Src/Zle/complete.export, Src/Zle/computil.mdd, + Src/Zle/zle.export, Src/Zle/.distfiles: lastest changes + necessary for dynamical AIX support. + + * Sven: 8722: Completion/Base/_arguments, + Completion/Core/_path_files, Completion/User/_telnet, + Doc/Zsh/compsys.yo: ignored-suffixes style. + + * Sven: 8721: Src/signals.c: null sigfuncs when being saved. + + * Sven: 8720: Doc/Zsh/compsys.yo, + Functions/Zle/incremental-complete-word, + Functions/Zle/predict-on, Completion/Base/_combination, + Completion/Base/_describe, Completion/Base/_jobs, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Builtins/_pids, Completion/Builtins/_popd, + Completion/Builtins/_sched, Completion/Core/_approximate, + Completion/Core/_complete, Completion/Core/_correct, + Completion/Core/_expand, Completion/Core/_list, + Completion/Core/_main_complete, Completion/Core/_match, + Completion/Core/_menu, Completion/Core/_oldlist, + Completion/Core/compinit, Completion/User/_groups, + Completion/User/_hosts, Completion/User/_my_accounts, + Completion/User/_other_accounts, Completion/User/_ports, + Completion/User/_rlogin, Completion/User/_socket, + Completion/User/_ssh, Completion/User/_telnet, + Completion/User/_user_at_host, Completion/User/_users: various + parameters have become styles. + + * Sven: 8718: Src/Zle/compcore.c: addmatches() with fignore. + + * Sven: 8715: Src/Zle/complist.mdd: module depends on zle. + + * Sven: 8716: Completion/Base/_arguments, Src/Zle/computil.c: + option completion fixes; careful with multiple use of tags. + + * Bart: 8501: configure.in: don't try testing for job control + if stdin is not a terminal. + +1999-11-21 Peter Stephenson <pws@supanet.com> + + * pws: Configure/version.mk: 3.1.6-pws-9 made available. + + * Clint: 8702: Completion/Debian/_dpkg: typo. + + * Bart: 8696: Completion/User/_cvs: `cvs watch add' failed. + + * Clint: 8695: Doc/Zsh/params.yo, Src/params.c: LC_NUMERIC support. + + * Clint: 8609, 8693: Src/math.c: make decimal point use + independent of locale. + + * Bart: 8692: Src/Zle/computil.c: core dump in completion. + + * Alexandre: 8691: Completion/User/_mount: upgrade for + Solaris (tested), OSF and Linux (not). + + * Oliver: 8690: Src/makepro.awk: printf locals -> print locals + avoiding buffer size limit on some systems. + + * Sven: 8679: Completion/Base/_jobs, Doc/Zsh/compsys.yo: use + strings style in _jobs. + + * Tanaka Akira: 8678: Completion/User/_cvs: tag name after `cvs + tag'. + + * Sven: 8677: Completion/User/_killall: careful with incompatible + versions. + + * Sven: zsh-users/2742: Src/Makefile.in: remove comp1 from Makefile.in + for building into statically linked shells. + + * Sven: 8675: Completion/Builtins/_kill, + Completion/Builtins/_signals, Completion/Builtins/_trap, + Completion/User/_killall: better use of tags with signal + handling completion. + + * Bart: 8674: Src/builtin.c: make `typeset -x' equivalent to export + by forcing -g. + + * Adam: 8672: Functions/Prompts/.distfiles, + Functions/Prompts/prompt_adam2_setup, + Functions/Prompts/prompt_fire_setup, + Fuanctions/Prompts/promptinit: fix $prompt_theme use; restore after + preview; add distfiles. + + * Sven: 8681: Completion/Builtins/.distfiles: and _signals. + + * Sven: 8683: Completion/Core/.distfiles: add _funcall. + + * Oliver: 8684: Prompts/prompt_off_setup, + Prompts/prompt_oliver_setup, Prompts/prompt_redhat_setup, + Prompts/prompt_suse_setup, Prompts/prompt_zefram_setup, + Prompts/promptinit: tweaks for 8667. + + * Adam: 8669: Misc/bash2zshprompt: and this one, too. + + * Adam: 8667: Functions/Misc/colors, + Functions/Prompts/prompt_adam1_setup, + Functions/Prompts/prompt_adam2_setup, + Functions/Prompts/prompt_bigfade_setup, + Functions/Prompts/prompt_blue_setup, + Functions/Prompts/prompt_combo_setup, + Functions/Prompts/prompt_cyan_setup, + Functions/Prompts/prompt_elite2_setup, + Functions/Prompts/prompt_elite_setup, + Functions/Prompts/prompt_fade_setup, + Functions/Prompts/prompt_fire_setup, + Functions/Prompts/prompt_green_setup, + Functions/Prompts/prompt_magenta_setup, + Functions/Prompts/prompt_off_setup, + Functions/Prompts/prompt_oliver_setup, + Functions/Prompts/prompt_red_setup, + Functions/Prompts/prompt_suse_setup, + Functions/Prompts/prompt_white_setup, + Functions/Prompts/prompt_yellow_setup, + Functions/Prompts/prompt_zefram_setup, + Functions/Prompts/promptinit: new prompt themes with better + handling of colours. + + * Sven: 8665, 8664: Doc/Zsh/compsys.yo, Completion/Core/_funcall, + Completion/Core/compinit, Completion/Linux/_rpm, + Completion/User/_nslookup: manual clean-ups. + + * Adam: 8658: Completion/Core/compinit, Doc/Zsh/compsys.yo: + fix some typos. + + * Tanaka Akira: 8657: Completion/Base/.distfiles, + Completion/Builtins/.distfiles, Completion/Commands/.distfiles, + Completion/Core/.distfiles, Completion/Debian/.distfiles, + Misc/.distfiles, Src/Zle/.distfiles: new and moved files. + + * Sven: 8655: Completion/Base/_arguments: for 8654. + + * Sven: 8654: Doc/Zsh/compsys.yo, + Functions/Zle/incremental-complete-word, + Functions/Zle/predict-on, Completion/Base/_describe, + Completion/Base/_first, Completion/Base/_regex_arguments, + Completion/Builtins/_echotc, + Completion/Commands/_history_complete_word, + Completion/Core/compinit: documentation for new tags code. + + * Sven: 8648: Completion/Base/_brace_parameter, + Completion/Base/_subscript, Completion/Builtins/_sched, + Completion/Builtins/_stat, Completion/User/_tar: get rid of some + _requested and rationalise tag names. + + * Sven: 8647: Completion/Builtins/_hash, + Completion/Builtins/_sched, Completion/Builtins/_stat, + Completion/Core/compinit, Completion/User/_cvs, + Completion/User/_urls, Completion/User/_user_at_host, + Completion/User/_whois, Completion/X/_xutils: additional fixes + for latest tags code. + + * Sven: 8646: Src/Zle/computil.c: add comments + + * Tanaka Akira: 8645: Completion/User/_make, Doc/Zsh/compsys.yo: + fixes for 8639. + + * Sven: 8644: Completion/Base/_arguments, Completion/Base/_values: + loop for only a few options, so don't use getopts. + + * Sven: 8642: Completion/Base/_arguments, Completion/Base/_values: + don't shift OPTINDS-1. + + * Sven: 8640: Completion/Commands/.distfiles: remove _verbose_list. + + * Sven: 8639: Src/Zle/computil.c, Src/Zle/computil.mdd, + Completion/Base/_arg_compile, Completion/Base/_arguments, + Completion/Base/_brace_parameter, + Completion/Base/_command_names, Completion/Base/_condition, + Completion/Base/_default, Completion/Base/_describe, + Completion/Base/_equal, Completion/Base/_first, + Completion/Base/_jobs, Completion/Base/_math, + Completion/Base/_parameter, Completion/Base/_regex_arguments, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_aliases, + Completion/Builtins/_arrays, Completion/Builtins/_autoload, + Completion/Builtins/_bindkey, Completion/Builtins/_builtin, + Completion/Builtins/_cd, Completion/Builtins/_command, + Completion/Builtins/_compdef, Completion/Builtins/_disable, + Completion/Builtins/_echotc, Completion/Builtins/_enable, + Completion/Builtins/_functions, Completion/Builtins/_hash, + Completion/Builtins/_kill, Completion/Builtins/_limits, + Completion/Builtins/_pids, Completion/Builtins/_popd, + Completion/Builtins/_sched, Completion/Builtins/_stat, + Completion/Builtins/_trap, Completion/Builtins/_unhash, + Completion/Builtins/_vars, Completion/Builtins/_wait, + Completion/Builtins/_which, Completion/Builtins/_zftp, + Completion/Builtins/_zle, Completion/Builtins/_zmodload, + Completion/Commands/_complete_help, + Completion/Commands/_correct_word, + Completion/Commands/_expand_word, + Completion/Commands/_history_complete_word, + Completion/Commands/_read_comp, Completion/Core/.distfiles, + Completion/Core/_alternative, Completion/Core/_approximate, + Completion/Core/_complete, Completion/Core/_correct, + Completion/Core/_description, Completion/Core/_expand, + Completion/Core/_files, Completion/Core/_list, + Completion/Core/_main_complete, Completion/Core/_match, + Completion/Core/_menu, Completion/Core/_message, + Completion/Core/_normal, Completion/Core/_oldlist, + Completion/Core/_options, Completion/Core/_parameters, + Completion/Core/_path_files, Completion/Core/_requested, + Completion/Core/_set_options, Completion/Core/_sort_tags, + Completion/Core/_style, Completion/Core/_tags, + Completion/Core/_unset_options, Completion/Core/_wanted, + Completion/Core/compdump, Completion/Core/compinit, + Completion/Core/compinstall, Completion/Debian/_apt, + Completion/Debian/_deb_packages, Completion/Linux/_rpm, + Completion/User/_archie, Completion/User/_cvs, + Completion/User/_dd, Completion/User/_flex, + Completion/User/_gcc, Completion/User/_gdb, + Completion/User/_gprof, Completion/User/_groups, + Completion/User/_gs, Completion/User/_hosts, + Completion/User/_killall, Completion/User/_lynx, + Completion/User/_mailboxes, Completion/User/_make, + Completion/User/_man, Completion/User/_mh, + Completion/User/_mount, Completion/User/_mutt, + Completion/User/_netscape, Completion/User/_nslookup, + Completion/User/_pbm, Completion/User/_perl_basepods, + Completion/User/_perl_builtin_funcs, + Completion/User/_perl_modules, Completion/User/_ports, + Completion/User/_rcs, Completion/User/_rlogin, + Completion/User/_socket, Completion/User/_ssh, + Completion/User/_stty, Completion/User/_tar, + Completion/User/_telnet, Completion/User/_tiff, + Completion/User/_urls, Completion/User/_use_lo, + Completion/User/_user_at_host, Completion/User/_users, + Completion/User/_users_on, Completion/User/_wget, + Completion/User/_whois, Completion/User/_yp, + Completion/X/_x_arguments, Completion/X/_x_color, + Completion/X/_x_cursor, Completion/X/_x_display, + Completion/X/_x_extension, Completion/X/_x_font, + Completion/X/_x_keysym, Completion/X/_x_modifier, + Completion/X/_x_window, Completion/X/_xmodmap, + Completion/X/_xt_arguments, Completion/X/_xutils, + Doc/Zsh/compsys.yo, Doc/Zsh/mod_computil.yo, + Etc/completion-style-guide: contexts extended to multiple levels; + tags and styles replace configuration keys; _complete_help (C-xh) + shows context and accepted tags. + + * Bart: 8638: Completion/Base/.distfiles, + Completion/Builtins/.distfiles: mv _vars from Base to _Builtins. + + * Sven: 8633: Doc/Zsh/compsys.yo: documentation for -O options + to _arguments and _values.o + + * Sven: 8632: Completion/User/_telnet: remove set -x + + * Sven: 8630: Src/Zle/computil.c, Doc/Zsh/compsys.yo, + Completion/Base/_arguments, Completion/Base/_brace_parameter, + Completion/Base/_command_names, Completion/Base/_condition, + Completion/Base/_default, Completion/Base/_describe, + Completion/Base/_equal, Completion/Base/_jobs, + Completion/Base/_math, Completion/Base/_parameter, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Base/_vars, + Completion/Builtins/_aliases, Completion/Builtins/_arrays, + Completion/Builtins/_autoload, Completion/Builtins/_bindkey, + Completion/Builtins/_builtin, Completion/Builtins/_cd, + Completion/Builtins/_command, Completion/Builtins/_compdef, + Completion/Builtins/_disable, Completion/Builtins/_echotc, + Completion/Builtins/_enable, Completion/Builtins/_functions, + Completion/Builtins/_hash, Completion/Builtins/_kill, + Completion/Builtins/_limits, Completion/Builtins/_pids, + Completion/Builtins/_popd, Completion/Builtins/_sched, + Completion/Builtins/_stat, Completion/Builtins/_trap, + Completion/Builtins/_unhash, Completion/Builtins/_wait, + Completion/Builtins/_which, Completion/Builtins/_zftp, + Completion/Builtins/_zle, Completion/Builtins/_zmodload, + Completion/Core/_alternative, Completion/Core/_complete, + Completion/Core/_files, Completion/Core/_main_complete, + Completion/Core/_message, Completion/Core/_normal, + Completion/Core/_options, Completion/Core/_parameters, + Completion/Core/_requested, Completion/Core/_set_options, + Completion/Core/_sort_tags, Completion/Core/_style, + Completion/Core/_tags, Completion/Core/_unset_options, + Completion/Core/compinit, Completion/Debian/_apt, + Completion/Linux/_rpm, Completion/User/_archie, + Completion/User/_flex, Completion/User/_gcc, + Completion/User/_gprof, Completion/User/_groups, + Completion/User/_gs, Completion/User/_hosts, + Completion/User/_lynx, Completion/User/_mount, + Completion/User/_mutt, Completion/User/_netscape, + Completion/User/_nslookup, Completion/User/_pbm, + Completion/User/_ports, Completion/User/_rlogin, + Completion/User/_socket, Completion/User/_ssh, + Completion/User/_telnet, Completion/User/_tiff, + Completion/User/_urls, Completion/User/_user_at_host, + Completion/User/_users, Completion/User/_users_on, + Completion/User/_wget, Completion/User/_whois, + Completion/User/_yp, Completion/X/_x_color, + Completion/X/_x_cursor, Completion/X/_x_display, + Completion/X/_x_extension, Completion/X/_x_font, + Completion/X/_x_keysym, Completion/X/_x_modifier, + Completion/X/_x_window, Completion/X/_xmodmap: tags rewrite. + + * Bart: 8617: Src/signals.c: warning, not error, if jobs running + at exit. + + * Akim Demaille <akim@epita.fr>, Tanaka Akira: 8612, 8615: + Completion/User/_make: avoid empty branch in awk pattern by + using `?'. + + * Clint: 8611: Completion/Debian/_apt: complete package to show. + + * Sven: 8607: Src/builtin.c, Src/math.c: initialize mathevall() + return value, but not hunk reset errflag in zexit() (except + kept braces). + + * Sven: 8604: Src/Builtins/.cvsignore, Src/Modules/.cvsignore, + Src/Zle/.cvsignore: ignore so_locations. + + * Sven: 8603: Completion/Base/_arguments, Completion/Base/_describe, + Completion/Base/_values, Completion/Builtins/_kill, + Completion/Builtins/_wait, Completion/Core/_alternative, + Completion/Core/_files, Completion/Core/_main_complete, + Completion/Core/_requested, Completion/Core/_style, + Completion/Core/_tags, Completion/Core/compinit: simplified tags + mechanism and new style mechanism. + + * Bart: 8601: Src/Zle/compcore.c: add DPUTS for 8599. + + * Sven: 8599: Src/Zle/compcore.c: fix problems with quoting + + * Adam: 8598: Misc/make-zsh-urls: perl script for creating URLs to + complete. + + * Tanaka Akira: 8597: Completion/User/_whois: handle fwhois. + + * Clint: 8594: Completion/Debian/_bug: improvements. + + * Sven: 8591: Src/Zle/zle_main.c: fix up vared in subshell by + re-opening file + + * Sven: 8590: Src/Zle/zle.h, Src/Zle/zle_tricky.c, + Src/Zle/zle_utils.c, Completion/Core/_path_files: keeping + track of prefixes and suffixes in file completion and tracking + cursor position for undo. + + * Sven: 8588, 8589: Src/Zle/comp.h, Src/Zle/compcore.c, + Src/Zle/compctl.c, Src/Zle/complete.c, Src/Zle/compmatch.c, + Src/Zle/compresult.c, Src/Zle/computil.c, Src/Zle/computil.mdd, + Src/Zle/zle_tricky.c, Src/params.c, Doc/Zsh/compwid.yo, + Doc/Zsh/mod_computil.yo, Completion/Core/_path_files: mega patch + for nested quotes in completion. + + * Clint: 8585: Src/Zle/compresult.c: count mismatch displaying lines + + * Clint: 8576: configure.in: fix up options descriptions + + * Clint: 8575: Completion/Debian.new/_bug: handle reportbug + + * Sven: 8573: Src/utils.c: more careful quoting re-inserted ~, too. + + * Sven: 8569: Src/utils.c: 8565 after colon. + + * Sven: 8566: Completion/Core/_tags: local var is $ttags, not $tags. + + * Sven: 8565: Src/utils.c, Completion/Core/_expand: don't quote = + in normal argument except at start. + +1999-11-19 Peter Stephenson <pws@supanet.com> + + * Sven: 8562: Completion/Core/_path_files: handle noglobdots but + still find explicitly typed dotfiles. + + * Sven: 8560: Src/Zle/complete.export, Src/Zle/compresult.c, + Src/Zle/zle.export, Src/Zle/zle_tricky.c, Src/zsh.export: move + functions around. + + * Bart: 8558: Completion/Builtins/.distfiles: update + + * Oliver: 8547: zle.export, complete.export, zsh.export + + * Clint: 8545, 7546: Functions/Misc/run-help: .->dot and :->colon; + check $HELPDIR and english, don't invoke man if not necessary. + + * Bart: 8541: configure.in, Completion/Base/.distfiles, + Completion/Builtins/.distfiles, Completion/Core/.distfiles, + Completion/Debian/.distfiles: fix getpwent() test and update + .distfiles. + + * Clint: 8540: Completion/Debian/_bug: completion for Debian `bug'. + + * Sven: 8537: Completion/Base/_describe, Completion/Base/_values, + Completion/Builtins/_kill, Completion/Builtins/_pids, + Completion/Builtins/_wait, Completion/Core/_tags, + Completion/User/_gdb: _pids to complete PIDs; -i option to _tags. + + * Sven: 8536: Src/lex.c: don't try to balance parentheses in + parameter expressions inside math evals. + + * Sven: 8535: Src/Zle/compcore.c, Src/Zle/complist.c, + Src/Zle/zle_tricky.c: drop back to ordinary completion to query + user for listing when in menu-select. + + * Sven: 8533: Completion/Base/_arguments, Completion/Base/_describe, + Completion/Base/_values, Completion/Builtins/_kill, + Completion/Builtins/_wait, Completion/Core/_files, + Completion/Core/_main_complete, Completion/Core/_tags: remove + prios parameters by using $funcstack. + + * Clint: 8532: Completion/Debian/_dpkg, + Completion/Debian/_dpkg-source: new support for Debian package + management functions. + + * 8520: Completion/Base/_arguments, Completion/Base/_describe, + Completion/Base/_values, Completion/Builtins/_kill, + Completion/Builtins/_wait, Completion/Core/_files, + Completion/Core/_main_complete, Completion/Core/_tags, + Completion/Core/compinit: add _tags functionality + + * Sven: 8519: Src/Zle/complist.c: don't use old list after a menu + selction. + + * Sven: 8518: Src/Modules/parameter.c, Src/Modules/parameter.mdd, + Completion/Base/_command_names, Completion/Builtins/_aliases, + Completion/Builtins/_enable, Completion/Builtins/_unhash, + Completion/Builtins/_which, Doc/Zsh/builtins.yo, + Doc/Zsh/mod_parameter.yo: dis* parameter keys are now all + dis_*. + + * Sven: 8517: Src/Zle/zleparameter.c: when to calculate values + for zle parameters (update to 8474). + + * Sven: 8515: Src/Zle/comp.h, Src/Zle/compctl.h, Src/builtin.c, + Src/module.c, Doc/Zsh/builtins.yo, + Completion/Base/_command_names, Completion/Builtins/_bg_jobs, + Completion/Builtins/_fg_jobs, Completion/Builtins/_hash, + Completion/Builtins/_jobs, Completion/Builtins/_kill, + Completion/Builtins/_wait, Completion/User/_gdb, + Completion/User/_perldoc: completion file headers; + zmodload in static shells; changes in job control + completion. + + * Bart: 8512: Completion/Core/compinit: workaround zmodload -i + unavailibity in statically linked shell. + +1999-11-03 Bart Schaefer <schaefer@zsh.org> + + * Config/version.mk: Set version string to 3.1.6-bart-8. + + * Doc/Zsh/Makefile.in, Src/Zle/zle.mdd: The comp1 module is obsolete. + +1999-11-02 Bart Schaefer <schaefer@zsh.org> + + * Src/Zle/comp1.c, Src/Zle/comp1.export, Src/Zle/comp1.mdd: Sven: + 8424: These files are obsolete now. + + * Src/Zle/compcore.c: Sven: 8495: The wrong cline struct was being + tested, causing improper auto-suffix-removal behavior. + + * Completion/Core/_path_files: Sven: 8494: Fix up prefix/suffix + manipulations. + + * Completion/Base/_value: Tanaka: 8491: Call _value after + redefining it. + + * Src/Zle/compcore.c, Src/Zle/compresult.c, Src/Zle/computil.c: + Sven: 8490: Fix display bugs and a fencepost error. + + * Src/Modules/parameter.c: Sven: 8490: Use the correct scan for + disabled aliases. + + * Completion/User/_urls: Sven: 8490: Don't use "hosts" as a local + paramter name, _hosts wants to see the global when it gets called + later. + + * Src/exec.c: Sven: 8488: Pass a copy of the function name to + module wrappers in case the function undefines/redefines itself. + + * Completion/Base/_value: Tanaka: 8487: Completions after + parameter assignments. + + * Completion/User/_make: Tanaka: 8486: Some BSD-variant special cases. + + * Completion/Debian/_apt, Completion/User/_archie: Tanaka: 8485: + Fix typos and minor omissions. + + * Completion/User/_cvs, Completion/User/_whois, + Completion/Core/compinit, Completion/Base/_combination: Sven: + 8484: Use parameter module for testing function existence; fix a + couple of small bugs. + + * Src/Modules/parameter.c: Sven: 8482: Make sure special AA param + keys are set when needed. + + * Src/Zle/compcore.c, Src/Zle/compmatch.c: Sven: 8481: An empty + string in compmatchers means try global match specs. + + * Doc/Zsh/mod_parameter.yo, Src/Modules/parameter.c, + Src/Modules/parameter.mdd, Completion/Core/compinit: Sven: 8480: + Add funcstack parameter. + + * Completion/Core/_path_files: Sven: 8479: Use globdots throughout. + + * Completion/Base/_first: Sven: 8479: Fix example code (in comment). + + * Doc/Zsh/expn.yo, Src/glob.c: Sven: zsh-users/2713: Qualifier (n) + sets numeric-glob-sort for current glob. + + * Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, Doc/Zsh/compctl.yo, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, Doc/Zsh/intro.yo, + Doc/Zsh/manual.yo, Doc/Zsh/mod_complete.yo, Doc/Zsh/modules.yo, + Doc/Zsh/zle.yo, Src/Zle/comp.h, Src/Zle/compcore.c, + Src/Zle/complete.c, Src/Zle/complete.mdd, Src/Zle/complist.c, + Src/Zle/compmatch.c, Src/Zle/compresult.c, Src/Zle/zle.h, + Src/Zle/zle_main.c, Src/Zle/zle_misc.c, Doc/zsh.yo: Sven: 8478 (as + described in 8475 and 8476): Continue the re-modularization of the + new completion system, moving some doc into new sections and + moving most of the completion code from zle_tricky.c into three + new files. + + * Completion/Core/compinit: Sven: 8475: Call zmodload on parameter + and zleparameter. This may not be necessary, as it wasn't + included in the correction in 8478. + + * Src/Modules/parameter.c: Sven: 8474: Fix computation from + previous patch for whether values are needed. + + * Src/hashtable.c: Sven: 8474: Fall back on getpwent() if NIS + and/or NIS+ don't find anything. + + * Src/signals.c: Sven: 8473: Reset sigtrapped[] during dosavetrap(). + + * Src/Modules/parameter.c, Src/Zle/zleparameter.c: Sven: 8472: + Don't calculate values for special parameters unless needed. + + * Functions/Zle/predict-on: Use a "repeat 1" instead of "while + true" for a dummy loop. (Unposted.) + + * Completion/Builtins/_functions, Completion/Builtins/_unhash, + Completion/Builtins/_which, Completion/Builtins/_zle, + Completion/Builtins/_zmodload, Doc/Zsh/mod_parameter.yo, + Doc/Zsh/mod_zleparameter.yo, Src/Modules/parameter.c, + Src/Modules/parameter.mdd, Src/Zle/zleparameter.c, + Src/Zle/zleparameter.mdd, Completion/Base/_command_names, + Completion/Base/_equal, Completion/Builtins/_aliases, + Completion/Builtins/_bindkey, Completion/Builtins/_builtin, + Completion/Builtins/_disable, Completion/Builtins/_enable: Sven: + 8471: Split some paramters into enabled and disabled variants. + + * Functions/Zle/predict-on: Sven: 8470: Test list_max of 0 as a + special case. + + * configure.in: Zefram: 8459: More places to hunt for signals and + resources. + + * Completion/Core/compinit, Doc/Zsh/compsys.yo, Src/xmods.conf: + Sven: 8440: Auto-autoload the parameter modules, because + completion won't work without them. + + * Src/Zle/zle_tricky.c: Sven: 8439: Completion lists respect + NUMERIC_GLOB_SORT. + + * Src/Zle/zle_tricky.c: Sven: 8438: Force recompute of completion + list in listlist(). + + * Src/Zle/complist.c, Src/Zle/zle_tricky.c: Sven: 8437: Fix crash + in menu-select and remove old ref to ZLS_SELECT param. + + * Src/Zle/compctl.mdd, Src/Zle/complete.c, Src/Zle/complete.mdd, + Src/Zle/complist.c, Src/Zle/complist.mdd, Src/Zle/computil.mdd, + Src/Zle/zle.h, Src/Zle/zle_keymap.c, Src/Zle/zle_main.c, + Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, + Src/Zle/zleparameter.c, Src/Zle/zleparameter.mdd, + Doc/Zsh/compwid.yo, Doc/Zsh/expn.yo, Doc/Zsh/manual.yo, + Doc/Zsh/mod_clone.yo, Doc/Zsh/mod_compctl.yo, + Doc/Zsh/mod_complete.yo, Doc/Zsh/mod_computil.yo, + Doc/Zsh/mod_parameter.yo, Doc/Zsh/mod_zle.yo, + Doc/Zsh/mod_zleparameter.yo, Doc/Zsh/modules.yo, + Src/Modules/parameter.c, Src/Modules/parameter.mdd, + Src/Zle/comp.h, Src/Zle/compctl.h, Src/hashtable.c, Src/module.c, + Src/params.c, Src/subst.c, Src/xmods.conf, Completion/User/_cvs, + Completion/User/_gdb, Completion/User/_man, Completion/User/_mh, + Completion/User/_nslookup, Completion/User/_tar, + Completion/User/_urls, Completion/User/_users, + Completion/User/_whereis, Completion/User/_whois, + Completion/X/_x_font, Completion/X/_x_window, + Completion/X/_xmodmap, Doc/Makefile.in, Doc/Zsh/compctl.yo, + Doc/Zsh/compsys.yo, Completion/Debian/_apt, + Completion/Core/_approximate, Completion/Core/_main_complete, + Completion/Core/_normal, Completion/Core/_options, + Completion/Core/_parameters, Completion/Core/_path_files, + Completion/Core/compinit, Completion/Commands/_bash_completions, + Completion/Commands/_history_complete_word, + Completion/Commands/_read_comp, Completion/Builtins/_aliases, + Completion/Builtins/_arrays, Completion/Builtins/_bg_jobs, + Completion/Builtins/_bindkey, Completion/Builtins/_builtin, + Completion/Builtins/_cd, Completion/Builtins/_command, + Completion/Builtins/_compdef, Completion/Builtins/_disable, + Completion/Builtins/_enable, Completion/Builtins/_fc, + Completion/Builtins/_functions, Completion/Builtins/_hash, + Completion/Builtins/_jobs, Completion/Builtins/_kill, + Completion/Builtins/_set, Completion/Builtins/_stat, + Completion/Builtins/_trap, Completion/Builtins/_unhash, + Completion/Builtins/_wait, Completion/Builtins/_which, + Completion/Builtins/_zle, Completion/Builtins/_zmodload, + Completion/Base/_arguments, Completion/Base/_brace_parameter, + Completion/Base/_command_names, Completion/Base/_describe, + Completion/Base/_equal, Completion/Base/_first, + Completion/Base/_job, Completion/Base/_regex_arguments, + Completion/Base/_tilde, Completion/Base/_values: Sven: 8424: + Rearrange completion code to make the new function-based system + the default and begin separating zle_tricky, the old compctl + stuff, and the new system into better-segregated modules. + + * Src/Zle/compctl.c: Port from zle_tricky.c my local stubbornness + patch to use short job names, not whole job listings, in job + completions. + + * Src/Zle/compctl.c: Sven: 8424: Rearrange completion code to make + the new function-based system the default and begin separating + zle_tricky, the old compctl stuff, and the new system into + better-segregated modules. + +1999-10-27 Bart Schaefer <schaefer@zsh.org> + + * Functions/Zle/predict-on: Better handling of automenu, and don't + generate a listing if nmatches is so big that it would generate a + "do you wish ...?" prompt. + + * Functions/Zle/predict-on, Doc/Zsh/compsys.yo: Sven: 8442: "Pour + some compconfig over" predict-on. + +1999-10-26 Bart Schaefer <schaefer@zsh.org> + + * Functions/Zle/predict-on: As per Sven's suggestion, use a + comppostfuncs function to suppress the "do you wish to see all + possibilities?" message on long listings. + +1999-10-25 Bart Schaefer <schaefer@zsh.org> + + * Src/Zle/complist.c: Alexandre Duret-Lutz: 8413: Tweak 8412 to + extend the menu-selection highlight to the full width of the + column. + + * Src/Zle/complist.c, Doc/Zsh/mod_complist.yo: Sven: 8412: Add + separate colorings for the file-type-marker and for background + spaces, to be able to more closely copy GNU color-ls. + + * Src/Modules/parameter.c: Bart: 8404: Implement "autoload -X" and + change the value of "$functions" to fit. Also fix a crash-bug + when unloading this module. + + * Src/builtin.c, Src/exec.c, Src/hashtable.c, Doc/Zsh/builtins.yo, + Doc/Zsh/func.yo: Bart: 8404: Implement "autoload -X" and change the + output of "functions" to fit. + + * Doc/Zsh/zle.yo: Sven: 8400: BLINES -> BUFFERLINES + +1999-10-24 Bart Schaefer <schaefer@zsh.org> + + * Src/zsh.mdd: Don't forcibly rebuild zshpaths.h; instead make it + depend on the usual configuration-related makefile fragments. + + * Src/parse.c: Fix function-body parsing bug introduced by earlier + optimizations. + +1999-10-22 Bart Schaefer <schaefer@zsh.org> + + * Src/Modules/stat.c: Alexandre Duret-Lutz: 8371: Make "stat -g" + correspond to the doc for it. + + * Src/hist.c: Alexandre Duret-Lutz: 8376: !# history expansion now + works during completion, as it has in 3.0 since June 1, 1997. + + * Src/main.c, Src/params.c, Src/system.h, INSTALL, acconfig.h, + configure.in: Zefram: 8372: Configure option to disable + setlocale() support, and also do a linkage test for it rather than + simply test for the LC_ALL constant. + + * Functions/Zle/predict-on: Back out Sven's suggested compmatchers + for now; turn off prediction when a delete-char-or-list is + performed. + +1999-10-21 Bart Schaefer <schaefer@zsh.org> + + * Functions/Zle/predict-on: Refine, and improve commentary. + + * Completion/Builtins/_cd, Completion/Builtins/_popd: Oliver: + 8361: Factor out handling of +/- dirstack offsets from _cd to make + completer for _popd; fix _cd handling of directory names that + actually do begin with a + or -. + + * Src/Zle/computil.c: Sven: 8360: Still more parsing fixes. + + * Completion/User/_bison: Sven: 8360: Improved option recognition. + + * Completion/Base/_arguments, Completion/Base/_values: Sven: 8360: + More computil-related tweaking. + + * Completion/Builtins/_sched: Oliver: 8359: Complete scheduled + jobs for removal. + + * Src/Zle/computil.c: Sven: 8357: More options-parsing tweaks. + + * Functions/Prompts/promptinit, + Functions/Prompts/prompt_oliver_setup: Oliver: 8353: Simplified + handling of prompt_opts. + + * Src/Zle/computil.c: Sven: 8352: Fix parsing bugs. + + * Completion/User/_bison: Sven: 8352: Complete .y files as well. + + * Completion/Base/_arguments: Sven: 8352: Delay calling _message + so it won't confuse compstate[insert]. + + * Src/Zle/zle_tricky.c: Sven: 8350: Fixes to cline handling of + position of braces and of cursor following completion in nested + braces. + + * Functions/Zle/predict-on: If history-beginning-search-backward + fails, attempt complete-word. + + * Completion/Core/_path_files: Sven: 8350: Fix prefix/suffix settings. + + * configure.in: Clint Adams: 8346: Fix typos. + + * Src/Zle/computil.c: Sven: 8340: Fix memory management bugs and + confusion about word ranges when restricting compwords. + + * Completion/Core/_path_files: Sven: 8340: Fix completion on empty + string. + +1999-10-20 Bart Schaefer <schaefer@zsh.org> + + * Functions/Prompts/promptinit: Oliver: 8335: Provide the + prompt_opts assoc. array to specify what options are needed by a + given prompt theme, and arrange to set them by putting the + localoptions-affected guts of the prompt function into set_prompt + and then calling setopt after it finishes. (Tweaked to avoid + reindentation.) + +1999-10-19 Bart Schaefer <schaefer@zsh.org> + + * Src/Zle/comp.h, Src/Zle/complist.c, Src/Zle/zle_tricky.c: Sven: + 8333: Handle completion in nested brace-expressions. + + * Src/Builtins/rlimits.c: Display the sockbufsize and maxpthreads + limits in "ulimit -a" output. + + * Src/Builtins/rlimits.awk, Doc/Zsh/builtins.yo: Add the + "maxpthreads" limit as reported by Albert Chin. + + * Src/Zle/comp1.export, Src/Zle/compctl.export, + Src/Zle/zle.export: Oliver: 8323: Declarations needed to build + shared objects on AIX. + + * Src/Zle/zle_tricky.c: Sven: 8322: Fix overeager slash-addition + and suffix-elimination. + + * Completion/Core/_path_files: Sven: 8322: Complete directories up + to a trailing slash even if there are no further subdirectories, + but continue to make any subdirectories candidates for further + completion when a trailing slash is present. + + * Src/Builtins/rlimits.awk, Doc/Zsh/builtins.yo: Rename + "sktbuffersize" as "sockbufsize". + + * Src/cond.c: Sven: 8321: Fix bug in new cmpile-once "case" handling. + +1999-10-18 Bart Schaefer <schaefer@zsh.org> + + * Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c, + Src/Builtins/rlimits.mdd: Zefram: 8320: Sort the resource list for + "limit", rename "sbsize" to "sktbuffersize", fix problems handling + memory type limits vs pure numeric vs time spans. + + * Doc/Zsh/builtins.yo: Zefram: 8320: Sort the resource list for + "limit", rename "sbsize" to "sktbuffersize". + + * Src/cond.c, Src/loop.c, Src/parse.c, Src/pattern.c, Src/utils.c, + Src/zsh.h: Sven: 8319: Compile patterns in "case" statements on + demand, then keep them in the parse tree so they only have to be + compiled once. + + * Src/Zle/zle_tricky.c: Sven: 8317: Reset state so that a leading + "~" isn't assumed to be part of an extendedglob pattern. + + * Completion/Base/_tilde: Sven: 8317: Use _users. + + * Src/Zle/computil.c: Sven: 8316: Report when arguments are not + allowed at a position. + + * Completion/Base/_arguments: Sven: 8316: Extraneous "break". + + * Src/Zle/computil.c: Sven: 8315: Save and restore parser state + around "restricting rest-argument-definitions". + + * Src/Zle/zle_tricky.c: Sven: 8313: Try harder to use match specs + correctly, even when `globcomplete'. + + * Doc/Zsh/compsys.yo, Completion/Core/_path_files: Sven: 8313: + conconfig[path_expand] now has "prefix" and "suffix" choices. + + * Completion/Core/compinit: Sven: 8313: Minor cleanup of "funcall". + + * Completion/Core/_main_complete: Sven: 8313: A warning message + should be printed only when the last global match spec was tried. + + * Completion/Core/_main_complete: Sven: 8312: Missing "local" decl. + + * Doc/Zsh/builtins.yo: Document the `sbsize' limit. + + * Src/Builtins/rlimits.awk: Jos Backus: 8309: FreeBSD has an + SBSIZE limit. + +1999-10-17 Bart Schaefer <schaefer@zsh.org> + + * Completion/User/_man: Oliver: 8139: Use the "manpath" command if + available, splitting at colons. + + * Src/Modules/mathfunc.c: Oliver: 8138: Remove excess comma that + causes picky compilers to choke. + + * Src/builtin.c, Src/options.c, Src/zsh.h, Doc/Zsh/options.yo: + Bart: 8308: The `CHECK_JOBS' option, based on Clint Adams' 8109, + with sense reversed as suggested by Zefram in 8111, and adapted + doc from PWS in 8110. + + * Doc/Zsh/compsys.yo, Completion/Commands/_history_complete_word: + Adam: 8028,8063,8070; and PWS: 8098: Revised history completion. + + * Src/.cvsignore: Ignore .pro files only if they begin with + alphanumerics, to keep .indent.pro. + +1999-10-16 Bart Schaefer <schaefer@zsh.org> + + * Config/version.mk: Set version string to 3.1.6-bart-7. + + * Completion/User/_whois: Tanaka: 8296: New completion for "whois". + + * Completion/User/_archie: Tanaka: 8295: New completion for "archie". + +1999-10-15 Bart Schaefer <schaefer@zsh.org> + + * Completion/Debian/_apt, Completion/Base/_regex_arguments: + Tanaka: 8289: Misc. cleanup. + + * Completion/User/_pbm: Tanaka: 8287: Add missing + continuation-line backslashes. + + * Completion/User/_urls: Tanaka: 8286: Misc. cleanup. + + * Misc/bash2zshprompt: Adam: 8278: Emit "setopt promptsubst". + + * Completion/User/_urls: Oliver: 8276: More autoremoval fixes. + + * Src/Zle/zle_tricky.c: Sven: 8283: Fix bug in tracking number of + matches added. + + * Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo: + Sven: 8283: Improve documentation about match-specs. + + * Completion/Core/compinit: Sven: 8273: "compconf -L" sorts its + output. + + * Completion/Core/compinit, Src/Zle/computil.c, + Src/Zle/computil.mdd, Src/xmods.conf: Sven: 8272: The computil + module is now auto-autoloaded; minor bugfix. + + * Doc/Zsh/mod_complist.yo, Doc/Zsh/mod_computil.yo, + Doc/Zsh/mod_deltochar.yo, Doc/Zsh/modules.yo: Sven: 8272: Assorted + computil documentation. + + * Completion/Base/_describe, Completion/Base/_values: Sven: 8272: + Clean-up related to usages of new computil functions. + + * Src/Zle/computil.c, Completion/Base/_arguments: Sven: 8270: + Assorted computil debugging. + + * Src/math.c: Sven: 8267: Fix core dump caused by bad error handling. + + * Completion/User/_urls: Tanaka: 8263: Avoid bad autoremove behavior. + + * Completion/User/_killall, Completion/User/_pack, + Completion/User/_unpack, Completion/User/_whereis: Oliver: 8262: + More new completers. + + * Completion/User/_uncompress, Completion/User/_users, + Completion/User/_gzip, Completion/User/_hosts: Oliver: 8262: Fix + misc. minor omissions. + + * Completion/Builtins/_nothing: Oliver: 8262: Use this for the + "whoami" command. + + * Src/zsh.h, Src/params.c: Sven: 8254: Implement (k) and (K) + subscript modifiers. + + * Doc/Zsh/params.yo: Sven: 8254: Document the new (k) and (K) + subscript modifiers. + + * Functions/Prompts/prompt_adam2_setup, + Functions/Prompts/prompt_fire_setup, + Functions/Prompts/prompt_redhat_setup, + Functions/Prompts/promptinit: Fix a few bugs, mostly involving + `setopt promptsubst'. + + * Functions/Prompts/promptinit: Sven: 8251: Tweak to properly + expand the $fpath array. + + * Src/Zle/compctl.c, Src/Zle/compctl.mdd: Sven: 8249: Add the + "compmatchers" array. + + * Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo: Sven: 8249: Clarify + documentaion of declarations needed by some completers; document a + couple of new features. + + * Completion/Core/_description, Completion/Core/_files, + Completion/Core/_main_complete, Completion/Core/_message, + Completion/Core/_multi_parts, Completion/Core/_path_files, + Completion/Core/_sep_parts: Sven: 8249: Accept standard compadd + arguments, fix a few bugs, use the new compconfig[warning_format], + etc. + + * Completion/Builtins/_nothing: Sven: 8249: A completer which just + prints a warning that the current context does not expect any + words at all (e.g., a command that takes no arguments). + +1999-10-14 Bart Schaefer <schaefer@zsh.org> + + * Completion/Core/_main_complete, Completion/Core/compinit: Sven: + 8256: Missing hunks of 8227. + + * Src/Zle/zle_tricky.c: Sven: 8247: When completing with a match + spec, don't insert anchors if there are characters missing to the + left of them. + + * Src/Zle/zle_tricky.c: Sven: 8244: Fix failure to list ambiguous + matches completing after a quote. + + * configure.in: Tanaka: 8241: Test for a gcc 2.95 bug. + + * Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c, + Doc/Zsh/builtins.yo: Zefram: 8229: Support for the AIO_OPS and + AIO_MEM resource limits. + +1999-10-13 Bart Schaefer <schaefer@zsh.org> + + * Src/Zle/compctl.c, Src/Zle/computil.c, Src/Zle/computil.mdd, + Src/Zle/zle_tricky.c, Doc/Zsh/compsys.yo, + Completion/Core/compinit, Completion/Base/_arguments, + Completion/Base/_describe, Completion/Base/_values: Sven: 8219: + Add and make use of the "computil" module, which moves several of + the operations previously done by shell functions into C code. + + * Completion/User/_netscape: Oliver: 8230: Better browser and url + completion. + + * Completion/User/_tiff: Sven: 8132: Change "options" to "opt_args". + + * Src/Zle/zle_tricky.c: Sven: 8231: Remove unnecessary tokenization. + + * Src/utils.c: Sven: 8231: Don't attempt to use a null name in + zwarnnam(). + + * Doc/Zsh/compsys.yo, Completion/X/_xmodmap, + Completion/User/_flex, Completion/User/_gcc, + Completion/User/_gprof, Completion/User/_gs, + Completion/User/_lynx, Completion/User/_mount, + Completion/User/_nslookup, Completion/User/_rlogin, + Completion/User/_socket, Completion/User/_ssh, + Completion/User/_telnet, Completion/User/_urls, + Completion/User/_wget, Completion/User/_yp, Completion/Linux/_rpm: + Sven: 8231,8232: Rename "options" as "opt_args" in a lot of places + to avoid conflicts with the parameters module. + + * Completion/User/_urls, Completion/User/_webbrowser, + Doc/Zsh/compsys.yo: Oliver: 8230: Better browser and url + completion. + + * Functions/Zle/incremental-complete-word, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/zle.yo, Src/Zle/comp.h, + Src/Zle/comp1.c, Src/Zle/compctl.c, Src/Zle/complist.c, + Src/Zle/zle_main.c, Src/Zle/zle_params.c, Src/Zle/zle_tricky.c: + Sven: 8227: Compute the list of matches more frequently and + earlier so that compstate[nmatches] is accurate more often; + replace compstate[normal_nmatches] with + compstate[alternate_nmatches] as a consequence; add + compstate[list_lines] and BUFFERLINES for testing how big a screen + is needed to edit; add an array comppostfuncs to hold callback + shell functions run during completion; fix a display bug. + + * Src/Zle/zle_tricky.c: Sven: 8222: More cursor position + heuristics: prefer to place the cursor in the matched portion of + an ambiguous word, rather than in a prefix or suffix. + + * Completion/Core/_approximate, Completion/Core/_complete, + Completion/Core/_expand, Completion/Core/_list, + Completion/Core/_main_complete, Completion/Core/_match, + Completion/Core/_path_files, Completion/Base/_default: Sven: 8217: + Remove large comments that are now redundant with the compsys + manual; misc other cleanup. + + * Src/Zle/zle_tricky.c: Sven: 8216: Improve code readability. + + * Src/Zle/zle_tricky.c: Sven: 8215: Fix problem with + accept-and-menu-complete. + + * Functions/Misc/nslookup: A space is required between "read -k" + and the number of bytes to read. + + * Doc/Zsh/builtins.yo: Document vagaries of "read -k" argument + parsing. + +1999-10-12 Bart Schaefer <schaefer@zsh.org> + + * config.sub: Handle newer flavors of hppa2.0 as computed by + configure. + +1999-10-11 Bart Schaefer <schaefer@zsh.org> + + * Completion/Core/_path_files: Sven: 8206: Fix setting of PREFIX + when there's a leading slash. + + * Src/Zle/zle_tricky.c: Sven: 8205: Misc. fixes involving uninit'd + variables, ragged alignment of output in calclist(), etc. + + * Completion/User/_yodl: Sven: 8204: Handle .yo file-suffix as + well as .yodl. + + * Completion/Builtins/_cd, Completion/Base/_tilde: Oliver: 8181: + Clean up directory stack handling. + +1999-10-10 Bart Schaefer <schaefer@zsh.org> + + * Src/options.c: Zefram: 8152: A batch of tweaks to emulation + behavior (exec change omitted). + + * Doc/Zsh/options.yo, Src/options.c: Zefram: 8154: Change default + behavior of shortloops (extendedglob change omitted). + + * Src/exec.c: Add the coproc descriptors to those that can't be + copied by redirection. + + * Doc/Zsh/redirect.yo: Zefram: 8186: More accurate redirection doc. + + * Src/exec.c: Tweak 8187 to test the fdtable[] array rather than + simply > 9. + + * Src/glob.c, Src/exec.c: Zefram: 8187: Don't permit redirection + to grab zsh's internal descriptors. + + * Doc/Zsh/redirect.yo: Document the "&>" redirection and the use + of multi-digit numbers on the RHS of "<&" and ">&" redirections. + + * Src/lex.c: Fix parsing of the "&>" redirection. + + * Src/exec.c: Plug lead of a copy of the coproc input descriptor. + +1999-10-07 Bart Schaefer <schaefer@zsh.org> + + * Completion/User/_urls: Oliver K: 8155: Handle "file:" urls. + + * Src/Zle/zle_tricky.c: Tweak last patch slightly to avoid the + possibility of returning NULL. + + * Src/Zle/zle_tricky.c: Don't prematurely free/recreate the cached + value of $compstate[ambiguous]. + + * Functions/Prompts/promptinit: This function requires extendedglob. + +1999-10-06 Bart Schaefer <schaefer@zsh.org> + + * Functions/Misc/colors: + Adam: 8147: Use $'...' rather than $(echo -n '...'). + + * Misc/bash2zshprompt: Adam: 8144: Small fix. + + * Misc/bash2zshprompt, Functions/Prompts/prompt_adam1_setup, + Functions/Prompts/prompt_adam2_setup, + Functions/Prompts/prompt_blue_setup, + Functions/Prompts/prompt_combo_setup, + Functions/Prompts/prompt_cyan_setup, + Functions/Prompts/prompt_elite2_setup, + Functions/Prompts/prompt_elite_setup, + Functions/Prompts/prompt_fire_setup, + Functions/Prompts/prompt_green_setup, + Functions/Prompts/prompt_magenta_setup, + Functions/Prompts/prompt_off_setup, + Functions/Prompts/prompt_red_setup, + Functions/Prompts/prompt_redhat_setup, + Functions/Prompts/prompt_suse_setup, + Functions/Prompts/prompt_white_setup, + Functions/Prompts/prompt_yellow_setup, + Functions/Prompts/promptinit, Functions/Misc/colors, + Completion/User/_prompt: Adam: 8129: "Themed prompts" system + copied (and translated) from bash. + + * INSTALL, configure.in: Adam: 8145: Install the themed-prompt stuff. + + * Src/Modules/stat.c, Src/system.h: Zefram: 8137: Support for + Solaris "doors". + + * Src/jobs.c: Reattach the tty and resize the terminal after a + foreground job is stopped. + +1999-10-04 Bart Schaefer <schaefer@zsh.org> + + * Src/Zle/zle_refresh.c: Geoff: 8126: Fix infinite loop in + tc_rightcurs(). + +1999-10-03 Bart Schaefer <schaefer@zsh.org> + + * Src/builtin.c, Doc/Zsh/builtins.yo: PWS: 8093: Back out 8084. + + * Src/prompt.c: Use zcalloc() to allocate the buffer in + promptexpand(), so as not to leave garbage beyond the end of the + prompt after expansion. + + * Src/builtin.c: When computing the new directory for $PWD, don't + duplicate a trailing slash. + + * Etc/FAQ.yo: PWS: zsh-announce/100: Latest FAQ changes. + +1999-10-02 Bart Schaefer <schaefer@zsh.org> + + * Src/exec.c: Start the path search over from the beginning, not + from where it was last left off, after removing a bad element at + attempted-execute-time. + +1999-09-30 Bart Schaefer <schaefer@zsh.org> + + * Doc/Zsh/compsys.yo, Completion/Commands/_bash_completions: PWS: + 8108: Completions for bash equivalence. + + * Doc/Makefile.in: Adam: 8106: Use $(DESTDIR) when installing + info, too. + + * Completion/User/_my_accounts, Completion/User/_other_accounts, + Completion/User/_user@host, Completion/User/_user_at_host: Adam: + 8101: Change @ to _at_ in file names. + + * Completion/User/_perl_modules, Completion/User/_perldoc: Adam: + 8100: Small bugfix, whitespace cleanup. + + * Completion/Core/compinit, Doc/Zsh/compsys.yo: PWS: 8098: Add + "compdef -K" to map multiple widgets to the same function. + + * Doc/Zsh/guide.yo: PWS: 8097: Renamed to manual.yo. + + * Doc/Zsh/guide.yo, Doc/Zsh/intro.yo, Doc/Zsh/manual.yo, + Doc/Makefile.in, Doc/zsh.yo, Doc/ztexi.yo: PWS: 8097: Rename + "guide" to "manual" as PWS is working on another "guide." + + * Completion/User/_a2ps: Alexandre Duret-Lutz: 8094: Update for + newer versions of a2ps. + + * Src/params.c: Don't use tokenized strings as associative array keys. + + * Src/exec.c: PWS: 8086: Don't singsub() the LHS of assignments at + exec time. + + * Src/Zle/complist.c: PWS: 8072: Fix allocation state bug (massive + reindentation but no other real changes). + + * Doc/Zsh/builtins.yo: PWS: 8084: Reset $PWD in the "pwd" builtin + if unable to stat(pwd). This leaves the dirstack in an + inconsistent state and needs more looking-at. + + * Src/exec.c: Be a little smarter about fixing up the command + table when we find a bad element at attempted-execute-time. + +1999-09-28 Bart Schaefer <schaefer@zsh.org> + + * Src/builtin.c: PWS: 8084: Reset $PWD in the "pwd" builtin if + unable to stat(pwd). This leaves the dirstack in an inconsistent + state and needs more looking-at. + + * Completion/User/_man: Tanaka: 8082: Fix PWS's silly thinko. + +1999-09-27 Bart Schaefer <schaefer@zsh.org> + + * Completion/User/_user@host: Adam: 8065: Add forgotten file used + by _my_accounts and _other_accounts. + + * Doc/Zsh/compsys.yo: Adam: 8064: Documentation for _my_accounts + and _other_accounts usages. + + * Completion/User/_my_accounts, Completion/User/_other_accounts: + Adam: 8064,8065,8066: Assorted fixes and documentation. + + * Completion/User/_man: Adam: 8062: Fix to handle colon-delimited + "manpath" output (as corrected by PWS: 8067.) + +1999-09-26 Bart Schaefer <schaefer@zsh.org> + + * Src/signals.c: PWS: 8056: Wrap getiparam() in HEAPALLOC block + for math evaluation reasons. + +1999-09-26 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: Config/version.mk: 3.1.6-pws-6 + + * pws: 8051: Completion/User/_users_on: typos. + + * pws: 8050: Src/utils.c: getkeystring() used in ##<char> + (formally #\<char>) should return unsigned char. + + * pws: 8049: Src/math.c: use HEAPALLOC for math evals. + + * Adam: 8048: Completion/User/_my_accounts, + Completion/User/_other_accounts, Completion/User/_rlogin, + Completion/User/_ssh, Completion/User/_users_on: use + my_accounts and other_accounts for ssh and friends; + user users for write and potentially elsewhere. + + * Adam: 8047: Completion/User/_users: lasts uses _users. + + * Tanaka Akira: 8044: Completion/Base/_regex_arguments, + Completion/Debian/_apt: remove NULs from cache files, + fix some typos. + + * Tanaka Akira: 8042: Doc/Zsh/expn.yo, Src/subst.c, Src/utils.c: + ${(qqqq)...} now does $'...' quotation; rejigging unprintable + characters is now ${(V)...}. + +1999-09-24 Peter Stephenson <pws@ibmth.df.unipi.it> + * Tanaka Akira: 8039: Src/utils.c: quoting of backslashes inside + ${(qqq)...}. + + * pws: 8038: Completion/User/_tar: wouldn't use tar archives + beginning with a ~. + +1999-09-23 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 8033: Src/math.c: use '##' to get code for literal + character as less error-prone than `#\'. + + * Sven: 8030: Src/utils.c: 8019 needed to expand the buffer + even more. + + * pws: 8026: Src/math.c: idiotically made buffer too short + for error message. + + * Sven: 8023: Src/subst.c, Src/utils.c, Doc/Zsh/expn.yo: + ${(qqqq)...} quotes unprintables in bindkey fashion. + + * pws: 8022: Src/Zle/zle_misc.c: digit argument with metafied + digits didn't work. + + * Sven: 8021: Src/Zle/complist.c: keep better track of cursor + position when moving in a menu selection. + + * Vin Shelton and pws: 8020: Src/Zle/deltochar.c, + Doc/Zsh/mod_deltochar.yo: new zap-to-char, uses deltochar() + function but doesn't delete last occurrence (replaces 8010). + + * Sven: 8019: Src/utils.c: buffer overflow quoting newlines. + + * Sven: 8015: Completion/Commands/_history_complete_word, + Src/Zle/zle_tricky.c: bug without history_stop in + _history_complete_word; go backwards on line when scanning + history words. + + * pws: 8014: Src/math.c: arguments after the first in math + function skipped first character. + + * Sven: 8013: Completion/X/_x_keysym, Completion/X/_x_modifier, + Completion/X/_xmodmap: completion for keys and modifiers + in xmodmap. + + * Sven: 8012: Doc/Zsh/compsys.yo: document + incremental-complete-word configuration keys. + + * Sven: 8011: Src/Zle/comp.h, Src/Zle/complist.c, + Src/Zle/zle_tricky.c: better menu insertion with braces. + +1999-09-22 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 8004: Src/Zle/complist.c, Src/Zle/zle_tricky.c, + Doc/Zsh/compctl.yo, Doc/Zsh/compwid.yo: crash in selecting; + documentation for 8001. + + * Sven: 8001: Src/Zle/comp.h, Src/Zle/compctl.c, + Src/Zle/zle_tricky.c, Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Completion/Core/_description: -1 and -2 + flags to completion commands allow removal of consecutive and + non-consecutive duplicates. + + * pws: 7999, 8000: Doc/Makefile.in, Doc/Zsh/guide.yo, + Doc/Zsh/mod_mapfile.yo, Doc/Zsh/mod_mathfunc.yo, + Doc/Zsh/modules.yo, Doc/Zsh/mod_parameter.yo, + Src/Modules/mathfunc.c, Src/Modules/mathfunc.mdd, Src/math.c: + mathfunc module, contains 46 functions for use in math + evaluations; make function arguments behave like normal mathevals. + + * Sven: 7998: Src/Zle/comp.h, Src/Zle/complist.c, + Src/Zle/zle_tricky.c, Src/options.c, Src/zsh.h, + Doc/Zsh/options.yo: Display column sizes can be different + for different completion groups; LIST_PACKED and LIST_ROWS_FIRST + options change listing display behaviour; clean functions up. + + * pws: 7995: Completion/Builtin/_zmodload: when looking for module, + restrict to *.s[ol]. + + * Tanaka Akira: 7989: Completion/Base/_combination, + Completion/Debian/_apt, Completion/Base/_regex_arguments, + Doc/Zsh/compsys.yo: document _combination and _regex_arguments, + clean up relevant completion functions. + +1999-09-21 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7985: Src/Zle/zle_tricky.c: crash in old completion + with non-existent file. + + * pws: 7983: Src/hist.c: bug that hungetc() blindly went + ahead after keyboard interrupt fixed by testing for errflag + in hungetc(). + + * pws: 7981, 7982: Src/math.c, Src/zsh.h: use dupstring() + instead of lvalue stack; better ternary expression parsing; + old `unbalanced stack' messages shouldn't show up so become + debugging messages; arithmetical errors in unevaluated + portions don't cause shell errors. + + * Sven: 7978: Src/exec.c, Src/init.c, Src/utils.c: grow and shrink + underscore parameters properly. + + * Sven: 7976, 7977: Src/builtin.c, Src/math.c, Src/mkbltnmlst.sh, + Src/mkmakemod.sh, Src/module.c, Src/zsh.h, Src/Modules/example.c, + Src/Modules/example.mdd, Doc/Zsh/arith.yo, Doc/Zsh/builtins.yo, + Etc/zsh-development-guide: system for loading math functions + for use in math evals. + + * Sven: 7974: Src/Zle/zle_tricky.c: remove duplicates. + + * Bart: 7968: Completion/User/_mailboxes: mutt fixes. + +1999-09-20 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7963: Src/math.c, Src/subst.c: better error checking + for math evals; don't pass surrounding parentheses down for + $(( ... )). + + * Adam: 7961: Completion/User/_mailboxes: fun with variables and + elm. + + * Sven: 7960: Src/Zle/zle_tricky.c: too much deleted in path + completion. + + * Sven: 7959: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + fixes from previous patches which missed 3.1.6-pws-5. + + * pws: 7957: Src/module.c: `zmodload -e modname' in statically + linked shell didn't work. + + * pws: Config/version.mk: version 3.1.6-pws-5 + + * Sven: 7953: Completion/Commands/_expand_word, + Completion/Core/_expand, Doc/Zsh/compsys.yo: expand_completions + configuration key. + + * pws: 7952: Completion/X/_xutils: xrdb should complete file + arguments. + + * Sven: 7951: Src/subst.c, Doc/Zsh/expn.yo: parameter expansion flags + for quoting with single or double quotes. + + * Sven: 7950: Src/utils.c, Src/Zle/complist.c: more careful + with VARARR's. + + * Sven: 7949: Completion/X/_x_color, + Completion/X/_x_extension, Completion/X/_x_window, + Completion/X/_xutils: completion for standard X utilities. + + * pws: 7948: Src/glob.c, Src/pattern.c: indexes weren't + calculate properly in $mbegin, $mend, $MBEGIN, $MEND because + of Meta bytes. + + * Sven: 7947: Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo: + compstate[insert] can be all to insert all matches. + + * Sven: 7945: Src/Zle/zle_tricky.c, Completion/Core/_multi_parts, + Completion/Core/_path_files: better path completion with braces + + * Sven: 7944: Src/Zle/zle_tricky.c, Completion/Core/_multi_parts, + Completion/Core/_path_files, Completion/Core/_sep_parts: + new heuristic for deciding whether to add strings under match + control or if they are too ambiguous to be useful. + + * Sven: 7943: Doc/Zsh/compsys.yo: docs for long args syntax + in _arguments. + + * Bart: zsh-users/2610: Completion/Builtins/_kill, + Completion/Builtins/_wait, Completion/User/_gdb: split words + for ps arguments (replaces 2609). + + * Bart: 7938: Completion/Base/_arg_compile, Completion/Base/_describe: + pre-compiler for _arguments and typo in describe. + + * Tanaka Akira: 7937: Completion/User/_cvs, Completion/User/_lynx, + Completion/User/_wget: it's good to have _values. + + * Bart: 7934: Completion/User/_telnet: improvement. + + * Bart: 7932: Completion/User/_mailboxes: more generic. + + * Bart: 7929: Src/hist.c, Src/Zle/zle_tricky.c: handle gaps + in history when scanning through it. + + * Bart: 7928: Doc/Zsh/builtins.yo: typo in float stuff. + + * Bart: 7925: Functions/Misc/run-help: various functions and + builtins in manual pages other than zshbuiltins. + + * Adam: 7923: Completion/Core/compinit: compconf quoting tweak. + +1999-09-17 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7921: Src/glob.c: bad test in rarely used + (string/)# globbing construct. + + * Oliver: 7919: Completion/User/_man: try to find a manpath if + none (slightly adapted). + + * Sven: 7917: Src/loop.c: hunk missed from 7915. + + * pws: 7915: Doc/Zsh/arith.yo, Doc/Zsh/builtins.yo, + Src/Modules/parameter.c, Src/builtin.c, Src/cond.c, Src/exec.c, + Src/math.c, Src/mem.c, Src/params.c, Src/subst.c, Src/zsh.h, + configure.in: Floating point support via typeset -F and + typeset -E for variables and in matheval(). mnumber struct + passes around float or integer. + + * Sven: 7903: Completion/Builtins/_cd: more careful with + things from cdablevars. + + * Sven: 7902, 7912: Completion/Base/_arguments, + Doc/Zsh/compsys.yo: autodescribe_options. + + * Sven: 7900: Completion/Commands/_history_complete_word, + Doc/Zsh/compsys.yo: history_stop config opt stops history + cycling past end. + + * Sven: 7896: Src/Zle/zle_tricky.c: cursor positioning. + + * Tanaka Akira: 7892: Completion/User/_webbrowser: initial + implementation of completion for web browsers. + + * Adam: 7891: Completion/Core/compinit: error message in compdef. + + * Tanaka Akira: 7888: Completion/User/_wget: completion for wget. + + * Tanaka Akira; 7887: Completion/User/_telnet: try to get + valid telnet options. + + * Tanaka Akira: 7886: Completion/Base/_describe, + Completion/Debian/_apt, Completion/User/_cvs: -d option for + descriptions. + + * Adam: 7882: Doc/Zsh/expn.yo: parentheses. + +1999-09-16 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Adam: 7871: Completion/User/_perl_basepods, + Completion/User/_perl_builtin_funcs, + Completion/User/_perl_modules, Completion/User/_perldoc: + perl completion. + + * Sven: 7864: Src/Zle/zle_tricky.c: crash when browsing + directory hierarchies with select and selecting an entry. + + * Sven: 7863: Doc/Zsh/mod_parameter.yo, Src/Modules/parameter.c, + Src/Modules/parameter.mdd: $dirstack and $modules special + parameters. + + * Sven: 7866: Doc/Zsh/compsys.yo, Completion/User/_mutt: + action necessary. + + * Sven: 7862: Completion/Base/_arguments, Completion/User/_gcc, + Doc/Zsh/compsys.yo, Src/Zle/zle_tricky.c: completion for gcc, + -M match spec for _arguments, remove duplicate matches. + + * Clint: 7860: Completion/User/_mailboxes, Completion/User/_mutt: + mutt support. + +1999-09-15 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7855: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfopen: + failed zfopen with arguments deletes the stored open parameters. + + * Oliver: 7852: Completion/Builtins/_compdef, + Completion/User/_man: new compdef support, _man works for whatis + and apropos. + + * Sven: 7850: Completion/Base/_arguments: minor cleanup. + + * Sven: 7844: Src/Zle/complist.c, Src/Zle/zle_tricky.c, + Doc/Zsh/compsys.yo, Etc/completion-style-guide, + Completion/Base/_arguments, Completion/Base/_describe, + Completion/Base/_subscript, Completion/Base/_tilde, + Completion/Base/_values, Completion/Builtins/_cd, + Completion/Builtins/_kill, Completion/Builtins/_wait, + Completion/Core/_approximate, Completion/Core/_expand, + Completion/User/_gdb: various matching display bugs + (with compadd -d) and enhancements to correction and + approximation keys. + + * Tanaka Akira: 7840: Completion/Base/_tilde, + Completion/Builtins/_cd: use compadd -d. + + * pws: 7836: Src/Modules/zftp.c: bug from 7767: zftp rmsession + incremented node pointer wrongly and assigned new session + wrongly. + + * pws: 7834: Src/pattern.c: bug from 7825, pure string path + segments wouldn't approximate. + +1999-09-14 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7827: Src/Zle/comp.h, Src/Zle/compctl.c, + Src/Zle/complist.c, Src/Zle/zle_tricky.c, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Completion/Base/_arguments, + Completion/Base/_values, Completion/Core/_display, + Completion/User/_mount: compadd -d for list of elements + to display instead of matches, -l to show one per line, + plus changes in _display and uses thereof; typos in _mount. + + * pws: 7825, 7848: Doc/Zsh/expn.yo, Src/glob.c, Src/pattern.c, + Src/subst.c, Src/zsh.h: (#b) and (#m) globbing flags and + inverses; speed up compilation of pure string patterns. + + * Sven: 7823: Src/Zle/zle_tricky.c: improve joining of completion + strings with different match control behaviour. + + * Sven: 7824: Completion/Base/_arguments, Completion/Core/_message: + improve `no more arguments' message. + + * Sven: 7819: Completion/Base/_arguments, Doc/Zsh/compsys.yo: + use of $options for single character options. + + * Tanaka Akira: 7817: Completion/Debian/_apt, + Completion/User/_socket, Completion/User/_perl_builtin_funcs: + several improvements. + + * Tanaka Akira: 7815: Completion/User/_combination, + Completion/User/_ports, Completion/User/_socket, + Completion/User/_telnet: more sophisticated port/user + combinations via general combination mechanism. + + * Bart: 7813: Src/subst.c: correct incorrect application of + correction in 7697. + + * Tanaka Akira: 7740: Completion/User/_man: handle gzipped and + SGML manual pages. + +1999-09-13 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: zsh-users/2598: Functions/Zle/incarg: zle function to + increment number under cursor. + + * pws: 7812: Completion/X/_xrdb: now exists. + + * Tanaka Akira: 7809: Completion/Debian/_apt, Completion/User/_patch: + new apt options and typo in _patch. + + * Sven: 7808: Completion/Base/_arguments: don't add long options + sometimes. + + * pws: Config/version.mk: 3.1.6-pws-4. + + * Tanaka Akira: 7806: Completion/Users/_pbm: missing backslash. + + * Sven: 7804: Completion/Base/_arguments: `no more arguments' + message. + + * Sven: 7801: Completion/Base/_arguments: listing problem with + arguments. + + * Sven: 7800: Completion/Core/_normal: terminate whence options to + avoid error message. + + * Sven: 7798: Doc/Zsh/compwid.yo, Src/Zle/comp.h, + Src/Zle/compctl.c, Src/Zle/zle_tricky.c, + Completion/Base/_brace_parameter, Completion/Base/_parameter, + Completion/Core/_parameters: compadd -e treats arguments as + parameters for AUTO_PARAM_SLASH and AUTO_PARAM_KEYS. + + * Sven: 7797: Doc/Zsh/compsys.yo, + Completion/Commands/_verbose_list, Completion/Core/_oldlist: + _verbose_list widget makes completion function lists + progressively more verbose. + + * Sven: 7796: _arguments uses describe_values config key; other + misc. fixes. + + * Sven: 7795: Completion/User/_mount: mounting excitement. + + * Sven: 7793: Completion/User/_ispell: ispell completions. + + * Sven: 7792: Completion/User/_bison, Completion/User/_flex: + not particularly hairy bison and flex completions. + + * Sven: 7791: Src/Zle/zle_tricky.c: completion code numbers. + + * Sven: 7790: Completion/User/_pbm, Completion/User/_ssh, + Completion/Linux/_rpm: miscellaneous tidying. + + * Sven: 7789: Completion/User/_tiff: completions for conversions + to/from tiff format. + + * Bart: 7784, 7787: Src/utils.c: memory use in bslashquote + (cf. 7713). + + * Tanaka Akira: 7779, 7781: Completion/User/_hosts, + Completion/User/_telnet, Completion/User/_socket: telnet and + socket completions with ports. + + * Bart and pws: 2592: Functions/Zle/history-search-end, + Functions/Zle/predict-on: new Zle functions for fancy history + searching. + + * Tanaka Akira: 7778: Completion/Base/_regex_arguments: implement + cache. + + * Tanaka Akira: 7777: Completion/Base/_regex_arguments, + Completion/Debian/_apt: more apt utilities handled, condensed to + single file; _apt-cache, _apt-get and _apt_arguments deleted. + +1999-09-10 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7767: Completion/Builtins/_zftp, Doc/Zsh/mod_zftp.yo, + Doc/Zsh/zftpsys.yo, Functions/Zftp/zfanon, + Functions/Zftp/zfautocheck, Functions/Zftp/zfcd, + Functions/Zftp/zfcd_match, Functions/Zftp/zfcget, + Functions/Zftp/zfdir, Functions/Zftp/zffcache, + Functions/Zftp/zfgcp, Functions/Zftp/zfget, + Functions/Zftp/zfget_match, Functions/Zftp/zfgoto, + Functions/Zftp/zfinit, Functions/Zftp/zfmark, + Functions/Zftp/zfopen, Functions/Zftp/zfparams, + Functions/Zftp/zfpcp, Functions/Zftp/zfrglob, + Functions/Zftp/zfsession, Functions/Zftp/zfstat, + Functions/Zftp/zftp_chpwd, Functions/Zftp/zftp_progress, + Functions/Zftp/zftransfer, Functions/Zftp/zfuget, + Functions/Zftp/zfuput, Src/Modules/zftp.c: + new session management for zftp (session, rmsession); new + functions zfsession, zftransfer, zffcache; various completion + and argument-handling improvements. + + * pws: 7765: Src/builtin.c, Src/exec.c: getopts didn't reset + counter for index into option list properly; didn't set option + variable to "?" when printing its own error message. + + * Tanaka Akira: 7763: Completion/Base/_arguments: bad argument + indexing. + +1999-09-09 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7750: Completion/Base/_arguments: fix option aliasing. + + * Tanaka Akira: 7748: Completion/User/_urls, + Completion/Core/_display: missing "$@" and X. + + * Sven: 7747: Doc/Zsh/compsys.yo, Completion/Base/_first, + Completion/Commands/_history_complete_word, + Completion/User/_cvs, Completion/User/_groups, + Etc/completion-style-guide: Mainly documentation changes: group + configuration keys into a single section. + + * Tanaka Akira: 7744: Completion/User/_patch: argument changes. + + * Sven: 7739: Completion/User/_rlogin: improvements. + + * pws: 7738: Completion/User/_man: didn't work with correction + and approximation. + + * Sven: 7737: Completion/User/_ssh, Completion/User/_users: + slogin, scp, and user@host; use array $users if defined. + + * Sven: 7736: Src/Zle/zle_tricky.c, Completion/Core/_display: + + * Sven: 7734: Src/Zle/complist.c, Src/Zle/zle_tricky.c: + displays of lists with disparate lengths and different groups of + matches with the same name. + + * Tanaka Akira: 7729, 7735: Completion/Debian/_apt-get, + Completion/Debian/_apt_arguments, Completion/Debian/_apt-cache: + apt-get and apt-cache completion improvments. + +1999-09-08 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 7723: Completion/User/_cvs: typo. + + * Sven: 7722: Completion/User/_dvi, Completion/User/_rlogin, + Completion/User/_ssh, Completion/User/_yodl, + Completion/User/_yp: new _yodl and all-round improvements. + + * Tanaka Akira: 7720: Completion/Base/_regex_arguments, + Completion/Debian/_apt_arguments, _apt-get: regular expression + argument parsing, used for apt-get. + + * Sven: 7718, 7719: Completion/Base/_arguments, + Completion/Linux/_rpm, Doc/Zsh/compsys.yo: better handling for + combined single-letter options. + + * Sven: 7716: Completion/Core/_complete, Completion/Core/_normal, + Completion/Base/_precommand: modify 7693 so that _normal always + resets _compskip unless called from _complete (via -s option). + + * Sven: 7714: Src/Zle/zle_tricky.c: problem displaying multiople + completion messages. + + * Sven: 7713: Src/utils.c: buffer for backslash quoting was too + short. + + * Sven: 7712: Src/text.c: fix core dump in case. + + * Bart: 7707: Config/installfns.sh, Config/uninstallfns.sh: + insert $DESTDIR as internal prefix of $fndir. + + * Bart, Tanaka Akira: 7705, 7706, 7709: Completion/User/_cvs: + select cvs function by substitution. + + * Clint: 7704: Makefile.in, Completion/Makefile.in, + Doc/Makefile.in, Functions/Makefile.in: betting distclean for + Completion/Makefile, Functions/Makefile, Config/defs.mk. + + * Clint: 7703: Config/installfns.sh: $DESTDIR prefixes $fndir. + + * Bart: 7697: Src/subst.c: sroted -> sorted. + +1999-09-07 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7693: Completion/Base/_precommand: unset _compskip for + redoing _normal after _precommand. + + * Sven: 7690: Completion/Base/_arguments, Completion/User/_gprof, + Completion/User/_gs, Completion/User/_gv, + Completion/User/_patch, Completion/User/_xargs, + Completion/X/_x_arguments, Completion/X/_xt_arguments, + Doc/Zsh/compsys.yo: more exclusion lists and states, different + return value for using states. + + * Sven: 7687: Completion/Base/_arguments, Completion/User/_yp, + Doc/Zsh/compsys.yo: _arguments allows case where an option turns + off normal argument handling, new _yp function, space in action + means no action. + + * Sven: zsh-users/2576, zsh-users/2578: fix typeset -Z and typeset + -R. + + * Tanaka Akira: 7675: Completion/User/_hosts: remove nslookup, + since that uses _nslookup. + + * Adam: 7674: Doc/Zsh/compsys.yo, Etc/completion-style-guide: + typos. + + * Adam: 7671: Completion/Linux/_rpm: tyeset -> typeset, + build_b completes *.spec. + + * Tanaka Akira: 7670, 7686: Completion/User/_cvs, INSTALL, + configure.in: _cvs back in one function, remove Completion/Cvs. + + * John Williams: 7669: Src/builtin.c: __CYGWIN should be __CYGWIN__ + +1999-09-06 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7662: Etc/completion-style-guide: subcommands and using + funcall to test state functions. + + * pws: 7660: Src/Modules/cap.c: changes as per 7591; initialize + variables to silence compiler. + + * Sven: 7656: Doc/Zsh/compsys.yo: display fixes. + + * Sven: 7655: Src/Zle/zle_tricky.c: bug completing on continuation + line. + + * Sven: 7654: Src/Zle/zle_thingy.c: error calling zle -R outside + widget. + + * pws: Config/version.mk: 3.1.6-pws-3 + + * Sven: 7652: Doc/Zsh/compsys.yo, Completion/Base/_values, + Completion/User/_hosts, Completion/User/_nslookup, + Functions/Misc/nslookup: complete assignment-like arguments, + nslookup wrapper with completion. + + * pws: 7651: Doc/Zsh/options.yo: document HIST_FIND_NO_DUPS. + + * Sven: 7650: Doc/Zsh/compsys.yo, Completion/Base/_arguments, + Completion/Core/_display, Completion/Core/compinit, + Completion/Linux/_rpm, Completion/User/_urls, + Completion/X/_x_color, Etc/completion-style-guide: + urls_dir -> urls_path, colors_path allow paths for URLs and X + colours; funcall; _arguments changes: options assoc, states + available using '->name', option descriptions for mutually + incompatible options, descriptions of individual options, + option_prefix allows ~command; _display for compadd -y; + new _rpm; style guide additions. + + * pws: 7649: Src/pattern.c: bug with excluding multiple + directories with ~ in 7611, 7626. + + * Adam Spiers: 7647: Completion/User/_perl_basepods, + Completion/User/_perl_builtin_funcs, + Completion/User/_perl_modules, Completion/User/_perldoc: + completion for perldoc. + + * Tanaka Akira: 7641, 7646: Completion/Debian/_apt-get, + Completion/Debian/_deb_packages: handle different apt-get + keywords. + +1999-09-03 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7639: Doc/Zsh/expn.yo, Src/glob.c: remember that + (foo/)# is a special case for file globbing; fix bug that + that pattern generated a null string. + + * pws: 7637: Doc/Zsh/expn.yo: clarify some glob descriptions + including change that / inside parentheses is error (rather than + just screwing up pattern) for file globbing. + + * Bart: zsh-users/2567: Doc/Zsh/options.yo: new improved + GLOB_COMPLETE description. + + * pws: 7636: Doc/Zsh/builtins.yo, Doc/Zsh/params.yo, + Src/builtin.c, Src/zsh.h, Src/Modules/mapfile.c, + Src/Modules/parameter.c: typeset -h allows locals to hide + specials; turned on automatically for specials in mapfile and + parameter modules. + + * Sven: 7635: Completion/User/_urls: change configuration key to + urls_dir. + + * Tanaka Akira: 7634: Completion/Debian/_apt-get, + Completion/Debian/_deb_packages: completion for apt-get. + + * Tanaka Akira: 7633: Completion/User/_lynx, + Completion/User/_urls: completion for lynx and general URL + completion. + +1999-09-02 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7632: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfautocheck, + Functions/Zftp/zfinit, Functions/Zftp/zfrglob, + Functions/Zftp/zftp_progress: bar-style progress meter, zfconfig + associative array for configuration. + + * Sven: 7631: Completion/User/_pbm: comment about overriding + definitions. + + * Sven: 7630: Src/zle_tricky.c: when using a matcher spec + generating matches with missing characters, position on last set + of missing characters instead of first. + + * Sven: 7628: Src/params.c, Src/Modules/parameter.c, + Completion/Core/_parameters, Completion/Core/_path_files: + parameters gives `undefined' message; _parameters doesn't + load undefined parameters; do partial path expansion after + parameters. + + * pws: 7627: Src/params.c: don't autoload parameter just to + unset it (replaces 7616). + + * Sven: 7625: Completion/Base/_arguments: expansion fix. + + * Tanaka Akira: 7623: Completion/X/_xv: complete .jpg and .png + files. + + * Bart: 7618: Config/installfns.sh, Config/uninstallfns.sh: + space required in $sdir substitution. + + * Bart: 7617: Src/signals.c: set err to -1. + +1999-09-01 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7613: Completion/User/_gv: typos + + * pws: 7611, 7626: Src/pattern.c, Src/parse.c, Doc/Zsh/expn.yo: + strip parentheses from case label with open and close + parentheses; use unions for pattern alignment, optimize lowest + level character reading routine, optimize ...*string pattern, + optimize search for characters terminating processing, document + some more existing pattern features. + + * Sven: 7607: Completion/Base/_arguments: behaviour after a + non-option when using `*::'. + + * Sven: 7605: Src/exec.c, Src/jobs.c: use killpg instead of + altering process group when leader exits, fix fg test to use + killpg. + + * Sven: 7598: Src/Zle/zle_tricky.c: REC_EXACT behaviour. + + * Sven: 7596, 7601: Completion/Base/_arguments: interaction of option + arguments with default. + + * pws: 7591: Src/utils.c: cap_free should take caps (not pointer + to it) as arg. + + * Bart: 7584: Src/jobs.c, Src/signals.c, Src/system.h: handle + broken ESRCH by redefining ESRCH to EINVAL. + + * Tanaka Akira: 7580: Completion/Cvs/_cvs, + Completion/Cvs/_cvs_diff, Completion/Cvs/_cvs?history_x: + arguments for options; cvs diff description. + + * Sven: 7574, 7577, 7597: Src/subst.c, Doc/Zsh/expn.yo: modify + 7539 so that the % flag just does % expansion, while %% does + full prompt expansion. + + * Sven: 7573: Src/signals.c, Src/exec.c, Src/utils.c: fix return + value of killjb(); pipelines which lose their leader get a new + one. + +1999-08-31 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Will Day: 7362: Src/Makefile.in, Src/hist.c, Src/jobs.c, + Src/signals.c, Src/system.h, acconfig.h: support for BeOS: test + more capabilities. This was present in 6-pws-1, but without + a Changelog entry. + + * Sven: -7540: withdrawn, use ${${${(M)name#pattern}:+then}:-else}. + + * Tanaka Akira: 7436: Src/exec.c: exec last command in sequence + properly; don't increment SHLVL when exec'ing. + + * Sven: 7564: Completion/X/_xterm, Completion/Pbmplus/_pgmtoppm, + Completion/Pbmplus/_pnmalias, Completion/Pbmplus/_pnmmargin, + Completion/Pbmplus/_ppmchange, Completion/Pbmplus/_ppmmake, + Completion/Pbmplus/_ppmtoacad, Completion/User/_gs, + Completion/X/_xdvi, Completion/X/_xfig, Completion/X/_xsetroot, + Completion/X/_xt_arguments, Completion/X/_xterm, + Completion/X/_xv: change some names. + + * Bart: 7562: corresponding fix for Config/uninstallfns.sh + + * Tanaka Akira: 7561: Config/installfns.sh: administrative files + from Functions and Completion were installed by mistake. + + * Bart: 7414: Doc/ztexi.yo: @'@' breaks texinfo; use '@:'. + + * Bart: 7557: Src/Makefile.in: typo adding $(DESTDIR) patch by + hand. (Also from Ollivier Robert, 7558, and Oliver Kiddle). + +1999-08-30 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: Config/version.mk: 3.1.6-pws-2 made available. + + * Tanaka Akira: 7551: Doc/Zsh/expn.yo: mismatched parenthesis. + + * Sven: 7549: Src/hist.c: shell wouldn't exit if writing history + file failed. + + * Sven: 7548: Completion/User/_xargs: new. + + * Sven: 7541: Completion/Base/_arguments: fix. + + * Sven: 7540: Src/subst.c, Doc/Zsh/expn.yo: ${name^pat^then^else} + tests string and substitutes appropriately. + + * Sven: 7539: Src/subst.c, Doc/Zsh/expn.yo: % parameter flag does + prompt escapes. + + * Sven: 7538: Completion/Base/_arguments: completion of trailing + non-option arguments. + + * Sven: 7535: Src/glob.c: don't restore badcshglob. + + * Sven: 7533: Completion/Rpm/*, Completion/Base/_arguments, + Completion/User/_a2ps, Completion/User/_configure, + Completion/User/_dvi, Completion/User/_gdb, Completion/User/_gs, + Completion/User/_gs_name, Completion/User/_patch, + Completion/User/_pspdf, Completion/User/_tar, + Completion/User/_use_lo, Completion/User/_xfig, + Completion/User/_xsetroot, Completion/User/_xterm, + Completion/X/_gv, Completion/X/_xdvi, + Completion/X/_xt_arguments, Completion/X/_xv, + Doc/Zsh/compsys.yo: argument handling; new rpm functions. + + * Sven: 7532: Src/Zle/zle_tricky.c: completion bug. + + * Bart, Sven: 7529, 7530: process groups not continued properly. + + * Bart: 7527: KSH_ARRAYS messed up assignment to a + hash, plus 7521 typo. + + * Bart: 7521: Src/init.c: replace 7472 and 7490 with thing that + tests if hashed command is really there. + + * Sven: 7517: Completion/Base/_arguments, + Completion/Pbmplus/_pbmtext, Completion/Pbmplus/_pbmtopk, + Completion/Pbmplus/_pktopbm, Completion/Pbmplus/_pnmcomp, + Completion/Pbmplus/_pnmtoddif, Completion/Pbmplus/_psidtopgm, + Completion/Pbmplus/_pstopnm, Completion/User/_gdb, + Completion/User/_gprof, Completion/User/_x_options, + Completion/User/_xfig, Completion/User/_xsetroot, + Completion/X/_x_borderwidth, Completion/X/_x_geometry, + Completion/X/_x_locale, Completion/X/_x_name, + Completion/X/_x_resource, Completion/X/_x_selection_timeout, + Completion/X/_x_title, Completion/X/_xv: use _arguments more. + + * Tanaka Akira: 7516: Completion/Base/_arguments, + Completion/Cvs/_cvs, Completion/Cvs/_cvs_command: fixes. + + * Sven: 7515: Doc/Zsh/compsys.yo, Completion/Base/_arguments, + Completion/Pbmplus/_pnmtotiff, Completion/Pbmplus/_ppmtomitsu, + Completion/User/_find: _arguments allows descriptions in list of + possibilities. + + * Sven: 7514: Src/glob.c, Doc/Zsh/expn.yo: use REPLY to set + filename. + + * Bart: 7510: Src/init.c: zsh -ce interprets e as option, not + command. + + * Sven: 7512: Completion/Base/_arguments: complete function. + + * Sven: 7500: Completion/Base/_arguments, + Completion/Cvs/_cvs_command, Completion/User/_find: + word-splitting in _arguments. + + * Tanaka Akira: 7495: Completion/Cvs/_cvs*: new cvs functions. + + * Sven: 7496: Src/glob.c, Src/zsh.h, Doc/Zsh/expn.yo: glob + qualifier e:string: with $_ set to filename. + + * Sven: 7492: Completion/Base/_arguments, Completion/User/_find, + Completion/X/_x_font: speed up _arguments. + + * Sven: 7490: Src/exec.c: change 7472 not to try test on hashed + command. + + * Sven: zsh-users/2511: Src/Zle/zle_tricky.c: bad (old) completion + after `$(<'. + + * Sven: 7482: Src/exec.c, Src/glob.c, Src/zsh.h, Doc/Zsh/expn.yo: + F:func: glob qualifier calls func to determine whether to + include file. + + * Sven: 7480: Src/Zle/zle_tricky.c, Completion/Core/_multi_parts, + Completion/User/_xterm, Completion/X/_x_font, + Completion/X/_xt_arguments: matching bug. + + * Sven: 7478: Doc/Zsh/compsys.yo, Completion/Base/_arguments, + Completion/Builtins/_vars_eq: handling of :: in _arguments. + + * Tanaka Akira: 7477: Completion/User/_xterm, + Completion/X/_x_borderwidth, Completion/X/_x_font, + Completion/X/_x_geometry, Completion/X/_x_locale, + Completion/X/_x_name, Completion/X/_x_resource, + Completion/X/_x_selection_timeout, Completion/X/_x_title, + Completion/X/_xt_arguments, Completion/X/_xt_session_id: + use standard XToolkit arguments. + + * Sven: 7472: Src/exec.c: crash in isreallycom(). + + * Sven: 7469: Completion/Base/_arguments, + Completion/Base/_command_names, Completion/Builtins/_zftp, + Completion/Core/_complete, Completion/Core/_main_complete, + Completion/Core/_normal, Completion/User/_x_display, + Completion/User/_x_options, Completion/User/_xterm: fix + word-splitting for _arguments. + + * Sven: zsh-users/2505: parameter with non-empty prefix. + + * Tanaka Akira: 7468: Completion/User/_xterm: xterm argument + completion. + + * Sven: zsh-users/2502: completing '=$' erased word. + + * Sven: 7467: Doc/Zsh/compsys.yo, Completion/Base/_arguments, + Completion/Base/_long_options: allow an _arguments option to + swallow everything to end of line. + + * Sven: 7465: Src/params.c: reverse indexing of associative + arrays. + + * Sven: 7463: Src/Zle/compctl.c, Doc/Zsh/compsys.yo, + Completion/Base/_arguments, Completion/Base/_brace_parameter, + Completion/Base/_condition, Completion/Base/_long_options, + Completion/Base/_math, Completion/Base/_parameter, + Completion/Base/_tilde, Completion/Base/_vars, + Completion/Builtins/_vars_eq, Completion/Builtins/_zftp, + Completion/Commands/_correct_filename, + Completion/Commands/_correct_word, + Completion/Commands/_expand_word, + Completion/Commands/_history_complete_word, + Completion/Commands/_most_recent_file, + Completion/Commands/_read_comp, Completion/Core/_parameters, + Completion/Core/compinit, Completion/User/_chown, + Completion/User/_dir_list, Completion/User/_exec_funcs, + Completion/User/_find, Completion/User/_gprof, + Completion/User/_rlogin, Completion/User/_su, + Completion/User/_tar, Completion/User/_users, + Util/completion-style-guide: miscellaneous completion fixes. + + * Tanaka Akira: 7460. 7461: Completion/Base/_arguments, + Completion/User/_patch: _arguments -s handling with --. + + * Clint Adams: 7459: Config/funcinst.mk, Config/installfns.sh, + Doc/Makefile.in, Src/Makefile.in, Src/Makemod.in.in: can set + DESTDIR to specify install prefix. + + * Tanaka Akira: 7458: Completion/Base/_arguments, + Completion/Base/_long_options, Completion/User/_patch: + _patch function and required fixes. + + * Sven: 7457: Doc/Zsh/compsys.yo, Completion/Base/_arguments: + handle short options. + + * Sven: 7455: Src/Zle/complist.c: handle lengths of capabilities. + + * Sven: 7454: Doc/Zsh/compsys.yo, Completion/Base/_arguments, + Completion/Core/_message: option prefix configuration. + + * Sven: 7429: _pbm: more stuff + + * Tanaka Akira: 7451: Completion/Core/_message, + Completion/Pbmplus/_pbmtoepsi, Completion/Pbmplus/_pktopbm, + Completion/Pbmplus/_yuvtoppm, Doc/Zsh/compsys.yo: some small + mistakes. + + * Sven: 7441: Src/Zle/zle_tricky.c: matching control bug. + + * Sven: 7450: Completion/Base/_arguments, + Completion/Base/_long_options, Completion/Base/_subscript, + Completion/Builtins/_zmodload, Completion/User/_colors, + Completion/User/_cvs, Completion/User/_gdb: explanations and + arguments. + + * Tanaka Akira: 7431: Completion/User/_colors: null glob. + + * Tanaka Akira: 7432: Completion/User/_cvs: update. + + * Sven: 7449: Src/module.c, Src/params.c: better errors for failed + autoloading; + + * Sven: 7448: too many files under Completion to list, including + new Pbmplus directory: revised pbm completion; pattern completion + only if no specific completion; descriptions for completions; + better handling for command line arguments. + + * Tanaka Akira: 7417: Completion/User/_pdf, Completion/User/_ps, + Completion/User/_pspdf: more programs that take ps or pdf files. + + * Sven: 7430: matching control bug: Src/Zle/zle_tricky.c, + Completion/User/_colors, Completion/User/_cursors, + Completion/User/_x_options, Completion/User/_xsetroot: + bug in matching control. + + * Tanaka Akira: 7428: Completion/User/_pbm, + Completion/User/_colors: fix some problems. + + * Sven: 7420: Src/Zle/zle_tricky.c, Doc/Zsh/compsys.yo, + Completion/Base/_first, Completion/Builtins/_zftp, + Completion/Core/_complete, Completion/Core/_main_complete, + Completion/Core/_normal, Completion/User/_colors, + Completion/User/_pbm, Completion/User/_x_options: _compskip + extended to allow choice of what to skip. + + * Sven: 7418: Completion/User/_pbm: new + + * Sven: 7446: print -P %s didn't work. + + * Bart: 7410: parameter flags doc for M. + + * Sven: 7404: Src/glob.c: repeatedly matching empty string + (somehow). + +1999-08-06 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: Config/version.mk: 3.1.6-pws-1 made available. + + * Sven: 7386: Src/subst.c: Order of q and Q parameter flags matters. + +1999-08-05 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7380: Src/hist.c, Src/subst.c, Doc/Zsh/expn.yo: flag X for + reporting errors de-quoting. + + * Sven: 7374: Src/subst.c, Doc/Zsh/expn.yo: modifier to remove one + level of quotation, corresponding flags. + + * Sven: 7373: Src/Zle/comp.h, Src/Zle/zle_tricky.c, + Completion/Base/_brace_parameter: support nested parameter + expansion type of deal. + +1999-08-04 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7355: Src/Zle/compctl.c, Src/Zle/zle_tricky.c: make + compadd quoting consistent with compgen. + +1999-08-02 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7349: Src/loop.c, Src/signals.c: restore errflags in + select after a zleread; fix problem restoring function-style trap + after a function set it to something else. + + * Sven: 7348: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + remove path_keepdir configuration key but don't do keepdir + trick unless _files had no type arguments. + + * Sven: 7345, 7346, 7347: Src/Zle/zle_tricky.c: match control + problems. + + * Sven: 7344, 7353: Src/cond.c, Src/Modules/example.c, + Src/Zle/compctl.c, Util/zsh-development-guide: conditions can + get the tokenized string; better quoting behaviour in + IPREFIX/ISUFFIX. + + * Sven: 7343: Src/Zle/zle_tricky.c: quote path prefix and suffix + earlier. + + * pws: 7342: Doc/Makfile.in: use makeinfo ... || exit 0 to + ignore result of makeinfo. + + * Irving Wolfe: 7336: utils.c: same fcntl() change. + + * Geoff: 7335: init.c: third argument for fcntl(). + +1999-08-01 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: Config/version.mk: zsh 3.1.6 released. + +1999-07-30 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws, Bart: 7321, 7325: Src/hist.c: NO_BANG_HIST wasn't working + at all, but be careful not to disable too much when it's + in effect. + + * Tanaka Akira: 7318: Completion/User/_cvs: more improvements + +1999-07-29 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7316: Doc/Zsh/compsys.yo: mention that compctl -M control + is available and fix some typos. + + * pws: unposted: Doc/Zsh/metafaq.yo: sites in Italy and Poland + (the one in Italy is not `official', but is actively mirroring + ftp.zsh.org anyway). + + * Felix Rosencrantz: 7311: Src/Zle/zle_tricky.c: matching control + left dangling pointers. + + * Tanaka Akira: 7312: Completion/User/_cvs: don't quote ignore + patterns. + +1999-07-28 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7308, 7309: Src/Zle/zle_tricky.c: glob patterns were + limited to PATH_MAX and length wasn't tested. + + * Tanaka Akira: 7307: Completion/User/_cvs: remove parentheses, + complete argument options. + + * pws: 7305: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfanon, + Functions/Zftp/zfget, Functions/Zftp/zfopen, + Functions/Zftp/zftp_chpwd: use URL-style paths in opening; + zfget -c sends output to stdout; don't delete current directory + information if we haven't really changed directory. + + * Bart: 7301: Completion/User/_cvs: restored .file completion + +1999-07-27 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7300: Completion/Core/compdump: wasn't ignoring . in fpath, + although compinit was. + + * pws: 7299: configure.in: don't use gcc -pedantic any more, since + there are too many messages about `long long' and variable-sized + arrays not being available in ISO C. + + * pws: 7298: Src/Zle/zle_tricky.c: missing dupstring() in + comp_match. + + * pws: 7297: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + path_keepdir config key required for 7141 to come into effect + due to significant side effects. + + * Tanaka Akira: 7290, 7292: Completion/User/_cvs: condensed + version of all _cvs completion stuff; completes files if not + under CVS control; use compgen -p to work around problem with + quoted characters. + + * Andrej: 7827: Etc/Machines: Siemens info + + * Bart: 7285, applied by hand: Completion/User/_cvs: parameter + fixes, commit bug. + + * Tanaka Akira: 7284: Completion/Core/compdump: careful when + two shells start at once. + + * Tanaka Akira: 7282: Completion/User/_cvs, + Completion/User/_cvsaddp, Completion/User/_cvsentries_modified, + Completion/User/_cvsprefix, Completion/User/_cvsremovep, + Completion/User/_cvstargets, Completion/User/_cvstargets_modified: + handle modified files using stat module. + +1999-07-26 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 7278: Completion/Base/_complete_opts: + less verbosity + +1999-07-25 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 7276, 7277, 7279: Completion/User/{_cvs, _cvsaddp, + _cvsentries, _cvsprefix, _cvsremovep, _cvsrepositories, + _cvsrevisions, _cvstargets, _cvstest}, Misc/compctl-examples: + more modular cvs new completion support including CVS/Entries; + bug fix for old CVS completion. + + * Bart: 7275: Doc/intro.ms: now works with groff. + + * Bart: 7274: Src/Zle/zle_tricky.c: don't go beyond end of line + + * pws: from Bart: Etc/CONTRIBUTORS, Etc/NEWS: updates for 3.0.6 + +1999-07-24 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: version 3.1.6-test-3 + + * pws: lastest FAQ.yo, FAQ + +1999-07-23 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7264: Completion/Commands/_correct_filename, + Completion/Commands/_correct_word, + Completion/Commands/_expand_word, + Completion/Commands/_history_complete_word, + Completion/Commands/_most_recent_file, + Completion/Commands/_read_comp, Completion/Core/compinit, + Doc/Zsh/compsys.yo: compdef -k takes -n option not to override + existing keybinding; used in completion command widgets to + keep user bindings during compinit. + + * Sven: 7260: Completion/Core/_main_complete: commented-out + option saving bit can uses parameter module + + * Sven: 7259, 7261: Src/subst.c, Src/Modules/parameter.c, + Doc/Zsh/expn.yo, Completion/Core/_normal, + Completion/Core/_parameters: parameter module provides + local information; used in _parameters; _normal uses + $commands when available. + + * pws: 7257: Completion/Core/_parameters: simplify. + + * Tanaka Akira: 7256: Completion/User/_bzip2, + Completion/User/_bunzip2: new. + + * Tanaka Akira: 7255: Completion/User/_make: complete after =. + + * Oliver: 7254: Completion/Builtins/_aliases: do unalias. + +1999-07-22 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7253: Doc/Zsh/arith.yo, Doc/Zsh/builtins.yo, + Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, + Doc/Zsh/cond.yo, Doc/Zsh/expn.yo, Doc/Zsh/files.yo, + Doc/Zsh/func.yo, Doc/Zsh/grammar.yo, Doc/Zsh/invoke.yo, + Doc/Zsh/jobs.yo, Doc/Zsh/mod_stat.yo, Doc/Zsh/mod_zle.yo, + Doc/Zsh/options.yo, Doc/Zsh/params.yo, Doc/Zsh/redirect.yo, + Doc/Zsh/zle.yo, Doc/ztexi.yo, Util/zsh-development-guide: + General documentation fixes and enhancements. + + * Sven: 7251: Src/Zle/zle_tricky.c: completion words wrapper + tweak thing. + +1999-07-21 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Bart: 7246: Completion/Builtin/_functions: complete for + _functions. + + * Tanaka Akira, Sven: 7243, 7250: Completion/Base/_complete_opts, + Completion/User_cvs: enhancements for cvs completion. + + * Sven: 7241: Completion/Base/_first: typos + + * pws: 7231: README, Etc/CONTRIBUTORS: notes for latest release + including possible incompatibilities. + + * Bart: 7230: Src/exec.c: cancd2 didn't free string properly + (or at all, in fact). + + * Tanaka Akira, Bart: 7228: Completion/User/_cvs, + Completion/User/_complete_opts: completion for cvs. + +1999-07-20 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7226: INSTALL: mention that dependent libraries of zle + can't be used if zle is dynamically loaded on systems without + working RTLD_GLOBAL. + + * pws: 7223: Doc/Makefile.in, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/mod_complist.yo, + Doc/Zsh/mod_zftp.yo, Doc/Zsh/mod_zle.yo, Doc/Zsh/zftpsys.yo: + dependences for texinfo manual; extra index entries. + + * Sven: 7220: Src/Zle/complist.c: `*=' works and the last + column is set. + + * Sven: 7219: Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo: + compstate[force_list] now works as documented. + + * Sven: 2456: Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo: + clear explanation string; document compstate[insert]='' + is same as unsetting. + + * pws: 7218: Doc/Makefile.in, Doc/zman.yo: delete all manual + page lines beginning .'; work around yodl .SH ""NAME problem. + + * Sven: 7217: Src/exec.c: duplicate function name for scriptname. + + * Sven: 7216: Src/Zle/zle_tricky.c: insertion with old and + new completion. + + * Tanaka Akira: 7213: Doc/Makefile.in: postprocess manual pages + to remove yodl cruft. + + * Ollivier: 7209, 7210: configure.in, Etc/MACHINES: Elf and a.out + dynamic loading on FreeBSD (MACHINES entry adapted). + +1999-07-19 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 7205: Src/Modules/mapfile.c: MS_SYNC was not + defined on SunOS 4. + + * pws: 7202: Src/Modules/clone.c: add an extra zero argument + to ioctl() to make three. + + * pws: from Ollivier Robert: Etc/MACHINES: FreeBSD 4.0 builds OK. + + * pws: 7196: Src/Zle/zle_tricky.c: try to handle multiple supplied + (-P) prefixes better. + + * pws: 2446: Completion/User/_rlogin: handle user@host better. + + * pws: version 3.1.6-test-2 + + * pws: 7192: Src/glob.c: bug with null in pattern if at end of + test string (matched as if a real character). + +1999-07-18 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7185: Src/glob.c: don't use strcoll() for character + ranges [...] because it can have side effects. + + * pws: 7184: Src/lex.c: histactive didn't get get zeroed before + non-interactive history use, hence interactive lines with + remhist() were junked more than once. + + * Wayne: 7181: Doc/Zsh/options.y, Doc/Zsh/params.yo: history docs. + + * Wayne: 7180: Src/Zle/complist.c, Src/utils.c: warnings. + +1999-07-16 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7172: Doc/Zsh/options.yo, Src/builtin.c, Src/exec.c, + Src/options.c, Src/utils.c, Src/zsh.h: minor bugs with + 7164 fixed; CHASE_DOTS resolves ..'s to physical path; + CHASE_LINKS doesn't do logical path rationalization; + xsymlink() and xsymlinks() simplified and option-dependence + removed. + + * Sven: 7171: Src/builtin.c: alternate form of Digital/gcc + bug workaround. + +1999-07-15 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7164: Src/builtin.c, Src/exec.c: AUTOCD now allows + paths with symlinks (as real cd always did); simplify code + for testing for existing directory on foo/.. before removing + foo/..; as a side effect, relative cd's from directory which + has been deleted don't work. + + * Sven: 7161: Src/Zle/comp.h, Src/Zle/complist.c, + Src/Zle/zle_tricky.c, Completion/Base/_brace_parameter: + be more careful with quote-prefix/suffix and path-prefix/suffix + especially with accept-and-menu-complete. + + * pws: 7155: Functions/Zftp/zfgoto, Functions/Zftp/zfinit: + zfgoto can cd without needing to re-login; zfinit uses + zmodload -e to check for zftp. + + * Sven: 7154: Src/Zle/complist.c, Src/Zle/zle_refresh.c, + Src/Zle/zle_tricky.c, Doc/Zsh/mod_complist.yo: don't + list too many times on ambiguous completion; don't do + menu-selection if no alwayslastprompt behaviour. + +1999-07-14 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7148: INSTALL: User subdirectory + + * Thomas Köhler: 7146: Completion/User/_make: didn't work. + + * pws: 7145: Completion/User/_sh: use compset -q for completing + after -c option + + * Sven: 7143: Src/Zle/complist.c, Src/Zle/zle_tricky.c: + listing got confused with only hidden matches. + + * Sven: 7141: Completion/Core/_path_files: if there are + no completions in a valid directory when we have a path ending + in /, use the directory as a completion, to avoid + correction/approximation of the existing directory. + + * pws: 7139: Src/builtin.c: not particularly pleasant fix + to problem that `cd nonexistent/..' silently did nothing, while + making `cd ..' work even if current directory has gone. + + * Sven: 7138: Completion/User/_hosts, Completion/User/_x_options: + _hosts passes arguments as options to compadd. + + * Oliver: 7136: Completion/User/_rlogin, + Completion/User/_x_options: use _hosts. + + * Sven: 7135: Src/Zle/zle_tricky.c, Completion/Core/_path_files: + change quoting of files again. + + * Sven: 7133: Doc/Zsh/expn.yo, Doc/Zsh/mod_complist.yo: + ZLS_COLOURS not required for complist to work. + + * pws: 7127: configure.in: help now shows --disable-dynamic + and --disable-lfs. + + * Sven: 7126: Src/Zle/comp.h, Src/Zle/comp1.c, Src/Zle/compctl.c, + Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo, + Functions/Zle/incremental-complete-word: compstate key + normal_nmatches; more i-c-w prompt escapes + + * Sven: 7123: Src/Zle/zle_tricky.c: clear list on expansion + failure. + +1999-07-13 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7119: Src/Zle/zle_tricky.c: status from expansion + functions. + + * Sven: 7116: Doc/Zsh/compwid.yo, Doc/Zsh/expn.yo: minor + changes. + + * pws: 7114: Src/parse.c, Src/utils.c: line numbers again: + flushing line in a script made lineno appear one too large; + introduce zwarn() function. + + * Sven/pws: 7112: Src/Zle/zle_params.c, Doc/Zsh/zle.yo: change + array keys to scalar KEYS, works more like read -k; + documentation. + + * Sven: 7110: Src/Modules/zftp.c, Doc/Zsh/compsys.yo, + Etc/MACHINES: signed char warnings in zftp; document + _long_options options; Digital UNIX problem. + + * Sven: 2432: Src/builtin.c: workaround Digital UNIX 4.0 + + gcc 2.8.1 bug. + + * Sven: zsh-users/2430: Etc/NEWS: mention chmod-like mode glob + qualifier. + + * Sven: 7108: Misc/job-control-tests: more tests + + * Bart: 7107: configure.in: too many x's in lfs handling. + + * Sven: 7106: Functions/Zle/incremental-complete-word: prompting + changes. + + * pws: unposted: update .distfiles and .cvsignore: _sh, _su + zshcompsys.yo, zshcompwid.yo, zshzftp.yo, zshcompsys.1, + zshcompwid.1, zshzftp.1 were missing from the distribution. + + * Sven: 7105: Src/Zle/Zle_tricky.c: restore the command line + in more places. + +1999-07-12 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 7103: Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo: update + CURRENT with compset -q; modify test for quoted delimiters. + + * pws: version 3.1.6-test-1 + + * Sven: 7099: Completion/Core/_main_complete, Doc/Zsh/compsys.yo: + config key last_prompt means don't turn off alwayslastprompt on + prefix. + + * Sven: 7097: Completion/Core/_oldlist: keeps old command line. + +1999-07-09 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7091: configure.in, INSTALL: change defaults for + dynamic and large file support to be enabled. + + * Sven: 7083: Src/Zle/compctl.c, Src/Zle/zle_tricky.c, + Doc/Zsh/compwid.yo: compset -q unconditionally splits + the current word. + + * Sven: 7082: Completion/Base/_parameter: use _parameters + + * pws: 7076: Completion/Base/_command_names, + Completion/Base/_first, Completion/User/_su: %resume should be + in _command_names; _su should check $SHELL. + + * pws: 7075, 7080, 7092: Completion/Core/compinit, + Config/funcinst.mk, Config/installfns.sh, + Config/uninstallfns.sh, INSTALL: Yet another attempt to install + shell functions in a sensible way; compinit adds to the end of + $fpath; fixed typo that it didn't check existing fpath properly. + + * Oliver: 7067: Completion/Base/_first, Completion/User/_su, + Completion/User/_sh: check for %resume on command line; + new completions for _su and _sh. + + * pws: 7066: configure.in: function install makefile in + source, not build, hierarchy. + + * Sven: 7062: Src/Zle/complist.c, Src/Zle/zle_tricky.c, + Doc/Zsh/compsys.yo, Doc/Zsh/mod_complist.yo: undo works + inside menu-selection for items completed by + accept-and-infer-next-history; display is more reliable. + + * Sven: 7058: Src/Zle/zle_params.c: turn off menu completion + if the command line gets altered by a zle function. + +1999-07-08 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7049: Src/builtin.c: eval didn't save/restore lexical + state. + + * pws: 7046: Src/loop.c: xtrace for case and for statements. + + * Sven: 7043: Completion/Core/_oldlist: Extra sophistication + when using _oldlist with a particular completer. + + * pws: 7042: Etc/BUGS, Etc/CONTRIBUTORS, Etc/NEWS, + Doc/Zsh/builtins.yo, Doc/Zsh/expn.yo, Doc/Zsh/mod_complist.yo, + Doc/Zsh/params.yo: Changes to admin files for 3.1.6; some minor + documentation changes. + + * Sven: 7039: Completion/Commands/_read_comp: trapping SIGINT + no longer necessary after 7038. + + * pws: 7038: Src/Zle/zle_main.c: restore breaks whenever errflag + is restored as SIGINT handler sets both. + + * Sven: 7036: Src/Zle/complist.c: make sure old list is thrown + away when doing accept-and-infer-next-history in menu-completion. + + * Sven: 7028: Src/Zle/zle_tricky.c, + Functions/Zle/incremental-complete-word: problems when BUFFER + changes, %u in i-c-w prompt, config key for showing list. + + * Sven: 7026: Completion/Core/_main_complete, + Completion/Core/_match, Completion/Core/_oldlist, + Completion/Core/compinit: More information stored in assoc array + _lastcomp about the previous completion. + + * Sven: 7025: Src/Zle/complist.c: remove list when accepting + and retrying completion when unambiguous. + +1999-07-07 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 7021: Src/utils.c: error message in findsep() was + erroneous. + + * pws: 7020: Src/params.c: error message for whole assoc array + assignment. + + * Oliver: 7005: Src/builtin.c, Doc/Zsh/builtins.yo: alias + takes +g and + flags. + + * Sven: 7004: Src/Zle/zle_refresh.c: reset showinglist on + clearlist. + + * pws: 7002: Completion/Commands/_read_comp: does completion + lists; handle errors better. + + * pws: 7001: Src/hist.c: line numbers were wrong in some error + messages (e.g. conditions) when reading from a string + (e.g. autoloaded functions). + + * pws: 6998: Src/Zle/zle_bindings.c: restore history-search + bindings \M-n, \M-p. + + * Sven: 6996: Src/Zle/complist.c, Src/Zle/zle_tricky.c, + Doc/Zsh/mod_complist.yo: accept-and-infer-next-history + in menu-select accepts a match, then restarts menu selection. + + * Sven: 6995, 7000: Src/math.c, Src/utils.c, Doc/Zsh/arith.yo: + allow bindkey strings in after #\ in math mode. Also + incremental-complete-word and insert-files, added by hand + to directory Functions/Zle, with appropriate changes to + configure.in and INSTALL. + + * Sven: 6992: Src/Zle/zle_main.c, Src/Zle/zle_misc.c, + Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, Doc/Zsh/mod_zle.yo: + zle -R can take list arguments; zle -cR clears the list; + zle -U puts keys in the unget queue. + + * Geoff: 6991: configure.in: NetBSD can use both ELF and a.out. + +1999-07-06 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Andrej: 6990: Completion/Builtins/_cd, + Completion/Core/_path_files: some local variable fixes. + + * pws: 6987: Src/builtin.c: `typeset +f' and `functions +' + should just print the function name. + + * pws: 6986: Doc/Zsh/builtins.yo, Doc/Zsh/params.yo, + Src/builtin.c, Src/params.c, Src/zsh.h: special parameters + can become local, remaining special; be more careful that + only the most global parameter can appear in the environment. + + * pws: 6984: Doc/Zsh/compsys.yo: typo in 6973 docs + +1999-07-05 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6982: Src/exec.c: variable assignment with redirection is + interpreted as variable assignment with redirection, not + nullcmd. + + * pws: 6981: Completion/Commands/_read_comp: -n should be -z. + + * Sven: 6979: Completion/Core/_path_files: compconfig[path_expand] + fix. + + * Sven: 6977: Completion/Core/_match: cosmetic `if' change. + + * Sven: 6975: Src/Zle/zle_tricky.c: fix quoting of tildes at + the start of file names. + + * Sven: 6974: Src/exec.c: mark superjob as locked as soon + as started. + + * pws: 6973: Completion/Commands/_read_comp, Doc/Zsh/compsys.yo: + _read_comp allows function arguments and ^U but won't add + non-printables; document Completion/Commands widgets. + + * Sven: 6971: Src/exec.c, Src/jobs.c: backgrounding jobs forked + from current shell works again; job table not filled up by + current shell subjobs; current/previous job not lost. + +1999-07-04 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6970: Completion/Base/_default, Completion/Builtins/_cd, + Completion/Commands/_read_comp: handle magicequalsubst and + cdablevars optios; _read_comp can read and execute a completion + function (_*) or compgen argument (-*) on the fly. + + * pws: 6969: Doc/Zsh/builtins.yo, Src/builtin.c: print -b + uses full bindkey string possibilities. + + * Tanaka Akira: 6968: Completion/Core/compinit: compinit -D + didn't actually work. + + * pws: 6967: Completion/Core/_path_files: final return status + inverted. + + * pws: 6966: Completion/Makefile.in, Functions/Makefile.in, + Config/funcinst.mk, configure.in, INSTALL: prevent overwriting + of changed shell functions on installation; move function + installation code to funcinst.mk; clear up INSTALL a bit. + +1999-07-03 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6962: Doc/Zsh/prompt.yo, Src/prompt.c: %/ and %~ take + numbers for trailing path segments like %c and %C, %N can too; + function promptpath() to implement this. + + * pws: 6957: 3.1.5-pws-25 made available + + * pws: 6955, 6956: Completion/Core/compinit, + Completion/Core/compinstall, Doc/Zsh/compsys.yo: better handling + of subdirectory structure for completion functions; -d is default + for compinit, -D turns it off; documentation updated for installed + files; bugfix for compinstall re-using compconf arguments. + +1999-07-02 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 6953: Completion/Builtins/_cd: use pushd code for cd + + * Sven: 6945: Completion/Core/_expand: error expanding :] + + * Sven: 6941: Src/exec.c, Src/jobs.c: neater fix for time builtin. + + * Oliver: 6939: Completion/User/_hosts, + Completion/Base/_subscript, Misc/compctl-examples: better way of + using /etc/hosts; complete POSIX character classes. + + * Sven: 6937: Doc/Zsh/mod_complist.yo, Src/Zle/complist.c: use + send-break to exit menu selection and return to normal menu + completion. + +1999-07-01 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 6936: Src/jobs.c: time builtin was broken. + + * Sven: 6933: Src/exec.c, Src/jobs.c, Src/Signals.c: More job + control fixes: running external command after loop in function; + function on left hand side of pipeline with loop on right. + +1999-06-29 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 6908, 6926: Src/exec.c, Src/jobs.c, Src/zsh.h: more job + control fixes: functions with programs that send strange + signals to parents should work. + + * Sven: 6904: Src/Makefile.in: bugs with cleaning up modules + in Src. + + * Sven: 6903: Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo: + compstate[insert] can have a space at the end to force inserting + a space after completion. + + * Sven: 6902: Src/Zle/complist.c, Doc/Zsh/mod_complist.yo: + menu-select will use %S/%s if ZLS_COLO[U]RS is not defined. + + * Sven: 6901: Src/exec.c, Src/init.c, Src/jobs.c: back off + some (but not all) recent job handling patches to avoid more + serious problems with recalcitrant programs. + +1999-06-28 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6899: Doc/Zsh/params.yo, Doc/Zsh/prompt.yo, Src/init.c: + default PS4 is now "+%N:%i> ", except in [k]sh emulation. + + * Andrej: 6893: aczsh.m4: use existing environment value when + testing for large file support. + + * pws: 6890: Doc/Zsh/params.yo, Doc/Zsh/prompt.yo, Src/prompt.c: + %N and %i prompt escapes provide script or function name and + line number. + + * Sven: 6887: Src/exec.c, Src/jobs.c: another loop killing problem. + + * Geoff: 6884: Src/Zle/zle_refresh.c: bug when redisplaying line + one shorter than terminal width + +1999-06-27 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6881: Doc/Zsh/mod_zle.yo: explain keymap linking + + * pws: 6879: Src/exec.c: update command hash pointer if builtin + is autoloaded after a prefork(). + + * Bart: 6873: Src/Zle/zle_tricky.c: magic-space doesn't feep + quite so much. + + * Geoff: 6871: Src/Zle/complist.c: optimi[sz]ations for outputing + coloured/colorized output. + + * pws: 6866: Src/exec.c, Src/init.c: signed/unsigned character + problems; one was causing SunOS 4.1.3_U1 with gcc 2.7.0 to hang. + +1999-06-26 Peter Stephenson <pws@ibmth.df.unipi.it> + + * 3.1.5-pws-24 made available + +1999-06-25 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6857: Completion/Core/compinit, + Completion/Core/compinstall, Doc/Zsh/compsys.yo: compinit and + compinstall are now functions which unfunction and autoload + themselves. _compdir is used by compinstall to record where + it found the completion directories. compinit is now otherwise + stuck with fpath. + + * pws: 6851, 6853: typeset -g doesn't locallize parameters; bug + that unset parameters were recreated global instead of at + some higher local level; handle PM_AUTOLOAD consistent with other + flags. + + * Sven: 6850: Src/init.c: always generate a new pgrp for the + shell, since the parent (e.g. xterm) may not have done that + and zsh now runs programs in its own pgrp. + + * Sven: 6848: Src/exec.c: don't suspend if the shell is the + only thing to suspend (or something like that). + + * Sven: 6841: Src/loop.c: %_ in else branches for PS4 + +1999-06-24 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6834: Src/glob.c, Src/hashtable.c: dyncat() changed always + to use heap memory (as it erroneously claimed); hashtable element + tablename (used for debugging) freed. + + * Bart: 6830: Src/params.c: don't create the hashtable for an + assoc array on assignment unless there is something to put in it. + + * Sven: 6825: Src/Zle_tricky.c: make sure path prefix and suffix + are quoted in filename completion; recalculate length of match + string. + + * Sven: 6824: Src/exec.c, Src/signals.c: functions got deleted + from the process table too early for job control. + + * pws: 6823: Src/exec.c, Src/utils.c: names and line numbers + of functions printed for errors during execution. + + * Sven: 6822: Src/Zle/complist.c, Src/Zle/zle_tricky.c: assorted + completion fixes: crash with old completion; too many spaces + with menu inserting; too many beeps with LISTBEEP. + + * Sven: 6819: Src/exec.c, Src/jobs.c, Src/signals.c: Run + jobs inside shell constructs in the same process group as the + shell itself. + + * Sven: 6817: Src/Zle/comp.h, Src/Zle/complist.c, + Src/Zle/zle_tricky.c: Change ZLS_SELECT to SELECTMIN; + don't automatically switch on select widget until there are + $SELECTMIN choices. + +1999-06-23 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6816: Doc/Zsh/params.yo, Src/utils.c: ZBEEP parameter + gives string to output instead of beeping. + + * Sven: 6815: Src/Zle/complist.c: switch off menu-select for + hidden matches. + + * pws: 6814: Doc/Zsh/mod_zle.yo, Doc/Zsh/options.yo, + Doc/Zsh/zle.yo, Src/Zle/deltochar.c, Src/Zle/iwidgets.list, + Src/Zle/zle_hist.c, Src/Zle/zle_main.c, Src/Zle/zle_misc.c, + Src/Zle/zle_move.c, Src/Zle/zle_thingy.c, Src/Zle/zle_tricky.c, + Src/Zle/zle_utils.c, Src/Zle/zle_vi.c, Src/Zle/zle_word.c: + Zle determines whether to feep by the return status (except + for some inner code loops); completion widgets return 1 if + something failed in the hierarchy outside the widget function; + the -n and -N options work properly. + + * pws: 6812: Src/subst.c: ${(AA)foo=}, or anything that gives + a null string after the =, creates an empty assoc array. + + * pws: 6806: Completion/Core/compdump, Completion/Core/compinit, + Completion/Core/compinstall, Doc/Zsh/compsys.yo: compdump is now + a function which unfunctions itself; default dumpfile location + is now ${ZDOTDIR:-$HOME}/.zcompdump + + * Sven: 6807: Src/Zle/complist.c: accept-and-menu-complete + advances the menu-select selection too. + + * Sven: 6802: Src/Zle/complist.c: change some default colours + + * pws: 6801: Doc/Zsh/builtins.yo, Src/builtin.c: Make emulate -L + turn on LOCAL_TRAPS, too. + + * Sven: 6796: Src/Zle/zle_main.c, Src/Zle/zle_thingy.c, + Doc/Zsh/mod_zle.yo, Completion/Core/compinit: zle -la lists + all widgets, just the name; zle -la <NAME> tests if <NAME> is + defined. + + * Sven: 6793: Src/Zle/complist.c, Src/Zle/zle_keymap.c, + Src/Zle/zle_main.c, Doc/Zsh/mod_complist.yo: Local keymaps can be + defined, currently only used with menu-select. + +1999-06-22 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 6786: Src/Zle/zle_tricky.c, Doc/Zsh/compctl.yo: only use + a range when you are after the first pattern in it. + + * Sven: 6780: Src/Zle/complist.c: wasn't showinglist when it + thought it was. + + * Sven: 6778: don't delete function from job tables + + * pws: 6776: Doc/Makefile.in, Doc/Zsh/compsys.yo, + Doc/Zsh/mod_complist.yo: Tweakchen for menu-select patch; + also (unposted) changed name collist to complist wherever it + occurs. + + * Sven: 6774, 6775: Src/Zle/collist.c, Src/Zle/comp.h, + Src/Zle/zle.h, Src/Zle/zle_main.c, Src/Zle/zle_tricky.c, + Doc/Zsh/compsys.yo, Doc/Zsh/mod_collist.yo, + Doc/Zsh/mod_compctl.yo, Doc/Zsh/mod_deltochar.yo, + Doc/Zsh/modules.yo, Completion/Core/_path_files: Improvements + for menu-select widget; ZLS_SELECT turns menu-completion + into menu-selection; key bindings more natural; highlighting + more useful + + * Oliver: 6772: Src/Zle/zle_tricky.c: use the whole + command text for job completion. + +1999-06-21 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Sven: 6760: Src/Zle/zle_tricky.c: menucompletion displaying new + list of matches sometimes got confused. + + * Sven: 6755: Src/jobs.c: status of restarted job including + current shell processes was wrong. + + * Sven: 6753: Src/Zle/collist.c, Src/xmods.conf: + load collist + + * Sven: 6747: Src/Zle/collist.c, Src/Zle/zle_main.c, + Src/Zle/zle_tricky.c: menu-select allows you to move + cursor to select completions; uses ma list colouring + capability. + + * Sven: 6742: Src/Zle/collist.c, Src/Zle/collist.mdd, + Src/Zle/zle_main.c, Src/Zle/zle_tricky.c, Src/module.c, + Src/zsh.h, Doc/Zsh/mod_collist.yo, Doc/Zsh/mod_compctly.yo, + Doc/Zsh/mod_deltochar.yo, Doc/Zsh/modules.yo, + Util/zsh-development-guide: collist module: colour completion + lists by setting ZLS_COLOURS (or even ZLS_COLORS) variables. + + * pws: 6737: Doc/Zsh/builtins.yo, Doc/Zsh/zle.yo: simplifications + suggested by Bart. + + * Bart: 6732: Doc/Zsh/compsys.yo: restore missing bits of Sven's + patches (not the zle_tricky.c hunk). + + * Bart: 6731: Doc/Zsh/compctl.yo: spelling correction + +1999-06-20 Peter Stephenson <pws@ibmth.df.unipi.it> + + * zsh-3.1.5-pws-23 made available + + * Sven/pws: 6616, 6609, 6726 (merged): `zle [ -N ] [ -n num ] + widget args'; internal widgets handle arguments and return + values; search commands use arguments; read -[kq] can use + zle's key mechanism; zle -R [msg] redisplays line editor; + digit-argument feeps if the keypress wasn't a digit; + universal-argument handles argument as numeric. + + * pws: 6725: Src/signals.c: more local traps: now don't add trap + to list to restore when outside a function, but do if the function + simply unsets a trap which was set outside. + +1999-06-18 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6718: Completion/Core/compinit, Completion/Core/compdump, + Doc/Zsh/compsys.yo: rebind existing completion widgets for new + completion instead of defining new ones. + + * pws: 6717: Doc/Zsh/options.yo, Src/exec.c, Src/options.c, + Src/signals.c, Src/zsh.h: Option LOCAL_TRAPS saves and restores + traps on exit from functions; set for ksh emulation. + + * Tanaka Akira: 6716: Completion/User/_chown: some systems use `:' + as separator in chown. + + * Oliver/Sven: 6709, 6710: Completion files Base/_subscript, + User/_chown, User/_groups, User/_x_options: _subscript shows + listing for ordinary arrays; new chown and chgrp completions; + example _x_options can complete displays. + + * Sven: 6707: Src/exec.c: Shell structures not at the end + of a pipeline are suspendable. This is the only way + of stopping a command in such a structure where the command + handles interruptions in such a way that zsh doesn't see them. + +1999-06-17 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6705: Doc/Zsh/builtins.yo, Src/builtin.c, Src/exec.c, + Src/init.c, Src/input.c, Src/parse.c: some more LINENO + subtleties: embedded function definitions have correct line + number; all lines, not just ones with new PS1, are counted + interactively; traps with trap builtin use line no. of + surrounding environment. + + * Sven: 6693: Src/Modules/parameter.c, Src/builtin.c, Src/exec.c, + Src/input.c, Src/zsh.h: update LINENO properly when parsing a + string. + + * Sven: 6692: Src/Zle/comp.h, Src/Zle/compctl.c, + Src/Zle/zle_tricky.c, Doc/Zsh/compwid.yo, + Completion/Builtins/_kill, Completion/Builtins/_wait, + Completion/User/_gdb: allow the -y option to compadd for + specifying an array to use when listing. + + * Sven: 6689: Src/Zle/zle_tricky.c, Completion/Base/_subscript: + test for closing bracket in get_comp_string(). + + * Oliver: 6688: Zsh/compsys.yo, Zsh/func.yo, Zsh/mod_zle.yo, + Zsh/params.yo, Zsh/zftpsys.yo: spelling changes. + + * Wayne: 6682: Src/hist.c: Uniquified history commands are limited + to size $SAVEHIST, so that the last $((HISTSIZE-SAVEHIST)) + commands are always available even with HIST_EXPIRE_DUPS_FIRST. + + * Sven: 6686: Completion/Core/_match, Completion/Core/_path_files, + Doc/Zsh/compsys.yo: New configuration keys path_cursor, + match_insert. + + * Sven: 6685: Src/Zle/compctl.c, Src/Zle/zle_params.c, + Doc/Zsh/zle.yo, Completion/Base/_first, + Completion/Commands/_correct_filename, + Completion/Commands/_most_recent_file, + Completion/Core/_approximate, Completion/Core/_expand, + Completion/Core/_list: NUMERIC is unset if no prefix was given; + it may be unset explicitly, and if set again will be restored in + the expected way. + + * Wayne: 6683: Src/exec.c: ambiguous brace + + * Wayne: 6681: Src/builtin.c: start-of-loop check for history -r + was wrong. + +1999-06-16 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6679: Src/Zle/zle_thingy.c, Doc/Zsh/compwid.yo: always + use .complete-word etc. as widget type in zle -C. + + * pws: 6677: Doc/Zsh/guide.yo: avoid TeX overfull hbox problem. + + * Andrej: 6674: Doc/zsh.yo, Doc/ztexi.yo: change order of initial + formatting instructions to make interaction with system + configuration files better. + + * pws: 6660: Doc/Zsh/compctl.yo: pointer to new completion system + at top of compctl documentation. + + * pws: 6659: Src/Zle/zle_tricky.c: a couple of NULL's should be 0's + + * pws: 6658: Doc/Zsh/options.yo, Src/init.c: options strings at + shell startup can end with whitespace (for #!), but anything + after the whitespace causes an error. + + * Sven: 6657: Completion files Base/_subscript, + Builtins/_autoload, Builtins/_bindkey, Builtins/_echotc, + Builtins/_kill, Builtins/_limits, Builtins/_wait, + Builtins/_zmodload, User/_dd, User/_find, User/_gdb, User/_make, + User/_mh, User/_rlogin, User/_x_options: New gdb completion; + improved make completion; use compadd in preference to compgen + -[sk]; configuration keys ps_args, ps_listsargs. + + * Sven: 6654: Src/Zle/zle_tricky.c: empty display list after -y. + + * Bart: 6652: Src/exec.c: trailing spaces confused #! emulation. + + * Sven: 6649: Src/Zle/zle_tricky.c: behaviour of compctl -l. + + * Bart: 6646: Src/lex.c: extra braces to enhance beauty of code + which appeared in 3.0.5. + +1999-06-15 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Tanaka Akira: 6642: Completion/Base/_tilde: complete directory + stack elements after ~+ or ~-. + + * Tanaka Akira: 6641: Src/subst.c: treat ~-0 like ~0 + + * pws: 6639: configure.in: don't try type of $enable_val if empty + (needed when off_t/ino_t are 64-bit without explicit enabling). + + * zsh-3.1.5-pws-22 made available + + * Oliver: 6636: Completion/Builtins/_limits: wasn't working + + * Bart: 6617 + minor changes: Src/utils.c: Be more careful keeping + $COLUMNS and $LINES correct, particularly if exported. + + * Sven: zsh-users/2388: Src/jobs.c: while loops etc. in shells + running without MONITOR were hard to kill. + + * Bart: 6628: Src/params.c: setting slices of unset array + caused a crash. + +1999-06-14 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6626: Src/mem.c: in zsh's malloc, try to make sure when + sbrk'ing that it's sufficiently well aligned. + + * Oliver: 6624: Completion/Builtins/_kill, + Completion/Builtins/_wait: more widely functioning process + handling + + * pws: 6623: Completion/Makefile.in, Config/defs.mk.in, + Functions/Makefile.in, INSTALL, Src/init.c, Src/zsh.mdd, + configure.in: --enable-function-subdirs allows installation + into subdirectories of the function directory and sets the + initial $fpath appropriately. + + * Oliver: 6620: Completion/Builtins/_jobs: handle disown, too. + + * pws: 6618: Doc/Zsh/func.yo, Doc/Zsh/grammar.yo, Src/lex.c: + with SH_GLOB set, function definition parentheses after the + first word on the line allow spaces inside. + + * Sven: 6614: Src/Zle/zle_tricky.c, Completion/Brace/_brace_parameter: + completion after quotes in parameters + + * pws: 6610: Src/glob.c: globbing flags shouldn't be active + without extendedglob. + + * Bart: 6608: Doc/Zsh files compctl.yo, compsys.yo, compwid.yo, + expn.yo, files.yo, mod_mapfile.yo, mod_zftp.yo, params.yo, + zftpsys.yo, zle.yo: spelling corrections + +1999-06-12 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6601: Src/Makefile.in: don't remake Makemod just + to clean up files + + * pws: 6600: Doc/Zsh/arith.yo, Doc/Zsh/compctl.yo, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, Doc/Zsh/expn.yo, + Doc/Zsh/guide.yo, Doc/Zsh/jobs.yo, Doc/Zsh/metafaq.yo, + Doc/Zsh/mod_compctl.yo, Doc/Zsh/mod_zftp.yo, Doc/Zsh/params.yo, + Doc/Zsh/redirect.yo, Doc/Zsh/zftpsys.yo, Doc/Zsh/zle.yo, + Doc/zman.yo, Doc/ztexi.yo, Util/zsh-development-guide: + Formatting of unfilled text now handled by three distinct + macros example(), indent(), nofill(); compctl description node + is now called `Programmable Completion Using compctl' to + distinguish it from widget completion; don't put chapters on + separate pages because many are too short. + + * Wayne: 6599: Src/Zle/zle_tricky.c: unitialised variable warnings + from gcc + +1999-06-11 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6598: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfinit, + Functions/Zftp/zfgoto, Functions/Zftp/zfmark, + Functions/Zftp/zftp_chpwd, Completion/Builtins/_zftp: + add zfmark and zfgoto implementing bookmarks (including use + ncftp bookmarks) for zftp function suite; autoload functions + from zfinit; patcomps -> _patcomps. + + * pws: 6596: Doc/Zsh/arith.yo: update on size of integers and + increase in clarity of presentation + + * Sven: 6589: Completion/Core/_path_files: use :h and :t instead + of pattern matching + + * Sven: 6587, 6588: Src/Zle/zle_misc.c, Doc/Zsh/options.yo: < and + > shouldn't remove a suffix, but | does + + * Sven: 6586: Src/exec.c, Src/lex.c, Src/loop.c: don't modify + struct cmd to insert cmd args and flags, always pass those + separately + +1999-06-10 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Andrej: 6581: Doc/Makefile: dependencies for manuals + + * Sven: 6579: Src/exec.c: old hack of storing shell function + args in struct cmd doesn't work any more + + * Sven: 6577: Src/exec.c, Src/text.c, Src/utils.c: expunge + simplifyright(), which appears no longer to have an effect + + * pws: 6575: Doc/Zsh/mod_mapfile.yo: avoid mapping long files + + * pws: 6571: Src/Builtins/rlimits.c: use appropriate printf() + routine in printulimit() instead of just casting to long + + * pws: 6570: configure.in, INSTALL: some systems have + sizeof(off_t) or sizeof(ino_t) == 8 and sizeof(long) == 4 even + without explicit enabling, so check and if so use the + --enable-lfs code. + + * pws/Sven: 6567, 6568: Completion/Base/_vars: complete assoc + array keys + + * pws: 6566: Src/params.c: junk testhash assoc array + + * pws: 6563: sporadic: minor changes affecting casts, sizes + of integers, unused variables; add index for subscripts in + manual + + * Bart: email: Src/zsh.h: alternative definition for zulong + + * Bart: 6558: Src/builtins.c: printing functions with the + UNALIASED flag + + * Sven: 6557: Doc/zsh/compsys.yo: a few typos + +1999-06-09 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Andrej: 6556: aczsh.m4: don't disable setting variables + for --enable-lfs just because some other variables were set + + * Sven: 6554: Src/Zle/zle_tricky.c: display bugs with compadd -X: + newline missing and display unnecessarily altered + + * pws: 6552: configure.in, aczsh.m4, acconfig.h, Src/zsh.h: + define separate unsigned 64-bit integer; try __int64_t and + __uint64_t. + + * Sven: 6548: Src/Zle/zle_tricky.c: fix `compctl -l' + + * Andrej: 6544: configure displays info on function installation + + * Sven: 6542: Src/builtin.c, Src/exec.c, Src/hist.c, Src/init.c, + Src/lex.c: when not using interactive history, don't allocate + history at all + + * Andrej: 6541: configure.in: add missing `test' + + * Sven: 6535: Completion/core/_normal: an eval was unnecessary + + * Bart: 6534: Completion/Core/compdump, Completion/Core/compinit, + Doc/Zsh/builtins.yo, Src/builtin.c, Src/exec.c, Src/zsh.h: + autoload -U defines functions which don't use expand aliases + during loading; used in new completion code to protect + functions. + + * Sven: 6527: Src/builtin.c, Src/cond.c, Src/exec.c, Src/glob.c, + Src/hashtable.c, Src/init.c, Src/jobs.c, Src/lex.c, + Src/linklist.c, Src/loop.c, Src/math.c, Src/mem.c, Src/params.c, + Src/parse.c, Src/signals.c, Src/text.c, Src/utils.c, Src/zsh.h: + various sets of patches: + - make zhalloc() use a pointer to the first free heap + - make zsh-mem allocators keep some memory back when freeing + - reduce the amount of allocation work done in the exec.c + execution hierarchy + - don't duplicate execution trees any more than necessary, e.g. + execute functions from stored tree + + * pws: Etc/MACHINES: Danek Duvall reports --enable-dynamic OK + on Solaris 2.7, despite previous reports; Sven says on Digital + UNIX 4.0, you need special DLLD and LDFLAGS. + +1999-06-08 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: 6525: Src/lex.c (gettokstr): allow parentheses after + first character in command word + + * Tanaka Akira: 6522: configure.in: help string for --enable-fndir + had wrong default directory + + * pws: 6520: configure.in: --enable-fndir might be yes, + so turn it into ${datadir}/zsh/functions + + * 3.1.5-pws-21 made available + + * Sven: 6515: Src/Zle/zle_tricky.c: fix memory problems with 6492 + + * Wayne: 6510: Completion/Core/compinit: another nounset problem + +1999-06-07 Peter Stephenson <pws@ibmth.df.unipi.it> + + * pws: configure.in, Config/defs.mk.in, Functions/Makefile.in, + Completion/Makefile.in, rearrangement of Functions + subdirectories: --enable-fndir allows function installation, + defaults to ${datadir}/zsh/functions; is compiled into $fpath; + FUNCTIONS_INSTALL can specify functions to install e.g. + 'Core/* Base/* Builtins/* Zftp/*'. + + * pws: 6509: Src/Zle/zle_tricky.c: comp_setunset -> comp_setunsetptr + + * pws: 6506: Completion/Core/compinit, Doc/Zsh/compsys.yo: if + completion dumpfile is not writeable, use + ${ZDOTDIR:-$HOME}/.zcompdump + + * Sven: 6502: Doc/Zsh/options.yo: document 6496 + + * Sven: 6496: Src/Zle/zle_misc.c (makesuffix): more characters + that can't be part of a filename + + * Sven: 6493: Completion/Core/_approximate, + Completion/Core/_expand: %e wasn't being replaced properly in + correction prompts + + * Sven: 6492: Src/Zle/comp.h, Src/Zle/comp1.c, Src/Zle/compctl.c, + Src/Zle/zle_main.c, Src/Zle/zle_tricky.c, Doc/Zsh/compctl.yo, + Doc/Zsh/compsys.yo, Doc/Zsh/compwid.yo, + Completion/Base/_brace_parameter: Completion inside quotes + now acts as if the file name is the entire quoted string; + `compctl -h' takes a command line from inside a quoted string; + the compctl tests q[s], q[d], q[b] are true if we are in single, + double, back quotes; compset -q tests quotes and splits the word, + affecting $PREFIX, $SUFFIX and setting $IQPREFIX, $IQSUFFIX for + the bits which will now be ignored. + + * pws: 6490: Completion/Core/compinit: nounset workaround + + * Bart: 6485: Src/loop.c: only show one screenful at a time + in select, as LINES doc implies it should do + + * Sven: 6484: Src/Zle/zle_main.c, Src/Zle/zle_tricky.c: close + fd 0 during zle widgets and completion and redup back afterwards + (removed unnecessary zclose()'s) + + * Wayne: 6481: Doc/Zsh/builtins.yo, Doc/Zsh/options.yo, + Src/hist.c: improved new history documentation and comments + + * Wayne: 6480: Src/hist.c: Ignore some lines in remhist() to + workaround crashes attempting to add already removed lines + + * Tanaka Akira: 6478: Completion/User/_make: complete files + as fallback (but use _files instead of compgen -f) + +1999-06-06 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Naoki Wakamatsu <naoki-w@ht-net21.ne.jp>: 6477: configure.in: + undefine etcdir, not zshenv + +1999-06-05 Peter Stephenson <pws@ibmth.df.unipi.it> + + * Merge ChangeLog entry from patchlist.txt in 3.1.5-pws-20 + These are briefer than normal ChangeLog entries, but upgrading + all of them is too much work. + + * pws: 6473: Src/Modules/mapfile.c: munmap() after writing file + + * Bart: 6472: doc for 6458 + + * pws: 6470: options.yo doc for globalrcs + + * Sven: 6468: -first- context example; allow $compcontext for + direct context in _complete; other stuff + + * pws: 6464: fix problem with 6433; disallow nested parameter + substitution without braces + + * Sven: 6458: allow seconds in globbing qualifier time comparisons + + * Zefram: off-list: metafaq updates + + * pws: 6437: rearrange quotes in expn.yo, zftpsys.yo, minor + corrections + + * pws: 6433: allow quotes around names of parameters in braces + + * pws: 6431: su saga again: new documentation + + * Bart: 4127: su saga: 6299 and 6313 backed off; this alters + ZSH_NAME using zgetenv("SHELL"). It can be turned into an + --enable if anyone complains. + + * Wayne: 6430: history tweaks: more careful ignoring history with + foreign lines, changed name incappendhistory + + * pws: 6424: reduce excess quoting in info files + + * pws: 6421: _mh should use $words instead of $argv + + * pws: 6416: document ${(f)"$(foo)"} change and nesting of quotes + in braces + + * Sven: 6414: completing parameters with extra quotes, don't + complete local parameters + + * Sven: 6411: fix display bug on terminals which can do + TCMULTRIGHT (gap left when clearing list). + + * pws: 6410: RCS option can now take affect at any point during + initialisation, new GLOBAL_RCS applies to /etc/z* files. + + * Bart: 6404: singleton arrays treated as scalars locally (as + before), but correct array/scalar status is passed to enclosing + substitutions. + + * Bart: 6395: uninstall info files over 9, too + + * Sven: 6212 (previously missed): an extra clear list + + * Andrej: 6392: install info files higher than 9 + + * 3.1.5-pws-20 + + * Sven: 6388: completion in braces removes later arguments + + * Sven: 6374: autoremove behaviour on -r and -R, documentation + + * Bart: 6369: fix use of relative paths in compinstall + + * Bart: 6368: don't use cp -f, use rm -f in configure.in + + * Sven: 6355: ALL_EXPORT crashed the shell if set on command line + + * Sven: 6352, 6354: more quoting in completion + + * pws: 6346: msync() missing from mapfile.c, somehow + + * pws: 6345: Config/defs.mk is now in build tree, not source tree + + * Sven: 6343: test length of anchor in partial word matching + + * pws: 6340: INSTALL didn't work if it was install-sh after 6330 + + * pws: 6335: now you can do ${(f)"$(...)"} to get arrays + + * pws: 6332: mapfile module + + * pws: 6331: protect against null hash tables in parameter module + + * pws: 6330: rewrite configuration system to use AC_SUBST_FILE + instead of including files by ed trickery (ed is now no longer + required). + + * Sven: 6326: compadd -r and -R work on automatically added + suffixes, too + + * Sven: 6322: reverse indexing of nested arrays + + * Sven: 6318: memory fixes for parameter module (and compctl). + + * 3.1.5-pws-19 made available + + * pws: unposted: updated some .distfiles + + * pws: 6314: in something like `{ false; } || true', errexit + shouldn't be used at all on the left of the || + + * pws: 6313: fix 6299 to use $SHELL to decide emulation + + * pws: 6307, 6312: wider support for 64-bit integers on 32-bit + architectures + + * Tanaka Akira: 6303: _path_files: find files after symbolic link + + * Sven: 6302: more list_pipe intricacies + + * Sven: 6301: expanded ignored prefix ignored for testing + + * pws: 6299: if called as su* or -su*, zsh doesn't do sh emulation + + * Sven: 6298: (mult_isarr) ${*:-word} didn't use the default word + + * pws: 6294: typeset -U MANPATH performs uniqueness test straight + away + + * pws: 6291: zftp only checks for system type after login. + + * pws: 6290: parameter module uses global scope, $parameters gets + unreadonlied, gcc warning + + * Sven: 6285: tty/job handling when executing some command in + current shell code within RHS of pipeline + + * Sven: 6283: compadd -U didn't quote characters properly + + * Sven: 6278: fix ${$(foo)...} to produce an array + + * Tatsuo Furukawa: 6274: updated form of zle_refresh patch + + * Tatsuo Furukawa: 6273: don't need to defined _POSIX* flags + specially on HPUX + + * pws: 6272: correct even more mistakes some bozo (guess who) made + with rlim_t: put back RLIM_T_IS_UNSIGNED code. + + * pws: 6271: make sure -D_LARGEFILE_SOURCE is defined any time + there are other -D's for large file support + + * pws: 6284, should have been in 6269: changes to large file + support + + * Sven: 6268: parameter module for access to internal tables + + * pws: 6263: incrementalappendhistory -> incappendhistory + + * 3.1.5-pws-18 made available + + * pws: 6259: second version of compinstall + + * pws: 6258: yet another attempt at the same problem + + * pws: 6257: rewrite 6240 for any old builtin structure after the + pipeline + + * Wayne: 6255: more history: zle toggle between local/global + history; `zle widget' can now take a direct numeric argument; + small tweaks + + * Sven: 6249: fix for 6046 (problem showed up with $(...)) + + * pws: 6246: doc changes for 6046, plus subscripts done properly + + * Sven: 6046: nested parameter expansions can return either arrays + or scalars. + + * Wayne: 6241: history editing can use foreign history commands; + history appended in hend() instead of hbegin() + + * pws: 6240: a pipeline ending in a builtin didn't attach to the + tty pgrp. + + * pws: 6239: need space after incrementalappendhistory for + kshoptionprint + + * pws: 6238: Wayne's share_history option set in ksh emulation + + * pws: 6237: window size code upgraded from 3.0.6-pre2, plus + Bart's patch 4447. + + * Wayne: 6236: history changes to improve management of duplicate + lines, incremental history read/write, and sharing history + + * pws: 6235: unset -m shouldn't restore unset parameters; + unsetting a global should remove it from paramtab even inside a + function. + + * pws: 6227: configuration for large file support (from bash + aclocal.m4). + + * pws: 6224: alter 6205 to read chars only when necessary, but + ensure terminal is set appropriately. + + * Wayne: 6220: various compilation warnings + + * Tanaka Akira: 6219: initialize a variable in zle_tricky.c + + * Bart: 6213: race condition in $(...), use waitforpid() instead + of unblocking child (which shouldn't happen until later). + + * pws: 6205: use FIONREAD wherever defined, read chars immediately + into buffer + + * pws: 6202: trivial _correct_filename change, ^Xc -> ^XC + + * Sven: 6197: off by one error parsing assignment in completion + + * Sven: 6195: _expand_word and _correct_word change. + + * Sven: 6194: complete assoc array arguments by default where + necessary + + * pws: 6193: [un]setopt shouldn't complain when setting an + unsettable option to the value it already has + + * Bart: 6188: compinit speedup + + * 3.1.5-pws-17 made available + + * pws: 6180: Completion/Core/compinstall + + * Bart: 6171 as rewritten in 6174: old RedHat Linux doesn't have + normal definitions for poll. + + * Sven: 6167: show unloaded parameters as undefined + + * pws: 6165: globsubst'd foo='~/bin' depended on extendedglob + being set + + * Bart: 6162: autoloadable parameter code links without dynamic + loading + + * Sven: 6153: realparamtab to smooth access to autoloaded parameters + + * Sven: 6152: compstate[vared] + + * Sven: 6150: alwayslastprompt sometimes failed in M-x + + * Sven: 6133: autoloaded parameters + + * Sven: 6132: compctl.mdd + + * Ville Herva: 6131, see 6126: reset tv.tv_sec before select for + Linux + + * Sven: 6129: comments for struct cadata + + * Sven: 6128: completion after an expansion; list after a + non-completion list + + * Sven: 6124: menu completion wasn't consistent between tabs + + * Sven: 6121: try harder with braces after a parameter expansion + + * Sven: 6119: don't insert word separator before ignored suffix + + * pws: 6118: _closequote and _oldlist completers + + * Sven: 6117: position of ignored suffix in inserted match + + * Sven: 6113: compadd -D, nuke element in an array for each failed + match + + * Sven: 6109: completion in parameter assignment should set + context `value' + + * Bart: 6106: short documentation fixes in expn.yo, options.yo, + redirect.yo + + * Sven: 6105: _make patch whitespace + + * Geoff: 6104: multi-line prompt fix (6101 backed off) + + * 3.1.5-pws-16 made available + + * pws: 6101: multi-line prompt ending in '\n' got another newline + + * Tanaka Akira: 6092: _find, bad glob pattern + + * Tanaka Akira: 6085: _make can hang when no [mM]akefile + + * pws: zsh-announce/94: FAQ and FAQ.yo updated + + * Sven: 6079: compwid.yo typo + + * Tanaka Akira: 6078: _find syntax error + + * Sven: 6077: do_single() fix for old completion + + * pws: 6074: zftp function suite moved to Functions/Zftp and + provided with documentation. + + * pws: 6070: ~ in character class in parentheses with extendedglob + failed + + * Sven: 6066: create list of modules built into the base executable + + * Sven: 6062: test whether using the same widget when doing + menucompletion + + * Sven: 6060: don't invalidatelist() in zle_main.c before calling + completion functions + + * Sven: 6058: small changes in _path_files, compinit and + documentation + + * Sven: 6056: compwid.yo + + * pws: 6053: compwid.yo + + * 3.1.5-pws-15 made available + + * Sven: 6031: defcomp -> compdef + + * pws: 6030: compsys.yo + + * Sven: 6026: _path_files slight rewrite for speed + + * Sven: 6021: _path_files expanding path fix + + * pws: 6018: (#l) and friends with a trailing / on the glob + pattern always failed + + * pws: 6016: compinit and _zftp + + * Andrej: 6017 (ex 6014): -i and -s options for _long_options + + * Sven: 6013: pass ignored prefix and suffix in _path_files + + * Sven: 6011: compadd uses first (not last) occurrence of an option + + * Sven: 6010: _match_pattern and _match_test replaced by options + to compadd (and deleted from distribution) + + * Sven: extracted from 6009: chunk for getmatcharr() + + * Sven: 6008: %{ works in completion listings + + * Sven: 6005: Misc/compctl-examples altered for latest (more + consistent) nested parameter expansion rules + + * Bart: 6002, 6003: in ${foo/#bar/thing}, the `#' can appear from + substitution and can be quoted + + * Sven: 5999: ~foo<TAB> completes with / + + * Sven: 5996: compsys.yo, special contexts + + * Sven: 5995: should fix 5969 + + * Sven: 5986: compstate[insert] + + * Sven: 5983: documentation for Completion/ system (compsys.1). + + * Sven: 5982: menu behaviour + + * Sven: 5981: bit masks in comp.h + + * Sven: 5972: compconf without arguments lists; _compalso takes + extra arguments + + * Sven: 5971: shell code control over re-using existing completion + lists + + * Sven: 5970: completion fix compilation; #defcomp is now #compdef + + * Sven: 5969: clear to end of display optimization (may need + modifying for some terminals) + + * Sven: 5968: fix brace re-insertion problem in completion + + * pws: 5965: _correct_word + + * Sven: 5960: $PREBUFFER: lines before current $BUFFER + + * Sven: 5959: quoting characters in completion + + * Bruce: 5958: _make + + * Sven: 5955: more compstate choices: list_max, last_prompt, to_end + + * 3.1.5-pws-14 made avaliable + + * pws: unposted: updated .distfiles under Completion + + * Sven: 5947: completion functions fix + + * Sven: 5942: spaces in file names with old completion + + * Sven: 5940: move cursor + + * Sven: 5938, 5937: compset to replace modifying conditions + + * Sven: 5936: replace modifying completion tests with compset + + * pws: 5934: option GLOBAL_RCS_FIRST runs /etc/z* files before + user's files. + + * Sven: 5933: don't complete local parameters; _setopt/_unsetopt + complete all options (code to use currently unset/set options + remains in comments) + + * pws: 5931: more parameter substitution rules + + * Sven: 5928: copy context in zle_tricky + + * Sven: 5926: $HISTNO + + * Sven: 5925: path_expand + + * Sven: 5918: _list completer + + * Sven: 5916: _expand completer + + * pws: 5915: minor type fixes + + * Sven: 5914: _main_complete takes optional completer arguments + + * Sven: 5913: zle -C test + + * Sven: 5912: compiler warnings + + * pws: 5905: _main_complete should at least try to get + _unset_options correct. + + * Sven: 5904: print local for parameters + + * Sven: 5895, 5898, 5906: fix completion prefixes + + * Sven: 5890: _match completer + + * Sven: 5879, 5899: completion documentation + + * Sven: 5872, 5881, 5889: corresponding Completion function rewrite + + * Sven: 5871, 5875: big zle_tricky.c cleanup, with compstate + changes and IFSUFFIX + + * Bart: 5868: expn.yo fixes + + * 3.1.5-pws-13 made available + + * pws: 5863: substitution rules + + * Sven: 5862: _path_files (turning on menu) and _cd (include . in + path) + + * pws: 5854: man page dependencies in Doc/Makefile.in + + * Sven: 5852: warnings about _long_options + + * pws: 5844: don't set errflag if noerrs = 2. + + * Sven: 5831: in subscripts and math environments, the whole + string is always passed down to the function handler. + + * Sven: 5830: in ${#:-stuff}, stuff is treated as a single word + (unless split for some other reason). + + * Sven: 5829: clear the completion list in more zle functions + + * Sven: 5818: parameter name in subscript which looks math-like; + _subscript. + + * Sven: 5811: put back _multi_parts which got left out when it was + moved into Core. + + * Sven: 5804: _pdf + + * Sven: 5800: _path_files; path altered when no possible match + + * pws: 5797: set CLOBBERS_TYPEAHEAD for Irix; old config.guess + change for Reliant UNIX and Apple Rhapsody re-imported from old + config.guess. + + * Sven: 5796: globcomplete shouldn't always turn on menucompletion + + * Sven: 5795: parsing change for assignment and arrays in nested + substitution. + + * Sven (reposted by Bart): 5783: zerr() sets errflag even if + noerrs is set + + * pws: 5780: Completion/Base/_brace_parameter change + + * 3.1.5-pws-12 made available + + * Geoff: 5779: correct mistakes some bozo (guess who) made testing + rlim_t for long long. + + * pws: unposted archive changes: .distfiles in Completion + hierarchy, dunno what these do but it looks better; _comp_parts + is now _sep_parts; moved _long_options into Base and mentioned + it in Completion/README. + + * pws: 5776: untested patch for typeahead problems when reading + multiple lines of input + + * Sven: 5775: correcting completion will not ignore everything the + user has typed; prefix quote fix + + * Sven: 5770: _path_files again + + * Sven: 5766: _path_files closer to compctl/compgen behaviour + + * Sven: 5761: remove unnecessary compiler warnings in compctl.c + + * Sven: 5759: math environment fixes + + * pws: www archive: updated Etc/FAQ finally, keep forgetting + + * Sven: 5758: _path_files accepts -q, -r and -R options + + * Sven: 5757: compconfig + + * Sven: 5756: compstate[force_list] + + * Lehti Rami: 5754: --disable-restricted-r stops the shell + becoming restricted when its name starts with r + + * Sven: zsh-users/2211 (+ p -> s): setopt -m handles underscores + and case sensitivity + + * pws: 5737: ${foo#* } is more efficient in ordinary cases + + * Sven: 5736: completion before = in assignment + + * Sven: 5732: _a2ps, _long_options + + * pws: 5729: _bindkey doc + + * Sven: 5726: zle_tricky.c: ctokenize() fix and parameter completion + + * Will Day: 5724 (+postprocessing, 5741): signames2.awk: match + extra spaces if produced by CPP. + + * Andrej: 5719: _bindkey can use - as anchor for wildcard matching + + * Sven: 5716: zle.h, zle_misc.c, zle_tricky.c: iremovesuffix() can + be told whether to keep a list of matches + + * Sven: 5714: _path_files: failed completions get left alone more + often + + * Sven: 5713: zle_tricky.c, interesting code specimen made extinct + + * Sven: 5712: _path_files, noglobcomplete fix + + * Sven: 5710: zle_tricky.c, completion inside words + + * Sven: 5708: completion manual, -M anchors must be matched + explicitly + + * Sven: 5707: tokenization changes + + * Sven: 5704: _long_options + + * Sven: 5701: _main_complete, _multi_parts, _path_files, a few + cosmetic changes. + + * Sven: 5699: matching prefixes of various sorts + + * Sven: 5698: array indexing in _long_options and _multi_parts + + * Sven: 5696, 5697: "${${path}[1]}" indexes on characters again + + * Sven: 5692: remove compstate[matcher] test from _long_options + + * Sven: 5682: bindkey fix + + * Sven: 5677, 5679: Completion/User/_long_options and consequent + upgrades for Completion/User files which use long GNU-style + options. + + * Sven: 5676: all Completion example functions return a status + + * pws: from autoconf 2.13: new config.guess, too. + + * Sven: 5675: tidying up for zle_tricky.c + + * Sven: 5671: another small parameter fix for multiple braces + + * Sven: 5670: parameter completion fix + + * 3.1.5-pws-11 made available + + * pws: from autoconf 2.13: new config.sub + + * Sven: 5666: calling inststrlen() with a null string + + * Sven: 5665: return values from completion functions + + * Sven: 5663: compctl -i _completion_function + + * Sven: 5662: / following brace parameter + + * Sven: 5659: globcomplete changes + + * Sven: 5651: widespread completion fixes + + * Andrej: 5650: more tricks with _configure + + * Sven: 5647: _multi_parts doesn't replace so many *'s + + * Sven: 5640: _multi_parts, _path_files, _tar + + * Sven: 5637: mustuseheap check in complistflags + + * Sven: 5634: return values for compgen and compadd + + * Sven: 5631: compilation warnings + + * Sven: 5629: approximate correction patches + + * pws: 5628: _builtin, _cd, _most_recent_file + + * Sven: 5624: CCORIG required to be offered original string when + correcting using COMPCORRECT + + * Sven: 5623: -X strings with compadd were mishandled + + * Sven: 5622: zshcompwid manual: clarifications + + * Sven: 5621: manual for nmatches and matcher + + * Sven: 5620: fix for completion inside expansible braces + + * Bart: 5614: Completion/Base/_match_test works out of the box + + * Sven: 5613: copy scalar variable used for compgen -y + + * Sven: 5605: explanation listing fix + + * Sven: 5604: approximate completion. + + * Sven: 5603: compstat[pattern_match] + + * pws: 5602: _tar + + * Sven: 5601: compstate[exact_string] and compstate[total_matchers] + + * Sven: 5599: _comp_parts, _path_files tweaks + + * Sven: 5598: a neater way of handling compadd -p/-P + + * pws; 5597: Use separate file mymods.conf for your own builtin + modules rather than the automatically generated modules-bltin. + + * Matt: 5596: Makefile dependencies for module compilation + + * Sven: 5593: _path_files -w + + * Sven: 5590: compadd -p, -s and -P fixes + + * Sven: 5588: fix _most_recent_file idiocy + + * Sven: 5586: addmatch fix (old completion wasn't working) + + * pws: 5583: post-patch restructuring of _mh, _zftp, + _most_recent_file. + + * Sven: 5582: _path_files will expand /u/ -> /usr/ even if /u + exists if nothing later on would match otherwise (got that?) + + * Sven: 5574, 5578: Completion/README notes + + * Sven: 5571: Functions/Builtins/_cd tests if $cdpath is set + + * Sven: 5566: $foo[(b.<index>.i)<match>] starts searching $foo for + for <match> at <index> + + * Sven: 5565, 5576: $NUMERIC gives the numeric argument in a zle + widget + + * Sven: 5564, 5577, 5579: massive new completion reworking with + $words, $compstate, etc., etc. + + * pws: 5561: attempted (untested) fix for QNX4 compilation; + halloc() is now zhalloc(). (By private email from + probin@qnx.co.uk, it seems the QNX problems are more + considerable with 3.1.5.) + + * Sven: 5560: subscripting fixes in params.c: flags for scalars + and converting integer AA element to string + + * pws: 5559: cd /.. doesn't show .. (except if RFS was detected). + + * Larry P. Schrof: 5550: last -> previous in history documentation + + * pws: 5557: configure.in for making sure signals really are + defined in the file found. This was in pws-10, but the patch + didn't appear on the list for four days. + + * 3.1.5-pws-10 made available + + * pws: unposted: Functions/Completion moved to Completion; + subdirectories Core, Base, Builtins, User, Commands created; + Completion/README created. + + * Matt: 5553: under _WIN32, .exe suffix is optional for commands + + * Sven: 5548: _path_files, _comp_parts + + * Sven: 5547: group handling -J/-V in compadd + + * pws: 5545: silly set -x mistake + + * Sven: 5544: another completion cleanup + + * Sven: 5543: compadd -X, zshcompwid manual + + * pws: 5538: approximate pattern matching, (#a1)readme etc. + + * pws: 5531: small init fix + + * Sven: 5529: cleanup for Functions/Completion + + * Sven: 5521: improved option handling for _path_files + + * Sven: 5512, 5525: globcomplete fix for new completion + + * Sven: 5511: make sure compctl is available for new completion + + * pws: 5508: init and dump, globbing and printing. + + * pws: unposted, see 5503: remove dynamic=no from configure.in when + underscore is needed. + + * Sven: 5490: unset test for AA elements when substituting + + * Sven: 5489: control for matching in _path_files and _comp_parts + + * Sven: 5483: completeinword fixes + + * Sven: 5476: quoting of tildes in Functions/Completion/_path_files + + * Sven: 5471: range code knows not to handle associative arrays + + * Sven: 5470: new completion conditions didn't handle untokenization + consistently. + + * Sven: 5469: init fix and Functions/Completion/_comp_parts + + * Sven: 5467: expn manual typo + + * Sven: 5466: compwid manual for -after and -between + + * Sven: 5455: keep track of which matcher specification to use + + * Matt: 5330: I've put this back the way it original was. I hate + sed almost as much as awk. + + * Martin Buchholz: 5448: libc.h can't be included on Debian Linux, + so only include it on NeXT where it's necessary. + + * 3.1.5-pws-9 made available + + * pws: unposted (but see 5440): zftp changes: more return 6's, + functions now do auto-open and avoid subshells. + + * pws: 5436: set -x for function calls and ((...)). + + * Sven: 5430: rewrite Functions/Completions with simplified syntax + (no #array type completions). + + * Sven: 5429: $CONTEXT strings + + * pws: 5425: fix pattern matching for new completion + + * Sven: 5424: addmatches fix when not doing matching + + * Sven: 5423: compadd accepts either - or -- to end options + + * Sven: 5422: braces in completions were not tokenized; array + parameters wereused uncopied + + * pws: 5421: setting same element of assoc array in full array + assignment crashed + + * Sven: 5418: small addmatches fixes + + * Sven: 5417: multiple subscripts with undefined array + + * Sven: 5415: anchors in matchers shouldn't match variable part of + completion + + * Sven: 5412: better matcher control + + * Helmut Jarausch/pws: 5410: IRIX 6.5 problems in Etc/MACHINES + + * pws: 5408: set -x output for [[ ... ]] + + * pws: 5403: magicequalsubst now affects all ...=~...:~ + + * Sven: 5401: files -> __files + + * Sven: 5400, 5402: print needs - in dump; auto-dump and use + $COMPDUMP file + + * Sven: 5399, 5407: do_ambiguous overhaul + + * pws: 5398: fixlet for __path_files + + * pws: 5393: dump new completion status for faster init + + * Sven: 5384, 5397: manual for new completion so far + + * Andrej: 5377: Reliant UNIX configuration + + * Oliver: 5374: compctl -T doc for ~dirs + + * Oliver: 5372: change of mailing list host + + * Bart: 5367: CVS ignores version.h + + * 3.1.5-pws-8 made available + + * pws: 5365: make dependencies for main.o, Makemod, zshpaths.h + + * pws: 5364: 5281 now works + + * pws: Misc/Completion now Functions/Completion, some new + new-style completions + + * pws: 5362: #key-* completions allow >= 0 key bindings + + * Sven: 5355: compadd -R function for suffix removal + + * Sven: 5354: redisplaying completion lists, don't show if + completion failed + + * Sven: 5352: new fignore handling + + * pws/Bart: 5349, 5361: "$foo[@]" didn't get removed if $foo + wasn't set + + * pws/Sven: 5341, 5351: completion init and __normal + + * Sven: 5342, 5343: ignoring ignored prefix in new conditions + + * Sven: 5341: modularise new completion shell code + + * Sven: 5335: printing zle condition codes + + * pws: 5332: emulate -L + + * Sweth/Bart/pws: zsh-users/2121: Functions/allopt with the odd + emulate and local added + + * pws/Matt: 5326, 5329, 5330: signames.c generation + + * pws: 5321: compctl -LM + + * Sven: 5320: keys available in zle widgets + + * Sven: 5316: compctl matcher users reference counts + + * Matt: 5311: CHAR(+) -> CHAR(43) in zmacros + + * Bart: 5305: trashzle() crashed shell with loading dynamic but + zle builtin + + * Bart: 5299: PWD, OLDPWD export confusion + + * Bart: 5297: local variables and $argv doc + + * Geoff: 5295: no ld -g on NetBSD + + * 3.1.5-pws-7 made available + + * pws; 5281: interrupts in getquery() weren't handled gracefully + + * Sven: 5266: get matcher number in new completion functions + + * Sven: 5265, 5284: rewrite of $foo:q and doc + + * Sven: 5262: compctl -M, REC_EXACT fixes + + * Sven: 5261, 5268: GLOB_COMPLETE docs + + * Bart: 5260: new mailing lists in Meta-FAQ + + * Bart: 5258: parameter scoping docs + + * pws: 5247: typeset -T fix + + * pws: Etc/MACHINES: Linux Alpha with egcs + + * pws: 5233: .zlogout doc + + * pws/Sven: 5229, 5234, 5235, 5269: bashautolist option + + * Sven: 5120: use ${foo:q} for quoting completion prefix/suffix + + * Sven: 5208: preliminary version of ${foo:q} + + * Sven: 5207: completion in conditions + + * Sven: 5206: completion in arrays + + * Sven: 5203: o -> f, O -> o, O = ^o + + * Sven: 5201: zle commands erase listing when minibuffer used + + * pws: 5185, 5198: compctl documentation tidy-up + + * Sven: 5183, 5199, 5200: ${(P)...} flag + + * Sven: 5178: fix for command completion and pattern completions + + * Bart: 5174: unset assoc array elements + + * Sven: 5145, 5204: compadd -m, -F, -r + + * Sven: 5144: partial word completion fix + + * Matt: 5133: cygwin needs native getcwd() + + * Matt Armstrong: 5132, 5151: makepro.awk can spit out + preprocessor lines, move init.pro inclusion + + * Bart: 5129: vared assoc array and elements thereof + + * Bart: 4965, missing hunk: unset assoc array when assigned as + scalar + + * pws: 5054: zls + + * 3.1.5-pws-6 made available + + * Drazen Kacar/pws: 5118: unlock terminal device on Solaris + + * pws: 5111: unsetting special zle variables + + * Sven: 5107: glob qualifier o for modes + + * pws: 5105: remove old zle -C, zle -C does new completion + + * Sven: 5104: zle and widget information via variables + + * Drazen Kacar/pws/Bart: 5103, 5113: terminal bug on Solaris with + Openwindows + + * Sven: 5102: glob qualifiers doc + + * pws: 5094, 5120: typeset -T MYPATH mypath; MYPATH=(foo), + mypath=foo fix; PATH=(foo) bug + + * Sven: 5092: extra completion context + + * Sven: 5060: completion in brace expansion + + * Sven: 5059, 5065, 5085: compcall, compctl -K ' func', avoid + recursion, fix dynamic loading + + * pws: 5047: make install doesn't make install.info + + * Phil/Bart: 5032, 5037: zless with localoptions added + + * Sven: 5022, 5045, 5078: ${(t)param} and nounset behaviour + + * Andrej: 5016: insert zsh.info into dir when installing + + * pws: new mirror site ftp://ftp.win.ne.jp/pub/shell/zsh/ + + * Sven: 4986, 4988: new-style completion after redirection + + * Sven: 4981: fix completion whitespace for copy-previous-word + + * Sven: 4979, 4987: new glob modifiers for sort order and + selecting items from list + + * Sven: 4976: compadd and new-completion-examples + + * Sven: 4975, 5007: comptl -M matches with *'s + + * Sven: 4974: compctl list with single string + + * Andrej: 5021: configuration on Reliant UNIX + + * Bart: 4965: add-on + + * Sven: 4957: completion after redirection + + * Made available as 3.1.5-pws-5; top level directory now + zsh-3.1.5-pws-5 + + * Helmut Jarausch: 4947: part of patch missed + + * Sven: 4850, 4881, 4941, 4942, 4943, 4944, 4946, 4949, 4950, + 4945: New completion system + + * Sven: 4940: compctl -t (minor incompatibility) + + * pws: 4939: configure checks for tgetent() accepts null but then + tgetstr() dumps core + + * pws: 4931: compiler warnings + + * Sven: 4930: completion after reserved words + + * pws/Bart: 4923, 4924: findcmd() memory leak and comment + + * pws: 4912: Etc/MACHINES + + * pws: 4902: typeset neatness, -a, -m + + * Bart: 4893: setting assoc array elements inside a substitution + + * Andrej Borsenkow + pws: 4888: zftp shouldn't dup sockets until + connected + + * Oliver Kiddle: 4887: configure + + * Sven: 4880: conditions from module again + + * Sven: 4879: group completion + + * Sven: 4878: accept-and-menu-complete + + * Bart: 4874: array slices + + * Geoff: 4855: refresh line the same length as terminal width + + * pws: 4852: zftp test subcommand + + * Bart: 4851: sethparam(), part got missed + + * 3.1.5-pws-4 made available + + * Sven: 4845: isident() + + * Sven: 4837, 4842: more for loadable conditions + + * Sven: 4828: ignored character + + * Bart/Sven: 4826, 4831, 4836: assoc array fixes + + * Gene Cohler + pws: 4824, 4833, 4843: dynamical loading under + HPUX + + * Sven: 4821: network byte order in zftp + + * Bart: 4817: parameter documentation + + * Sven: 4806, 4815, 4820, 4822, 4830: be careful when unloading + modules which may have side effects + + * pws: 4805: define INADDR_NONE in zftp if not defined + + * pws: 4801: compilation without HAVE_GETPWUID + + * Bart: 4792: Handle --program-{suf,pre}fix in configure + + * Bart: 4791: don't hash PWD after all + + * Bart: 4789, 4794, 4795: sethparam(), setsparam; allow assoc + array assignment ${(AA)=assoc::=key1 val1 ...} + + * Bart: 4788: some missing patches put back + + * Phil: 4784: unused variable j in glob.c + + * Phil: 4783: wtmp is in /var/log on Linux + + * pws: 4779: compiling statically linked + + * pws: version 3.1.5-pws-3 made available + + * Sven: 4767: completion listing fix + + * Bart: 4763, 4766, 4764: associative arrays using subscripting + flags and typeset output + + * Bart: 4762: use of conddef without dynamic loading + + * pws: 4761: zftp module + + * Phil: 4737: typeset -a docs + + * pws: 4736, 4754: ${foo/orig/new} subst as in bash; optimize + pattern matching in strings + + * Phil Pennock: 4727: associative arrays in stat builtin + + * Sven: 4716, 4732, 4734, 4742, 4769: allow modules for + conditions and wrappers around functions + + * Sven: 4700: heap memory fixes suggested by Phil Pennock + + * Sven: 4698, 4707: ignore completions if cursor not in + completable part of word + + * Sven: 4697: zle_tricky.c + + * pws: 4693: case-indendent globbing fix + + * Bart: 4678: viforwardword + + * pws: don't use vifirstnonblank()in vioperswapcase() + + * Bart: 4674: scanmatchtable() + + * Bart: 4482: cdmatch2 + + * Bart: 4644: delimiters in parameter substitution flags + + * Bart: 4624: don't be too clever with optimizing when doing *** + + * pws: 4612: 8 bit character input problem if char was signed + + * Bart: 4606: error messages from parameters + + * pws: 4601: rewrite prompt truncation in more predictable, + delimitable way + + * Bart: 4599, 4602, 4608, 4641, 4653, 4654: associative arrays + + * pws: 4596: allow PWD to be hashed on explicit user request + + * pws: 4595: globbing fix for problem which showed up in `case' + + * Wilfredo Sanchez: 4594: fix configure problems + + * pws: 4591: test line length in prompt e.g. %(40l.yes.no) + + * Bart: 4589: PWD and OLDPWD fix + + * Bart: 4472: doc fixes + + * Bart: 4471: fixes for shell functions + + * Bart: line missed in zle_tricky.c when patching + + * Bart: 4589: chpwd + + * pws: lete2ctl update + + * pws: fixsuffix() missed in delcharorlist() when patching + + * Bart: 4574: doc fix + + * Bart: 4570: flags to allow zle command not to interrupt + cumulative effects, deltochar + + * pws: 4564: fix completion suffix for yank + + * pws: 4533: ~PWD should not be displayed as such + + * pws: 4513, 4552: case-insensitive globbing (#i) + + * Sven: 4509, 4510, 4526, 4527, 4534, 4557: alternative matches in + completion (compctl -t), mapping between characters on line and + in matches (compctl -M) + + * pws: 4477: change function names to avoid dynamic loading + clashes + + * Bart: 4473, 4475, 4476: collected minor fixes since 3.1.5 + + * Zoli: 3933: AIX dynamic patch + Thu Oct 29 21:51:10 1998 Andrew Main <zefram@zsh.org> * Config/version.mk: Version 3.1.5. diff --git a/Completion/Base/_arguments b/Completion/Base/_arguments index 5170acb84..bf263d6e9 100644 --- a/Completion/Base/_arguments +++ b/Completion/Base/_arguments @@ -3,386 +3,345 @@ # Complete the arguments of the current command according to the # descriptions given as arguments to this function. -local long args rest ws cur nth def nm expl descr action opt arg tmp +local long cmd="$words[1]" descr mesg subopts opt usecc autod +local oldcontext="$curcontext" hasopts -# Associative arrays used to collect information about the options. +long=$argv[(I)--] +if (( long )); then + local name tmp tmpargv -typeset -A opts mopts dopts dmopts odopts odmopts - -# See if we support long options, too. + if [[ long -eq 1 ]]; then + tmpargv=() + else + tmpargv=( "${(@)argv[1,long-1]}" ) + fi -nth=$argv[(I)--] -if (( nth )); then - long=( "${(@)argv[nth+1,-1]}" ) - argv=("${(@)argv[1,nth-1]}") -else - long=() -fi + name=${~words[1]} + [[ "$name" != /* ]] && tmp="$PWD/$name" -# Now parse the arguments... + name="_args_cache_${name}" + name="${name//[^a-zA-Z0-9_]/_}" -args=() -nth=1 -while (( $# )); do + if (( ! ${(P)+name} )); then + local iopts sopts pattern tmpo cur cache + typeset -U lopts - # This describes a one-shot option. + cache=() - if [[ "$1" = [-+]* ]]; then - if [[ "$1" = *:* ]]; then + # We have to build a new long-option cache, get the `-i' and + # `-s' options. - # If the option name ends in a `-', the first argument comes - # directly after the option, if it ends in a `+', the first - # argument *may* come directly after the option, otherwise it - # is in the next word. + set -- "${(@)argv[long+1,-1]}" - if [[ "$1" = [^:]##-:* ]]; then - dopts[${${1%%:*}[1,-2]}]="${1#*:}" - elif [[ "$1" = [^:]##+:* ]]; then - odopts[${${1%%:*}[1,-2]}]="${1#*:}" + iopts=() + sopts=() + while [[ "$1" = -[is]* ]]; do + if [[ "$1" = -??* ]]; then + tmp="${1[3,-1]}" + cur=1 else - opts[${1%%:*}]="${1#*:}" + tmp="$2" + cur=2 fi - else - opts[$1]='' - fi - elif [[ "$1" = \*[-+]* ]]; then - - # The same for options that may appear more than once. - - if [[ "$1" = *:* ]]; then - if [[ "$1" = [^:]##-:* ]]; then - dmopts[${${1[2,-1]%%:*}[1,-2]}]="${1#*:}" - elif [[ "$1" = [^:]##+:* ]]; then - odmopts[${${1[2,-1]%%:*}[1,-2]}]="${1#*:}" + if [[ "$tmp[1]" = '(' ]]; then + tmp=( ${=tmp[2,-2]} ) else - mopts[${1[2,-1]%%:*}]="${1#*:}" + tmp=( "${(@P)tmp}" ) fi - else - mopts[${1[2,-1]}]='' - fi - elif [[ "$1" = \*:* ]]; then + if [[ "$1" = -i* ]]; then + iopts=( "$iopts[@]" "$tmp[@]" ) + else + sopts=( "$sopts[@]" "$tmp[@]" ) + fi + shift cur + done - # This is `*:...', describing `all other arguments'. + # Now get the long option names by calling the command with `--help'. + # The parameter expansion trickery first gets the lines as separate + # array elements. Then we select all lines whose first non-blank + # character is a hyphen. Since some commands document more than one + # option per line, separated by commas, we convert commas int + # newlines and then split the result again at newlines after joining + # the old array elements with newlines between them. Then we select + # those elements that start with two hyphens, remove anything up to + # those hyphens and anything from the space or comma after the + # option up to the end. - rest="${1[3,-1]}" - elif [[ "$1" = :* ]]; then + lopts=("--${(@)^${(@)${(@)${(@M)${(@ps:\n:j:\n:)${(@)${(@M)${(@f)$(_call options ${~words[1]} --help 2>&1)//\[--/ +--}:#[ ]#-*}//,/ +}}:#[ ]#--*}#*--}%%[], ]*}:#}") + lopts=( "${(@)lopts:#--}" ) - # This is `:...', describing `the next argument'. + # Now remove all ignored options ... - args[nth++]="${1#*:}" - else + while (( $#iopts )); do + lopts=( ${lopts:#$~iopts[1]} ) + shift iopts + done - # And this is `n:...', describing the `n'th argument. + # ... and add "same" options - args[${1%%:*}]="${1#*:}" - nth=$(( ${1%%:*} + 1 )) - fi - shift -done + while (( $#sopts )); do + lopts=( $lopts ${lopts/$sopts[1]/$sopts[2]} ) + shift 2 sopts + done -if [[ $#long -ne 0 && "$PREFIX" = --* ]]; then + # Then we walk through the descriptions plus a few builtin ones. - # If the current words starts with `--' and we should use long - # options, just call... + set -- "$@" '*=FILE*:file:_files' \ + '*=(DIR|PATH)*:directory:_files -/' '*: :' - _long_options "$long[@]" -else + while (( $# )); do - # Otherwise parse the command line... + # First, we get the pattern and the action to use and take them + # from the positional parameters. - ws=( "${(@)words[2,-1]}" ) - cur=$(( CURRENT-2 )) - nth=1 + pattern="${${${(M)1#*[^\\]:}[1,-2]}//\\\\:/:}" + descr="${1#${pattern}}" + shift - # ...until the current word is reached. + # We get all options matching the pattern and take them from the + # list we have built. If no option matches the pattern, we + # continue with the next. - while [[ cur -gt 0 ]]; do + tmp=("${(@M)lopts:##$~pattern}") + lopts=("${(@)lopts:##$~pattern}") - # `def' holds the description for the option we are currently after. - # Check if the next argument for the option is optional. + (( $#tmp )) || continue - if [[ "$def" = :* ]]; then - opt=yes - else opt='' - fi - arg='' - - # Remove one description/action pair from `def' if that isn't empty. - if [[ -n "$def" ]]; then - if [[ "$def" = ?*:*:* ]]; then - def="${def#?*:*:}" - else - def='' - fi - else + # If there are option strings with a `[=', we take these get an + # optional argument. - # If it is empty, and the word starts with `--' and we should - # complete long options, just ignore this word, otherwise make sure - # we test for options below and handle normal arguments. + tmpo=("${(@M)tmp:#*\[\=*}") + if (( $#tmpo )); then + tmp=("${(@)tmp:#*\[\=*}") + tmpo=("${(@)${(@)tmpo%%\=*}//[^a-z0-9-]}") - if [[ $#long -eq 0 || "$ws[1]" != --* ]]; then - opt=yes - arg=yes - else - def='' + if [[ "$descr" = ::* ]]; then + cache=( "$cache[@]" "${(@)^tmpo}=${descr}" ) + else + cache=( "$cache[@]" "${(@)^tmpo}=:${descr}" ) + fi fi - fi - - if [[ -n "$opt" ]]; then - - # `opt' was set above if we have to test if the word is an option. - # We first test for the simple options -- those without arguments or - # those whose arguments have to be given as separate words. - - if (( $+opts[$ws[1]] )); then - - # Options that may only be given once are removed from the - # associative array so that we are not offered them again. - def="$opts[$ws[1]]" - unset "opts[$ws[1]]" - elif (( $+mopts[$ws[1]] )); then - def="$mopts[$ws[1]]" - else + # Descriptions with `=': mandatory argument. - # If the word is none of the simple options, test for those - # whose first argument has to or may come directly after the - # option. This is done in four loops looking very much alike. + tmpo=("${(@M)tmp:#*\=*}") + if (( $#tmpo )); then + tmp=("${(@)tmp:#*\=*}") + tmpo=("${(@)${(@)tmpo%%\=*}//[^a-z0-9-]}") - if (( $#dopts )); then + cache=( "$cache[@]" "${(@)^tmpo}=${descr}" ) + fi - # First we get the option names. + # Everything else is just added as a option without arguments. - tmp=( "${(@k)dopts}" ) + if (( $#tmp )); then + tmp=("${(@)tmp//[^a-zA-Z0-9-]}") + cache=( "$cache[@]" "$tmp[@]" ) + fi + done + eval "${name}=( \"\${(@)cache:# #}\" )" + fi + set -- "$tmpargv[@]" "${(@P)name}" +fi - # Then we loop over them and see if the current word begins - # with one of the option names. +subopts=() +while [[ "$1" = -(O*|C) ]]; do + case "$1" in + -C) usecc=yes; shift ;; + -O) subopts=( "${(@P)2}" ); shift 2 ;; + *) subopts=( "${(@P)1[3,-1]}" ); shift ;; + esac +done - while (( $#tmp )); do - [[ "$ws[1]" = ${tmp[1]}* ]] && break - shift 1 tmp - done +zstyle -s ":completion:${curcontext}:options" auto-description autod - if (( $#tmp )); then +if (( $# )) && comparguments -i "$autod" "$@"; then + local nm="$compstate[nmatches]" action noargs aret expl local + local next direct odirect equal single match matched ws tmp1 tmp2 tmp3 + local opts subc prefix suffix + local origpre="$PREFIX" origipre="$IPREFIX" - # It does. So use the description for it, but only from - # the second argument on, because we are searching the - # description for the next command line argument. + if comparguments -D descr action; then + comparguments -C subc + curcontext="${oldcontext%:*}:$subc" - opt='' - def="$dopts[$tmp[1]]" - unset "dopts[$tmp[1]]" - if [[ "$def" = ?*:*:* ]]; then - def="${def#?*:*:}" - else - def='' - fi - fi - fi - if [[ -n "$opt" && $#dmopts -ne 0 ]]; then - tmp=( "${(@k)dmopts}" ) - while (( $#tmp )); do - [[ "$ws[1]" = ${tmp[1]}* ]] && break - shift 1 tmp - done - - if (( $#tmp )); then - opt='' - def="$dmopts[$tmp[1]]" - if [[ "$def" = ?*:*:* ]]; then - def="${def#?*:*:}" - else - def='' - fi - fi - fi - if [[ -n "$opt" && $#odopts -ne 0 ]]; then - tmp=( "${(@k)odopts}" ) - while (( $#tmp )); do - [[ "$ws[1]" = ${tmp[1]}* ]] && break - shift 1 tmp - done - - if (( $#tmp )); then - opt='' - def="$odopts[$tmp[1]]" - unset "odopts[$tmp[1]]" - - # For options whose first argument *may* come after the - # option, we skip over the first description only if there - # is something after the option name on the line. - - if [[ "$ws[1]" != "$tmp[1]" ]]; then - if [[ "$def" = ?*:*:* ]]; then - def="${def#?*:*:}" - else - def='' - fi - fi - fi - fi - if [[ -n "$opt" && $#odmopts -ne 0 ]]; then - tmp=( "${(@k)odmopts}" ) - while (( $#tmp )); do - [[ "$ws[1]" = ${tmp[1]}* ]] && break - shift 1 tmp - done - - if (( $#tmp )); then - opt='' - def="$odmopts[$tmp[1]]" - if [[ "$ws[1]" != "$tmp[1]" ]]; then - if [[ "$def" = ?*:*:* ]]; then - def="${def#?*:*:}" - else - def='' - fi - fi - fi - fi - - # If we didn't find a matching option description and we were - # told to use normal argument descriptions, just increase - # our counter `nth'. - - if [[ -n "$opt" && -n "$arg" ]]; then - def='' - (( nth++ )) - fi - fi + if comparguments -O next direct odirect equal; then + opts=yes + _tags arguments options + else + _tags arguments + fi + else + if comparguments -a; then + noargs='no more arguments' + else + noargs='no arguments' fi + comparguments -O next direct odirect equal || return 1 - shift 1 ws - (( cur-- )) - done + opts=yes + _tags options + fi - # Now generate the matches. + while true; do + while _tags; do + if [[ -n "$matched" ]] || _requested arguments; then + _description arguments expl "$descr" + + if [[ "$action" = -\>* ]]; then + comparguments -W line opt_args + state="${${action[3,-1]##[ ]#}%%[ ]#}" + if [[ -n "$usecc" ]]; then + curcontext="${oldcontext%:*}:$subc" + else + context="$subc" + fi + compstate[restore]='' + aret=yes + else + if [[ -z "$local" ]]; then + local line + typeset -A opt_args + local=yes + fi - nm="$compstate[nmatches]" + comparguments -W line opt_args - if [[ -z "$def" || "$def" = :* ]]; then + if [[ "$action" = \ # ]]; then - # We either don't have a description for an argument of an option - # or we have a description for a optional argument. + # An empty action means that we should just display a message. - if [[ -z "$def" ]]; then + [[ -n "$matched" ]] && compadd -n -Q -S '' -s "$SUFFIX" - "$PREFIX" + mesg="$descr" - # If we have none at all, use the one for this argument position. + elif [[ "$action" = \(\(*\)\) ]]; then - def="$args[nth]" - [[ -z "$def" ]] && def="$rest" - fi + # ((...)) contains literal strings with descriptions. - # In any case, we have to complete option names here, but we may - # be in a string that starts with an option names and continues with - # the first argument, test that (again, four loops). + eval ws\=\( "${action[3,-3]}" \) - opt=yes - if (( $#dopts )); then + _describe "$descr" ws -M "$match" "$subopts[@]" - # Get the option names. + elif [[ "$action" = \(*\) ]]; then - tmp=( "${(@k)dopts}" ) - while (( $#tmp )); do - if compset -P "$tmp[1]"; then + # Anything inside `(...)' is added directly. - # The current string starts with the option name, so ignore - # that and complete the rest of the string. + _all_labels arguments expl "$descr" \ + compadd "$subopts[@]" - ${=action[2,-2]} + elif [[ "$action" = \{*\} ]]; then - def="$dopts[$tmp[1]]" - opt='' - break - fi - shift 1 tmp - done - fi - if [[ -n "$opt" && $#dmopts -ne 0 ]]; then - tmp=( "${(@k)dmopts}" ) - while (( $#tmp )); do - if compset -P "$tmp[1]"; then - def="$dmopts[$tmp[1]]" - opt='' - break - fi - shift 1 tmp - done - fi - if [[ -n "$opt" && $#odopts -ne 0 ]]; then - tmp=( "${(@k)odopts}" ) - while (( $#tmp )); do - if compset -P "$tmp[1]"; then - def="$odopts[$tmp[1]]" - opt='' - break - fi - shift 1 tmp - done - fi - if [[ -n "$opt" && $#odmopts -ne 0 ]]; then - tmp=( "${(@k)odmopts}" ) - while (( $#tmp )); do - if compset -P "$tmp[1]"; then - def="$odmopts[$tmp[1]]" - opt='' - break - fi - shift 1 tmp - done - fi - if [[ -n "$opt" ]]; then - - # We aren't in an argument directly after a option name, so - # all option names are possible matches. - - _description expl option - compadd "$expl[@]" - "${(@k)opts}" "${(@k)mopts}" \ - "${(@k)dopts}" "${(@k)dmopts}" \ - "${(@k)odopts}" "${(@k)odmopts}" - fi - fi + # A string in braces is evaluated. - # Now add the matches from the description, if any. + while _next_label arguments expl "$descr"; do + eval "$action[2,-2]" + done + elif [[ "$action" = \ * ]]; then - if [[ -n "$def" ]]; then + # If the action starts with a space, we just call it. - # Ignore the leading colon describing optional arguments. + eval "action=( $action )" + while _next_label arguments expl "$descr"; do + "$action[@]" + done + else - [[ "$def" = :* ]] && def="$def[2,-1]" + # Otherwise we call it with the description-arguments. - # Get the description and the action. + eval "action=( $action )" + _all_labels arguments expl "$descr" \ + "$action[1]" "$subopts[@]" "${(@)action[2,-1]}" + fi + fi + fi - descr="${def%%:*}" - action="${${def#*:}%%:*}" + if [[ -z "$matched$hasopts" ]] && _requested options && + { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || + [[ "$origpre" = [-+]* || + ( -z "$aret$mesg" && nm -eq compstate[nmatches] ) ]] } ; then + local prevpre="$PREFIX" previpre="$IPREFIX" + + hasopts=yes + + PREFIX="$origpre" + IPREFIX="$origipre" + + comparguments -M match + + if comparguments -s single; then + + _description options expl option + + if [[ "$single" = direct ]]; then + compadd "$expl[@]" -QS '' - "${PREFIX}${SUFFIX}" + elif [[ "$single" = next ]]; then + compadd "$expl[@]" -Q - "${PREFIX}${SUFFIX}" + elif [[ "$single" = equal ]]; then + compadd "$expl[@]" -QqS= - "${PREFIX}${SUFFIX}" + else + tmp1=( "$next[@]" "$direct[@]" "$odirect[@]" "$equal[@]" ) + tmp3=( "${(M@)tmp1:#[-+]?[^:]*}" ) + tmp1=( "${(M@)tmp1:#[-+]?(|:*)}" ) + tmp2=( "${PREFIX}${(@M)^${(@)${(@)tmp1%%:*}#[-+]}:#?}" ) + + _describe -o option \ + tmp1 tmp2 -Q -S '' -- \ + tmp3 -Q + fi + single=yes + else + next=( "$next[@]" "$odirect[@]" ) + _describe -o option \ + next -Q -M "$match" -- \ + direct -QS '' -M "$match" -- \ + equal -QqS= -M "$match" + fi + PREFIX="$prevpre" + IPREFIX="$previpre" + fi + done + if [[ -n "$opts" && -z "$aret$matched$mesg" && + nm -eq compstate[nmatches] ]]; then - _description expl "$descr" + PREFIX="$origpre" + IPREFIX="$origipre" - if [[ -z "$action" ]]; then + prefix="${PREFIX#*\=}" + suffix="$SUFFIX" + PREFIX="${PREFIX%%\=*}" + SUFFIX='' + compadd -M "$match" -D equal - "${(@)equal%%:*}" - # An empty action means that we should just display a message. - _message "$descr" - return 1 - elif [[ "$action[1]" = \( ]]; then + if [[ $#equal -eq 1 ]]; then + PREFIX="$prefix" + SUFFIX="$suffix" + IPREFIX="${IPREFIX}${equal[1]%%:*}=" + matched=yes - # Anything inside `(...)' is added directly. + comparguments -L "${equal[1]%%:*}" descr action subc + curcontext="${oldcontext%:*}:$subc" - compadd "$expl[@]" - ${=action[2,-2]} - elif [[ "$action" = \ * ]]; then + _tags arguments - # If the action starts with a space, we just call it. + continue + fi + fi + break + done - $=action - else + [[ -z "$aret" || -z "$usecc" ]] && curcontext="$oldcontext" - # Otherwise we call it with the description-arguments built above. + [[ -n "$aret" ]] && return 300 - action=( $=action ) - "$action[1]" "$expl[@]" "${(@)action[2,-1]}" - fi - fi + [[ -n "$mesg" ]] && _message "$mesg" + [[ -n "$noargs" ]] && _message "$noargs" # Set the return value. - [[ nm -ne "$compstate[nmatches]" ]] + [[ nm -ne "$compstate[nmatches]" ]] +else + return 1 fi diff --git a/Completion/Base/_default b/Completion/Base/_default index 8bcf14f6a..fd5869e2e 100644 --- a/Completion/Base/_default +++ b/Completion/Base/_default @@ -1,13 +1,23 @@ -#defcomp -default- +#compdef -default- -# We first try the `compctl's. This is without first (-T) and default (-D) -# completion. If you want them add `-T' and/or `-D' to this command. -# If there is a `compctl' for the command we are working on, we return -# immediatly. If you want to use new style completion anyway, remove the -# `|| return'. Also, you may want to use new style completion if the -# `compctl' didn't produce any matches. In that case remove the `|| return' -# and at the line `[[ -nmatches 0 ]] || return' after `compcall'. +local ctl -compcall || return +if { zstyle -s ":completion:${curcontext}:" use-compctl ctl || + zmodload -e zsh/compctl } && [[ "$ctl" != (no|false|0|off) ]]; then + local opt -_files + opt=() + [[ "$ctl" = *first* ]] && opt=(-T) + [[ "$ctl" = *default* ]] && opt=("$opt[@]" -D) + compcall "$opt[@]" || return 0 +fi + +_wanted files || return 1 + +_files && return 0 + +# magicequalsubst allows arguments like <any-old-stuff>=~/foo to do +# file name expansion after the =. In that case, it's natural to +# allow completion to handle file names after any equals sign. + +[[ -o magicequalsubst ]] && compset -P 1 '*=' && _files diff --git a/Completion/Base/_describe b/Completion/Base/_describe index e01c77509..6e6f4f4a9 100644 --- a/Completion/Base/_describe +++ b/Completion/Base/_describe @@ -2,154 +2,52 @@ # This can be used to add options or values with descriptions as matches. -setopt localoptions extendedglob +local _opt _expl _tmps _tmpd _tmpmd _tmpms _ret=1 _showd _nm _hide _args +local _type=values _descr -local gdescr isopt cmd opt nsets tmp descr match descrs matches adescr i -local disps disp expl tmps tmpd tmpmd tmpms name ret=1 showd _nm +# Get the option. -cmd="$words[1]" - -# Get the options. - -while getopts 'oc:' opt; do - if [[ "$opt" = o ]]; then - isopt=yes - else - cmd="$OPTARG" - fi -done -shift OPTIND-1 +if [[ "$1" = -o ]]; then + _type=options + shift +fi # Do the tests. `showd' is set if the descriptions should be shown. -if [[ -n "$isopt" ]]; then - - # We take the value to test the number of patches from a non-local - # parameter `nm' if that exists and contains only digits. It's a hack. - - if [[ "$nm" = [0-9]## ]]; then - _nm="$nm" - else - _nm=0 - fi - [[ -n "$compconfig[option_prefix]" && - "$compconfig[option_prefix]" != *\!${cmd}* && - "$PREFIX" != [-+]* && - ( "$compconfig[option_prefix]" = *nodefault* || - _nm -ne compstate[nmatches] ) ]] && return 1 +_wanted "$_type" || return 1 - [[ -n "$compconfig[describe_options]" && - "$compconfig[describe_options]" != *\!${cmd}* ]] && showd=yes -else - [[ -n "$compconfig[describe_values]" && - "$compconfig[describe_values]" != *\!${cmd}* ]] && showd=yes -fi +zstyle -T ":completion:${curcontext}:$_type" verbose && _showd=yes -gdescr="$1" +_descr="$1" shift -# Now interpret the arguments. +[[ "$_type" = options ]] && + zstyle -t ":completion:${curcontext}:options" prefix-hidden && _hide=yes -nsets=0 -adescr=() -descrs=() -matches=() -while (( $# )); do - (( nsets++ )) - descr="$1" - [[ -n "$showd" ]] && adescr=( "$adescr[@]" "${(@PM)^descr:#*:?*},$nsets" ) - if [[ "$2" = -* ]]; then - match='' - shift - else - match="$2" - shift 2 - fi - tmp=$argv[(i)--] - if [[ tmp -eq 1 ]]; then - opt=() - else - opt=( "${(@)argv[1,tmp-1]}" ) - fi - if [[ tmp -gt $# ]]; then - argv=() +while _next_label "$_type" _expl "$_descr"; do + + if [[ -n "$_showd" ]]; then + compdescribe -I ' -- ' "$@" else - shift tmp + compdescribe -i "$@" fi - # `descr' and `matches' collect the names of the arrays containing the - # possible matches with descriptions and the matches to add. - # The options to give to `compadd' are stored in local arrays. + while compdescribe -g _args _tmpd _tmpmd _tmps _tmpms; do - descrs[nsets]="$descr" - matches[nsets]="$match" - typeset -a _descr_opts_$nsets - eval "_descr_opts_${nsets}=( \"\$opt[@]\" )" -done - -(( nsets )) || return 1 - -# Build the display strings if needed. - -[[ -n "$showd" ]] && _display disps "$adescr[@]" -_description expl "$gdescr" + # See if we should remove the option prefix characters. -# Loop through the array/option sets we have. - -i=0 -while [[ ++i -le nsets ]]; do - name=_descr_opts_$i - [[ -n "$showd" ]] && disp=( "${(@)${(@M)disps:#*,${i}}%,*}" ) - descr=( "${(@P)descrs[i]}" ) - - # We collect the strings to display in `tmpd' (one string per line) - # and `tmps' (in columns) and the matches to add in `tmpmd' and `tmpms'. - - tmpd=() - tmps=() - tmpmd=() - tmpms=() - if [[ -n "$matches[i]" ]]; then - match=( "${(@P)matches[i]}" ) - while (( $#match )); do - if [[ -n "$showd" && "$descr[1]" = *:?* ]]; then - tmpd=( "$tmpd[@]" "$disp[1]" ) - tmpmd=( "$tmpmd[@]" "$match[1]" ) - shift 1 disp - else - tmps=( "$tmps[@]" "${descr[1]%%:*}" ) - tmpms=( "$tmpms[@]" "$match[1]" ) + if [[ -n "$_hide" ]]; then + if [[ "$PREFIX" = --* ]]; then + _tmpd=( "${(@)_tmpd#--}" ) + _tmps=( "${(@)_tmps#--}" ) + elif [[ "$PREFIX" = [-+]* ]]; then + _tmpd=( "${(@)_tmpd#[-+]}" ) + _tmps=( "${(@)_tmps#[-+]}" ) fi - shift 1 match - shift 1 descr - done - else - while (( $#descr )); do - if [[ -n "$showd" && "$descr[1]" = *:?* ]]; then - tmpd=( "$tmpd[@]" "$disp[1]" ) - tmpmd=( "$tmpmd[@]" "${descr[1]%%:*}" ) - shift 1 disp - else - tmps=( "$tmps[@]" "${descr[1]%%:*}" ) - tmpms=( "$tmpms[@]" "${descr[1]%%:*}" ) - fi - shift 1 descr - done - fi - - # See if we should remove the option prefix characters. - - if [[ -n "$isopt" && "$compconfig[option_prefix]" = hide* ]]; then - if [[ "$PREFIX" = --* ]]; then - tmpd=( "${(@)tmpd#--}" ) - tmps=( "${(@)tmps#--}" ) - elif [[ "$PREFIX" = [-+]* ]]; then - tmpd=( "${(@)tmpd#[-+]}" ) - tmps=( "${(@)tmps#[-+]}" ) fi - fi - compadd "${(@P)name}" "$expl[@]" -ld tmpd - "$tmpmd[@]" && ret=0 - compadd "${(@P)name}" "$expl[@]" -d tmps - "$tmpms[@]" && ret=0 -done -return ret + compadd "$_args[@]" "$_expl[@]" -ld _tmpd - "$_tmpmd[@]" && _ret=0 + compadd "$_args[@]" "$_expl[@]" -d _tmps - "$_tmpms[@]" && _ret=0 + done +done +return _ret diff --git a/Completion/Base/_jobs b/Completion/Base/_jobs index 869aeeb8a..45983ad16 100644 --- a/Completion/Base/_jobs +++ b/Completion/Base/_jobs @@ -1,27 +1,85 @@ #autoload -local expl disp jobs job jids +local expl disp jobs job jids pfx='%' desc how expls + +_wanted jobs || return 1 + +if [[ "$1" = -t ]]; then + zstyle -T ":completion:${curcontext}:jobs" prefix-needed && + [[ "$PREFIX" != %* && compstate[nmatches] -ne 0 ]] && return 1 + shift +fi +zstyle -t ":completion:${curcontext}:jobs" prefix-hidden && pfx='' +zstyle -T ":completion:${curcontext}:jobs" verbose && desc=yes if [[ "$1" = -r ]]; then jids=( "${(@k)jobstates[(R)running*]}" ) shift - _description expl 'running job' + expls='running job' elif [[ "$1" = -s ]]; then jids=( "${(@k)jobstates[(R)running*]}" ) shift - _description expl 'suspended job' + expls='suspended job' else [[ "$1" = - ]] && shift jids=( "${(@k)jobtexts}" ) - _description expl job + expls=job fi -disp=() -jobs=() -for job in "$jids[@]"; do - disp=( "$disp[@]" "${(l:3:: ::%:)job} -- ${jobtexts[$job]}" ) - jobs=( "$jobs[@]" "$job" ) -done +if [[ -n "$desc" ]]; then + disp=() + for job in "$jids[@]"; do + [[ -n "$desc" ]] && + disp=( "$disp[@]" "${pfx}${(r:2:: :)job} -- ${(r:COLUMNS-8:: :)jobtexts[$job]}" ) + done +fi + +zstyle -s ":completion:${curcontext}:jobs" numbers how + +if [[ "$how" = (yes|true|on|1) ]]; then + jobs=( "$jids[@]" ) +else + local texts i text str tmp num max=0 -compadd "$@" "$expl[@]" -ld disp - "%$^jobs[@]" + # Find shortest unambiguous strings. + texts=( "$jobtexts[@]" ) + jobs=() + for i in "$jids[@]"; do + text="$jobtexts[$i]" + str="${text%% *}" + if [[ "$text" = *\ * ]]; then + text="${text#* }" + else + text="" + fi + tmp=( "${(@M)texts:#${str}*}" ) + num=1 + while [[ -n "$text" && $#tmp -ge 2 ]]; do + str="${str} ${text%% *}" + if [[ "$text" = *\ * ]]; then + text="${text#* }" + else + text="" + fi + tmp=( "${(@M)texts:#${str}*}" ) + (( num++ )) + done + + [[ num -gt max ]] && max="$num" + + jobs=( "$jobs[@]" "$str" ) + done + + if [[ "$how" = [0-9]## && max -gt how ]]; then + jobs=( "$jids[@]" ) + else + [[ -z "$pfx" && -n "$desc" ]] && disp=( "${(@)disp#%}" ) + fi +fi + +if [[ -n "$desc" ]]; then + _all_labels jobs expl "$expls" compadd "$@" -ld disp - "%$^jobs[@]" +else + _all_labels jobs expl "$expls" compadd "$@" - "%$^jobs[@]" +fi diff --git a/Completion/Base/_subscript b/Completion/Base/_subscript index 2b827a117..60d45370b 100644 --- a/Completion/Base/_subscript +++ b/Completion/Base/_subscript @@ -1,4 +1,56 @@ -#defcomp -subscript- +#compdef -subscript- -_compalso -math- "$@" -[[ ${(Pt)${COMMAND}} = assoc* ]] && complist -k "( ${(kP)${COMMAND}} )" +local expl + +if [[ "$PREFIX" = :* ]]; then + _wanted characters expl 'character class' \ + compadd -p: -S ':]' alnum alpha blank cntrl digit graph \ + lower print punct space upper xdigit +elif [[ ${(Pt)${compstate[parameter]}} = assoc* ]]; then + local suf + + [[ "$RBUFFER" != \]* ]] && suf=']' + + _wanted association-keys expl 'association key' \ + compadd -S "$suf" - "${(@kP)${compstate[parameter]}}" +elif [[ ${(Pt)${compstate[parameter]}} = array* ]]; then + local list i j ret=1 disp + + _tags indexes parameters + + while _tags; do + if _requested indexes; then + ind=( {1..${#${(P)${compstate[parameter]}}}} ) + if zstyle -T ":completion:${curcontext}:indexes" verbose; then + list=() + for i in "$ind[@]"; do + if [[ "$i" = ${PREFIX}*${SUFFIX} ]]; then + list=( "$list[@]" + "${i}:$(print -D ${(P)${compstate[parameter]}[$i]})" ) + else + list=( "$list[@]" '' ) + fi + done + zformat -a list ' -- ' "$list[@]" + disp=( -d list) + else + disp=() + fi + + if [[ "$RBUFFER" = \]* ]]; then + _all_labels -V indexes expl 'array index' \ + compadd -S '' "$disp[@]" - "$ind[@]" && ret=0 + else + _all_labels -V indexes expl 'array index' \ + compadd -S ']' "$disp[@]" - "$ind[@]" && ret=0 + fi + fi + _requested parameters && _parameters && ret=0 + + (( ret )) || return 0 + done + + return 1 +else + _compalso -math- +fi diff --git a/Completion/Base/_tilde b/Completion/Base/_tilde index aef575e19..7ab058e01 100644 --- a/Completion/Base/_tilde +++ b/Completion/Base/_tilde @@ -1,10 +1,53 @@ -#defcomp -tilde- +#compdef -tilde- # We use all named directories and user names here. If this is too slow # for you or if there are too many of them, you may want to use -# `compgen -k friends -qS/' or something like that. To get all user names -# if there are no matches in the `friends' array, add -# `(( compstate[nmatches] )) || compgen -nu -qS/' -# below that. +# `compadd -qS/ - "$friends[@]"' or something like that. -compgen -nu -qS/ +local expl suf dirs list lines revlines i ret disp nm="$compstate[nmatches]" + +if [[ "$SUFFIX" = */* ]]; then + ISUFFIX="/${SUFFIX#*/}$ISUFFIX" + SUFFIX="${SUFFIX%%/*}" + suf=(-S '') +else + suf=(-qS/) +fi + +_tags users named-directories directory-stack + +while _tags; do + _requested users && _users "$suf[@]" "$@" && ret=0 + _requested named-directories expl 'named directory' \ + compadd "$suf[@]" "$@" - "${(@k)nameddirs}" + + if _requested directory-stack && + { ! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed || + [[ "$PREFIX" = [-+]* || nm -eq compstate[nmatches] ]] }; then + if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then + integer i + + lines=("${PWD}" "${dirstack[@]}") + + if [[ ( -prefix - && ! -o pushdminus ) || + ( -prefix + && -o pushdminus ) ]]; then + revlines=( $lines ) + for (( i = 1; i <= $#lines; i++ )); do + lines[$i]="$((i-1)) -- ${revlines[-$i]}" + done + else + for (( i = 1; i <= $#lines; i++ )); do + lines[$i]="$((i-1)) -- ${lines[$i]}" + done + fi + list=( ${PREFIX[1]}${^lines%% *} ) + disp=( -ld lines ) + else + list=( ${PREFIX[1]}{0..${#dirstack}} ) + disp=() + fi + _all_labels -V directory-stack expl 'directory stack' \ + compadd "$suf[@]" "$disp[@]" -Q - "$list[@]" && ret=0 + fi + (( ret )) || return 0 +done diff --git a/Completion/Base/_values b/Completion/Base/_values index 4be3e8203..62cf0e409 100644 --- a/Completion/Base/_values +++ b/Completion/Base/_values @@ -1,322 +1,103 @@ #autoload -setopt localoptions extendedglob +local subopts opt usecc -local name arg def descr xor str tmp ret=1 expl nm="$compstate[nmatches]" -local snames odescr gdescr sep -typeset -A names onames xors _values +subopts=() +while [[ "$1" = -(O*|C) ]]; do + case "$1" in + -C) usecc=yes; shift ;; + -O) subopts=( "${(@P)2}" ); shift 2 ;; + *) subopts=( "${(@P)1[3,-1]}" ); shift ;; + esac +done -# Probably fill our cache. +if compvalues -i "$@"; then -if [[ "$*" != "$_vals_cache_args" ]]; then - _vals_cache_args="$*" + local noargs args opts descr action expl sep subc + local oldcontext="$curcontext" - unset _vals_cache_{sep,descr,names,onames,snames,xors,odescr} + if ! compvalues -D descr action; then - typeset -gA _vals_cache_{names,onames,xors} - _vals_cache_snames=() - _vals_cache_odescr=() + _wanted values || return 1 - # Get the separator, if any. + curcontext="${oldcontext%:*}:values" - if [[ "$1" = -s ]]; then - _vals_cache_sep="$2" - shift 2 - fi - - # This is the description string for the values. - - _vals_cache_descr="$1" - shift - - # Now parse the descriptions. - - while (( $# )); do - - # Get the `name', anything before an unquoted colon. - - if [[ "$1" = *[^\\]:* ]]; then - name="${${${(M)1#*[^\\]:}[1,-2]}//\\\\:/:}" - else - name="$1" - fi - - descr='' - xor='' - - # Get a description, if any. - - if [[ "$name" = *\[*\] ]]; then - descr="${${name#*\[}[1,-2]}" - name="${name%%\[*}" - fi - - # Get the names of other values that are mutually exclusive with - # this one. - - if [[ "$name" = \(*\)* ]]; then - xor="${${name[2,-1]}%%\)*}" - name="${name#*\)}" - fi - - # Finally see if this value may appear more than once. - - if [[ "$name" = \** ]]; then - name="$name[2,-1]" - else - xor="$xor $name" - fi - - # Store the information in the cache. - - _vals_cache_odescr=( "$_vals_cache_odescr[@]" "${name}:$descr" ) - [[ -n "$xor" ]] && _vals_cache_xors[$name]="${${xor##[ ]#}%%[ ]#}" - - # Get the description and store that. - - if [[ "$1" = *[^\\]:* ]]; then - descr=":${1#*[^\\]:}" - else - descr='' - fi - - if [[ "$descr" = ::* ]]; then + compvalues -V noargs args opts - # Optional argument. - - _vals_cache_onames[$name]="$descr[3,-1]" - elif [[ "$descr" = :* ]]; then - - # Mandatory argument. - - _vals_cache_names[$name]="$descr[2,-1]" - else - - # No argument. - - _vals_cache_snames=( "$_vals_cache_snames[@]" "$name" ) - fi - shift - done -fi - -snames=( "$_vals_cache_snames[@]" ) -names=( "${(@kv)_vals_cache_names}" ) -onames=( "${(@kv)_vals_cache_onames}" ) -xors=( "${(@kv)_vals_cache_xors}" ) -odescr=( "$_vals_cache_odescr[@]" ) -gdescr="$_vals_cache_descr" -sep="$_vals_cache_sep" - -if [[ -n "$sep" ]]; then - - # We have a separator character. We parse the PREFIX and SUFFIX to - # see if any of the values that must not appear more than once are - # already on the line. - - while [[ "$PREFIX" = *${sep}* ]]; do - - # Get one part, remove it from PREFIX and put it into IPREFIX. - - tmp="${PREFIX%%${sep}*}" - PREFIX="${PREFIX#*${sep}}" - IPREFIX="${IPREFIX}${tmp}${sep}" - - # Get the value `name'. - - name="${tmp%%\=*}" - - if [[ "$tmp" = *\=* ]]; then - _values[$name]="${tmp#*\=}" - else - _values[$name]='' - fi - - # And remove the descriptions for the values this one makes - # superfluous. - - if [[ -n "$xors[$name]" ]]; then - snames=( "${(@)snames:#(${(j:|:)~${=xors[$name]}})}" ) - odescr=( "${(@)odescr:#(${(j:|:)~${=xors[$name]}}):*}" ) - unset {names,onames,xors}\[${^=tmp}\] - fi - done - if [[ "$SUFFIX" = *${sep}* ]]; then - - # The same for the suffix. + if [[ "$PREFIX" = *\=* ]]; then + local name - str="${SUFFIX%%${sep}*}" - SUFFIX="${SUFFIX#*${sep}}" - while [[ -n "$SUFFIX" ]]; do - tmp="${PREFIX%%${sep}*}" - if [[ "$SUFFIX" = *${sep}* ]]; then - SUFFIX="${SUFFIX#*${sep}}" + name="${PREFIX%%\=*}" + if compvalues -L "$name" descr action; then + IPREFIX="${IPREFIX}${name}=" + PREFIX="${PREFIX#*\=}" else - SUFFIX='' + local prefix suffix + + prefix="${PREFIX#*\=}" + suffix="$SUFFIX" + PREFIX="$name" + SUFFIX='' + args=( "$args[@]" "$opts[@]" ) + compadd -M 'r:|[_-]=* r:|=*' -D args - "${(@)args[@]%%:*}" + + [[ $#args -ne 1 ]] && return 1 + + PREFIX="$prefix" + SUFFIX="$suffix" + IPREFIX="${IPREFIX}${args[1]%%:*}=" + compvalues -L "${args[1]%%:*}" descr action subc + curcontext="${oldcontext%:*}:$subc" fi - PREFIX="${PREFIX#*${sep}}" - IPREFIX="${IPREFIX}${tmp}${sep}" - - name="${tmp%%\=*}" - - if [[ "$tmp" = *\=* ]]; then - _values[$name]="${tmp#*\=}" + else + compvalues -d descr + if [[ ${#noargs}+${#args}+${#opts} -ne 1 ]] && compvalues -s sep; then + sep=( "-qQS" "$sep" ) else - _values[$name]='' + sep=() fi - if [[ -n "$xors[$name]" ]]; then - snames=( "${(@)snames:#(${(j:|:)~${=xors[$name]}})}" ) - odescr=( "${(@)odescr:#(${(j:|:)~${=xors[$name]}}):*}" ) - unset {names,onames,xors}\[${^=tmp}\] - fi - done - SUFFIX="$str" - fi -fi - -descr='' -str="$PREFIX$SUFFIX" - -if [[ "$str" = *\=* ]]; then - - # The string from the line contains a `=', so we get the stuff before - # it and after it and see what we can do here... - - name="${str%%\=*}" - arg="${str#*\=}" - - if (( $snames[(I)${name}] )); then - - # According to our information, the value doesn't get an argument, - # so give up. - - _message "\`${name}' gets no value" - return 1 - elif (( $+names[$name] )); then - - # It has to get an argument, we skip over the name and complete - # the argument (below). - - def="$names[$name]" - if ! compset -P '*\='; then - IPREFIX="${IPREFIX}${name}=" - PREFIX="$arg" - SUFFIX='' - fi - elif (( $+onames[$name] )); then + _describe "$descr" \ + noargs "$sep[@]" -M 'r:|[_-]=* r:|=*' -- \ + args -S= -M 'r:|[_-]=* r:|=*' -- \ + opts -qS= -M 'r:|[_-]=* r:|=*' - # Gets an optional argument, same as previous case. + curcontext="$oldcontext" - def="$onames[$name]" - if ! compset -P '*\='; then - IPREFIX="${IPREFIX}${name}=" - PREFIX="$arg" - SUFFIX='' + return fi else - local pre="$PREFIX" suf="$SUFFIX" - - # The part before the `=' isn't a known value name, so we see if - # it matches only one of the known names. - - if [[ "$PREFIX" = *\=* ]]; then - PREFIX="${PREFIX%%\=*}" - pre="${pre#*\=}" - SUFFIX='' - else - SUFFIX="${SUFFIX%%\=*}" - pre="${suf#*\=}" - suf='' - fi - - tmp=( "${(@k)names}" "${(@k)onames}" ) - compadd -M 'r:|[-_]=* r:|=*' -D tmp - "$tmp[@]" - - if [[ $#tmp -eq 1 ]]; then - - # It does, so we use that name and immediatly start completing - # the argument for it. - - IPREFIX="${IPREFIX}${tmp[1]}=" - PREFIX="$pre" - SUFFIX="$suf" - - def="$names[$tmp[1]]" - [[ -z "$def" ]] && def="$onames[$tmp[1]]" - elif (( $#tmp )); then - _message "ambiguous option \`${PREFIX}${SUFFIX}'" - return 1 - else - _message "unknown option \`${PREFIX}${SUFFIX}'" - return 1 - fi + compvalues -C subc + curcontext="${oldcontext%:*}:$subc" fi -else - - # No `=', just complete value names. - - _description expl "$gdescr" - [[ -n "$sep" && ${#snames}+${#names}+${#onames} -ne 1 ]] && - expl=( "-qS$sep" "$expl[@]" ) - - tmp='' - if [[ -n "$compconfig[describe_values]" && - "$compconfig[describe_values]" != *\!${words[1]}* ]]; then - if _display tmp odescr -M 'r:|[_-]=* r:|=*'; then - if (( $#snames )); then - compadd "$expl[@]" -y tmp -M 'r:|[_-]=* r:|=*' - \ - "$snames[@]" && ret=0 - compadd -n -S= -J "_$gdescr" -M 'r:|[_-]=* r:|=*' - \ - "${(@k)names}" && ret=0 - compadd -n -qS= -J "_$gdescr" -M 'r:|[_-]=* r:|=*' - \ - "${(@k)onames}" && ret=0 - elif (( $#names )); then - compadd -n -S= "$expl[@]" -y tmp -M 'r:|[_-]=* r:|=*' - \ - "${(@k)names}" && ret=0 - compadd -n -qS= -J "_$gdescr" -M 'r:|[_-]=* r:|=*' - \ - "${(@k)onames}" && ret=0 - else - compadd -n -qS= "$expl[@]" -y tmp -M 'r:|[_-]=* r:|=*' - \ - "${(@k)onames}" && ret=0 - fi - fi - fi - if [[ -z "$tmp" ]]; then - compadd "$expl[@]" -M 'r:|[_-]=* r:|=*' - "$snames[@]" && ret=0 - compadd -S= "$expl[@]" -M 'r:|[_-]=* r:|=*' - "${(@k)names}" && ret=0 - compadd -qS= "$expl[@]" -M 'r:|[_-]=* r:|=*' - "${(@k)onames}" && ret=0 + if ! _tags arguments; then + curcontext="$oldcontext" + return 1 fi - return ret -fi - -if [[ -z "$def" ]]; then - _message 'no value' - return 1 -else - local action - - descr="${${${(M)def#*[^\\]:}[1,-2]}//\\\\:/:}" - action="${${def#*[^\\]:}//\\\\:/:}" - _description expl "$descr" + _description arguments expl "$descr" # We add the separator character as a autoremovable suffix unless # we have only one possible value left. - [[ -n "$sep" && ${#snames}+${#names}+${#onames} -ne 1 ]] && + [[ ${#snames}+${#names}+${#onames} -ne 1 ]] && compvalues -s sep && expl=( "-qS$sep" "$expl[@]" ) if [[ "$action" = -\>* ]]; then - values=( "${(@kv)_values}" ) + compvalues -v val_args state="${${action[3,-1]##[ ]#}%%[ ]#}" + if [[ -n "$usecc" ]]; then + curcontext="${oldcontext%:*}:$subc" + else + context="$subc" + fi compstate[restore]='' return 1 else - typeset -A values + typeset -A val_args - values=( "${(@kv)_values}" ) + compvalues -v val_args if [[ "$action" = \ # ]]; then @@ -332,36 +113,44 @@ else eval ws\=\( "${action[3,-3]}" \) - if _display tmp ws; then - compadd "$expl[@]" -y tmp - "${(@)ws%%:*}" - else - _message "$descr" - return 1 - fi + _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" + elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly. - compadd "$expl[@]" - ${=action[2,-2]} + _all_labels arguments expl "$descr" \ + compadd "$subopts[@]" - ${=action[2,-2]} elif [[ "$action" = \{*\} ]]; then # A string in braces is evaluated. - eval "$action[2,-2]" - + while _next_label arguments expl "$descr"; do + eval "$action[2,-2]" + done elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. - ${(e)=~action} + eval "action=( $action )" + while _next_label arguments expl "$descr"; do + "$action[@]" + done else # Otherwise we call it with the description-arguments built above. - action=( $=action ) - ${(e)action[1]} "$expl[@]" ${(e)~action[2,-1]} + eval "action=( $action )" + _all_labels arguments expl "$descr" \ + "$action[1]" "$subopts[@]" "${(@)action[2,-1]}" fi fi -fi -[[ nm -ne "$compstate[nmatches]" ]] + curcontext="$oldcontext" + + [[ nm -ne "$compstate[nmatches]" ]] +else + curcontext="$oldcontext" + + return 1; +fi diff --git a/Completion/Builtins/_autoload b/Completion/Builtins/_autoload index 4f506baeb..238b79e95 100644 --- a/Completion/Builtins/_autoload +++ b/Completion/Builtins/_autoload @@ -1,3 +1,10 @@ -#defcomp autoload +#compdef autoload -complist -s '${^fpath}/*(N:t)' +local expl + +if (( $words[(I)[-+]*w*] )); then + _description files expl 'zwc file' + _files "$expl[@]" -g '*.zwc' +else + _wanted functions expl 'shell function' compadd - ${^fpath}/*(N:t) +fi diff --git a/Completion/Builtins/_cd b/Completion/Builtins/_cd index f3ce67ec7..803bcbda5 100644 --- a/Completion/Builtins/_cd +++ b/Completion/Builtins/_cd @@ -1,3 +1,47 @@ -#defcomp cd +#compdef cd chdir pushd -_files -W cdpath -g '*(-/)' +# Handling of cd. +# - Normally just completes directories. Uses cdpath if that's set +# and the string doesn't begin with ~, /, ./ or ../. +# - In the second argument to cd for the form `cd old new', completes +# possible `new' strings by examining `old' and $PWD. +# - After - or +, completes numbers, but the listing +# gives you the list of directories to complete. This turns on +# menu-completion and lists the possibilities automatically, otherwise +# it's not a lot of use. If you don't type the + or - it will +# complete directories as normal. + +setopt localoptions nonomatch + +local expl + +if [[ CURRENT -eq 3 ]]; then + # cd old new: look for old in $PWD and see what can replace it + local rep + # Get possible completions using word in position 2 + rep=(${~PWD/$words[2]/*}~$PWD(-/N)) + # Now remove all the common parts of $PWD and the completions from this + rep=(${${rep#${PWD%%$words[2]*}}%${PWD#*$words[2]}}) + (( $#rep )) && _wanted -C replacement strings expl replacement compadd $rep +elif _popd || [[ $PREFIX != (\~|/|./|../)* && $#cdpath -ne 0 ]]; then + local tdir tdir2 + + # With cdablevars, we can convert foo/bar/... to ~foo/bar/... if + # there is no directory foo. In that case we could also complete + # variable names, but it hardly seems worth it. + # Note we need a tilde because cdablevars also allows user home + # directories, hence we also need nonomatch to suppress error messages. + if [[ -o cdablevars && -n "$PREFIX" && ! -d ${tdir::=${PREFIX%%/*}} && + -d ${~tdir2::="~$tdir"} ]]; then + PREFIX="~$PREFIX" + _wanted directories expl directory _path_files -/ + else + local tmpcdpath + tmpcdpath=(${${(@)cdpath:#.}:#$PWD}) + _alternative \ + 'local-directories:local directories:_path_files -/' \ + "path-directories:directories in cdpath:_path_files -W tmpcdpath -/" + fi +else + _wanted directories expl directory _path_files -/ +fi diff --git a/Completion/Builtins/_compdef b/Completion/Builtins/_compdef index 1df5758b3..d47a560c9 100644 --- a/Completion/Builtins/_compdef +++ b/Completion/Builtins/_compdef @@ -1,22 +1,40 @@ #compdef compdef -local func base=2 +local state line expl list disp -while [[ $words[base] = -* ]]; do - case $words[base] in - -d) delete=yes ;; - -p) type=pattern ;; - -k) type=key ;; - esac - (( base++ )) -done +_arguments -C -s \ + '(-d)-a[make function autoloadable]' \ + '(-d -p -P)-n[leave existing definitions intact]' \ + '(-a -n -p -P -k -K)-d[delete]:*:completed command:->ccom' \ + '(-n -d -P -k -K)-p[completion for command matching pattern]:completion function:->cfun:pattern' \ + '(-n -d -p -k -K)-P[as -p for commands without own completion]:completion function:->cfun:pattern' \ + '(-d -p -P -K)-k[define widget and key binding]:completion function:->cfun:widget name::style:->style:*:key' \ + '(-d -p -P -k)-K[define multiple widgets based on function]:completion function:->cfun:widget name::style:->style:*:key' \ + '1:completion function:->cfun' \ + '2:commands:_command_names' + -if [ "$delete" ]; then - compadd ${(k)_comps} -else - if [[ CURRENT -eq base ]]; then - for func in ${^~fpath:/.}/_(|*[^~])(N:t); compadd -P_ - ${func#_} - else - compgen -c - fi -fi +case $state in + ccom) + _wanted commands expl 'completed command' compadd - ${(k)_comps} + ;; + cfun) + if _wanted functions; then + list=( ${^fpath:/.}/_(|*[^~])(N:t) ) + if zstyle -T ":completion:${curcontext}:functions" prefix-hidden; then + disp=( ${list[@]#_} ) + _all_labels functions expl 'completion function' \ + compadd -d disp - "$list[@]" + else + _all_labels functions expl 'completion function' compadd - "$list[@]" + fi + fi + ;; + style) + _wanted widgetstyle expl 'widget style' \ + compadd -M 'r:|-=* r:|=*' \ + complete-word delete-char-or-list expand-or-complete \ + expand-or-complete-prefix list-choices menu-complete \ + menu-expand-or-complete reverse-menu-complete + ;; +esac diff --git a/Completion/Builtins/_disable b/Completion/Builtins/_disable index 063b65a7d..b3c2632ed 100644 --- a/Completion/Builtins/_disable +++ b/Completion/Builtins/_disable @@ -1,6 +1,8 @@ -#defcomp disable +#compdef disable -[[ -mcurrent -1 -*a* ]] && complist -ea -[[ -mcurrent -1 -*f* ]] && complist -eF -[[ -mcurrent -1 -*r* ]] && complist -ew -[[ ! -mcurrent -1 -* ]] && complist -eB +_arguments -C -s \ + "(-f -r)-a[act on aliases]:*:aliases:(${(k)aliases} ${(k)galiases})" \ + "(-a -r)-f[act on functions]:*:functions:(${(k)functions})" \ + "(-a -f)-r[act on reserved words]:*:reserved-words:(${(k)reswords})" \ + '-m[treat arguments as patterns]' \ + "*:builtin command:(${(k)builtins})" diff --git a/Completion/Builtins/_emulate b/Completion/Builtins/_emulate new file mode 100644 index 000000000..82096a77e --- /dev/null +++ b/Completion/Builtins/_emulate @@ -0,0 +1,6 @@ +#compdef emulate + +_arguments -C -s \ + '-L[set local_options and local_traps as well]' \ + '-R[reset all options instead of only those needed for script portability]' \ + '1::shell to emulate:(zsh sh ksh csh)' diff --git a/Completion/Builtins/_enable b/Completion/Builtins/_enable index 22ff53ee7..991286276 100644 --- a/Completion/Builtins/_enable +++ b/Completion/Builtins/_enable @@ -1,6 +1,8 @@ -#defcomp enable +#compdef enable -[[ -mcurrent -1 -*a* ]] && complist -da -[[ -mcurrent -1 -*f* ]] && complist -dF -[[ -mcurrent -1 -*r* ]] && complist -dw -[[ ! -mcurrent -1 -* ]] && complist -dB +_arguments -C -s \ + "(-f -r)-a[act on aliases]:*:aliases:(${(k)dis_aliases})" \ + "(-a -r)-f[act on functions]:*:functions:(${(k)dis_functions})" \ + "(-a -f)-r[act on reserved words]:*:reserved-words:(${(k)dis_reswords})" \ + '-m[treat arguments as patterns]' \ + "*:builtin command:(${(@k)dis_builtins})" diff --git a/Completion/Builtins/_fc b/Completion/Builtins/_fc index f0d2c03fd..e97492604 100644 --- a/Completion/Builtins/_fc +++ b/Completion/Builtins/_fc @@ -1,7 +1,27 @@ -#defcomp fc +#compdef fc history -if [[ -mcurrent -1 -*e ]]; then - complist -c -elif [[ -mcurrent -1 -[ARWI]## ]]; then - _files +local fc_common + +fc_common=( \ + '(-A -R -W -I)-m[treat first argument as a pattern]' \ + '(-A -R -W -I)-r[reverse order of the commands]' \ + '(-A -R -W -I -e)-n[suppress line numbers]' \ + '(-A -R -W -I -e -f -E -i)-d[print time-stamps]' \ + '(-A -R -W -I -e -d -E -i)-f[mm/dd/yyyy format time-stamps]' \ + '(-A -R -W -I -e -d -f -i)-E[dd.mm.yyyy format time-stamps]' \ + '(-A -R -W -I -e -d -f -E)-i[yyyy-mm-dd format time-stamps]' \ + '(-A -R -W -I -e)-D[print elapsed times]' \ + '(-A -R -W -I)*::commands:_command_names -e' ) + +if [[ $words[1] = *history ]]; then + _arguments -C -s "$fc_common[@]" +else + _arguments -C -s \ + '(-A -R -W -I -e)-l[list resulting commands on stdout]' \ + '(-A -R -W -I -l -n -d -f -E -i -D)-e[specify editor to invoke]:editor to invoke:_command_names -e' \ + '(-l -m -e -r -n -d -f -E -i -D -A -W *)-R[read history from file]:history file:_files' \ + '(-l -m -e -r -n -d -f -E -i -D -R -W *)-A[append history to file]:history file:_files' \ + '(-l -m -e -r -n -d -f -E -i -D -R -A *)-W[write history to file]:history file:_files' \ + '(-l -m -e -r -n -d -f -E -i -D -A -W *)-I[read/write new events only]:history file:_files' \ + "$fc_common[@]" fi diff --git a/Completion/Builtins/_nothing b/Completion/Builtins/_nothing index 35a2558cc..38f6bee77 100644 --- a/Completion/Builtins/_nothing +++ b/Completion/Builtins/_nothing @@ -1,3 +1,3 @@ -#compdef true false +#compdef true false log times whoami _message 'no argument or option' diff --git a/Completion/Builtins/_pids b/Completion/Builtins/_pids index 0ffda900b..7dec90e7d 100644 --- a/Completion/Builtins/_pids +++ b/Completion/Builtins/_pids @@ -3,16 +3,32 @@ # If given the `-m <pattern>' option, this tries to complete only pids # of processes whose command line match the `<pattern>'. -local list expl match +local out list expl match desc listargs args + +_wanted processes || return 1 if [[ "$1" = -m ]]; then match="${2}*" shift 2 fi -_description expl 'process ID' +zstyle -s ":completion:${curcontext}:pids" command args + +out="$(_call pids ps 2>/dev/null)" -list=("${(@Mr:COLUMNS-1:)${(f@)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}") +if zstyle -T ":completion:${curcontext}:processes" verbose; then + zstyle -s ":completion:${curcontext}:pids-list" command listargs + (( $#listargs )) || listargs=( "$args[@]" ) + if [[ "$listargs" = "$args" ]]; then + list=("${(@Mr:COLUMNS-1:)${(f@)out}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}") + else + list=("${(@Mr:COLUMNS-1:)${(f@)$(_call pids-list ps 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${~match}}") + fi + desc=(-ld list) +else + desc=() +fi -compadd "$expl[@]" "$@" -ld list - \ - ${${${(M)${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]:#*${~match}}## #}%% *} +_all_labels processes expl 'process ID' \ + compadd "$@" "$desc[@]" - \ + ${${${(M)${(f)"${out}"}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]#*${~match}}## #}%% *} diff --git a/Completion/Builtins/_popd b/Completion/Builtins/_popd index 9054befb7..2a3413253 100644 --- a/Completion/Builtins/_popd +++ b/Completion/Builtins/_popd @@ -5,36 +5,39 @@ # way round if pushdminus is set). Note that this function is also called # from _cd for cd and pushd. -emulate -L zsh setopt extendedglob nonomatch -[[ $PREFIX = [-+]* ]] || return 1 +local expl list lines revlines disp -local expl list lines revlines ret=1 i +! zstyle -T ":completion:${curcontext}:directory-stack" prefix-needed || + [[ $PREFIX = [-+]* ]] || return 1 -IPREFIX=$PREFIX[1] -PREFIX=$PREFIX[2,-1] +_wanted directory-stack || return 1 -# get the list of directories with their canonical number -# and turn the lines into an array, removing the current directory -lines=( ${${(f)"$(dirs -v)"}##0*} ) -if [[ ( $IPREFIX = - && ! -o pushdminus ) || - ( $IPREFIX = + && -o pushdminus ) ]]; then - integer i - revlines=( $lines ) - for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[ ]#}" - done +if zstyle -T ":completion:${curcontext}:directory-stack" verbose; then + # get the list of directories with their canonical number + # and turn the lines into an array, removing the current directory + lines=("${dirstack[@]}") + + if [[ ( $PREFIX[1] = - && ! -o pushdminus ) || + ( $PREFIX[1] = + && -o pushdminus ) ]]; then + integer i + revlines=( $lines ) + for (( i = 1; i <= $#lines; i++ )); do + lines[$i]="$((i-1)) -- ${revlines[-$i]##[0-9]#[ ]#}" + done + else + for (( i = 1; i <= $#lines; i++ )); do + lines[$i]="$i -- ${lines[$i]##[0-9]#[ ]#}" + done + fi + # get the array of numbers only + list=( ${PREFIX[1]}${^lines%% *} ) + disp=( -ld lines ) else - for (( i = 1; i <= $#lines; i++ )); do - lines[$i]="$i -- ${lines[$i]##[0-9]#[ ]#}" - done + list=( ${PREFIX[1]}{0..${#dirstack}} ) + disp=() fi -# get the array of numbers only -list=(${lines%% *}) -_description expl 'directory stack index' -compadd "$expl[@]" -ld lines -V dirs -Q - "$list[@]" && ret=0 -[[ -z $compstate[list] ]] && compstate[list]=list && ret=0 -[[ -n $compstate[insert] ]] && compstate[insert]=menu && ret=0 - -return ret + +_all_labels -V directory-stack expl 'directory stack' \ + compadd "$@" "$disp[@]" -Q - "$list[@]" diff --git a/Completion/Builtins/_sched b/Completion/Builtins/_sched index 1e8ae3445..98ecb3642 100644 --- a/Completion/Builtins/_sched +++ b/Completion/Builtins/_sched @@ -1,3 +1,23 @@ -#defcomp sched +#compdef sched -[[ -position 2 -1 ]] && _normal "$@" +local expl lines disp + +if [[ CURRENT -eq 2 ]]; then + if compset -P -; then + _wanted -C - jobs || return 1 + + lines=(${(f)"$(sched)"}) + if zstyle -T ":completion:${curcontext}:jobs" verbose; then + disp=( -ld lines ) + else + disp=() + fi + [[ -z $lines ]] || _all_labels jobs expl 'scheduled jobs' \ + compadd "$disp[@]" - {1..$#lines} + return + else + _message 'time specification' + return 1 + fi +fi +compset -n 3 && _normal diff --git a/Completion/Builtins/_signals b/Completion/Builtins/_signals index c79350044..aa95a8499 100644 --- a/Completion/Builtins/_signals +++ b/Completion/Builtins/_signals @@ -20,17 +20,19 @@ done [[ "$1" = -(|-) ]] && shift -if _wanted signals expl signal && - { [[ -z "$minus" ]] || ! _style signals prefix-needed || +if _wanted signals && + { [[ -z "$minus" ]] || + ! zstyle -T ":completion:${curcontext}:signals" prefix-needed || [[ "$PREFIX" = -* ]] } ; then local disp tmp - if _style signals prefix-hidden; then + if zstyle -t ":completion:${curcontext}:signals" prefix-hidden; then tmp=( "${(@)signals[1,last]}" ) disp=(-d tmp) else disp=() fi - compadd "$@" "$expl[@]" "$disp[@]" -M 'm:{a-z}=${A-Z}' - \ - "${minus}${(@)^signals[1,last]}" + _all_labels signals expl signal \ + compadd "$@" "$disp[@]" -M 'm:{a-z}={A-Z}' - \ + "${minus}${(@)^signals[1,last]}" fi diff --git a/Completion/Builtins/_stat b/Completion/Builtins/_stat index 3cdbb2618..5ba06388b 100644 --- a/Completion/Builtins/_stat +++ b/Completion/Builtins/_stat @@ -1,10 +1,20 @@ #compdef stat +local expl ret=1 + if [[ "$words[CURRENT-1]" = -[AH] ]]; then - compgen -A + _arrays else - [[ "$PREFIX[1]" = + ]] && - compadd - +device +inode +mode +nlink +uid +gid +rdev +size \ - +atime +mtime +ctime +blksize +block +link - _files + _tags files options || return 1 + + while _tags; do + _requested files && _files && ret=0 + _requested options && + { ! zstyle -T ":completion:${curcontext}:options" prefix-needed || + [[ "$PREFIX[1]" = + || ret -eq 1 ]] } && + _all_labels options expl 'inode element' \ + compadd - +device +inode +mode +nlink +uid +gid +rdev \ + +size +atime +mtime +ctime +blksize +block +link + (( ret )) || return 0 + done fi diff --git a/Completion/Builtins/_zcompile b/Completion/Builtins/_zcompile new file mode 100644 index 000000000..5ec6f96ce --- /dev/null +++ b/Completion/Builtins/_zcompile @@ -0,0 +1,22 @@ +#compdef zcompile + +local context state line expl +typeset -A opt_args + +_arguments -s \ + '(-c -m -a)-U[don'\''t expand aliases]' \ + '(-M)-R[mark as read]' \ + '(-R)-M[mark as mapped]' \ + '(-c -z -m -a)-k[ksh-style autoloading]' \ + '(-c -k -m -a)-z[zsh-style autoloading]' \ + '(-U -z -k)-c[currently defined functions]' \ + '(-U -z -k)-m[use names as patterns]' \ + '(-U -z -k)-a[write autoload functions]' \ + ':zwc file:_files' \ + '*:function:->function' && return 0 + +if (( $+opt_args[-c] )); then + _wanted functions expl 'function to write' compadd - ${(k)functions} +else + _wanted file expl 'zsh source file' _files +fi diff --git a/Completion/Builtins/_zftp b/Completion/Builtins/_zftp index 9be9c94db..0d6530dfc 100644 --- a/Completion/Builtins/_zftp +++ b/Completion/Builtins/_zftp @@ -1,50 +1,92 @@ -#defpatcomp zf* - -# Don't try any more completion after this. -_compskip=1 +#compdef -p zf* # Completion for zftp builtin and zf* functions. The functions -# zfcd_match and zfget_match (used for old-style completion) +# zfcd_match and zfget_match (also used for old-style completion) # need to be installed for remote file and directory completion to work. -local subcom +# emulate -L zsh + +# Don't try any more completion after this. +_compskip=all + +local subcom expl curcontext="${curcontext}" -if [[ $COMMAND = zftp ]]; then - if [[ $CURRENT -eq 1 ]]; then - compadd -m open params user login type ascii binary mode put \ - putat get getat append appendat ls dir local remote mkdir rmdir +if [[ $words[1] = zftp ]]; then + if [[ $CURRENT -eq 2 ]]; then + _wanted commands expl sub-command \ + compadd open params user login type ascii binary mode put \ + putat get getat append appendat ls dir local remote mkdir rmdir \ + session rmsession return fi - subcom=$1 + subcom=$words[2] + curcontext="${curcontext/:zftp:/:zftp-${words[2]}:}" else - subcom=$COMMAND + subcom=$words[1] fi case $subcom in *(cd|ls|dir)) - # complete remote directories; we could be smarter about hiding prefixes - zfcd_match $PREFIX $SUFFIX - (( $#reply )) && compadd -m -S/ -q $reply - ;; + # complete remote directories + _wanted directories && zfcd_match $PREFIX $SUFFIX + ;; *(get(|at)|gcp|delete|remote)) - # complete remote files - zfget_match $PREFIX $SUFFIX - (( $#reply )) && compadd -F fignore -m $reply - ;; + # complete remote files + _wanted files && zfget_match $PREFIX $SUFFIX + ;; *(put(|at)|pcp)) - # complete local files - _files - ;; + # complete local files + _wanted files && _files + ;; *(open|anon|params)) - # complete hosts: should do cleverer stuff with user names - complist -k hosts - ;; + # complete hosts: should do cleverer stuff with user names + _wanted hosts && _hosts + ;; + + *(goto|mark)) + # complete bookmarks. First decide if ncftp mode is go. + _wanted bookmarks || return 1 + if [[ $words[2] = -*n* ]]; then + if [[ -f ~/.ncftp/bookmarks ]]; then + _all_labels bookmarks expl bookmark \ + compadd - $(awk -F, 'NR > 2 { print $1 }' ~/.ncftp/bookmarks) + fi + else + if [[ -f ${ZFTP_BMFILE:=${ZDOTDIR:-$HOME}/.zfbkmarks} ]]; then + _all_labels bookmarks expl bookmark \ + compadd - $(awk '{print $1}' $ZFTP_BMFILE) + fi + fi + ;; + + *session) + # complete sessions, excluding the current one. + _wanted sessions expl 'another FTP session' \ + compadd - ${$(zftp session):#$ZFTP_SESSION} + ;; + + *transfer) + # complete arguments like sess1:file1 sess2:file2 + if [[ $PREFIX = *:* ]]; then + # complete file in the given session + _wanted files || return 1 + local sess=${PREFIX%%:*} oldsess=$ZFTP_SESSION + compset -p $(( $#sess + 1 )) + [[ -n $sess ]] && zftp session $sess + zfget_match $PREFIX $SUFFIX + [[ -n $sess && -n $oldsess ]] && zftp session $oldsess + else + # note here we can complete the current session + _wanted sessions expl 'FTP session' compadd -S : - $(zftp session) + fi + ;; *) - # dunno... try ordinary completion after all. - unset _compskip - ;; + # dunno... try ordinary completion after all. + _compskip='' + return 1 + ;; esac diff --git a/Completion/Builtins/_zpty b/Completion/Builtins/_zpty index b197b4128..d8c77ff2e 100644 --- a/Completion/Builtins/_zpty +++ b/Completion/Builtins/_zpty @@ -7,17 +7,17 @@ _arguments -C -s \ '(-d -w -r -L)-b[io to pseudo-terminal blocking]' \ '(-e -b -w -r -L)-d[delete command]:*:name:->name' \ '(-e -b -d -r -L)-w[send string to command]:name:->name:*:strings to write' \ - '(-e -b -d -w -L)-r[read string from command]:name:->name:param:_parameters:*:nothing:_nothing' \ + '(-e -b -d -w -L *)-r[read string from command]:name:->name:param:_parameters' \ '(-e -b -d -w -r)-L[list defined commands as calls]' \ - '*::args:_normal' + '(-r)*::args:_normal' -if [[ $state = name ]] && _wanted zptynames expl 'zpty command names'; then +if [[ $state = name ]] && _wanted names; then list=( ${${(f)"$(zpty)"}#*\) } ) names=( ${list%%:*} ) if zstyle -T ":completion:${curcontext}" verbose; then zformat -a list ' --' ${${(f)"$(zpty)"}#*\) } - compadd "$expl[@]" -d list - "$names[@]" + _all_labels names expl 'zpty command names' compadd -d list - "$names[@]" else - compadd "$expl[@]" - "$names[@]" + _all_labels names expl 'zpty command names' compadd - "$names[@]" fi fi diff --git a/Completion/Builtins/_zstyle b/Completion/Builtins/_zstyle index f072f79ae..cd470598a 100644 --- a/Completion/Builtins/_zstyle +++ b/Completion/Builtins/_zstyle @@ -1,7 +1,8 @@ #compdef zstyle -local curcontext="$curcontext" state ostate line expl ctop -local nm=$compstat[nmatches] +local curcontext="$curcontext" state context ostate line expl ctop +local nm=$compstate[nmatches] mesg +typeset -A opt_args typeset -A styles # Assoc array of styles; the values give the possible top-level @@ -9,15 +10,18 @@ typeset -A styles # followed by a colon, followed by a state to enter, empty if none. styles=( accept-exact c:bool + add-space c:bool arguments c: auto-description c: - cache-path 'c:_path_files -/' + break c: completer c:completer completions c: condition c: - cursor c:bool + cursor c:cursor disable-stat c:bool + domains c: expand c: + file-patterns c:filepat format c: glob c: group-name c: @@ -26,8 +30,9 @@ styles=( hidden c:bool hosts c:_hosts hosts-ports c:host-port - hosts-ports-users c:host-port-user - ignored-suffixes c: + users-hosts-ports c:user-host-port + ignore-parents c:ignorepar + ignored-patterns c: insert-unambiguous c:bool last-prompt c:bool list c:listwhen @@ -36,21 +41,26 @@ styles=( list-packed c:bool list-rows-first c:bool local c: + matcher-list c: max-errors c: menu c:boolauto numbers c:bool original c:bool - path 'c:_path_files -/' + packageset c:packageset + path 'c:_wanted directories expl directory _path_files -/' ports c:_ports prefix-hidden c:bool prefix-needed c:bool prompt c: remove-all-dups c:bool + single-ignored c:single-ignored sort c:bool - tag-order c:tag special-dirs c:sdirs + squeeze-slashes c:bool stop c:stop + subst-glob-only c: substitute c: + tag-order c:tag users c:_users users-hosts c:user-host verbose c:bool @@ -83,9 +93,20 @@ while [[ -n $state ]]; do case "$ostate" in contexts) - if [[ $PREFIX != :*: ]]; then - _wanted contexts expl context && - compadd -P : -S : "$expl[@]" completion zftp + if _wanted contexts; then + if [[ $PREFIX != :*: ]]; then + _all_labels contexts expl context compadd -P : -S : completion zftp + elif [[ $PREFIX = :completion:* ]]; then + mesg='' + case "$PREFIX" in + :completion:[^:]#) mesg=function ;; + :completion:[^:]#:[^:]#) mesg=completer ;; + :completion:[^:]#:[^:]#:[^:]#) mesg='command or context' ;; + :completion:[^:]#:[^:]#:[^:]#:[^:]#) mesg=argument ;; + :completion:[^:]#:[^:]#:[^:]#:[^:]#:[^:]#) mesg=tag ;; + esac + [[ -n "$mesg" ]] && _message "$mesg" + fi fi ;; @@ -96,8 +117,8 @@ while [[ -n $state ]]; do else ctop=cz fi - _wanted styles expl style && - compadd "$expl[@]" - ${(k)styles[(R)[^:]#[$ctop][^:]#:*]} + _wanted styles expl style \ + compadd -M 'r:|-=* r:|=*' - ${(k)styles[(R)[^:]#[$ctop][^:]#:*]} ;; style-arg) @@ -105,66 +126,116 @@ while [[ -n $state ]]; do ;; bool) - _wanted values expl boolean && - compadd "$expl[@]" true false + _wanted values expl boolean compadd true false ;; boolauto) - _wanted values expl boolean && - compadd "$expl[@]" true false auto select + _wanted values expl boolean compadd true false auto select + ;; + + cursor) + if [[ "$words[2]" = *:completion:inc* ]]; then + _wanted values expl 'cursor positioning' compadd complete key default + elif [[ "$words[2]" = *:completion::* ]]; then + _wanted values expl 'cursor positioning' compadd true false + else + _wanted values expl 'cursor positioning' \ + compadd complete key default true false + fi ;; completer) - _wanted values expl completer && - compadd "$expl[@]" _complete _approximate _correct _match \ - _expand _list _menu _oldlist + _wanted values expl completer \ + compadd _complete _approximate _correct _match \ + _expand _list _menu _oldlist _next_tags ;; - host-port*) + user-host-port) + if [[ $PREFIX != *[@:]* ]]; then + _users -S @ + elif [[ $PREFIX = *[@:]*[[@:]* ]]; then + compset -P 2 '*[:@]' + _ports + else + compset -P 1 '*[:@]' + _hosts -S : + fi + ;; + + host-port) if [[ $PREFIX != *:* ]]; then _hosts -S : - elif [[ $ostate != *user || $PREFIX != *:*:* ]]; then + else compset -P 1 '*:' _ports - else - compset -P 2 '*:' - _users fi ;; listwhen) - _wanted values expl 'when to list completions' && - compadd "$expl[@]" always never sometimes + _wanted values expl 'when to list completions' \ + compadd always never sometimes + ;; + + packageset) + _wanted values expl 'default package set' \ + compadd available installed uninstalled ;; progress) - _wanted values expl 'progress meter style' && - compadd "$expl[@]" none bar percent + _wanted values expl 'progress meter style' \ + compadd none bar percent ;; sdirs) - _wanted values expl 'whether to complete . or ..' && - compadd "$expl[@]" true false .. + _wanted values expl 'whether to complete . or ..' \ + compadd true false .. ;; stop) - _wanted values expl 'when to insert matches' && - compadd "$expl[@]" true false verbose + _wanted values expl 'when to insert matches' \ + compadd true false verbose ;; tag) - _wanted tags expl tag && compadd "$expl[@]" - $taglist + compset -q + if compset -P '*:*:'; then + _message description + elif compset -P '*:'; then + _message 'tag alias' + else + _wanted tags expl tag compadd - $taglist + fi + ;; + + filepat) + if compset -P '*:*:'; then + _message description + elif compset -P '*:'; then + _message tag + else + _message 'glob patterns' + fi ;; user-host) - if [[ $PREFIX = *:* ]]; then - compset -P '*:' + if [[ $PREFIX = *[@:]* ]]; then + compset -P '*[@:]' _hosts else - _users + _users -S @ fi ;; + ignorepar) + _wanted values expl 'which parents to ignore' \ + compadd parent pwd .. directory + ;; + + single-ignored) + _wanted values expl 'how to handle a single ignored match' \ + compadd - show menu + ;; + _*) ${=ostate} ;; diff --git a/Completion/Commands/_complete_help b/Completion/Commands/_complete_help index cfefdcf90..cfc922df5 100644 --- a/Completion/Commands/_complete_help +++ b/Completion/Commands/_complete_help @@ -1,35 +1,80 @@ #compdef -k complete-word \C-xh _complete_help() { - local _sort_tags=_help_sort_tags text i - typeset -A help_tags - typeset -U help_contexts - - help_contexts=() + local _sort_tags=_help_sort_tags text i j k + typeset -A help_funcs help_tags help_sfuncs help_styles compadd() { return 1 } + zstyle() { + local _f="${${(@)${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(wanted|requested|loop|try)}% *}" + + [[ -z "$_f" ]] && _f="${${(@)funcstack[2,(i)_(main_complete|complete|approximate|normal)]}:#_(wanted|requested|loop|try)}" + + if [[ "$help_sfuncs[$2]" != *${_f}* || + "$help_styles[${2}${_f}]" != *${3}* ]]; then + [[ "$help_sfuncs[$2]" != *${_f}* ]] && + help_sfuncs[$2]="${help_sfuncs[$2]}:${_f}" + local _t + + case "$1" in + -s) _t='[string] ';; + -a) _t='[array] ';; + -h) _t='[assoc] ';; + *) _t='[boolean]';; + esac + help_styles[${2}${_f}]="${help_styles[${2}${_f}]},${_t} ${3}:${_f}" + fi + builtin zstyle "$@" + } _main_complete - unfunction compadd + unfunction compadd zstyle - for i in "$help_contexts[@]"; do + for i in "${(@ok)help_funcs}"; do text="${text} -tags in context \`${i}': ${help_tags[$i]}" +tags in context :completion:${i}:" + tmp=() + for j in "${(@s.:.)help_funcs[$i][2,-1]}"; do + tmp=( "$tmp[@]" "${(@s.,.)help_tags[${i}${j}][2,-1]}" ) + done + zformat -a tmp ' (' "$tmp[@]" + tmp=( ' + '${^tmp}')' ) + text="${text}${tmp}" done - compstate[list]=list - compstate[force_list]=yes + text="$text +" + for i in "${(@ok)help_sfuncs}"; do + text="${text} +styles in context ${i}" + tmp=() + for j in "${(@s.:.)help_sfuncs[$i][2,-1]}"; do + tmp=( "$tmp[@]" "${(@s.,.)help_styles[${i}${j}][2,-1]}" ) + done + zformat -a tmp ' (' "$tmp[@]" + tmp=( ' + '${^tmp}')' ) + text="${text}${tmp}" + done + + compstate[list]='list force' compstate[insert]='' compadd -UX "$text[2,-1]" -n '' } _help_sort_tags() { - help_contexts=( "$help_contexts[@]" "$curcontext" ) - help_tags[$curcontext]="${help_tags[$curcontext]} - ${argv}" - comptry "$@" + local f="${${(@)${(@)funcstack[3,(i)_(main_complete|complete|approximate|normal)]}:#_(wanted|requested|loop|try)}% *}" + + if [[ "$help_funcs[$curcontext]" != *${f}* || + "$help_tags[${curcontext}${f}]" != *(${(j:|:)~argv})* ]]; then + [[ "$help_funcs[$curcontext]" != *${f}* ]] && + help_funcs[$curcontext]="${help_funcs[$curcontext]}:${f}" + help_tags[${curcontext}${f}]="${help_tags[${curcontext}${f}]},${argv}:${f}" + comptry "$@" + fi } _complete_help "$@" diff --git a/Completion/Commands/_history_complete_word b/Completion/Commands/_history_complete_word index fc67c0f14..d904e01f1 100644 --- a/Completion/Commands/_history_complete_word +++ b/Completion/Commands/_history_complete_word @@ -1,2 +1,105 @@ -#compdef -k complete-word \e/ -compgen -Q -H 0 '' +#compdef -K _history-complete-older complete-word \e/ _history-complete-newer complete-word \e, +# +# Complete words from the history +# +# by Adam Spiers, with help gratefully received from +# Sven Wischnowsky and Bart Schaefer +# +# Available styles: +# +# :history-words:list -- display lists of available matches +# :history-words:stop -- prevent looping at beginning and end of matches +# during menu-completion +# :history-words:sort -- sort matches lexically (default is to sort by age) +# :history-words:remove-all-dups -- +# remove /all/ duplicate matches rather than just +# consecutives +# + +_history_complete_word () { + local expl direction stop + + if [[ $WIDGET = *newer ]]; then + direction=newer + else + direction=older + fi + + zstyle -s ":completion:${curcontext}:history-words" stop stop + + zstyle -t ":completion:${curcontext}:history-words" list || compstate[list]='' + + if [[ -n "$compstate[old_list]" && + ( -n "$stop" || "$compstate[insert]" = menu ) ]] ; then + # array of matches is newest -> oldest (reverse of history order) + if [[ "$direction" == 'older' ]]; then + if [[ compstate[old_insert] -eq $_hist_menu_length || + "$_hist_stop" == 'oldest' ]]; then + _hist_stop='oldest' + [[ "$stop" = verbose ]] && + _message 'beginning of history reached' + elif [[ "$_hist_stop" == 'newest' ]]; then + zle -Rc + _history_complete_word_gen_matches + else + compstate[old_list]=keep + (( compstate[insert] = compstate[old_insert] + 1 )) + fi + elif [[ "$direction" == 'newer' ]]; then + if [[ compstate[old_insert] -eq 1 || "$_hist_stop" == 'newest' ]]; then + _hist_stop='newest' + [[ "$stop" = verbose ]] && _message 'end of history reached' + elif [[ "$_hist_stop" == 'oldest' ]]; then + zle -Rc + _history_complete_word_gen_matches + else + compstate[old_list]=keep + (( compstate[insert] = compstate[old_insert] - 1 )) + fi + fi + else + _hist_stop='' + _hist_old_prefix="$PREFIX" + _history_complete_word_gen_matches + fi + + [[ -n "$compstate[nmatches]" ]] +} + +_history_complete_word_gen_matches () { + local opt + + [[ -n "$_hist_stop" ]] && PREFIX="$_hist_old_prefix" + + if zstyle -t ":completion:${curcontext}:history-words" remove-all-dups; then + opt=- + else + opt=-1 + fi + if zstyle -t ":completion:${curcontext}:history-words" sort; then + opt="${opt}J" + else + opt="${opt}V" + fi + + _wanted "$opt" history-words expl 'history word' \ + compadd -Q - "$historywords[@]" + + zstyle -t ":completion:${curcontext}:history-words" list || + compstate[list]= + + _hist_menu_length="$compstate[nmatches]" + + case "$direction" in + newer) compstate[insert]=$_hist_menu_length + [[ -n "$_hist_stop" ]] && (( compstate[insert]-- )) + ;; + older) compstate[insert]=1 + [[ -n "$_hist_stop" ]] && (( compstate[insert]++ )) + ;; + esac + + [[ -n "$_hist_stop" ]] && _hist_stop='' +} + +_history_complete_word "$@" diff --git a/Completion/Commands/_next_tags b/Completion/Commands/_next_tags index 8bd3f5921..4861d1adf 100644 --- a/Completion/Commands/_next_tags +++ b/Completion/Commands/_next_tags @@ -1,70 +1,92 @@ #compdef -k complete-word \C-xn -# Main widget/completer. +# Main widget. _next_tags() { + local comp - if [[ $#funcstack -gt 1 ]]; then + if [[ -z $compstate[old_list] ]]; then + comp=() + else + comp=(_complete) + fi - # Called as completer, probably `remove' our helper function. A better - # test would be nice, but I think one should still be able to edit the - # current word between attempts to complete it. + (( $+_sort_tags )) || _next_tags_not= - [[ $_next_tags_pre != ${LBUFFER%${PREFIX}} ]] && unset _sort_tags + _sort_tags=_next_tags_sort + _next_tags_pre="${LBUFFER%${PREFIX}}" + _next_tags_not="$_next_tags_not $_lastcomp[tags]" - return 1 - else - local comp + _main_complete "$comp[@]" - if [[ -z $compstate[old_list] ]]; then - comp=() - else - comp=(_next_tags _complete) - fi + [[ $compstate[insert] = automenu ]] && + compstate[insert]=automenu-unambiguous + + compstate[insert]='' + compstate[list]='list force' - (( $+_sort_tags )) || _next_tags_not= + compprefuncs=( "$compprefuncs[@]" _next_tags_pre ) +} - _sort_tags=_next_tags_sort - _next_tags_pre="${LBUFFER%${PREFIX}}" - _next_tags_not="$_next_tags_not $_lastcomp[tags]" +# Pre-completion function. - _main_complete "$comp[@]" +_next_tags_pre() { - [[ $compstate[insert] = automenu ]] && - compstate[insert]=automenu-unambiguous + # Probably `remove' our sort function. A better test would be nice, but + # I think one should still be able to edit the current word between + # attempts to complete it. - compstate[insert]='' - compstate[list]='list force' + if [[ $_next_tags_pre != ${LBUFFER%${PREFIX}} ]]; then + unset _sort_tags + else + compprefuncs=( "$compprefuncs[@]" _next_tags_pre ) fi } # Helper function for sorting tags. Most of this is copied from _tags. _next_tags_sort() { - local order tags tag nodef + local order tags tag nodef tmp zstyle -a ":completion:${curcontext}:" tag-order order || - order=( 'arguments values' options globbed-files directories all-files ) + order=('arguments values' options) # But we also remove the tags we've already tried... - tags=( "${(@)order:#(${(j:|:)~${=_next_tags_not}})}" ) + tags=( "${(@)order:#(${(j:|:)~${=_next_tags_not}})(|:*)}" ) # ... unless that would remove all offered tags. - [[ $#tags -ne $#order && "$tags" != *(${(j:|:)~argv})* ]] && - tags=( $order ) _next_tags_not= - + if [[ $funcstack[4] = _files ]]; then + if zstyle -a ":completion:${curcontext}:" file-patterns tmp; then + [[ "$tags" = *${${tmp[-1]##[^\\]:}%:*}* ]] && + tags=( $order ) _next_tags_not= + else + [[ "$tags" = *all-files* ]] && tags=( $order ) _next_tags_not= + fi + else + [[ $#tags -ne $#order && "$tags" != *(${(j:|:)~argv})* ]] && + tags=( $order ) _next_tags_not= + fi for tag in $tags; do case $tag in -) nodef=yes;; *\(\)) "${${tag%%[ ]#\(\)}##[ ]#}" "$@";; - \!*) comptry "${(@)argv:#(${(j:|:)~${=tag[2,-1]}})}";; - ?*) comptry ${=tag};; + \!*) comptry "${(@)argv:#(${(j:|:)~${=~tag[2,-1]}})}";; + ?*) comptry -m "$tag";; esac done - [[ -z "$nodef" ]] && comptry "$@" + if [[ -z "$nodef" ]]; then + if [[ $funcstack[4] = _files ]]; then + if zstyle -a ":completion:${curcontext}:" file-patterns tmp; then + [[ "$argv" = *${${tmp[-1]##[^\\]:}%:*}* ]] && _next_tags_not= + else + [[ "$argv" = *all-files* ]] && _next_tags_not= + fi + fi + comptry "${(@)argv:#(${(j:|:)~${=_next_tags_not}})(|:*)}" + fi } [[ -o kshautoload ]] || _next_tags "$@" diff --git a/Completion/Core/_all_labels b/Completion/Core/_all_labels new file mode 100644 index 000000000..fa7118ec4 --- /dev/null +++ b/Completion/Core/_all_labels @@ -0,0 +1,44 @@ +#autoload + +local gopt=-J len tmp pre suf tloop ret=1 descr + +if [[ "$1" = -t ]]; then + tloop=yes + shift +fi +if [[ "$1" = -([12]|)[VJ] ]]; then + gopt="$1" + shift +fi + +tmp=${argv[(ib:4:)-]} +len=$# +if [[ tmp -lt len ]]; then + pre=$(( tmp-1 )) + suf=$tmp +elif [[ tmp -eq $# ]]; then + pre=-2 + suf=$(( len+1 )) +else + pre=4 + suf=5 +fi + +while [[ -z "$tloop" ]] || comptags -N; do + while comptags -A "$1" curtag; do + if [[ "$curtag" = *:* ]]; then + zformat -f descr "${curtag#*:}" "d:$3" + _description "$gopt" "${curtag%:*}" "$2" "$descr" + curtag="${curtag%:*}" + + "$4" "${(P@)2}" "${(@)argv[5,-1]}" + else + _description "$gopt" "$curtag" "$2" "$3" + + "${(@)argv[4,pre]}" "${(P@)2}" "${(@)argv[suf,-1]}" && ret=0 + fi + done + [[ -z "$tloop" || ret -eq 0 ]] && break +done + +return ret diff --git a/Completion/Core/_alternative b/Completion/Core/_alternative index 158f3a07a..b038aa8a4 100644 --- a/Completion/Core/_alternative +++ b/Completion/Core/_alternative @@ -1,19 +1,23 @@ #autoload -local tags def expl descr action mesgs nm="$compstack[nmatches]" -local context +local tags def expl descr action mesgs nm="$compstate[nmatches]" subopts +local opt curcontext="$curcontext" + +subopts=() +while getopts 'O:C:' opt; do + case "$opt" in + O) subopts=( "${(@P)OPTARG}" ) ;; + C) curcontext="${curcontext%:*}:$OPTARG" ;; + esac +done + +shift OPTIND-1 -if [[ "$1" = -C?* ]]; then - context="${1[3,-1]}" - shift -elif [[ "$1" = -C ]]; then - context="$2" - shift 2 -fi +[[ "$1" = -(|-) ]] && shift mesgs=() -_tags -C "$context" "${(@)argv%%:*}" +_tags "${(@)argv%%:*}" while _tags; do for def; do @@ -21,7 +25,7 @@ while _tags; do descr="${${def#*:}%%:*}" action="${def#*:*:}" - _description expl "$descr" + _description "${def%%:*}" expl "$descr" if [[ "$action" = \ # ]]; then @@ -35,28 +39,35 @@ while _tags; do eval ws\=\( "${action[3,-3]}" \) - _describe "$descr" ws -M 'r:|[_-]=* r:|=*' + _describe "$descr" ws -M 'r:|[_-]=* r:|=*' "$subopts[@]" elif [[ "$action" = \(*\) ]]; then # Anything inside `(...)' is added directly. - compadd "$expl[@]" - ${=action[2,-2]} + _all_labels "${def%%:*}" expl "$descr" \ + compadd "$subopts[@]" - ${=action[2,-2]} elif [[ "$action" = \{*\} ]]; then # A string in braces is evaluated. - eval "$action[2,-2]" + while _next_label "${def%%:*}" expl "$descr"; do + eval "$action[2,-2]" + done elif [[ "$action" = \ * ]]; then # If the action starts with a space, we just call it. - ${(e)=~action} + eval "action=( $action )" + while _next_label "${def%%:*}" expl "$descr"; do + "$action[@]" + done else # Otherwise we call it with the description-arguments built above. - action=( $=action ) - ${(e)action[1]} "$expl[@]" ${(e)~action[2,-1]} + eval "action=( $action )" + _all_labels "${def%%:*}" expl "$descr" \ + "$action[1]" "$subopts[@]" "${(@)action[2,-1]}" fi fi done diff --git a/Completion/Core/_approximate b/Completion/Core/_approximate index 1b40f7cbf..0815a308e 100644 --- a/Completion/Core/_approximate +++ b/Completion/Core/_approximate @@ -1,102 +1,30 @@ #autoload # This code will try to correct the string on the line based on the -# strings generated for the context if `compconfig[correct]' is set. -# These corrected strings will be shown in a list and one can -# cycle through them as in a menucompletion or get the corrected prefix. -# -# Supported configuration keys: -# -# approximate_accept -# This should be set to a number, specifying the maximum number -# of errors that should be accepted. If the string also contains -# a `n' or `N', the code will use the numeric argument as the -# maximum number of errors if a numeric argument was given. If no -# numeric argument was given, the number from the value of this -# key will be used. E.g. with `compconf approximate_accept=2n' two -# errors will be accepted, but if the user gives another number -# with the numeric argument, this will be prefered. Also, with -# `compconf approximate_accept=0n', normally no correction will be -# tried, but if a numeric argument is given, automatic correction -# will be used. On the other hand, if the string contains an `!' -# and a `n' or `N', correction is not attempted if a numeric -# argument is given. Once the number of errors to accept is -# determined, the code will repeatedly try to generate matches by -# allowing one error, two errors, and so on. Independent of the -# number of errors the user wants to accept, the code will allow -# only fewer errors than there are characters in the string from -# the line. -# -# approximate_original -# This value is used to determine if the original string should -# be included in the list (and thus be presented to the user when -# cycling through the corrections). If it is set to any non-empty -# value, the original string will be offered. If it contains the -# sub-string `last', the original string will appear as the last -# string when cycling through the corrections, otherwise it will -# appear as the first one (so that the command line does not -# change immediately). Also, if the value contains the sub-string -# `always', the original string will always be included, whereas -# normally it is included only if more than one possible -# correction was generated. -# -# approximate_prompt -# This can be set to a string that should be printed before the -# list of corrected strings when cycling through them. This string -# may contain the control sequences `%n', `%B', etc. known from -# the `-X' option of `compctl'. Also, the sequence `%e' will be -# replaced by the number of errors accepted to generate the -# corrected strings. -# -# approximate_insert -# If this is set to a string starting with `unambig', the code -# will try to insert a usable unambiguous string in the command -# line instead of always cycling through the corrected strings. -# If such a unambiguous string could be found, the original -# string is not used, independent of the setting of -# `approximate_original'. If no sensible string could be found, -# one can cycle through the corrected strings as usual. -# -# If any of these keys is not set, but the the same key with the -# prefix `correct' instead of `approximate' is set, that value will -# be used. - -local _comp_correct _correct_prompt comax -local cfgacc cfgorig cfgps cfgins - -# Only if all global matchers hav been tried. - -[[ compstate[matcher] -ne compstate[total_matchers] ]] && return 1 - -# We don't try correction if the string is too short. - -[[ "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 - -# Get the configuration values, using either the prefix `correct' or -# `approximate'. - -if [[ "$compstate[pattern_match]" = (|\**) ]]; then - cfgacc="${compconfig[approximate_accept]:-$compconfig[correct_accept]}" - cfgorig="${compconfig[approximate_original]:-$compconfig[correct_original]}" - cfgps="${compconfig[approximate_prompt]:-$compconfig[correct_prompt]}" - cfgins="${compconfig[approximate_insert]:-$compconfig[correct_insert]}" -else - cfgacc="$compconfig[correct_accept]" - cfgorig="$compconfig[correct_original]" - cfgps="$compconfig[correct_prompt]" - cfgins="$compconfig[correct_insert]" -fi +# strings generated for the context. These corrected strings will be +# shown in a list and one can cycle through them as in a menucompletion +# or get the corrected prefix. + +# We don't try correction if the string is too short or we have tried it +# already. + +[[ _matcher_num -gt 1 || "${#:-$PREFIX$SUFFIX}" -le 1 ]] && return 1 + +local _comp_correct _correct_expl comax cfgacc +local oldcontext="${curcontext}" opm="$compstate[pattern_match]" + +zstyle -s ":completion:${curcontext}:" max-errors cfgacc || cfgacc='2 numeric' # Get the number of errors to accept. -if [[ "$cfgacc" = *[nN]* && NUMERIC -ne 1 ]]; then - # Stop if we also have a `!'. +if [[ "$cfgacc" = *numeric* && ${NUMERIC:-1} -ne 1 ]]; then + # A numeric argument may mean that we should not try correction. - [[ "$cfgacc" = *\!* ]] && return 1 + [[ "$cfgacc" = *not-numeric* ]] && return 1 # Prefer the numeric argument if that has a sensible value. - comax="$NUMERIC" + comax="${NUMERIC:-1}" else comax="${cfgacc//[^0-9]}" fi @@ -105,13 +33,15 @@ fi [[ "$comax" -lt 1 ]] && return 1 -# Otherwise temporarily define functions to use instead of -# the builtins that add matches. This is used to be able -# to stick the `(#a...)' into the right place (after an +_tags corrections original + +# Otherwise temporarily define a function to use instead of +# the builtin that adds matches. This is used to be able +# to stick the `(#a...)' in the right place (after an # ignored prefix). compadd() { - [[ "$*" != *-([a-zA-Z/]#|)U* && + [[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 && "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return if [[ "$PREFIX" = \~*/* ]]; then @@ -119,79 +49,49 @@ compadd() { else PREFIX="(#a${_comp_correct})$PREFIX" fi - if [[ -n "$_correct_prompt" ]]; then - builtin compadd -X "$_correct_prompt" -J _correct "$@" - else - builtin compadd -J _correct "$@" - fi + builtin compadd "$_correct_expl[@]" "$@" } -compgen() { - [[ "$*" != *-([a-zA-Z/]#|)U* && - "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return - - if [[ "$PREFIX" = \~*/* ]]; then - PREFIX="${PREFIX%%/*}/(#a${_comp_correct})${PREFIX#*/}" - else - PREFIX="(#a${_comp_correct})$PREFIX" - fi - if [[ -n "$_correct_prompt" ]]; then - builtin compgen "$@" -X "$_correct_prompt" -J _correct - else - builtin compgen "$@" -J _correct - fi -} - -# Now initialise our counter. We also set `compstate[matcher]' -# to `-1'. This allows completion functions to use the simple -# `[[ compstate[matcher] -gt 1 ]] && return' to avoid being -# called for multiple global match specs and still be called -# again when correction is done. Also, this makes it easy to -# test if correction is attempted since `compstate[matcher]' -# will never be set to a negative value by the completion code. - _comp_correct=1 -compstate[matcher]=-1 - -_correct_prompt="${cfgps//\%e/1}" - -# We also need to set `extendedglob' and make the completion -# code behave as if globcomplete were set. - -setopt extendedglob [[ -z "$compstate[pattern_match]" ]] && compstate[pattern_match]='*' while [[ _comp_correct -le comax ]]; do + curcontext="${oldcontext/(#b)([^:]#:[^:]#:)/${match[1][1,-2]}-${_comp_correct}:}" + + _description corrections _correct_expl corrections \ + "e:$_comp_correct" "o:$PREFIX$SUFFIX" + if _complete; then - if [[ "$cfgins" = unambig* && - "${#compstate[unambiguous]}" -ge "${#:-$PREFIX$SUFFIX}" ]]; then + if zstyle -t ":completion:${curcontext}:" insert-unambiguous && + [[ "${#compstate[unambiguous]}" -ge "${#:-$PREFIX$SUFFIX}" ]]; then compstate[pattern_insert]=unambiguous - elif [[ compstate[nmatches] -gt 1 || "$cfgorig" = *always* ]]; then - if [[ "$cfgorig" = *last* ]]; then - builtin compadd -U -V _correct_original -nQ - "$PREFIX$SUFFIX" - elif [[ -n "$cfgorig" ]]; then - builtin compadd -U -nQ - "$PREFIX$SUFFIX" - fi + elif _requested original && + { [[ compstate[nmatches] -gt 1 ]] || + zstyle -t ":completion:${curcontext}:" original }; then + local expl + + _description -V original expl original + + builtin compadd "$expl[@]" -U -Q - "$PREFIX$SUFFIX" # If you always want to see the list of possible corrections, - # set `compstate[list]=list' here. + # set `compstate[list]=list force' here. - compstate[force_list]=list + [[ "$compstate[list]" != list* ]] && + compstate[list]="$compstate[list] force" fi - compstate[matcher]="$compstate[total_matchers]" - unfunction compadd compgen + unfunction compadd + compstate[pattern_match]="$opm" return 0 fi [[ "${#:-$PREFIX$SUFFIX}" -le _comp_correct+1 ]] && break (( _comp_correct++ )) - - _correct_prompt="${cfgps//\%e/$_comp_correct}" done -compstate[matcher]="$compstate[total_matchers]" -unfunction compadd compgen +unfunction compadd +compstate[pattern_match]="$opm" return 1 diff --git a/Completion/Core/_call b/Completion/Core/_call index 345dae50d..b038a80bc 100644 --- a/Completion/Core/_call +++ b/Completion/Core/_call @@ -1,4 +1,4 @@ -#autoload +#autoload +X local tmp diff --git a/Completion/Core/_complete b/Completion/Core/_complete index 0f4d5ff4b..c2679dcb8 100644 --- a/Completion/Core/_complete +++ b/Completion/Core/_complete @@ -2,51 +2,65 @@ # Generate all possible completions. Note that this is not intended as # a normal completion function, but as one possible value for the -# compconfig[completer] parameter. +# completer style. -local comp name +local comp name oldcontext +typeset -T curcontext="$curcontext" ccarray + +oldcontext="$curcontext" + +# If we have a user-supplied context name, use only that. + +if [[ -n "$compcontext" ]]; then + ccarray[3]="$compcontext" + + comp="$_comps[$compcontext]" + [[ -z "$comp" ]] || "$comp" + + return +fi # An entry for `-first-' is the replacement for `compctl -T' -# Completion functions may set `_compskip' to any value to make the -# main loops stop calling other completion functions. comp="$_comps[-first-]" if [[ ! -z "$comp" ]]; then + ccarray[3]=-first- "$comp" - if (( $+_compskip )); then - unset _compskip + if [[ "$_compskip" = all ]]; then + _compskip='' (( compstate[nmatches] )) return fi fi + # For arguments and command names we use the `_normal' function. if [[ "$compstate[context]" = command ]]; then - _normal + curcontext="$oldcontext" + _normal -s else # Let's see if we have a special completion definition for the other # possible contexts. - comp='' - - case $compstate[context] in - equal) comp="$_comps[-equal-]";; - tilde) comp="$_comps[-tilde-]";; - redirect) comp="$_comps[-redirect-]";; - math) comp="$_comps[-math-]";; - subscript) comp="$_comps[-subscript-]";; - value) comp="$_comps[-value-]";; - array_value) comp="$_comps[-array-value-]";; - condition) comp="$_comps[-condition-]";; - parameter) comp="$_comps[-parameter-]";; - brace_parameter) comp="$_comps[-brace-parameter-]";; - esac + local cname="-${compstate[context]:s/_/-/}-" + + ccarray[3]="$cname" + + comp="$_comps[$cname]" # If not, we use default completion, if any. - [[ -z "$comp" ]] && comp="$_comps[-default-]" + if [[ -z "$comp" ]]; then + if [[ "$_compskip" = *default* ]]; then + _compskip='' + return 1 + fi + comp="$_comps[-default-]" + fi [[ -z "$comp" ]] || "$comp" fi +_compskip='' + (( compstate[nmatches] )) diff --git a/Completion/Core/_correct b/Completion/Core/_correct index 35ab01cf1..c9c3d999c 100644 --- a/Completion/Core/_correct +++ b/Completion/Core/_correct @@ -1,8 +1,8 @@ #autoload -# This is mainly a wrapper around the more general `_approximate. +# This is mainly a wrapper around the more general `_approximate'. # By setting `compstate[pattern_match]' to something unequal to `*' and -# then calling `_approximate, we get only corrections, not all strings +# then calling `_approximate', we get only corrections, not all strings # with the corrected prefix and something after it. # # Supported configuration keys are the same as for `_approximate', only diff --git a/Completion/Core/_description b/Completion/Core/_description index 874ba8a96..7db47228b 100644 --- a/Completion/Core/_description +++ b/Completion/Core/_description @@ -1,22 +1,56 @@ #autoload -local gropt=-J +local name gropt=-J format gname hidden hide match opts -if [[ "$1" = -V ]]; then - gropt=-V +opts=() + +if [[ "$1" = -([12]|)[VJ] ]]; then + gropt="$1" shift fi -if [[ -n "$compconfig[group_matches]" ]]; then - if [[ -n "$compconfig[description_format]" ]]; then - eval "$1=($gropt ${(q)2} -X ${(q)compconfig[description_format]//\\%d/$2})" +_lastdescr=( "$_lastdescr[@]" "$3" ) + +_setup "$1" + +name="$2" + +zstyle -s ":completion:${curcontext}:$1" format format || + zstyle -s ":completion:${curcontext}:descriptions" format format + +zstyle -s ":completion:${curcontext}:$1" hidden hidden +if [[ "$hidden" = (all|yes|true|1|on) ]]; then + [[ "$hidden" = all ]] && format='' + opts=(-n) +fi +zstyle -s ":completion:${curcontext}:$1" group-name gname && + [[ -z "$gname" ]] && gname="$1" +zstyle -s ":completion:${curcontext}:$1" matcher match && + opts=($opts -M "${(q)match}") +[[ -n "$_matcher" ]] && opts=($opts -M "${(q)_matcher}") + +if [[ -z "$_comp_no_ignore" ]] && + zstyle -a ":completion:${curcontext}:$1" ignored-patterns _comp_ignore; then + opts=( $opts -F _comp_ignore ) +else + _comp_ignore=() +fi + +shift 2 +[[ -n "$format" ]] && zformat -f format "$format" "d:$1" "${(@)argv[2,-1]}" + +if [[ -n "$gname" ]]; then + if [[ -n "$format" ]]; then + eval "${name}=($opts $gropt ${(q)gname} -X \"${format}\")" else - eval "$1=($gropt ${(q)2})" + eval "${name}=($opts $gropt ${(q)gname})" fi else - if [[ -n "$compconfig[description_format]" ]]; then - eval "$1=(-X ${(q)compconfig[description_format]//\\%d/$2})" + if [[ -n "$format" ]]; then + eval "${name}=($opts $gropt -default- -X \"${format}\")" else - eval "$1=()" + eval "${name}=($opts $gropt -default-)" fi fi + +return 0 diff --git a/Completion/Core/_expand b/Completion/Core/_expand index 9172b6cbf..eff8d8601 100644 --- a/Completion/Core/_expand +++ b/Completion/Core/_expand @@ -6,61 +6,20 @@ # This function will allow other completer functions to be called if # the expansions done produce no result or do not change the original # word from the line. -# -# Configuration keys: -# -# expand_substitute -# If this is unset or set to the empty string, the code will first -# try to expand all substitutions in the string (such as $(...) and -# ${...}). If this is set to an non-empty string it should be -# an expression usable inside a $[...] arithmetical expression. -# In this case, expansion of substitutions will be done if the -# expression evaluates to `1'. For example, with -# -# compconf expand_substitute='NUMERIC != 1' -# -# substitution will be performed only if given an explicit numeric -# argument other than `1', as by typing ESC 2 TAB. -# -# expand_glob -# If this is unset or set to an empty string, globbing will be -# attempted on the word resulting from substitution or the -# original string. The values accepted for this key are the same -# as for expand_substitute. -# -# expand_menu -# If this is unset or set to the empty string, the words resulting -# from expansion (if any) will simply be inserted in the ommand line, -# replacing the original string. However, if this key is set to an -# non-empty string, the user can cycle through the expansion as in -# a menucompletion. Unless the value contains the sub-string `only', -# the user will still be offered all expansions at once as one of -# the strings to insert in the command line. Also, if the value -# contains the sub-string `last', the string with all expansion will -# be offered first, whereas normally it is offered as the last string -# to insert. Finally, if the value contains the sub-string `sort', -# the expansions will be sorted alphabetically, normally they are -# kept in the order the expansion produced them in. -# -# expand_original -# If this is set to an non-empty string, the original string from the -# line will be included in the list of strings the user can cycle -# through as in a menucompletion. If the value contains the sub-string -# `last', the original string will appear as the last string, with -# other values it is inserted as the first one (so that the command -# line does not change immediatly). -# -# expand_prompt -# This may be set to a string that should be displayed before the -# possible expansions. This is given to the -X option and thus may -# contain the control sequences `%n', `%B', etc. Also, the sequence -# `%o' in this string will be replaced by the original string. - -local exp word="$PREFIX$SUFFIX" group=-V - -# Do this only for the first global matcher. - -[[ "$compstate[matcher]" -le 1 ]] || return 1 + +setopt localoptions nullglob + +[[ _matcher_num -gt 1 ]] && return 1 + +local exp word="$PREFIX$SUFFIX" sort expr expl subd suf=" " + +# First, see if we should insert all *completions*. + +if zstyle -s ":completion:${curcontext}:" completions expr && + [[ "${(e):-\$[$expr]}" -eq 1 ]]; then + compstate[insert]=all + return 1 +fi # In exp we will collect the expansion. @@ -69,79 +28,68 @@ exp=("$word") # First try substitution. That weird thing spanning multiple lines # changes quoted spaces, tabs, and newlines into spaces. -[[ -z "$compconfig[expand_substitute]" || - "${(e):-\$[$compconfig[expand_substitute]]}" -eq 1 ]] && +zstyle -s ":completion:${curcontext}:" substitute expr && + [[ "${(e):-\$[$expr]}" -eq 1 ]] && exp=( "${(e)exp//\\[ ]/ }" ) # If the array is empty, store the original string again. -[[ -z "$exp" ]] && exp=("$word") +(( $#exp )) || exp=("$word") + +subd=("$exp[@]") # Now try globbing. -[[ -z "$compconfig[expand_glob]" || - "${(e):-\$[$compconfig[expand_glob]]}" -eq 1 ]] && - exp=( ${~exp}(N) ) +zstyle -s ":completion:${curcontext}:" glob expr && + [[ "${(e):-\$[$expr]}" -eq 1 ]] && + exp=( ${~exp} ) # If we don't have any expansions or only one and that is the same # as the original string, we let other completers run. -[[ $#exp -eq 0 || - ( $#exp -eq 1 && "$exp[1]" = "$word" ) ]] && return 1 +(( $#exp )) || exp=("$subd[@]") -# We have expansions, should we menucomplete them? +[[ $#exp -eq 1 && "$exp[1]" = "$word"(|\(N\)) ]] && return 1 -if [[ -z "$compconfig[expand_menu]" ]]; then +# With subst-globs-only we bail out if there were no glob expansions, +# regardless of any substitutions - # No, so if the user only wants a list, we add the strings - # separately. Otherwise we add the whole array as one string, - # probably also adding the original string. +zstyle -s ":completion:${curcontext}:" subst-globs-only expr && + [[ "${(e):-\$[$expr]}" -eq 1 && "$subd" = "$exp"(|\(N\)) ]] && return 1 - if [[ -z "$compstate[insert]" ]]; then - compadd -U -V _expand -Q - "$exp[@]" - else - [[ -n "$compconfig[expand_original]" && - "$compconfig[expand_original]" != *last* ]] && - compadd -UnQ -V _expand_original - "$word" +# Now add as matches whatever the user requested. - compadd -UQ -V _expand - "$exp" +zstyle -s ":completion:${curcontext}:" sort sort - [[ -n "$compconfig[expand_original]" && - "$compconfig[expand_original]" = *last* ]] && - compadd -UnQ -V _expand_original - "$word" +[[ "$sort" = (yes|true|1|on) ]] && exp=( "${(@o)exp}" ) - compstate[insert]=menu - fi -else - # Sorting? We just use a different group type then. +# If there is only one expansion, add a suitable suffix +(($#exp == 1)) && suf='' && [[ -d $exp && "$exp[1]" != */ ]] && suf='/' - [[ "$compconfig[expand_menu]" = *sort* ]] && group=-J +if [[ -z "$compstate[insert]" ]] ;then + _description all-expansions expl 'all expansions' "o:$word" - # Now add the expansion string, probably also adding the original - # and/or the string containing all expanded string. + compadd "$expl[@]" -UQ -qS "$suf" - "$exp" +else + _tags all-expansions expansions original - [[ -n "$compconfig[expand_original]" && - "$compconfig[expand_original]" != *last* ]] && - compadd -UnQ -V _expand_original - "$word" - [[ "$compconfig[expand_menu]" = *last* && - "$compconfig[expand_menu]" != *only* ]] && - compadd -UnQ -V _expand_all - "$exp" + if _requested all-expansions; then + _description all-expansions expl 'all expansions' + compadd "$expl[@]" -UQ -qS "$suf" - "$exp" + fi - if [[ -z "$compconfig[expand_prompt]" ]]; then - compadd -UQ $group _expand - "$exp[@]" - else - compadd -UQ -X "${compconfig[expand_prompt]//\%o/$word}" \ - $group _expand - "$exp[@]" + if [[ $#exp -gt 1 ]] && _requested expansions; then + if [[ "$sort" = menu ]]; then + _description expansions expl expansions "o:$word" + else + _description -V expansions expl expansions "o:$word" + fi + compadd "$expl[@]" -UQ - "$exp[@]" fi - [[ "$compconfig[expand_menu]" != *last* && - "$compconfig[expand_menu]" != *only* ]] && - compadd -UnQ -V _expand_all - "$exp" - [[ -n "$compconfig[expand_original]" && - "$compconfig[expand_original]" = *last* ]] && - compadd -UnQ -V _expand_original - "$word" + _requested original expl original && compadd "$expl[@]" -UQ - "$word" compstate[insert]=menu fi diff --git a/Completion/Core/_files b/Completion/Core/_files index d2cce35e7..1755abebd 100644 --- a/Completion/Core/_files +++ b/Completion/Core/_files @@ -1,26 +1,49 @@ #autoload -# Utility function for completing files of a given type or any file. -# In many cases you will want to call this one instead of _path_files(). +local opts tmp glob pats expl tag i pat descr minus -local nm=$NMATCHES +zparseopts -a opts \ + '/=tmp' 'f=tmp' 'g+:-=tmp' q n 1 2 P: S: r: R: W: X+: M+: F: J+: V+: -_path_files "$@" +type="${(@j::M)${(@)tmp#-}#?}" +(( $tmp[(I)-g*] )) && glob="${(j: :)${(M)tmp:#-g*}#-g}" -if [[ $# -ne 0 && -nmatches nm ]]; then - local opt opts +if zstyle -a ":completion:${curcontext}:" file-patterns pats; then + [[ "$type" = */* ]] && glob="$glob *(-/)" + pats=( \ ${(M)^${pats//\\%p/ ${glob:-\*} }:#*[^\\]:*} ) +else + if [[ "$type" = *g* ]]; then + if [[ "$type" = */* ]]; then + pats=( " ${glob//:/\\:} *(-/):globbed-files" '*:all-files' ) + else + pats=( " ${glob//:/\\:}:globbed-files" + '*(-/):directories' '*:all-files' ) + fi + elif [[ "$type" = */* ]]; then + pats=( '*(-/):directories' '*:all-files' ) + else + pats=( '*:all-files' ) + fi +fi - # We didn't get any matches for those types of files described by - # the `-g' or `-/' option. Now we try it again accepting all files. - # First we get those options that we have to use even if then. If - # we find out that the `-f' option was given, we already accepted - # all files and give up immediatly. +for tag in "${(@)${(@)pats#*[^\\]:}%%:*}"; do - opts=() - while getopts "P:S:W:F:J:V:X:f/g:" opt; do - [[ "$opt" = f ]] && return - [[ "$opt" = [PSWFJVX] ]] && opts=("$opts[@]" "-$opt" "$OPTARG") - done + i="$pats[(I)*[^\\\\]:${tag}(|:*)]" + pat="${${pats[i]%%:${tag}*}//\\\\:/:}" - _path_files "$opts[@]" -fi + if [[ i -gt 0 && "$pat" != \ # ]]; then + if [[ "$pats[i]" = *:${tag}:* ]]; then + descr="${pats[i]#*:${tag}:}" + minus=() + else + descr=file + minus=(-) + fi + fi + + _wanted "$tag" expl "$descr" \ + _path_files -g "$pat" "$opts[@]" "$minus[@]" && return 0 + +done + +return 1 diff --git a/Completion/Core/_ignored b/Completion/Core/_ignored index 69a5244cc..4046f4c2d 100644 --- a/Completion/Core/_ignored +++ b/Completion/Core/_ignored @@ -4,11 +4,10 @@ (( $compstate[ignored] )) || return 1 -local curcontext="${curcontext/:[^:]#:/:ignored-${(M)#_completers[1,_completer_num]:#_ignored}:}" local comp i _comp_no_ignore=yes tmp expl zstyle -a ":completion:${curcontext}:" completer comp || - comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored,-1]}" ) + comp=( "${(@)_completers[1,_completer_num-1][(R)_ignored(|:*),-1]}" ) for i in "$comp[@]"; do if [[ "$i" != _ignored ]] && "$i"; then diff --git a/Completion/Core/_list b/Completion/Core/_list index 099c6bc7b..37167726c 100644 --- a/Completion/Core/_list +++ b/Completion/Core/_list @@ -1,38 +1,16 @@ #autoload # This completer function makes the other completer functions used -# insert possible completions only after once the list has been -# shown. -# -# Configuration keys: -# -# list_condition -# If this key is unset or set to the empty string, this completer -# will delay the insertion of matches unconditionally. However, -# if this value is set, it should be set to an expression usable -# inside a $[...] arithmetical expression. In this case, delaying -# will be done if the expression evaluates to `1'. -# For example, with -# -# compconf list_condition='NUMERIC != 1' -# -# delaying will be done only if given an explicit numeric argument -# other than `1'. -# -# list_word -# To find out if only listing should be done, the code normally -# compares the contents of the line with the contents the line -# had at the time of the last invocation. If this key is set to -# an non-empty string comparison is done using only the current -# word. So if it is set, attempting completion on a word equal -# to the one completion was called on the last time will not -# delay the generation of matches. - -local pre suf +# insert possible completions only after the list has been shown at +# least once. + +[[ _matcher_num -gt 1 ]] && return 1 + +local pre suf expr # Get the strings to compare. -if [[ -z "$compconfig[list_word]" ]]; then +if zstyle -t ":completion:${curcontext}:" word; then pre="$HISTNO$LBUFFER" suf="$RBUFFER" else @@ -42,16 +20,15 @@ fi # Should we only show a list now? -if [[ ( -z "$compconfig[list_condition]" || - "${(e):-\$[$compconfig[expand_glob]]}" -eq 1 ) && +zstyle -s ":completion:${curcontext}:" condition expr +if [[ ( -z "$expr" || "${(e):-\$[$expr]}" -eq 1 ) && ( "$pre" != "$_list_prefix" || "$suf" != "$_list_suffix" ) ]]; then # Yes. Tell the completion code about it and save the new values # to compare the next time. compstate[insert]='' - compstate[list]=list - compstate[force_list]=yes + compstate[list]='list force' _list_prefix="$pre" _list_suffix="$suf" fi diff --git a/Completion/Core/_main_complete b/Completion/Core/_main_complete index c7f5a5a96..d9278f435 100644 --- a/Completion/Core/_main_complete +++ b/Completion/Core/_main_complete @@ -2,47 +2,206 @@ # The main loop of the completion code. This is what is called when # completion is attempted from the command line. -# The completion code gives us the special variables and the arguments -# from the command line are given as positional parameters. -local comp name -setopt localoptions nullglob rcexpandparam globdots -unsetopt markdirs globsubst shwordsplit nounset +# If you want to complete only set or unset options for the unsetopt +# and setopt builtin, un-comment these lines: +# +# local _set_options _unset_options +# +# _set_options=(${(k)options[(R)on]}) +# _unset_options=(${(k)options[(R)off]}) +# +# This is needed because completion functions may set options locally +# which makes the output of setopt and unsetopt reflect a different +# state than the global one for which you are completing. -# An entry for `-first-' is the replacement for `compctl -T' -# Completion functions may set `_compskip' to any value to make the -# main loops stop calling other completion functions. +setopt localoptions nullglob rcexpandparam extendedglob +unsetopt markdirs globsubst shwordsplit nounset ksharrays -comp="$_comps[-first-]" -if [[ ! -z "$comp" ]]; then - "$comp" "$@" - if (( $+_compskip )); then - unset _compskip - return - fi +local func funcs ret=1 tmp _compskip format _comp_ignore \ + _completers _completer _completer_num curtag \ + _matchers _matcher _matcher_num _comp_tags \ + context state line opt_args val_args curcontext="$curcontext" \ + _last_nmatches=-1 _last_menu_style _def_menu_style _menu_style sel \ + _saved_exact="${compstate[exact]}" \ + _saved_lastprompt="${compstate[last_prompt]}" \ + _saved_list="${compstate[list]}" \ + _saved_insert="${compstate[insert]}" + +typeset -U _lastdescr + +[[ -z "$curcontext" ]] && curcontext=::: + +# Special completion contexts after `~' and `='. + +if compset -P 1 '='; then + compstate[context]=equal +elif [[ "$PREFIX" != */* && "$PREFIX[1]" = '~' ]]; then + compset -p 1 + compstate[context]=tilde fi -# For arguments we use the `_normal function. +# Initial setup. + +_setup default +_def_menu_style=( "$_last_menu_style[@]" + +# We can't really do that because the current value of $SELECTMIN +# may be the one set by this function. +# There is a similar problem with $ZLS_COLORS in _setup. + +# ${SELECTMIN+select${SELECTMIN:+\=$SELECTMIN}} + + ) +_last_menu_style=() -if [[ $CONTEXT == argument || $CONTEXT == command ]]; then - _normal "$@" +# Get the names of the completers to use in the positional parameters. + +if (( $# )); then + _completers=( "$@" ) else - # Let's see if we have a special completion definition for the other - # possible contexts. + zstyle -a ":completion:${curcontext}:" completer _completers || + _completers=( _complete ) +fi + +# And now just call the completer functions defined. + +_completer_num=1 + +# Call the pre-functions. + +funcs=( "$compprefuncs[@]" ) +compprefuncs=() +for func in "$funcs[@]"; do + "$func" +done + +for tmp in "$_completers[@]"; do + + if [[ "$tmp" = *:-* ]]; then + _completer="${${tmp%:*}[2,-1]//_/-}${tmp#*:}" + tmp="${tmp%:*}" + elif [[ $tmp = *:* ]]; then + _completer="${tmp#*:}" + tmp="${tmp%:*}" + else + _completer="${tmp[2,-1]//_/-}" + fi + curcontext="${curcontext/:[^:]#:/:${_completer}:}" - comp='' + zstyle -a ":completion:${curcontext}:" matcher-list _matchers || + _matchers=( '' ) - case $CONTEXT in - redirect) comp="$_comps[-redirect-]";; - math) comp="$_comps[-math-]";; - subscript) comp="$_comps[-subscript-]";; - value) comp="$_comps[-value-]";; - condition) comp="$_comps[-condition-]";; - esac + _matcher_num=1 + for _matcher in "$_matchers[@]"; do + if "$tmp"; then + ret=0 + break 2 + fi + (( _matcher_num++ )) + done + (( _completer_num++ )) +done - # If not, we use default completion, if any. +curcontext="${curcontext/:[^:]#:/::}" - [[ -z "$comp" ]] && comp="$_comps[-default-]" - [[ -z "$comp" ]] || "$comp" "$@" +if [[ $compstate[old_list] = keep || $compstate[nmatches] -gt 1 ]]; then + [[ _last_nmatches -ge 0 && _last_nmatches -ne $compstate[nmatches] ]] && + _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) + + if [[ "$compstate[insert]" = "$_saved_insert" ]]; then + if [[ -n "$_menu_style[(r)(yes|true|1|on)]" || + ( -n "$_menu_style[(r)auto*]" && + "$compstate[insert]" = automenu ) ]]; then + compstate[insert]=menu + elif [[ -n "$_menu_style[(r)auto*]" && + "$compstate[insert]" != automenu ]]; then + compstate[insert]=automenu-unambiguous + elif [[ -n "$_menu_style[(r)(no|false|0|off)]" ]]; then + compstate[insert]=unambiguous + elif [[ -n "$_def_menu_style[(r)(yes|true|1|on)]" || + ( -n "$_def_menu_style[(r)auto*]" && + "$compstate[insert]" = automenu ) ]]; then + compstate[insert]=menu + elif [[ -n "$_def_menu_style[(r)auto*]" && + "$compstate[insert]" != automenu ]]; then + compstate[insert]=automenu-unambiguous + elif [[ -n "$_def_menu_style[(r)(no|false|0|off)]" ]]; then + compstate[insert]=unambiguous + fi + fi + + _menu_style=( "$_menu_style[@]" "$_def_menu_style[@]" ) + + if [[ "$compstate[insert]" = *menu* ]]; then + if [[ -n "$_menu_style[(r)no-select*]" ]]; then + unset SELECTMIN + else + sel=( "${(@M)_menu_style:#select*}" ) + + if (( $# )); then + local min=9999999 i num + + for i in "$sel[@]"; do + if [[ "$i" = *\=* ]]; then + num="${i#*\=}" + [[ num -lt 0 ]] && num=0 + else + num=0 + fi + [[ num -lt min ]] && min="$num" + + (( min )) || break + done + + zmodload -i zsh/complist + SELECTMIN="$min" + fi + fi + fi +elif [[ $compstate[nmatches] -eq 0 && + $#_lastdescr -ne 0 && $compstate[old_list] != keep ]] && + zstyle -s ":completion:${curcontext}:warnings" format format; then + + compstate[list]='list force' + compstate[insert]='' + + if [[ "$format" = *%d* ]]; then + local str mesg + + _lastdescr=( "\`${(@)^_lastdescr:#}'" ) + + case $#_lastdescr in + 1) str="$_lastdescr[1]";; + 2) str="$_lastdescr[1] or $_lastdescr[2]";; + *) str="${(j:, :)_lastdescr[1,-2]}, or $_lastdescr[-1]";; + esac + + zformat -f mesg "$format" "d:$str" + compadd -UX "$mesg" -n - '' + else + _setup warnings + compadd -UQX "$format" -V warnings - "${(@)_lastdescr:#}" + fi fi + +# Now call the post-functions. + +funcs=( "$comppostfuncs[@]" ) +comppostfuncs=() +for func in "$funcs[@]"; do + "$func" +done + +_lastcomp=( "${(@kv)compstate}" ) +_lastcomp[completer]="$_completer" +_lastcomp[prefix]="$PREFIX" +_lastcomp[suffix]="$SUFFIX" +_lastcomp[iprefix]="$IPREFIX" +_lastcomp[isuffix]="$ISUFFIX" +_lastcomp[qiprefix]="$QIPREFIX" +_lastcomp[qisuffix]="$QISUFFIX" +_lastcomp[tags]="$_comp_tags" + +return ret diff --git a/Completion/Core/_match b/Completion/Core/_match index 3c639935c..18dab7423 100644 --- a/Completion/Core/_match +++ b/Completion/Core/_match @@ -1,53 +1,51 @@ #autoload # This is intended to be used as a completer function after the normal -# completer as in: `compconf completer=_complete:_match'. +# completer as in: `zstyle ":completion:::::" completer _complete _match'. # It temporarily switches on pattern matching, allowing you to try # completion on patterns without having to setopt glob_complete. # # Note, however, that this is only really useful if you don't use the # expand-or-complete function because otherwise the pattern will # be expanded using globbing. -# -# Configuration key used: -# -# match_original -# If this is set to a `only', pattern matching will only be tried -# with the string from the line. If it is set to any other non-empty -# string, the original pattern will be tried first and if that yields -# no completions, matching will be tried again with a `*' inserted -# at the cursor position. If this key is not set or set to an empty -# string, matching will only be attempted with the `*' inserted. -local tmp opm="$compstate[pattern_match]" ret=0 +[[ _matcher_num -gt 1 ]] && return 1 + +local tmp opm="$compstate[pattern_match]" ret=0 orig ins -# Do nothing if we don't have a pattern or there are still global -# match specifications to try. +# Do nothing if we don't have a pattern. tmp="${${:-$PREFIX$SUFFIX}#[~=]}" -[[ "$tmp:q" = "$tmp" || - compstate[matcher] -ne compstate[total_matchers] ]] && return 1 +[[ "$tmp:q" = "$tmp" ]] && return 1 + +zstyle -s ":completion:${curcontext}:" match-original orig +zstyle -b ":completion:${curcontext}:" insert-unambiguous ins # Try completion without inserting a `*'? -if [[ -n "$compconfig[match_original]" ]]; then - compstate[matcher]=-1 +if [[ -n "$orig" ]]; then compstate[pattern_match]='-' _complete && ret=1 compstate[pattern_match]="$opm" - compstate[matcher]="$compstate[total_matchers]" - (( ret )) && return 0 + if (( ret )); then + [[ "$ins" = yes && + $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] && + compstate[pattern_insert]=unambiguous + return 0 + fi fi # No completion with inserting `*'? -[[ "$compconfig[match_original]" = only ]] && return 1 +[[ "$orig" = only ]] && return 1 -compstate[matcher]=-1 compstate[pattern_match]='*' _complete && ret=1 compstate[pattern_match]="$opm" -compstate[matcher]="$compstate[total_matchers]" + +[[ ret -eq 1 && "$ins" = yes && + $#compstate[unambiguous] -ge ${#:-${PREFIX}${SUFFIX}} ]] && + compstate[pattern_insert]=unambiguous return 1-ret diff --git a/Completion/Core/_menu b/Completion/Core/_menu index 4cbda4e14..41fc178ba 100644 --- a/Completion/Core/_menu +++ b/Completion/Core/_menu @@ -1,10 +1,12 @@ #autoload +[[ _matcher_num -gt 1 ]] && return 1 + # This completer is an example showing how menucompletion can be # implemented with the new completion system. # Use this one before the normal _complete completer, as in: # -# compconf completer=_menu:_complete +# zstyle ":completion:::::" completer _menu _complete if [[ -n "$compstate[old_list]" ]]; then diff --git a/Completion/Core/_next_label b/Completion/Core/_next_label new file mode 100644 index 000000000..e309e53ea --- /dev/null +++ b/Completion/Core/_next_label @@ -0,0 +1,24 @@ +#autoload + +local gopt=-J descr + +if [[ "$1" = -([12]|)[VJ] ]]; then + gopt="$1" + shift +fi + +if comptags -A "$1" curtag; then + if [[ "$curtag" = *:* ]]; then + zformat -f descr "${curtag#*:}" "d:$3" + _description "$gopt" "${curtag%:*}" "$2" "$descr" + curtag="${curtag%:*}" + eval "${2}=( \${(P)2} \$argv[4,-1] )" + else + _description "$gopt" "$curtag" "$2" "$3" + eval "${2}=( \$argv[4,-1] \${(P)2} )" + fi + + return 0 +fi + +return 1 diff --git a/Completion/Core/_oldlist b/Completion/Core/_oldlist new file mode 100644 index 000000000..bcb3e148a --- /dev/null +++ b/Completion/Core/_oldlist @@ -0,0 +1,53 @@ +#autoload + +[[ _matcher_num -gt 1 ]] && return 1 + +local list + +zstyle -s ":completion:${curcontext}:" old-list list + +# If this is a listing widget and there is already an old list, +# and either the style :oldlist:old-list is `always', or it is not `never' +# and the list is not already shown, then use the existing list for listing +# (even if it was generated by another widget). +# Do this also if there is an old list and it was generated by the +# completer named by the oldlist_list key. + +if [[ -n $compstate[old_list] && $list != never ]]; then + if [[ $WIDGET = *list* && ( $list = always || $list != shown ) ]]; then + compstate[old_list]=keep + return 0 + elif [[ $list = *${_lastcomp[completer]}* ]]; then + [[ "$_lastcomp[insert]" = unambig* ]] && compstate[to_end]=single + compstate[old_list]=keep + if [[ -o automenu ]]; then + compstate[insert]=menu + else + compadd -Qs "$SUFFIX" - "$PREFIX" + fi + return 0 + fi +fi + +# If this is a completion widget, and we have a completion inserted already, +# and the style :oldlist:old-menu is `true', then we cycle through the +# existing list (even if it was generated by another widget). + +if [[ -z $compstate[old_insert] && -n $compstate[old_list] ]]; then + compstate[old_list]=keep +elif [[ $WIDGET = *complete(|-prefix|-word) ]] && + zstyle -t ":completion:${curcontext}:" old-menu; then + if [[ -n $compstate[old_insert] ]]; then + compstate[old_list]=keep + if [[ $WIDGET = *reverse* ]]; then + compstate[insert]=$(( compstate[old_insert] - 1 )) + else + compstate[insert]=$(( compstate[old_insert] + 1 )) + fi + else + return 1 + fi + return 0 +fi + +return 1 diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 83b6e8a09..ac4614dd8 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -1,85 +1,64 @@ #autoload -# Utility function for in-path completion. -# Supported arguments are: `-f', `-/', `-g <patterns>', `-J <group>', -# `-V <group>', `-W paths', `-X explanation', and `-F <ignore>'. All but -# the last have the same syntax and meaning as for `complist'. The -# `-F <ignore>' option may be used to give a list of suffixes either by -# giving the name of an array or literally by giving them in a string -# surrounded by parentheses. Files with one of the suffixes thus given -# are treated like files with one of the suffixes in the `fignore' array -# in normal completion. -# -# This function uses the helper functions `_match_test' and `_match_pattern'. +# Utility function for in-path completion. This allows `/u/l/b<TAB>' +# to complete to `/usr/local/bin'. -# First see if we should generate matches for the global matcher in use. +local linepath realpath donepath prepath testpath exppath skips skipped +local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre +local pats haspats=no ignore pfxsfx rem remt sopt gopt opt +local nm=$compstate[nmatches] menu matcher mopts atmp sort match -_match_test _path_files || return +typeset -U prepaths exppaths -# Yes, so... - -local nm prepaths str linepath realpath donepath patstr prepath testpath rest -local tmp1 collect tmp2 suffixes i ignore matchflags opt group sopt pats gopt -local addpfx addsfx expl - -setopt localoptions nullglob rcexpandparam globdots extendedglob +setopt localoptions nullglob rcexpandparam unsetopt markdirs globsubst shwordsplit nounset -prepaths=('') -ignore=() -group=() -sopt='-' -gopt='' -pats=() -addpfx=() -addsfx=() -expl=() +exppaths=() # Get the options. -while getopts "P:S:W:F:J:V:X:f/g:" opt; do - case "$opt" in - P) addpfx=(-P "$OPTARG") - ;; - S) addsfx=(-S "$OPTARG") - ;; - W) tmp1="$OPTARG" - if [[ "$tmp1[1]" = '(' ]]; then - prepaths=( ${^=tmp1[2,-2]}/ ) - else - prepaths=( ${(P)=${tmp1}} ) - (( ! $#prepaths )) && prepaths=( ${tmp1}/ ) - fi - (( ! $#prepaths )) && prepaths=( '' ) - ;; - F) tmp1="$OPTARG" - if [[ "$tmp1[1]" = '(' ]]; then - ignore=( ${^=tmp1[2,-2]}/ ) - else - ignore=( ${(P)${tmp1}} ) - fi - (( $#ignore )) && ignore=(-F "( $ignore )") - ;; - [JV]) group=("-$opt" "$OPTARG") - ;; - X) expl=(-X "$OPTARG") - ;; - f) sopt="${sopt}f" - pats=("$pats[@]" '*') - ;; - /) sopt="${sopt}/" - pats=("$pats[@]" '*(-/)') - ;; - g) gopt='-g' - pats=("$pats[@]" ${=OPTARG}) - ;; - esac -done +zparseopts -a mopts \ + 'P:=pfxsfx' 'S:=pfxsfx' 'q=pfxsfx' 'r:=pfxsfx' 'R:=pfxsfx' \ + 'W:=prepaths' 'F:=ignore' 'M+:=matcher' \ + J+: V+: X+: 1: 2: n: 'f=tmp1' '/=tmp1' 'g+:-=tmp1' + +sopt="-${(@j::M)${(@)tmp1#-}#?}" +(( $tmp1[(I)-[/g]*] )) && haspats=yes +(( $tmp1[(I)-g*] )) && gopt=yes +if (( $tmp1[(I)-/] )); then + pats=( '*(-/)' ${=${(M)tmp1:#-g*}#-g} ) +else + pats=( "${(@)=${(@M)tmp1:#-g*}#-g}" ) +fi +pats=( "${(@)pats:# #}" ) + +if (( $#prepaths )); then + tmp1="${prepaths[2]}" + if [[ "$tmp1[1]" = '(' ]]; then + prepaths=( ${^=tmp1[2,-2]%/}/ ) + elif [[ "$tmp1[1]" = '/' ]]; then + prepaths=( "${tmp1%/}/" ) + else + prepaths=( ${(P)^tmp1%/}/ ) + (( ! $#prepaths )) && prepaths=( ${tmp1%/}/ ) + fi + (( ! $#prepaths )) && prepaths=( '' ) +else + prepaths=( '' ) +fi + +if (( $#ignore )); then + if [[ "${ignore[2]}" = \(* ]]; then + ignore=( ${=ignore[2][2,-2]} ) + else + ignore=( ${(P)ignore[2]} ) + fi +fi # If we were given no file selection option, we behave as if we were given # a `-f'. -if [[ "$sopt" = - ]]; then +if [[ "$sopt" = -(f|) ]]; then if [[ -z "$gopt" ]]; then sopt='-f' pats=('*') @@ -88,224 +67,472 @@ if [[ "$sopt" = - ]]; then fi fi -# str holds the whole string from the command line with a `*' between -# the prefix and the suffix. - -str="${PREFIX:q}*${SUFFIX:q}" - -# If the string began with a `~', the quoting turned this into `\~', -# remove the slash. +if (( ! $mopts[(I)-[JVX]] )); then + local expl -[[ "$str" = \\\~* ]] && str="$str[2,-1]" - -# We will first try normal completion called with `complist', but only if we -# weren't given a `-F' option. - -if (( ! $#ignore )); then - # First build an array containing the `-W' option, if there is any and we - # want to use it. We don't want to use it if the string from the command line - # is a absolute path or relative to the current directory. - - if [[ -z "$tmp1[1]" || "$str[1]" = [~/] || "$str" = (.|..)/* ]]; then - tmp1=() + if [[ -z "$gopt" && "$sopt" = -/ ]]; then + _description directories expl directory else - tmp1=(-W "( $prepaths )") + _description files expl file + fi + tmp1=$expl[(I)-M*] + if (( tmp1 )); then + if (( $#matcher )); then + matcher[2]="$matcher[2] $expl[1+tmp1]" + else + matcher=(-M "$expl[1+tmp1]") + fi fi + mopts=( "$mopts[@]" "$expl[@]" ) +fi - # Now call complist. +if zstyle -s ":completion:${curcontext}:files" sort tmp1; then + case "$tmp1" in + *size*) sort=oL;; + *links*) sort=ol;; + *(time|date|modi)*) sort=om;; + *access*) sort=oa;; + *(inode|change)*) sort=oc;; + *) sort=on;; + esac + [[ "$tmp1" = *rev* ]] && sort[1]=O - nm=$NMATCHES - if [[ -z "$gopt" ]]; then - complist "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" "$tmp1[@]" $sopt + if [[ "$sort" = on ]]; then + sort='' else - complist "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" "$tmp1[@]" $sopt -g "$pats" + mopts=( "${(@)mopts/#-J/-V}" ) + + tmp2=() + for tmp1 in "$pats[@]"; do + if [[ "$tmp1" = (#b)(?*)(\(\([^\|~]##\)\)) ]]; then + tmp2=( "$tmp2[@]" "${match[1]}((${sort}${match[2][3,-1]}" ) + elif [[ "$tmp1" = (#b)(?*)(\([^\|~]##\)) ]]; then + tmp2=( "$tmp2[@]" "${match[1]}(${sort}${match[2][2,-1]}" ) + else + tmp2=( "$tmp2[@]" "${tmp1}(${sort})" ) + fi + done + pats=( "$tmp2[@]" ) fi +fi + +# Check if we have to skip over sequences of slashes. The value of $skips +# is used below to match the pathname components we always have to accept +# immediatly. + +if zstyle -t ":completion:${curcontext}:paths" squeeze-slashes; then + skips='((.|..|)/)##' +else + skips='((.|..)/)##' +fi + +# We get the prefix and the suffix from the line and save the whole +# original string. Then we see if we will do menucompletion. + +pre="$PREFIX" +suf="$SUFFIX" +opre="$PREFIX" +osuf="$SUFFIX" +orig="${PREFIX}${SUFFIX}" +eorig="$orig" - # If this generated any matches, we don't want to do in-path completion. +[[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" || + ( -n "$compstate[pattern_match]" && + "${orig#\~}" != "${${orig#\~}:q}" ) ]] && menu=yes - [[ -nmatches nm ]] || return +# If given no `-F' option, we may want to use $fignore, turned into patterns. - # No `-F' option, so we want to use `fignore'. +[[ -z "$_comp_no_ignore" && $#ignore -eq 0 && + ( -z $gopt || "$pats" = \ #\*\ # ) && -n $FIGNORE ]] && + ignore=( "?*${^fignore[@]}" ) - ignore=(-F fignore) +if (( $#ignore )); then + _comp_ignore=( "$_comp_ignore[@]" "$ignore[@]" ) + (( $mopts[(I)-F] )) || mopts=( "$mopts[@]" -F _comp_ignore ) fi +(( $#matcher )) && mopts=( "$mopts[@]" "$matcher[@]" ) + # Now let's have a closer look at the string to complete. -if [[ "$str[1]" = \~ ]]; then +if [[ "$pre[1]" = \~ ]]; then # It begins with `~', so remember anything before the first slash to be able # to report it to the completion code. Also get an expanded version of it # (in `realpath'), so that we can generate the matches. Then remove that # prefix from the string to complete, set `donepath' to build the correct # paths and make sure that the loop below is run only once with an empty # prefix path by setting `prepaths'. - - linepath="${str%%/*}/" - eval realpath\=$linepath - str="${str#*/}" + + linepath="${pre[2,-1]%%/*}" + if [[ -z "$linepath" ]]; then + realpath="${HOME%/}/" + elif (( $+userdirs[$linepath] )); then + realpath="${userdirs[$linepath]%/}/" + elif (( $+nameddirs[$linepath] )); then + realpath="${nameddirs[$linepath]%/}/" + else + _message "unknown user \`$linepath'" + return 1 + fi + linepath="~${linepath}/" + [[ "$realpath" = "$linepath" ]] && return 1 + pre="${pre#*/}" + orig="${orig#*/}" + donepath='' + prepaths=( '' ) +elif [[ "$pre" = *\$*/* ]]; then + + # If there is a parameter expansion in the word from the line, we try + # to complete the beast by expanding the prefix and completing anything + # after the first slash after the parameter expansion. + # This fails for things like `f/$foo/b/<TAB>' where the first `f' is + # meant as a partial path. + + linepath="${(M)pre##*\$[^/]##/}" + realpath=${(e)~linepath} + [[ "$realpath" = "$linepath" ]] && return 1 + pre="${pre#${linepath}}" + i="${#linepath//[^\\/]}" + orig="${orig[1,(in:i:)/][1,-2]}" donepath='' prepaths=( '' ) else # If the string does not start with a `~' we don't remove a prefix from the # string. - liniepath='' + linepath='' realpath='' - if [[ "$str[1]" = / ]]; then + if [[ "$pre[1]" = / ]]; then # If it is a absolut path name, we remove the first slash and put it in # `donepath' meaning that we treat it as the path that was already handled. # Also, we don't use the paths from `-W'. - str="$str[2,-1]" + pre="$pre[2,-1]" + orig="$orig[2,-1]" donepath='/' prepaths=( '' ) else # The common case, we just use the string as it is, unless it begins with # `./' or `../' in which case we don't use the paths from `-W'. - [[ "$str" = (.|..)/* ]] && prepaths=( '' ) + [[ "$pre" = (.|..)/* ]] && prepaths=( '' ) donepath='' fi fi -# First we skip over all pathname components in `str' which really exist in -# the file-system, so that `/usr/lib/l<TAB>' doesn't offer you `lib' and -# `lib5'. Pathname components skipped this way are taken from `str' and added -# to `donepath'. +# Now we generate the matches. First we loop over all prefix paths given +# with the `-W' option. -while [[ "$str" = */* ]] do - [[ -e "$realpath$donepath${str%%/*}" ]] || break - donepath="$donepath${str%%/*}/" - str="${str#*/}" -done +for prepath in "$prepaths[@]"; do -# Now build the glob pattern by calling `_match_pattern'. -patstr="$str" -matchflags="" -_match_pattern _path_files patstr matchflags + # Get local copies of the prefix, suffix, and the prefix path to use + # in the following loop, which walks through the pathname components + # in the string from the line. -# We almost expect the pattern to have changed `..' into `*.*.', `/.' into -# `/*.', and probably to contain two or more consecutive `*'s. Since these -# have special meaning for globbing, we remove them. But before that, we -# add the pattern for matching any characters before a slash. + tpre="$pre" + tsuf="$suf" + testpath="$donepath" -patstr="$patstr:gs-/-*/-:gs/*.*.//:gs-/*.-/.-:gs/**/*/" + tmp2="${(M)tpre##${~skips}}" + tpre="${tpre#$tmp2}" -# Finally, generate the matches. First we loop over all the paths from `-W'. -# Note that in this loop `str' is used as a modifyable version of `patstr' -# and `testpath' is a modifyable version of `donepath'. + tmp1=( "$prepath$realpath$donepath$tmp2" ) -for prepath in "$prepaths[@]"; do - str="$patstr" - testpath="$donepath" + while true; do - # The second loop tests the components of the path in `str' to get the - # possible matches. + # Get the prefix and suffix for matching. - while [[ "$str" = */* ]] do - # `rest' is the pathname after the first slash that is left. In `tmp1' - # we get the globbing matches for the pathname component currently - # handled. + if [[ "$tpre" = */* ]]; then + PREFIX="${tpre%%/*}" + SUFFIX="" + else + PREFIX="${tpre}" + SUFFIX="${tsuf%%/*}" + fi - rest="${str#*/}" - tmp1="${prepath}${realpath}${testpath}${~matchflags}${str%%/*}(-/)" - tmp1=( $~tmp1 ) + # Get the matching files by globbing. - if [[ $#tmp1 -eq 0 ]]; then - # If this didn't produce any matches, we don't need to test this path - # any further, so continue with the next `-W' path, if any. + tmp2=( "$tmp1[@]" ) + if [[ "$tpre$tsuf" = */* ]]; then + if [[ ! -o globdots && "$PREFIX" = .* ]]; then + tmp1=( ${^tmp1}${skipped}*(-/) ${^tmp1}${skipped}.*(-/) ) + else + tmp1=( ${^tmp1}${skipped}*(-/) ) + fi + if [[ -o globdots || "$PREFIX" = .* ]] && + zstyle -s ":completion:${curcontext}:paths" special-dirs atmp; then + if [[ "$atmp" = (yes|true|1|on) ]]; then + tmp1=( "$tmp1[@]" . .. ) + elif [[ "$atmp" = .. ]]; then + tmp1=( "$tmp1[@]" .. ) + fi + fi + else + if [[ ! -o globdots && "$PREFIX" = .* ]]; then + tmp1=( ${^tmp1}${skipped}${^~pats} ${^tmp1}${skipped}.${^~pats:#.*} ) + else + tmp1=( ${^tmp1}${skipped}${^~pats} ) + fi + if [[ "$sopt" = *[/f]* && ( -o globdots || "$PREFIX" = .* ) ]] && + zstyle -s ":completion:${curcontext}:paths" special-dirs atmp; then + if [[ "$atmp" = (yes|true|1|on) ]]; then + tmp1=( "$tmp1[@]" . .. ) + elif [[ "$atmp" = .. ]]; then + tmp1=( "$tmp1[@]" .. ) + fi + fi + fi - continue 2 - elif [[ $#tmp1 -gt 1 ]]; then - # If it produced more than one match, we want to remove those which - # don't have possible following pathname components matching the - # rest of the string we are completing. (The case with only one - # match is handled below.) - # In `collect' we will collect those of the produced pathnames that - # have a matching possible path-suffix. In `suffixes' we build an - # array containing strings build from the rest of the string to - # complete and the glob patterns we were given as arguments. - - collect=() - suffixes=( $rest$^pats ) - suffixes=( "${(@)suffixes:gs.**.*.}" ) - - # In the loop the prefixes from the `tmp1' array produced above and - # the suffixes we just built are used to produce possible matches - # via globbing. - - for i in $tmp1; do - tmp2=( ${~i}/${~matchflags}${~suffixes} ) - [[ $#tmp2 -ne 0 ]] && collect=( $collect $i ) - done - - # If this test showed that none of the matches from the glob in `tmp1' - # has a possible sub-path matching what's on the line, we give up and - # continue with the next `-W' path. - - if [[ $#collect -eq 0 ]]; then + if [[ -n "$PREFIX$SUFFIX" ]]; then + # See which of them match what's on the line. + + if [[ -n "$_comp_correct" ]]; then + tmp2=( "$tmp1[@]" ) + builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}" + + if [[ $#tmp1 -eq 0 ]]; then + tmp1=( "$tmp2[@]" ) + compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp2:t}" + fi + else + [[ "$tmp1[1]" = */* ]] && tmp2=( "$tmp1[@]" ) + + builtin compadd -D tmp1 -F _comp_ignore "$matcher[@]" - "${(@)tmp1:t}" + fi + + # If no file matches, save the expanded path and continue with + # the outer loop. + + if (( ! $#tmp1 )); then + if [[ "$tmp2[1]" = */* ]]; then + tmp2=( "${(@)tmp2#${prepath}${realpath}}" ) + if [[ "$tmp2[1]" = */* ]]; then + tmp2=( "${(@)tmp2:h}" ) + compquote tmp2 + if [[ "$tmp2" = */ ]]; then + exppaths=( "$exppaths[@]" ${^tmp2}${tpre}${tsuf} ) + else + exppaths=( "$exppaths[@]" ${^tmp2}/${tpre}${tsuf} ) + fi + else + exppaths=( "$exppaths[@]" ${tpre}${tsuf} ) + fi + fi continue 2 - elif [[ $#collect -ne 1 ]]; then - # If we have more than one possible match, this means that the - # pathname component currently handled is ambiguous, so we give - # it to the completion code. - # First we build the full path prefix in `tmp1'. + fi + elif (( ! $#tmp1 )); then + # A little extra hack: if we were completing `foo/<TAB>' and `foo' + # contains no files, this will normally produce no matches and other + # completers might think that's it's their time now. But if the next + # completer is _correct or something like that, this will result in + # an attempt to correct a valid directory name. So we just add the + # original string in such a case so that the command line doesn't + # change but other completers still think there are matches. + # We do this only if we weren't given a `-g' or `-/' option because + # otherwise this would keep `_files' from completing all filenames + # if none of the patterns match. + + if [[ -z "$tpre$tsuf" && -n "$pre$suf" ]]; then + pfxsfx=(-S '' "$pfxsfx[@]") + ### Don't remember what the break was good for. We explicitly + ### execute this only when there are no matches in the directory, + ### so why continue? + ### + ### tmp1=( "$tmp2[@]" ) + ### break + elif [[ "$haspats" = no && -z "$tpre$tsuf" && + "$pre" = */ && -z "$suf" ]]; then + PREFIX="${opre}" + SUFFIX="${osuf}" + compadd -nQS '' - "$linepath$donepath$orig" + tmp4=- + fi + continue 2 + fi - tmp1="$prepath$realpath$testpath" + if [[ -z "$_comp_no_ignore" && "$tpre$tsuf" != */* && $#tmp1 -ne 0 ]] && + zstyle -s ":completion:${curcontext}:files" ignore-parents rem && + [[ ( "$rem" != *dir* || "$pats" = '*(-/)' ) && + ( "$rem" != *..* || "$tmp1" = *../* ) ]]; then + if [[ "$rem" = *parent* ]]; then + for i in ${(M)^tmp1:#*/*}(-/); do + remt="${${i#$prepath$realpath$donepath}%/*}" + while [[ "$remt" = */* && + ! "$prepath$realpath$donepath$remt" -ef "$i" ]]; do + remt="${remt%/*}" + done + [[ "$remt" = */* || "$remt" -ef "$i" ]] && + _comp_ignore=( "$_comp_ignore[@]" "${(q)i}" ) + done + fi + if [[ "$rem" = *pwd* ]]; then + for i in ${^tmp1}(-/); do + [[ "$i" -ef "$PWD" ]] && _comp_ignore=( "$_comp_ignore[@]" "${(q)i}" ) + done + fi + (( $#_comp_ignore && $mopts[(I)-F] )) || mopts=( "$mopts[@]" -F _comp_ignore ) + fi - # Now produce all matching pathnames in `collect'. + # Step over to the next component, if any. - collect=( ${~collect}/${~matchflags}${~suffixes} ) + if [[ "$tpre" = */* ]]; then + tpre="${tpre#*/}" + elif [[ "$tsuf" = */* ]]; then + tpre="${tsuf#*/}" + tsuf="" + else + break + fi - # And then remove the common path prefix from all these matches. + # There are more components, so skip over the next components and make a + # slash be added. - collect=( ${collect#$tmp1} ) + tmp2="${(M)tpre##((.|..|)/)##}" + if [[ -n "$tmp2" ]]; then + skipped="/$tmp2" + tpre="${tpre#$tmp2}" + else + skipped=/ + fi + done + + # The next loop searches the first ambiguous component. + + tmp3="$pre$suf" + tpre="$pre" + tsuf="$suf" + tmp1=( "${(@)tmp1#${prepath}${realpath}${testpath}}" ) - # Finally, we add all these matches with the common (unexpanded) - # pathprefix (the `-p' option), the path-prefix (the `-W' option) - # to allow the completion code to test file type, and the path- - # suffix (the `-s' option). We also tell the completion code that - # these are file names and that `fignore' should be used as usual - # (the `-f' and `-F' options). + while true; do - for i in $collect; do - compadd "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" -p "$linepath$testpath" -W "$tmp1" -s "/${i#*/}" -f "$ignore[@]" - "${i%%/*}" - done + # First we check if some of the files match the original string + # for this component. If there are some we remove all other + # names. This avoids having `foo' complete to `foo' and `foobar'. - # We have just finished handling all the matches from above, so we - # can continue with the next `-W' path. + if [[ "$tmp3" = */* ]]; then + tmp4=( "${(@M)tmp1:#${tmp3%%/*}/*}" ) + (( $#tmp4 )) && tmp1=( "$tmp4[@]" ) + fi + + # Next we see if this component is ambiguous. - continue 2 + if [[ "$tmp3" = */* ]]; then + tmp4=$tmp1[(I)^${(q)tmp1[1]%%/*}/*] + else + tmp4=$tmp1[(I)^${(q)tmp1[1]}] + fi + + if [[ "$tpre" = */* ]]; then + tmp2="${cpre}${tpre%%/*}" + PREFIX="${donepath}${linepath}${tmp2}" + SUFFIX="/${tpre#*/}${tsuf#*/}" + else + tmp2="${cpre}${tpre}" + PREFIX="${donepath}${linepath}${tmp2}" + SUFFIX="${tsuf}" + fi + + if (( tmp4 )) || + [[ -n "$compstate[pattern_match]" && "$tmp2" != "${(q)tmp2}" ]]; then + # It is. For menucompletion we now add the possible completions + # for this component with the unambigous prefix we have built + # and the rest of the string from the line as the suffix. + # For normal completion we add the rests of the filenames + # collected as the suffixes to make the completion code expand + # it as far as possible. + + tmp2="$testpath" + compquote tmp1 tmp2 + + if [[ -n $menu || -z "$compstate[insert]" ]] || + ! zstyle -t ":completion:${curcontext}:paths" expand suffix; then + (( tmp4 )) && zstyle -t ":completion:${curcontext}:paths" cursor && + compstate[to_end]='' + if [[ "$tmp3" = */* ]]; then + compadd -Qf "$mopts[@]" -p "$linepath$tmp2" -s "/${tmp3#*/}" \ + -W "$prepath$realpath$testpath" \ + "$pfxsfx[@]" -M "r:|/=* r:|=*" \ + - "${(@)tmp1%%/*}" + else + compadd -Qf "$mopts[@]" -p "$linepath$tmp2" \ + -W "$prepath$realpath$testpath" \ + "$pfxsfx[@]" -M "r:|/=* r:|=*" \ + - "$tmp1[@]" + fi + else + if [[ "$tmp3" = */* ]]; then + atmp=( -Qf "$mopts[@]" -p "$linepath$tmp2" + -W "$prepath$realpath$testpath" + "$pfxsfx[@]" -M "r:|/=* r:|=*" ) + for i in "$tmp1[@]"; do + compadd "$atmp[@]" -s "/${i#*/}" - "${i%%/*}" + done + else + compadd -Qf "$mopts[@]" -p "$linepath$tmp2" \ + -W "$prepath$realpath$testpath" \ + "$pfxsfx[@]" -M "r:|/=* r:|=*" \ + - "$tmp1[@]" + fi fi - # We reach this point if only one of the path prefixes in `tmp1' - # has a existing path-suffix matching the string from the line. - # In this case we accept this match and continue with the next - # path-name component. + tmp4=- + break + fi + + # If we have checked all components, we stop now and add the + # strings collected after the loop. - tmp1=( "$collect[1]" ) + if [[ "$tmp3" != */* ]]; then + tmp4="" + break fi - # This is also reached if the first globbing produced only one match - # in this case we just continue with the next pathname component, too. - tmp1="$tmp1[1]" - testpath="$testpath${tmp1##*/}/" - str="$rest" + # Otherwise we add the unambiguous component to `testpath' and + # take it from the filenames. + + testpath="${testpath}${tmp1[1]%%/*}/" + tmp1=( "${(@)tmp1#*/}" ) + + tmp3="${tmp3#*/}" + + if [[ "$tpre" = */* ]]; then + cpre="${cpre}${tpre%%/*}/" + tpre="${tpre#*/}" + elif [[ "$tsuf" = */* ]]; then + cpre="${cpre}${tpre}/" + tpre="${tsuf#*/}" + tsuf="" + else + tpre="" + tsuf="" + fi done - # We are here if all pathname components except the last one (which is still - # not tested) are unambiguous. So we add matches with the full path prefix, - # no path suffix, the `-W' we are currently handling, all the matches we - # can produce in this directory, if any. - - tmp1="$prepath$realpath$testpath" - suffixes=( $str$^pats ) - suffixes=( "${(@)suffixes:gs.**.*.}" ) - tmp2=( ${~tmp1}${~matchflags}${~suffixes} ) - if [[ $#tmp2 -eq 0 && "$sopt" = */* ]]; then - [[ "$testpath[-1]" = / ]] && testpath="$testpath[1,-2]" - compadd "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" -f - "$linepath$testpath" - else - compadd "$addpfx[@]" "$addsfx[@]" "$group[@]" "$expl[@]" -p "$linepath$testpath" -W "$prepath$realpath$testpath" -f "$ignore[@]" - ${(@)tmp2#$tmp1} + if [[ -z "$tmp4" ]]; then + if [[ "$osuf" = */* ]]; then + PREFIX="${opre}${osuf}" + SUFFIX="" + else + PREFIX="${opre}" + SUFFIX="${osuf}" + fi + tmp4="$testpath" + compquote tmp4 tmp1 + compadd -Qf "$mopts[@]" -p "$linepath$tmp4" -W "$prepath$realpath$testpath" \ + "$pfxsfx[@]" -M "r:|/=* r:|=*" - "$tmp1[@]" fi done + +# If we are configured to expand paths as far as possible and we collected +# expanded paths that are different from the string on the line, we add +# them as possible matches. + +if zstyle -t ":completion:${curcontext}:paths" expand prefix && + [[ nm -eq compstate[nmatches] && $#exppaths -ne 0 && + "$exppaths" != "$eorig" ]]; then + PREFIX="${opre}" + SUFFIX="${osuf}" + compadd -Q "$mopts[@]" -S '' -M "r:|/=* r:|=*" -p "$linepath" - "$exppaths[@]" +fi + +[[ nm -ne compstate[nmatches] ]] diff --git a/Completion/Core/_prefix b/Completion/Core/_prefix index 6306b4aa0..f6e3b0831 100644 --- a/Completion/Core/_prefix +++ b/Completion/Core/_prefix @@ -4,10 +4,10 @@ [[ -n "$SUFFIX" ]] || return 1 -local curcontext="${curcontext/:[^:]#:/:prefix:}" comp i +local comp i zstyle -a ":completion:${curcontext}:" completer comp || - comp=( "${(@)_completers[1,-${#_completers_left}-1][(R)_prefix,-1]}" ) + comp=( "${(@)_completers[1,_completer_num-1][(R)_prefix(|:*),-1]}" ) if zstyle -t ":completion:${curcontext}:" add-space; then ISUFFIX=" $SUFFIX" diff --git a/Completion/Core/_requested b/Completion/Core/_requested index 082c45820..bd838a28e 100644 --- a/Completion/Core/_requested +++ b/Completion/Core/_requested @@ -1,9 +1,20 @@ #autoload -local tag tname="$funcstack[2,-1]" +local gopt=-J -for tag; do - [[ "${_cur_tags[${tname}]}" = *:${tag}(:|\[*\]:)* ]] && return 0 -done +if [[ "$1" = -([12]|)[VJ] ]]; then + gopt="$1" + shift +fi -return 1 +if comptags -R "$1"; then + _comp_tags="$_comp_tags $1" + if [[ $# -gt 3 ]]; then + _all_labels "$gopt" "$@" + elif [[ $# -gt 1 ]]; then + _description "$gopt" "$@" + fi + return 0 +else + return 1 +fi diff --git a/Completion/Core/_setup b/Completion/Core/_setup index f12c34b34..ed7307e69 100644 --- a/Completion/Core/_setup +++ b/Completion/Core/_setup @@ -1,13 +1,61 @@ #autoload -local colors i - -for i; do - if _style -a "$i" list-colors colors; then - if [[ "$1" = default ]]; then - ZLS_COLORS="${(j.:.)${(@)colors:gs/:/\\\:}}" - else - eval "ZLS_COLORS=\"(${i})\${(j.:(${i}).)\${(@)colors:gs/:/\\\:}}:\${ZLS_COLORS}\"" - fi +local val nm="$compstate[nmatches]" + +if zstyle -a ":completion:${curcontext}:$1" list-colors val; then + zmodload -i zsh/complist + if [[ "$1" = default ]]; then + ZLS_COLORS="${(j.:.)${(@)val:gs/:/\\\:}}" + else + eval "ZLS_COLORS=\"(${1})\${(j.:(${1}).)\${(@)val:gs/:/\\\:}}:\${ZLS_COLORS}\"" fi -done + +# Here is the problem mentioned in _main_complete. + +# elif [[ "$1" = default && -n "$ZLS_COLORS$ZLS_COLOURS" ]]; then +# zmodload -i zsh/complist +# ZLS_COLORS="$ZLS_COLORS$ZLS_COLOURS" + +fi + +if zstyle -t ":completion:${curcontext}:$1" list-packed; then + compstate[list]="${compstate[list]} packed" +elif [[ $? -eq 1 ]]; then + compstate[list]="${compstate[list]:gs/packed//}" +else + compstate[list]="$_saved_list" +fi + +if zstyle -t ":completion:${curcontext}:$1" list-rows-first; then + compstate[list]="${compstate[list]} rows" +elif [[ $? -eq 1 ]]; then + compstate[list]="${compstate[list]:gs/rows//}" +else + compstate[list]="$_saved_list" +fi + +if zstyle -t ":completion:${curcontext}:$1" last-prompt; then + compstate[last_prompt]=yes +elif [[ $? -eq 1 ]]; then + compstate[last_prompt]='' +else + compstate[last_prompt]="$_saved_lastprompt" +fi + +if zstyle -t ":completion:${curcontext}:$1" accept-exact; then + compstate[exact]=accept +elif [[ $? -eq 1 ]]; then + compstate[exact]='' +else + compstate[exact]="$_saved_exact" +fi + +[[ _last_nmatches -ge 0 && _last_nmatches -ne nm ]] && + _menu_style=( "$_last_menu_style[@]" "$_menu_style[@]" ) + +if zstyle -a ":completion:${curcontext}:$1" menu val; then + _last_nmatches=$nm + _last_menu_style=( "$val[@]" ) +else + _last_nmatches=-1 +fi diff --git a/Completion/Core/_tags b/Completion/Core/_tags index af8dc21dd..496f5b7e0 100644 --- a/Completion/Core/_tags +++ b/Completion/Core/_tags @@ -1,81 +1,83 @@ #autoload -if (( $# )); then - local cmd="$words[1]" func="$funcstack[2]" defs i tags tag pat style prio - - while getopts 'c:f:' i; do - if [[ "$i" = c ]]; then - cmd="$OPTARG" - else - func="$OPTARG" - fi - done - - shift OPTIND-1 - - defs=( "${(@M)argv:#${(kj:|:)~override_tags[(R)(|+*)]}}" ) - (( $#defs )) && set -- "$defs[@]" - - _offered_tags=( "$_offered_tags[@]" "$@" ) - _last_tags=() - - defs=() - for i; do - if [[ -n ${override_tags[$i]} && ${override_tags[$i]} != (\[|+\[)* ]]; then - if [[ ${override_tags[$i]} = *\[* ]]; then - prio=( "${i}:*=${override_tags[$i]#+}" ) - else - prio=( "${i}:${(@v)^comptags[(I)(|*:)${i}(|:*)]}" ) - (( $#prio )) || prio=( "${i}:${comptags[any]}" ) - prio="${${${prio[(r)(|*:)\*=[^:]#\[*\](|:*)]}##(|*:)\*}%%:*}" - prio=( "${i}:*=${override_tags[$i]#+}${(M)prio%%\[*\]}" ) - fi - else - prio=( "${i}:${(@v)^comptags[(I)(|*:)${i}(|:*)]}" ) - (( $#prio )) || prio=( "${i}:${comptags[any]}" ) - fi - defs=( "$defs[@]" "$prio[@]" ) - done - - tags=() - for i in "$defs[@]"; do - tag="${i%%:*}" - for pat in "${(s.:.)i#*:}"; do - if [[ ( "$pat" = _* && "$func" = ${~pat%%\=*} ) || - "$cmd" = ${~pat%%\=*} ]]; then - prio="${pat#*\=}" - [[ "$prio" = -* ]] && continue 2 - - if [[ "$prio" = *\[*\] ]]; then - style="${(M)prio%%\[*}" - prio="${prio%%\[*}" - else - style='' - fi - [[ ${override_tags[$tag]} = (|+)\[* ]] && - style="${override_tags[$tag]#+}" - - (( prio++ )) - - tags[$prio]="${tags[$prio]}:${tag}${style}" - break - fi - done - done +local prev - prios=( "${(@)tags:#}" ) +# A `--' as the first argument says that we should tell comptags to use +# the preceding function nesting level. This is only documented here because +# if everythings goes well, users won't have to worry about it and should +# not mess with it. - return 0 +if [[ "$1" = -- ]]; then + prev=- + shift fi -_failed_tags=( "$_failed_tags[@]" "$_last_tags[@]" ) +if (( $# )); then + + # We have arguments: the tags supported in this context. + + local curcontext="$curcontext" order tag nodef tmp + + if [[ "$1" = -C?* ]]; then + curcontext="${curcontext%:*}:${1[3,-1]}" + shift + elif [[ "$1" = -C ]]; then + curcontext="${curcontext%:*}:${2}" + shift 2 + else + targs=() + fi + + [[ "$1" = -(|-) ]] && shift -(( $#prios )) || return 1 + if zstyle -a ":completion:${curcontext}:" group-order order; then + local name -tags="${prios[1]}:" -shift 1 prios + for name in "$order[@]"; do + compadd -J "$name" + compadd -V "$name" + compadd -J "$name" -1 + compadd -V "$name" -1 + compadd -J "$name" -2 + compadd -V "$name" -2 + done + fi + + # Set and remember offered tags. + + comptags "-i$prev" "$curcontext" "$@" + + # Sort the tags. + + if [[ -n "$_sort_tags" ]]; then + "$_sort_tags" "$@" + else + zstyle -a ":completion:${curcontext}:" tag-order order || + order=('arguments values' options) + + for tag in $order; do + case $tag in + -) nodef=yes;; + *\(\)) if ! "${${tag%%[ ]#\(\)}##[ ]#}" "$@"; then + nodef=yes + break + fi + ;; + \!*) comptry "${(@)argv:#(${(j:|:)~${=~tag[2,-1]}})}";; + ?*) comptry -m "$tag";; + esac + done + + [[ -z "$nodef" ]] && comptry "$@" + fi + + # Return non-zero if at least one set of tags should be used. + + comptags "-T$prev" + + return +fi -_last_tags=( "${(@s.:.)${${tags#:}%:}}" ) -_tried_tags=( "$_tried_tags[@]" "$_last_tags[@]" ) +# The other mode: switch to the next set of tags. -return 0 +comptags "-N$prev" diff --git a/Completion/Core/_wanted b/Completion/Core/_wanted index 7baa3e724..32875ec57 100644 --- a/Completion/Core/_wanted +++ b/Completion/Core/_wanted @@ -1,6 +1,6 @@ #autoload -local targs +local targs gopt=-J if [[ "$1" = -C?* ]]; then targs=( -C "${1[3,-1]}" ) @@ -12,10 +12,22 @@ else targs=() fi -[[ "$1" = -(|-) ]] && shift +if [[ "$1" = -([12]|)[VJ] ]]; then + gopt="$1" + shift +fi + +if [[ $# -gt 3 ]]; then + if _tags "$targs[@]" "$1"; then + _comp_tags="$_comp_tags $1" -if [[ $# -gt 1 ]]; then - _tags "$targs[@]" "$1" && _description "${(@)argv[2,-1]}" + _all_labels -t "$gopt" "$@" + else + return 1 + fi +elif [[ $# -gt 1 ]]; then + _tags -- "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" && + _description "$gopt" "$@" else - _tags "$targs[@]" "$1" + _tags -- "$targs[@]" "$1" && _comp_tags="$_comp_tags $1" fi diff --git a/Completion/Core/compdump b/Completion/Core/compdump index 8be096f50..3cccbd06e 100644 --- a/Completion/Core/compdump +++ b/Completion/Core/compdump @@ -1,4 +1,4 @@ -# This is a file to be sourced to dump the definitions for new-style +# This is a function to dump the definitions for new-style # completion defined by 'compinit' in the same directory. The output # should be directed into the "compinit.dump" in the same directory as # compinit. If you rename init, just stick .dump onto the end of whatever @@ -9,33 +9,46 @@ # To do this, simply remove the .dump file, start a new shell, and # create the .dump file as before. Again, compinit -d handles this # automatically. -# -# It relies on KSH_ARRAYS not being set. # Print the number of files used for completion. This is used in compinit # to see if auto-dump should re-dump the dump-file. -_d_file=${COMPDUMP-${0:h}/compinit.dump} +emulate -L zsh +setopt extendedglob + +typeset _d_file _d_f _d_bks _d_line _d_als + +_d_file=${_comp_dumpfile-${0:h}/compinit.dump}.$HOST.$$ typeset -U _d_files -_d_files=( ${^~fpath}/_*~*~(N:t) ) +_d_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N:t) ) print "#files: $#_d_files" > $_d_file -unset _d_files - # First dump the arrays _comps and _patcomps. The quoting hieroglyphyics # ensure that a single quote inside a variable is itself correctly quoted. print "_comps=(" >> $_d_file for _d_f in ${(ok)_comps}; do - print -r - "'${_d_f//\'/'\\''}'" "'${_comps[$_d_f]//\'/'\\''}'" + print -r - "${(q)_d_f}" "${(q)_comps[$_d_f]}" done >> $_d_file print ")" >> $_d_file print "\n_patcomps=(" >> $_d_file -for _d_f in "$_patcomps[@]"; do - print -r - "'${_d_f//\'/'\\''}'" +for _d_f in "${(ok@)_patcomps}"; do + print -r - "${(q)_d_f}" "${(q)_patcomps[$_d_f]}" +done >> $_d_file +print ")" >> $_d_file + +print "\n_postpatcomps=(" >> $_d_file +for _d_f in "${(ok@)_postpatcomps}"; do + print -r - "${(q)_d_f}" "${(q)_postpatcomps[$_d_f]}" +done >> $_d_file +print ")" >> $_d_file + +print "\n_compautos=(" >> $_d_file +for _d_f in "${(ok@)_compautos}"; do + print -r - "${(q)_d_f}" "${(q)_compautos[$_d_f]}" done >> $_d_file print ")" >> $_d_file @@ -44,11 +57,13 @@ print >> $_d_file # Now dump the key bindings. We dump all bindings for zle widgets # whose names start with a underscore. # We need both the zle -C's and the bindkey's to recreate. +# We can ignore any zle -C which rebinds a standard widget (second +# argument to zle does not begin with a `_'). _d_bks=() zle -lL | while read -rA _d_line; do - if [[ ${_d_line[5]} = _* ]]; then + if [[ ${_d_line[3]} = _* && ${_d_line[5]} = _* ]]; then print -r - ${_d_line} _d_bks=($_d_bks ${_d_line[3]}) fi @@ -73,17 +88,26 @@ done)) # print them out: about five to a line looks neat +_i=5 +print -n autoload -U >> $_d_file while (( $#_d_als )); do - print -n autoload - for (( _i = 0; _i < 5; _i++ )); do - if (( $#_d_als )); then - print -n " $_d_als[1]" - shift _d_als + if (( ! $+_compautos[$_d_als[1]] )); then + print -n " $_d_als[1]" + if (( _i-- && $#_d_als > 1 )); then + _i=5 + print -n '\nautoload -U' fi - done - print + fi + shift _d_als done >> $_d_file print >> $_d_file -unset _d_line _d_zle _d_bks _d_als _d_f _f_file +for _i in "${(ok@)_compautos}"; do + print "autoload -U $_compautos[$_i] $_i" >> $_d_file +done + +mv $_d_file ${_d_file%.$HOST.$$} + +unfunction compdump +autoload -U compdump diff --git a/Completion/Core/compinit b/Completion/Core/compinit index ec5867838..6a35d17a7 100644 --- a/Completion/Core/compinit +++ b/Completion/Core/compinit @@ -1,25 +1,23 @@ # Initialisation for new style completion. This mainly contains some helper -# function and aliases. Everything else is split into different files in this -# directory that will automatically be made autoloaded (see the end of this -# file). +# functions and aliases. Everything else is split into different files that +# will automatically be made autoloaded (see the end of this file). # The names of the files that will be considered for autoloading have to -# start with a underscores (like `_setopt). +# start with an underscores (like `_setopt'). # The first line of these files will be read and has to say what should be # done with its contents: # -# `#defcomp <names ...>' -# if the first line looks like this, the file is -# autoloaded as a function and that function will -# be called to generate the matches when completing -# for one of the commands whose <name> is given +# `#compdef <names ...>' +# If the first line looks like this, the file is autoloaded as a +# function and that function will be called to generate the matches +# when completing for one of the commands whose <names> are given. # -# `#defpatcomp <pattern>' -# this defines a function that should be called to generate -# matches for commands whose name matches <pattern>; note -# that only one pattern may be given +# `#compdef -p <pattern>' +# This defines a function that should be called to generate matches +# for commands whose name matches <pattern>. Note that only one pattern +# may be given. # -# `#defkeycomp <style> [ <key-sequence> ... ] -# this is used to bind special completions to all the given +# `#compdef -k <style> [ <key-sequence> ... ]' +# This is used to bind special completions to all the given # <key-sequence>(s). The <style> is the name of one of the built-in # completion widgets (complete-word, delete-char-or-list, # expand-or-complete, expand-or-complete-prefix, list-choices, @@ -29,35 +27,89 @@ # rather than by the context. The widget has the same name as # the autoload file and can be bound using bindkey in the normal way. # -# `#autoload' -# this is for helper functions that are not used to +# `#compdef -K <widget-name> <style> <key-sequence> [ ... ]' +# This is similar to -k, except it takes any number of sets of +# three arguments. In each set, the widget <widget-name> will +# be defined, which will behave as <style>, as with -k, and will +# be bound to <key-sequence>, exactly one of which must be defined. +# <widget-name> must be different for each: this must begin with an +# underscore, else one will be added, and should not clash with other +# completion widgets (names based on the name of the function are the +# clearest), but is otherwise arbitrary. It can be tested in the +# function by the parameter $WIDGET. +# +# `#autoload [ <options> ]' +# This is for helper functions that are not used to # generate matches, but should automatically be loaded -# when they are called +# when they are called. The <options> will be given to the +# autoload builtin when making the function autoloaded. Note +# that this need not include `-U'. # # Note that no white space is allowed between the `#' and the rest of # the string. # -# See the file `compdump' for how to speed up initialiation. -# -# If you are using global matching specifications with `compctl -M ...' -# have a look at the files `_match_test' and `_match_pattern'. To make -# all the example functions use matching as specified with `-M' these -# need some editing. +# Functions that are used to generate matches should return zero if they +# were able to add matches and non-zero otherwise. # +# See the file `compdump' for how to speed up initialisation. + # If we got the `-d'-flag, we will automatically dump the new state (at -# the end). +# the end). This takes the dumpfile as an argument. -d (with the +# default dumpfile) is now the default; to turn off dumping use -D. + +emulate -L zsh +setopt extendedglob + +typeset _i_dumpfile _i_files _i_line _i_done _i_dir _i_autodump=1 +typeset _i_tag _i_file _i_addfiles + +while [[ $# -gt 0 && $1 = -[dDf] ]]; do + if [[ "$1" = -d ]]; then + _i_autodump=1 + shift + if [[ $# -gt 0 && "$1" != -[df] ]]; then + _i_dumpfile="$1" + shift + fi + elif [[ "$1" = -D ]]; then + _i_autodump=0 + shift + elif [[ "$1" = -f ]]; then + # Not used any more; use _compdir + shift + shift + fi +done -if [[ "$1" = -d ]]; then - _i_autodump=1 +# The associative array containing the definitions for the commands. +# Definitions for patterns will be stored in the associations `_patcomps' +# and `_postpatcomps'. `_compautos' contains the names and options +# for autoloaded functions that get options. + +typeset -gA _comps _patcomps _postpatcomps _compautos + +# The associative array use to report information about the last +# cmpletion to the outside. + +typeset -gA _lastcomp + +# Remember dumpfile. +if [[ -n $_i_dumpfile ]]; then + # Explicitly supplied dumpfile. + _comp_dumpfile="$_i_dumpfile" else - _i_autodump=0 + _comp_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump" fi -# The associative array containing the definitions for the commands. -# Definitions for patterns will be stored in the normal array `_patcomps'. +# These can hold names of functions that are to be called before/after all +# matches have been generated. -typeset -A _comps -_patcomps=() +compprefuncs=() +comppostfuncs=() + +# Loading it now ensures that the `funcstack' parameter is always correct. + +: $funcstack # This function is used to register or delete completion functions. For # registering completion functions, it is invoked with the name of the @@ -70,6 +122,9 @@ _patcomps=() # function will be invoked when completing for a command whose name # matches the pattern given as argument after the function name (in this # case only one argument is accepted). +# The option `-P' is like `-p', but the function will be called after +# trying to find a function defined for the command on the line if no +# such function could be found. # With the `-k' option a function for a special completion keys is # defined and immediatly bound to those keys. Here, the extra arguments # are the name of one of the builtin completion widgets and any number @@ -78,7 +133,8 @@ _patcomps=() # whose name is given as the first argument be autoloaded. When defining # a function for command names the `-n' option may be given and keeps # the definitions from overriding any previous definitions for the -# commands. +# commands; with `-k', the `-n' option prevents compdef from rebinding +# a key sequence which is already bound. # For deleting definitions, the `-d' option must be given. Without the # `-p' option, this deletes definitions for functions for the commands # whose names are given as arguments. If combined with the `-p' option @@ -110,11 +166,16 @@ compdef() { # Get the options. - while getopts "anpkd" opt; do + if [[ $#* -eq 0 ]]; then + echo "compdef needs parameters" + return 1 + fi + + while getopts "anpPkKd" opt; do case "$opt" in a) autol=yes;; n) new=yes;; - [pk]) if [[ -n "$type" ]]; then + [pPkK]) if [[ -n "$type" ]]; then # Error if both `-p' and `-k' are given (or one of them # twice). echo "$0: type already set to $type" @@ -122,6 +183,10 @@ compdef() { fi if [[ "$opt" = p ]]; then type=pattern + elif [[ "$opt" = P ]]; then + type=postpattern + elif [[ "$opt" = K ]]; then + type=widgetkey else type=key fi @@ -131,12 +196,17 @@ compdef() { done shift OPTIND-1 + if [[ $#* -eq 0 ]]; then + echo "compdef needs parameters" + return 1 + fi + if [[ -z "$delete" ]]; then # Adding definitions, first get the name of the function name # and probably do autoloading. func="$1" - [[ -n "$autol" ]] && autoload "$func" + [[ -n "$autol" ]] && autoload -U "$func" shift case "$type" in @@ -145,11 +215,33 @@ compdef() { echo "$0: only one pattern allowed" return 1 fi - # Patterns are stored in strings like `c* foo', with a space - # between the pattern and the function name. - - _patcomps=("$_patcomps[@]" "$1 $func") + _patcomps[$1]="$func" ;; + postpattern) + if [[ $# -gt 1 ]]; then + echo "$0: only one pattern allowed" + return 1 + fi + _postpatcomps[$1]="$func" + ;; + widgetkey) + while [[ -n $1 ]]; do + if [[ $# -lt 3 ]]; then + echo "$0: compdef -K requires <widget> <comp-widget> <key>" + return 1 + fi + [[ $1 = _* ]] || 1="_$1" + [[ $2 = .* ]] || 2=".$2" + zle -C "$1" "$2" "$func" + if [[ -n $new ]]; then + bindkey "$3" | read -A opt + [[ $opt[-1] = undefined-key ]] && bindkey "$3" "$1" + else + bindkey "$3" "$1" + fi + shift 3 + done + ;; key) if [[ $# -lt 2 ]]; then echo "$0: missing keys" @@ -157,30 +249,44 @@ compdef() { fi # Define the widget. - zle -C "$func" "$1" "$func" + if [[ $1 = .* ]]; then + zle -C "$func" "$1" "$func" + else + zle -C "$func" ".$1" "$func" + fi shift # And bind the keys... for i; do + if [[ -n $new ]]; then + bindkey "$i" | read -A opt + [[ $opt[-1] = undefined-key ]] || continue + fi bindkey "$i" "$func" done ;; *) # For commands store the function name in the `_comps' # associative array, command names as keys. - for i; do - [[ -z "$new" || "${+_comps[$i]}" -eq 0 ]] && _comps[$i]="$func" - done + if [[ -z "$new" ]]; then + for i; do + _comps[$i]="$func" + done + else + for i; do + [[ "${+_comps[$i]}" -eq 0 ]] && _comps[$i]="$func" + done + fi ;; esac else # Handle the `-d' option, deleting. case "$type" in pattern) - # Note the space. - for i; do - _patcomps=("${(@)patcomps:#$i *}") - done + unset "_patcomps[$^@]" + ;; + postpattern) + unset "_postpatcomps[$^@]" ;; key) # Oops, cannot do that yet. @@ -189,81 +295,210 @@ compdef() { return 1 ;; *) - # Deleting definitons for command is even simpler. - for i; do - unset "_comps[$i]" - done + unset "_comps[$^@]" esac fi } -# Now we automatically make the definition files autoloaded. +# Do *not* use this... -# First we get the name of a dump file if this will be used. +compconf() { -: ${COMPDUMP:=$0.dump} + local style name val i tmp cmt -if [[ ! -o extendedglob ]]; then - _i_noextglob=yes - setopt extendedglob -fi + if [[ -z "$_compconf_warn" ]]; then + _compconf_warn=yep + + print " + +Hello + +\`compconf' will be removed in the near future, we now use a more +general (and powerful) mechanism using the \`zstyle' builtin. An +approximation to your old setup using \`zstyle' should be available +in the file: + + \`${HOME}/.zsh-styles' + +Note that the values for the styles may be partly incorrect. Please +read the manual to find out how to configure the completion system +with styles. + +Have fun + + Sven +" 1>&2 + command rm -f ${HOME}/.zsh-styles + fi + + for i; do + name="${i%%\=*}" + val="${i#*\=}" + + tmp='' + cmt='' + + case "$name" in + urls_path) + tmp="'*:urls' path ${(qq)val}" + ;; + urls_localhttp) + tmp="'*:urls' local ${${(qqs.:.)val}}" + ;; + describe_options) + tmp="'*:options' verbose 'yes'" + ;; + describe_values) + tmp="'*:values' verbose 'yes'" + ;; + autodescribe_options) + tmp="'*:options' auto-description ${(qq)val}" + ;; + description_format) + tmp="'*:descriptions' format ${(qq)val}" + ;; + message_format) + tmp="'*:messages' format ${(qq)val}" + ;; + warning_format) + tmp="'*:warnings' format ${(qq)val}" + ;; + option_prefix) + tmp="'*:options' prefix-needed yes" + [[ "$val" = hide* ]] && + tmp="$tmp +zstyle ':completion:*:options' prefix-hidden yes" + ;; + group_matches) + tmp="'*' group-name ''" + ;; + colors_path) + tmp="'*:colors' path ${(qq)val}" + ;; + path_expand) + tmp="'*:paths' expand ${(qq)val}" + ;; + path_cursor) + tmp="'*:paths' cursor ${(qq)val}" + ;; + (approximate|incremental|predict|list|oldlist|match)_*) + tmp="'*${name%%_*}:*' ${${name#*_}//_/-} ${(qq)val}" + ;; + correct_*) + cmt="# This one is a bit ugly. You may want to use only \`*:correct' +# if you also have the \`correctword_*' or \`approximate_*' keys. +" + tmp="'*(correct(|-word)|approximate):*' ${name#*_} ${(qq)val}" + ;; + correctword_*) + tmp="'*:correct-word' ${name#correctword_} ${(qq)val}" + ;; + expand_*) + cmt="# This one is a bit ugly. You may want to use only \`*:expand' +# if you also have the \`expandword_*' keys. +" + tmp="'*expand(|expand-word):*' ${name#*_} ${(qq)val}" + ;; + expandword_*) + tmp="'expand-word:*' ${name#expandword_} ${(qq)val}" + ;; + history_*) + tmp="'history-words:*' ${name#history_} ${(qq)val}" + ;; + completer) + tmp="'*' completer ${${(qqs.:.)val}}" + ;; + last_prompt) + tmp="'*' last-prompt 'yes'" + ;; + esac + [[ -n "$tmp" ]] && style="${style}${cmt}zstyle :completion:${tmp} +" + done + + eval "${style}" + + print "$style" >>! ${HOME}/.zsh-styles +} + +# Now we automatically make the definition files autoloaded. typeset -U _i_files -_i_files=( ${^~fpath}/_*~*~(N:t) ) -_i_initname=$0 +_i_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N:t) ) +if [[ $#_i_files -lt 20 || $_compdir = */Core || -d $_compdir/Core ]]; then + # Too few files: we need some more directories, + # or we need to check that all directories (not just Core) are present. + if [[ -n $_compdir ]]; then + _i_addfiles=() + if [[ $_compdir = */Core ]]; then + # Add all the Completion subdirectories + _i_addfiles=(${_compdir:h}/*(/)) + elif [[ -d $_compdir/Core ]]; then + # Likewise + _i_addfiles=(${_compdir}/*(/)) + fi + for _i_line in {1..$#i_addfiles}; do + _i_file=${_i_addfiles[$_i_line]} + [[ -d $_i_file && -z ${fpath[(r)$_i_file]} ]] || + _i_addfiles[$_i_line]= + done + fpath=($fpath $_i_addfiles) + _i_files=( ${^~fpath:/.}/^([^_]*|*~|*.zwc)(N:t) ) + fi +fi + + +# Rebind the standard widgets +for _i_line in complete-word delete-char-or-list expand-or-complete \ + expand-or-complete-prefix list-choices menu-complete \ + menu-expand-or-complete reverse-menu-complete; do + zle -C $_i_line .$_i_line _main_complete +done +zle -la menu-select && zle -C menu-select .menu-select _main_complete + _i_done='' +# Make sure compdump is available, even if we aren't going to use it. +autoload -U compdump compinstall + # If we have a dump file, load it. -if [[ -f "$COMPDUMP" ]]; then - read -rA _i_line < "$COMPDUMP" +if [[ -f "$_comp_dumpfile" ]]; then + read -rA _i_line < "$_comp_dumpfile" if [[ _i_autodump -eq 1 && $_i_line[2] -eq $#_i_files ]]; then - builtin . "$COMPDUMP" + builtin . "$_comp_dumpfile" _i_done=yes fi - unset _i_line fi if [[ -z "$_i_done" ]]; then for _i_dir in $fpath; do [[ $_i_dir = . ]] && continue - for _i_file in $_i_dir/_*~*~(N); do + for _i_file in $_i_dir/^([^_]*|*~|*.zwc)(N); do read -rA _i_line < $_i_file _i_tag=$_i_line[1] shift _i_line - if [[ $_i_tag = '#defcomp' ]]; then - compdef -na "${_i_file:t}" "${_i_line[@]}" - elif [[ $_i_tag = '#defpatcomp' ]]; then - compdef -pa "${_i_file:t}" "${_i_line[@]}" - elif [[ $_i_tag = '#defkeycomp' ]]; then - compdef -ka "${_i_file:t}" "${_i_line[@]}" - elif [[ $_i_tag = '#autoload' ]]; then - autoload ${_i_file:t} - fi + case $_i_tag in + (\#compdef) + if [[ $_i_line[1] = -[pPkK](n|) ]]; then + compdef ${_i_line[1]}na "${_i_file:t}" "${(@)_i_line[2,-1]}" + else + compdef -na "${_i_file:t}" "${_i_line[@]}" + fi + ;; + (\#autoload) + autoload -U "$_i_line[@]" ${_i_file:t} + [[ "$_i_line" != \ # ]] && _compautos[${_i_file:t}]="$_i_line" + ;; + esac done done - bindkey | - while read -rA _i_line; do - if [[ "$_i_line[2]" = complete-word || - "$_i_line[2]" = delete-char-or-list || - "$_i_line[2]" = expand-or-complete || - "$_i_line[2]" = expand-or-complete-prefix || - "$_i_line[2]" = list-choices || - "$_i_line[2]" = menu-complete || - "$_i_line[2]" = menu-expand-or-complete || - "$_i_line[2]" = reverse-menu-complete ]]; then - zle -C _complete_$_i_line[2] $_i_line[2] _main_complete - bindkey "${_i_line[1][2,-2]}" _complete_$_i_line[2] - fi - done - - unset _i_dir _i_line _i_file _i_tag - # If autodumping was requested, do it now. - (( _i_autodump )) && builtin . ${_i_initname:h}/compdump + if [[ $_i_autodump = 1 ]]; then + compdump + fi fi -[[ -z "$_i_noextglob" ]] || unsetopt extendedglob - -unset _i_files _i_initname _i_done _i_autodump _i_noextglob +unfunction compinit +autoload -U compinit diff --git a/Completion/Core/compinstall b/Completion/Core/compinstall index d96121cf2..ad05cb5a1 100644 --- a/Completion/Core/compinstall +++ b/Completion/Core/compinstall @@ -1,72 +1,149 @@ -# This script is to be run by a user to setup the new function based +# This script is to be run by a user to set up the new function based # completion system. The functions themselves are assumed to be already # available in some directory; they should have been installed with the -# the shell (except we haven't written that yet). +# the shell. If they have been, the commands `autoload -U compinit; compinit' +# in the shell startup file should be enough, although you can run +# compinstall for more configuration choices. # -# Run it as a script under zsh and answer the questions. -# You can run it as `zsh compinstall $FPATH' and it will be able to check -# your function path for the completion functions. -# -# Normally, this will alter ~/.zshrc (or wherever ZDOTDIR puts it), -# but you can make that unwritable and it will leave the lines in a -# temporary file instead. -# -# You can use this script to modify what compinstall previously -# added to ~/.zshrc. +# Simply run this script as a function and answer the questions. +# Normally it will alter ~/.zshrc (or wherever ZDOTDIR puts it), but you +# can make that unwritable and it will leave the lines in a temporary file +# instead. It doesn't matter if .zshrc didn't exist before. If your +# .zshrc usually exits before the end, then you should take the code added +# by compinstall and put it (including the comment lines at the start and +# end) at the point you want it to be executed. If you run compinstall +# again it will find and replace those lines, so you can use this script to +# modify what compinstall previously added to ~/.zshrc. # # It is safe to abort with ^C any time you are being prompted for # information; your .zshrc will not be altered. # # To do: -# - Maybe this should be sourced, then it can check the user's current -# setup better. But then there is a potentially horrendous option -# setting/resetting problem. (Maybe we need another way of doing that.) # - Should probably offer to set different options for _approximate than # for _complete if both are used. # - Could add code for setting other completers and options. # - Could add keys for context-sensitive help. -# - Probably should allow a set of directories to be added to $fpath, -# like Core, Base, etc. -# In case a startup script changed options -emulate zsh -[[ -n $1 ]] && FPATH=$1 +emulate -L zsh -for f in $fpath; do - if [[ $f != . && -f $f/compinit && -f $f/compdump ]]; then - fdir=$f - break - fi -done +typeset _ci_options _ci_f _ci_fdir _ci_files _ci_dumpfile _ci_lines +typeset _ci_type _ci_completer _ci_accept _ci_cprompt _ci_startline +typeset _ci_endline _ci_ifile _ci_tmpf _ci_compstyle _ci_warn +typeset _ci_dtype _ci_existing _ci_line _ci_end -if [[ -z $fdir ]]; then - print "Trying to find where the completion functions are..." - if [[ $0 = */* && -f $0:h/compinit && -f $0:h/compdump ]]; then - fdir=$0:h - else - # more guesses? - print \ +# Look for the defaults. +_ci_startline='# The following lines were added by compinstall' +_ci_endline='# End of lines added by compinstall' + +_ci_ifile=${ZDOTDIR:-~}/.zshrc +_ci_lines='' +_ci_existing='' + +typeset -A _ci_defaults + +if [[ -f $_ci_ifile ]]; then + # This assumes the lines haven't been altered by the user too much + # after they were added. + _ci_compstyle=0 + sed -n "/^$_ci_startline/,/^$_ci_endline/p" $_ci_ifile | + while read -rA _ci_line; do + if (( $_ci_compstyle )); then + # parse a compstyle component as first argument + if [[ $_ci_line[-1] != \\ ]]; then + _ci_end=-1 + _ci_compstyle=0 + else + _ci_end=-2 + fi + if [[ $_ci_line[1] = *=* ]]; then + _ci_f="${${_ci_line[1,$_ci_end]}#*=}" + if [[ $_ci_f = \'*\' ]]; then + # strip quotes + _ci_f=${_ci_f[2,-2]//\'\\\'\'/\'} + fi + _ci_defaults[${_ci_line[1]%%\=*}]=$_ci_f + fi + _ci_existing="${_ci_existing} $_ci_line +" + elif [[ $_ci_line[1] = compinit ]]; then + # parse the line running compinit + [[ $_ci_line[2] = -f ]] && _ci_fdir=$_ci_line[3] + [[ $_ci_line[-2] = -d ]] && _ci_dumpfile=$_ci_line[-1] + elif [[ $_ci_line[1] = _compdir=* ]]; then + _ci_fdir=${_ci_line[1]##_compdir=} + elif [[ $_ci_line[1] = compstyle ]]; then + # parse a compstyle component as second argument (should be completer) + [[ $_ci_line[3] = completer ]] && + _ci_completer=${_ci_line[3,-1]} + [[ $_ci_line[-1] == \\ ]] && _ci_compstyle=1 + _ci_existing="${_ci_existing}$_ci_line +" + elif [[ $_ci_line[1] != \#* && $_ci_line[1] != (autoload|\[\[) ]]; then + if [[ -z $_ci_warn ]]; then + _ci_warn=1 + print "Warning: existing lines in compinstall setup not understood:" + fi + print - $_ci_line + _ci_existing="${_ci_existing}$_ci_line +" + fi + done +fi + + +# Find out where the completion functions are kept. + +if [[ -z $_ci_fdir || ! -f ${~_ci_fdir}/compinit || + ! -f ${~_ci_fdir}/compdump ]]; then + for _ci_f in $fpath; do + if [[ $_ci_f != . && -f $_ci_f/compinit && -f $_ci_f/compdump ]]; then + _ci_fdir=$_ci_f + break + elif [[ $_ci_f != . && -f $_ci_f/Core/compinit && + -f $_ci_f/Core/compdump ]] + then + _ci_fdir=$_ci_f/Core + break + fi + done +fi + +if [[ -z $_ci_fdir || ! -d ${~_ci_fdir} ]]; then + print \ "Please edit the name of the directory where the completion functions are installed. If they are not installed, you will need to find them in the Completion/* directories of the zsh distribution and install them yourself, or insult your system manager for incompetence." - vared -c fdir - while [[ ! -d ${~fdir} || ! -f ${~fdir}/compinit || - ! -f ${~fdir}/compdump ]]; do - print "I can't find them in that directory. Try again or abort." - vared fdir - done + vared -c _ci_fdir + while [[ ! -d ${~_ci_fdir} || + ((! -f ${~_ci_fdir}/compinit || ! -f ${~_ci_fdir}/compdump) && + (! -f ${~_ci_fdir}/Core/compinit || ! -f ${~_ci_fdir}/Core/compdump)) ]] + do + print "I can't find them in that directory. Try again or abort." + vared _ci_fdir + done + if [[ -f ${~_ci_fdir}/Core/compinit && ! -f ${~_ci_fdir}/compinit ]]; then + _ci_fdir=$_ci_fdir/Core fi - eval "fpath=($fdir \$fpath)" - fdir=${fdir/#$HOME/\~} - lines="fpath=($fdir \$fpath)\n" else - print "Found completion functions in your fpath, will not alter it." + print "Keeping existing completion directiory $_ci_fdir" +fi + +if [[ ${~_ci_fdir} != /* ]]; then + _ci_fdir=$(cd $_ci_fdir;builtin pwd) fi -files=( ${^~fpath:/.}/_(|*[^~])(N:t) ) -if [[ $#files -lt 20 ]]; then +# Check if this is in fpath already, else put it there (with ~'s expanded). +_ci_f=${~_ci_fdir} +[[ -z ${fpath[(r)$_ci_f]} ]] && fpath=($fpath $_ci_f) + +# Contract $HOME to ~ in the parameter to be used for writing. +_ci_fdir=${_ci_fdir/#$HOME/\~} + +# Now check the fpath, ignoring the directory . +_ci_files=( ${^~fpath:/.}/_(|*[^~])(N:t) ) +if [[ $#_ci_files -lt 20 ]]; then print " Hmmm, completion functions seem a bit thin on the ground. There should be lots of files with names beginning with an underscore (_). You should @@ -75,12 +152,20 @@ look and see what's happened to these. read fi -if [[ -w ${~fdir} && ( ! -f ${~fdir}/compinit.dump || - -w ${~fdir}/compinit.dump ) ]] + +# Set up the dumpfile +_ci_dtype=existing +if [[ -z $_ci_dumpfile ]]; then + _ci_dumpfile="${ZDOTDIR:-$HOME}/.zcompdump" + _ci_dtype=standard +fi + +if [[ -w ${~_ci_dumpfile:h} && ( ! -f ${~_ci_dumpfile} || + -w ${~_ci_dumpfile} ) ]] then print " -Using standard dumpfile - ${~fdir}/compinit.dump +Using $_ci_dtype dumpfile + ${_ci_dumpfile} to speed up initialisation. [Hit return to continue]" read @@ -88,23 +173,32 @@ else print " I will force completion to dump its status, which will speed up the shell's start-up considerably. However, I can't write the file I'd like to, namely -$fdir/compinit.dump. Please edit a replacement." - dumpfile='~/.compinit.dump' - vared dumpfile - while ! touch ${~dumpfile} >& /dev/null; do +${_ci_dumpfile}. Please edit a replacement." + vared _ci_dumpfile + while ! touch ${~_ci_dumpfile} >& /dev/null; do print "Sorry, I can't write that either. Try again." - vared dumpfile + vared _ci_dumpfile done - [[ -s $dumpfile ]] || rm -f $dumpfile - dumpfile=" $dumpfile" + [[ -s $_ci_dumpfile ]] || rm -f $_ci_dumpfile fi -fdir=${fdir/#$HOME/\~} - -lines="${lines}. $fdir/compinit -d$dumpfile\n" +_ci_lines="${_ci_lines}_compdir=$_ci_fdir +[[ -z \$fpath[(r)\$_compdir] ]] && fpath=(\$fpath \$_compdir) +autoload -U compinit +compinit" +[[ $_ci_dtype != standard ]] && _ci_lines="${_ci_lines} $_ci_dumpfile" +_ci_lines="${_ci_lines} +" print " +Would you like to set some more advanced options? Otherwise, you +can re-run compinstall later to set these. [n]" + +# The whole of the next part should be indented, but I can't be bothered. +if read -q; then + + print " In addition to completion, zsh can also perform correction of the current word, or approximate completion, i.e. completion where the part of the word typed so far can be corrected; or it can try correction, then @@ -112,105 +206,156 @@ approximate completion if that fails. Would you like: 0: Just ordinary completion C: Correction A: Approximate completion - B: Both? -Please type one of the keys above:" -while read -k type; do - print - case $type in - 0*) completer=_complete - break - ;; - [cC]*) completer=_complete:_correct - break - ;; - [aA]*) completer=_complete:_approximate - break; - ;; - [bB]*) completer=_complete:_correct:_approximate - break - ;; - *) print Try again - ;; - esac -done - -lines="${lines}compconf completer=$completer" - - -if [[ $completer = *(correct|approx)* ]]; then - print " -Correction and approximation will normally allow up to two errors, -and you will be able to use a numeric prefix (e.g. <Esc>4) to allow -more. The standard prompt is \`correct to:'. Do you want to change -any of this? [n]" - if read -q; then - print "Number of errors to accept normally (0 is OK):" - read accept - while [[ $accept != <-> ]]; do - read accept"?Please enter a number: " - done - print \ + B: Both" + if [[ -n $_ci_completer ]]; then + print " Default: use the current completers:\n$_ci_completer" + else + print "Please type one of the keys above." + fi + while read -k _ci_type; do + print + case $_ci_type in + 0*) _ci_completer=_complete + break + ;; + [cC]*) _ci_completer='_complete _correct' + break + ;; + [aA]*) _ci_completer='_complete _approximate' + break; + ;; + [bB]*) _ci_completer='_complete _correct _approximate' + break + ;; + *) [[ -n $_ci_completer ]] && break + print Try again + ;; + esac + done + + _ci_lines="${_ci_lines}zstyle ':completion*' completer $_ci_completer" + + + if [[ $_ci_completer = *(correct|approx)* ]]; then + _ci_accept=${_ci_defaults[correct_accept]} + _ci_cprompt=${_ci_defaults[correct_prompt]} + print " +Correction and approximation will allow up to ${${_ci_accept:-2}%%[^0-9]*} \ +errors. " + case $_ci_accept in + *n*!*|*!*n) print "A numeric prefix, if not 1, will cause correction \ +not to be done." + ;; + *n*) print "A numeric prefix gives the maximum number of errors which \ +will be accepted." + ;; + *) print "The numeric prefix will not be used." + esac +print "The correction prompt is \`${_ci_cprompt:-correct to:}'. +Do you want to change any of this? [n]" + if read -q; then + print "Number of errors to accept normally (0 is OK):" + _ci_accept=${_ci_accept%%[^0-9]*} + vared _ci_accept + while [[ $_ci_accept != <-> ]]; do + print "Please enter a number:" + vared _ci_accept + done + print \ "How would you like the numeric prefix to be treated: 0: Not used by correction - U: Used to given the number of errors + U: The number gives the largest number of errors which will be + accepted when correcting I: If present, and not 1, do not perform correction? Please type one of the keys above:" - while read -k type; do - print - case $type in - 0*) break - ;; - [uU]*) accept="${accept}n" - break - ;; - [Ii]*) accept="${accept}!n" - break - ;; - *) print Try again - ;; - esac - done - lines="$lines \\\\ - correct_accept='$accept'" - print " + while read -k _ci_type; do + print + case $_ci_type in + 0*) break + ;; + [uU]*) _ci_accept="${_ci_accept}n" + break + ;; + [Ii]*) _ci_accept="${_ci_accept}!n" + break + ;; + *) print Try again + ;; + esac + done + print " Instead of the prompt \`correct to:', you can have no prompt, or a prompt of your choosing which can display the number of errors found by containing the string \`%e'. Do you wish to change the correction prompt? [n]" - if read -q; then - cprompt='' - print "Edit a new prompt (may be empty):" - vared cprompt - lines="$lines \\\\ - correct_prompt='${cprompt//\'/\'\\\'\'}'" + if read -q; then + print "Edit a new prompt (may be empty):" + vared _ci_cprompt + [[ -z $_ci_cprompt ]] && _ci_cprompt=':empty:' + fi + fi + if [[ -n $_ci_accept ]]; then + _ci_lines="$_ci_lines \\ + correct_accept='$_ci_accept'" + unset '_ci_defaults[correct_accept]' + fi + if [[ -n $_ci_cprompt ]]; then + _ci_cprompt=${_ci_cprompt##:empty:} + _ci_lines="$_ci_lines \\ + correct_prompt='${_ci_cprompt//\'/\'\\\'\'}'" + unset '_ci_defaults[correct_prompt]' fi fi -fi -lines="$lines\n" + _ci_warn='' + for _ci_f in ${(k)_ci_defaults}; do + if [[ -z $_ci_warn ]]; then + print " +(Keeping other existing configuration settings...)" + _ci_warn=1 + fi + _ci_lines="$_ci_lines \\ + ${_ci_f}='${_ci_defaults[$_ci_f]//\'/\'\\\'\'}'" + done + _ci_lines="$_ci_lines +" -startline='# The following lines were added by compinstall' -endline='# End of lines added by compinstall' +else -ifile=${ZDOTDIR:-~}/.zshrc -[[ -f $ifile ]] || touch $ifile -tmpf=${TMPPPREFIX:-/tmp/zsh}compinstall$$ + if [[ -n $_ci_existing ]]; then + print -nr " +I will retain the following lines from the existing completion setup: +$_ci_existing" + _ci_lines="$_ci_lines${_ci_existing}" + fi + +fi # End of advanced options -if [[ ! -w $ifile ]]; then - print "\nI can't write to $ifile. I will leave the lines to add in -\`$tmpf' and you must add them by hand." - print "\n$startline\n$lines\n$endline" >$tmpf - return 0 -fi -if grep $endline $ifile >& /dev/null; then - print -- "$startline\n$lines$endline" >$tmpf - sed -e "/^$endline/r $tmpf -/^$startline/,/^$endline/d" $ifile >${tmpf}2 && mv ${tmpf}2 $ifile && - print "\nSuccesfully modified old compinstall lines in $ifile." - rm -f $tmpf ${tmpf}2 +[[ -f $_ci_ifile ]] || touch $_ci_ifile +_ci_tmpf=${TMPPPREFIX:-/tmp/zsh}compinstall$$ + +if [[ ! -w $_ci_ifile ]]; then + print "\nI can't write to $_ci_ifile. I will leave the lines to add in +\`$_ci_tmpf' and you must add them by hand." + print -r - "$_ci_startline +$_ci_lines$_ci_endline" >$_ci_tmpf +elif grep $_ci_endline $_ci_ifile >& /dev/null; then + print -r - "$_ci_startline +$_ci_lines$_ci_endline" >$_ci_tmpf + sed -e "/^$_ci_endline/r $_ci_tmpf +/^$_ci_startline/,/^$_ci_endline/d" $_ci_ifile >${_ci_tmpf}2 && + mv ${_ci_tmpf}2 $_ci_ifile && + print "\nSuccesfully modified old compinstall lines in $_ci_ifile." + rm -f $_ci_tmpf ${_ci_tmpf}2 else - print "\n$startline\n$lines\n$endline" >>$ifile && - print "\nSuccessfully appended lines to $ifile." + print -r - "$_ci_startline +$_ci_lines$_ci_endline" >>$_ci_ifile && + print "\nSuccessfully appended lines to $_ci_ifile." fi + +unfunction compinstall +autoload -U compinstall + +return 0 diff --git a/Completion/Linux/_rpm b/Completion/Linux/_rpm index 7fdc80ab0..9ef2d57d9 100644 --- a/Completion/Linux/_rpm +++ b/Completion/Linux/_rpm @@ -3,7 +3,7 @@ # This uses `_arguments' in a state-machine kind of way. These states # have names and before executing the default action for such a state # we try to call a function with the name `_rpm_<state>'. If such a -# function exists, we return with it's return status immediatly. This +# function exists, we return with its return status immediately. This # allows users to override the default completions by simply defining # these functions. # The states (and possible values for the `<state>' above) are: @@ -43,28 +43,36 @@ local ret=1 tmp expl # Used by `_arguments', made local here. -local state lstate line -tyeset -A options +local curcontext="$curcontext" state lstate line +typeset -A opt_args state='' # Do simple completions or get the first state. -_arguments \ +_arguments -C -s \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ - '-q:*:query:->query' \ - -{V,v,vv,y,-{setperms,setugids,querytags,initdb,showrc}} \ - '-pipe:*:pipe command:_command_names -e' \ - '--verify:*:verify:->verify' \ - -{i,-install}':*:install:->install' \ - -{U,-upgrade}':*:upgrade:->upgrade' \ - -{e,-erase}':*:uninstall:->uninstall' \ - -'b+:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_b' \ - -'t+:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_t' \ + '-q+[query mode]:*:query:->query' \ + '*-v[verbose mode]' \ + --{setperms,setugids,querytags,initdb,showrc} \ + '--pipe:pipe command:_command_names -e' \ + -{V,y}'[verify mode]:*:verify:->verify' \ + '--verify[verify mode]:*:verify:->verify' \ + '-i+[install mode]:*:install:->install' \ + '--install:*:install:->install' \ + '-U+[upgrade mode]:*:upgrade:->upgrade' \ + '--upgrade:*:upgrade:->upgrade' \ + '-F+[freshen mode]:*:upgrade:->upgrade' \ + '--freshen:*:upgrade:->upgrade' \ + '-e+[uninstall mode]:*:uninstall:->uninstall' \ + '--erase:*:uninstall:->uninstall' \ + -'b+[build mode (spec file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_b' \ + -'t+[build mode (tar file)]:build stage:((p\:execute\ \%prep\ stage l\:do\ a\ list\ check c\:execute\ build\ stage i\:execute\ install\ stage b\:build\ a\ binary\ package a\:build\ binary\ and\ source\ packages)):*:build:->build_t' \ --{rebuild,rmsource,recompile,resign,addsign}':*:RPM package:->package' \ - -{K,-checksig}':*:sigcheck:->sigcheck' \ + '-K+[signature check mode]:*:sigcheck:->sigcheck' \ + '--checksig:*:sigcheck:->sigcheck' \ '--rebuilddb:*:rebuild:->rebuild' && ret=0 # As long as we have a state name... @@ -73,7 +81,7 @@ while [[ -n "$state" ]]; do # First try to call a user-defined function. - funcall ret _rpm_$state && return ret + _funcall ret _rpm_$state && return ret # Copy the state and reset `state', to simplify the test above. @@ -85,24 +93,24 @@ while [[ -n "$state" ]]; do case "$lstate" in query) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' -q \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ '--root:RPM root directory:_files -/' \ '--dbpath:RPM database path:_files -/' \ '--queryformat:RPM query format:->tags' \ - '-f:file:_files' \ - '-p:RPM package file:->package_file' \ + '-f[specify file to query owner of]:file:_files' \ + '-p+[specify uninstalled package file to query]:*:RPM package file:->package_file' \ '--triggeredby:RPM package:->package' \ '--whatprovides:RPM capability:->capability' \ '--whatrequires:RPM capability:->capability' \ '*:RPM package:->package_or_file' && ret=0 ;; verify) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' '(-y)-V' '(-V)-y' \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ @@ -112,15 +120,18 @@ while [[ -n "$state" ]]; do '*:RPM package:->package' && ret=0 ;; upgrade) - tmp=( --oldpackage ) + tmp=( -U --oldpackage ) ;& install) - _arguments "$tmp[@]" \ - -{v,vv} \ + (( $#tmp )) || tmp=(-i) + _arguments -s "$tmp[@]" \ + '*-v[verbose mode]' \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ - -{-{badreloc,excludedocs,force,hash,allfiles,ignorearch,ignoreos,includedocs,justdb,nodeps,noorder,noscripts,notriggers,percent,replacefiles,replacepkgs,test},h} \ + '(-h)--hash' '(--hash)-h' \ + '(--replacepkgs --replacefiles --oldpackage)--force' \ + --{badreloc,excludedocs,allfiles,ignorearch,ignoreos,includedocs,justdb,nodeps,noorder,noscripts,notriggers,percent,replacefiles,replacepkgs,test} \ '--relocate:relocate:->relocate' \ '--prefix:package prefix directory:_files -/' \ '--root:RPM root directory:_files -/' \ @@ -128,8 +139,8 @@ while [[ -n "$state" ]]; do '*:pkg file:->package_file' && ret=0 ;; uninstall) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' -e \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ @@ -139,13 +150,13 @@ while [[ -n "$state" ]]; do '*:RPM package:->package' && ret=0 ;; build_b) - tmp=( '*:RPM package:->package' ) + tmp=( '*:spec file:_files -g \*.spec' ) ;& build_t) (( $#tmp )) || tmp=( '*:tar file:_files -g \*.\(\#i\)tar\(.\*\|\)' ) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ @@ -156,8 +167,8 @@ while [[ -n "$state" ]]; do '--timecheck:time check (seconds):' "$tmp[1]" && ret=0 ;; sigcheck) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' -K \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ @@ -165,8 +176,8 @@ while [[ -n "$state" ]]; do '*:RPM package file:->package_or_file' && ret=0 ;; rebuild) - _arguments \ - -{v,vv} \ + _arguments -s \ + '*-v[verbose mode]' \ '--rcfile:resource file:_files' \ '--ftpproxy:FTP proxy server:_hosts' \ '--ftpport:FTP port number:' \ @@ -178,21 +189,23 @@ while [[ -n "$state" ]]; do state=package_file ;& package) - _description expl 'RPM package' - compadd "$expl[@]" -M 'r:|-=* r:|=*' - $(rpm -qa) && ret=0 + _wanted packages expl 'RPM package' \ + compadd -M 'r:|-=* r:|=*' - $(_call packages rpm -qa) && ret=0 ;; package_file) - if compset -P ftp:; then + if compset -P ftp://; then _hosts -S/ && ret=0 else - _files -g '*.(#i)rpm' && ret=0 + _alternative \ + 'files:RPM package file:_files -g \*.\(\#i\)rpm' \ + 'prefixes:ftp URL prefix:compadd ftp://' && ret=0 fi ;; tags) if compset -P '*\{'; then - _description expl 'RPM tag' - compadd "$expl[@]" -M 'm:{a-z}={A-Z}' -S '}' - \ - "${(@)${(@f)$(rpm --querytags)}#RPMTAG_}" && ret=0 + _wanted tags expl 'RPM tag' \ + compadd -M 'm:{a-z}={A-Z}' -S '\}' - \ + "${(@)${(@f)$(_call tags rpm --querytags)}#RPMTAG_}" && ret=0 else _message 'RPM format' fi @@ -201,10 +214,10 @@ while [[ -n "$state" ]]; do _message 'RPM capability' ;; relocate) - if compset -P '*\='; then - _description expl 'new path' + if compset -P '*='; then + _description directories expl 'new path' else - _description expl 'old path' + _description directories expl 'old path' fi _files "$expl[@]" -/ && ret=0 diff --git a/Completion/User/_gdb b/Completion/User/_gdb index ff54e6a07..55e149bb7 100644 --- a/Completion/User/_gdb +++ b/Completion/User/_gdb @@ -1,36 +1,44 @@ #compdef gdb -# This uses the configuration keys `ps_args' and `ps_listargs' -# described in the `_wait' function. +local cur="$words[CURRENT]" prev w list ret=1 expl -local cur="$words[CURRENT]" prev w list ret=1 - -_long_options -t '*=(CORE|SYM)FILE' '_files' \ - '*=EXECFILE' '_files *(*)' \ - '*=TTY' 'compadd /dev/tty*' && return 0 +[[ "$PREFIX" = --* ]] && + _arguments -- '*=(CORE|SYM)FILE:core file:_files' \ + '*=EXECFILE:executable:_files \*\(-\*\)' \ + '*=TTY:terminal device:compadd /dev/tty\*' && return 0 if compset -P '-(cd|directory)='; then _files -/ elif compset -P '-tty='; then - compadd - /dev/tty* + _wanted devices expl 'terminal device' compadd - /dev/tty* elif compset -P '-(exec|se)='; then - _files -/g '*(*)' + _description files expl executable + _files "$expl[@]" -g '*(-*)' elif compset -P '-(symbols|core|command)='; then _files -elif compset -P -; then - compadd -QS '' - symbols\= exec\= se\= core\= command\= directory\= \ - cd\= tty\= - compadd - help h s e c x d nx n quiet q batch fullname f b +elif [[ "$PREFIX" = -* ]]; then + if _wanted options; then + while _next_label options expl option; do + compadd "$expl[@]" -QS '' - -symbols\= -exec\= -se\= -core\= -command\= \ + -directory\= -cd\= -tty\= && ret=0 + compadd "$expl[@]" - -help -h -s -e -c -x -d -nx -n -quiet -q \ + -batch -fullname -f -b && ret=0 + (( ret )) || return 0 + done + fi else prev="$words[CURRENT-1]" case "$prev" in - (-d) _files -/ && return 0 ;; - (-e) _files -/g '*(*)' && return 0 ;; + (-d) _files -/ && return 0 ;; (-[csx]) _files && return 0 ;; - (-b) compadd -V baud 0 50 75 110 134 150 200 300 600 1200 1800 2400 4800 \ - 9600 19200 38400 57600 115200 230400 && return 0 ;; + (-e) _description files expl executable + _files "$expl[@]" -g '*(-*)' && return 0 ;; + (-b) _wanted -V values expl 'baud rate' \ + compadd 0 50 75 110 134 150 200 300 600 1200 1800 2400 4800 \ + 9600 19200 38400 57600 115200 230400 && return 0 ;; esac + w=( "${(@)words[2,-1]}" ) while [[ "$w[1]" = -* ]]; do [[ "$w[1]" = -[decsxb] ]] && shift 1 w @@ -38,13 +46,9 @@ else done if [[ $#w -gt 1 ]]; then - _files && ret=0 - list=("${(F)${(@Mr:COLUMNS-1:)${(f)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ ]#${PREFIX}[0-9]#${SUFFIX}[ ]*${w[1]:t}}} -") - compadd -y list - ${${${(M)${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}:#*${w[1]:t}*}## #}%% *} && ret=0 - - return ret + _alternative 'files:: _files' "processes:: _pids -m ${w[1]:t}" else - _files -/g '*(*)' + _description files expl executable + _files "$expl[@]" -g '*(-*)' fi fi diff --git a/Completion/User/_getconf b/Completion/User/_getconf index 7ce709588..59e9a83bc 100644 --- a/Completion/User/_getconf +++ b/Completion/User/_getconf @@ -1,20 +1,19 @@ #compdef getconf -local expl +local expl ret=1 if [[ CURRENT -eq 2 ]]; then _tags syswideconfig pathconfig standardsconfig while _tags; do - if _requested -V syswideconfig expl 'systemwide configuration variables' - then - compadd "$expl[@]" -S '' ARG_MAX BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX \ + _requested -V syswideconfig expl 'systemwide configuration variables' \ + compadd -S '' ARG_MAX BC_BASE_MAX BC_DIM_MAX BC_SCALE_MAX \ BC_STRING_MAX CHILD_MAX COLL_WEIGHTS_MAX EXPR_NEST_MAX LINE_MAX \ - NGROUPS_MAX OPEN_MAX RE_DUP_MAX STREAM_MAX TZNAME_MAX - fi - if _requested -V standardsconfig \ - expl 'system-standards configuration variables'; then - compadd "$expl[@]" -S '' _POSIX_CHILD_MAX _POSIX_LINK_MAX \ + NGROUPS_MAX OPEN_MAX RE_DUP_MAX STREAM_MAX TZNAME_MAX && ret=0 + + _requested -V standardsconfig \ + expl 'system-standards configuration variables' \ + compadd -S '' _POSIX_CHILD_MAX _POSIX_LINK_MAX \ _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX \ _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX \ _POSIX_STREAM_MAX _POSIX_TZNAME_MAX _POSIX_VERSION \ @@ -22,15 +21,17 @@ if [[ CURRENT -eq 2 ]]; then POSIX2_BC_STRING_MAX POSIX2_COLL_WEIGHTS_MAX POSIX2_EXPR_NEST_MAX \ POSIX2_LINE_MAX POSIX2_RE_DUP_MAX POSIX2_VERSION POSIX2_C_BIND \ POSIX2_C_DEV POSIX2_FORT_DEV POSIX2_FORT_RUN POSIX2_LOCALEDEF \ - POSIX2_SW_DEV _XOPEN_VERSION - fi - if _requested -V pathconfig expl 'system path configuration variables' - then - compadd "$expl[@]" -S '' PIPE_BUF _POSIX_CHOWN_RESTRICTED \ - _POSIX_NO_TRUNC _POSIX_VDISABLE - compadd "$expl[@]" -S ' ' LINK_MAX MAX_CANON MAX_INPUT NAME_MAX PATH_MAX \ - PIPE_BUF - fi + POSIX2_SW_DEV _XOPEN_VERSION && ret=0 + + _requested pathconfig && + while _next_label -V pathconfig expl 'system path configuration variables'; do + compadd "$expl[@]" -S '' PIPE_BUF _POSIX_CHOWN_RESTRICTED \ + _POSIX_NO_TRUNC _POSIX_VDISABLE && ret=0 + compadd "$expl[@]" -S ' ' LINK_MAX MAX_CANON MAX_INPUT NAME_MAX \ + PATH_MAX PIPE_BUF && ret=0 + (( ret )) || break + done + (( ret )) || return 0 done else _files -/ diff --git a/Completion/User/_groups b/Completion/User/_groups index 975189174..27444d26d 100644 --- a/Completion/User/_groups +++ b/Completion/User/_groups @@ -1,6 +1,19 @@ #compdef newgrp -: ${(A)groups:=${${(s: :)$(</etc/group)}%%:*}} -# : ${(A)groups:=${${(s: :)$(ypcat group.byname)}%%:*}} # If you use NIS +local expl groups tmp -compadd $groups +_wanted groups || return 1 + +if ! zstyle -a ":completion:${curcontext}:" groups groups; then + (( $+_cache_groups )) || + if (( ${+commands[ypcat]} )) && + tmp=$(_call groups ypcat group.byname); then + : ${(A)_cache_groups:=${${(f)tmp}%%:*}} # If you use YP + else + : ${(A)_cache_groups:=${${(s: :)$(</etc/group)}%%:*}} + fi + + groups=( "$_cache_groups[@]" ) +fi + +_all_labels groups expl group compadd "$@" - "$groups[@]" diff --git a/Completion/User/_lp b/Completion/User/_lp index f37c62a14..cfa2a147c 100644 --- a/Completion/User/_lp +++ b/Completion/User/_lp @@ -1,50 +1,98 @@ #compdef lp lpr lpq lprm -local file expl ret=1 list disp strs shown +local expl ret=1 printer list disp strs shown if (( ! $+_lp_cache )); then + local file entry names i + file=( /etc/(printcap|printers.conf)(N) ) - if (( $#file )); then - _lp_cache=( "${(@)${(@s:|:)${(@)${(@f)$(< $file[1])}:#[ \#]*}%%:*}%%[ ]*}" ) - else - # Default value. Could probably be improved + _lp_cache=() + _lp_alias_cache=() - _lp_cache=( lp0 ) + if (( $#file )); then + while read entry; do + if [[ "$entry" = [^[:blank:]\#\*_]*:* ]]; then + names=( "${(s:|:)entry%%:*}" ) + if [[ "$entry" = *:description=* ]]; then + disp="${${entry##*:description=}%%:*}" + elif [[ $#names -gt 1 && "$names[-1]" = *\ * ]] ;then + disp="$names[-1]" + else + disp='' + fi + if [[ -n "$disp" ]]; then + _lp_cache=( "$_lp_cache[@]" "${names[1]}:${disp}" ) + _lp_alias_cache=( "$_lp_alias_cache[@]" "${(@)^names[2,-1]:#*\ *}:${disp}" ) + else + _lp_cache=( "$_lp_cache[@]" "${names[1]}" ) + _lp_alias_cache=( "$_lp_alias_cache[@]" "${(@)names[2,-1]:#*\ *}" ) + fi + fi + done < $file[1] fi + (( $#_lp_cache )) || _lp_cache=( 'lp0:Guessed default printer' ) + (( $#_lp_alias_cache )) || unset _lp_alias_cache fi if compset -P -P || [[ "$words[CURRENT-1]" = -P ]]; then - _wanted printers expl printer && compadd "$expl" - "$_lp_cache[@]" + if _wanted printers; then + if zstyle -T ":completion:${curcontext}:printers" verbose; then + zformat -a list ' -- ' "$_lp_cache[@]" + disp=(-ld list) + else + disp=() + fi + _all_labels printers expl printer \ + compadd "$disp[@]" - "${(@)_lp_cache%%:*}" && return 0 + + (( $+_lp_alias_cache )) || return 1 + + if zstyle -T ":completion:${curcontext}:printers" verbose; then + zformat -a list ' -- ' "$_lp_alias_cache[@]" + disp=(-ld list) + else + disp=() + fi + compadd "$expl[@]" "$disp[@]" - "${(@)_lp_alias_cache%%:*}" + else + return 1 + fi else if [[ "$words[1]" = (lpq|lprm) ]]; then - list=( "${(@M)${(f@)$(lpq)}:#[0-9]*}" ) + if [[ "$words" = *-P* ]]; then + printer=(-P "${${words##*-P( |)}%% *}") + else + printer=() + fi + list=( ${(M)"${(f@)$(_call jobs lpq $printer 2> /dev/null)}":#[0-9]*} ) if (( $#list )); then _tags users jobs while _tags; do - if _requested users expl user; then + if _requested users; then strs=( "${(@)${(@)list##[^ ]##[ ]##[^ ]##[ ]##}%%[ ]*}" ) if [[ -z "$shown" ]] && - zstyle -t ":completion:${curcontext}:users" verbose; then + zstyle -T ":completion:${curcontext}:users" verbose; then disp=(-ld list) shown=yes else disp=() fi - compadd "$expl[@]" "$disp[@]" - "$strs[@]" || _users && ret=0 + _all_labels users expl user compadd "$disp[@]" - "$strs[@]" || + _users && ret=0 fi - if _requested jobs expl job; then + if _requested jobs; then strs=( "${(@)${(@)list##[^ ]##[ ]##[^ ]##[ ]##[^ ]##[ ]##}%%[ ]*}" ) if [[ -z "$shown" ]] && - zstyle -t ":completion:${curcontext}:jobs" verbose; then + zstyle -T ":completion:${curcontext}:jobs" verbose; then disp=(-ld list) shown=yes else disp=() fi - compadd "$expl[@]" "$disp[@]" - "$strs[@]" && ret=0 + _all_labels jobs expl job compadd "$disp[@]" - "$strs[@]" && ret=0 fi (( ret )) || return 0 done diff --git a/Completion/User/_make b/Completion/User/_make index d576b0308..741cbb7dc 100644 --- a/Completion/User/_make +++ b/Completion/User/_make @@ -1,3 +1,32 @@ -#defcomp make gmake pmake +#compdef make gmake pmake -complist -s "\$(awk '/^[a-zA-Z0-9][^/ ]+:/ {print \$1}' FS=: [mM]akefile)" +local prev="$words[CURRENT-1]" file expl tmp + +if [[ "$prev" = -[CI] ]]; then + _files -/ +elif [[ "$prev" = -[foW] ]]; then + _files +else + file="$words[(I)-f]" + if (( file )); then + file="$words[file+1]" + elif [[ -e Makefile ]]; then + file=Makefile + elif [[ -e makefile ]]; then + file=makefile + else + file='' + fi + + if [[ -n "$file" ]] && _wanted targets; then + tmp=( + $(awk '/^[a-zA-Z0-9][^\/ \t]+:/ {print $1} + /^\.include *<bsd\.port\.(subdir\.|pre\.)?mk>/ || /^\.include *".*mk\/bsd\.pkg\.(subdir\.)?mk"/ { + print "fetch fetch-list extract patch configure build install reinstall deinstall package describe checkpatch checksum makesum" }' \ + FS=: $file) + ) + _all_labels targets expl 'make target' compadd "$tmp[@]" && return 0 + fi + compset -P 1 '*=' + _files +fi diff --git a/Completion/User/_mh b/Completion/User/_mh index 67ce49fd2..c1f397744 100644 --- a/Completion/User/_mh +++ b/Completion/User/_mh @@ -1,28 +1,36 @@ -#defcomp folder comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath mhpatch +#compdef folder folders comp inc mark refile repl scan show next prev rmm pick whom mhn mhpath # Completion for all possible MH commands. # Alter the following two to your own mh directory and the directory # where standard mh library files live. (It works anyway, but this # will save a little time.) + local mymhdir=~/Mail local mhlib=/usr/lib/mh +local prev="$words[CURRENT-1]" expl + # To be on the safe side, check this exists and if not, get it anyway. [[ -d $mymhdir ]] || mymhdir=$(mhpath +) -if [[ -iprefix - ]]; then +if compset -P 1 -; then # get list of options, which MH commands can generate themselves # awk is just too icky to use for this, sorry. send me one if # you come up with it. - compadd -m $($COMMAND -help | perl -ne 'if (/^\s*-\(?(\S+)/) { - $n = $1; - $n =~ s/\)//g; - print $n =~ s/^\[([a-z]+)\]// ? "$n\n$1$n\n" : "$n\n"; - }') - return -elif [[ -iprefix '+' || -iprefix '@' || -current -1 -draftfolder ]]; then + if _wanted options; then + _all_labels options expl option \ + compadd - $($words[1] -help | perl -ne 'if (/^\s*-\(?(\S+)/) { + $n = $1; + $n =~ s/\)//g; + print $n =~ s/^\[([a-z]+)\]// ? "$n\n$1$n\n" : "$n\n"; + }') + return + fi + return 1 +elif compset -P 1 '[+@]' || [[ "$prev" = -draftfolder ]]; then # Complete folder names. local mhpath + if [[ $IPREFIX != '@' ]]; then [[ $IPREFIX = '+' ]] || IPREFIX=+ mhpath=$mymhdir @@ -30,13 +38,12 @@ elif [[ -iprefix '+' || -iprefix '@' || -current -1 -draftfolder ]]; then mhpath=$(mhpath) fi - # painless, or what? - complist -W mhpath -/ -elif [[ -mcurrent -1 -(editor|(whatnow|rmm|show|more)proc) ]]; then - complist -c -elif [[ -current -1 -file ]]; then - complist -f -elif [[ -mcurrent -1 -(form|audit|filter) ]]; then + _wanted files expl 'MH folder' _path_files -W mhpath -/ +elif [[ "$prev" = -(editor|(whatnow|rmm|show|more)proc) ]]; then + _command_names -e +elif [[ "$prev" = -file ]]; then + _files +elif [[ "$prev" = -(form|audit|filter) ]]; then # Need some MH template file, which may be in our own MH directory # or with the standard library. local mhfpath @@ -44,15 +51,16 @@ elif [[ -mcurrent -1 -(form|audit|filter) ]]; then [[ -d $mhlib ]] || { mhlib=$(mhparam mhlproc); mhlib=$mhlib:h; } mhfpath=($mymhdir $mhlib) - complist -W mhfpath -g '*(.)' -elif [[ -mcurrent -1 -(no|)cc ]]; then - compadd -m all to cc me -elif [[ -mcurrent -1 -[rw]cache ]]; then - compadd -m public private never ask + _wanted files expl 'MH template file' _files -W mhfpath -g '*(.)' +elif [[ "$prev" = -(no|)cc ]]; then + _wanted -C "$prev" values expl 'CC address' compadd all to cc me +elif [[ "$prev" = -[rw]cache ]]; then + _wanted -C "$prev" values expl cache compadd public private never ask else # Generate sequences. - local foldnam folddir f - for f in $argv; do + local foldnam folddir f ret + + for f in $words; do [[ $f = [@+]* ]] && foldnam=$f done if [[ $foldnam = '+'* ]]; then @@ -64,7 +72,14 @@ else # leaving foldnam empty works here fi - complist -s '$(mark $foldnam | awk -F: '\''{ print $1 }'\'')' - compadd -m reply next cur prev first last all unseen - complist -W folddir -g '<->' + if _wanted sequences; then + while _next_label sequences expl sequence; do + compadd "$expl[@]" $(mark $foldnam 2>/dev/null | awk -F: '{ print $1 }') && + ret=0 + compadd "$expl[@]" reply next cur prev first last all unseen && ret=0 + _files "$expl[@]" -W folddir -g '<->' && ret=0 + (( ret )) || return 0 + done + fi + return ret fi diff --git a/Completion/User/_nedit b/Completion/User/_nedit index 1f030e369..a3fcd9785 100644 --- a/Completion/User/_nedit +++ b/Completion/User/_nedit @@ -40,10 +40,11 @@ else '(-background)-bg[specify background color]:background color:_x_color' \ '(-fg)-foreground:foreground color:_x_color' \ '(-foreground)-fg[specify foreground color]:foreground color:_x_color' \ - '-import[load additional preferences file]:nedit preferences file:_files' \ + '*-import[load additional preferences file]:nedit preferences file:_files' \ "$nedit_common[@]" fi -[[ $state = lang ]] && _wanted neditlanguages expl 'language mode' && - compadd "$expl[@]" - ${(f)"$(sed -n \ - '/^nedit.languageMode/,/^nedit/ s/.* \([^:]*\).*/\1/p' < ~/.nedit)"} +[[ $state = lang ]] && + _wanted neditlanguages expl 'language mode' \ + compadd - ${(f)"$(sed -n \ + '/^nedit.languageMode/,/^nedit/ s/.* \([^:]*\).*/\1/p' < ~/.nedit)"} diff --git a/Completion/User/_netscape b/Completion/User/_netscape index f176083d2..b29c27c6c 100644 --- a/Completion/User/_netscape +++ b/Completion/User/_netscape @@ -1,8 +1,9 @@ #compdef netscape -local state +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args -_x_arguments \ +_x_arguments -C \ '-xrm:resource:_x_resource' \ '-help[show usage message]' \ '-version[show the version number and build date]' \ @@ -21,55 +22,70 @@ _x_arguments \ -{,no-}{,irix-}session-management \ -{done-save,ignore}-geometry-prefs \ -{component-bar,composer,edit,messenger,mail,discussions,news} \ - '*:location:->urls' + '*:location:->urls' && ret=0 + +[[ "$state" = "urls" ]] && + _files "$@" && return 0 -[ "$state" = "urls" ] && _files "$@" && return # Handle netscape remote commands -if [ "$state" = "remote" ]; then +if [[ "$state" = "remote" ]]; then local -a remote_commands remote_commands=(openURL openFile saveAs mailto addBookmark) [[ $compstate[quoting] = (double|single) ]] && compset -q compset -P '*\(' case $IPREFIX in - openURL*|addBookmark* ) state=urls;; - openFile* ) _files -W ~;; - saveAs* ) + openURL*|addBookmark*) state=urls;; + openFile*) _files -W ~;; + saveAs*) if compset -P "*,"; then - compadd -s")" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript + _wanted types expl 'data type' \ + compadd -s")" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript && + ret=0 else - _path_files -W ~ + _files -W ~ && ret=0 fi ;; - mailto* ) + mailto*) compset -P "*," if compset -P '*@'; then - _description expl 'remote host name' - _hosts "$expl[@]" -q -S, + _wanted hosts expl 'remote host name' _hosts -q -S, && ret=0 else - _description expl 'login name' - _users "$expl[@]" -q -S@ + _wanted users expl 'login name' _users -q -S@ && ret=0 fi ;; - * ) - if [ "$QIPREFIX" ]; then - compadd -q -S '(' -M 'm:{a-zA-Z}={A-Za-z}' $remote_commands - else - compadd -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' $remote_commands + *) + if _wanted commands; then + if [[ -z "$QIPREFIX" ]]; then + _all_labels commands expl 'remote commands' \ + compadd -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' - \ + $remote_commands && ret=0 + else + _all_labels commands expl 'remote commands' \ + compadd -qS '(' -M 'm:{a-zA-Z}={A-Za-z}' - \ + $remote_commands && ret=0 + fi fi ;; esac fi -if [ "$state" = "urls" ]; then +if [[ "$state" = "urls" ]]; then # Complete netscape urls - if [[ -prefix about: ]]; then - compset -P about: - compadd authors blank cache document fonts global hype image-cache \ - license logo memory-cache mozilla plugins + if compset -P about: ; then + _wanted values expl 'about what' \ + compadd authors blank cache document fonts global hype image-cache \ + license logo memory-cache mozilla plugins && ret=0 else - compadd -S '' about: mocha: javascript: - _urls "$@" + if _wanted prefixes; then + while _next_label prefixes expl 'URL prefix'; do + compadd "$expl[@]" -S '' about: mocha: javascript: && ret=0 + _urls "$@" && ret=0 + (( ret )) || return 0 + done + fi fi fi + +return ret diff --git a/Completion/User/_tiff b/Completion/User/_tiff index bbc331442..8fd008f0f 100644 --- a/Completion/User/_tiff +++ b/Completion/User/_tiff @@ -10,21 +10,22 @@ fi if [[ $# -ne 0 || $+_in_tiff -ne 0 ]]; then if (( ! $# )); then - _description expl 'picture file' + _description files expl 'picture file' set -- "$expl[@]" fi - _path_files "$@" -g "$pat" || _files "$@" -g '*.(#i)tiff' + _wanted files expl 'picture file' _path_files "$@" -g "$pat" - || + _files "$@" "$expl[@]" -g '*.(#i)tiff' return fi local _in_tiff=yes -local state line ret=1 -typeset -A options +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args case "$words[1]" in tiff2bw) - _arguments \ + _arguments -C \ '-c[specify compression scheme]:compression scheme:->compress' \ '-r[specify rows per strip]:rows per strip:' \ '-R[specify percentage of red channel]:percentage of red channel:' \ @@ -59,7 +60,7 @@ tiffcmp) ':second input TIFF file:_files -g \*.\(\#i\)' && ret=0 ;; tiffcp) - _arguments \ + _arguments -C \ '-B[write output in bin-endian byte order]' \ '-c[specify compression scheme]:compression scheme:->compress' \ '-o[set initial TIFF directory (file offset)]:file offset:' \ @@ -74,7 +75,7 @@ tiffcp) '*:input TIFF file:_files -g \*.\(\#i\)' && ret=0 ;; tiffdither) - _arguments \ + _arguments -C \ '-c[specify compression scheme]:compression scheme:->compress' \ '-f[specify fill order]:fill order:(lsb2msb msb2lsb)' \ '-r[specify rows per strip]:rows per strip:' \ @@ -102,7 +103,7 @@ tiffinfo) '*:input TIFF file:_files -g \*.\(\#i\)' && ret=0 ;; tiffmedian) - _arguments \ + _arguments -C \ '-r[specify rows per strip]:rows per strip:' \ '-C[specify number of colormap entries]:number of colormap entries:' \ '-c[specify compression scheme]:compression scheme:->compress' \ @@ -135,14 +136,14 @@ fax2tiff) ':FAX input file:_files -g \*.\(\#i\)\(g\[34\]\|fax\)' && ret=0 ;; gif2tiff) - _arguments \ + _arguments -C \ '-r[specify rows per strip]:rows per strip:' \ '-c[specify compression scheme]:compression scheme:->compress' \ ':input GIF file:_files -g \*.\(\#i\)gif' \ ':output file:_files -g \*.\(\#i\)tiff' && ret=0 ;; ppm2tiff) - _arguments \ + _arguments -C \ '-r[specify rows per strip]:rows per strip:' \ '-c[specify compression scheme]:compression scheme:->compress' \ '-R[specify resolution]:resolution:' \ @@ -150,14 +151,14 @@ ppm2tiff) ':output file:_files -g \*.\(\#i\)tiff' && ret=0 ;; ras2tiff) - _arguments \ + _arguments -C \ '-r[specify rows per strip]:rows per strip:' \ '-c[specify compression scheme]:compression scheme:->compress' \ ':input raster image file:_files -g \*.\(\#i\)ras\(\|t\)' \ ':output file:_files -g \*.\(\#i\)tiff' && ret=0 ;; pal2rgb) - _arguments \ + _arguments -C \ '-C[specify number of bits for colormap entries]:bits for colormap entries:(8 16)' \ '-p[set sample packing]:sample packing:(contig separate)' \ '-c[specify compression scheme]:compression scheme:->compress' \ @@ -166,7 +167,7 @@ pal2rgb) ':output file:_files -g \*.\(\#i\)tiff' && ret=0 ;; *) - _description expl 'picture file' + _description files expl 'picture file' _files "$expl[@]" -g "$pat" && ret=0 esac @@ -194,9 +195,13 @@ if [[ -n "$state" ]]; then ;; esac else - _description expl 'compression scheme' - compadd "$expl[@]" - none g4 packbits && ret=0 - compadd "$expl[@]" -qS: - lzw zip jpeg g3 && ret=0 + if _wanted values; then + while _next_label values expl 'compression scheme'; do + compadd "$expl[@]" - none g4 packbits && ret=0 + compadd "$expl[@]" -qS: - lzw zip jpeg g3 && ret=0 + (( ret )) || return 0 + done + fi fi fi diff --git a/Completion/User/_urls b/Completion/User/_urls index 19f7eea3a..03e8902cb 100644 --- a/Completion/User/_urls +++ b/Completion/User/_urls @@ -1,65 +1,155 @@ -#autoload +#compdef curl # Usage: _urls [-f] # Options: -# -f : complete files. - -# To complete URLs, you must make a URL database locally such as: +# -f : complete files first. +# +# Configuration styles used: +# +# path +# The path to a directory containing a URL database, such as: +# +# % cd ~/.zsh/urls +# % find . -ls +# ... drwxr-xr-x ... 512 Sep 3 02:46 . +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http +# ... drwxr-xr-x ... 512 Sep 3 02:52 ./http/www.zsh.org +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers +# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999 +# ... -rw-r--r-- ... 0 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999/index.html +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk/zsh +# ... drwxr-xr-x ... 512 Sep 3 02:47 ./bookmark +# ... drwxr-xr-x ... 512 Sep 3 02:48 ./bookmark/zsh +# ... -rw-r--r-- ... 27 Sep 3 02:47 ./bookmark/zsh/home +# ... -rw-r--r-- ... 20 Sep 3 02:48 ./bookmark/zsh/meta +# % cat bookmark/zsh/home +# http://sunsite.auc.dk/zsh/ +# % cat bookmark/zsh/meta +# http://www.zsh.org/ # -# % cd ~/.zsh/urls -# % find . -ls -# ... drwxr-xr-x ... 512 Sep 3 02:46 . -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http -# ... drwxr-xr-x ... 512 Sep 3 02:52 ./http/www.zsh.org -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers -# ... drwxr-xr-x ... 512 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999 -# ... -rw-r--r-- ... 0 Sep 3 03:01 ./http/www.zsh.org/mla/workers/1999/index.html -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./http/sunsite.auc.dk/zsh -# ... drwxr-xr-x ... 512 Sep 3 02:47 ./bookmark -# ... drwxr-xr-x ... 512 Sep 3 02:48 ./bookmark/zsh -# ... -rw-r--r-- ... 27 Sep 3 02:47 ./bookmark/zsh/home -# ... -rw-r--r-- ... 20 Sep 3 02:48 ./bookmark/zsh/meta +# local +# Specify a local web server as an array with three elements: +# <hostname> <doc root> <user area> +# where hostname is the name of the web server, doc root is the path to +# the default web pages for the server and user area is the directory +# name used by a user placing web pages within their home area. +# E.g.: +# zstyle ':completion:*:urls' local www /usr/local/apache/htdocs public_html -local ipre scheme dirs files +local ipre scheme host user uhosts ret=1 expl +local urls_path localhttp +zstyle -s ":completion:${curcontext}:urls" path urls_path || + urls_path="${ZDOTDIR:-$HOME}/.zsh/urls" +zstyle -a ":completion:${curcontext}:urls" local localhttp +local localhttp_servername="$localhttp[1]" +local localhttp_documentroot="$localhttp[2]" +local localhttp_userdir="$localhttp[3]" if [[ "$1" = -f ]]; then shift - _files "$@" && return -fi - -if [[ -z "$compconfig[_urls_dir]" ]]; then - compconfig[_urls_dir]=${ZDOTDIR:-$HOME}/.zsh/urls + _wanted -C -f files && _files "$@" && return fi ipre="$IPREFIX" -if [[ -prefix [-+.a-z0-9]#: ]]; then - scheme="${PREFIX%%:*}" - compset -P "[-+.a-z0-9]#:" -else - compadd -S '' http:// ftp:// bookmark: - return +if ! compset -P '(#b)([-+.a-z0-9]#):' && _wanted -C argument prefixes; then + while _next_label prefixes expl 'URL prefix' "$@"; do + [[ -d $urls_path/bookmark ]] && + compadd "$expl[@]" -S '' bookmark: && ret=0 + compadd "$expl[@]" -S '' file: ftp:// gopher:// http:// && ret=0 + (( ret )) || return 0 + done + return ret fi +scheme="$match[1]" case "$scheme" in - http) compset -P // || { compadd "$@" -S '' //; return };; - ftp) compset -P // || { compadd "$@" -S '' //; return };; + http|ftp|gopher) + if ! compset -P //; then + _wanted -C "$scheme" prefixes expl 'end of prefix' compadd "$@" -S '' // + return + fi + ;; + file) + if ! compset -P //; then + _wanted -C file files || return 1 + + while _next_label files expl 'local file' "$@"; do + if [[ -prefix / ]]; then + _path_files "$expl[@]" -S '' -g '*(^/)' && ret=0 + _path_files "$expl[@]" -S/ -r '/' -/ && ret=0 + elif [[ -z "$PREFIX" ]]; then + compadd "$expl[@]" -S '/' -r '/' - "${PWD%/}" && ret=0 + fi + (( ret )) || return 0 + done + return ret + fi + ;; + bookmark) + if [[ -f "$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" && + -s "$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}" ]]; then + _wanted -C bookmark bookmarks expl bookmarks \ + compadd "$@" -U - \ + "$ipre$(<"$urls_path/$scheme/${(Q)PREFIX}${(Q)SUFFIX}")" && ret=0 + else + if _wanted -C bookmark files; then + while _next_label files expl 'bookmark'; do + _path_files -W "$urls_path/$scheme" "$expl[@]" -S '' -g '*(^/)' && + ret=0 + _path_files -W "$urls_path/$scheme" -S/ -r '/' -/ && ret=0 + (( ret )) || return 0 + done + fi + fi + return ret + ;; esac -if [[ "$scheme" = bookmark && - -f "$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX" && - -s "$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX" ]]; then - compadd "$@" -QU -- "$ipre$(<"$compconfig[_urls_dir]/$scheme/$PREFIX$SUFFIX")" -else - dirs=($compconfig[_urls_dir]/$scheme/$PREFIX*$SUFFIX(/:t)) - files=($compconfig[_urls_dir]/$scheme/$PREFIX*$SUFFIX(.:t)) - compset -P '*/' - compadd "$@" -Q -S '/' - $dirs - if [[ "$scheme" = bookmark ]]; then - compadd "$@" -QS '' - $files +# Complete hosts +if ! compset -P '(#b)([^/]#)/' && _wanted hosts; then + uhosts=($urls_path/$scheme/$PREFIX*$SUFFIX(/:t)) + + while _next_label hosts expl host "$@"; do + (( $#uhosts )) || _hosts -S/ && ret=0 + [[ "$scheme" = http ]] && uhosts=($uhosts $localhttp_servername) + compadd "$expl[@]" -S/ - $uhosts && ret=0 + (( ret )) || return 0 + done + return ret +fi +host="$match[1]" + +# Complete part after hostname + +_wanted -C local files || return 1 + +if [[ "$localhttp_servername" = "$host" ]]; then + if compset -P \~; then + if ! compset -P '(#b)([^/]#)/'; then + _users -S/ + return + fi + user="$match[1]" + while _next_label files expl 'local file'; do + _path_files "$expl[@]" -W ~$user/$localhttp_userdir -g '*(^/)' && ret=0 + _path_files "$expl[@]" -W ~$user/$localhttp_userdir -S/ -r '/' -/ && ret=0 + (( ret )) || return 0 + done else - compadd "$@" -Q - $files + while _next_label files expl 'local file'; do + _path_files "$expl[@]" -W $localhttp_documentroot -g '*(^/)' && ret=0 + _path_files "$expl[@]" -W $localhttp_documentroot -S/ -r '/' -/ && ret=0 + (( ret )) || return 0 + done fi +else + while _next_label files expl 'local file'; do + _path_files "$expl[@]" -W $urls_path/$scheme/$host -g '*(^/)' && ret=0 + _path_files "$expl[@]" -W $urls_path/$scheme/$host -S/ -r '/' -/ && ret=0 + (( ret )) || return 0 + done fi +return $ret diff --git a/Completion/User/_users b/Completion/User/_users index fc1e87e52..d04731af9 100644 --- a/Completion/User/_users +++ b/Completion/User/_users @@ -1,6 +1,10 @@ -#autoload +#compdef last passwd groups -local expl +local expl users -_description expl user -compgen "$@" "$expl[@]" -u +_wanted users || return 1 + +zstyle -a ":completion:${curcontext}:" users users && + _all_labels users expl user compadd "$@" - "$users[@]" && return 0 + +_all_labels users expl user compadd "$@" - "${(@k)userdirs}" diff --git a/Completion/User/_users_on b/Completion/User/_users_on index 920688089..b19cff6e7 100644 --- a/Completion/User/_users_on +++ b/Completion/User/_users_on @@ -1,10 +1,12 @@ -#autoload write +#compdef write local expl +_wanted users || return 1 + if which users >/dev/null; then - _description expl users logged on - compadd "$@" "$expl[@]" - $(users) && return 0 + _all_labels users expl 'users logged on' \ + compadd "$@" - $(_call users users) && return 0 else # Other methods of finding out users logged on should be added here return 1 diff --git a/Completion/X/_x_colormapid b/Completion/X/_x_colormapid index 4fe6aac42..3c637c1d9 100644 --- a/Completion/X/_x_colormapid +++ b/Completion/X/_x_colormapid @@ -2,7 +2,7 @@ local expl list desc -_wanted colormapids expl 'colormap id' || return 1 +_wanted colormapids || return 1 list=(${(f)"$(xprop -root -f RGB_COLOR_MAP 32xcccccccxx ': $0\n'|awk -F'[ ():]' '/^[a-zA-Z_]+\(RGB_COLOR_MAP\)/ {print $5, "--", $1}')"}) @@ -12,4 +12,5 @@ else desc=() fi -compadd "$expl[@]" "$@" "$desc[@]" - "${(@)list%% *}" +_all_labels colormapids expl 'colormap id' \ + compadd "$@" "$desc[@]" - "${(@)list%% *}" diff --git a/Completion/X/_x_extension b/Completion/X/_x_extension index 967938e28..11e53fa6c 100644 --- a/Completion/X/_x_extension +++ b/Completion/X/_x_extension @@ -2,16 +2,18 @@ local expl -(( $+_xe_cache )) || _xe_cache=( "${(@)${(@f)$(xdpyinfo)}[(r)number of extensions:*,-1][2,(r)default screen number:*][1,-2]//[ ]}" ) +_wanted extensions || return 1 -_description expl 'X extension' +(( $+_xe_cache )) || _xe_cache=( "${(@)${(@f)$(xdpyinfo)}[(r)number of extensions:*,-1][2,(r)default screen number:*][1,-2]//[ ]}" ) if [[ "$1" = -a ]]; then shift - compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - all "$_xe_cache[@]" + _all_labels extensions expl 'X extensions' \ + compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - all "$_xe_cache[@]" else [[ "$1" = - ]] && shift - compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - "$_xe_cache[@]" + _all_labels extensions expl 'X extensions' \ + compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - "$_xe_cache[@]" fi diff --git a/Completion/X/_x_font b/Completion/X/_x_font index e0acb4014..43a713b34 100644 --- a/Completion/X/_x_font +++ b/Completion/X/_x_font @@ -1,3 +1,16 @@ #autoload -_message 'font' +local expl + +_wanted fonts || return 1 + +# This *has* to be improved some day... + +if (( ! $+_font_cache )); then + typeset -gU _font_cache + + _font_cache=( "${(@)^${(@f)$(_call fonts xlsfonts)}%%--*}--" ) +fi + +_all_labels fonts expl font \ + compadd -M 'r:|-=* r:|=*' "$@" -S '' - "$_font_cache[@]" diff --git a/Completion/X/_x_keysym b/Completion/X/_x_keysym index 6b031014a..f50762f7e 100644 --- a/Completion/X/_x_keysym +++ b/Completion/X/_x_keysym @@ -2,6 +2,8 @@ local expl +_wanted keysyms || return 1 + if (( ! $+_keysym_cache )); then local file @@ -16,5 +18,5 @@ if (( ! $+_keysym_cache )); then fi fi -_description expl 'key symbol' -compadd "$@" "$expl[@]" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - $_keysym_cache +_all_labels keysyms expl 'key symbol' \ + compadd "$@" -M 'm:{a-z}={A-Z} r:|-=* r:|=*' - $_keysym_cache diff --git a/Completion/X/_x_window b/Completion/X/_x_window index 118c7f131..1862db9a7 100644 --- a/Completion/X/_x_window +++ b/Completion/X/_x_window @@ -1,19 +1,18 @@ #autoload -setopt localoptions extendedglob - local list expl -list=( "${(@)${(M@)${(@f)$(xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" ) +_wanted windows || return 1 + +list=( "${(@)${(M@)${(@f)$(_call windows xwininfo -root -tree)}:#[ ]#0x[0-9a-f]# \"*}##[ ]#}" ) if [[ "$1" = -n ]]; then shift - _description expl 'window name' - compadd "$@" "$expl[@]" -d list - "${(@)${(@)list#*\"}%%\"*}" + _all_labels windows expl 'window name' \ + compadd "$@" -d list - "${(@)${(@)list#*\"}%%\"*}" else [[ "$1" = - ]] && shift - _description expl 'window ID' - compadd "$@" "$expl[@]" -d list - "${(@)list%% *}" + _all_labels windows expl 'window ID' compadd "$@" -d list - "${(@)list%% *}" fi diff --git a/Completion/X/_xmodmap b/Completion/X/_xmodmap index 0f6514eb6..1cd461d4c 100644 --- a/Completion/X/_xmodmap +++ b/Completion/X/_xmodmap @@ -1,11 +1,9 @@ #compdef xmodmap -setopt localoptions extendedglob +local curcontext="$curcontext" state line ret=1 +typeset -A opt_args -local state line ret=1 -typeset -A options - -_x_arguments \ +_x_arguments -C \ -{help,grammar,verbose,quiet} \ '-n[only show what would be done]' \ '*-e[specify expression]:expression:->expr' \ @@ -57,7 +55,7 @@ if [[ -n "$state" ]]; then pointer*) if compset -P '*=[ ]#'; then compset -P '*[ ]' - _description expl 'button code' + _description values expl 'button code' compadd "$expl[@]" -qS ' ' 1 2 3 4 5 default return else @@ -84,9 +82,13 @@ if [[ -n "$state" ]]; then [[ "$what" = *ksym* ]] && _x_keysym "$suf[@]" && ret=0 else - _description expl command - compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0 - compadd "$expl[@]" -S ' = ' pointer && ret=0 + if _wanted commands; then + while _next_label commands expl command; do + compadd "$expl[@]" -S ' ' keycode keysym clear add remove && ret=0 + compadd "$expl[@]" -S ' = ' pointer && ret=0 + (( ret )) || return 0 + done + fi fi fi diff --git a/Completion/X/_xutils b/Completion/X/_xutils index 1818b447f..4eea8ded1 100644 --- a/Completion/X/_xutils +++ b/Completion/X/_xutils @@ -8,7 +8,7 @@ xdpyinfo) ;; xwininfo) _x_arguments \ - -{help,int,stats,bits,events,size,wm,shape,frame,all,english,metric} \ + -{help,int,children,tree,stats,bits,events,size,wm,shape,frame,all,english,metric} \ '(-id -name)-root' \ '(-id -root)-name:name: _x_window -n' \ '(-name -root)-id:id: _x_window' @@ -46,12 +46,33 @@ xev) '-rv' ;; xhost) - local expl type ret=1 + local expl type ret=1 tmp if compset -P '-'; then - _description expl 'disallow access' - compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \ - "${${(@M)${(@f)$(xhost)}[2,-1]:#LOCAL:*}#INET:}" + tmp=(${(f)"$(xhost)"}) + shift tmp + tmp=(${tmp:#LOCAL:|<*>}) + if [[ "$tmp" = *:* ]]; then + if compset -P '(#b)(*):'; then + type="$match[1]" + _wanted displays && + while _next_label displays expl 'disallow access'; do + { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - \ + ${${(M)tmp:#(#i)$type:*}#(#i)$type:} || + _hosts "$expl[@]" } && return 0 + done + else + _alternative \ + 'types:name family:compadd -S: ${(L)tmp%%:*}' \ + 'hosts:host:compadd ${(@)tmp#*:}' && ret=0 + fi + else + _wanted displays && + while _next_label displays expl 'disallow access'; do + { compadd "$expl[@]" -M 'm:{a-z}={A-Z} r:|[:.]=* r:|=*' - $tmp || + _hosts "$expl[@]" } && return 0 + done + fi else compset -P + @@ -66,9 +87,9 @@ xhost) krb) _message 'Kerberos V5 principal';; esac else - _description expl 'name family' - compadd -S: - inet dnet nis krb && ret=0 - _hosts && ret=0 + _alternative \ + 'types:name family:compadd -S: - inet dnet nis krb' \ + 'hosts:: _hosts' && ret=0 fi return ret fi @@ -120,7 +141,7 @@ xrdb) '(-global -all -screens)-screen' \ '(-global -all -screen)-screens' \ '-n[only display on stdout]' \ - '(-nocpp)-cpp:preprocessor program:_files -g \*\(\*\)' \ + '(-nocpp)-cpp:preprocessor program:_files -g \*\(-\*\)' \ '(-cpp)-nocpp' \ '(-load -override -merge -remove)-query' \ '(-query -override -merge -remove)-load' \ @@ -131,6 +152,7 @@ xrdb) '-backup:backup extension:' \ '*-D-:symbol to define:' \ '*-U-:symbol to undefine:' \ - '*-I-:include directory:_files -/' + '*-I-:include directory:_files -/' \ + '*:defaults file:_files' ;; esac diff --git a/Completion/X/_xwit b/Completion/X/_xwit index e86443a32..998627869 100644 --- a/Completion/X/_xwit +++ b/Completion/X/_xwit @@ -16,8 +16,8 @@ _xwit_guard () { _xwit_compopts () { local expl - _description options expl option - compadd "$expl[@]" - ${(k)no[(R)*~0]} || compadd "$expl[@]" - ${(k)no} + _wanted options expl option compadd - ${(k)no[(R)*~0]} || + _all_labels options expl option compadd - ${(k)no} } _regex_arguments _xwit_parse \ @@ -39,8 +39,8 @@ _regex_arguments _xwit_parse \ \| "/iconmove$nul/" "$guard" "/$word/" ":_message x" "/$word/" ":_message y" \ \| "/id$nul/" "$guard" "/$word/" ":_x_window" \ \| "/(no|)keyrepeat$nul/" "$guard" \ - \( "/[0-9]##$nul/" ":_message keycode" \ - \( "/-$nul/" "/[0-9]##$nul/" ":_message 'last keycode'" \| \) \) \# \ + \( "/[0-9]##$nul/" ":[[ -prefix [0-9]# ]] && _message keycode" \ + \( "/-$nul/" "/[0-9]##$nul/" ":[[ -prefix [0-9]# ]] && _message 'last keycode'" \| \) \) \# \ \| "/names$nul/" "$guard" "/$word/" ":_x_window -n" \# \ \| "/[]/" ':_xwit_compopts' \ \) \ diff --git a/Config/version.mk b/Config/version.mk index 5ed093b1b..c328c8dce 100644 --- a/Config/version.mk +++ b/Config/version.mk @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=3.1.5 -VERSION_DATE='October 29, 1998' +VERSION=3.1.6-dev-21 +VERSION_DATE='April 1, 2000' diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo index 8959543c5..cb7372cc5 100644 --- a/Doc/Zsh/builtins.yo +++ b/Doc/Zsh/builtins.yo @@ -17,17 +17,26 @@ item(tt(ARG1))( Same as tt(ARG2). )\ )\ +def(module)(2)(\ +item(tt(ARG1))( +See ifzman(the section `The ARG2 Module' in zmanref(zshmodules))\ +ifnzman(noderef(The ARG2 Module)). +)\ +)\ startitem() prefix(-) findex(.) item(tt(.) var(file) [ var(arg) ... ])( Read commands from var(file) and execute them in the current shell environment. -If var(file) does not contain a slash, or if tt(PATH_DIRS) -is set, the shell looks in the components of tt($path) to find the -directory containing var(file). -Files in the current directory are not read unless `tt(.)' appears -somewhere in tt($path). + +If var(file) does not contain a slash, or if tt(PATH_DIRS) is set, +the shell looks in the components of tt($path) to find the directory +containing var(file). Files in the current directory are not read +unless `tt(.)' appears somewhere in tt($path). If a file named +`var(file)tt(.zwc)' is found, is newer than var(file), and is the +compiled form (created with the tt(zcompile) builtin) of var(file), +then commands are read from that file instead of var(file). If any arguments var(arg) are given, they become the positional parameters; the old positional @@ -39,15 +48,16 @@ cindex(expanding parameters) cindex(parameters, expanding) cindex(doing nothing) item(tt(:) [ var(arg) ... ])( -This command only expands parameters. A zero exit code is returned. +This command does nothing, although normal argument expansions is performed +which may have effects on shell parameters. A zero exit code is returned. ) findex(alias) cindex(aliases, defining) cindex(aliases, listing) -item(tt(alias) [ tt(-gmrL) ] [ var(name)[tt(=)var(value)] ... ])( +item(tt(alias) [ {tt(PLUS()|tt(-))}tt(gmrL) ] [ var(name)[tt(=)var(value)] ... ])( For each var(name) with a corresponding var(value), define an alias with that value. A trailing space in var(value) causes the next word -to be checked for alias substitution. If the tt(-g) flag is present, +to be checked for alias expansion. If the tt(-g) flag is present, define a global alias; global aliases are expanded even if they do not occur in command position. @@ -58,7 +68,9 @@ are taken as patterns (they should be quoted to preserve them from being interpreted as glob patterns), and the aliases matching these patterns are printed. When printing aliases and the tt(-g) or tt(-r) flags are present, then restrict the printing to global or regular -aliases, respectively. +aliases, respectively. Using `tt(PLUS())' instead of `tt(-)', or ending +the option list with a single `tt(PLUS())', prevents the values of the +aliases from being printed. If the tt(-L) flag is present, then print each alias in a manner suitable for putting in a startup script. The exit @@ -68,7 +80,38 @@ which no alias has been defined. findex(autoload) cindex(functions, autoloading) cindex(autoloading functions) -alias(autoload)(functions -u) +item(tt(autoload) [ {tt(PLUS())|tt(-)}tt(UXmt) ] [ tt(-wkz) ] [ var(name) ... ])( +Equivalent to tt(functions -u), with the exception of tt(-X)/tt(+X), +tt(-w), tt(-k) and tt(-z). + +The flag tt(-X) may be used only inside a shell function, and may not be +followed by a var(name). It causes the calling function to be marked for +autoloading and then immediately loaded and executed, with the current +array of positional parameters as arguments. This replaces the previous +definition of the function. If no function definition is found, an error +is printed and the function remains undefined and marked for autoloading. + +The flag tt(+X) attempts to load each var(name) as an autoloaded function, +but does em(not) execute it. The exit status is zero (success) if the +function was not previously defined em(and) a definition for it was found. +This does em(not) replace any existing definition of the function. The +exit status is nonzero (failure) if the function was already defined or +when no definition was found. In the latter case the function remains +undefined and marked for autoloading. + +The flag tt(+X) may be combined with either tt(-k) or tt(-z) to make +the function be loaded using ksh-style or zsh-style autoloading, +respectively. If neither is given, the current setting of the +tt(KSH_AUTOLOAD) options determines how the function is loaded. With +ksh-style autoloading, the contents of the file will not be executed +immediatly. Instead, the function created will contain the contents of +the file plus a call to the function itself appended to it, thus given +normal ksh autoloading behaviour on the first call to the function. + +With the tt(-w) flag, the var(name)s are taken as names of files compiled +with the tt(zcompile) builtin, and all functions defined in them are +marked for autoloading. +) findex(bg) cindex(jobs, backgrounding) xitem(tt(bg) [ var(job) ... ]) @@ -76,6 +119,7 @@ item(var(job) ... tt(&))( Put each specified var(job) in the background, or the current job if none is specified. ) +module(bindkey)(zsh/zle) findex(break) cindex(exiting loops) cindex(loops, exiting) @@ -89,6 +133,7 @@ item(tt(builtin) var(name) [ var(args) ... ])( Executes the builtin var(name), with the given var(args). ) alias(bye)(exit) +module(cap)(zsh/cap) findex(cd) cindex(directories, changing) xitem(tt(cd) [ tt(-sLP) ] [ var(arg) ]) @@ -98,12 +143,13 @@ Change the current directory. In the first form, change the current directory to var(arg), or to the value of tt($HOME) if var(arg) is not specified. If var(arg) is `tt(-)', change to the value of tt($OLDPWD), the previous directory. -If a directory named var(arg) is not found in the current directory -and var(arg) does not begin with a slash, -search each component of the shell parameter tt(cdpath). -If the option tt(CDABLE_VARS) is set, and a parameter named var(arg) -exists whose value begins with a slash, treat its value as -the directory. +Otherwise, if a directory named var(arg) is not found in the current +directory and var(arg) does not begin with a slash, search each +component of the shell parameter tt(cdpath). If no directory is found +and the option tt(CDABLE_VARS) is set, and a parameter named var(arg) +exists whose value begins with a slash, treat its value as the +directory. In that case, the parameter is added to the named +directory hash table. The second form of tt(cd) substitutes the string var(new) for the string var(old) in the name of the current directory, @@ -124,7 +170,16 @@ to their true values. If the tt(-L) option is given symbolic links are followed regardless of the state of the tt(CHASE_LINKS) option. ) alias(chdir)(cd) +module(clone)(zsh/clone) prefix(command) +module(comparguments)(zsh/computil) +module(compcall)(zsh/compctl) +module(compctl)(zsh/compctl) +module(compdescribe)(zsh/computil) +module(compquote)(zsh/computil) +module(comptags)(zsh/computil) +module(comptry)(zsh/computil) +module(compvalues)(zsh/computil) findex(continue) cindex(loops, continuing) cindex(continuing loops) @@ -158,8 +213,8 @@ causes tt(disable) to act on aliases. The tt(-f) option causes tt(disable) to act on shell functions. The tt(-r) options causes tt(disable) to act on reserved words. Without arguments all disabled hash table elements from the corresponding hash table are printed. -With the tt(-m) flag the arguments are taken as patterns (should be -quoted to preserve them from being taken as glob patterns), and all hash +With the tt(-m) flag the arguments are taken as patterns (which should be +quoted to prevent them from undergoing filename expansion), and all hash table elements from the corresponding hash table matching these patterns are disabled. Disabled objects can be enabled with the tt(enable) command. @@ -214,13 +269,29 @@ cindex(compatibility, csh) cindex(sh, compatibility) cindex(ksh, compatibility) cindex(csh, compatibility) -item(tt(emulate) [ tt(-R) ] {tt(zsh)|tt(sh)|tt(ksh)|tt(csh)})( +item(tt(emulate) [ tt(-LR) ] {tt(zsh)|tt(sh)|tt(ksh)|tt(csh)})( Set up zsh options to emulate the specified shell as much as possible. bf(csh) will never be fully emulated. If the argument is not one of the shells listed above, tt(zsh) -will be used as a default. If the tt(-R) option is given, all options +will be used as a default; more precisely, the tests performed on the +argument are the same as those used to determine the emulation at startup +based on the shell name, see +ifzman(\ +the section `Compatibility' in zmanref(zshmisc) +)\ +ifnzman(\ +noderef(Compatibility) +)\ +. If the tt(-R) option is given, all options are reset to their default value corresponding to the specified emulation -mode. +mode, except for certain options describing the interactive +environment; otherwise, only those options likely to cause portability +problems in scripts and functions are altered. If the tt(-L) option +is given, the options tt(LOCAL_OPTIONS) and tt(LOCAL_TRAPS) will be set as +well, causing the effects of the tt(emulate) command and any tt(setopt) and +tt(trap) commands to be local to the immediately surrounding shell +function, if any; normally these options are turned off in all emulation +modes except tt(ksh). ) findex(enable) cindex(enabling commands) @@ -256,8 +327,7 @@ findex(export) item(tt(export) [ var(name)[tt(=)var(value)] ... ])( The specified var(name)s are marked for automatic export to the environment of subsequently executed commands. -Equivalent to tt(typeset -x), except that no parameter will be created -to hide an existing one in an outer scope. +Equivalent to tt(typeset -gx). If a parameter specified does not already exist, it is created in the global scope. ) @@ -308,13 +378,16 @@ With the tt(-D) flag, tt(fc) prints elapsed times. cindex(history, file) cindex(file, history) -tt(fc -R) reads the history from the given file, -tt(fc -W) writes the history out to the given file, -and tt(fc -A) appends the history out to the given file. -If the tt(-I) option is added, only those -events that are new since last incremental append (write) to -the history file are appended (written). -In any case the file will have no more than tt($SAVEHIST) +`tt(fc -R)' reads the history from the given file, +`tt(fc -W)' writes the history out to the given file, +and `tt(fc -A)' appends the history out to the given file. +If no filename is specified, the tt($HISTFILE) is assumed. +If the tt(-I) option is added to tt(-R), only those events that are +not already contained within the internal history list are added. +If the tt(-I) option is added to tt(-A) or tt(-W), only those +events that are new since last incremental append/write to +the history file are appended/written. +In any case, the created file will have no more than tt($SAVEHIST) entries. ) findex(fg) @@ -325,10 +398,16 @@ item(var(job) ...)( Bring each specified var(job) in turn to the foreground. If no var(job) is specified, resume the current job. ) +findex(float) +item(tt(float) [ {tt(PLUS())|tt(-)}tt(EFghlrtux) ] [ var(name)[tt(=)var(value)] ... ])( +Equivalent to tt(typeset -E), except that options irrelevant to floating +point numbers are not permitted. +) findex(functions) -item(tt(functions) [ {tt(PLUS())|tt(-)}tt(tum) ] [ var(name) ... ])( +item(tt(functions) [ {tt(PLUS())|tt(-)}tt(UXmtu) ] [ var(name) ... ])( Equivalent to tt(typeset -f). ) +module(getcap)(zsh/cap) findex(getln) cindex(line, reading) cindex(reading a line) @@ -357,11 +436,20 @@ is stored in tt(OPTARG). vindex(OPTIND, use of) vindex(OPTARG, use of) +The first option to be examined may be changed by explicitly assigning +to tt(OPTIND). tt(OPTIND) has an initial value of tt(1), and is +normally reset to tt(1) upon exit from a shell function. tt(OPTARG) +is not reset and retains its value from the most recent call to +tt(getopts). If either of tt(OPTIND) or tt(OPTARG) is explicitly +unset, it remains unset, and the index or option argument is not +stored. The option itself is still stored in var(name) in this case. + A leading `tt(:)' in var(optstring) causes tt(getopts) to store the -letter of the invalid option in tt(OPTARG), and to set var(name) -to `tt(?)' for an unknown option and to `tt(:)' when a required option -is missing. Otherwise, tt(getopts) prints an error -message. The exit status is nonzero when there are no more options. +letter of any invalid option in tt(OPTARG), and to set var(name) to +`tt(?)' for an unknown option and to `tt(:)' when a required option is +missing. Otherwise, tt(getopts) sets var(name) to `tt(?)' and prints +an error message when an option is invalid. The exit status is +nonzero when there are no more options. ) findex(hash) item(tt(hash) [ tt(-dfmrv) ] [ var(name)[tt(=)var(value)] ] ...)( @@ -386,7 +474,7 @@ and for the named directory hash table this adds all users' home directories. These two options cannot be used with any arguments. The tt(-m) option causes the arguments to be taken as patterns -(they should be quoted) and the elements of the hash table +(which should be quoted) and the elements of the hash table matching those patterns are printed. This is the only way to display a limited selection of hash table elements. @@ -409,7 +497,7 @@ added by explicit specification. If has no effect if used with tt(-f). ) alias(history)(fc -l) findex(integer) -item(tt(integer) [ {tt(PLUS())|tt(-)}tt(lrtux) ] [ var(name)[tt(=)var(value)] ... ])( +item(tt(integer) [ {tt(PLUS())|tt(-)}tt(ghlrtux) ] [ var(name)[tt(=)var(value)] ... ])( Equivalent to tt(typeset -i), except that options irrelevant to integers are not permitted. ) @@ -475,18 +563,23 @@ If no var(resource) is given, print all limits. var(resource) can be one of: startsitem() -sitem(tt(memorylocked))(Maximum amount of memory locked in RAM.) -sitem(tt(resident))(Maximum resident set size.) -sitem(tt(vmemorysize))(Maximum amount of virtual memory.) -sitem(tt(descriptors))(Maximum value for a file descriptor.) +sitem(tt(addressspace))(Maximum amount of address space used.) +sitem(tt(aiomemorylocked))(Maximum amount of memory locked in RAM for AIO operations.) +sitem(tt(aiooperations))(Maximum number of AIO operations.) +sitem(tt(cachedthreads))(Maximum number of cached threads.) sitem(tt(coredumpsize))(Maximum size of a core dump.) -sitem(tt(stacksize))(Maximum stack size for each process.) +sitem(tt(cputime))(Maximum CPU seconds per process.) sitem(tt(datasize))(Maximum data size (including stack) for each process.) +sitem(tt(descriptors))(Maximum value for a file descriptor.) sitem(tt(filesize))(Largest single file allowed.) -sitem(tt(cputime))(Maximum CPU seconds per process.) sitem(tt(maxproc))(Maximum number of processes.) -sitem(tt(addressspace))(Maximum amount of address space used.) -sitem(tt(cachedthreads))(Maximum number of cached threads.) +sitem(tt(maxpthreads))(Maximum number of threads per process.) +sitem(tt(memorylocked))(Maximum amount of memory locked in RAM.) +sitem(tt(memoryuse))(Maximum resident set size.) +sitem(tt(resident))(Maximum resident set size.) +sitem(tt(sockbufsize))(Maximum size of all socket buffers.) +sitem(tt(stacksize))(Maximum stack size for each process.) +sitem(tt(vmemorysize))(Maximum amount of virtual memory.) endsitem() Which of these resource limits are available depends on the system. @@ -502,8 +595,8 @@ sitem([var(mm)tt(:)]var(ss))(minutes and seconds) endsitem() ) findex(local) -item(tt(local) [ {tt(PLUS())|tt(-)}tt(LRZilrtu) [var(n)]] [ var(name)[tt(=)var(value)] ] ...)( -Same as tt(typeset), except that the options tt(-x) and +item(tt(local) [ {tt(PLUS())|tt(-)}tt(AEFLRUZahilrtu) [var(n)]] [ var(name)[tt(=)var(value)] ] ...)( +Same as tt(typeset), except that the options tt(-g), tt(-x) and tt(-f) are not permitted. ) findex(log) @@ -521,8 +614,8 @@ Same as tt(exit), except that it only works in a login shell. prefix(noglob) findex(popd) item(tt(popd) [ {tt(PLUS())|tt(-)}var(n) ])( -Removes a entry from the directory stack, and perform a tt(cd) to -the new top directory. With no argument, the current top entry is +Remove an entry from the directory stack, and perform a tt(cd) to +the new top directory. With no argument, the current top entry is removed. An argument of the form `tt(PLUS())var(n)' identifies a stack entry by counting from the left of the list shown by the tt(dirs) command, starting with zero. An argument of the form tt(-n) counts from the right. @@ -531,7 +624,7 @@ If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and `tt(-)' in this context are swapped. ) findex(print) -item(tt(print) [ tt(-nrslzpNDPoOicm) ] [ tt(-u)var(n) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( +item(tt(print) [ tt(-bnrslzpNDPoOicm) ] [ tt(-u)var(n) ] [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( With no flags or with flag `tt(-)', the arguments are printed on the standard output as described by tt(echo), with the following differences: the escape sequence `tt(\M-)var(x)' metafies the character @@ -551,6 +644,13 @@ unless the tt(-e) flag is given. The tt(-n) flag suppresses the trailing newline. Only the tt(-e) and tt(-n) flags are recognized after tt(-R); all other arguments and options are printed. ) +item(tt(-b))( +Recognize all the escape sequences defined for the tt(bindkey) command, +see +ifzman(zmanref(zshmodules))\ +ifnzman(noderef(The zsh/zle Module))\ +. +) item(tt(-m))( Take the first argument as a pattern (should be quoted), and remove it from the argument list together with subsequent arguments that @@ -575,8 +675,8 @@ item(tt(-O))( Print the arguments sorted in descending order. ) item(tt(-i))( -If given together with tt(-o) or tt(-O), makes them work case -independently. +If given together with tt(-o) or tt(-O), sorting is performed +case-independently. ) item(tt(-c))( Print the arguments in columns. @@ -615,21 +715,9 @@ If var(arg) is not specified, change to the second directory on the stack (that is, exchange the top two entries), or change to tt($HOME) if the tt(PUSHD_TO_HOME) option is set or if there is only one entry on the stack. - -If var(arg) is `tt(-)', change to tt($OLDPWD), the previous directory. -If a directory named var(arg) is not found in the current directory -and var(arg) does not contain a slash, -search each component of the shell parameter tt(cdpath). -If the option tt(CDABLE_VARS) is set, and a parameter named var(arg) -exists whose value begins with a slash, treat its value as -the directory. - -If the option tt(PUSHD_SILENT) is not set, the directory -stack will be printed after a tt(pushd) is performed. - -The second form of tt(pushd) substitutes the string var(new) -for the string var(old) in the name of the current directory, -and tries to change to this new directory. +Otherwise, var(arg) is interpreted as it would be by tt(cd). +The meaning of var(old) and var(new) in the second form is also +the same as for tt(cd). The third form of tt(pushd) changes directory by rotating the directory list. An argument of the form `tt(PLUS())var(n)' identifies a stack @@ -637,6 +725,9 @@ entry by counting from the left of the list shown by the tt(dirs) command, starting with zero. An argument of the form `tt(-)var(n)' counts from the right. If the tt(PUSHD_MINUS) option is set, the meanings of `tt(PLUS())' and `tt(-)' in this context are swapped. + +If the option tt(PUSHD_SILENT) is not set, the directory +stack will be printed after a tt(pushd) is performed. ) findex(pushln) item(tt(pushln) [ var(arg) ... ])( @@ -672,12 +763,16 @@ Read only one character from the terminal and set var(name) to With this flag set the return value is zero only if the character was `tt(y)' or `tt(Y)'. Note that this always reads from the terminal, even if used with the tt(-p) or tt(-u) or tt(-z) flags or with redirected input. +This option may also be used within zle widgets. ) item(tt(-k) [ var(num) ])( Read only one (or var(num)) characters. All are assigned to the first var(name), without word splitting. This flag is ignored when tt(-q) is present. Input is read from the terminal unless one of tt(-u) or tt(-p) -is present. +is present. This option may also be used within zle widgets. + +Note that var(num) must be in the argument word that follows tt(-k), not +in the same word. See tt(-u). ) item(tt(-z))( Read one entry from the editor buffer stack and assign it to the first @@ -714,7 +809,8 @@ and that when the cursor is at the end of the line, its character index is the length of the line plus one. ) item(tt(-u)var(n))( -Input is read from file descriptor var(n). +Input is read from file descriptor var(n), where var(n) is a single +digit and must em(not) be separated from tt(-u) by any whitespace. ) item(tt(-p))( Input is read from the coprocess. @@ -727,7 +823,8 @@ is interactive. The value (exit status) of tt(read) is 1 when an end-of-file is encountered, or when tt(-c) or tt(-l) is present and the command is -not called from a tt(compctl) function. Otherwise the value is 0. +not called from a tt(compctl) function, or as described for tt(-q). +Otherwise the value is 0. The behavior of some combinations of the tt(-k), tt(-p), tt(-q), tt(-u) and tt(-z) flags is undefined. Presently tt(-q) cancels all the others, @@ -757,6 +854,7 @@ trap is passed as the first argument, so the statement `tt(return $((128PLUS()$1)))' will return the same status as if the signal had not been trapped. ) +module(sched)(zsh/sched) findex(set) cindex(parameters, listing) cindex(parameters, positional) @@ -781,6 +879,7 @@ given, then the names and values of all parameters are printed on the standard output. If the only argument is `tt(PLUS())', the names of all parameters are printed. ) +module(setcap)(zsh/cap) findex(setopt) cindex(options, setting) item(tt(setopt) [ {tt(PLUS())|tt(-)}var(options) | \ @@ -789,8 +888,8 @@ Set the options for the shell. All options specified either with flags or by name are set. If no arguments are supplied, the names of all options currently set are printed. If the tt(-m) flag is given the arguments are taken as patterns -(which should be quoted to preserve them from being interpreted as glob -patterns), and all options with names matching these patterns are set. +(which should be quoted to protect them from filename expansion), and all +options with names matching these patterns are set. ) findex(shift) cindex(parameters, positional) @@ -806,6 +905,7 @@ item(tt(source) var(file) [ var(arg) ... ])( Same as tt(.), except that the current directory is always searched and is always searched first, before directories in tt($path). ) +module(stat)(zsh/stat) findex(suspend) cindex(shell, suspending) cindex(suspending the shell) @@ -831,11 +931,12 @@ findex(trap) cindex(signals, trapping) cindex(trapping signals) item(tt(trap) [ var(arg) [ var(sig) ... ] ])( -var(arg) is a command to be read and executed when the shell +var(arg) is a series of commands (usually quoted to protect it from +immediate evaluation by the shell) to be read and executed when the shell receives var(sig). Each var(sig) can be given as a number or as the name of a signal. If var(arg) is `tt(-)', then all traps var(sig) are reset to their -default values. If var(arg) is the null string, then this signal +default values. If var(arg) is the empty string, then this signal is ignored by the shell and by the commands it invokes. If var(sig) is tt(ZERR) then var(arg) will be executed @@ -851,6 +952,20 @@ then the command var(arg) is executed when the shell terminates. The tt(trap) command with no arguments prints a list of commands associated with each signal. + +Note that traps defined with the tt(trap) builtin are slightly different +from those defined as `tt(TRAP)var(NAL) () { ... }', as the latter have +their own function environment (line numbers, local variables, etc.) while +the former use the environment of the command in which they were called. +For example, + +example(trap 'print $LINENO' DEBUG) + +will print the line number of a command executed after it has run, while + +example(TRAPDEBUG() { print $LINENO; }) + +will always print the number zero. ) findex(true) cindex(doing nothing, successfully) @@ -876,21 +991,83 @@ Equivalent to tt(whence -v). findex(typeset) cindex(parameters, setting) cindex(parameters, declaring) -item(tt(typeset) [ {tt(PLUS())|tt(-)}tt(LRUZfilrtuxm) [var(n)]] [ var(name)[tt(=)var(value)] ... ])( -Set attributes and values for shell parameters. -When invoked inside a function a new parameter is created which will be -unset when the function completes. The new parameter will not be -exported unless tt(ALL_EXPORT) is set, in which case the parameter will be -exported provided no parameter of that name already exists. -The following attributes are valid: +xitem(tt(typeset) [ {tt(PLUS())|tt(-)}tt(AEFLRUZafghilrtuxm) [var(n)]] [ \ +var(name)[tt(=)var(value)] ... ]) +item(tt(typeset) -T [ {tt(PLUS()|tt(-))}tt(LRUZrux) ] \ + var(SCALAR)[tt(=)var(value)] var(array))( +Set or display attributes and values for shell parameters. + +A parameter is created for each var(name) that does not already refer +to one. When inside a function, a new parameter is created for every +var(name) (even those that already exist), and is unset again when the +function completes. See +ifzman(`Local Parameters' in zmanref(zshparam))\ +ifnzman(noderef(Local Parameters))\ +. Local parameters are not exported unless tt(ALL_EXPORT) is set, in +which case the parameter is exported em(only) when var(name) does not +already exist. The same rules apply to special shell parameters, which +retain their special attributes when made local. + +For each var(name)tt(=)var(value) assignment, the parameter +var(name) set to var(value). Note that arrays currently cannot be +assigned in tt(typeset) expressions, only scalars and integers. + +For each remaining var(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 if any attribute flags +listed below are given. Using `tt(PLUS())' instead of minus to introduce +an attribute turns it off. + +If the tt(-T) option is given, exactly two (or zero) var(name) +arguments must be present. They represent a scalar and an array (in +that order) that will be tied together in the manner of tt($PATH) and +tt($path). In other words, an array present in the latter variable +appears as a scalar with the elements of the array joined by colons in +the former. Only the scalar may have an initial value. Both the +scalar and the array may otherwise be manipulated as normal. If one +is unset, the other will automatically be unset too. There is no way +of untying the variables without unsetting them, or converting the +type of one them with another tt(typeset) command; tt(+T) does not work, +assigning an array to var(SCALAR) is an error, and assigning a scalar +to var(array) sets it to be a single-element array. Note that +both tt(typeset -xT ...) and tt(export -T ...) work, but only the +scalar will be marked for export. + +The flag tt(-g) (global) flag is treated specially: it means that any +resulting parameter will not be restricted to local scope. Note that this +does not necessarily mean that the parameter will be global, as the flag +will apply to any existing parameter (even if unset) from an enclosing +function. This flag does not affect the parameter after creation, hence it +has no effect when listing existing parameters, nor does the flag tt(+g) +have any effect. + +If no var(name) is present, the names and values of all parameters are +printed. In this case the attribute flags restrict the display to only +those parameters that have the specified attributes, and using `tt(PLUS())' +rather than `tt(-)' to introduce the flag suppresses printing of the values +of parameters when there is no parameter name. Also, if the option list +ends with `tt(PLUS())', values will not be printed. If only the tt(-m) +flag is given the arguments are taken as patterns (which should be quoted) +and all parameters (or functions with the tt(-f) flag) with matching names +are printed. If no attribute flags and no tt(-m) flag is present, the +parameter names will be preceded by a list of any attributes (tt(array), +tt(association), tt(exported), tt(integer), tt(readonly)). + +The following attribute flags may be specified: startitem() +item(tt(-A))( +The names refer to associative array parameters; see +ifzman(`Array Parameters' in zmanref(zshparam))\ +ifnzman(noderef(Array Parameters))\ +. +) item(tt(-L))( Left justify and remove leading blanks from var(value). If var(n) is nonzero, it defines the width of the field; otherwise it is determined by the width of the value of the first assignment. -When the parameter is printed, it is filled on the right with +When the parameter is expanded, it is filled on the right with blanks or truncated if necessary to fit the field. Leading zeros are removed if the tt(-Z) flag is also set. ) @@ -899,13 +1076,14 @@ Right justify and fill with leading blanks. If var(n) is nonzero if defines the width of the field; otherwise it is determined by the width of the value of the first assignment. -When the parameter is printed, the field is left filled with +When the parameter is expanded, the field is left filled with blanks or truncated from the end. ) item(tt(-U))( -For arrays keep only the first element of each duplications. It can also be -set for colon separated special parameters like tt(PATH) or tt(FIGNORE), -etc. +For arrays (but not for associative arrays), keep only the first +occurrence of each duplicated value. This may also be set for +colon-separated special parameters like tt(PATH) or tt(FIGNORE), etc. +This flag has a different meaning when used with tt(-f); see below. ) item(tt(-Z))( Right justify and fill with leading zeros if the first non-blank @@ -914,51 +1092,83 @@ If var(n) is nonzero it defines the width of the field; otherwise it is determined by the width of the value of the first assignment. ) +item(tt(-a))( +The names refer to array parameters. An array parameter may be +created this way, but it may not be assigned to in the tt(typeset) +statement. When displaying, both normal and associative arrays are +shown. +) item(tt(-f))( The names refer to functions rather than parameters. No assignments -can be made, and the only other valid flags are tt(-t) -and tt(-u). The flag tt(-t) turns on execution tracing for this -function. The flag tt(-u) causes this function to be marked -for autoloading. The tt(fpath) parameter will be searched to find the -function definition when the function is first referenced; see -noderef(Functions). +can be made, and the only other valid flags are tt(-t), tt(-u) and +tt(-U). The flag tt(-t) turns on execution tracing for this +function. The tt(-u) and tt(-U) flags cause the function to be +marked for autoloading; tt(-U) also causes alias expansion to be +suppressed when the function is loaded. The tt(fpath) parameter +will be searched to find the function definition when the function +is first referenced; see noderef(Functions). +) +item(tt(-h))( +Hide: only useful for special parameters (those marked `<S>' in the table in +ifzman(zmanref(zshparams))\ +ifnzman(noderef(Parameters))\ +), and for local parameters with the same name as a special parameter, +though harmless for others. A special parameter with this attribute will +not retain its special effect when made local. Thus after `tt(typeset -h +PATH)', a function containing `tt(typeset PATH)' will create an ordinary +local parameter without the usual behaviour of tt(PATH). Alternatively, +the local parameter may itself be given this attribute; hence inside a +function `tt(typeset -h PATH)' creates an ordinary local parameter and the +special tt(PATH) parameter is not altered in any way. It is also possible +to create a local parameter using `tt(typeset +h )var(special)', where the +local copy of var(special) will retain its special properties regardless of +having the tt(-h) attribute. Global special parameters loaded from shell +modules (currently those in tt(mapfile) and tt(parameter)) are +automatically given the tt(-h) attribute to avoid name clashes. ) item(tt(-i))( -Use an internal integer representation. If var(n) is nonzero -it defines the output arithmetic base, otherwise it is determined by the first -assignment. +Use an internal integer representation. If var(n) is nonzero it +defines the output arithmetic base, otherwise it is determined by the +first assignment. +) +item(tt(-E))( +Use an internal double-precision floating point representation. On output +the variable will be converted to scientific notation. If var(n) is +nonzero it defines the number of significant figures to display; the +default is ten. +) +item(tt(-F))( +Use an internal double-precision floating point representation. On output +the variable will be converted to fixed-point decimal notation. If var(n) +is nonzero it defines the number of digits to display after the decimal +point; the default is ten. ) item(tt(-l))( -Convert to lower case. +Convert the result to lower case whenever the parameter is expanded. +The value is em(not) converted when assigned. ) item(tt(-r))( The given var(name)s are marked readonly. ) item(tt(-t))( Tags the named parameters. Tags have no special meaning to the shell. +This flag has a different meaning when used with tt(-f); see above. ) item(tt(-u))( -Convert to upper case. +Convert the result to upper case whenever the parameter is expanded. +The value is em(not) converted when assigned. +This flag has a different meaning when used with tt(-f); see above. ) item(tt(-x))( Mark for automatic export to the environment of subsequently executed commands. ) enditem() - -Using `tt(PLUS())' rather than `tt(-)' causes these flags to be turned off. -If no arguments are given but flags are specified, -a list of named parameters which have these flags set is printed. -Using `tt(PLUS())' instead of `tt(-)' keeps their values from being printed. -If no arguments or options are given, the names and attributes -of all parameters are printed. If only the tt(-m) flag is given the -arguments are taken as patterns (should be quoted) and all parameters -or functions (with the tt(-f) flag) with matching names are printed. ) findex(ulimit) cindex(resource limits) cindex(limits, resource) -item(tt(ulimit) [ tt(-SHacdflmnpstv) [ tt(limit) ] ... ])( +item(tt(ulimit) [ tt(-SHacdflmnpstv) [ var(limit) ] ... ])( Set or display resource limits of the shell and the processes started by the shell. The value of var(limit) can be a number in the unit specified below or the value `tt(unlimited)'. If the tt(-H) flag is given use @@ -1025,10 +1235,16 @@ Each named parameter is unset. Local parameters remain local even if unset; they appear unset within scope, but the previous value will still reappear when the scope ends. -If the tt(-m) flag is specified the -arguments are taken as patterns (should be quoted) and all parameters -with matching names are unset. tt(unset -f) is equivalent to -tt(unfunction). +Individual elements of associative array parameters may be unset by using +subscript syntax on var(name), which should be quoted (or the entire command +prefixed with tt(noglob)) to protect the subscript from filename generation. + +If the tt(-m) flag is specified the arguments are taken as patterns (should +be quoted) and all parameters with matching names are unset. Note that this +cannot be used when unsetting associative array elements, as the subscript +will be treated as part of the pattern. + +tt(unset -f) is equivalent to tt(unfunction). ) findex(unsetopt) cindex(options, unsetting) @@ -1041,6 +1257,7 @@ If the tt(-m) flag is given the arguments are taken as patterns (which should be quoted to preserve them from being interpreted as glob patterns), and all options with names matching these patterns are unset. ) +module(vared)(zsh/zle) findex(wait) cindex(waiting for jobs) cindex(jobs, waiting for) @@ -1105,33 +1322,153 @@ findex(which) item(tt(which) [ tt(-wpams) ] var(name) ...)( Equivalent to tt(whence -c). ) +findex(zcompile) +cindex(.zwc files, creation) +cindex(compilation) +xitem(tt(zcompile) [ tt(-U) ] [ tt(-z) | tt(-k) ] [ tt(-R) | tt(-M) ] var(file) [ var(name) ... ]) +xitem(tt(zcompile) tt(-ca) [ tt(-m) ] [ tt(-R) | tt(-M) ] var(file) [ var(name) ... ]) +item(tt(zcompile -t) var(file) [ var(name) ... ])( +This builtin command can be used to compile functions or scripts and +store the compiled form in a file, and to examine files containing +the compiled form. This allows faster autoloading of functions and +execution of scripts by avoiding parsing of the text when the files +are read. + +The first form (without the tt(-c), tt(-a) or tt(-t) options) creates a +compiled file. If only the var(file) argument is provided, the +output file has the name `var(file)tt(.zwc)' and will be placed in +the same directory as the var(file). This will make the compiled +file be loaded instead of the normal function file when the function +is autoloaded (see +ifzman(\ +the section `Autoloading Functions' in zmanref(zshfunc) +)\ +ifnzman(\ +noderef(Functions) +)\ +for a description of how autoloaded functions are searched). The +extension tt(.zwc) stands for `zsh word codes'. + +If there is at least one var(name) argument, all those named files +are compiled into one output var(file). If var(file) does not end +in tt(.zwc), this extension is automatically appended. Files +containing multiple compiled functions are called `digest' files, +and are intended to be used as elements of the tt(FPATH)/tt(fpath) +special array. + +The second form, with the tt(-c) or tt(-a) options, writes the compiled +definitions for all the named functions into var(file). For tt(-c), the +names must be functions currently defined in the shell, not those marked +for autoloading. Undefined functions that are marked for autoloading +may be written by using the tt(-a) option, in which case the tt(fpath) +is searched and the contents of the definition files for those +functions, if found, are compiled into var(file). If both tt(-c) and +tt(-a) are given, names of both defined functions and functions marked +for autoloading may be given. In either case, the functions in files +written with the tt(-c) or tt(-a) option will be autoloaded as if the +tt(KSH_AUTOLOAD) option were unset. + +The reason for handling loaded and not-yet-loaded functions with +different options is that some definition files for autoloading define +multiple functions, including the function with the same name as the +file, and, at the end, call that function. In such cases the output of +`tt(zcompile -c)' does not include the additional functions defined in +the file, and any other initialization code in the file is lost. Using +`tt(zcompile -a)' captures all this extra information. + +If the tt(-m) option is combined with tt(-c) or tt(-a), +the var(name)s are used as patterns and all functions whose names +match one of these patterns will be written. If no var(name) is given, +the definitions of all functions currently defined or marked as +autoloaded will be written. + +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 tells +the version of the shell which compiled the file and how the file +will be used (mapping or reading the file). With arguments, nothing +is output and the return value is set to zero if em(all) var(name)s +name files contained in the wordcode file, and non-zero if at least +one var(name) is not contained in it. + +Other options: + +startitem() +item(tt(-U))( +Aliases are not expanded when compiling the var(name)d files. +) +item(tt(-R))( +When the compiled file is read, its contents are copied into the +shell's memory, rather than memory-mapped (see tt(-M)). This +happens automatically on systems that do not support memory mapping. + +When compiling scripts instead of autoloadable functions, it is +often desirable to use this option. Otherwise the whole file will +remain mapped if the script has defined one or more functions, even +if the rest of the file will not be used again. +) +item(tt(-M))( +The compiled file is mapped into the shell's memory when read. This +is done in such a way that multiple instances of the shell running +on the same host will share this mapped file. If neither tt(-R) nor +tt(-M) is given, the tt(zcompile) builtin decides what to do based +on the size of the compiled file. +) +xitem(tt(-k)) +item(tt(-z))( +These options are used when the compiled file contains functions and +those functions are to be autoloaded. If tt(-z) is given, the +function will be autoloaded as if the tt(KSH_AUTOLOAD) option is +em(not) set, even if it is set at the time the compiled file is +read. The tt(-k) makes the function be loaded as if tt(KSH_AUTOLOAD) +em(is) set. If neither of these options is given, the function will +be loaded as determined by the setting of the tt(KSH_AUTOLOAD) option +at the time the compiled file is read. + +These options may also be repeated among the listed var(name)s to +specify the loading style of all following functions, up to the next +tt(-k) or tt(-z). +) +enditem() + +The created file always contains two versions of the compiled +format, one for big-endian machines and one for small-endian +machines. The upshot of this is that the compiled file is machine +independent and if it is read or mapped, only one half of the file +is actually used (and mapped). +) +module(zformat)(zsh/zutil) +module(zftp)(zsh/zftp) +module(zle)(zsh/zle) findex(zmodload) cindex(modules, loading) cindex(loading modules) -xitem(tt(zmodload) [ tt(-iL) ] [ var(name) ... ]) -xitem(tt(zmodload) tt(-u) [ tt(-i) ] var(name) ...) -xitem(tt(zmodload) tt(-d) [ tt(-L) ] [ var(name) [ var(dep) ... ] ]) -xitem(tt(zmodload) tt(-du) var(name) [ var(dep) ... ]) -xitem(tt(zmodload) tt(-a) [ tt(-iL) ] [ var(name) [ var(builtin) ... ] ]) -item(tt(zmodload) tt(-au) [ tt(-i) ] var(builtin) ...)( -tt(zmodload) performs operations relating to zsh's loadable modules. +xitem(tt(zmodload) [ tt(-dL) ] [ ... ]) +xitem(tt(zmodload -e) [ ... ]) +xitem(tt(zmodload) [ tt(-a) [ tt(-bcpf) [ tt(-I) ] ] ] [ tt(-iL) ] ...) +item(tt(zmodload) tt(-u) [ tt(-abcdpf) [ tt(-I) ] ] [ tt(-iL) ] ...)( +Performs operations relating to zsh's loadable modules. This feature is not available on all operating systems, or on all installations on a particular operating system. -In the simplest case, -tt(zmodload) loads a binary module. The module must be in a file with a -name consisting of the specified var(name) followed by a standard suffix, -usually `tt(.so)'. If this can't be found, the var(name) is tried without -the suffix. -If the module to be loaded is already loaded and the tt(-i) -option is given, the duplicate module is ignored. Otherwise -tt(zmodload) prints an error message. +Without arguments the names of all currently loaded binary modules are +printed. The tt(-L) option causes this list to be in the form of a +series of tt(zmodload) commands. Forms with arguments are: + +startitem() +xitem(tt(zmodload) [ tt(-i) ] var(name) ... ) +item(tt(zmodload) tt(-u) [ tt(-i) ] var(name) ...)( +In the simplest case, tt(zmodload) loads a binary module. The module must +be in a file with a name consisting of the specified var(name) followed by +a standard suffix, usually `tt(.so)'. +If the module to be loaded is +already loaded and the tt(-i) option is given, the duplicate module is +ignored. Otherwise tt(zmodload) prints an error message. The var(name)d module is searched for in the same way a command is, using -tt($module_path) instead of tt($path). If var(name) contains a `tt(/)', -it will be used as-is, and a path search will be performed otherwise. -This behaviour can be modified by the tt(PATH_DIRS) option. -cindex(PATH_DIRS, use of) +tt($module_path) instead of tt($path). However, the path search is +performed even when the module name contains a `tt(/)', which it usually does. +There is no way to prevent the path search. With tt(-u), tt(zmodload) unloads modules. The same var(name) must be given that was given when the module was loaded, but it is not @@ -1142,43 +1479,92 @@ unloaded (or was never loaded). Each module has a boot and a cleanup function. The module will not be loaded if its boot function fails. Similarly a module can only be unloaded if its cleanup function runs successfully. +) +xitem(tt(zmodload) tt(-d) [ tt(-L) ] [ var(name) ]) +xitem(tt(zmodload) tt(-d) var(name) var(dep) ...) +item(tt(zmodload) tt(-ud) var(name) [ var(dep) ... ])( +The tt(-d) option can be used to specify module dependencies. The modules +named in the second and subsequent arguments will be loaded before the +module named in the first argument. + +With tt(-d) and one argument, all dependencies for that module are listed. +With tt(-d) and no arguments, all module dependencies are listed. This +listing is by default in a Makefile-like format. The tt(-L) option +changes this format to a list of tt(zmodload -d) commands. + +If tt(-d) and tt(-u) are both used, dependencies are removed. If only one +argument is given, all dependencies for that module are removed. +) +xitem(tt(zmodload) tt(-ab) [ tt(-L) ]) +xitem(tt(zmodload) tt(-ab) [ tt(-i) ] var(name) [ var(builtin) ... ]) +item(tt(zmodload) tt(-ub) [ tt(-i) ] var(builtin) ...)( +The tt(-ab) option defines autoloaded builtins. It defines the specified +var(builtin)s. When any of those builtins is called, the module specified +in the first argument is loaded. If only the var(name) is given, one +builtin is defined, with the same name as the module. tt(-i) suppresses +the error if the builtin is already defined or autoloaded, regardless of +which module it came from. -Without arguments all currently loaded binary modules are printed. -The tt(-L) option causes this list to be in the form of a series of -tt(zmodload) commands. - -The tt(-d) option can be used to specify module dependencies. -This operation is idempotent regardless of the tt(-i) option. -The modules named in the second and subsequent arguments will be -loaded before the module named in the first argument. - -With tt(-d) and one -argument, all dependencies for that module are listed. With tt(-d) and no -arguments, all module dependencies are listed. -This listing is by default in a Makefile-like format. -The tt(-L) option changes this format to a list of -tt(zmodload -d) commands. - -If tt(-d) and tt(-u) are both used, dependencies are removed. -This operation is idempotent regardless of the tt(-i) option. -If only one argument is given, all dependencies for that module are removed. - -The tt(-a) option defines autoloaded builtins. It defines the -specified var(builtin)s. When any of those builtins is called, the module -specified in the first argument is loaded. If only one argument is given, -one builtin is defined, with the same name as the module. -tt(-i) suppresses the error if the builtin is already defined or -autoloaded, regardless of which module it came from. - -With tt(-a) and no arguments, all -autoloaded builtins are listed, with the module name (if different) -shown in parentheses after the builtin name. The tt(-L) option changes -this format to a list of tt(zmodload -a) commands. - -If tt(-a) is used -together with the tt(-u) option it removes builtins defined with -tt(zmodload -a). This is only possible if the builtin is not yet -loaded. tt(-i) suppresses the error if the builtin is already +With tt(-ab) and no arguments, all autoloaded builtins are listed, with the +module name (if different) shown in parentheses after the builtin name. +The tt(-L) option changes this format to a list of tt(zmodload -a) +commands. + +If tt(-b) is used together with the tt(-u) option, it removes builtins +previously defined with tt(-ab). This is only possible if the builtin is +not yet loaded. tt(-i) suppresses the error if the builtin is already removed (or never existed). ) +xitem(tt(zmodload) tt(-ac) [ tt(-IL) ]) +xitem(tt(zmodload) tt(-ac) [ tt(-iI) ] var(name) [ var(cond) ... ]) +item(tt(zmodload) tt(-uc) [ tt(-iI) ] var(cond) ...)( +The tt(-ac) option is used to define autoloaded condition codes. The +var(cond) strings give the names of the conditions defined by the +module. The optional tt(-I) option is used to define infix condition +names. Without this option prefix condition names are defined. + +If given no condition names, all defined names are listed (as a series of +tt(zmodload) commands if the tt(-L) option is given). + +The tt(-uc) option removes definitions for autoloaded conditions. +) +xitem(tt(zmodload) tt(-ap) [ tt(-L) ]) +xitem(tt(zmodload) tt(-ap) [ tt(-i) ] var(name) [ var(parameter) ... ]) +item(tt(zmodload) tt(-up) [ tt(-i) ] var(parameter) ...)( +The tt(-p) option is like the tt(-b) and tt(-c) options, but makes +tt(zmodload) work on autoloaded parameters instead. +) +xitem(tt(zmodload) tt(-af) [ tt(-L) ]) +xitem(tt(zmodload) tt(-af) [ tt(-i) ] var(name) [ var(function) ... ]) +item(tt(zmodload) tt(-uf) [ tt(-i) ] var(function) ...)( +The tt(-f) option is like the tt(-b), tt(-p), and tt(-c) options, but +makes tt(zmodload) work on autoloaded math functions instead. +) +xitem(tt(zmodload) tt(-a) [ tt(-L) ]) +xitem(tt(zmodload) tt(-a) [ tt(-i) ] var(name) [ var(builtin) ... ]) +item(tt(zmodload) tt(-ua) [ tt(-i) ] var(builtin) ...)( +Equivalent to tt(-ab) and tt(-ub). +) +item(tt(zmodload -e) [ var(string) ... ])( +The tt(-e) option without arguments lists all loaded modules. +With arguments only the return status is set to zero +if all var(string)s given as arguments are names of loaded modules +and to one if at least on var(string) is not the name of a +loaded module. This can be used to test for the availability +of things implemented by modules. +) +enditem() + +Note that tt(zsh) makes no distinction between modules that were linked +into the shell and modules that are loaded dynamically. In both cases +this builtin command has to be used to make available the builtins and +other things defined by modules (unless the module is autoloaded on +these definitions). This is true even for systems that don't support +dynamic loading of modules. +) +module(zparseopts)(zsh/zutil) +module(zprof)(zsh/zprof) +module(zpty)(zsh/zpty) +module(zregexparse)(zsh/zutil) +module(zstyle)(zsh/zutil) enditem() diff --git a/Doc/Zsh/compctl.yo b/Doc/Zsh/compctl.yo index a78a18fa9..f25ddda98 100644 --- a/Doc/Zsh/compctl.yo +++ b/Doc/Zsh/compctl.yo @@ -1,7 +1,25 @@ -texinode(Programmable Completion)(Zsh Modules)(Zsh Line Editor)(Top) -chapter(Programmable Completion) +texinode(Completion Using compctl)(Completion Widgets)(Zsh Line Editor)(Top) +chapter(Completion Using compctl) cindex(completion, programmable) cindex(completion, controlling) +ifzman(\ +sect(Synopsis) +This version of zsh has two ways of performing completion of words on the +command line. New users of the shell may prefer to use the newer +and more powerful system based on shell functions; this is described in +zmanref(zshcompsys), and the basic shell mechanisms which support it are +described in zmanref(zshcompwid). This manual entry describes the older +tt(compctl) command. +)\ +ifnzman(\ +sect(Types of completion) +This version of zsh has two ways of performing completion of words on the +command line. New users of the shell may prefer to use the newer +and more powerful system based on shell functions; this is described +in noderef(Completion System), and the basic shell mechanisms which support +it are described in noderef(Completion Widgets). This chapter describes +the older tt(compctl) command. +)\ findex(compctl) sect(Description) startlist() @@ -10,7 +28,8 @@ list(tt(compctl) [ tt(-CDT) ] var(options) \ [ tt(-x) var(pattern) var(options) tt(-) ... tt(--) ] \ [ tt(PLUS()) var(options) [ tt(-x) ... tt(--) ] ... [tt(PLUS())] ] \ [ var(command) ... ]) -list(tt(compctl) tt(-L) [ tt(-CDT) ] [ var(command) ... ]) +list(tt(compctl) tt(-M) var(match-specs) ...) +list(tt(compctl) tt(-L) [ tt(-CDTM) ] [ var(command) ... ]) list(tt(compctl) tt(PLUS()) var(command) ...) endlist() @@ -30,7 +49,8 @@ menu(Alternative Completion) menu(Extended Completion) menu(Example) endmenu() -texinode(Command Flags)(Option Flags)()(Programmable Completion) + +texinode(Command Flags)(Option Flags)()(Completion Using compctl) sect(Command Flags) Completion of the arguments of a command may be different for each command or may use the default. The behavior when completing the @@ -44,9 +64,23 @@ item(var(command) ...)( controls completion for the named commands, which must be listed last on the command line. If completion is attempted for a command with a pathname containing slashes and no completion definition is found, the -search is retried with the last pathname component. Note that aliases +search is retried with the last pathname component. If the command starts +with a tt(=), completion is tried with the pathname of the command. + +Any of the var(command) strings may be patterns of the form normally +used for filename generation. These should be be quoted to protect them +from immediate expansion; for example the command string tt('foo*') +arranges for completion of the words of any command beginning with +tt(foo). When completion is attempted, all pattern completions are +tried in the reverse order of their definition until one matches. By +default, completion then proceeds as normal, i.e. the shell will try to +generate more matches for the specific command on the command line; this +can be overridden by including tt(-tn) in the flags for the pattern +completion. + +Note that aliases are expanded before the command name is determined unless the -tt(COMPLETE_ALIASES) option is set. Commands should not be combined +tt(COMPLETE_ALIASES) option is set. Commands may not be combined with the tt(-C), tt(-D) or tt(-T) flags. ) item(tt(-C))( @@ -62,8 +96,8 @@ been issued, filenames are completed. ) item(tt(-T))( supplies completion flags to be used before any other processing is -done, even those given to specific commands with other compctl -definitions. This is only useful when combined with extended +done, even before processing for tt(compctl)s defined for specific +commands. This is especially useful when combined with extended completion (the tt(-x) flag, see noderef(Extended Completion) below). Using this flag you can define default behavior which will apply to all commands without exception, or you can alter @@ -71,41 +105,59 @@ the standard behavior for all commands. For example, if your access to the user database is too slow and/or it contains too many users (so that completion after `tt(~)' is too slow to be usable), you can use -nofill(tt(compctl -Tx 'C[0,*/*]' -f - 's[~]' -k friends -S/)) +example(compctl -T -x 's[~] C[0,[^/]#]' -k friends -S/ -tn) to complete the strings in the array tt(friends) after a `tt(~)'. -The first argument is necessary so that this form of ~-completion is +The tt(C[...]) argument is necessary so that this form of ~-completion is not tried after the directory name is finished. ) item(tt(-L))( lists the existing completion behavior in a manner suitable for putting into a start-up script; the existing behavior is not changed. -Any combination of the above forms may be specified, otherwise all -defined completions are listed. Any other flags supplied -are ignored. +Any combination of the above forms, or the tt(-M) flag (which must +follow the tt(-L) flag), may be specified, otherwise all defined +completions are listed. Any other flags supplied are ignored. ) item(em(no argument))( If no argument is given, tt(compctl) lists all defined completions in an abbreviated form; with a list of var(options), all completions with those flags set (not counting extended completion) are listed. ) -endlist() +enditem() If the tt(PLUS()) flag is alone and followed immediately by the var(command) list, the completion behavior for all the commands in the list is reset to the default. In other words, completion will subsequently use the options specified by the tt(-D) flag. -texinode(Option Flags)(Alternative Completion)(Command Flags)(Programmable Completion) + +The form with tt(-M) as the first and only option defines global +matching specifications (see +ifzman(zshcompwid)\ +ifnzman(noderef(Matching Control))\ +). The match specifications given will be used for every completion +attempt (only when using tt(compctl), not with the new completion +system) and are tried in the order in which they are defined until one +generates at least one match. E.g.: + +example(compctl -M '' 'm:{a-zA-Z}={A-Za-z}') + +This will first try completion without any global match specifications +(the empty string) and, if that generates no matches, will try case +insensitive completion. + +texinode(Option Flags)(Alternative Completion)(Command Flags)(Completion Using compctl) sect(Option Flags) startlist() -list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu/) ]) +list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu/12) ]) list([ tt(-k) var(array) ] [ tt(-g) var(globstring) ] \ [ tt(-s) var(subststring) ]) -list([ tt(-K) var(function) ] [ tt(-H) var(num pattern) ]) +list([ tt(-K) var(function) ]) list([ tt(-Q) ] [ tt(-P) var(prefix) ] [ tt(-S) var(suffix) ]) -list([ tt(-W) var(file-prefix) ]) +list([ tt(-W) var(file-prefix) ] [ tt(-H) var(num pattern) ]) list([ tt(-q) ] [ tt(-X) var(explanation) ] [ tt(-Y) var(explanation) ]) -list([ tt(-y) var(func-or-var) ] [ tt(-l) var(cmd) ] [ tt(-U) ]) +list([ tt(-y) var(func-or-var) ] [ tt(-l) var(cmd) ] [ tt(-h) var(cmd) ] [ tt(-U) ]) +list([ tt(-t) var(continue) ] [ tt(-J) var(name) ] [ tt(-V) var(name) ]) +list([ tt(-M) var(match-spec) ]) endlist() The remaining var(options) specify the type of command arguments @@ -117,6 +169,7 @@ menu(Simple Flags) menu(Flags with Arguments) menu(Control Flags) endmenu() + texinode(Simple Flags)(Flags with Arguments)()(Option Flags) subsect(Simple Flags) These produce completion lists made up by the shell itself: @@ -215,6 +268,7 @@ item(tt(-u))( User names. ) enditem() + texinode(Flags with Arguments)(Control Flags)(Simple Flags)(Option Flags) subsect(Flags with Arguments) These have user supplied arguments to determine how the list of @@ -229,8 +283,8 @@ of space- or comma-separated values in parentheses, in which any delimiter may be escaped with a backslash; in this case the argument should be quoted. For example, -nofill(tt(compctl -k "(cputime filesize datasize stacksize - coredumpsize resident descriptors)" limit)) +example(compctl -k "(cputime filesize datasize stacksize + coredumpsize resident descriptors)" limit) ) item(tt(-g) var(globstring))( The var(globstring) is expanded using filename globbing; it should be @@ -251,20 +305,21 @@ completions. The tt(fignore) special parameter is not applied to the resulting files. Note that tt(-g) is faster for filenames. ) item(tt(-K) var(function))( -Call the given function to get the completions. The function is +Call the given function to get the completions. Unless the name +starts with an underscore, the function is passed two arguments: the prefix and the suffix of the word on which completion is to be attempted, in other words those characters before the cursor position, and those from the cursor position onwards. The whole command line can be accessed with the tt(-c) and tt(-l) flags -of the tt(read) builtin. The +of the tt(read) builtin. The function should set the variable tt(reply) to an array containing the completions (one completion per element); note that tt(reply) should not be made local to the function. From such a function the command line can be accessed with the tt(-c) and tt(-l) flags to the tt(read) builtin. For example, -nofill(tt(function whoson { reply=(`users`); } -compctl -K whoson talk)) +example(function whoson { reply=(`users`); } +compctl -K whoson talk) completes only logged-on users after `tt(talk)'. Note that `tt(whoson)' must return an array, so `tt(reply=`users`)' would be incorrect. @@ -276,12 +331,13 @@ zero or negative the whole history is searched and if var(pattern) is the empty string all words are taken (as with `tt(*)'). A typical use is -nofill(tt(compctl -D -f PLUS() -H 0 '')) +example(compctl -D -f PLUS() -H 0 '') which forces completion to look back in the history list for a word if no filename matches. ) enditem() + texinode(Control Flags)()(Flags with Arguments)(Option Flags) subsect(Control Flags) These do not directly specify types of name to be completed, but @@ -303,7 +359,7 @@ The var(prefix) is inserted just before the completed string; any initial part already typed will be completed and the whole var(prefix) ignored for completion purposes. For example, -nofill(tt(compctl -j -P "%" kill)) +example(compctl -j -P "%" kill) inserts a `%' after the kill command and then completes job names. ) @@ -318,20 +374,25 @@ With directory var(file-prefix): for command, file, directory and globbing completion (options tt(-c), tt(-f), tt(-/), tt(-g)), the file prefix is implicitly added in front of the completion. For example, -nofill(tt(compctl -/ -W ~/Mail maildirs)) +example(compctl -/ -W ~/Mail maildirs) completes any subdirectories to any depth beneath the directory tt(~/Mail), although that prefix does not appear on the command line. +The var(file-prefix) may also be of the form accepted by the tt(-k) +flag, i.e. the name of an array or a literal list in parenthesis. In +this case all the directories in the list will be searched for +possible completions. ) item(tt(-q))( If used with a suffix as specified by the tt(-S) option, this causes the suffix to be removed if the next character typed is a blank -or does not insert anything (the same rule as used for the -tt(AUTO_REMOVE_SLASH) option). The option is most useful for list +or does not insert anything or if the suffix consists of only one character +and the next character typed is the same character; this the same rule used +for the tt(AUTO_REMOVE_SLASH) option. The option is most useful for list separators (comma, colon, etc.). ) item(tt(-l) var(cmd))( -This option cannot be combined with any other. It restricts the range +This option restricts the range of command line words that are considered to be arguments. If combined with one of the extended completion patterns `tt(p[)...tt(])', `tt(r[)...tt(])', or `tt(R[)...tt(])' (see noderef(Extended Completion) @@ -342,12 +403,21 @@ option. If the var(cmd) string is empty the first word in the range is instead taken as the command name, and command name completion performed on the first word in the range. For example, -nofill(tt(compctl -x 'r[-exec,;]' -l '' -- find)) +example(compctl -x 'r[-exec,;]' -l '' -- find) completes arguments between `tt(-exec)' and the following `tt(;)' (or the end of the command line if there is no such string) as if they were a separate command line. ) +item(tt(-h) var(cmd))( +Normally zsh completes quoted strings as a whole. With this option, +completion can be done separately on different parts of such +strings. It works like the tt(-l) option but makes the completion code +work on the parts of the current word that are separated by +spaces. These parts are completed as if they were arguments to the +given var(cmd). If var(cmd) is the empty string, the first part is +completed as a command name, as with tt(-l). +) item(tt(-U))( Use the whole list of possible completions, whether or not they actually match the word on the command line. The word typed so far @@ -355,7 +425,10 @@ will be deleted. This is most useful with a function (given by the tt(-K) option) which can examine the word components passed to it (or via the tt(read) builtin's tt(-c) and tt(-l) flags) and use its own criteria to decide what matches. If there is no -completion, the original word is retained. +completion, the original word is retained. Since the produced +possible completions seldom have interesting common prefixes +and suffixes, menucompletion is started immediately if tt(AUTO_MENU) is +set and this flag is used. ) item(tt(-y) var(func-or-var))( The list provided by var(func-or-var) is displayed instead of the list @@ -379,9 +452,22 @@ printed literally and if they appear output in columns is suppressed. ) item(tt(-X) var(explanation))( Print var(explanation) when trying completion on the current set of -options. A `tt(%n)' in this string is replaced by the number of matches. +options. A `tt(%n)' in this string is replaced by the number of +matches that were added for this explanation string. The explanation only appears if completion was tried and there was -no unique match, or when listing completions. +no unique match, or when listing completions. Explanation strings +will be listed together with the matches of the group specified +together with the tt(-X) option (using the tt(-J) or tt(-V) +option). If the same explanation string is given to multiple tt(-X) +options, the string appears only once (for each group) and the number +of matches shown for the `tt(%n)' is the total number of all matches +for each of these uses. In any case, the explanation string will only +be shown if there was at least one match added for the explanation +string. + +The sequences tt(%B), tt(%b), tt(%S), tt(%s), tt(%U), and tt(%u) specify +output attributes (bold, standout, and underline) and tt(%{...%}) can +be used to include literal escape sequences as in prompts. ) item(tt(-Y) var(explanation))( Identical to tt(-X), except that the var(explanation) first undergoes @@ -389,8 +475,72 @@ expansion following the usual rules for strings in double quotes. The expansion will be carried out after any functions are called for the tt(-K) or tt(-y) options, allowing them to set variables. ) +item(tt(-t) var(continue))( +The var(continue)-string contains a character that specifies which set +of completion flags should be used next. It is useful: + +(i) With tt(-T), or when trying a list of pattern completions, when +tt(compctl) would usually continue with ordinary processing after +finding matches; this can be suppressed with `tt(-tn)'. + +(ii) With a list of alternatives separated by tt(+), when tt(compctl) +would normally stop when one of the alternatives generates matches. It +can be forced to consider the next set of completions by adding `tt(-t+)' +to the flags of the alternative before the `tt(+)'. + +(iii) In an extended completion list (see below), when tt(compctl) would +normally continue until a set of conditions succeeded, then use only +the immediately following flags. With `tt(-t-)', tt(compctl) will +continue trying extended completions after the next `tt(-)'; with +`tt(-tx)' it will attempt completion with the default flags, in other +words those before the `tt(-x)'. +) +item(tt(-J) var(name))( +This gives the name of the group the matches should be placed in. Groups +are listed and sorted separately; likewise, menucompletion will offer +the matches in the groups in the order in which the groups were +defined. If no group name is explicitly given, the matches are stored in +a group named var(default). The first time a group name is encountered, +a group with that name is created. After that all matches with the same +group name are stored in that group. + +This can be useful with non-exclusive alternative completions. For +example, in + +example(compctl -f -J files -t+ + -v -J variables foo) + +both files and variables are possible completions, as the tt(-t+) forces +both sets of alternatives before and after the tt(+) to be considered at +once. Because of the tt(-J) options, however, all files are listed +before all variables. +) +item(tt(-V) var(name))( +Like tt(-J), but matches within the group will not be sorted in listings +nor in menucompletion. These unsorted groups are in a different name +space from the sorted ones, so groups defined as tt(-J files) and tt(-V +files) are distinct. +) +item(tt(-1))( +If given together with the tt(-V) option, makes +only consecutive duplicates in the group be removed. Note that groups +with and without this flag are in different name spaces. +) +item(tt(-2))( +If given together with the tt(-J) or tt(-V) option, makes all +duplicates be kept. Again, groups with and without this flag are in +different name spaces. +) +item(tt(-M) var(match-spec))( +This defines additional matching control specifications that should be used +only when testing words for the list of flags this flag appears in. The format +of the var(match-spec) string is described in +ifzman(zshcompwid)\ +ifnzman(noderef(Matching Control))\ +. +) enditem() -texinode(Alternative Completion)(Extended Completion)(Option Flags)(Programmable Completion) + +texinode(Alternative Completion)(Extended Completion)(Option Flags)(Completion Using compctl) sect(Alternative Completion) startlist() list(tt(compctl) [ tt(-CDT) ] var(options) tt(PLUS()) var(options) [ tt(PLUS()) ... ] \ @@ -402,16 +552,19 @@ tried with the options before the first `tt(PLUS())'. If this produces no matches co |