diff -Nru zsh-beta-4.3.11-dev-1+20110504/ChangeLog zsh-beta-4.3.12-dev-1+20110925/ChangeLog --- zsh-beta-4.3.11-dev-1+20110504/ChangeLog 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/ChangeLog 2011-10-02 01:10:11.000000000 +0000 @@ -1,3 +1,869 @@ +2011-09-25 Barton E. Schaefer + + * 29799: Src/utils.c: swap order of RESET_PROMPT / REFRESH in + adjustwinsize() so that the cursor is moved to the start of a + multi-line prompt before the prompt is actually displayed. + + * 29769: Src/signals.c: handle thisjob == -1 (no foreground job) + when checking for whether a background job is allowed to suspend. + + * unposted: Doc/Zsh/modules.yo: cross-reference zmodload. + +2011-09-22 Peter Stephenson + + * Daniel Friesel: 29796: Completion/X/Command/_mplayer: complete + .webm. + +2011-09-21 Peter Stephenson + + * Luka Perkov: 29788: Completion/Unix/Command/_quilt: + improved quilt completion. + +2011-09-18 Peter Stephenson + + * users/16375: Src/Zle/complist.c: initialise number of + references each time for multiple match tests when + highlighting. + +2011-09-16 Mikael Magnusson + + * 29764, 29765: Completion/Unix/Command/_pgrep: use _users and + _groups rather than reimplementing them, use _wanted instead + of plain compadd to get descriptions, return 0 on success, + fix conditions on -f and -x, complete pts/* for -t too. + +2011-09-15 Peter Stephenson + + * 29776 (modified as noted): Src/lex.c, Test/D08cmdsubst.ztst: + double quotes are not special in double-quote-style parsing + if the end character is something else. + + * 29773: Marco Hinz: Completion/Unix/Type/_perl_modules: + complete some missed modules. + +2011-09-10 Clint Adams + + * 29762: Completion/Debian/Command/_bts: bts completion tag + update from Ansgar Burchardt. + +2011-09-10 Barton E. Schaefer + + * 29760: Completion/compaudit: declare _i_ulwdirs and make sure + it is correctly referenced. + +2011-09-07 Peter Stephenson + + * unposted: Completion/Unix/Command/_perforce: updates for + 2010.2 release. + +2011-09-07 Simon Ruderich + + * 29756: Doc/Zsh/params.yo: DIRSTACKSIZE is unlimited by default. + + * 29757: Doc/Zsh/compsys.yo: Remove superfluous brace. + +2011-09-07 Mikael Magnusson + + * 29755: Completion/Unix/Command/_ssh: add -O stop to to _ssh. + +2011-09-06 Mikael Magnusson + + * 29736: Doc/Zsh/mod_zutil.yo: mention when zstyle -t returns 1. + + * 29738: Completion/Unix/Command/_ssh: add PreferredAuthentications + completion. + + * 29739: Completion/Unix/Command/_rsync: redefine _rsync(), make + -e accept cuddled arguments. + + * 29740: Completion/Unix/Command/_wget: add --content-disposition. + + * 29741: Completion/Zsh/Command/_zattr: add ret=0, fix filename + globbing like in 27658 for _zip. + + * 29733: Jonathan Kolberg: Completion/Debian/Command/_apt: add + completion for apt-get changelog. + +2011-09-05 Barton E. Schaefer + + * users/16302: Completion/Unix/Type/_path_files: pattern matching + for plain files (e.g., *.pdf for xpdf completion) was broken by + 29444. Hopefully this does not re-break directory patterns. + +2011-08-30 Simon Ruderich + + * 29745: Mikael Magnusson: Completion/X/Command/_mplayer: fix -ss + completion. + +2011-08-29 Peter Stephenson + + * 29744: Src/builtin.c: don't mess up non '-A' case in + 29731. + +2011-08-29 Barton E. Schaefer + + * users/16291: Functions/Prompts/prompt_bart_setup: revert to + using history text in non-"fg" case to avoid alias expansion. + +2011-08-29 Mikael Magnusson + + * 29722: Completion/X/Command/_mplayer: escape colon. + + * 29706: Completion/X/Command/_mplayer: add missing ret=0. + +2011-08-28 Peter Stephenson + + * 29731: Src/builtin.c, Test/B04read.ztst: fix output from `read + -AE' and test that and `read -Ae'. + + * users/16289: Doc/Zsh/expn.yo, Src/exec.c, Src/jobs.c: don't + delete temporary files when disowning and document this. + +2011-08-20 Barton E. Schaefer + + * unposted: Functions/Zle/.distfiles: add move-line-in-buffer + + * 29711: Completion/compaudit: avoid calling potentially-slow + "getent group" unless group-writable directories are found. + +2011-08-20 Nikolai Weibull + + * 29707: Completion/Unix/Command/.distfiles, + Completion/Unix/Command/_ln: New _ln completer. + +2011-08-18 Mikael Magnusson + + * unposted: Completion/Linux/Command/.distfiles, + Completion/Linux/Command/_schedtool, + Completion/Zsh/Command/.distfiles, + Completion/Zsh/Command/_schedtool: move _schedtool completion + to correct directory. + + * 29705: Completion/Unix/Command/_iconv: add correct number of + slashes when completing //TRANSLIT. + +2011-08-17 Peter Stephenson + + * 29703: Src/exec.c, Src/subst.c, Test/D03procsubst.ztst: + + * users/16253, users/16255: Src/utils.c, Test/D04parameter.ztst: + A nulstring should be split like an empty string. + + * Anthony R Fletcher: users/16260: + Completion/Unix/Command/_systemctl: new completion. + +2011-08-17 Nikolai Weibull + + * 29698: Completion/Unix/Command/_git: Complete diff options for git + log. + +2011-08-17 Mikael Magnusson + + * 29681: Src/Zle/zle_refresh.c: consistently use [] to access + region_highlights. + + * 29682: Completion/Zsh/Command/.distfiles, + Completion/Zsh/Command/_schedtool: new _schedtool completer. + + * 29683: Completion/Unix/Command/_ssh: add -O forward to _ssh. + + * Daniel Friesel: 29690: Completion/Linux/Command/_cryptsetup, + Completion/Unix/Command/_twidge: new _twidge and _cryptsetup + completers. + +2011-08-16 Barton E. Schaefer + + * 29694: Src/hist.c: Don't overwrite the current history word if + we aren't actually expanding an alias or history event. + + * users/16251: Functions/Prompts/prompt_bart_setup: use a preexec + hook to replace "fg" et al. with the jobtext of the resumed job. + +2011-08-16 Wayne Davison + + * 29650: Src/jobs.c: don't lose the the time info after a + suspend+restore. + +2011-08-15 Peter Stephenson + + * unposted: Src/Modules/datetime.c: use pm->node.nam to get + parameter names for errors. + +2011-08-14 Mikael Magnusson + + * 29673: Doc/Zsh/compsys.yo: clarify what 'other' in the + ignore-line style does. + + * 28852: Misc/zargs, Zle/match-words-by-style: use syntax that + doesn't depend on SHORT_LOOPS being set. + + * unposted: Src/hist.c: fix a typo in a comment. + + * unposted: Src/jobs.c: fix capitalized word in the middle of + a sentence. + + * 29388, 29680: Doc/Zsh/expn.yo: clarify note about e:string: + quoting. + + * 29504: Doc/Zsh/expn.yo: note when (#cN,M) can't be used in + place of # or ##. + +2011-08-14 Barton E. Schaefer + + * 29677: Src/exec.c, Src/signals.c, Src/zsh.h: flag jobs that are + builtins running in the current shell, and if they control a + pipeline, do not allow the external processes in that pipeline to + become suspended when the foreground shell cannot suspend. + +2011-08-11 Peter Stephenson + + * Src/Modules/datetime.mdd: unposted: also fix the autofeatures. + + * Src/params.c: unposted: Src/params.c, Test/V04features.ztst: + fix some tests I broke. + + * Src/subst.c: 29674: Src/Modules/datetime.c, + Doc/Zsh/mod_datetime.yo: add $epochtime array. + +2011-08-10 Peter Stephenson + + * 29663: configure.ac, Src/module.c, Src/Modules/datetime.c, + Doc/Zsh/mod_datetime.yo: add $EPOCHREALTIME for time in + double precision floating point. + +2011-08-04 Peter Stephenson + + * 29643: Src/signals.c, Src/utils.c, Src/zle_main.c: set + incompfunc to zero when executing hook or trap function. + +2011-08-09 Peter Stephenson + + * 29661: Doc/Zsh/redirect.yo: Improve the documentation for + {var}>... redirections. + +2011-08-09 Barton E. Schaefer + + * 29654: Src/jobs.c: "wait" should resume stopped jobs identified + by process ID as well as by job number. + + * 29654: Src/exec.c: don't hide the job table entry for the left + side of a pipline that ends in a shell builtin. This change may + be backed out if the patch in 29660 can be improved. + +2011-08-03 Peter Stephenson + + * 29644: Functions/Chpwd/zsh_directory_name_cdr, + Src/Zle/compcore.c, Src/Zle/zle_tricky.c: Work round a bug in + _describe, plus a new comment and some more braces. + + * 29633: Doc/Zsh/func.yo, Src/parse.c, Test/C04funcdef.ztst: be + more careful that anonymous function syntax doesn't mess up + working syntax with other functions. + +2011-08-03 Peter Stephenson + + * 29635: Completion/Base/Widget/_complete_debug: Improve file + descriptor handling and standardise syntax. + +2011-07-29 Frank Terbeck + + * Luka Perkov: 29624: Completion/Unix/Command/_quilt: Improve + `push' and `pop' completion. + +2011-07-28 Peter Stephenson + + * 29626: Src/parse.c, Test/C04funcdef.ztst: arguments to + anonymous functions shouldn't be parsed as command words. + + * 29602 and subsequent changes: Doc/Zsh/expn.yo: clarify meaning + of filename extension in :r and :e modifiers (which were + slightly inconsistent). + +2011-07-27 Peter Stephenson + + * 29561: Test/A04redirect.ztst: this bit didn't get committed, + somehow. + +2011-07-27 Mikael Magnusson + + * 29618: Completion/Linux/Command/_ethtool, + Completion/Zsh/Type/_file_descriptors: Fix some syntax to not depend + on SHORT_LOOPS being set. + +2011-07-25 Peter Stephenson + + * 29561: Src/exec.c, Src/utils.c, Test/A04redirect.ztst: Allow + closing of file descriptors not recorded internally by the shell. + +2011-07-22 Mikael Magnusson + + * 29596: Completion/compinit: Fix syntax to work with KSH_ARRAYS + set. + +2011-07-22 Nikolai Weibull + + * unposted: Completion/Unix/Command/_git: Use _files, not _path_files. + + * 29582: Completion/Unix/Command/_git: Alter the way that commands and + aliases are listed when both are requested. + + * 29589: Completion/Unix/Command/_git, + Completion/Debian/Command/_git-buildpackage: Use #description instead + of #desc: for description of third-party commands. Also, refactor the + code to match the rest of the file. + +2011-07-21 Nikolai Weibull + + * 29272: Completion/Unix/Command/_git: Use return values correctly + accross all completion functions. + + * unposted: Completion/Unix/Command/_git: Move _gitk and _tig to + correct location. + + * unposted: Completion/Unix/Command/_git: Fix bug in git-add completion + that prevented -f option from being used correctly. + + * unposted: Completion/Unix/Command/_git: Update git-add completion to + not complete already given file arguments and also to not list file + completions if an option is being completed. + + * unposted: Completion/Unix/Command/_git: Adjust some TODO items. + +2011-07-19 Peter Stephenson + + * 29555: Src/exec.c: fix problem that shell failed to use file + descriptor opened in parent if beyond max_zsh_fd. + +2011-07-18 Peter Stephenson + + * users/16131: Src/hist.c: skip reading an empty history file. + +2011-07-18 Peter Stephenson + + * Matthieu Baerts: 29547: Completion/Unix/Command/_bzr: cdiff + subcommand. + +2011-07-12 Peter Stephenson + + * 29543: Src/hist.c: saved history lines with backslash-newline + in the middle of words confused histlexwords. + + * 29542: Src/hist.c, Src/Zle/zle_main.c: remove test when + initialising history that could cause crashes (and was probably + never useful); ensure ZLE returns NULL if there's an error. + +2011-07-04 Peter Stephenson + + * Eric Moors: 29531: Completion/Unix/Command/_adb: completion + for Android debugger. + +2011-07-03 Frank Terbeck + + * unposted: Doc/Zsh/contrib.yo: Fix typo "paramter". Caught by + debian's lintian. + +2011-07-01 Peter Stephenson + + * 29530: Src/subst.c, Test/E01options.ztst: ${..?..} shouldn't + cause an error with NO_EXEC option. + +2011-07-01 Frank Terbeck + + * 29518: Completion/Unix/Command/_git: Fall back to file + completion for unknown sub-commands. + + * 29527: Completion/Unix/Command/_git: Make file-completion + fallback optional. + + * 29519: Completion/Unix/Command/_git: Pick up addon completions + from $fpath. + + * 29521: Completion/Unix/Command/_git: Add `user-commands' support + again. + + * 29523: Completion/Debian/Command/_git-buildpackage: Use "#desc:" + line for _git third-party add-on completion description. + + * Daniel Bolton: 29529: Completion/Debian/Command/_aptitude: Complete + format specifiers with the `-F' option. + +2011-06-30 Frank Terbeck + + * 29526: Functions/VCS_Info/vcs_info: Set `max-exports' early + after certain `start-up' hooks. + +2011-06-28 Frank Terbeck + + * Sebastian Ramacher: 29513: Completion/Debian/Command/_apt: Add + markauto and unmarkauto sub-commands. + +2011-06-27 Peter Stephenson + + * Mikael Muszynski: 29510: Completion/X/Command/_mplayer: + complete .m4v files. + +2011-06-25 Peter Stephenson + + * Axel Beckert: 29506: Doc/Zsh/params.yo: use format + SINGLE_LINE_ZLE as elsewhere in manual. + +2011-06-23 Peter Stephenson + + * 29503: Src/exec.c: Missing popheap() on failed autoload. + +2011-06-20 Peter Stephenson + + * unposted: update version to 4.3.12-dev-1 as wordcode + now incompatible with anonymous functions. + +2011-06-20 Doug Kearns + + * unposted: Completion/BSD/Command/_sockstat, + Completion/Debian/Command/_git-buildpackage, + Completion/Unix/Command/_at, Completion/Unix/Command/_lp, + Completion/Unix/Command/_unison, Completion/X/Command/_matlab, + Completion/X/Command/_okular, Completion/Zsh/Function/_zargs: clean up + completion descriptions as per Etc/completion-style-guide. + +2011-06-19 Peter Stephenson + + * Luka Perkov: 29493: Completion/Unix/Type/_pdf: handle apvlv. + + * 29492: Doc/Zsh/func.yo, Src/exec.c, Src/parse.c, Src/text.c, + Test/C04funcdef.ztst: add argument handling to anonymous functions. + + * unposted: Src/Zle/zle_refresh.c: remove additional loop + noticed by Mikael. + + * 29491: Src/glob.c, Src/lex.c, Src/math.c, Src/params.c, + Src/parse.c, Src/utils.c, Src/Modules/db_gdbm.c, + Src/Zle/compcore.c, Src/Zle/complist.c, Src/Zle/zle_refresh.c, + Src/Zle/zle_tricky.c: remove some variables set but not used. + + * 29490: Src/Builtins/rlimits.awk, Src/Builtins/rlimits.c, + Src/Builtins/rlimits.mdd: add RLIMIT_RTTIME. + +2011-06-18 Peter Stephenson + + * Michel Dos Reis: 29482: Completion/Linux/Command/_modutils: + handle .gz kernel modules. + +2011-06-16 Doug Kearns + + * 29483: Completion/Unix/Command/_vim: add --servername completion. + +2011-06-15 Barton E. Schaefer + + * 29481: Src/jobs.c, Src/signals.c: always return a matching job + in findproc() [reverses 28967 and 29472], but scan the whole list + to prefer running jobs in the rare event that one running and one + exited job share a PID. + +2011-06-14 Peter Stephenson + + * unposted: Doc/Zsh/compwid.yo: document change to brace + parameter context in 29452/29459. + +2011-06-12 Barton E. Schaefer + + * 29472: Src/jobs.c: findproc() needs at least to also return + stopped jobs. See 28967. + +2011-06-08 Peter Stephenson + + * Jeremy Sylvestre: 29468: Functions/Zle/define-composed-chars: + add some ligatures and symbols. + +2011-06-06 Peter Stephenson + + * 29462: Src/subst.c: fix warning with some compilers (code was + already safe). + +2011-06-05 Clint Adams + + * unposted: Functions/Zle/move-line-in-buffer: clean + the funny characters out of move-line-in-buffer. + +2011-06-04 Barton E. Schaefer + + * 29444: Completion/Unix/Type/_path_files: when called with a + pattern to match directories, as from _files with list-dirs-first, + do not descend into subdirectories looking for fake files unless + some fake files have been defined. + +2011-06-04 Peter Stephenson + + * 29459: Completion/Zsh/Context/_brace_parameter, + Src/Zle/compcore.c (check_param): In shell function, check for + ${( not at start of match; in C code, check for untokenized + parentheses when in double quotes. + +2011-06-03 Peter Stephenson + + * 29452: Completion/Zsh/Context/_brace_parameter, + Src/Zle/compcore.c (typo corrected): allow completion + of parameter flags. + +2011-06-03 Mikael Magnusson + + * 29438: Completion/Zsh/Context/_subscript: adjust pattern so + we complete dynamic directory names in command position as well. + + * 29448: Completion/Unix/Command/_initctl: complete symlinks + to files too. + + * 29422: Test/D04parameter.ztst: Fix test for g:: to not depend + on the current locale. + +2011-06-03 Peter Stephenson + + * 29451: Src/subst.c, Test/D04parameter.ztst: ${##stuff} + removes stuff from the head of $#. + + * 29413: Doc/Zsh/builtins.yo, Src/builtin.c, Src/hist.c: print + -S takes a single argument, applies lexical history word + splitting, and puts it on the history. + +2011-06-02 Frank Terbeck + + * 29434: Doc/Zsh/contrib.yo: Use PLUS() to avoid a + being + silently dropped. + +2011-06-01 Frank Terbeck + + * 29412: Completion/Unix/Command/_tmux: Disable sub-command + completions if tmux is not found in `$path'. + + * Valentin Haenel: 29431: Misc/vcs_info-examples: Hook example for + signaling untracked files in git repositories. + +2011-06-01 Barton E. Schaefer + + * users/16064: Functions/Zle/move-line-in-buffer: example widget + for moving in multiline buffers without navigating history + + * 29416 (plus typo fixes): Doc/Zsh/contrib.yo: Fix (mis-)uses of + var() in vcs_info documentation. + +2011-05-31 Peter Stephenson + + * unposted: Config/version.mk: update version to 4.3.12-dev-0 + to avoid confusion with release. + +2011-05-31 Frank Terbeck + + * Jan Pobrislo: 29411: + Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr: vcs_info: Major + bzr backend update. + +2011-05-31 Barton E. Schaefer + + * 29410: Test/V01zmodload.ztst: skip autoload persistence test + when zsh/example module is not available. + +2011-05-31 Mikael Magnusson + + * Omari Norman: users/16057: Completion/Unix/Command/.distfiles, + Completion/Unix/Command/_tree: Add completion for tree. + +2011-05-31 Peter Stephenson + + * unposted: Config/version.mk: release 4.3.12. + +2011-05-29 Nikolai Weibull + + * unposted: Completion/Unix/Command/_git: Update git-branch completion + to deal with -r and -d correctly. + +2011-05-27 Peter Stephenson + + * 29403: Src/hist.c: histlexwords splitting of ";;" in case. + +2011-05-27 Mikael Magnusson + + * 28364: Doc/Zsh/zle.yo: Document that space left by wrapping + double-width characters is highlighted with the 'special' style. + + * 29384: Completion/Base/Completer/_expand, + Completion/Unix/Type/_have_glob_qual, + Completion/Unix/Type/_path_files, Completion/compinit: Add + _comp_caller_options and use it in completions that want to + check values of options that are overwritten by _comp_options. + + * 29334: Completion/Unix/Command/_sh: Complete options for zsh with + _arguments --. + + * 29392: Doc/Zsh/compsys.yo: Remove now-defunct use-perl style + documentation. + + * 29387: Completion/Unix/Command/.distfiles, + Completion/Unix/Command/_at: Add completion for at and friends. + + * 29385: Doc/Zsh/compsys.yo: Document when directories and + local-directories are used. + +2011-05-27 Barton E. Schaefer + + * 29382: Src/Modules/curses.c: apply 29374 to zccmd_input too. + +2011-05-27 Mikael Magnusson + + * 29331: NEWS: Note g:: parameter expansion flag. + + * 29365: Completion/Unix/Command/_make: redefine _make so that + helper functions are only defined once. + + * 29376: Completion/Unix/Command/_initctl: redefine _initctl so + that helper functions are only defined once. + + * unposted: Doc/Zsh/params.yo: Document that PROMPT_EOL_MARK can + be empty, forgot in 28480. + + * 29329: Src/math.c: Fix undefined behaviour in function argument + evaluation order. + +2011-05-26 Peter Stephenson + + * unposted: Etc/CONTRIBUTORS: expand. + + * 29374: Src/Zle/zle_main.c: Exit ZLE immediately if exit + is pending when a keypress is expected. + +2011-05-25 Peter Stephenson + + * Bernhard Tittelbach: 29371: Completion/Unix/Command/_initctl: + completion for initctl and related system job management + utilities. + +2011-05-24 Barton E. Schaefer + + * 29368: Src/exec.c: do not restore xtrerr to stderr before + running simple commands; restore xtrerr to stderr just before + running a function body, but after printing the trace of + the function call itself. + + * 29367: Test/E02xtrace.ztst: update tests to fix mistaken + assumptions introduced by 25145 and add check of redirection + inside a function body. + +2011-05-24 Mikael Magnusson + + * 29364: Completion/Unix/Command/_make: Partial fix for + completion in dirs with spaces and other unusual characters. + + * 29335: Completion/Linux/Command/_valgrind: Update the hack + for --tool= completion. + + * 29338: Completion/Base/Core/_main_complete: Correct pattern + checking for true value in insert-tab style. + +2011-05-23 Peter Stephenson + + * unposted: Config/version.mk: 4.3.11-dev-4. + + * 29351: Src/subst.c: need to cast non-integer + stdarg arguments to integer to fit % prototype. + + * unposted: Completion/Unix/Command/_go: typo + + * 29341, corrected: Completion/Unix/Command/_go, + Completion/Unix/Command/.distfiles: basic completion for + commands associated with the Go programming language. + +2011-05-22 Mikael Magnusson + + * unposted: Doc/Zsh/compsys.yo, ChangeLog: Quote -e with tt(). + Fix some formatting in ChangeLog. + + * 29328: Completion/Redhat/Command/_rpm, + Completion/Unix/Command/_git, Completion/Unix/Command/_gnutls, + Completion/Unix/Command/_gpg, Completion/Unix/Command/_growisofs, + Completion/Unix/Command/_php: Another missing backslash in _git, + remove some not needed backslashes in array definitions. + +2011-05-19 Mikael Magnusson + + * 29224: Doc/Zsh/expn.yo, NEWS, Src/subst.c, + Test/D04parameter.ztst: Support negative LEN in ${VAR:OFFSET:LEN} + like bash. + + * 29261: Doc/Zsh/expn.yo, Src/subst.c, Test/D04parameter.ztst: + Add g:: parameter expansion flag. Add note that s:: can take an + empty string. + + * 29307, 29308 + replies: Completion/BSD/Command/_bsd_pkg, + Completion/Base/Utility/_sep_parts, Completion/Unix/Command/_git, + Completion/Unix/Command/_osc, Completion/Unix/Command/_perforce, + Completion/compinit, Completion/openSUSE/Command/_osc, + Completion/openSUSE/Command/_zypper, Doc/Zsh/builtins.yo, + Doc/Zsh/calsys.yo, Doc/Zsh/compctl.yo, Doc/Zsh/compsys.yo, + Doc/Zsh/compwid.yo, Doc/Zsh/contrib.yo, + Doc/Zsh/expn.yo, Doc/Zsh/zle.yo, Etc/CONTRIBUTORS, + Functions/Calendar/calendar_parse, Functions/Misc/sticky-note, + Functions/TCP/tcp_read, Functions/Zftp/zfcput, Src/Zle/compctl.c, + Src/Zle/zle_hist.c, Src/exec.c, Src/hist.c, Src/jobs.c, Src/lex.c, + Src/math.c, Src/params.c, Src/subst.c: Fix some doubled words in + docs and comments. + +2011-05-18 Wayne Davison + + * Valentin Haenel: 29315: Completion/Unix/Command/_git: add a + missing backslash. + +2011-05-17 Barton E. Schaefer + + * unposted: Doc/Zsh/options.yo: tweak description of the -l (LOGIN) + option for clarity. + + * 29313: Src/subst.c: when SHWORDSPLIT is in effect, the state of + the (@) expansion flag depends on the value of $IFS so as to mimic + Bourne shell join/split behavior more closely (see users/15442). + + * 29312, users/16032: Doc/Zsh/mod_zutil.yo, Src/Modules/zutil.c: + add "zparseopts -M" which allows option descriptions to map + synonymous option names onto a single name. + +2011-05-17 Clint Adams + + * 29306: Completion/Debian/Command/_make-kpkg: typo fix + from Laurent Fousse. + +2011-05-17 Frank Terbeck + + * Nikolai Weibull: 29166: Completion/Unix/Command/_git: Speed + improvements for file completion. + +2011-05-17 Nikolai Weibull + + * 29273: Completion/Unix/Command/_git: Parse compadd options in + __git_guard_number. + +2011-05-14 Barton E. Schaefer + + * 29278: Completion/Unix/Type/_path_files: fix use of the $skips + pattern from the squeeze-slashes style. + +2011-05-14 Mikael Magnusson + + * 29271: Doc/Zsh/compwid.yo: document _alternative -O name. + +2011-05-14 Peter Stephenson + + * 29282: Src/mem.c: hide prototypes for ZSH_HEAP_DEBUG with + #ifdef's. + +2011-05-14 Bart Schaefer + + * 29276: Src/zsh.h: typedef Heapid unconditionally, to prevent + compile errors in automatically-generated header files. + +2011-05-14 Peter Stephenson + + * 29268: Src/Zle/compcore.c: dupstring() the value that's + going to be used for prpre, whatever the heck that is. + + * 29267: configure.ac, Src/mem.c, Src/zsh.h, Src/Zle/comp.h, + Src/Zle/compcore.c, Src/Zle/compctl.c, Src/Zle/complist.c, + Src/Zle/compresult.c: add --enable-zsh-heap-debug and use + for debugging completion matcher groups. + +2011-05-13 Peter Stephenson + + * Danek: 29254: Src/cond.c, Src/Builtins/rlimits.c, + Src/Modules/datetime.c, Src/Modules/zftp.c, Src/Zle/computil.c: + fix some compiler warnings. + +2011-05-13 Peter Stephenson + + * Jérémie Roquet: 29258: Src/Zle/zle_utils.c: mark a couple + more functions for export. + + * unposted (late commit): Completion/Unix/Command/.distfiles, + Config/version.mk, Test/.distfiles: update for 4.3.11-dev-3. + +2011-05-12 Mikael Magnusson + + * 29245: Completion/X/Command/_xset: pass -O instead of -o + to _describe. + + * Nikolai Weibull: 29124: Completion/Unix/Command/_git: Fix + -l option. + + * 29205: Completion/Unix/Type/_pids: don't sort processes. + + * 29208: Src/Zle/zle_move.c: make vimatchbracket check the + character left of the cursor when at the end of the line. + +2011-05-11 Mikael Magnusson + + * 29206: Doc/Zsh/mod_complist.yo: fix formatting. + +2011-05-11 Peter Stephenson + + * 29217: Src/zsh.mdd: zshterm.h and zshcurses.h are now + dependencies for the main shell. + +2011-05-10 Peter Stephenson + + * unposted: Src/.distfiles, Src/system.h, Src/zsh.mdd, + Src/zsh_system.h: rename system.h to zsh_system.h to ensure + there are no clashes. + + * 29214: Src/Makemod.in.in, Src/mkmakemod.sh, Src/zsh.mdd: use + -I to find headers in order to allow #include'ing generated + headers from non-generated headers when the build tree is + separate from the source tree. + + * 29191 (Danek) and 29203 (with fixes): Doc/Zsh/params.yo, + Src/params.c: make TERMINFO variable special. + +2011-05-09 Peter Stephenson + + * 29195: Src/.distfiles, Src/hashnameddir.c, Src/hashtable.c, + Src/system.h, Src/zsh.mdd: Separate out hash handling for named + directories in order to keep RCP header usage from curses to + avoid clash on Solaris 8. + + * 29193: Src/text.c: fix variable declaration that was after + code. + + * 29165: Src/builtin.c, Src/exec.c, Src/glob.c, Src/hashtable.c, + Src/init.c, Src/jobs.c, Src/loop.c, Src/params.c, Src/prompt.c, + Src/system.h, Src/utils.c, Src/Modules/files.c, + Src/Modules/termcap.c, Src/Modules/zpty.c, Src/Zle/comp.h, + Src/Zle/complist.c, Src/Zle/compmatch.c, Src/Zle/compresult.c, + Src/Zle/computil.c, Src/Zle/zle_refresh.c, Src/Zle/zle_tricky.c, + Src/Zle/zle_utils.c: Use term.h globally if needed, instead of + just using in Modules and fudging the headers elsewhere. Fix + various name clashes. + +2011-05-08 Barton E. Schaefer + + * users/15986 (belated commit): Src/Modules/curses.c: handle + EINTR in zccmd_input. + +2011-05-08 Wayne Davison + + * Valentin Haenel: 29187: Completion/Unix/Command/_git: add a + missing backslash. + +2011-05-07 Barton E. Schaefer + + * 29175 (w/comment typo fixed): Src/mem.c: optimize freeheap. + +2011-05-07 Frank Terbeck + + * 29170: Doc/Zsh/contrib.yo: vcs_info: Clarify check-for-changes + style behaviour with the mercurial backend. + + * unposted: Doc/Zsh/contrib.yo: Add missing word ("style") spotted + by Bart. + +2011-05-06 Peter Stephenson + + * 29163: README, Etc/FAQ.yo: update latest version claimed + to 4.3.12. + 2011-05-04 Barton E. Schaefer * 29140: Completion/bashcompinit: introduce function-scope wrapper @@ -54,7 +920,7 @@ * 29107: Src/Zle/zle_tricky.c: replace overlapping strcpy with memmove. -2011-04-27 Mikael Magnusson +2011-04-27 Mikael Magnusson * 29051: Completion/Unix/Command/_make: add _make- prefix to internal helper functions. @@ -127,7 +993,7 @@ * Simon Ruderich: 28927: Completion/Unix/Command/_git: Fix "git tag -v" completion. -2011-04-15 Mikael Magnusson +2011-04-15 Mikael Magnusson * 28998: Completion/Unix/Command/_make: set return status correctly. @@ -165,7 +1031,7 @@ 2011-04-01 Peter Stephenson - * Stef van Vlierberghe: 28965 (as posted in 28967): + * Stef van Vlierberghe: Src/jobs.c: 28965 (as posted in 28967): findproc() should not return processes not marked as SP_RUNNING since findproc() is used find processes still known to the OS. @@ -196,7 +1062,7 @@ Functions/VCS_Info/vcs_info: Make the nvcsformats style be used if vcs_info is disabled. -2011-03-29 Mikael Magnusson +2011-03-29 Mikael Magnusson * unposted: Completion/Unix/Command/_vim: Fix typo in description for -N. @@ -304,7 +1170,7 @@ 2011-03-01 Peter Stephenson * Baptiste: 28819: Completion/BSD/Command/_sockstat, - Completion/Unix/Command/_mount, + Completion/Unix/Command/_mount, Completion/Unix/Type/_file_systems: FreeBSD completion tweaks. 2011-02-28 Barton E. Schaefer @@ -1814,11 +2680,11 @@ * Frank: 27717: Functions/VCS_Info/vcs_info_lastmsg: add option terminators for builtins. -2010-12-17 Andrey Borzenkov +2010-12-17 Andrey Borzenkov * unposted: Doc/Zsh/compsys.yo: typo fix -2010-12-16 Andrey Borzenkov +2010-12-16 Andrey Borzenkov * 27715: Completion/Unix/Command/_stgit: fixes for new version (workaround removed commands); autogenerate list @@ -2096,7 +2962,7 @@ * 27518: Completion/Unix/Command/_configure: suggest some more patterns for arguments. -2009-12-14 Andrey Borzenkov +2009-12-14 Andrey Borzenkov * unposted: Completion/Unix/Command/_grep: add --exclude-dir option @@ -2713,7 +3579,7 @@ save and restore the lexical context to avoid pulling the rug out when called in some nested fashion. -2009-06-28 Andrey Borzenkov +2009-06-28 Andrey Borzenkov * unposted: Completion/Unix/Command/_man: support lzma compression of man pages used in Mandriva @@ -2899,7 +3765,7 @@ variables should be zeroed even if the module is being unloaded (problem on HP-UX). -2009-05-09 Andrey Borzenkov +2009-05-09 Andrey Borzenkov * unposted: Completion/Unix/Command/_getfacl: fix options definition; add file names completion for variant=unix @@ -3010,7 +3876,7 @@ * Kalle Olavi Niemitalo: 26850: Completion/Unix/Command/_git: fix breakage in git write-tree and git send-pack. -2009-04-18 Andrey Borzenkov +2009-04-18 Andrey Borzenkov * users/14033 as modified by users/14037 and added doc: Completion/Base/Utility/_describe, Doc/Zsh/compsys.yo: allow @@ -3474,7 +4340,7 @@ * Richard Hartmann: 26535: Doc/Zsh/options.yo: remove typo. -2009-02-08 Andrey Borzenkov +2009-02-08 Andrey Borzenkov * 26530: Doc/Zsh/builtins.yo: clarify that "emulate -c" restores all options on return, not only those related @@ -3507,7 +4373,7 @@ * 26513: README: note that addition of ".." in completion was broken. -2009-02-01 Andrey Borzenkov +2009-02-01 Andrey Borzenkov * 26504: Doc/Zsh/options.yo: document that LOCAL_OPTIONS does not restore PRIVILEGED and RESTRICTED @@ -3581,7 +4447,7 @@ * Greg Klanderman: 26439: Doc/Zsh/mod_system.yo: convert sections to subsections. -2009-01-25 Andrey Borzenkov +2009-01-25 Andrey Borzenkov * 26425: Doc/Zsh/builtins.yo Src/builtin.c: "emulate csh -c command" will evaluate `command' after temporary @@ -3707,7 +4573,7 @@ * unposted: add RCS Revision tag for use in patchlevel recording. -2009-01-09 Andrey Borzenkov +2009-01-09 Andrey Borzenkov * 26270: Completion/Base/Utility/_values, Doc/Zsh/compwid.yo, Src/Zle/compcore.c, Src/Zle/complete.c, Src/Zle/compresult.c: @@ -3745,7 +4611,7 @@ Completion/Unix/Type/_ps, Completion/Unix/Type/_pdf: files compressed with .bz2. -2009-01-05 Andrey Borzenkov +2009-01-05 Andrey Borzenkov * 26247: configure.ac, Src/Zle/zle_tricky.c: fix compilation with -Werror=format-security GCC option. @@ -4785,7 +5651,7 @@ of complex sublists were wrong, plus test; another place to make lineno more consistent. -2008-08-31 Andrey Borzenkov +2008-08-31 Andrey Borzenkov * users/13169: Src/exec.c: really restore emulation mode when exiting shell function if 'emulate -L' has been used (actually @@ -5790,7 +6656,7 @@ * users/12793: William Scott: Completion/BSD/Command/_chflags: hidden/nohidden flags. -2008-04-20 Andrey Borzenkov +2008-04-20 Andrey Borzenkov * 24851: Doc/Zsh/mod_complist.yo, Src/Zle/complist.c: support colour codes for from current GNU ls @@ -6056,7 +6922,7 @@ 2008-03-22 Barton E. Schaefer * unposted: Doc/Zsh/params.yo: further documentation tweak for the - (R) and (I) subscript flags. + (R) and (I) subscript flags. 2008-03-18 Barton E. Schaefer @@ -7625,7 +8491,7 @@ words immediately followed by () or something that looks like it's going to be one. -2007-08-12 Andrey Borzenkov +2007-08-12 Andrey Borzenkov * 23751: Completion/Linux/Command/_modutils: support for completing module files directly @@ -7796,7 +8662,7 @@ make autoloads persistent. Put modules in hash table. Rationalise error handling and error messages. Improve module listing. Abort at top level of list execution when - errflag is set instead of relying on called functions returning + errflag is set instead of relying on called functions returning early. 2007-07-06 Clint Adams @@ -8264,7 +9130,7 @@ * 23433: Src/Zle/zle_main.c: cast for ZMAXTIMEOUT was wrong where sizeof(long) > sizeof(int). -2007-05-10 Andrey Borzenkov +2007-05-10 Andrey Borzenkov * 23409 with extra comment: Src/init.c, Src/utils.c: after ZLE displayed "use 'exit' to exit" message, PROMPT_SP will overwrite @@ -8549,7 +9415,7 @@ * 23214: Completion/Unix/Command/_subversion: complete files after svn commit --file. -2007-02-10 Felix Rosencrantz +2007-02-10 Felix Rosencrantz * unposted: Completion/Unix/Command/_comm: added -s flag to _arguments so completion could deal with combined flags. @@ -8681,7 +9547,7 @@ try to parse base indicators in octal and raise error for bases above 36. -2007-02-10 Felix Rosencrantz +2007-02-10 Felix Rosencrantz * 23164: Src/builtin.c when PUSHD_SILENT is set, don't print anything from popd/pushd. @@ -9308,7 +10174,7 @@ * 22835: Completion/Unix/Command/_pon: tidy up pon bit and add poff completion. -2006-10-07 Andrey Borzenkov +2006-10-07 Andrey Borzenkov * 22831: Src/Zle/comp.h, Src/Zle/compresult.c, Src/Zle/computil.c: make CM_SPACE definition global and use it consistently in @@ -9415,7 +10281,7 @@ Completion/Linux/Type/_wakeup_capable_devices: completion for acpitool. -2006-09-30 Andrey Borzenkov +2006-09-30 Andrey Borzenkov * unposted: Src/Zle/compmatch.c: fix thinko in 22787 that changed semantic of pattern matching in join_strs @@ -9424,7 +10290,7 @@ * 22789: Src/init.c: Source zshenv even if non-interactive. -2006-09-29 Andrey Borzenkov +2006-09-29 Andrey Borzenkov * 22787: Srz/Zsh/compmatch.c: change calling convention of pattern_match to not depend on current implementation that works @@ -9455,7 +10321,7 @@ Src/Zle/zle_main.c: rename some MB_ macros to WC_ since they act on wchar_t's. -2006-09-23 Andrey Borzenkov +2006-09-23 Andrey Borzenkov * unposted: Test/A06assign.ztst, Test/B03print.ztst, Test/E01options.ztst, Test/ztst.zsh: as pointed by Bart in 22759, @@ -9466,7 +10332,7 @@ to consistently use character width when laying out matches. This supercedes fix in 22729. -2006-09-22 Andrey Borzenkov +2006-09-22 Andrey Borzenkov * 22758: Test/A06assign.ztst, Test/B03print.ztst, Test/E01options.ztst: force locale to C to avoid test failures @@ -9517,7 +10383,7 @@ * 22727: Src/init.c, Src/Zle/zle_main.c: "use 'exit' to exit" was suboptimal. -2006-09-16 Andrey Borzenkov +2006-09-16 Andrey Borzenkov * 22721: Makefile.in: add pdf target @@ -9714,7 +10580,7 @@ 2006-08-09 Peter Stephenson * unposted: Functions/Example/pushd: maintain pushdignoredups if - it was set on entry to the function. I have a weird sense of + it was set on entry to the function. I have a weird sense of deja vu about this... * 22594: Src/Zle/complist.c, Src/Zle/compresult.c, @@ -11747,7 +12613,7 @@ * 21609: Src/glob.c: fixed the readlink() call in statfullpath(). -2005-08-15 Felix Rosencrantz +2005-08-15 Felix Rosencrantz * 21611: Completion/X/Command/_mozilla: Added Firefox support. @@ -12354,7 +13220,7 @@ Completion/Zsh/Type/_options, Completion/Zsh/Type/_options_set, Completion/Zsh/Type/_options_unset: make completion functions give precedence to descriptions passed as parameters and - cleanup descriptions in calling functions + cleanup descriptions in calling functions * 21314: Doc/Zsh/compsys.yo: declare expl local in example use of _wanted @@ -12474,12 +13340,12 @@ * unposted: Completion/X/Command/_qiv: new completion for qiv -2005-05-13 Motoi Washida +2005-05-13 Motoi Washida * users/8826: Completion/Darwin/Type/_retrieve_mac_apps: search applications using spotlight. -2005-05-12 Felix Rosencrantz +2005-05-12 Felix Rosencrantz * 21257: Completion/Unix/Command/_perforce: fix minor typo in completion for the p4 password command. @@ -12624,7 +13490,7 @@ * 21156: Completion/Debian/Command/_dpkg: tweaks to dpkg-reconfigure completion. -2005-04-18 Felix Rosencrantz +2005-04-18 Felix Rosencrantz * 21154: Completion/Unix/Command/_perforce: add pid completion for monitor (clear|terminate) commands. @@ -13123,7 +13989,7 @@ cleanup and 2 more options for the upcoming rsync 2.6.4 release. -2005-02-19 Motoi Washida +2005-02-19 Motoi Washida * users/8522: Completion/Darwin/Command/_defaults: fixed the number of spaces broken while sending the patch by email. @@ -13632,7 +14498,7 @@ * 20528: Src/exec.c: Clint spotted that fix in 18492 to make > >(...) synchronous failed in the case of an fd opened for the - shell's own use with an exec. + shell's own use with an exec. 2004-10-26 Peter Stephenson @@ -14228,7 +15094,7 @@ * 20024: Doc/Zsh/func.yo: Improve documentation for TRAPNAL functions. -2004-06-03 Felix Rosencrantz +2004-06-03 Felix Rosencrantz * 20002: Src/Zle/compmatch.c: Fix a problem with an inconsistent struct change in cmp_anchors(). @@ -14554,7 +15420,7 @@ configure.ac, Doc/Zsh/mod_zftp.yo, Src/Modules/zftp.c, Etc/NEWS, Functions/Zftp/zfstat: Add support for non-standard ports to core zftp. Not yet handled by the function system - (except zfstat reports port): needed in lastloc and bookmarks. + (except zfstat reports port): needed in lastloc and bookmarks. 2004-03-23 Peter Stephenson @@ -14585,5 +15451,5 @@ ***************************************************** * This is used by the shell to define $ZSH_PATCHLEVEL -* $Revision: 1.5277 $ +* $Revision: 1.5474 $ ***************************************************** diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Completer/_expand zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Completer/_expand --- zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Completer/_expand 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Completer/_expand 2011-10-02 01:10:11.000000000 +0000 @@ -70,7 +70,7 @@ ### parameter expressions such as ${foo} be expanded like brace ### expansions, too (and with braceccl set...). - if [[ ! -o ignorebraces && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]]; then + if [[ ! $_comp_caller_options[ignorebraces] == on && "${#${exp}//[^\{]}" = "${#${exp}//[^\}]}" ]]; then local otmp tmp=${(q)word} diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Core/_main_complete zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Core/_main_complete --- zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Core/_main_complete 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Core/_main_complete 2011-10-02 01:10:11.000000000 +0000 @@ -51,7 +51,7 @@ fi if [[ "$compstate[insert]" = tab* ]]; then - { [[ "$tmp" = (|[[:blank:]]*)(yes|true|on|1)(|[[:blank:]]*) ]] && + { [[ "$tmp" = (|*[[:blank:]])(yes|true|on|1)(|[[:blank:]]*) ]] && { [[ "$curcontext" != :* || -z "$compstate[vared]" ]] || zstyle -t ":completion:vared${curcontext}:" insert-tab } } && return 0 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Utility/_sep_parts zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Utility/_sep_parts --- zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Utility/_sep_parts 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Utility/_sep_parts 2011-10-02 01:10:11.000000000 +0000 @@ -96,7 +96,7 @@ autosuffix=() while [[ $# -gt 0 && "$str" == *${1}* ]]; do - # Remove anything up to the the suffix. + # Remove anything up to the suffix. str="${str#*${1}}" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Widget/_complete_debug zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Widget/_complete_debug --- zsh-beta-4.3.11-dev-1+20110504/Completion/Base/Widget/_complete_debug 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Base/Widget/_complete_debug 2011-10-02 01:10:11.000000000 +0000 @@ -6,21 +6,27 @@ local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count] local pager w="${(qq)words}" -exec 3>&- # Too bad if somebody else is using it ... -[[ -t 2 ]] && { exec 3>&2 2>| $tmp ; trap 'exec 2>&3 3>&-' EXIT INT } +integer debug_fd=-1 +{ + if [[ -t 2 ]]; then + exec {debug_fd}>&2 2>| $tmp + fi -setopt xtrace -: $ZSH_NAME $ZSH_VERSION -${1:-_main_complete} -integer ret=$? -unsetopt xtrace + setopt xtrace + : $ZSH_NAME $ZSH_VERSION + ${1:-_main_complete} + integer ret=$? + unsetopt xtrace -[[ -t 3 ]] && { + if (( debug_fd != -1 )); then zstyle -s ':completion:complete-debug::::' pager pager print -sR "${pager:-${PAGER:-${VISUAL:-${EDITOR:-more}}}} ${(q)tmp} ;: $w" _message -r "Trace output left in $tmp (up-history to view)" - [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]] && + if [[ $compstate[nmatches] -le 1 && $compstate[list] != *force* ]]; then compstate[list]='list force messages' + fi + fi +} always { + (( debug_fd != -1 )) && exec 2>&$debug_fd {debug_fd}>&- } - return ret diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/BSD/Command/_bsd_pkg zsh-beta-4.3.12-dev-1+20110925/Completion/BSD/Command/_bsd_pkg --- zsh-beta-4.3.11-dev-1+20110504/Completion/BSD/Command/_bsd_pkg 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/BSD/Command/_bsd_pkg 2011-10-02 01:10:11.000000000 +0000 @@ -178,7 +178,7 @@ '-m[show mtree files]' '-p[show installation prefixes]' '-q[be quiet]' - '-R[show list list of installed requiring packages]' + '-R[show list of installed requiring packages]' '-r[show requirements scripts]' '-v[be verbose]' ) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/BSD/Command/_sockstat zsh-beta-4.3.12-dev-1+20110925/Completion/BSD/Command/_sockstat --- zsh-beta-4.3.11-dev-1+20110504/Completion/BSD/Command/_sockstat 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/BSD/Command/_sockstat 2011-10-02 01:10:11.000000000 +0000 @@ -3,10 +3,10 @@ local tmp_proto protocols proto tmp_proto=(${${(M)${(f)"$( so that the -# completions are chosen as given in the the rest of the file, +# completions are chosen as given in the rest of the file, # 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. # @@ -160,7 +160,9 @@ # have a valid stdin descriptor (zle closes it before calling widgets) # and don't get confused by user's ZERR trap handlers. -typeset -g _comp_setup='setopt localoptions localtraps ${_comp_options[@]}; +typeset -g _comp_setup='local -A _comp_caller_options; + _comp_caller_options=(${(kv)options[@]}); + setopt localoptions localtraps ${_comp_options[@]}; local IFS=$'\'\ \\t\\r\\n\\0\'' exec processes' && ret=0 + +if [[ -n "$state" ]]; then + _alternative \ + 'processes:: _pids' && ret=0 +fi + +return ret diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Linux/Command/_valgrind zsh-beta-4.3.12-dev-1+20110925/Completion/Linux/Command/_valgrind --- zsh-beta-4.3.11-dev-1+20110504/Completion/Linux/Command/_valgrind 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Linux/Command/_valgrind 2011-10-02 01:10:11.000000000 +0000 @@ -118,7 +118,11 @@ # Basically uses debug output to find out the directory where the tools are # present and lists all executables in that directory. # Hope the program provides a neater interface some day! - tools=(${${${(M)${(f)"$(_call_program tools valgrind --tool=something -d 2> /dev/null)"}:#*launcher launching *something}##*launcher launching }%%something}*(*:t)) + () { + setopt localoptions histsubstpattern + tools=( ${${${(M)${(f)"$(_call_program tools valgrind --tool=something -d 2>&1)"}:#*launcher launching *something*}##*launcher launching }%%something*}*~*.*(*:t:s/-*//) ) + typeset -U tools + } _wanted tools exl 'valgrind tool' compadd $tools && return fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/openSUSE/Command/_osc zsh-beta-4.3.12-dev-1+20110925/Completion/openSUSE/Command/_osc --- zsh-beta-4.3.11-dev-1+20110504/Completion/openSUSE/Command/_osc 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/openSUSE/Command/_osc 2011-10-02 01:10:11.000000000 +0000 @@ -4,7 +4,7 @@ # # This file is released under the GPLv2. # -# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html +# Based on the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html # # Toggle verbose completions: zstyle ':completion:*:osc:*' verbose no # zstyle ':completion:*:osc-subcommand:*' verbose no diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/openSUSE/Command/_zypper zsh-beta-4.3.12-dev-1+20110925/Completion/openSUSE/Command/_zypper --- zsh-beta-4.3.11-dev-1+20110504/Completion/openSUSE/Command/_zypper 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/openSUSE/Command/_zypper 2011-10-02 01:10:11.000000000 +0000 @@ -4,7 +4,7 @@ # # This file is released under the GPLv2. # -# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html +# Based on the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html # # Toggle verbose completions: zstyle ':completion:*:zypper:*' verbose no # zstyle ':completion:*:zypper-subcommand:*' verbose no diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Redhat/Command/_rpm zsh-beta-4.3.12-dev-1+20110925/Completion/Redhat/Command/_rpm --- zsh-beta-4.3.11-dev-1+20110504/Completion/Redhat/Command/_rpm 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Redhat/Command/_rpm 2011-10-02 01:10:11.000000000 +0000 @@ -55,7 +55,7 @@ '--httpport:http port number' {-\?,--help}'[print help information]' '--version[print version number]' - '--pipe:pipe command:->command' \ + '--pipe:pipe command:->command' ) # package selection options of which only one can be used diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_adb zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_adb --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_adb 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_adb 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,541 @@ +#compdef adb -value-,ADB_TRACE,-default- -value-,ANDROID_SERIAL,-default- -value-,ANDROID_LOG_TAGS,-default- + +local ADB_DEVICE_SPECIFICATION LOG_REDIRECT + +_adb() { + # rely on localoptions + setopt nonomatch + + ADB_DEVICE_SPECIFICATION="" + + if [[ $1 = -l ]]; then + # Run to load _adb and associated functions but do + # nothing else. + return + fi + + if [[ $service = -value-* ]]; then + #_message compstate=$compstate[parameter] + case $compstate[parameter] in + (ADB_TRACE) + _adb_trace_opts + ;; + + (ANDROID_SERIAL) + _adb_device_serial + ADB_DEVICE_SPECIFICATION="-s ${ANDROID_SERIAL}" + ;; + + (ANDROID_LOG_TAGS) + _adb_logcat_filter_specification + ;; + + esac + # We do not handle values anywhere else. + return + fi + + local -a ALL_ADB_COMMANDS + ALL_ADB_COMMANDS=( + "connect" + "disconnect" + "shell" + "wait-for-device" + "push" + "pull" + "logcat" + "jdwp" + "bugreport" + "version" + "forward" + "install" + "uninstall" + "help" + "start-server" + "kill-server" + "devices" + "get-state" + "get-serialno" + "status-window" + "remount" + "reboot" + "reboot-bootloader" + "root" + "usb" + "tcpip" + "ppp" + ) + + (( $+functions[_adb_device_specification] )) && _adb_device_specification + + adb ${=ADB_DEVICE_SPECIFICATION} shell exit 2>/dev/null || { + # early bail-out until a single valid device/emulator is specified and up-and-running + _message -r "No (started) device specified, completions do not yet work" + _arguments \ + '(-d -e )-s[serial]: :_adb_device_serial' \ + '( -e -s)-d[device]' \ + '(-d -s)-e[emulator]' \ + '*:"options":_adb_options_handler' + + return; + } + + (( $+functions[_adb_check_log_redirect] )) && _adb_check_log_redirect + + (( $+functions[_adb_dispatch_command] )) && _adb_dispatch_command +} + +(( $+functions[_adb_dispatch_command] )) || +_adb_dispatch_command () { + local curcontext="${curcontext}" + local integer last_command_pos=-1 + + (( $+functions[_adb_sanitize_context] )) && _adb_sanitize_context + if [[ ${last_command_pos} -gt 0 ]] + then + shift ${last_command_pos}-1 words + CURRENT=$(( ${CURRENT} - ${last_command_pos} + 1 )) + fi + + case ${curcontext} in + (*:adb:shell) + (( $+functions[_adb_dispatch_shell] )) && _adb_dispatch_shell + ;; + (*:adb:connect|*:adb:disconnect) + (( $+functions[_adb_dispatch_connection_handling] )) && _adb_dispatch_connection_handling + ;; + (*:adb:logcat) + (( $+functions[_adb_dispatch_logcat] )) && _adb_dispatch_logcat + ;; + (*:adb:push) + (( $+functions[_adb_dispatch_push] )) && _adb_dispatch_push + ;; + (*:adb:pull) + (( $+functions[_adb_dispatch_pull] )) && _adb_dispatch_pull + ;; + (*:adb:install) + (( $+functions[_adb_dispatch_install] )) && _adb_dispatch_install + ;; + (*:adb:uninstall) + (( $+functions[_adb_dispatch_uninstall] )) && _adb_dispatch_uninstall + ;; + (*) + _arguments \ + '(-d -e)-s["serial"]: :_adb_device_serial' \ + '(-s -e)-d["device"]' \ + '(-d -s)-e["emulator"]' \ + '*:"options":_adb_options_handler' + ;; + esac +} + +(( $+functions[_adb_sanitize_context] )) || +_adb_sanitize_context () { + local -a mywords + for adbcommand in "${ALL_ADB_COMMANDS[@]}" + do + if [[ -n "${adbcommand}" ]] && [[ ${words[(I)${adbcommand}]} -gt 0 ]] + then + last_command_pos=${words[(I)${adbcommand}]} + mywords[${last_command_pos}]=${adbcommand} + fi + done + ##expand unquoted to remove sparse elements + mywords=( ${mywords[@]} ) + curcontext="${curcontext}${mywords[-1]}" +} + +(( $+functions[_adb_device_specification] )) || +_adb_device_specification () { + local integer i=1 + foreach word ($words) + do + i=$(( ++i )) + case ${words[$i]} in + (-d|-e) + ADB_DEVICE_SPECIFICATION="${words[$i]}" + break + ;; + (-s) + ADB_DEVICE_SPECIFICATION="-s ${words[$i + 1]}" + break + ;; + (-*) + continue + ;; + (*) + break + ;; + esac + done +} + +(( $+functions[_adb_dispatch_shell] )) || +_adb_dispatch_shell () { + if [[ ${#words} -le 2 ]] + then + (( $+functions[_adb_shell_commands_handler] )) && _adb_shell_commands_handler + return + fi + + case ${words[2]} in + (am) + (( $+functions[_adb_activity_manager_handler] )) && _adb_activity_manager_handler + ;; + (pm) + (( $+functions[_adb_package_manager_handler] )) && _adb_package_manager_handler + ;; + (*) + _arguments '*:adb_remote_folder:_adb_remote_folder' + ;; + esac +} + +(( $+functions[_adb_pm_list] )) || +_adb_pm_list () { + case ${words[4]} in + (packages) + _arguments -s '-f[see their associated file]' \ + ':' + ;; + (permissions) + _arguments -s '-g[organize by group]' \ + '-f[print all information]' \ + '-d[only list dangerous pemissions]' \ + '-u[only list user visible permissions]' \ + '-s[short summary]' \ + ':' + ;; + (permission-groups) + ;; + (instrumentation) + _arguments -s '-f[see their associated file]' \ + ':' + ;; + (features) + ;; + (*) + _wanted pm_list_argument expl 'pm list argument' compadd packages permission-groups permissions instrumentation features + ;; + esac +} + +(( $+functions[_adb_intent_handler] )) || +_adb_intent_handler () { + _message -r " specifications include these flags: + [-a ] [-d ] [-t ] + [-c [-c ] ...] + [-e|--es ...] + [--esn ...] + [--ez ...] + [-e|--ei ...] + [-n ] [-f ] + [--grant-read-uri-permission] [--grant-write-uri-permission] + [--debug-log-resolution] + [--activity-brought-to-front] [--activity-clear-top] + [--activity-clear-when-task-reset] [--activity-exclude-from-recents] + [--activity-launched-from-history] [--activity-multiple-task] + [--activity-no-animation] [--activity-no-history] + [--activity-no-user-action] [--activity-previous-is-top] + [--activity-reorder-to-front] [--activity-reset-task-if-needed] + [--activity-single-top] + [--receiver-registered-only] [--receiver-replace-pending] + []" +} + +(( $+functions[_adb_activity_manager_handler] )) || +_adb_activity_manager_handler () { + if [[ ${#words} -le 3 ]] + then + _wanted am_argument expl 'am argument' compadd start startservice broadcast instrument profile + return + fi + case ${words[3]} in + (start) + _arguments -s '-D[enable debugging]' \ + '-W[wait for launch to complete]' \ + '*:intent:_adb_intent_handler' + ;; + (startservice) + _arguments -s '*:intent:_adb_intent_handler' + ;; + (broadcast) + _arguments -s '*:intent:_adb_intent_handler' + ;; + (instrument) + _arguments -s '-r[print raw results]' \ + '-e[set argument NAME to VALUE]: :' \ + '-p[write profiling data to FILE]::' \ + '-w[wait for instrumenation to finish]' \ + ':' + ;; + (profile) + _message -r " start/stop " + ;; + esac +} + +(( $+functions[_adb_package_manager_handler] )) || +_adb_package_manager_handler () { + case ${words[3]} in + (list) + (( $+functions[_adb_pm_list] )) && _adb_pm_list + ;; + (path) + (( $+functions[_adb_installed_packages] )) && _adb_installed_packages + ;; + (enable) + (( $+functions[_adb_installed_packages] )) && _adb_installed_packages + ;; + (disable) + (( $+functions[_adb_installed_packages] )) && _adb_installed_packages + ;; + (setInstallLocation) + _wanted set_installlcation expl 'install location' compadd -d "(0:auto 1:internal 2:external)" 0 1 2 + ;; + (getInstallLocation) + ;; + (*) + _wanted pm_argument expl 'pm argument' compadd list path install unistall enable disable setInstallLocation getInstallLocation + ;; + esac +} + +(( $+functions[_adb_dispatch_uninstall] )) || +_adb_dispatch_uninstall () { + argcount=${#${(M)words#-*}} + if [[ $CURRENT -gt (( argcount + 2 )) ]] + then + _message -r "Notice: you can only uninstall one package at a time" + return + fi + + _arguments \ + '-k["keep data and cache"]' \ + '*:"installed package":_adb_installed_packages' +} + +(( $+functions[_adb_dispatch_install] )) || +_adb_dispatch_install () { + argcount=${#${(M)words#-*}} + if [[ $CURRENT -gt (( argcount + 2 )) ]] + then + _message -r "Notice: you can only install one package at a time" + return + fi + + _arguments \ + '-l["forward lock"]' \ + '-r["reinstall"]' \ + '-s["install on sd"]' \ + '*:"select apk file":_path_files -g "*(/)|*.apk"' +} + +(( $+functions[_adb_dispatch_push] )) || +_adb_dispatch_push () { + if [[ ${#words} -gt 3 ]] + then + _message -r "Notice: you can only push a single item at a time" + return + fi + if [[ ${#words} -gt 2 ]] + then + _arguments '*:adb_remote_folder:_adb_remote_folder' + else + _arguments '*:"local file/folder":_files' + fi +} + +(( $+functions[_adb_dispatch_pull] )) || +_adb_dispatch_pull () { + if [[ ${#words} -gt 3 ]] + then + _message -r "Notice: you can only pull a single item at a time" + return + fi + if [[ ${#words} -gt 2 ]] + then + _arguments '*:"local file/folder":_files' + else + _arguments '*:adb_remote_folder:_adb_remote_folder' + fi +} + +(( $+functions[_adb_dispatch_connection_handling] )) || +_adb_dispatch_connection_handling () { + if compset -P '*:' + then + local expl + _wanted ports expl port compadd "$@" 5555 + else + _hosts -qS: + fi +} + +(( $+functions[adb_check_log_redirect] )) || +_adb_check_log_redirect () { + LOG_REDIRECT=${$(adb ${=ADB_DEVICE_SPECIFICATION} shell getprop log.redirect-stdio)// +/} + [[ ${LOG_REDIRECT[1,4]} == "true" ]] && _message -r "Notice: stdio log redirection enabled on the device, so some completions will not work" +} + +(( $+functions[_adb_trace_opts] )) || +_adb_trace_opts() { + _values -s , 'adb trace options' \ + '(1 adb sockets packets rwx usb sync sysdeps transport jdwp)all' \ + '(all adb sockets packets rwx usb sync sysdeps transport jdwp)1' \ + 'adb' \ + 'sockets' \ + 'packets' \ + 'rwx' \ + 'usb' \ + 'sync' \ + 'sysdeps' \ + 'transport' \ + 'jdwp' +} + +(( $+functions[_adb_device_serial] )) || +_adb_device_serial() { + local expl + _wanted dev_serial expl 'available devices' compadd $(command adb devices | sed -n 's/^\([^[:space:]]*\)\t.*$/\1/p') +} + +(( $+functions[_adb_logcat_filter_specification] )) || +_adb_logcat_filter_specification() { + zstyle ":completion:${curcontext}:" cache-policy _adb_cache_policy_single_command + + local cacheid=logcat_filter_cache_${$(adb ${=ADB_DEVICE_SPECIFICATION} get-serialno)} + typeset -a logcat_filter_tags + if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" + then + logcat_filter_tags=( $(command adb ${=ADB_DEVICE_SPECIFICATION} logcat -d | sed -n 's#^[VDIWEF]/\([^[:space:](]*\).*#\1#p' |sort | uniq) ) + _store_cache "$cacheid" logcat_filter_tags + fi + local expl + if compset -P '*:' + then + _wanted filter expl filter compadd W S E I D V \* + else + _wanted filtertags expl filtertags compadd -qS: ${logcat_filter_tags[@]} \* + fi +} + +(( $+functions[_adb_dispatch_logcat] )) || +_adb_dispatch_logcat() { + _arguments \ + '(-c -g)-s[set default filter to silent]' \ + '(-c -g)-f[log output to file (defaults to stdout)]:logfile:_files' \ + '(-c -g -d)-r[rotate log every kbytes (default 16, requires -f)]:logsize:_guard "[0-9]#" "numeric value"' \ + '(-c -g -d)-n[max number of rotated logs (default 4)]:number :_guard "[0-9]#" "numeric value"' \ + '(-c -g -d)-v[log format]:format: _values "format" brief process tag thread raw time threadtime long' \ + '(-d -t -g)-c[clear log]' \ + '(-c -g)-d[dump log]' \ + '(-c -g)-t[print only recent lines (implies -d)]:linecount:_guard "[0-9]#" "numeric value"' \ + '(-c -g)-B[output log in binary]' \ + '(-c -g)*:filtering:_adb_logcat_filter_specification' +} + +(( $+functions[_adb_options_handler] )) || +_adb_options_handler() { + local expl + _wanted adb_options expl 'adb options' compadd "${ALL_ADB_COMMANDS[@]}" +} + +(( $+functions[_adb_shell_commands_handler] )) || +_adb_shell_commands_handler() { + local expl + _wanted adb_shell_commands expl 'adb shell commands' compadd ls pm am mkdir rmdir rm cat +} + +(( $+functions[_adb_any_device_available] )) || +_adb_any_device_available() { + _any_device_available=${#$(adb devices | sed -n 's/^\([^[:space:]]*\)\t.*$/\1/p')} +} + +(( $+functions[_adb_device_available] )) || +_adb_device_available() { + [[ $(adb ${=ADB_DEVICE_SPECIFICATION} get-state 2>&1) == "device" ]] && return 0 + return 1 +} + +(( $+functions[_adb_full_folder_scan] )) || +_adb_full_folder_scan() { + local -a rv; + rv=( ${$(adb ${=ADB_DEVICE_SPECIFICATION} shell 'for i in $(ls -d /*) + do + case $i in + /proc|/sys|/acct) + ;; + *) + ls -R $i + ;; + esac + done' )//'$\r'/} ) + for line in ${rv[@]}; + do + [[ ${line[1]} == '/' ]] && folder="${line%:}" && adb_device_folders+=$folder && continue; + adb_device_folders+=$folder/$line; + done +} + +(( $+functions[_adb_remote_folder] )) || +_adb_remote_folder () { + local expl + zstyle -s ":completion:${curcontext}:" cache-policy update_policy + if [[ -z "$update_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy _adb_cache_policy_daily + fi + local cacheid=package_cache_${$(adb ${=ADB_DEVICE_SPECIFICATION} get-serialno)} + typeset -a filesystem_content + if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" + then + local -a adb_device_folders + _adb_full_folder_scan + # remove any duplicates and the initial slash => should still remove bare folders from it when it has children + filesystem_content=( ${(u)adb_device_folders#/} ) + _store_cache "$cacheid" filesystem_content + fi + _adb_device_available && \ + _wanted adb_remote_folder expl 'file/folder on device' _multi_parts $@ -i / filesystem_content +} + +(( $+functions[_adb_installed_packages] )) || +_adb_installed_packages() { + zstyle -s ":completion:${curcontext}:" cache-policy update_policy + if [[ -z "$update_policy" ]]; then + zstyle ":completion:${curcontext}:" cache-policy _adb_cache_policy_single_command + fi + + local cacheid=package_cache_${$(adb ${=ADB_DEVICE_SPECIFICATION} get-serialno)} + typeset -a installed_packages + if _cache_invalid "$cacheid" || ! _retrieve_cache "$cacheid" + then + installed_packages=(${$( adb ${=ADB_DEVICE_SPECIFICATION} shell pm list packages )//#package:/}) + _store_cache "$cacheid" installed_packages + fi + + _wanted adb_installed_packages expl 'packages that are installed' compadd ${installed_packages} +} + +(( $+functions[_adb_cache_policy_single_command] )) || +_adb_cache_policy_single_command () { + typeset -a old + + # cache is valid for 1 minute + old=( "$1"(mm+1) ) + (( $#old )) +} + +(( $+functions[_adb_cache_policy_daily] )) || +_adb_cache_policy_daily () { + typeset -a old + + # cache is valid for a day + old=( "$1"(mh+12) ) + (( $#old )) +} + + + +_adb $@ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_at zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_at --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_at 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_at 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,39 @@ +#compdef atrm atq at batch + +local context state line expl +typeset -A opt_args + +#todo (when extremely bored) make -l and -d do the atq and atrm completions +case $service in +atrm) + _arguments \ + '-V[print version number]' \ + '*:job number:->jobs' + ;; +atq) + _arguments \ + '-V[print version number]' \ + '-q[uses specified queue]:a-z+A-Z' + ;; +at|batch) + _arguments \ + - new-job \ + '-V[print version number]' \ + '-q[uses specified queue, uppercase acts as batch]:a-z+A-Z' \ + '-f[read job from file rather than from stdin]:file:_files' \ + '-v[show the time the job will be executed]' \ + '-m[send mail even if there was no output]' \ + ':time:' \ + - atq \ + '-l[alias for atq]' \ + - atrm \ + '-d[alias for atrm]' \ + - show-job \ + '-c[cat specified jobs to stdout]:*:job number:->jobs' +esac + +case $state in +jobs) + _wanted job expl 'job number' compadd ${(M)${(f)"$(_call_program job atq)"}##<->} + ;; +esac diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_bzr zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_bzr --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_bzr 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_bzr 2011-10-02 01:10:11.000000000 +0000 @@ -259,7 +259,7 @@ ) ;; -(diff|dif|di) +(diff|dif|di|cdiff) args+=( '(-r --revision)'{--revision=,-r}'[revision]:revision:' '--diff-options=[options to pass to gdiff]:diff options:' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/.distfiles zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/.distfiles --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/.distfiles 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/.distfiles 2011-10-02 01:10:11.000000000 +0000 @@ -2,12 +2,14 @@ .distfiles _a2ps _aap +_adb _ant _antiword _apachectl _apm _arp _arping +_at _attr _awk _baz @@ -77,6 +79,7 @@ _gnu_generic _gnupod _gnutls +_go _gpg _gphoto2 _gprof @@ -94,6 +97,7 @@ _iftop _imagemagick _init_d +_initctl _ip _irssi _ispell @@ -107,6 +111,7 @@ _ldd _less _links +_ln _loadkeys _locate _look @@ -137,6 +142,7 @@ _netcat _nice _nmap +_notmuch _npm _nslookup _osc @@ -203,6 +209,7 @@ _sudo _surfraw _sysctl +_systemctl _tar _tardy _tcpdump @@ -220,6 +227,8 @@ _topgit _totd _tracepath +_tree +_twidge _twisted _unace _uname diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_git zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_git --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_git 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_git 2011-10-02 01:10:11.000000000 +0000 @@ -2,7 +2,7 @@ # Some parts of this completion's behaviour are configurable: # -# Say, you got your own git sub-commands (git will run a program `git-foo' +# Say you got your own git sub-commands (git will run a program `git-foo' # when you run "git foo") and you want "git f" to complete that sub # commands name for you. You can make that sub-command know to the completion # via the user-command style: @@ -15,8 +15,31 @@ # # % zstyle ':completion:*:*:git:*' user-commands ${${(M)${(k)commands}:#git-*}/git-/} # -# You could even create a function _git-foo() to handle specific completion -# for that command. +# A better solution is to create a function _git-foo() to handle specific +# completion for that command. This also allows you to add command-specific +# completion as well. Place such a function inside an autoloaded #compdef file +# and you should be all set. You can add a description to such a function by +# adding a line matching +# +# #description DESCRIPTION +# +# as the second line in the file. See +# Completion/Debian/Command/_git-buildpackage in the Zsh sources for an +# example. +# +# As this solution is so much better than the user-commands zstyle method, the +# zstyle method is now DEPRECATED. It will most likely be removed in the next +# major release of Zsh (5.0). +# +# When _git does not know a given sub-command (say `bar'), it falls back to +# completing file names for all arguments to that sub command. I.e.: +# +# % git bar +# +# ...will complete file names. If you do *not* want that fallback to be used, +# use the `use-fallback' style like this: +# +# % zstyle ':completion:*:*:git*:*' use-fallback false # TODO: There is still undocumented configurability in here. @@ -26,7 +49,7 @@ (( $+functions[_git-add] )) || _git-add () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args local ignore_missing= @@ -47,24 +70,25 @@ '--refresh[do not add files, but refresh their stat() info in index]' \ '--ignore-errors[continue adding if an error occurs]' \ $ignore_missing \ - '*:: :->file' && ret=0 + '*:: :->file' && return case $state in (file) - # TODO: Use __git_ignore_line_inside_arguments. declare -a ignored_files_alternatives - if [[ -n ${line[(I)-f|--force]} ]]; then + if [[ -n ${opt_args[(I)-f|--force]} ]]; then ignored_files_alternatives=( - 'ignored-modified-files:ignored modified files:__git_modified_files --ignored' - 'ignored-other-files:ignored other files:__git_other_files --ignored') + 'ignored-modified-files:ignored modified files:__git_ignore_line_inside_arguments __git_modified_files --ignored' + 'ignored-other-files:ignored other files:__git_ignore_line_inside_arguments __git_other_files --ignored') fi _alternative \ - 'modified-files::__git_modified_files' \ - 'other-files::__git_other_files' \ + 'modified-files::__git_ignore_line_inside_arguments __git_modified_files' \ + 'other-files::__git_ignore_line_inside_arguments __git_other_files' \ $ignored_files_alternatives && ret=0 ;; esac + + return ret } (( $+functions[_git-am] )) || @@ -72,11 +96,10 @@ local -a apply_options __git_setup_apply_options - # NOTE: --resolvemsg is only for internal use between git rebase and git am. + # NOTE: --rebasing and --resolvemsg are only for internal use between git + # rebase and git am. # TODO: --patch-format is undocumented. - # TODO: --ignore-date is incorrectly documented as being passed to git - # mailsplit. - # TODO: --rebasing, --rerere-autoupdate, and --no-rerere-autoupdate are + # TODO: --rerere-autoupdate and --no-rerere-autoupdate are # undocumented (and not implemented here). _arguments -S \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by: line to the commit message]' \ @@ -99,12 +122,12 @@ '--patch-format=-[specify format patches are in]:patch format:((mbox\:"mbox format" stgit-series\:"StGit patch series" stgit\:"stgit format"))' \ - '*:mbox file:_files' && ret=0 + '*:mbox file:_files' } (( $+functions[_git-archive] )) || _git-archive () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args declare -a backend_args @@ -131,7 +154,7 @@ '--format=-[format of the resulting archive]:archive format:__git_archive_formats' \ '(- :)'{-l,--list}'[list available archive formats]' \ '(-v --verbose)'{-v,--verbose}'[report progress to stderr]' \ - '--prefix=-[prepend the given path prefix to to each filename]:path prefix:_directories -r ""' \ + '--prefix=-[prepend the given path prefix to each filename]:path prefix:_directories -r ""' \ '--output=[write archive to argument instead of stdout]:archive:_files' \ '--worktree-attributes[look for attributes in .gitattributes in working directory too]' \ $backend_args \ @@ -145,6 +168,8 @@ __git_tree_files ${PREFIX:-.} $line[1] && ret=0 ;; esac + + return ret } (( $+functions[_git-applymbox] )) || @@ -156,14 +181,14 @@ '-u[encode commit information in UTF-8]' \ '(1)-c[restart command after fixing an unclean patch]:patch:_files -g ".dotest/0*"' \ ':mbox file:_files' \ - '::signoff file:__git_signoff_file' && ret=0 + '::signoff file:__git_signoff_file' } (( $+functions[_git-bisect] )) || _git-bisect () { # TODO: next subcommand is undocumented. Git-bisect.sh mentions that the # subcommand might be removed from the UI level. - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -246,6 +271,8 @@ esac ;; esac + + return ret } (( $+functions[_git-branch] )) || @@ -258,16 +285,22 @@ d='-d -D' declare -a dependent_creation_args - dependent_creation_args=( - "($l $m $d): :__git_branch_names" - "::start-point:__git_revisions") + if (( words[(I)-r] == 0 )); then + dependent_creation_args=( + "($l $m $d): :__git_branch_names" + "::start-point:__git_revisions") + fi declare -a dependent_deletion_args if (( words[(I)-d] || words[(I)-D] )); then dependent_creation_args= dependent_deletion_args=( - '-r[delete remote-tracking branches]' - '*: :__git_ignore_line_inside_arguments __git_branch_names') + '-r[delete only remote-tracking branches]') + if (( words[(I)-r] )); then + dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_remote_branch_names' + else + dependent_deletion_args+='*: :__git_ignore_line_inside_arguments __git_branch_names' + fi fi declare -a dependent_modification_args @@ -281,7 +314,7 @@ _arguments -w -S -s \ "($c $m $d --no-color :)--color=-[turn on branch coloring]:: :__git_color_whens" \ "($c $m $d : --color)--no-color[turn off branch coloring]" \ - "($c $m $d : -a)-r[list only the remote-tracking branches]" \ + "($c $m -a)-r[list or delete only remote-tracking branches]" \ "($c $m $d : -r)-a[list both remote-tracking branches and local branches]" \ "($c $m $d : -v --verbose)"{-v,--verbose}'[show SHA1 and commit subject line for each head]' \ "($c $m $d :)--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length" \ @@ -300,12 +333,12 @@ $dependent_modification_args \ "($l $c $m -D)-d[delete a fully merged branch]" \ "($l $c $m -d)-D[delete a branch]" \ - $dependent_deletion_args && ret=0 + $dependent_deletion_args } (( $+functions[_git-bundle] )) || _git-bundle () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -353,6 +386,8 @@ esac ;; esac + + return ret } (( $+functions[_git-checkout] )) || @@ -365,7 +400,7 @@ new_branch_reflog_opt="(--patch)-l[create the new branch's reflog]" fi - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -s \ @@ -414,7 +449,7 @@ $tree_ish_arg \ $file_arg && ret=0 elif [[ -n ${opt_args[(I)-b|-B|-t|--track|--orphan]} ]]; then - _nothing && ret=0 + _nothing elif [[ -n $line[1] ]] && __git_is_treeish $line[1]; then __git_ignore_line __git_tree_files ${PREFIX:-.} $line[1] && ret=0 else @@ -422,6 +457,8 @@ fi ;; esac + + return ret } (( $+functions[_git-cherry-pick] )) || @@ -433,7 +470,7 @@ '(-n --no-commit --ff)'{-n,--no-commit}'[do not make the actually commit]' \ '(-s --signoff --ff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ '(-e --edit -x -n --no-commit -s --signoff)--ff[fast forward, if possible]' \ - ': :__git_revisions' && ret=0 + ': :__git_revisions' } (( $+functions[_git-citool] )) || @@ -443,7 +480,7 @@ (( $+functions[_git-clean] )) || _git-clean () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s \ @@ -493,11 +530,13 @@ $other_files_alt && ret=0 ;; esac + + return ret } (( $+functions[_git-clone] )) || _git-clone () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args # TODO: Argument to -o should be a remote name. @@ -532,6 +571,8 @@ fi ;; esac + + return ret } (( $+functions[_git-commit] )) || @@ -583,13 +624,13 @@ {-F,--file=}'[read commit message from given file]: :_files' \ {-m,--message=}'[use the given message as the commit message]:message' \ {-t,--template=}'[use file as a template commit message]:template:_files' \ - $amend_opt && ret=0 + $amend_opt } (( $+functions[_git-describe] )) || _git-describe () { _arguments -w -S -s \ - '(*)--dirty=-[describe HEAD, adding mark if dirty]::mark' + '(*)--dirty=-[describe HEAD, adding mark if dirty]::mark' \ '--all[use any ref found in "$GIT_DIR/refs/"]' \ '--tags[use any ref found in "$GIT_DIR/refs/tags"]' \ '(--tags)--contains[find the tag after the commit instead of before]' \ @@ -600,12 +641,12 @@ '(--abbrev)--long[always show full format, even for exact matches]' \ '--match=[only consider tags matching glob pattern]:pattern' \ '--always[show uniquely abbreviated commit object as fallback]' \ - '*: :__git_committishs' && ret=0 + '*: :__git_committishs' } (( $+functions[_git-diff] )) || _git-diff () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args local -a diff_options @@ -623,7 +664,11 @@ case $CURRENT in (1) if [[ -n ${opt_args[(I)--]} ]]; then - __git_changed-in-working-tree_files && ret=0 + if [[ -n ${opt_args[(I)--cached|--staged]} ]]; then + __git_changed-in-index_files && ret=0 + else + __git_changed-in-working-tree_files && ret=0 + fi else local files_alt='files::__git_changed-in-working-tree_files' @@ -679,11 +724,13 @@ esac ;; esac + + return ret } (( $+functions[_git-fetch] )) || _git-fetch () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args local -a fetch_options @@ -707,11 +754,13 @@ fi ;; esac + + return ret } (( $+functions[_git-format-patch] )) || _git-format-patch () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args local -a diff_options @@ -760,6 +809,8 @@ fi ;; esac + + return ret } (( $+functions[_git-gc] )) || @@ -769,7 +820,7 @@ '--auto[check whether housekeeping is required]' \ '( --no-prune)--prune=[prune loose objects older than given date]: :__git_datetimes' \ '(--prune )--no-prune[do not prune any loose objects]' \ - '--quiet[suppress all progress reports]' && ret=0 + '--quiet[suppress all progress reports]' } (( $+functions[_git-grep] )) || @@ -784,7 +835,7 @@ '--not[the following pattern must not match]') fi - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args # TODO: Need to implement - as a shorthand for -C @@ -861,17 +912,19 @@ fi ;; esac + + return ret } (( $+functions[_git-gui] )) || _git-gui () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ '--version[display version information]' \ ': :->command' \ - '*:: :->arg' + '*:: :->arg' && ret=0 case $state in (command) @@ -890,7 +943,7 @@ case $line[1] in (blame) - _git-blame + _git-blame && ret=0 ;; (browser) _arguments -C \ @@ -904,7 +957,7 @@ esac ;; (citool) - _git-citool + _git-citool && ret=0 ;; (version) _nothing @@ -915,6 +968,8 @@ esac ;; esac + + return ret } (( $+functions[_git-init] )) || @@ -924,21 +979,23 @@ '--bare[create a bare repository]' \ '--template=[directory to use as a template for the object database]: :_directories' \ '--shared=[share repository amongst several users]:: :__git_repository_permissions' \ - ':: :_directories' && ret=0 + ':: :_directories' } (( $+functions[_git-log] )) || _git-log () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args - local -a log_options revision_options + local -a log_options revision_options diff_options __git_setup_log_options __git_setup_revision_options + __git_setup_diff_options _arguments -w -C -s \ $log_options \ $revision_options \ + $diff_options \ '(-)--[start file arguments]' \ '*:: :->commit-range-or-file' && ret=0 @@ -968,6 +1025,8 @@ ;; esac esac + + return ret } (( $+functions[_git-merge] )) || @@ -980,12 +1039,12 @@ '-m[set the commit message to be used for the merge commit]:merge message' \ '( --no-rerere-autoupdate)--rerere-autoupdate[allow the rerere mechanism to update the index]' \ '(--rerere-autoupdate )--no-rerere-autoupdate[do not allow the rerere mechanism to update the index]' \ - '*: :__git_commits' && ret=0 + '*: :__git_commits' } (( $+functions[_git-mv] )) || _git-mv () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s \ @@ -1002,11 +1061,13 @@ 'directories:destination directory:_directories' && ret=0 ;; esac + + return ret } (( $+functions[_git-notes] )) || _git-notes () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -1072,6 +1133,8 @@ esac ;; esac + + return ret } (( $+functions[_git-pull] )) || @@ -1086,7 +1149,7 @@ '(--rebase )--no-rebase[do not perform a rebase after fetching]' \ $fetch_options \ ': :__git_any_repositories' \ - '*: :__git_ref_specs' && ret=0 + '*: :__git_ref_specs' } (( $+functions[_git-push] )) || @@ -1112,7 +1175,7 @@ '(-q --quiet -v --verbose)'{-v,--verbose}'[output additional information]' \ '(-q --quiet)--progress[output progress information]' \ ':: :__git_any_repositories' \ - '*: :__git_ref_specs' && ret=0 + '*: :__git_ref_specs' } (( $+functions[_git-rebase] )) || @@ -1147,12 +1210,12 @@ '--no-ff[cherry-pick all rebased commits with --interactive, otherwise synonymous to --force-rebase]' \ '--onto[start new branch with HEAD equal to given revision]:newbase:__git_revisions' \ ':upstream branch:__git_revisions' \ - '::working branch:__git_branch_names' && ret=0 + '::working branch:__git_branch_names' } (( $+functions[_git-reset] )) || _git-reset () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 typeset -A opt_args _arguments -w -C -s \ @@ -1176,6 +1239,8 @@ __git_tree_files ${PREFIX:-.} $commit && ret=0 ;; esac + + return ret } (( $+functions[_git-revert] )) || @@ -1186,12 +1251,12 @@ '(-e --edit)--no-edit[do not edit the commit message]' \ '(-n --no-commit)'{-n,--no-commit}'[do not commit the reversion]' \ '(-s --signoff)'{-s,--signoff}'[add Signed-off-by line at the end of the commit message]' \ - ': :__git_commits' && ret=0 + ': :__git_commits' } (( $+functions[_git-rm] )) || _git-rm () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s \ @@ -1212,11 +1277,13 @@ fi ;; esac + + return ret } (( $+functions[_git-shortlog] )) || _git-shortlog () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args local -a revision_options @@ -1248,11 +1315,13 @@ fi ;; esac + + return ret } (( $+functions[_git-show] )) || _git-show () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 typeset -A opt_args local -a log_options revision_options @@ -1273,11 +1342,13 @@ 'blobs::__git_blobs' && ret=0 ;; esac + + return ret } (( $+functions[_git-stash] )) || _git-stash () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -1358,6 +1429,8 @@ esac ;; esac + + return ret } (( $+functions[_git-status] )) || @@ -1377,12 +1450,12 @@ all\:"also show untracked files in untracked directories (default)"))' \ '--ignore-submodules[ignore changes to submodules]:: :__git_ignore_submodules_whens' \ '(--porcelain)-z[use NUL termination on output]' \ - '*: :__git_ignore_line_inside_arguments _files' && ret=0 + '*: :__git_ignore_line_inside_arguments _files' } (( $+functions[_git-submodule] )) || _git-submodule () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C -A '-*' \ @@ -1483,6 +1556,8 @@ esac ;; esac + + return ret } (( $+functions[_git-tag] )) || @@ -1509,12 +1584,22 @@ '*:: :__git_ignore_line_inside_arguments __git_tags' \ - listing \ '-n+[limit line output of annotation]: :__git_guard_number "limit"' \ - '-l[list tags matching pattern]:pattern' \ + '-l[list tags matching pattern]' \ '--contains=[only list tags which contain the specified commit]: :__git_commits' \ + '::pattern' \ - verification \ '-v[verifies gpg signutare of tags]' \ - '*:: :__git_ignore_line_inside_arguments __git_tags' \ - && ret=0 + '*:: :__git_ignore_line_inside_arguments __git_tags' +} + +(( $+functions[_gitk] )) || +_gitk () { + _git-log +} + +(( $+functions[_tig] )) || +_tig () { + _git-log } # Ancillary Commands (Manipulators) @@ -1522,7 +1607,7 @@ (( $+functions[_git-config] )) || _git-config () { local name_arg value_arg - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args if (( words[(I)--get-regexp] )); then @@ -1945,7 +2030,7 @@ case $state in (section) - __git_config_sections -b '(|)' '^' section-names 'section name' $* + __git_config_sections -b '(|)' '^' section-names 'section name' $* && ret=0 ;; (is-a-tty) declare -a values @@ -1953,7 +2038,7 @@ true false auto) - _describe -t values 'stdout is a tty' values + _describe -t values 'stdout is a tty' values && ret=0 ;; (option) local label=option @@ -2044,7 +2129,7 @@ __git_mergetools -S . && ret=0 ;; (pager.) - __git_aliases_and_commands && ret=0 + _git_commands && ret=0 ;; (pretty.) __git_config_sections -a '(|)' '^pretty\..+\.[^.]+$' prettys 'pretty format string' && ret=0 @@ -2135,7 +2220,7 @@ ;; (gettable-option) _describe -t git-options option \ - ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:} + ${${${(0)"$(_call_program gettable-options git config -z --list)"}%%$'\n'*}//:/\\:} && ret=0 ;; (gettable-colorbool-option) __git_config_sections -b '(|)' -a '(|)' '^color\.[^.]+$' gettable-colorbool-options option && ret=0 @@ -2168,7 +2253,7 @@ # TODO: Should really only complete unique remotes, that is, not the same # remote more than once in the list. __git_remotes -S $suffix -q && ret=0 - return + return ret ;; esac local z=$'\0' @@ -2177,7 +2262,7 @@ if (( $#parts < 2 )) && [[ $line[1] == [^.]##.*.[^.]## ]]; then parts=("${(S@0)${git_options_static[(r)(#i)${line[1]%%.*}.\*.${line[1]##*.}:*]}//(#b)(*[^\\]|):/$match[1]$z}") fi - (( $#parts > 0 )) || return + (( $#parts > 0 )) || return ret case $parts[4] in ('->'*) case ${parts[4]#->} in @@ -2443,6 +2528,8 @@ esac ;; esac + + return ret } (( $+functions[_git-fast-export] )) || @@ -2464,7 +2551,7 @@ '--fake-missing-tagger=[fake a tagger when tags lack them]' \ '--no-data[do not output blocb objects, instead referring to them via their SHA-1 hash]' \ '--full-tree[output full tree for each commit]' \ - '*: :__git_commit_ranges' && ret=0 + '*: :__git_commit_ranges' } (( $+functions[_git-fast-import] )) || @@ -2484,7 +2571,7 @@ '*--no-relative-marks[paths for export/import are not relative to internal directory in current repository]' \ '--export-pack-edges=-[list packfiles and last commit on branches in them in given file]: :_files' \ '--quiet[disable all non-fatal output]' \ - '--stats[display statistics about object created]' && ret=0 + '--stats[display statistics about object created]' } (( $+functions[_git-filter-branch] )) || @@ -2506,7 +2593,7 @@ '--original[namespace where original commits will be stored]:namespace:_directories' \ '-d[temporary directory used for rewriting]: :_directories' \ '(-f --force)'{-f,--force}'[force operation]' \ - '*: :__git_commit_ranges' && ret=0 + '*: :__git_commit_ranges' } (( $+functions[_git-mergetool] )) || @@ -2516,7 +2603,7 @@ '(-t --tool)'{-t,--tool=}'[merge resolution program to use]: :__git_mergetools' \ '(-y --no-prompt --prompt)'{-y,--no-prompt}'[do not prompt before invocation of merge resolution program]' \ '(-y --no-prompt)--prompt[prompt before invocation of merge resolution program]' \ - '*:conflicted file:_files' && ret=0 + '*:conflicted file:_files' } (( $+functions[_git-pack-refs] )) || @@ -2525,7 +2612,7 @@ '( --no-all)--all[pack all refs]' \ '(--all )--no-all[do not pack all refs]' \ '( --no-prune)--prune[remove loose refs after packing them]' \ - '(--prune )--no-prune[do not remove loose refs after packing them]' && ret=0 + '(--prune )--no-prune[do not remove loose refs after packing them]' } (( $+functions[_git-prune] )) || @@ -2534,7 +2621,7 @@ '(-n --dry-run)'{-n,--dry-run}'[do not remove anything; just report what would be removed]' \ '(-v --verbose)'{-v,--rerbose}'[report all removed objects]' \ '--expire[only expire loose objects older than given date]: :__git_datetimes' \ - '*:: :__git_heads' && ret=0 + '*:: :__git_heads' } (( $+functions[_git-reflog] )) || @@ -2545,9 +2632,9 @@ if [[ $words[2] == --* ]]; then _arguments -S \ $revision_options \ - ':: :__git_references' && ret=0 + ':: :__git_references' else - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args # TODO: -h is undocumented. @@ -2606,6 +2693,8 @@ ;; esac esac + + return ret fi } @@ -2617,12 +2706,12 @@ '--help[display help]' \ ': :_directories' \ ': :_directories' \ - '*: :_directories' && ret=0 + '*: :_directories' } (( $+functions[_git-remote] )) || _git-remote () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -2715,6 +2804,8 @@ esac ;; esac + + return ret } (( $+functions[_git-repack] )) || @@ -2732,7 +2823,7 @@ '--window=-[number of objects to consider when doing delta compression]: :__git_guard_number "number of objects"' \ '--depth=-[maximum delta depth]: :__git_guard_number "maximum delta depth"' \ '--window-memory=-[scale window size dynamically to not use more than N bytes of memory]: :__git_guard_bytes' \ - '--max-pack-size=-[maximum size of each output packfile]:maximum pack size:__git_guard_bytes' && ret=0 + '--max-pack-size=-[maximum size of each output packfile]:maximum pack size:__git_guard_bytes' } (( $+functions[_git-replace] )) || @@ -2743,14 +2834,14 @@ '(- : *)-l[list replace refs]:pattern' \ ': :__git_objects' \ ':replacement:__git_objects' \ - '*: :__git_objects' && ret=0 + '*: :__git_objects' } # Ancillary Commands (Interrogators) (( $+functions[_git-blame] )) || _git-blame () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args declare -a revision_options @@ -2794,6 +2885,8 @@ fi ;; esac + + return ret } (( $+functions[_git-cherry] )) || @@ -2804,13 +2897,13 @@ '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ ':upstream commit:__git_commits' \ '::head commit:__git_commits' \ - '::limit commit:__git_commits' && ret=0 + '::limit commit:__git_commits' } (( $+functions[_git-count-objects] )) || _git-count-objects () { _arguments \ - '(-v --verbose)'{-v,--verbose}'[also report number of in-pack objects and objects that can be removed]' && ret=0 + '(-v --verbose)'{-v,--verbose}'[also report number of in-pack objects and objects that can be removed]' } (( $+functions[_git-difftool] )) || @@ -2837,7 +2930,7 @@ '--strict[do strict checking]' \ '(-v --verbose)'{-v,--verbose}'[output additional information]' \ '--lost-found[write dangling objects into .git/lost-found]' \ - '*: :__git_objects' && ret=0 + '*: :__git_objects' } (( $+functions[_git-get-tar-commit-id] )) || @@ -2852,12 +2945,12 @@ '(-a --all -m --man -w --web)'{-i,--info}'[show all available commands]' \ '(-a --all -i --info -w --web)'{-m,--man}'[show all available commands]' \ '(-a --all -i --info -m --man )'{-w,--web}'[show all available commands]' \ - ': :__git_aliases_and_commands' && ret=0 + ': :_git_commands' } (( $+functions[_git-instaweb] )) || _git-instaweb () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s \ @@ -2883,6 +2976,8 @@ _describe -t commands command commands && ret=0 ;; esac + + return ret } (( $+functions[_git-merge-tree] )) || @@ -2890,12 +2985,12 @@ _arguments \ ':base-tree:__git_tree_ishs' \ ':branch 1:__git_tree_ishs' \ - ':branch 2:__git_tree_ishs' && ret=0 + ':branch 2:__git_tree_ishs' } (( $+functions[_git-rerere] )) || _git-rerere () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args # TODO: --rerere-autoupdate is undocumented. @@ -2914,6 +3009,8 @@ 'gc[prune old records of conflicted merges]' && ret=0 ;; esac + + return ret } (( $+functions[_git-rev-parse] )) || @@ -2931,13 +3028,15 @@ quiet_opts=({-q,--quiet}'[do not output error messages]') fi + local ret=0 + if (( words[(I)--parseopt] )); then if (( words[(I)--] )); then _message 'argument' else # TODO: Parse option specification? _arguments -w -S -s \ - '(- *)'{-h,--help}'[display usage]' + '(- *)'{-h,--help}'[display usage]' \ '--keep-dashdash[do not skip first -- option]' \ '--stop-at-non-option[stop parsing options at first non-option argument]' \ '*:option specification' && ret=0 @@ -2981,11 +3080,13 @@ '(--until --before)'{--until=-,--before=-}'[show --min-age= parameter corresponding given date string]:datestring' \ '*: :__git_objects' && ret=0 fi + + return ret } (( $+functions[_git-show-branch] )) || _git-show-branch () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s -A '-*' \ @@ -3021,6 +3122,8 @@ fi ;; esac + + return ret } (( $+functions[_git-verify-tag] )) || @@ -3028,7 +3131,7 @@ # TODO: -v and --verbose are undocumented. _arguments -w -S -s \ '(-v --verbose)'{-v,--verbose}'[output additional information]' \ - '*: :__git_tags' && ret=0 + '*: :__git_tags' } (( $+functions[_git-whatchanged] )) || @@ -3039,7 +3142,7 @@ _arguments -S \ $revision_options \ '1:: :__git_commits' \ - '*: :__git_cached_files' && ret=0 + '*: :__git_cached_files' } # Interacting With Others @@ -3057,7 +3160,7 @@ '-D[attempt to import trees that have been merged from]: :__git_guard_number depth' \ '-a[auto-register archives at http://mirrors.sourcecontrol.net]' \ '-t[use given directory as temporary directory]: :_directories' \ - '*:archive/branch' && ret=0 + '*:archive/branch' } (( $+functions[_git-cvsexportcommit] )) || @@ -3078,7 +3181,7 @@ '-v[verbose output]' \ '-h[display usage]' \ ':: :__git_commits' \ - ': :__git_commits' && ret=0 + ': :__git_commits' } (( $+functions[_git-cvsimport] )) || @@ -3105,7 +3208,7 @@ '-A[specify author-conversion file]:author-conversion file:_files' \ '-R[generate cvs-revisions file mapping CVS revision numbers to commit IDs]' \ '-h[display usage information]' \ - ':cvsmodule' && ret=0 + ':cvsmodule' } (( $+functions[_git-cvsserver] )) || @@ -3117,7 +3220,7 @@ '(- * -V --version)'{-V,--version}'[display version information]' \ '(- * -h --help)'{-h,-H,--help}'[display usage information]' \ '::type:(pserver server)' \ - '*: :_directories' && ret=0 + '*: :_directories' } (( $+functions[_git-imap-send] )) || @@ -3130,7 +3233,7 @@ _arguments -S \ '(-n --dry-run)'{-n,--dry-run}'[check patches and warn if they cannot be imported]' \ '--author[default author name and email address to use for patches]: :_email_addresses' \ - '--patches[set directory containing patches]:patch directory:_directories' && ret=0 + '--patches[set directory containing patches]:patch directory:_directories' } (( $+functions[_git-request-pull] )) || @@ -3180,12 +3283,12 @@ '( --no-validate)--validate[perform sanity checks on patches]' \ '(--validate )--validate[do not perform sanity checks on patches]' \ '--force[send emails even if safetiy checks would prevent it]' \ - '*: :_files' && ret=0 + '*: :_files' } (( $+functions[_git-svn] )) || _git-svn () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -3428,6 +3531,8 @@ esac ;; esac + + return ret } # LOW-LEVEL COMMANDS (PLUMBING) @@ -3458,7 +3563,7 @@ '--inaccurate-eof[work around missing-new-line-at-EOF bugs]' \ '(-v --verbose)'{-v,--verbose}'[display progress on stderr]' \ '--recount[do not trust line counts in hunk headers]' \ - '*:patch:_files' && ret=0 + '*:patch:_files' } (( $+functions[_git-checkout-index] )) || @@ -3480,7 +3585,7 @@ '--temp[write content to temporary files]' \ '(-a --all *)--stdin[read list of paths from the standard input]' \ $z_opt \ - '*: :__git_cached_files' && ret=0 + '*: :__git_cached_files' } (( $+functions[_git-commit-tree] )) || @@ -3488,11 +3593,11 @@ if (( CURRENT == 2 )); then _arguments \ '-h[display usage]' \ - ': :__git_trees' && ret=0 + ': :__git_trees' elif [[ $words[CURRENT-1] == -p ]]; then local expl _description commits expl 'parent commit' - __git_objects $expl && ret=0 + __git_objects $expl else compadd - '-p' fi @@ -3510,7 +3615,7 @@ '(: --stdin --path)--stdin-paths[read file names from standard input instead of from command line]' \ '( --no-filters)--path=[hash object as if it were located at given path]: :_files' \ '(--path )--no-filters[hash contents as is, ignoring any input filters]' \ - '(--stdin --stdin-paths):file:_files' && ret=0 + '(--stdin --stdin-paths):file:_files' } (( $+functions[_git-index-pack] )) || @@ -3531,7 +3636,7 @@ '--stdin[read pack from stdin and instead write to specified file]' \ $stdin_opts \ '--strict[die if the pack contains broken objects or links]' \ - ':pack file:_files -g "*.pack"' && ret=0 + ':pack file:_files -g "*.pack"' } (( $+functions[_git-merge-file] )) || @@ -3560,7 +3665,7 @@ '--diff3[undocumented]' \ ':current file:_files' \ ':base file:_files' \ - ':other file:_files' && ret=0 + ':other file:_files' } (( $+functions[_git-merge-index] )) || @@ -3568,7 +3673,7 @@ if (( CURRENT > 2 )) && [[ $words[CURRENT-1] != -[oq] ]]; then _arguments -S \ '(:)-a[run merge against all files in index that need merging]' \ - '*: :__git_cached_files' && ret=0 + '*: :__git_cached_files' else declare -a arguments @@ -3576,7 +3681,7 @@ (( CURRENT == 2 || CURRENT == 3 )) && arguments+='(-o)-q[do not complain about failed merges]' (( 2 <= CURRENT && CURRENT <= 4 )) && arguments+='*:merge program:_files -g "*(*)"' - _arguments -S $arguments && ret=0 + _arguments -S $arguments fi } @@ -3590,7 +3695,7 @@ _arguments -w -S -s \ '-z[read NUL-terminated ls-tree -z output]' \ '--missing[allow missing objects]' \ - '--batch[allow creation of more than one tree]' && ret=0 + '--batch[allow creation of more than one tree]' } (( $+functions[_git-pack-objects] )) || @@ -3632,14 +3737,14 @@ '--keep-true-parents[pack parents hidden by grafts]' \ '( --unpack-unreachable)--keep-unreachable[undocumented]' \ '(--keep-unreachable )--unpack-unreachable[undocumented]' \ - ':base-name:_files' && ret=0 + ':base-name:_files' } (( $+functions[_git-prune-packed] )) || _git-prune-packed () { _arguments -w -S -s \ '(-n --dry-run)'{-n,--dry-run}'[only list objects that would be removed]' \ - '(-q --quiet)'{-q,--quiet}'[do not display progress on standard error]' && ret=0 + '(-q --quiet)'{-q,--quiet}'[do not display progress on standard error]' } (( $+functions[_git-read-tree] )) || @@ -3678,7 +3783,7 @@ '--no-sparse-checkout[display sparse checkout support]' \ '1:first tree-ish to be read/merged:__git_tree_ishs' \ '2::second tree-ish to be read/merged:__git_tree_ishs' \ - '3::third tree-ish to be read/merged:__git_tree_ishs' && ret=0 + '3::third tree-ish to be read/merged:__git_tree_ishs' } (( $+functions[_git-symbolic-ref] )) || @@ -3687,7 +3792,7 @@ '(-q --quiet)'{-q,--quiet}'[do not issue error if specified name is not a symbolic ref]' \ '-m[update reflog for specified name with specied reason]:reason for update' \ ':symbolic reference:__git_heads' \ - ':: :__git_references' && ret=0 + ':: :__git_references' } (( $+functions[_git-unpack-objects] )) || @@ -3696,7 +3801,7 @@ '-n[only list the objects that would be unpacked]' \ '-q[run quietly]' \ '-r[try recovering objects from corrupt packs]' \ - '--strict[do not write objects with broken content or links]' && ret=0 + '--strict[do not write objects with broken content or links]' } (( $+functions[_git-update-index] )) || @@ -3734,7 +3839,7 @@ '(: -)--stdin[read list of paths from standard input]' \ '--verbose[report what is being added and removed from the index]' \ $z_opt \ - '*:: :_files' && ret=0 + '*:: :_files' } (( $+functions[_git-update-ref] )) || @@ -3745,7 +3850,7 @@ '--no-deref[overwrite ref itself, not what it points to]' \ ':symbolic reference:__git_revisions' \ ':new reference:__git_revisions' \ - '::old reference:__git_revisions' && ret=0 + '::old reference:__git_revisions' } (( $+functions[_git-write-tree] )) || @@ -3753,7 +3858,7 @@ # NOTE: --ignore-cache-tree is only used for debugging. _arguments -w -S -s \ '--missing-ok[ignore objects in index that are missing in object database]' \ - '--prefix=[write tree representing given sub-directory]:sub-directory:_directories -r ""' && ret=0 + '--prefix=[write tree representing given sub-directory]:sub-directory:_directories -r ""' } # Interrogation commands @@ -3769,7 +3874,7 @@ '(- :)--batch[print SHA1, type, size, and contents of each object provided on stdin]' \ '(- :)--batch-check[print SHA1, type, and size of each object provided on stdin]' \ '(-):object type:(blob commit tag tree)' \ - ': :__git_objects' && ret=0 + ': :__git_objects' } (( $+functions[_git-diff-files] )) || @@ -3781,7 +3886,7 @@ $revision_options \ ': :__git_changed-in-working-tree_files' \ ': :__git_changed-in-working-tree_files' \ - '*: :__git_changed-in-working-tree_files' && ret=0 + '*: :__git_changed-in-working-tree_files' } (( $+functions[_git-diff-index] )) || @@ -3798,12 +3903,12 @@ '--cached[do not consider the work tree at all]' \ '-m[flag non-checked-out files as up-to-date]' \ ': :__git_tree_ishs' \ - '*: :__git_cached_files' && ret=0 + '*: :__git_cached_files' } (( $+functions[_git-diff-tree] )) || _git-diff-tree () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args declare -a revision_options @@ -3848,6 +3953,8 @@ fi ;; esac + + return ret } (( $+functions[_git-for-each-ref] )) || @@ -3863,7 +3970,7 @@ '(-s --shell -p --perl --python --tcl)'{-p,--perl}'[use string literals suitable for Perl]' \ '(-s --shell -p --perl --tcl)'--python'[use string literals suitable for Python]' \ '(-s --shell -p --perl --python )'--tcl'[use string literals suitable for Tcl]' \ - ':: :_guard "([^-]?#|)" pattern' && ret=0 + ':: :_guard "([^-]?#|)" pattern' } (( $+functions[_git-ls-files] )) || @@ -3898,7 +4005,7 @@ '-v[identify each files status (hmrck?)]' \ '--full-name[force paths to be output relative to the project top directory]' \ '--abbrev=[set minimum SHA1 display-length]: :__git_guard_number length' \ - '*:: :_files' && ret=0 + '*:: :_files' } (( $+functions[_git-ls-remote] )) || @@ -3909,12 +4016,12 @@ '(-t --tags)'{-t,--tags}'[show only refs under refs/tags]' \ '(-u --upload-pack)'{-u,--upload-pack=-}'[specify path to git-upload-pack on remote side]:remote path' \ ': :__git_any_repositories' \ - '*: :__git_references' && ret=0 + '*: :__git_references' } (( $+functions[_git-ls-tree] )) || _git-ls-tree () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -w -C -S -s \ @@ -3935,6 +4042,8 @@ __git_ignore_line __git_tree_files ${PREFIX:-.} $line[1] && ret=0 ;; esac + + return ret } (( $+functions[_git-merge-base] )) || @@ -3944,7 +4053,7 @@ '--octopus[compute best common ancestors of all supplied commits]' \ '(-)--independent[display minimal subset of supplied commits with same ancestors]' \ ': :__git_commits' \ - '*: :__git_commits' && ret=0 + '*: :__git_commits' } (( $+functions[_git-name-rev] )) || @@ -3954,10 +4063,10 @@ '--refs=[only use refs matching given pattern]: :_guard "?#" "shell pattern"' \ '(--stdin :)--all[list all commits reachable from all refs]' \ '(--all :)--stdin[read from stdin and append revision-name]' \ - '--name-only[display only name of commits]' + '--name-only[display only name of commits]' \ '--no-undefined[die with non-zero return when a reference is undefined]' \ '--always[show uniquely abbreviated commit object as fallback]' \ - '(--stdin --all)*: :__git_commits' && ret=0 + '(--stdin --all)*: :__git_commits' } (( $+functions[_git-pack-redundant] )) || @@ -3966,12 +4075,12 @@ '(:)--all[process all packs]' \ '--alt-odb[do not require objects to be present in local packs]' \ '--verbose[output some statistics to standard error]' \ - '(--all)*::packs:_files -g "*.pack"' && ret=0 + '(--all)*::packs:_files -g "*.pack"' } (( $+functions[_git-rev-list] )) || _git-rev-list () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args declare -a revision_options @@ -3998,6 +4107,8 @@ fi ;; esac + + return ret } (( $+functions[_git-show-index] )) || @@ -4019,14 +4130,14 @@ '(-q --quiet)'{-q,--quiet}'[do not print any results]' \ '*: :_guard "([^-]?#|)" pattern' \ - exclude \ - '--exclude-existing=-[filter out existing refs from stdin]:: :_guard "([^-]?#|)" pattern' && ret=0 + '--exclude-existing=-[filter out existing refs from stdin]:: :_guard "([^-]?#|)" pattern' } (( $+functions[_git-unpack-file] )) || _git-unpack-file () { _arguments -A '-*' \ '(:)-h[display usage information]' \ - '(-): :__git_blobs' && ret=0 + '(-): :__git_blobs' } (( $+functions[_git-var] )) || @@ -4036,7 +4147,7 @@ '(-):variable:((GIT_AUTHOR_IDENT\:"name and email of author" \ GIT_COMMITTER_IDENT\:"name and email of committer" \ GIT_EDITOR\:"text editor used by git commands" \ - GIT_PAGER\:"text viewer used by git commands"))' && ret=0 + GIT_PAGER\:"text viewer used by git commands"))' } (( $+functions[_git-verify-pack] )) || @@ -4044,7 +4155,7 @@ _arguments -w -S -s \ '(-v --verbose)'{-v,--verbose}'[show objects contained in pack]' \ '(-s --stat-only)'{-s,--stat-only}'[do not verify pack contents; only display histogram of delta chain length]' \ - '*:index file:_files -g "*.idx"' && ret=0 + '*:index file:_files -g "*.idx"' } # Synching Repositories @@ -4078,7 +4189,7 @@ '--disable=-[disable site-wide service]: :__git_daemon_service' \ '--allow-override[allow overriding site-wide service]: :__git_daemon_service' \ '--forbid-override[forbid overriding site-wide service]: :__git_daemon_service' \ - '*:repository:_directories' && ret=0 + '*:repository:_directories' } (( $+functions[_git-fetch-pack] )) || @@ -4095,7 +4206,7 @@ '--no-progress[do not display progress]' \ '-v[produce verbose output]' \ ': :__git_any_repositories' \ - '*: :__git_references' && ret=0 + '*: :__git_references' } (( $+functions[_git-http-backend] )) || @@ -4119,13 +4230,13 @@ '--stateless-rpc[undocumented]' \ '--helper-status[undocumented]' \ ': :__git_any_repositories' \ - '*: :__git_remote_references' && ret=0 + '*: :__git_remote_references' } (( $+functions[_git-update-server-info] )) || _git-update-server-info () { _arguments -w -S -s \ - '(-f --force)'{-f,--force}'[update the info files from scratch]' && ret=0 + '(-f --force)'{-f,--force}'[update the info files from scratch]' } (( $+functions[_git-http-fetch] )) || @@ -4139,7 +4250,7 @@ '--recover[recover from a failed fetch]' \ '(1)--stdin[read commit ids and refs from standard input]' \ ': :__git_commits' \ - ': :_urls' && ret=0 + ': :_urls' } (( $+functions[_git-http-push] )) || @@ -4152,7 +4263,7 @@ '( -D)-d[remove refs from remote repository]' \ '(-d )-D[forcefully remove refs from remote repository]' \ ': :_urls' \ - '*: :__git_remote_references' && ret=0 + '*: :__git_remote_references' } # NOTE: git-parse-remote isn’t a user command. @@ -4164,12 +4275,12 @@ _arguments -A '-*' \ '--advertise-refs[undocumented]' \ '--stateless-rpc[undocumented]' \ - ':directory to sync into:_directories' && ret=0 + ':directory to sync into:_directories' } (( $+functions[_git-shell] )) || _git-shell () { - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args _arguments -C \ @@ -4207,13 +4318,15 @@ esac ;; esac + + return ret } (( $+functions[_git-upload-archive] )) || _git-upload-archive () { _arguments \ - ':directory to get tar archive from:_directories' && ret=0 + ':directory to get tar archive from:_directories' } (( $+functions[_git-upload-pack] )) || @@ -4225,7 +4338,7 @@ '--timeout=-[interrupt transfer after given number of seconds of inactivity]: :__git_guard_number "inactivity timeout"' \ '--advertise-refs[undocumented]' \ '--stateless-rpc[undocumented]' \ - ': :_directories' && ret=0 + ': :_directories' } # Internal Helper Commands @@ -4234,7 +4347,7 @@ _git-check-attr () { local z_opt= - local curcontext=$curcontext state line + local curcontext=$curcontext state line ret=1 declare -A opt_args if (( words[(I)--stdin] )); then @@ -4270,6 +4383,8 @@ fi ;; esac + + return ret } (( $+functions[_git-check-ref-format] )) || @@ -4278,7 +4393,7 @@ '-h[display usage information]' \ '--print[display canonicalized name of hypothetical reference of given name]' \ '--branch[expand previous branch syntax]' \ - ': :__git_references' && ret=0 + ': :__git_references' } (( $+functions[_git-fmt-merge-msg] )) || @@ -4287,7 +4402,7 @@ '( --no-log)--log[display one-line descriptions from actual commits being merged]' \ '(--log )--no-log[do not display one-line descriptions from actual commits being merged]' \ '(-m --message)'{-m+,--message=}'[use given message instead of branch names for first line in log message]:message' \ - '(-F --file)'{-F,--file}'[specify list of merged objects from file]: :_files' && ret=0 + '(-F --file)'{-F,--file}'[specify list of merged objects from file]: :_files' } (( $+functions[_git-mailinfo] )) || @@ -4302,7 +4417,7 @@ '(--scissors )--no-scissors[do not remove everything in body before a scissors line]' \ '--no-inbody-headers[undocumented]' \ ':message file:_files' \ - ':patch file:_files' && ret=0 + ':patch file:_files' } (( $+functions[_git-mailsplit] )) || @@ -4313,7 +4428,7 @@ '-d-[specify number of leading zeros]: :__git_guard_number precision' \ '-f-[skip the first N numbers]: :__git_guard_number' \ '--keep-cr[do not remove CR from lines ending with CR+LF]' \ - '*::mbox file:_files' && ret=0 + '*::mbox file:_files' } (( $+functions[_git-merge-one-file] )) || @@ -4331,7 +4446,7 @@ (( $+functions[_git-stripspace] )) || _git-stripspace () { _arguments \ - '(-s --strip-comments)'{-s,--strip-comments}'[also strip lines starting with #]' && ret=0 + '(-s --strip-comments)'{-s,--strip-comments}'[also strip lines starting with #]' } # INTERNAL GIT COMPLETION FUNCTIONS @@ -4422,7 +4537,11 @@ (( $+functions[__git_ignore_line_inside_arguments] )) || __git_ignore_line_inside_arguments () { - __git_ignore_line ${*[-1]} ${*[1,-2]} + declare -a compadd_opts + + zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F: + + __git_ignore_line $* $compadd_opts } # Common Argument Types @@ -4581,10 +4700,41 @@ patch-id:'compute unique ID for a patch' stripspace:'filter out empty lines') + local -a user_commands + zstyle -a :completion:$curcontext: user-commands user_commands + + local -a third_party_commands + local command + for command in $_git_third_party_commands; do + (( $+commands[git-${command%%:*}] )) && third_party_commands+=$command + done + + local -a aliases unique_aliases + __git_extract_aliases + local alias + for alias in $aliases; do + local name=${alias%%:*} + (( main_porcelain_commands[(I)$name:*] || + user_commands[(I)$name:*] || + third_party_commands[(I)$name:*] || + ancillary_manipulator_commands[(I)$name:*] || + ancillary_interrogator_commands[(I)$name:*] || + interaction_commands[(I)$name:*] || + plumbing_manipulator_commands[(I)$name:*] || + plumbing_interrogator_commands[(I)$name:*] || + plumbing_sync_commands[(I)$name:*] || + plumbing_sync_helper_commands[(I)$name:*] || + plumbing_internal_helper_commands[(I)$name:*] )) || unique_aliases+=$alias + done + integer ret=1 - # TODO: Is this the correct way of doing it? - # TODO: Should we be chaining them together with || instead? + + # TODO: Is this the correct way of doing it? Should we be using _alternative + # and separate functions for each set of commands instead? + _describe -t aliases alias unique_aliases && ret=0 _describe -t main-porcelain-commands 'main porcelain command' main_porcelain_commands && ret=0 + _describe -t user-commands 'user command' user_commands && ret=0 + _describe -t third-party-commands 'third-party command' third_party_commands && ret=0 _describe -t ancillary-manipulator-commands 'ancillary manipulator command' ancillary_manipulator_commands && ret=0 _describe -t ancillary-interrogator-commands 'ancillary interrogator command' ancillary_interrogator_commands && ret=0 _describe -t interaction-commands 'interaction command' interaction_commands && ret=0 @@ -4593,24 +4743,23 @@ _describe -t plumbing-sync-commands 'plumbing sync command' plumbing_sync_commands && ret=0 _describe -t plumbing-sync-helper-commands 'plumbing sync helper command' plumbing_sync_helper_commands && ret=0 _describe -t plumbing-internal-helper-commands 'plumbing internal helper command' plumbing_internal_helper_commands && ret=0 + return ret } (( $+functions[__git_aliases] )) || __git_aliases () { - declare -a aliases - - aliases=(${^${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.}/$'\n'/:alias for \'}\') + local -a aliases + __git_extract_aliases _describe -t aliases alias aliases $* } -(( $+functions[__git_aliases_and_commands] )) || -__git_aliases_and_commands () { - _alternative \ - 'aliases::__git_aliases' \ - 'commands::_git_commands' +(( $+functions[__git_extract_aliases] )) || +__git_extract_aliases () { + aliases=(${^${${(0)"$(_call_program aliases "git config -z --get-regexp '^alias.'")"}#alias.}/$'\n'/:alias for \'}\') } + (( $+functions[__git_date_formats] )) || __git_date_formats () { declare -a date_formats @@ -4641,7 +4790,7 @@ local -a merge_strategies merge_strategies=(${=${${(M)${(f)"$(_call_program merge-strategies "git merge -s '' 2>&1")"}:#[Aa]vailable (custom )#strategies are: *}#[Aa]vailable (custom )#strategies are: }%.}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted merge-strategies expl 'merge strategy' compadd $* - $merge_strategies } @@ -4805,7 +4954,7 @@ declare -a reflog_entries reflog_entries=(${${${(f)"$(_call_program reflog-entries git reflog 2>/dev/null)"}#* }%%:*}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 if compset -P '*@'; then reflog_entries=(${${(M)reflog_entries:#$IPREFIX*}#$IPREFIX}) @@ -4866,7 +5015,7 @@ declare -a stashes stashes=(${${(f)"$(_call_program stashes git stash list 2>/dev/null)"}/: */}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted stashes expl stash compadd $* - $stashes } @@ -4905,7 +5054,7 @@ declare -a branch_names branch_names=(${${(f)"$(_call_program branchrefs git for-each-ref --format='"%(refname)"' refs/heads 2>/dev/null)"}#refs/heads/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted branch-names expl branch-name compadd $* - $branch_names } @@ -4915,8 +5064,8 @@ local expl declare -a branch_names - branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='%(refname)' refs/remotes 2>/dev/null)"}#refs/remotes/}) - __git_command_successful $pipestatus || return + branch_names=(${${(f)"$(_call_program remote-branch-refs git for-each-ref --format='"%(refname)"' refs/remotes 2>/dev/null)"}#refs/remotes/}) + __git_command_successful $pipestatus || return 1 _wanted remote-branch-names expl 'remote branch name' compadd $* - $branch_names } @@ -5036,7 +5185,7 @@ declare -a submodules submodules=(${${(f)"$(_call_program submodules git submodule 2>/dev/null)"}#* }) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted submodules expl submodule compadd $* - $submodules } @@ -5049,7 +5198,7 @@ declare -a tags tags=(${${(f)"$(_call_program tagrefs git for-each-ref --format='"%(refname)"' refs/tags 2>/dev/null)"}#refs/tags/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted tags expl tag compadd $* - $tags } @@ -5072,15 +5221,11 @@ type=$1; shift tags=(${${(M)${(f)"$(_call_program $type-tag-refs "git for-each-ref --format='%(*objecttype)%(objecttype) %(refname)' refs/tags 2>/dev/null")"}:#$type(tag|) *}#$type(tag|) refs/tags/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted $type-tags expl "$type tag" compadd $* - $tags } -(( $+functions[__git_tag_ids] )) || -__git_tag_ids () { -} - # Reference Argument Types (( $+functions[__git_references] )) || @@ -5097,7 +5242,7 @@ # TODO: deal with GIT_DIR if [[ $_git_refs_cache_pwd != $PWD ]]; then _git_refs_cache=(${${${(f)"$(_call_program references git ls-remote ./. 2>/dev/null)"}#*$'\t'}#refs/(heads|tags)/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _git_refs_cache_pwd=$PWD fi @@ -5110,7 +5255,7 @@ if [[ $_git_local_refs_cache_pwd != $PWD ]]; then _git_local_refs_cache=(${${${(f)"$(_call_program references git ls-remote ./. 2>/dev/null)"}#*$'\t'}#refs/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _git_local_refs_cache_pwd=$PWD fi @@ -5127,7 +5272,7 @@ local references expl references=(${${(M)${${(f)"$(_call_program references git ls-remote ./. 2>/dev/null)"}#*$'\t'}:#refs/notes/*}#refs/notes/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted references expl reference compadd - $references } @@ -5137,54 +5282,41 @@ declare -a notes_refs notes_refs=(${${(f)"$(_call_program notes-refs git for-each-ref --format='"%(refname)"' refs/notes 2>/dev/null)"}#$type refs/notes/}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 - _wanted notes-refs expl "notes ref" compadd $* - $notes_refs + _wanted notes-refs expl 'notes ref' compadd $* - $notes_refs } # File Argument Types (( $+functions[__git_files_relative] )) || __git_files_relative () { - local rawfiles files file f_parts prefix p_parts tmp + local files file f_parts prefix p_parts tmp prefix=$(_call_program gitprefix git rev-parse --show-prefix 2>/dev/null) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 - # Empty prefix, no modifications if (( $#prefix == 0 )); then print $1 return fi - rawfiles=(${(0)1}) files=() - # Now we assume that we've given "absolute" paths list with "root" - # being repository top directory. $prefix is also "absolute" path. - for file in $rawfiles; do - # Collapse "/./" and "//", strip "/." and "/" from tail (I know, - # this is a bit paranoid). - f_parts=(${(s:/:)"${${${${file//\/\///}//\/.\///}%%/.}%%/}"}) - p_parts=(${(s:/:)"${${${${prefix//\/\///}//\/.\///}%%/.}%%/}"}) - tmp=() - - # Strip common path prefix. - while (( $#f_parts > 0 )) && (( $#p_parts > 0 )) && [[ $f_parts[1] == $p_parts[1] ]]; do - f_parts[1]=() - p_parts[1]=() - done - - # If prefix still not empty, ascend up. - while (( $#p_parts > 0 )); do - tmp+=.. - p_parts[1]=() + # Collapse “//” and “/./” into “/”. Strip any remaining “/.” and “/”. + for file in ${${${${${(0)1}//\/\///}//\/.\///}%/.}%/}; do + integer i n + (( n = $#file > $#prefix ? $#file : $#prefix )) + for (( i = 1; i <= n; i++ )); do + if [[ $file[i] != $prefix[i] ]]; then + while (( i > 0 )) && [[ $file[i-1] != / ]]; do + (( i-- )) + done + break + fi done - # Add remaining path. - tmp+=($f_parts) - - files+=${(j:/:)tmp} + files+=${(l@${#prefix[i,-1]//[^\/]}*3@@../@)}${file[i,-1]} done print ${(pj:\0:)files} @@ -5192,27 +5324,26 @@ (( $+functions[__git_files] )) || __git_files () { - local compadd_opts opts tag description gitdir gitcdup files expl + local compadd_opts opts tag description gitcdup gitprefix files expl zparseopts -D -E -a compadd_opts V: J: 1 2 n f X: M: P: S: r: R: q F: zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed x+: --exclude+: tag=$1 description=$2; shift 2 - gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null) - __git_command_successful $pipestatus || return - gitcdup=$(_call_program gitcdup git rev-parse --show-cdup 2>/dev/null) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 - opts+='--exclude-per-directory=.gitignore' - [[ -f "$gitdir/info/exclude" ]] && opts+="--exclude-from=$gitdir/info/exclude" + gitprefix=$(_call_program gitprefix git rev-parse --show-prefix 2>/dev/null) + __git_command_successful $pipestatus || return 1 - files=$(_call_program files git ls-files -z --full-name $opts -- $gitcdup 2>/dev/null) - __git_command_successful $pipestatus || return - files=(${(0)"$(__git_files_relative $files)"}) + # TODO: --directory should probably be added to $opts when --others is given. + + local pref=$gitcdup$gitprefix$PREFIX + files=(${(0)"$(_call_program files git ls-files -z --exclude-standard $opts -- ${pref:+$pref\*} 2>/dev/null)"}) __git_command_successful $pipestatus || return - _wanted $tag expl $description _multi_parts $compadd_opts - / files +# _wanted $tag expl $description _files -g '{'${(j:,:)files}'}' $compadd_opts - + _wanted $tag expl $description _multi_parts -f $compadd_opts - / files } (( $+functions[__git_cached_files] )) || @@ -5260,9 +5391,9 @@ local files expl files=$(_call_program files git diff-index -z --name-only --no-color --cached HEAD 2>/dev/null) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 files=(${(0)"$(__git_files_relative $files)"}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted changed-in-index-files expl 'changed in index file' _multi_parts $@ - / files } @@ -5272,9 +5403,9 @@ local files expl files=$(_call_program changed-in-working-tree-files git diff -z --name-only --no-color 2>/dev/null) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 files=(${(0)"$(__git_files_relative $files)"}) - __git_command_successful $pipestatus || return + __git_command_successful $pipestatus || return 1 _wanted changed-in-working-tree-files expl 'changed in working tree file' _multi_parts $@ -f - / files } @@ -5415,7 +5546,7 @@ __git_guard_diff-stat-width () { if [[ $PREFIX == *,* ]]; then compset -P '*,' - __git_guard_number "filename width" + __git_guard_number 'filename width' else compset -S ',*' __git_guard_number width @@ -5424,7 +5555,11 @@ (( $+functions[__git_guard_number] )) || __git_guard_number () { - _guard "[[:digit:]]#" ${1:-number} + declare -A opts + + zparseopts -K -D -A opts M: J: V: 1 2 n F: X: + + _guard '[[:digit:]]#' ${1:-number} } (( $+functions[__git_guard_bytes] )) || @@ -5435,17 +5570,17 @@ (( $+functions[__git_datetimes] )) || __git_datetimes () { # TODO: Use this in more places. - _guard "*" 'time specification' + _guard '*' 'time specification' } (( $+functions[__git_stages] )) || __git_stages () { - __git_guard $* "[[:digit:]]#" 'stage' + __git_guard $* '[[:digit:]]#' 'stage' } (( $+functions[__git_svn_revision_numbers] )) || __git_svn_revision_numbers () { - __git_guard_number "revision number" + __git_guard_number 'revision number' } # _arguments Helpers @@ -5961,16 +6096,6 @@ _describe -t attributes attribute attributes $* } -(( $+functions[_gitk] )) || -_gitk () { - _git-log -} - -(( $+functions[_tig] )) || -_tig () { - _git-log -} - # Now, for the main driver… _git() { if (( CURRENT > 2 )); then @@ -5980,7 +6105,7 @@ aliases=(${(f)${${${(f)"$(_call_program aliases git config --get-regexp '\^alias\.')"}#alias.}/ /$'\n'}/(#e)/$'\n'}) (( $#aliases % 2 == 0 )) && git_aliases=($aliases) - if [[ -n ${git_aliases[$words[2]]} ]] ; then + if (( $+git_aliases[$words[2]] && !$+commands[git-$words[2]] )); then local -a tmpwords expalias expalias=(${(z)git_aliases[$words[2]]}) tmpwords=(${words[1]} ${expalias}) @@ -5996,7 +6121,8 @@ unset git_aliases aliases fi - local ret=1 + integer ret=1 + if [[ $service == git ]]; then local curcontext=$curcontext state line declare -A opt_args @@ -6017,20 +6143,54 @@ '--no-replace-objects[do not use replacement refs to replace git objects]' \ '(-): :->command' \ '(-)*:: :->option-or-argument' && return + case $state in (command) - __git_aliases_and_commands && ret=0 + _git_commands && ret=0 ;; (option-or-argument) curcontext=${curcontext%:*:*}:git-$words[1]: - _call_function ret _git-$words[1] + if (( $+functions[_git-$words[1]] )); then + _call_function ret _git-$words[1] + elif zstyle -T :completion:$curcontext: use-fallback; then + _files && ret=0 + else + _message 'unknown sub-command' + fi ;; esac else _call_function ret _$service fi + return ret } +# Load any _git-* definitions so that they may be completed as commands. +declare -gUa _git_third_party_commands +_git_third_party_commands=() + +local file +for file in ${^fpath}/_git-*~(*~|*.zwc)(.N); do + local name=${${file:t}#_git-} + if (( $+_git_third_party_commands[$name] )); then + continue + fi + + local desc= + integer i=1 + while read input; do + if (( i == 2 )); then + if [[ $input == '#description '* ]]; then + desc=:${input#\#description } + fi + break + fi + (( i++ )) + done < $file + + _git_third_party_commands+=$name$desc +done + _git diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_gnutls zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_gnutls --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_gnutls 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_gnutls 2011-10-02 01:10:11.000000000 +0000 @@ -8,7 +8,7 @@ _gnutls_cli_common_args=( '(-d --debug)'{-d,--debug}':debug level' '(-p --port)'{-p,--port}':port' - '(-h --help)'{-h,--help}'[help]' \ + '(-h --help)'{-h,--help}'[help]' ) case "$service" in diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_go zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_go --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_go 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_go 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,18 @@ +#compdef gccgo gofmt 5l 6l 8l 5g 6g 8g + +# This is for the computer language go, +# http://golang.org. + +local expl pat + +case $service in + (<->l) + pat="*.${service[1,-2]}" + ;; + + (*) + pat="*.go" + ;; +esac + +_wanted files expl "input file" _files -g "$pat" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_gpg zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_gpg --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_gpg 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_gpg 2011-10-02 01:10:11.000000000 +0000 @@ -22,7 +22,7 @@ '(-c --symmetric)'{-c,--symmetric}'[encrypt with symmetric cypher only]' '(-s --sign)'{-s,--sign}'[make a signature]' '*'{-r+,--recipient}'[specify user to encrypt for]:recipient:->public-keys' - '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users'\ + '(-u --local-user)'{-u+,--local-user}'[use name as the user ID to sign]:user attachment:_users' '(-o --output)'{-o+,--output}'[write output to file]:output file:_files' '(-h --help)'{-h,--help}'[display usage information]' '--version[print info on program version and supported algorithms]') @@ -44,7 +44,7 @@ '--list-packets[list only the sequence of packets]' '--gen-key[generate a new pair key]' '--edit-key[a menu for edit yours keys]:key attachment:->public-keys' - '--sign-key[sign a key]:key attachment:->public-keys'\ + '--sign-key[sign a key]:key attachment:->public-keys' '--lsign-key[sign a key but mark as non-exportable]:key attachment:->public-keys' '--nrsign-key[sign a key non-revocably]' '--delete-key[remove key from public keyring]:key attachment:->public-keys' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_growisofs zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_growisofs --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_growisofs 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_growisofs 2011-10-02 01:10:11.000000000 +0000 @@ -75,13 +75,13 @@ '*-size[true if the size of the file is in the given range]:range' '*-sparse[true if the file appears to be sparse]' '*-true[always true]' - '*-type[true if the file is of the given type]:file type:((b\:"block (buffered) special" \ - c\:"character (unbuffered) special" \ - d\:directory \ - p\:"named pipe (FIFO)" \ - f\:"regular file" \ - l\:"symbolic link" \ - s\:socket \ + '*-type[true if the file is of the given type]:file type:((b\:"block (buffered) special" + c\:"character (unbuffered) special" + d\:directory + p\:"named pipe (FIFO)" + f\:"regular file" + l\:"symbolic link" + s\:socket D\:"door (Solaris)" e\:unknown))' '*-user[true if the file is owned by the given user]:user:_users' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_iconv zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_iconv --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_iconv 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_iconv 2011-10-02 01:10:11.000000000 +0000 @@ -21,7 +21,7 @@ '1:input file:_files' && return 0 if [[ $state = codeset ]]; then - if compset -P '*/'; then + if compset -P '*[^/]/'; then _wanted option expl option compadd "$@" /TRANSLIT && ret=0 else _wanted codesets expl 'code set' compadd "$@" \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_initctl zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_initctl --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_initctl 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_initctl 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,184 @@ +#compdef initctl start stop restart reload status +# Written by Bernhard Tittelbach +# based on completion script by Mildred + +typeset -g -a -U _initctl_events_list _initctl_eventargs_list + +# run show-config -e and if possible parse out all events and KEY= argumnts +# otherwise provide some common values +_initctl_fillarray_events_args () +{ + setopt extendedglob + local showconfig="$(initctl show-config -e 2>| /dev/null)" + if [[ -n "$showconfig" ]]; then + _initctl_events_list=() + _initctl_eventargs_list=() + for cline in "${(f)showconfig}"; do + if [[ "$cline" == (#s)\ \ (stop\ on|start\ on|emit)\ (#b)([[:alpha:]-_]##)(*)(#e) ]]; then + _initctl_events_list+=($match[1]) + # this is a bit tricky, we take the string right of the matched event + # and parse for \sUPPERCASE=\S (in perl-re syntax) substrings until there are no more matches + # since we can't do multiple matches, we concatenated the remaing strings and try again + local stml="$match[2]" + while [[ "$stml" == (#b)(*)\ ([[:upper:]_]##\=)[^[:space:]](#b)(*) ]]; do + _initctl_eventargs_list+=($match[2]) + stml="$match[1] $match[3]" + done + unset stml + fi + done + else + _initctl_events_list=( socket login-session-start desktop-session-start virtual-filesystems local-filesystems remote-filesystems all-swaps filesystem mounting mounted net-device-up start-portmap runlevel unmounted-remote-filesystems ) + _initctl_eventargs_list=( PRIMARY_DEVICE_FOR_DISPLAY= EXIT_STATUS= EXIT_SIGNAL= RUNLEVEL= MOUNTPOINT= TYPE= INTERFACE= ) + fi + return 0 +} + +# list all upstart jobs, i.e. all files in /etc/init/ +_initctl_helper_jobs() +{ + _path_files -W "/etc/init/" -g "*.conf(-.:r)" +} + +# list events, generate array if necessary +_initctl_known_events() +{ + [[ ${#_initctl_events_list} -eq 0 ]] && _initctl_fillarray_events_args + _values "Event" "$_initctl_events_list[@]" +} + +# list events, allow multiple choices, generate array if necessary +_initctl_multiple_known_events() +{ + [[ ${#_initctl_events_list} -eq 0 ]] && _initctl_fillarray_events_args + _values -s "," "Events" "$_initctl_events_list[@]" +} + +# list KEY= arguments, generate array if necessary +_initctl_known_eventargs() +{ + [[ ${#_initctl_eventargs_list} -eq 0 ]] && _initctl_fillarray_events_args + _values "Argument Keys" "$_initctl_eventargs_list[@]" +} + +# describe and offer commands for initctl, then call matching completion function +_initctl_command() +{ + local cmds + cmds=( + start:"Start jobs" + stop:"Stop jobs" + restart:"Restart jobs" + reload:"Send SIGHUP to process instance" + status:"Query status of jobs" + list:"List known jobs" + emit:"Emit an event" + reload-configuration:"tell init to reload config files (generally inotify is used)" + version:"Request the version of the init daemon" + log-priority:"Change the minimum priority of log messages from the init daemon" + show-config:"Show start/stop/emit for processes" + check-config:"Find jobs than can't be started" + help:"display list of commands" + ) + + if (( CURRENT == 1 )); then + _describe -t command "initctl Commands" cmds + fi + + local cmd=$words[1] + + local curcontext="${curcontext%:*}:initctl-${cmd}" + _call_function ret _initctl_${cmd_completion_funcs[${cmd}]-${cmd_completion_default}} +} + +# completion for start/stop/restart/reload i.e. anything that take one job and multiple KEY= arguments's +_initctl_startstop() +{ + _arguments \ + '--no-wait[do not wait for operation to complete before exiting]' \ + "${common_args[@]}" \ + ':Upstart Jobs:_initctl_helper_jobs' \ + '*::Argument Keys:_initctl_known_eventargs' +} + +# completion for anything that takes one job +_initctl_argjob() +{ + _arguments \ + "${common_args[@]}" \ + ':Upstart Jobs:_initctl_helper_jobs' \ + '*::' +} + +# completion for emit, providing options, one event and multiple KEY= arguments's +_initctl_emit() +{ + _arguments \ + '--no-wait[do not wait for event to finish before exiting]' \ + "${common_args[@]}" \ + ':Events:_initctl_known_events' \ + '*::Argument Keys:_initctl_known_eventargs' +} + +# the fallback, just the options +_initctl_basic() +{ + _arguments \ + "${common_args[@]}" +} + +# completion for show-config, additional option and one job +_initctl_show-config() +{ + _arguments \ + "(-e --enumerate)"{-e,--enumerate}"[enumerate emit lines]" \ + "${common_args[@]}" \ + '::Upstart Jobs:_initctl_helper_jobs' \ + '*::' +} + +# completion for show-config, additional options and one job +_initctl_check-config() +{ + _arguments \ + "(-i --ignore-events)"{-i,--ignore-events}"[list of comma-separated events to ignore]:Events:_initctl_multiple_known_events" \ + "(-w --warn)"{-w,--warn}"[treat any unknown jobs or events as error]" \ + "${common_args[@]}" \ + '::Upstart Jobs:_initctl_helper_jobs' \ + '*::' +} + +# after defining above functions, overwrite _initctl function so helper-functions are loaded only once +_initctl() +{ + local -a common_args + common_args=( + '--session[use D-Bus session bus to connect to init daemon (for testing)]' + '--system[talk via DBUS system bus instead of socket]' + '(-q --quiet)'{-q,--quiet}'[reduce output to errors only]' + '(-v --verbose)'{-v,--verbose}'[increase output to include informational messages]' + '--dest=[D-Bus name for init, defaults to com.ubuntu.Upstart]' + '--help[display help and exit]' + '--version[output version information and exit]' + ) + + # map each initctl function to a completion function + local -A cmd_completion_funcs + cmd_completion_funcs=( start startstop stop startstop restart startstop reload startstop show-config show-config status argjob emit emit check-config check-config ) + + # define fallback completion function + local cmd_completion_default=basic + + # depending on which command was used, call different completion funtions + case $service in + initctl) + _arguments "${common_args[@]}" '*::Initctl Commands:_initctl_command' + ;; + start|stop|restart|reload|status) + _call_function ret _initctl_${cmd_completion_funcs[${service}]-${cmd_completion_default}} + ;; + *) return 1 ;; + esac +} + +_initctl "$@" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_ln zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_ln --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_ln 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_ln 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,76 @@ +#compdef ln gln + +local curcontext="$curcontext" state line ret=1 +local -A opt_args + +local -a args +args=( + '-f[remove existing destination files]' + '-s[create symbolic links instead of hard links]') + +local -a opts + +local variant +_pick_variant -r variant gnu=gnu unix --help +if [[ $variant == gnu ]]; then + opts=(-S) + args=( + '(-b --backup)-b[create a backup of each existing destination file]' \ + '(-b --backup)--backup=[create a backup of each existing destination file]::method:(( + none\:"never create backups" + off\:"never create backups" + numbered\:"create numbered backup" + t\:"create numbered backup" + existing\:"same as numbered if numbered backups exist, otherwise same as simple" + nil\:"same as numbered if numbered backups exist, otherwise same as simple" + simple\:"always create simple backups" + never\:"always create simple backups"))' + '(-d -F --directory)'{-d,-F,--directory}'[allow the superuser to attempt to hard link directories]' + '(-f --force)'{-f,--force}'[remove existing destination files]' + '(-i --interactive)'{-i,--interactive}'[prompt before removing destination files]' + '(-L --logical)'{-L,--logical}'[create hard links to symbolic link references]' + '(-n --no-dereference)'{-n,--no-dereference}'[treat destination symbolic link to a directory as if it were a normal file]' + '(-P --physical)'{-P,--physical}'[create hard links directly to symbolic links]' + '(-s --symbolic)'{-s,--symbolic}'[create symbolic links instead of hard links]' + '(-S --suffix)'{-S,--suffix=}'[override default backup suffix]:suffix' + '(-t --target-directory)'{-t,--target-directory=}'[specify directory in which to create the links]: :_directories' + '(-T --no-target-directory)'{-T,--no-target-directory}'[treat destination as a normal file]' + '(-v --verbose)'{-v,--verbose}'[print name of each linked file]' + '--help[display usage information and exit]' + '--version[display version information and exit]') +elif (( ${+builtins[ln]} )); then + args+=( + '-d[attempt to hard link directories]' + {-h,-n}'[do not dereference destination]' + '-i[prompt before removing destination files]') +elif [[ $OSTYPE == darwin* ]]; then + args+=( + '-F[remove existing destination directories]' + {-h,-n}'[do not dereference destination]' + '-i[prompt before removing destination files]' + '-v[print name of each linked file]') +fi + +_arguments -s $opts \ + $args \ + ':link target:_files' \ + '*:: :->files' && ret=0 + +case $state in + (files) + if [[ $variant == gnu && -n ${opt_args[(I)-t|--target-directory]} ]]; then + _wanted files expl 'link target' _files && ret=0 + else + if (( CURRENT == 2 )); then + local expl + _wanted files expl 'additional link target or link name' _files && ret=0 + else + _alternative \ + 'link-targets:additional link target:_files' \ + 'target-directories:target directory:_directories' && ret=0 + fi + fi + ;; +esac + +return ret diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_lp zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_lp --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_lp 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_lp 2011-10-02 01:10:11.000000000 +0000 @@ -133,7 +133,7 @@ case $service in (lpq) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '(-a)-P+[destination printer]:printers:_printers' \ @@ -144,7 +144,7 @@ (lprm) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '-P+[destination printer]:printers:_printers' \ @@ -153,7 +153,7 @@ (lpoptions) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U:username (for connection to server):_users' \ '-h:alternate server:_hosts' \ '(-p -l -r -x)-d[set default printer]:printers:_printers' \ @@ -166,58 +166,58 @@ (lpstat) _arguments \ - '-E[Force encryption]' \ - '-R[Shows print job ranking]' \ + '-E[force encryption]' \ + '-R[shows print job ranking]' \ '-U:username (for connection to server):_users' \ '-W:which jobs:(completed not-completed)' \ - '-a[Show accepting state]:printers:_printers' \ + '-a[show accepting state]:printers:_printers' \ '-c:printer classes:' \ - '-d[Show current default destination]' \ + '-d[show current default destination]' \ '-h:hostname (alternate server):_hosts' \ '-l[long listing]' \ '-o[destinations]:printers:_printers' \ '-p:printers:_printers' \ '-r[CUPS server running status]' \ - '-s[Status summary]' \ - '-t[All status info]' \ + '-s[status summary]' \ + '-t[all status info]' \ '-u[list jobs by users]:users:_users' \ '-v[show devices]:printers:_printers' ;; (lpr) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-H:hostname (alternate server):_hosts' \ '(-C -J -T)'-{C,J,T}':job name:' \ '-P+[destination printer]:printers:_printers' \ '-U:username (for connection to server):_users' \ - '-#[Copies]:copies (1--100):' \ - '-h[Disables banner printing]' \ + '-#[copies]:copies (1--100):' \ + '-h[disables banner printing]' \ '-l[raw file]' \ - '-m[Send an email on job completion]' \ + '-m[send an email on job completion]' \ '*-o:print job options:_lp_job_options' \ '-p[format with shaded header incl. date, time etc.]' \ - '-q[Hold job for printing.]' \ + '-q[hold job for printing]' \ '-r[delete files after printing]' \ '*:PS/PDF files:_pspdf' ;; (lp) _arguments \ - '-E[Force encryption]' \ + '-E[force encryption]' \ '-U[username (for connection to server)]:username:_users' \ '-c[(OBSOLETE) copy to spool dir before printing]' \ '-d[destination printer]:printers:_printers' \ '-h:hostname (alternate server):_hosts' \ '-i[job id to modify]:job id:' \ - '-m[Send an email on job completion]' \ - '-n[Copies]:copies (1--100):' \ + '-m[send an email on job completion]' \ + '-n[copies]:copies (1--100):' \ '*-o:print job options:_lp_job_options' \ - '-q[Job priority -- 1 (lowest) to 100 (highest)]:priority:' \ - '-s[Dont report resulting job IDs]' \ - '-t[Sets the job name]:job name:' \ + '-q[job priority -- 1 (lowest) to 100 (highest)]:priority:' \ + '-s[dont report resulting job IDs]' \ + '-t[sets the job name]:job name:' \ '-u[job submission username]:username:_users' \ - '-H[Time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ + '-H[time to print]:print time (or enter hh\:mm):(hold immediate restart resume)' \ '-P:page range list:' \ '*:PS/PDF files:_pspdf' ;; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_make zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_make --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_make 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_make 2011-10-02 01:10:11.000000000 +0000 @@ -3,10 +3,6 @@ # TODO: Based on targets given on the command line, show only variables that # are used in those targets and their dependencies. -local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match -local -A TARGETS VARIABLES -local ret=1 - _make-expandVars() { local open close var val front ret tmp=$1 @@ -149,77 +145,86 @@ print -- $basedir } -_pick_variant -r is_gnu gnu=GNU unix -v -f +_make() { + + local prev="$words[CURRENT-1]" file expl tmp is_gnu dir incl match + local -A TARGETS VARIABLES + local ret=1 -if [[ $is_gnu == gnu ]] -then - incl="(-|)include" -else - incl=.include -fi - -if [[ "$prev" == -[CI] ]] -then - _files -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0 -elif [[ "$prev" == -[foW] ]] -then - _files -W ${(q)$(_make-findBasedir $words)} && ret=0 -else - file="$words[(I)-f]" - if (( file )) + _pick_variant -r is_gnu gnu=GNU unix -v -f + + if [[ $is_gnu == gnu ]] then - file=${~words[file+1]} - [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file - [[ -r $file ]] || file= + incl="(-|)include" else - local basedir - basedir=${(q)$(_make-findBasedir $words)} - if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]] - then - file=$basedir/GNUmakefile - elif [[ -r $basedir/makefile ]] - then - file=$basedir/makefile - elif [[ -r $basedir/Makefile ]] + incl=.include + fi + + if [[ "$prev" == -[CI] ]] + then + _files -W ${(q)$(_make-findBasedir ${words[1,CURRENT-1]})} -/ && ret=0 + elif [[ "$prev" == -[foW] ]] + then + _files -W ${(q)$(_make-findBasedir $words)} && ret=0 + else + file="$words[(I)-f]" + if (( file )) then - file=$basedir/Makefile + file=${~words[file+1]} + [[ $file == [^/]* ]] && file=${(q)$(_make-findBasedir $words)}/$file + [[ -r $file ]] || file= else - file='' + local basedir + basedir=${$(_make-findBasedir $words)} + if [[ $is_gnu == gnu && -r $basedir/GNUmakefile ]] + then + file=$basedir/GNUmakefile + elif [[ -r $basedir/makefile ]] + then + file=$basedir/makefile + elif [[ -r $basedir/Makefile ]] + then + file=$basedir/Makefile + else + file='' + fi fi - fi - if [[ -n "$file" ]] - then - if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command + if [[ -n "$file" ]] + then + if [[ $is_gnu == gnu ]] && zstyle -t ":completion:${curcontext}:targets" call-command + then + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) + else + case "$OSTYPE" in + freebsd*) + _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null) + ;; + *) + _make-parseMakefile $PWD < $file + esac + fi + fi + + if [[ $PREFIX == *'='* ]] then - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp --no-print-directory -f "$file" .PHONY 2> /dev/null) + # Complete make variable as if shell variable + compstate[parameter]="${PREFIX%%\=*}" + compset -P 1 '*=' + _value "$@" && ret=0 else - case "$OSTYPE" in - freebsd*) - _make-parseMakefile $PWD < <(_call_program targets "$words[1]" -nsp -f "$file" .PHONY 2> /dev/null) - ;; - *) - _make-parseMakefile $PWD < $file - esac + _tags targets variables + while _tags + do + _requested targets expl 'make targets' \ + compadd -- ${(k)TARGETS} && ret=0 + _requested variables expl 'make variables' \ + compadd -S '=' -- ${(k)VARIABLES} && ret=0 + done fi fi - if [[ $PREFIX == *'='* ]] - then - # Complete make variable as if shell variable - compstate[parameter]="${PREFIX%%\=*}" - compset -P 1 '*=' - _value "$@" && ret=0 - else - _tags targets variables - while _tags - do - _requested targets expl 'make targets' \ - compadd -- ${(k)TARGETS} && ret=0 - _requested variables expl 'make variables' \ - compadd -S '=' -- ${(k)VARIABLES} && ret=0 - done - fi -fi + return ret +} -return ret +_make "$@" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_osc zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_osc --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_osc 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_osc 2011-10-02 01:10:11.000000000 +0000 @@ -4,7 +4,7 @@ # # This file is released under the GPLv2. # -# Based on the the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html +# Based on the zsh guide from http://zsh.dotsrc.org/Guide/zshguide06.html # # Toggle verbose completions: zstyle ':completion:*:osc:*' verbose no # zstyle ':completion:*:osc-subcommand:*' verbose no diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_perforce zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_perforce --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_perforce 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_perforce 2011-10-02 01:10:11.000000000 +0000 @@ -1686,6 +1686,7 @@ '-a[all, show both added and deleted lines]' \ '-c[output change numbers instead of revisions]' \ '-i[follow branches (integration records)]' \ + '-I[follow integrations to get change numbers]' \ '-q[quiet, suppress one-line file header]' \ '*::file:_perforce_files -tR' } @@ -1748,7 +1749,8 @@ '(-d -i -f)-o[output specification to standard output]' \ '(-d -o)-i[read specification from standard input]' \ '(-d -o)-u[force change of jobs or description by owner]' \ - "(-i)1::change:_perforce_changes$ctype" + "(-i)1::change:_perforce_changes$ctype" \ + '-t[specify visibility type]:visibility type:(public restricted)' } @@ -1800,6 +1802,22 @@ } +(( $+functions[_perforce_cmd_copy] )) || +_perforce_cmd_copy() { + local range + # If -s is present, the first normal argument can't have revRange. + [[ ${words[(I)-s]} -eq 0 ]] && range=" -tR" + _arguments -s : \ + '-b[select branch]:branch:_perforce_branches' \ + '-c[select change for copy]:change:_perforce_changes -tc' \ + '-n[no action, dummy run]' \ + '-r[reverse direction of copy with branch]' \ + '-s[select source with -b]:source file:_perforce_files -tR' \ + '-v[leave newly copied files uncopied till sync]' \ + "1:file:_perforce_files$range" \ + '*::file:_perforce_files' +} + (( $+functions[_perforce_cmd_counter] )) || _perforce_cmd_counter() { _arguments -s : \ @@ -1942,7 +1960,8 @@ '(-j)-l[specify number of lines]:number of lines: ' \ '(-j)-F[specify filter]:filter pattern: ' \ '(-c)-r[raw format]' \ - '-J[specify file prefix]:file prefix: ' + '-J[specify file prefix]:file prefix: ' \ + '-T[space-separated list of tables not to export]' } @@ -2117,8 +2136,8 @@ (( $+functions[_perforce_cmd_info] )) || _perforce_cmd_info() { - # No arguments - _arguments -s : + _arguments -s : \ + '-s[don'\''t check for unknown users or clients]' } @@ -2257,6 +2276,7 @@ '-d[delete files from label]' \ '-n[no effect, dummy run]' \ '-l[specify label]:label:_perforce_labels' \ + '-q[suppress informational messages]' \ '*::file:_perforce_files -tR' } @@ -2407,6 +2427,19 @@ } +(( $+functions[_perforce_cmd_ping] )) || +_perforce_cmd_ping() { + _arguments -s : \ + '-c[specify count of messages]:count of messages: ' \ + '-t[specify total time of test]:time in seconds: ' \ + '-i[specify iterations for test]:number of iterations: ' \ + '-f[transmit continuously without waiting for responses]' \ + '-p[specify pause between tests]:pause in seconds: ' \ + '-s[specify send size]:send size in octets: ' \ + '-r[specify receive size]:receive size in octets: ' +} + + (( $+functions[_perforce_cmd_print] )) || _perforce_cmd_print() { _arguments -s : \ @@ -2437,6 +2470,15 @@ } +(( $+functions[_perforce_cmd_pull] )) || +_perforce_cmd_pull() { + _arguments -s : \ + '-i[repeat as specified]:seconds between repeats: ' \ + '-u[retrieve file content rather than journal]' \ + '-p[display information about pending transfers]' \ + '-J[specify prefix for journal file]:journal file prefix: ' +} + (( $+functions[_perforce_cmd_reopen] )) || _perforce_cmd_reopen() { # Assume user doesn't want to reopen to same changelist. @@ -2462,7 +2504,9 @@ '-J[specify file prefix]:file prefix: ' \ '-k[keep pipe open]' \ '-o[specify output file]:output file:_files' \ + '-R[reconnect on failure, needs -i]' \ '-s[specify file to track state]:state file:_files' \ + '-T[space-separate list of tables not to transfer]' \ '-x[terminate when journal rotates]' \ '*::->_command' } @@ -2580,6 +2624,7 @@ '-f[force resynchronisation]' \ '-n[show operations but don'\''t perform them]' \ '-k[bypass client file update]' \ + '-q[suppress informational messages]' \ '*::file:_perforce_files -tR' } @@ -2605,7 +2650,7 @@ _perforce_cmd_triggers() { _arguments -s : \ '-o[output form to stdout]' \ - '-i[read from from stdin]' + '-i[read from stdin]' } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_pgrep zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_pgrep --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_pgrep 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_pgrep 2011-10-02 01:10:11.000000000 +0000 @@ -1,112 +1,89 @@ #compdef pgrep pkill -local context state line +local context state line ret=1 expl typeset -A opt_args typeset -a arguments arguments=('-P[parent process id]:parent process id:->ppid' - '-g[match only in process group ids]:group:->pgid' - '-G[match only real group id]:group:->group' - '-s[match only session id]:session id:->sid' - '-t[match only controlled by terminal]:terminal device:->tty' - '-u[match only effective user id]:user:->user' - '-U[match only real user id]:user:->user' + '-g[match only in process group ids]:group:->pgid' + '-G[match only real group id]:group:_groups' + '-s[match only session id]:session id:->sid' + '-t[match only controlled by terminal]:terminal device:->tty' + '-u[match only effective user id]:user:_users' + '-U[match only real user id]:user:_users' '(-n)-o[oldest process]' - '(-o)-n[newest process]' - '-f[match against full command line]' - '-v[negate matching]' - '-x[match exactly]' - '*:process name:->pname') + '(-o)-n[newest process]' + '-f[match against full command line]' + '-v[negate matching]' + '-x[match exactly]' + '*:process name:->pname') if [[ $service == 'pkill' ]] then - arguments+=('-'${^signals}'[signal]') + arguments+=('-'${^signals}'[signal]') elif [[ $service == 'pgrep' ]] then - arguments+=('-d[output delimiter]:delimiter:compadd ${(s\:\:)IFS}' - '-l[list name in addition to id]') + arguments+=('-d[output delimiter]:delimiter:compadd ${(s\:\:)IFS}' + '-l[list name in addition to id]') fi -_arguments -s -w $arguments +_arguments -s -w $arguments && ret=0 case $state in - (tty) - compset -P '*,' + (tty) + compset -P '*,' - local -a used - used=(${(s:,:)IPREFIX}) + local -a used ttys + used=(${(s:,:)IPREFIX}) - compadd -S ',' -q -F used /dev/tty*(:t) - ;; - - (sid) - compset -P '*,' - - local -a used sid - used=(${(s:,:)IPREFIX}) - sid=(${(uon)$(ps -A o sid=)}) - - compadd -S ',' -q -F used $sid - ;; - - (ppid) - compset -P '*,' - - local -a used ppid - used=(${(s:,:)IPREFIX}) - ppid=(${(uon)$(ps -A o ppid=)}) - - compadd -S ',' -q -F used $ppid - ;; - - (pgid) - compset -P '*,' - - local -a used pgid - used=(${(s:,:)IPREFIX}) - pgid=(${(uon)$(ps -A o pgid=)}) - - compadd -S ',' -q -F used $pgid - ;; - - (pname) - if (( ${+opt_args[-x]} )) && (( ${+opt_args[-f]} )) - then - compadd ${(u)${(f)"$(ps -A o cmd=)"}} - else - compadd ${(u)${(f)"$(ps -A co cmd=)"}} - fi - ;; - - (group) - compset -P '*,' - - local group - group=$(getent group) - - local -a groups ids - groups=(${${(f)group}%%:*}) - ids=(${${${(f)group}#*:*:}%%:*}) - - local -a used - used=(${(s:,:)IPREFIX}) - - compadd -S ',' -q -F used -d ids $groups $groups - ;; - - (user) - compset -P '*,' - - local passwd - passwd=$(getent passwd) - - local -a users ids - users=(${${(f)passwd}%%:*}) - ids=(${${${(f)passwd}#*:*:}%%:*}) - - local -a used - used=(${(s:,:)IPREFIX}) - - compadd -S ',' -q -F used -d ids $users $users - ;; -esac + ttys=( /dev/tty*(N) /dev/pts/*(N) ) + _wanted tty expl 'terminal device' compadd -S ',' -q -F used ${ttys#/dev/} + ;; + + (sid) + compset -P '*,' + + local -a used sid + used=(${(s:,:)IPREFIX}) + sid=(${(uon)$(ps -A o sid=)}) + + _wanted sid expl 'session id' compadd -S ',' -q -F used $sid + ;; + + (ppid) + compset -P '*,' + + local -a used ppid + used=(${(s:,:)IPREFIX}) + ppid=(${(uon)$(ps -A o ppid=)}) + + _wanted ppid expl 'parent process id' compadd -S ',' -q -F used $ppid + ;; + + (pgid) + compset -P '*,' + + local -a used pgid + used=(${(s:,:)IPREFIX}) + pgid=(${(uon)$(ps -A o pgid=)}) + + _wanted pgid expl 'process group id' compadd -S ',' -q -F used $pgid + ;; + + (pname) + local ispat="pattern matching " + if (( ${+opt_args[-x]} )) + then + ispat="" + fi + if (( ${+opt_args[-f]} )) + then + _wanted pname expl $ispat'process command line' compadd ${(u)${(f)"$(ps -A o cmd=)"}} + else + _wanted pname expl $ispat'process name' compadd ${(u)${(f)"$(ps -A co cmd=)"}} + fi + ;; + +esac && ret=0 + +return ret diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_php zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_php --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_php 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_php 2011-10-02 01:10:11.000000000 +0000 @@ -31,7 +31,7 @@ '(- 1 *)'{-i,--info}'[PHP information]' '(- *)'{-l,--syntax-check}'[syntax check only (lint)]' '(- 1 *)'{-m,--modules}'[show compiled in modules]' - "(-r --run -f --file $exclusions -l --syntax-check -s --syntax-highlight -w --strip 1)"{-r,--run}'[run the specified PHP code without using script tags ]:PHP code:'\ + "(-r --run -f --file $exclusions -l --syntax-check -s --syntax-highlight -w --strip 1)"{-r,--run}'[run the specified PHP code without using script tags ]:PHP code:' '(- 1 *)'{-s,--syntax-highlight}'[display colour syntax highlighted source]' '(- 1 *)'{-v,--version}'[display version information]' '(- *)'{-w,--strip}'[display source with stripped comments and whitespace]' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_quilt zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_quilt --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_quilt 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_quilt 2011-10-02 01:10:11.000000000 +0000 @@ -1,30 +1,241 @@ #compdef quilt +local -a tmp +local rc + +_quilt_applied () { + tmp=( ${(f)"$(quilt applied 2>&1)"} ) + rc=$? + if (( rc == 0 )); then + _wanted -V 'applied patches' expl 'patch' compadd "${tmp[@]}" + else + _message "No applied patches" + fi +} + +_quilt_series () { + _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} +} + +_quilt_unapplied () { + tmp=( ${(f)"$(quilt unapplied 2>&1)"} ) + rc=$? + if (( rc == 0 )); then + _wanted -V 'unapplied patches' expl 'patch' compadd "${tmp[@]}" + else + _message "No unapplied patches" + fi +} + _arguments \ - '--trace' \ - '--quiltrc:config file:_files' \ - '--version' \ - ':quilt command:(add files import previous setup annotate fold mail push - snapshot applied fork new refresh top delete graph next remove unapplied - diff grep patches rename upgrade edit header pop series)' \ + '--trace[Runs the command in bash trace mode]' \ + '--quiltrc[Use the specified configuration file]:files:_files' \ + '--version[Print the version number and exit]' \ + ':quilt command:(add annotate applied delete diff edit files fold fork graph + grep header import mail new next patches pop previous push refresh rename + revert series setup shell snapshot top unapplied upgrade)' \ '*::subcmd:->subcmd' && return 0 -case "$state" in - (subcmd) - +case "$state" in (subcmd) case "$words[1]" in - (applied|delete|files|graph|header|next|previous|refresh|unapplied) - _wanted -V 'patches' expl 'patch' compadd ${(f)"$(quilt series)"} - ;; - (push) - _wanted -V 'unapplied patches' expl 'patch' compadd ${(f)"$(quilt unapplied)"} - ;; + (add) + _arguments '-h' \ + '-P[Patch to add files to]:quilt series:_quilt_series' \ + '*:files:_files' + ;; + (annotate) + _arguments '-h' \ + '-P[Stop checking for changes at the specified rather than the topmost patch]:quilt series:_quilt_series' \ + ':files:_files' + ;; + (applied) + _arguments '-h' \ + ':quilt series:_quilt_series' + ;; + (delete) + _arguments '-h' \ + '-n[Delete the next patch after topmost]' \ + '-r[Remove the deleted patch file from the patches directory as well]' \ + '--backup[Rename the patch file to patch~ rather than deleting it]' \ + ':quilt series:_quilt_series' + ;; + (diff) + _arguments '-h' \ + '-p[Select a patch style]:quilt patch style:(0 1 ab)' \ + '-u[Create a unified diff]' \ + '-U[Create a unified diff with num lines of context]:quilt unified diff: ' \ + '-c[Create a context diff]' \ + '-C[Create a context diff with num lines of context]:quilt context diff: ' \ + '--no-timestamps[Do not include file timestamps in patch headers]' \ + '--no-index[Do not output Index: lines]' \ + '-z[Write to standard output the changes that have been made relative to the topmost or specified patch]' \ + '-R[Create a reverse diff]' \ + '-P[Create a diff for the specified patch]:quilt series:_quilt_series' \ + '--combine[Create a combined diff for all patches between this patch and the patch specified with -P]:quilt series:_quilt_series' \ + '--snapshot[Diff against snapshot]' \ + '--diff=[Use the specified utility for generating the diff]:quilt select diff utility:_command_names -e' \ + '--color=[Use syntax coloring]:quilt select color:(always auto never)' \ + '--sort[Sort files by their name]' \ + '*:files:_files' + ;; + (edit) + _arguments '-h' \ + '*:files:_files' + ;; + (files) + _arguments '-h' \ + '-a[List all files in all applied patches]' \ + '-l[Add patch name to output]' \ + '-v[Verbose, more user friendly output]' \ + '--combine[Create a listing for all patches between this patch and the topmost or specified patch]:quilt series:_quilt_series' \ + ':quilt series:_quilt_series' + ;; + (fold) + _arguments '-h' \ + '-R[Apply patch in reverse]' \ + '-q[Quiet operation]' \ + '-f[Force apply]' \ + '-p[The number of pathname components to strip]:quilt select strip-level: ' + ;; + (fork) + _arguments '-h' + ;; + (graph) + _arguments '-h' \ + '--all[Generate a graph including all applied patches and their dependencies]' \ + '--reduce[Eliminate transitive edges from the graph]' \ + '--lines[Compute dependencies by looking at the lines the patches modify]:quilt select lines: ' \ + '--edge-labels=files[Label graph edges with the file names that the adjacent patches modify]' \ + '-T ps[Directly produce a PostScript output file]' \ + ':quilt series:_quilt_series' + ;; + (header) + _arguments '-h' \ + '-a[Append the exiting patch header]' \ + '-r[Replace the exiting patch header]' \ + '-e[Edit the header in $EDITOR]' \ + '--strip-diffstat[Strip diffstat output from the header]' \ + '--strip-trailing-whitespace[Strip trailing whitespace at the end of lines of the header]' \ + '--backup[Create a backup copy of the old version of a patch as patch~]' \ + ':quilt series:_quilt_series' + ;; + (import) + _arguments '-h' \ + '-p[Number of directory levels to strip when applying]:quilt select strip-level: ' \ + '-R[Apply patch in reverse]' \ + '-P[Patch filename to use inside quilt]:quilt select patch filename: ' \ + '-f[Overwrite/update existing patches]' \ + '-d[When overwriting in existing patch, keep the old (o), all (a), or new (n) patch header]:quilt select patch:(a n o)' \ + '*:files:_files' + ;; + (mail) + _arguments '-h' \ + '-m[Text to use as the text in the introduction]:quilt select text: ' \ + '--prefix[Use an alternate prefix in the bracketed part of the subjects generated]:quilt select prefix: ' \ + '--mbox[Store all messages in the specified file in mbox format]:files:_files' \ + '--send[Send the messages directly]' \ + '--sender[The envelope sender address to use]:quilt select sender: ' \ + '--from[From header]:quilt select from: ' \ + '--subject[Subject header]:quilt select subject: ' \ + '--to[Append a recipient to the To header]:quilt select to: ' \ + '--cc[Append a recipient to the Cc header]:quilt select cc: ' \ + '--bcc[Append a recipient to the Bcc header]:quilt select bcc: ' \ + '--signature[Append the specified signature to messages]:files:_files' \ + '--reply-to[Add the appropriate headers to reply to the specified message]:quilt select reply-to: ' \ + '*:quilt series:_quilt_series' + ;; + (new) + _arguments '-h' + ;; + (next) + _arguments '-h' \ + ':quilt series:_quilt_series' + ;; + (patches) + _arguments '-h' \ + '-v[Verbose, more user friendly output]' \ + ':files:_files' + ;; (pop) - _wanted -V 'applied patches' expl 'patch' compadd ${(f)"$(quilt applied)"} - ;; + _arguments '-h' \ + '-a[Remove all applied patches]' \ + '-f[Force remove]' \ + '-R[Always verify if the patch removes cleanly]' \ + '-q[Quiet operation]' \ + '-v[Verbose operation]' \ + ':quilt applied:_quilt_applied' + ;; + (previous) + _arguments '-h' \ + ':quilt series:_quilt_series' + ;; + (push) + _arguments '-h' \ + '-a[Apply all patches in the series file]' \ + '-q[Quiet operation]' \ + '-f[Force apply, even if the patch has rejects]' \ + '-v[Verbose operation]' \ + '--leave-rejects[Leave around the reject files patch produced]' \ + '--color=[Use syntax coloring]:quilt select color:(always auto never)' \ + ':quilt unapplied:_quilt_unapplied' + ;; + (refresh) + _arguments '-h' \ + '-p[Select a patch style]:quilt patch style:(0 1 ab)' \ + '-u[Create a unified diff]' \ + '-U[Create a unified diff with num lines of context]:quilt unified diff: ' \ + '-c[Create a context diff]' \ + '-C[Create a context diff with num lines of context]:quilt context diff: ' \ + '-z[Create a new patch containing the changes instead of refreshing the topmost patch]:quilt select new patch name: ' \ + '--no-timestamps[Do not include file timestamps in patch headers]' \ + '--no-index[Do not output Index: lines]' \ + '--diffstat[Add a diffstat section to the patch header, or replace the existing diffstat section]' \ + '-f[Enforce refreshing of a patch that is not on top]' \ + '--backup[Create a backup copy of the old version of a patch as patch~]' \ + '--sort[Sort files by their name instead of preserving the original order]' \ + '--strip-trailing-whitespace[Strip trailing whitespace at the end of lines]' \ + ':quilt series:_quilt_series' + ;; + (rename) + _arguments '-h' \ + '-P[Patch to rename]:quilt series:_quilt_series' + ;; + (revert) + _arguments '-h' \ + '-P[Revert changes in the named patch]:quilt series:_quilt_series' \ + '*:files:_files' + ;; + (series) + _arguments '-h' \ + '-v[Verbose, more user friendly output]' + ;; + (setup) + _arguments '-h' \ + '-d[Optional path prefix for the resulting source tree]:quilt select path-prefix: ' \ + '--sourcedir[Directory that contains the package sources]:quilt select package sources directory: ' \ + '-v[Verbose debug output]' \ + ':files:_files' + ;; + (shell) + _arguments '-h' \ + ':quilt select shell command:_command_names -e' + ;; + (snapshot) + _arguments '-h' \ + '-d[Remove current snapshot]' + ;; + (top) + _arguments '-h' + ;; + (unapplied) + _arguments '-h' \ + ':quilt series:_quilt_series' + ;; + (upgrade) + _arguments '-h' + ;; (*) - _files - ;; + ;; esac ;; esac diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_rsync zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_rsync --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_rsync 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_rsync 2011-10-02 01:10:11.000000000 +0000 @@ -96,144 +96,148 @@ _alternative "files:file:_files" "remote-files:remote file:_rsync_remote_files" } -_arguments -s \ - '*'{-v,--verbose}'[increase verbosity]' \ - {--no-v,--no-verbose}'[turn off --verbose]' \ - '--bwlimit=[limit I/O bandwidth]:KBytes per second' \ - '--port=[specify alternate port number]:port:(873)' \ - '--address=[bind to the specified address]:bind address:_bind_addresses' \ - '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \ - '--sockopts=[specify custom TCP options]' \ - '(-4 -6 --ipv4 --ipv6)'{-4,--ipv4}'[prefer IPv4]' \ - '(-4 -6 --ipv4 --ipv6)'{-6,--ipv6}'[prefer IPv6]' \ - - daemon \ - '(-)'{-h,--help}'[display help information]' \ - '--config=[specify alternate rsyncd.conf file]:file:_files' \ - '--daemon[run as an rsync daemon]' \ - '--detach[detach from the parent]' \ - '--no-detach[do not detach from the parent]' \ - - client \ - '(-)--help[display help information]' \ - '*: :_rsync_files' \ - '(-q --quiet)'{-q,--quiet}'[suppress non-error messages]' \ - '--no-motd[suppress the daemon message-of-the-day output]' \ - '(-c --checksum)'{-c,--checksum}'[skip based on checksums, not mod-time & size]' \ - '(-a --archive)'{-a,--archive}'[archive mode; same as -rlptgoD (no -H)]' \ - '(-r --recursive)'{-r,--recursive}'[recurse into directories]' \ - {--no-r,--no-recursive}'[turn off --recursive]' \ - {--no-inc-recursive,--no-i-r}'[disable incremental recursive mode]' \ - '(-R --relative)'{-R,--relative}'[use relative path names]' \ - {--no-R,--no-relative}'[turn off --relative]' \ - {--no-implied-dirs,--no-i-d}'[do not send implied dirs with --relative]' \ - '(-b --backup)'{-b,--backup}'[make backups into hierarchy at indicated directory]' \ - '--backup-dir=[make backups into specified directory]:backup directory:_directories' \ - '--suffix=[set backup suffix]:suffix:(\~)' \ - '(-u --update)'{-u,--update}'[skip files that are newer on the receiving side]' \ - '--inplace[update destination files in-place]' \ - '(--append-verify)--append[append data onto shorter files]' \ - '(--append)--append-verify[append data onto shorter files, verifying old data]' \ - '(-A --acls)'{-A,--acls}'[preserve access-control lists]' \ - '(-X --xattrs)'{-X,--xattrs}'[preserve extended attributes]' \ - '--fake-super[use xattrs to save all file attributes]' \ - '(-d --dirs)'{-d,--dirs}'[transfer directories without recursing]' \ - {--no-d,--no-dirs}'[turn off --dirs]' \ - '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \ - {--no-l,--no-links}'[turn off --links]' \ - '(-L --copy-links)'{-L,--copy-links}'[transform symlinks into referent file/dir]' \ - '(-k --copy-dirlinks)'{-k,--copy-dirlinks}'[transform a symlink to a dir into referent dir]' \ - '--copy-unsafe-links[only "unsafe" symlinks are transformed]' \ - '--safe-links[ignore symlinks that point outside the source tree]' \ - '(-H --hard-links)'{-H,--hard-links}'[preserve hard links]' \ - {--no-H,--no-hard-links}'[turn off --hard-links]' \ - '(-K --keep-dirlinks)'{-K,--keep-dirlinks}'[treat symlinked dir on receiver as dir]' \ - '(-p --perms -E --executability)'{-p,--perms}'[preserve permissions]' \ - {--no-p,--no-perms}'[turn off --perms]' \ - '(-E --executability)'{-E,--executability}'[preserve executability]' \ - '(-o --owner)'{-o,--owner}'[preserve owner]' \ - {--no-o,--no-owner}'[turn off --owner]' \ - '(-g --group)'{-g,--group}'[preserve group]' \ - {--no-g,--no-group}'[turn off --group]' \ - '(--devices --specials)-D[same as --devices --specials]' \ - '(-D)--devices[preserve devices]' \ - '--no-devices[turn off --devices]' \ - '(-D)--specials[preserve special files]' \ - '--no-specials[turn off --specials]' \ - '--no-D[turn off --devices and --specials]' \ - '(-t --times)'{-t,--times}'[preserve times]' \ - {--no-t,--no-times}'[turn off --times]' \ - '(-O --omit-dir-times)'{-O,--omit-dir-times}'[omit directories when preserving times]' \ - '--chmod[change destination permissions]:mods' \ - '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \ - '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \ - '(-W --whole-file)'{-W,--whole-file}'[copy files whole (without delta-transfer algorithm)]' \ - {--no-W,--no-whole-file}'[turn off --whole-file]' \ - '(-x --one-file-system)'{-x,--one-file-system}'[do not cross filesystem boundaries]' \ - '(-B --block-size)'{-B,--block-size=}'[force a fixed checksum block-size]:block size' \ - '(-e --rsh)'{-e,--rsh=}'[specify the remote shell to use]:remote-shell command:(rsh ssh)' \ - '--rsync-path=[specify path to rsync on the remote machine]:remote command' \ - '--ignore-existing[ignore files that already exist on receiving side]' \ - '(--existing --ignore-non-existing)'{--existing,--ignore-non-existing}'[ignore files that do not exist on receiving side]' \ - '--remove-source-files[synchronized files are removed from sending side]' \ - '(--delete-before --delete-during --delete-after --delete-delay)--del[an alias for --delete-during]' \ - '--delete[delete files that do not exist on the sending side]' \ - '(--del --delete-during --delete-after --delete-delay)--delete-before[receiver deletes before transfer]' \ - '(--del --delete-before --delete-after --delete-delay)--delete-during[receiver deletes during transfer]' \ - '(--del --delete-before --delete-during --delete-delay)--delete-after[receiver deletes after transfer]' \ - '(--del --delete-before --delete-during --delete-after)--delete-delay[receiver deletes after transfer]' \ - '--delete-excluded[also delete excluded files on the receiving side]' \ - '--ignore-errors[delete even if there are I/O errors]' \ - '--force[force deletion of directories even if not empty]' \ - '--max-delete=[do not delete more than NUM files]:number' \ - '--max-size=[do not transfer any file larger than specified size]:number' \ - '--min-size=[do not transfer any file smaller than specified size]:number' \ - '(-P)--partial[keep partially transferred files]' \ - '--no-partial[turn off --partial]' \ - '--partial-dir=[put a partially transferred file into specified directory]:directory:_directories' \ - '--super[receiver attempts super-user activities]' \ - '--no-super[receiver performs normal-user activities]' \ - '--delay-updates[put all updated files into place at end of transfer]' \ - '(-m --prune-empty-dirs)'{-m,--prune-empty-dirs}'[prune empty directory chains from file-list]' \ - '--numeric-ids[do not map uid/gid values by user/group name]' \ - '--timeout=[set I/O timeout in seconds for lulls in a transfer]:seconds' \ - '--contimeout=[set connect timeout in seconds for daemon connections]:seconds' \ - '(-I --ignore-times)'{-I,--ignore-times}'[do not skip files that match in size and mod-time]' \ - '--size-only[skip files that match in size]' \ - '--modify-window=[compare mod-times with reduced accuracy]:seconds' \ - '(-y --fuzzy)'{-y,--fuzzy}'[find similar file for basis if no destination file]' \ - '(--copy-dest --link-dest)*--compare-dest=[also compare destination files relative to specified directory]:directory:_directories' \ - '(--compare-dest --link-dest)*--copy-dest=[like --compare-dest, but also includes copies of unchanged files]:directory:_directories' \ - '(--compare-dest --copy-dest)*--link-dest=[hardlink to files in specified directory hierarchy when unchanged]:directory:_directories' \ - '(-z --compress)'{-z,--compress}'[compress file data during the transfer]' \ - '--compress-level=[explicitly set compression level]:number' \ - '--skip-compress=[skip compressing files with a listed suffix]:suffixes' \ - '(-C --cvs-exclude)'{-C,--cvs-exclude}'[auto-ignore files the same way CVS does]' \ - '*'{-f=,--filter=}'[add a file-filtering rule]:rule' \ - '*-F[same as --filter="dir-merge /.rsync-filter", repeated: --filter="- .rsync-filter"]' \ - '--exclude-from=[read exclude patterns from specified file]:file:_files' \ - '*--exclude=[exclude files matching pattern]:pattern' \ - '--include-from=[read include patterns from specified file]:file:_files' \ - '*--include=[do not exclude files matching pattern]:pattern' \ - '--files-from=[read list of source-file names from specified file]:file:_files' \ - '(-0 --from0)'{-0,--from0}'[all *-from file lists are delimited by nulls]' \ - '(-s --protect-args)'{-s,--protect-args}'[no space-splitting; only wildcard special-chars]' \ - '--version[print version number]' \ - '*'{-h,--human-readable}'[output numbers in a human-readable format]' \ - '--blocking-io[use blocking I/O for the remote shell]' \ - '--no-blocking-io[turn off --blocking-io]' \ - '--stats[give some file-transfer stats]' \ - '(-8 --8-bit-output)'{-8,--8-bit-output}'[leave high-bit chars unescaped in output]' \ - '(-P)--progress[show progress during transfer]' \ - '--no-progress[turn off --progress]' \ - '(--partial --progress)-P[same as --partial --progress]' \ - '(-i --itemize-changes)'{-i,--itemize-changes}'[output a change-summary for all updates]' \ - '--log-format=[deprecated version of --out-format]' \ - '--out-format=[output updates using specified format]:format' \ - '--log-file-format=[log updates using specified format]:format' \ - '--log-file=[log what rsync is doing to the specified file]:file:_files' \ - '--password-file=[read daemon-access password from file]:file:_files' \ - '--list-only[list the files instead of copying them]' \ - '(--only-write-batch)--write-batch=[write a batched update to the specified file]:file:_files' \ - '(--write-batch)--only-write-batch=[like --write-batch but w/o updating destination]:file:_files' \ - '--protocol=[force an older protocol version to be used]:number' \ - '--iconv=[request charset conversion of filenames]:number' \ - '--read-batch=[read a batched update from the specified file]:file:_files' +_rsync() { + _arguments -s \ + '*'{-v,--verbose}'[increase verbosity]' \ + {--no-v,--no-verbose}'[turn off --verbose]' \ + '--bwlimit=[limit I/O bandwidth]:KBytes per second' \ + '--port=[specify alternate port number]:port:(873)' \ + '--address=[bind to the specified address]:bind address:_bind_addresses' \ + '(-T --temp-dir)'{-T,--temp-dir=}'[create temporary files in specified directory]:directory:_directories' \ + '--sockopts=[specify custom TCP options]' \ + '(-4 -6 --ipv4 --ipv6)'{-4,--ipv4}'[prefer IPv4]' \ + '(-4 -6 --ipv4 --ipv6)'{-6,--ipv6}'[prefer IPv6]' \ + - daemon \ + '(-)'{-h,--help}'[display help information]' \ + '--config=[specify alternate rsyncd.conf file]:file:_files' \ + '--daemon[run as an rsync daemon]' \ + '--detach[detach from the parent]' \ + '--no-detach[do not detach from the parent]' \ + - client \ + '(-)--help[display help information]' \ + '*: :_rsync_files' \ + '(-q --quiet)'{-q,--quiet}'[suppress non-error messages]' \ + '--no-motd[suppress the daemon message-of-the-day output]' \ + '(-c --checksum)'{-c,--checksum}'[skip based on checksums, not mod-time & size]' \ + '(-a --archive)'{-a,--archive}'[archive mode; same as -rlptgoD (no -H)]' \ + '(-r --recursive)'{-r,--recursive}'[recurse into directories]' \ + {--no-r,--no-recursive}'[turn off --recursive]' \ + {--no-inc-recursive,--no-i-r}'[disable incremental recursive mode]' \ + '(-R --relative)'{-R,--relative}'[use relative path names]' \ + {--no-R,--no-relative}'[turn off --relative]' \ + {--no-implied-dirs,--no-i-d}'[do not send implied dirs with --relative]' \ + '(-b --backup)'{-b,--backup}'[make backups into hierarchy at indicated directory]' \ + '--backup-dir=[make backups into specified directory]:backup directory:_directories' \ + '--suffix=[set backup suffix]:suffix:(\~)' \ + '(-u --update)'{-u,--update}'[skip files that are newer on the receiving side]' \ + '--inplace[update destination files in-place]' \ + '(--append-verify)--append[append data onto shorter files]' \ + '(--append)--append-verify[append data onto shorter files, verifying old data]' \ + '(-A --acls)'{-A,--acls}'[preserve access-control lists]' \ + '(-X --xattrs)'{-X,--xattrs}'[preserve extended attributes]' \ + '--fake-super[use xattrs to save all file attributes]' \ + '(-d --dirs)'{-d,--dirs}'[transfer directories without recursing]' \ + {--no-d,--no-dirs}'[turn off --dirs]' \ + '(-l --links)'{-l,--links}'[copy symlinks as symlinks]' \ + {--no-l,--no-links}'[turn off --links]' \ + '(-L --copy-links)'{-L,--copy-links}'[transform symlinks into referent file/dir]' \ + '(-k --copy-dirlinks)'{-k,--copy-dirlinks}'[transform a symlink to a dir into referent dir]' \ + '--copy-unsafe-links[only "unsafe" symlinks are transformed]' \ + '--safe-links[ignore symlinks that point outside the source tree]' \ + '(-H --hard-links)'{-H,--hard-links}'[preserve hard links]' \ + {--no-H,--no-hard-links}'[turn off --hard-links]' \ + '(-K --keep-dirlinks)'{-K,--keep-dirlinks}'[treat symlinked dir on receiver as dir]' \ + '(-p --perms -E --executability)'{-p,--perms}'[preserve permissions]' \ + {--no-p,--no-perms}'[turn off --perms]' \ + '(-E --executability)'{-E,--executability}'[preserve executability]' \ + '(-o --owner)'{-o,--owner}'[preserve owner]' \ + {--no-o,--no-owner}'[turn off --owner]' \ + '(-g --group)'{-g,--group}'[preserve group]' \ + {--no-g,--no-group}'[turn off --group]' \ + '(--devices --specials)-D[same as --devices --specials]' \ + '(-D)--devices[preserve devices]' \ + '--no-devices[turn off --devices]' \ + '(-D)--specials[preserve special files]' \ + '--no-specials[turn off --specials]' \ + '--no-D[turn off --devices and --specials]' \ + '(-t --times)'{-t,--times}'[preserve times]' \ + {--no-t,--no-times}'[turn off --times]' \ + '(-O --omit-dir-times)'{-O,--omit-dir-times}'[omit directories when preserving times]' \ + '--chmod[change destination permissions]:mods' \ + '(-S --sparse)'{-S,--sparse}'[handle sparse files efficiently]' \ + '(-n --dry-run)'{-n,--dry-run}'[show what would have been transferred]' \ + '(-W --whole-file)'{-W,--whole-file}'[copy files whole (without delta-transfer algorithm)]' \ + {--no-W,--no-whole-file}'[turn off --whole-file]' \ + '(-x --one-file-system)'{-x,--one-file-system}'[do not cross filesystem boundaries]' \ + '(-B --block-size)'{-B,--block-size=}'[force a fixed checksum block-size]:block size' \ + '(-e --rsh)'{-e+,--rsh=}'[specify the remote shell to use]:remote-shell command:(rsh ssh)' \ + '--rsync-path=[specify path to rsync on the remote machine]:remote command' \ + '--ignore-existing[ignore files that already exist on receiving side]' \ + '(--existing --ignore-non-existing)'{--existing,--ignore-non-existing}'[ignore files that do not exist on receiving side]' \ + '--remove-source-files[synchronized files are removed from sending side]' \ + '(--delete-before --delete-during --delete-after --delete-delay)--del[an alias for --delete-during]' \ + '--delete[delete files that do not exist on the sending side]' \ + '(--del --delete-during --delete-after --delete-delay)--delete-before[receiver deletes before transfer]' \ + '(--del --delete-before --delete-after --delete-delay)--delete-during[receiver deletes during transfer]' \ + '(--del --delete-before --delete-during --delete-delay)--delete-after[receiver deletes after transfer]' \ + '(--del --delete-before --delete-during --delete-after)--delete-delay[receiver deletes after transfer]' \ + '--delete-excluded[also delete excluded files on the receiving side]' \ + '--ignore-errors[delete even if there are I/O errors]' \ + '--force[force deletion of directories even if not empty]' \ + '--max-delete=[do not delete more than NUM files]:number' \ + '--max-size=[do not transfer any file larger than specified size]:number' \ + '--min-size=[do not transfer any file smaller than specified size]:number' \ + '(-P)--partial[keep partially transferred files]' \ + '--no-partial[turn off --partial]' \ + '--partial-dir=[put a partially transferred file into specified directory]:directory:_directories' \ + '--super[receiver attempts super-user activities]' \ + '--no-super[receiver performs normal-user activities]' \ + '--delay-updates[put all updated files into place at end of transfer]' \ + '(-m --prune-empty-dirs)'{-m,--prune-empty-dirs}'[prune empty directory chains from file-list]' \ + '--numeric-ids[do not map uid/gid values by user/group name]' \ + '--timeout=[set I/O timeout in seconds for lulls in a transfer]:seconds' \ + '--contimeout=[set connect timeout in seconds for daemon connections]:seconds' \ + '(-I --ignore-times)'{-I,--ignore-times}'[do not skip files that match in size and mod-time]' \ + '--size-only[skip files that match in size]' \ + '--modify-window=[compare mod-times with reduced accuracy]:seconds' \ + '(-y --fuzzy)'{-y,--fuzzy}'[find similar file for basis if no destination file]' \ + '(--copy-dest --link-dest)*--compare-dest=[also compare destination files relative to specified directory]:directory:_directories' \ + '(--compare-dest --link-dest)*--copy-dest=[like --compare-dest, but also includes copies of unchanged files]:directory:_directories' \ + '(--compare-dest --copy-dest)*--link-dest=[hardlink to files in specified directory hierarchy when unchanged]:directory:_directories' \ + '(-z --compress)'{-z,--compress}'[compress file data during the transfer]' \ + '--compress-level=[explicitly set compression level]:number' \ + '--skip-compress=[skip compressing files with a listed suffix]:suffixes' \ + '(-C --cvs-exclude)'{-C,--cvs-exclude}'[auto-ignore files the same way CVS does]' \ + '*'{-f=,--filter=}'[add a file-filtering rule]:rule' \ + '*-F[same as --filter="dir-merge /.rsync-filter", repeated: --filter="- .rsync-filter"]' \ + '--exclude-from=[read exclude patterns from specified file]:file:_files' \ + '*--exclude=[exclude files matching pattern]:pattern' \ + '--include-from=[read include patterns from specified file]:file:_files' \ + '*--include=[do not exclude files matching pattern]:pattern' \ + '--files-from=[read list of source-file names from specified file]:file:_files' \ + '(-0 --from0)'{-0,--from0}'[all *-from file lists are delimited by nulls]' \ + '(-s --protect-args)'{-s,--protect-args}'[no space-splitting; only wildcard special-chars]' \ + '--version[print version number]' \ + '*'{-h,--human-readable}'[output numbers in a human-readable format]' \ + '--blocking-io[use blocking I/O for the remote shell]' \ + '--no-blocking-io[turn off --blocking-io]' \ + '--stats[give some file-transfer stats]' \ + '(-8 --8-bit-output)'{-8,--8-bit-output}'[leave high-bit chars unescaped in output]' \ + '(-P)--progress[show progress during transfer]' \ + '--no-progress[turn off --progress]' \ + '(--partial --progress)-P[same as --partial --progress]' \ + '(-i --itemize-changes)'{-i,--itemize-changes}'[output a change-summary for all updates]' \ + '--log-format=[deprecated version of --out-format]' \ + '--out-format=[output updates using specified format]:format' \ + '--log-file-format=[log updates using specified format]:format' \ + '--log-file=[log what rsync is doing to the specified file]:file:_files' \ + '--password-file=[read daemon-access password from file]:file:_files' \ + '--list-only[list the files instead of copying them]' \ + '(--only-write-batch)--write-batch=[write a batched update to the specified file]:file:_files' \ + '(--write-batch)--only-write-batch=[like --write-batch but w/o updating destination]:file:_files' \ + '--protocol=[force an older protocol version to be used]:number' \ + '--iconv=[request charset conversion of filenames]:number' \ + '--read-batch=[read a batched update from the specified file]:file:_files' +} + +_rsync "$@" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_sh zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_sh --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_sh 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_sh 2011-10-02 01:10:11.000000000 +0000 @@ -5,7 +5,10 @@ if [[ ${words[CURRENT-1]} == -o ]]; then _options # no other possibilities - return + return 0 + fi + if _arguments -S -s -- '*:'; then + return 0 fi fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_ssh zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_ssh --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_ssh 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_ssh 2011-10-02 01:10:11.000000000 +0000 @@ -78,7 +78,7 @@ '(-x -X)-Y[enable trusted X11 forwarding]' \ '-M[master mode for connection sharing]' \ '-S+:path to control socket:_files' \ - '-O:multiplex control command:(check exit)' \ + '-O:multiplex control command:(check exit forward stop)' \ '*-L[specify local port forwarding]:local port forwarding:->forward' \ '*-R[specify remote port forwarding]:remote port forwarding:->forward' \ ':remote host name:->userhost' \ @@ -225,6 +225,9 @@ _description files expl 'path to control socket' _files "$expl[@]" && ret=0 ;; + *(#i)preferredauthentications*) + _values -s , 'authentication method' gssapi-with-mic \ + hostbased publickey keyboard-interactive password && ret=0 esac else _wanted values expl 'configure file option' \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_systemctl zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_systemctl --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_systemctl 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_systemctl 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,102 @@ +#compdef systemctl + +# Completion for systemd's systemctl +# Version 1.0 ARF 3 August 2011 + +# list the unit completions. +_systemd_units(){ + local -a units + local expl + units=(${(f)"$( systemctl --full list-units | sed -e 's/ .*//' )"}) + _wanted keys expl 'units' compadd "$units[@]" +} + +# list the job completions. +_systemd_jobs(){ + local -a jobs + local expl + jobs=(${(f)"$( systemctl --full list-jobs | sed -e 's/ .*//' )"}) + _wanted keys expl 'jobs' compadd "$jobs[@]" +} + +# list the snapshot completions. +_systemd_snapshots(){ + local -a ss + local expl + ss=(${(f)"$( + systemctl dump | sed -n -e 's/^-> Unit \(.*\.snapshot\):/\1/p' + )"}) + _wanted keys expl 'snapshots' compadd "$ss[@]" +} + +_systemctl(){ + local -a _systemctl_cmds + + # Determine the sub commands + #$(systemctl --help | sed -n -e 's/^ \([a-z]\)/\1/p' | sed -e 's/ .*//') + _systemctl_cmds=( + list-units start stop reload restart try-restart reload-or- + restart reload-or-try-restart isolate kill is-active status show + reset-failed enable disable is-enabled load list-jobs cancel + monitor dump dot snapshot delete daemon-reload daemon-reexec show- + environment set-environment unset-environment default rescue + emergency halt poweroff reboot kexec exit + ) + + local curcontext="$curcontext" state line expl + typeset -A opt_args + + # Initial flags + _arguments -A '-*' \ + '--help[Show help]' \ + '--version[Show package version]' \ + '(-a,--all)'{-a,--all}'[Show all units/properties, including dead/empty ones]' \ + '--full[Dont ellipsize unit names on output]' \ + '--failed[Show only failed units]' \ + '--fail[When queueing a new job, fail if conflicting jobs are pending]' \ + '--ignore-dependencies[ignore dependencies]' \ + '(-p,--privileged)'{-p,--privileged}'[Acquire privileges before execution]' \ + '(-q,--quiet)'{-q,--quiet}'[Suppress output]' \ + '--no-block[Do not wait until operation finished]' \ + '--no-wall[Dont send wall message before halt/power-off/reboot]' \ + '--no-reload[dont reload daemon configuration]' \ + '--no-pager[Do use pager]' \ + '--no-ask-password[Do not ask for system passwords]' \ + '--order[When generating graph for dot, show only order]' \ + '--require[When generating graph for dot, show only requirement]' \ + '--system[Connect to system manager]' \ + '--user[Connect to user service manager]' \ + '--global[Enable/disable unit files globally]' \ + '(-f,--force)'{-f,--force}'[When enabling unit files, override existing symlinks. When shutting down, execute action immediately]' \ + '--defaults[When disabling unit files, remove default symlinks only]' \ + '*::command:->subcmd' && return 0 + + # Complete subcommands. + if (( CURRENT == 1 )); then + _describe -t commands "command" _systemctl_cmds + return + fi + + # handle arguments to the subcommands. + case $words[1] in + start|restart|reload|stop|status|try-restart|reload-or-restart|reload-or-try-restart|isolate|kill|is-active|show|reset-failed|enable|disable|is-enabled|load) + # many units can be listed + _arguments "*:key:_systemd_units" + ;; + + cancel) _arguments "*:key:_systemd_jobs" ;; + + # snapshots + snapshot) _normal ;; + delete) _arguments "*:key:_systemd_snapshots" ;; + + # no arguments + dump|dot|monitor|daemon-reload|daemon-reexec|show-environment|default|rescue|emergency|halt|poweroff|reboot|kexec|exit|list-jobs|list-units) + ;; + + *) _message "unknown systemctl command: $words[1]" ;; + esac +} + +_systemctl "$@" + diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_tmux zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_tmux --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_tmux 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_tmux 2011-10-02 01:10:11.000000000 +0000 @@ -1520,6 +1520,10 @@ _describe -t subcommands 'tmux commands and aliases' _tmux_commands -- _tmux_aliases fi else + if (( ${+commands[tmux]} == 0 )); then + _message '`tmux'\'' not found in $path; sub-cmd completions disabled.' + return 0 + fi tmuxcommand="${words[1]}" if [[ -n ${_tmux_aliasmap[$tmuxcommand]} ]] ; then tmuxcommand="${_tmux_aliasmap[$tmuxcommand]}" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_tree zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_tree --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_tree 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_tree 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,51 @@ +#compdef tree + +# Completions for tree, version 1.5.3 +# Tree is available at +# http://mama.indstate.edu/users/ice/tree/ + +typeset -a opts + +opts=( +'--help[verbose usage listing]' +'--version[version of tree]' +'-a[show all files, including hidden ones]' +'-d[list directories only]' +'-f[print full path prefix for each file]' +'-i[do not print indentation lines]' +'-l[follow symlinks that point to directories]' +'-x[stay on current filesystem]' +'-P[list only files matching a pattern]:pattern:' +'-I[do not list files matching a pattern]:pattern:' +'--noreport[do not print file and directory report at end]' +'-p[print file type and permissions, like ls -l]' +'-s[print size of each file in bytes]' +'-h[print human readable file size]' +'-u[print username]' +'-g[print group name]' +'-D[print date of last modification]' +'--inodes[print inode numbers]' +'--device[print device number to which file or directory belongs]' +'-F[append descriptive character to end, like ls -F]' +'-q[print non-printable characters as question mark, not caret]' +'-N[print non-printable characters as is, not as caret]' +'-v[sort the output as version]' +'-r[sort output in reverse alphabetic order]' +'-t[sort output by last modification time instead of alphabetically]' +'--dirsfirst[list directories before files]' +'-n[turn colorization off always, over-ridden by the -C option]' +'-C[turn colorization on always]' +'-A[turn on ANSI line graphics hack when printing indentation lines]' +'-S[turn on ASCII line graphics]' +'-L[max display depth of tree]:level:' +'--filelimit[do not descend directories with more than number of entries]:number:' +'-R[recursively cross down the tree and execute tree again]' +'-H[turn on HTML output]' +'-T[title for HTML output]' +'--charset[character set for HTML and for line drawing]:charset:' +'--nolinks[turn off hyperlinks in HTML output]' +'-o[send output to file]:filename:_files' +'*:directory:_files -/' +) + +_arguments $opts diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_twidge zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_twidge --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_twidge 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_twidge 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,77 @@ +#compdef twidge +## completion for twidge 1.0.8, based on twidge(1) + +function _twidge_command { + typeset -a twidge_commands + typeset -i skip=1 + + twidge lscommands | while read cmd desc; do + if [[ $cmd == ---* ]] { + skip=0 + continue + } + if (( skip )) { + continue + } + twidge_commands+="${cmd}:${desc}" + done + + _describe command twidge_commands +} + +function _twidge_args { + typeset -a args_common args_more args_other args_update + + args_common=( + '(-a --all)'{-a,--all}'[receive all content]' + '(-e --exec)'{-e,--exec}'[execute command for each retrieved item]:command' + '(-l --long)'{-l,--long}'[long output format]' + '(-m --mailto)'{-m,--mailto}'[mail retrieved items]:mail address' + ) + + args_more=( + '(-s --saveid)'{-s,--saveid}'[save ID of most recent message]' + '(-u --unseen)'{-u,--unseen}'[only show unseen messages]' + ) + + args_other=( + '(-U --username)'{-U,--username}'[show updates of different user]:username' + ) + + args_update=( + '(-i --inreplyto)'{-i,--inreplyto}'[update in reply to a message]:message id' + '(-i --inreplyto 1)-r[read RFC2822 Mail]' + ':status' + ) + + case ${words[1]} in + lsarchive) + _arguments $args_common $args_more $args_other + ;; + ls(dm(|archive)|recent|replies|rt(|archive|replies))) + _arguments $args_common $args_more + ;; + lsfollow(ers|ing)) + _arguments $args_common :username + ;; + dmsend) + _arguments :recipient :status + ;; + (un|)follow) + _message username + ;; + update) + _arguments $args_update + ;; + esac +} + +function _twidge { + _arguments \ + '(-c --config)'{-c,--config}'[config file]:file:_files' \ + '(-d --debug)'{-d,--debug}'[enable debugging output]' \ + '(-): :_twidge_command' \ + '(-)*:: :_twidge_args' +} + +_twidge "$@" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_unison zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_unison --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_unison 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_unison 2011-10-02 01:10:11.000000000 +0000 @@ -42,7 +42,7 @@ '-copythreshold[use copyprog on files bigger than this]:size (kb):' \ '-debug:debug module:(all verbose)' \ '-diff[command for showing differences between files]:program:_files -g "*(-x)"' \ - '-dontchmod[When set, never use the chmod system call]' \ + '-dontchmod[when set, never use the chmod system call]' \ '-dumbtty[do not change terminal settings in text UI]' \ '-fastcheck:fast update detection:(true false default)' \ '-forcepartial[add a pattern to the forcepartial list]:pattern:' \ @@ -63,7 +63,7 @@ '-mountpoint[abort if this path does not exist]:mountpoint:_files -/' \ '-numericids[dont map uid/gid values by user/group names]' \ '-preferpartial[add a pattern to the preferpartial list]:pattern:' \ - '-pretendwin[Use creation times for detecting updates]' \ + '-pretendwin[use creation times for detecting updates]' \ '-repeat[synchronize repeatedly (text interface only)]:repeat:' \ '-retry[re-try failed synchronizations N times (text ui only)]:retry times:' \ '-rootalias[register alias for canonical root names]:root alias:' \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_vim zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_vim --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_vim 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_vim 2011-10-02 01:10:11.000000000 +0000 @@ -12,6 +12,9 @@ esac } +local curcontext="$curcontext" state line expl +typeset -A opt_args + local arguments arguments=( @@ -46,7 +49,7 @@ {-r,-L}'[list swap files and exit or recover from a swap file]::swap file:_vim_files -g \*.sw\?' '( -H -F)-A[start in Arabic mode]' '(-A -F)-H[start in Hebrew mode]' - '(-A -H )-H[start in Farsi mode]' + '(-A -H )-F[start in Farsi mode]' '-T[set terminal type]:::_terminals' '-u[use given vimrc file instead of default .vimrc]::rc file:_files' '-U[use given gvimrc file instead of default .gvimrc]::rc file:_files' @@ -54,7 +57,7 @@ '-o-[number of windows to open (default: one for each file)]::window count: ' '-O-[number of windows to vertically split open (default is one for each file)]::window count: ' '-p-[number of tabs to open (default: one for each file)]::tab count: ' - '-q-[quickfix file]:*:file:_vim_files' + '(* -t)-q-[quickfix file]:*:file:_vim_files' '*--cmd[execute given command before loading any RC files]:command: ' '-c[execute given command after loading the first file]:command: ' '-S[source a session file after loading the first file]:session file:_files' @@ -76,14 +79,22 @@ '--echo-wid[echo window ID on STDOUT, GUI version only]' '--literal[do not expand wildcards in arguments (this is useless with ZSH)]' '(- *)--serverlist[list available vim servers and exit]' - '--servername[name of vim server to send to or name of server to become]:server name: ' + '--servername[name of vim server to send to or name of server to become]:server name:->server' '--startuptime[write startup timing messages to given file]:log file:_files' '--socketid[run GVIM in another window]' '-i[use given viminfo file instead of default .viminfo]:viminfo file:_files' '(- *)'{-h,--help}'[print help and exit]' '(- *)--version[print version information and exit]' - '(*)-t[edit file where tag is defined]:tag:_complete_tag' - '(-t)*:file:_vim_files' + '(* -q)-t[edit file where tag is defined]:tag:_complete_tag' + '(-t -q)*:file:_vim_files' ) -_arguments -S $arguments +_arguments -C -S $arguments && return + +if [[ "$state" = server ]]; then + local -a servers + servers=( ${(f)"$(_call_program servers $words[1] --serverlist 2>/dev/null)"} ) + _wanted servers expl server compadd -M 'm:{a-z}={A-Z}' -a servers && return +fi + +return 1 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_wget zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_wget --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Command/_wget 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Command/_wget 2011-10-02 01:10:11.000000000 +0000 @@ -21,6 +21,7 @@ '--retry-connrefused[retry even if connection is refused]' \ '(--output-document -O)'{--output-document=,-O+}'[specify file to write documents to]:output file:_files' \ '(--continue -c)'{--continue,-c}'[continue getting an existing file]' \ + '--content-disposition[honor the Content-Disposition header when choosing local file names]' \ '--progress=[set progress gauge type]:gauge type:->gauge' \ '(--timestamping -N)'{--timestamping,-N}'[retrieve only files newer than existing]' \ '(--server-response -S)'{--server-response,-S}'[print server response]' \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_have_glob_qual zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_have_glob_qual --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_have_glob_qual 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_have_glob_qual 2011-10-02 01:10:11.000000000 +0000 @@ -16,9 +16,9 @@ [[ $2 = complete ]] && complete=")" [[ -z $compstate[quote] && - ( -o bareglobqual && + ( $_comp_caller_options[bareglobqual] == on && $1 = (#b)(((*[^\\\$]|)(\\\\)#)\()([^\)\|\~]#)$complete && ${#match[1]} -gt 1 || - -o extendedglob && + $_comp_caller_options[extendedglob] == on && $1 = (#b)(((*[^\\\$]|)(\\\\)#)"(#q")([^\)]#)$complete ) ]] diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_path_files zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_path_files --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_path_files 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_path_files 2011-10-02 01:10:11.000000000 +0000 @@ -16,7 +16,7 @@ # The later test looks for an outstanding quote. if _have_glob_qual $PREFIX; then compset -p ${#match[1]} - if [[ -o extendedglob ]] && compset -P '\#'; then + if [[ $_comp_caller_options[extendedglob] == on ]] && compset -P '\#'; then _globflags else _globquals @@ -438,8 +438,19 @@ tmp2=( "$tmp1[@]" ) - if [[ "$tpre$tsuf" = */* ]]; then - compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake + if [[ "$tpre$tsuf" = (#b)*/(*) ]]; then + + # We are going to be looping over the leading path segments. + # This means we should not apply special-dirs handling unless + # the path tail is a fake directory that needs to be simulated, + # and we should not apply pattern matching until we are looking + # for files rather than for intermediate directories. + + if [[ -n "$fake${match[1]}" ]]; then + compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake + else + compfiles -P$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" '' fake + fi elif [[ "$sopt" = *[/f]* ]]; then compfiles -p$cfopt tmp1 accex "$skipped" "$_matcher $matcher[2]" "$sdirs" fake "$pats[@]" else @@ -574,7 +585,7 @@ # slash be added. tmp1=( ${tmp1//(#b)([][()|*?^#~<>\\=])/\\${match[1]}} ) - tmp2="${(M)tpre##((.|..|)/)##}" + tmp2="${(M)tpre##${~skips}}" if [[ -n "$tmp2" ]]; then skipped="/$tmp2" tpre="${tpre#$tmp2}" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_pdf zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_pdf --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_pdf 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_pdf 2011-10-02 01:10:11.000000000 +0000 @@ -1,4 +1,4 @@ -#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf +#compdef pdf2dsc pdf2ps pdfimages pdfinfo pdftopbm pdftops pdftotext pdfopt pdffonts kpdf apvlv local expl ext='' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_perl_modules zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_perl_modules --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_perl_modules 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_perl_modules 2011-10-02 01:10:11.000000000 +0000 @@ -101,7 +101,7 @@ # Find all modules if [[ -d $libdir && -x $libdir ]]; then - new_pms=( $libdir/{[A-Z]*/***/,}*${~sufpat}~*blib* ) + new_pms=( $libdir/{[A-Za-z]*/***/,}*${~sufpat}~*blib* ) new_pms=( "${(@)new_pms##$libdir/##}" ) fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_pids zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_pids --- zsh-beta-4.3.11-dev-1+20110504/Completion/Unix/Type/_pids 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Unix/Type/_pids 2011-10-02 01:10:11.000000000 +0000 @@ -37,7 +37,7 @@ desc=() fi -_wanted processes expl 'process ID' \ +_wanted -V processes expl 'process ID' \ compadd "$@" "$desc[@]" "$all[@]" -a - pids && ret=0 if [[ -n "$all" ]]; then diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_matlab zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_matlab --- zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_matlab 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_matlab 2011-10-02 01:10:11.000000000 +0000 @@ -1,19 +1,19 @@ #compdef matlab _arguments : \ - {-h,-help}'[Display arguments.]' \ - '(-e)-n[Display final environment variables, and exit]' \ - '(-n)-e[Display ALL the environment variables and values, and exit]' \ - '-arch[Start MATLAB assuming architecture arch]:architecture:' \ - '-c[Set location of the license file]:licensefile:_files' \ + {-h,-help}'[display arguments]' \ + '(-e)-n[display final environment variables, and exit]' \ + '(-n)-e[display ALL the environment variables and values, and exit]' \ + '-arch[start MATLAB assuming architecture arch]:architecture:' \ + '-c[set location of the license file]:licensefile:_files' \ '(-nodisplay)-display:display:_x_display' \ - '(-display)-nodisplay[Do not display any X commands.]' \ - '-nosplash[Do not display the splash screen during startup.]' \ - '-mwvisual[The default X visual to use for figure windows.]:visualid:' \ - '-debug[Provide debugging information especially for X based problems.]' \ - '(-nodesktop -nojvm)-desktop[Allow the MATLAB desktop to be started by a process without a controlling terminal.]' \ - '(-desktop -nojvm)-nodesktop[Do not start the MATLAB desktop.]' \ - '(-nodesktop -desktop)-nojvm[Shut off all Java support by not starting the Java virtual machine.]' \ - '-r[Start MATLAB and execute the MATLAB_command.]:MATLAB_command:' \ - '-logfile[Make a copy of any output to the command window in file log.]:log file:' \ + '(-display)-nodisplay[do not display any X commands]' \ + '-nosplash[do not display the splash screen during startup]' \ + '-mwvisual[the default X visual to use for figure windows]:visualid:' \ + '-debug[provide debugging information especially for X based problems]' \ + '(-nodesktop -nojvm)-desktop[allow the MATLAB desktop to be started by a process without a controlling terminal]' \ + '(-desktop -nojvm)-nodesktop[do not start the MATLAB desktop]' \ + '(-nodesktop -desktop)-nojvm[shut off all Java support by not starting the Java virtual machine]' \ + '-r[start MATLAB and execute the MATLAB_command]:MATLAB_command:' \ + '-logfile[make a copy of any output to the command window in file log]:log file:' \ '-D-:debugger:_path_commands' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_mplayer zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_mplayer --- zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_mplayer 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_mplayer 2011-10-02 01:10:11.000000000 +0000 @@ -77,7 +77,7 @@ '-sid[turn on DVD subtitles]:language id' \ '-speed[set playback speed rate]:playback speed rate' \ '-srate[specify frequency of audio playback]:frequency (Hz)' \ - '-ss[seek to given time position]:position (hh:mm\[\:ss\])' \ + '-ss[seek to given time position]:position ([[hh\:]mm\:]ss[.sss])' \ '-sstep[specify time between displayed frames]:time (seconds)' \ -ssf:mode -stop_xscreensaver \ '-stereo:mode:((0\:stereo 1\:left\ channel 2\:right\ channel))' \ @@ -108,14 +108,14 @@ '-z[specify compression level for png output]:compression-level:((0\:no\ compression 1 2 3 4 5 6\:default\ compression 7 8 9\:max\ compression))' \ '-zoom[use software scaling, where available (use with -nofs)]' \ -zrbw -zrcrop -zrdev -zrfd -zrhelp -zrnorm -zrquality -zr{h,v}dec -zr{x,y}doff \ - '(-use-stdin)*:video file:->mfiles' + '(-use-stdin)*:video file:->mfiles' && ret=0 case "$state" in mfiles) _tags files urls while _tags; do _requested files expl 'video file' _files -g \ - "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|wma|wmv)(-.)" && ret=0 + "*.(#i)(asf|asx|avi|flac|flv|m1v|m2p|m2v|m4v|mjpg|mka|mkv|mov|mp3|mp4|mpe|mpeg|mpg|ogg|ogm|qt|rm|vob|wav|webm|wma|wmv)(-.)" && ret=0 if _requested urls; then while _next_label urls expl URL; do _urls "$expl[@]" && ret=0 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_okular zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_okular --- zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_okular 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_okular 2011-10-02 01:10:11.000000000 +0000 @@ -4,7 +4,7 @@ extns="{pdf,ps,eps,dvi}(.gz|.bz2)(#c,1)|djvu|tiff|chm|cbr|cbz" _arguments \ - '(-p --page)'{-p,--page}'[Page of the document to be shown]:page: ' \ - '--presentation[Start the document in presentation mode]' \ - '--unique[Unique instance control]' \ + '(-p --page)'{-p,--page}'[page of the document to be shown]:page: ' \ + '--presentation[start the document in presentation mode]' \ + '--unique[unique instance control]' \ "*:Okular documents:_files -g '*.(#i)($extns)(-.)'" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_xset zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_xset --- zsh-beta-4.3.11-dev-1+20110504/Completion/X/Command/_xset 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/X/Command/_xset 2011-10-02 01:10:11.000000000 +0000 @@ -27,8 +27,8 @@ tmp=("$tmp[@]" "$opt") fi done - _describe -o options tmp -- || - _describe -o options allopts -- + _describe -O options tmp -- || + _describe -O options allopts -- } _xset_compfpadd () { diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Command/_zattr zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Command/_zattr --- zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Command/_zattr 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Command/_zattr 2011-10-02 01:10:11.000000000 +0000 @@ -26,9 +26,9 @@ '1:file:_files' \ '2:parameter' ;; -esac +esac && ret=0 if [[ $state = attrs ]]; then - zlistattr $~line[1] REPLY 2> /dev/null + zlistattr ${~${(Q)line[1]}} REPLY 2> /dev/null _wanted attrs expl 'attribute' compadd $REPLY fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Context/_brace_parameter zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Context/_brace_parameter --- zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Context/_brace_parameter 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Context/_brace_parameter 2011-10-02 01:10:11.000000000 +0000 @@ -1,3 +1,190 @@ #compdef -brace-parameter- +local char delim found_percent found_m exp +local -a flags +integer q_last n_q + +if [[ $PREFIX = *'${('[^\)]# ]]; then + # Parameter flags. + compset -p 3 + + # Based on code in _globquals. + while [[ -n $PREFIX ]]; do + char=$PREFIX[1] + compset -p 1 + if [[ $char = q ]]; then + (( q_last++, n_q++ )) + continue + else + (( q_last = 0 )) + fi + # Skip arguments to find what's left to complete + case $char in + (%) + found_percent=1 + ;; + + (m) + found_m=1 + ;; + + ([gIjsZ_]) + # Single delimited argument. + if [[ -z $PREFIX ]]; then + _delimiters qualifer-$char + return + elif ! _globqual_delims; then + # still completing argument + case $char in + (g) + compset -P '*' + flags=('o:octal escapes' 'c:expand ^X etc.' 'e:expand \M-t etc.') + _describe -t format 'format option' flags -Q -S '' + ;; + + (I) + _message 'integer expression' + ;; + + (js) + _message "separator" + ;; + + (Z) + compset -P '*' + flags=( + 'c:parse comments as strings (else as ordinary words)' + 'C:strip comments (else treat as ordinary words)' + 'n:treat newlines as whitespace' + ) + _describe -t format 'format option' flags -Q -S '' + ;; + + (_) + _message "no useful values" + ;; + esac + return + fi + ;; + + ([lr]) + # One compulsory argument, two optional. + if [[ -z $PREFIX ]]; then + _delimiters qualifer-$char + return + else + delim=$PREFIX[1] + if ! _globqual_delims; then + # still completing argument + _message "padding width" + return + fi + # TBD if $PREFIX is empty can complete + # either repeat delimiter or a new qualifier. + # You might think it would just be easier + # for the user to type the delimiter at + # this stage, but users are astonishingly lazy. + if [[ $delim = $PREFIX[1] ]]; then + # second argument + if ! _globqual_delims; then + _message "repeated padding" + return + fi + if [[ $delim = $PREFIX[1] ]]; then + if ! _globqual_delims; then + _message "one-off padding" + return + fi + fi + fi + fi + ;; + esac + done + + if [[ -z $found_percent ]]; then + flags=("%:Expand prompt sequences") + else + flags=("%:Expand prompts respecting options") + fi + case $q_last in + (0) + if (( n_q == 0 )); then + flags+=("q:quote with backslashes") + fi + ;; + + (1) + flags+=( + "q:quote with single quotes" + "-:quote minimally for readability" + ) + ;; + + (2) + flags+=("q:quote with double quotes") + ;; + + (3) + flags+=("q:quote with \$'...'") + ;; + esac + if (( !n_q )); then + flags+=("Q:remove one level of quoting") + fi + if [[ -z $found_m ]]; then + flags+=("m:Count multibyte width in padding calculation") + else + flags+=("m:Count number of character code points in padding calculation") + fi + flags+=( + "#:Evaluate as numeric expression" + "@:Double-quoted splitting of scalars" + "A:Create array parameter" + "a:Sort in array index order (with O to reverse)" + "c:Count characters in an array (with \${(c)#...})" + "C:Capitalize words" + "D:Perform directory name abbreviation" + "e:Perform single-word shell expansions" + "f:Split the result on newlines" + "F:Join arrays with newlines" + "g:Process echo array sequences (needs options)" + "i:Sort case-insensitively" + "k:Subsitute keys of associative arrays" + "L:Lower case all letters" + "n:Sort decimal integers numerically" + "o:Sort in ascending order (lexically if no other sort option)" + "O:Sort in descending order (lexically if no other sort option)" + "P:Use parameter value as name of parameter for redirected lookup" + "t:Substitute type of parameter" + "u:Substitute first occurrence of each unique word" + "U:Upper case all letters" + "v:Substitute values of associative arrays (with (k))" + "V:Visibility enhancements for special characters" + "w:Count words in array or string (with \${(w)#...})" + "W:Count words including empty words (with \${(W)#...})" + "X:Report parsing errors and eXit substitution" + "z:Split words as if zsh command line" + "0:Split words on null bytes" + "p:Handle print escapes in parameter flag arguments" + "~:Treat strings in parameter flag arguments as patterns" + "j:Join arrays with specified string" + "l:Left-pad resulting words" + "r:Right-pad resulting words" + "s:Split words on specified string" + "Z:Split words as if zsh command line (with options)" + # "_:Extended flags, for future expansion" + "S:Search substrings in #, %, / expressions" + "I:Search th match in #, %, / expressions" + "B:Include index of beginning of match in #, %, / expressions" + "E:Include index of end of match in #, %, / expressions" + "M:Include matched portion in #, %, / expressions" + "N:Include length of match in #, %, expressions" + "R:Include rest (unmatched portion) in #, %, / expressions" + ) + _describe -t flags "parameter flag" flags -Q -S '' + return +fi + _parameters -e diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Context/_subscript zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Context/_subscript --- zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Context/_subscript 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Context/_subscript 2011-10-02 01:10:11.000000000 +0000 @@ -18,7 +18,7 @@ # or colon list. integer pos=$((CURSOR+1)) while [[ pos -gt 1 && $BUFFER[pos-1] != '[' ]]; do (( pos-- )); done -if [[ $BUFFER[1,pos-1] = *[[:space:]:=]##\~\[ ]]; then +if [[ $BUFFER[1,pos-1] = (|*[[:space:]:=]##)\~\[ ]]; then _dynamic_directory_name elif [[ "$PREFIX" = :* ]]; then _wanted characters expl 'character class' \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Function/_zargs zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Function/_zargs --- zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Function/_zargs 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Function/_zargs 2011-10-02 01:10:11.000000000 +0000 @@ -4,19 +4,19 @@ local arguments arguments=( $arguments[@] - '(--eof -e)'{--eof=,-e+}'[Change the end-of-input-args string from "--" to eof-str]' - '(--exit, -x)'{--exit,-x}'[Exit if the size (see --max-chars) is exceeded]' - '--help[Print summary and exit]' - '(--interactive, -p)'{--interactive,-p}'[Prompt before executing each command line]' - '(--max-args, -n)'{--max-args=,-n+}'[Use at most max-args arguments per command line]' - '(--max-chars, -s)'{--max-chars=,-s+}'[Use at most max-chars characters per command line]' - '(--max-lines, -l)'{--max-lines=,-l+}'[Use at most max-lines of the input-args per command line]' - '(--max-procs, -P)'{--max-procs=,-P+}'[Run up to max-procs command lines in the background at once]' - '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[Do nothing if there are no input arguments before the eof-str]' - '(--null, -0)'{--null,-0}'[Split each input-arg at null bytes, for xargs compatibility]' - '(--replace, -i)'{--replace=,-i}'[Substitute replace-str in the initial-args by each initial-arg]' - '(--verbose, -t)'{--verbose,-t}'[Print each command line to stderr before executing it]' - '--version[Print the version number of zargs and exit]' + '(--eof -e)'{--eof=,-e+}'[change the end-of-input-args string from "--" to eof-str]' + '(--exit, -x)'{--exit,-x}'[exit if the size (see --max-chars) is exceeded]' + '--help[print summary and exit]' + '(--interactive, -p)'{--interactive,-p}'[prompt before executing each command line]' + '(--max-args, -n)'{--max-args=,-n+}'[use at most max-args arguments per command line]' + '(--max-chars, -s)'{--max-chars=,-s+}'[use at most max-chars characters per command line]' + '(--max-lines, -l)'{--max-lines=,-l+}'[use at most max-lines of the input-args per command line]' + '(--max-procs, -P)'{--max-procs=,-P+}'[run up to max-procs command lines in the background at once]' + '(--no-run-if-empty, -r)'{--no-run-if-empty,-r}'[do nothing if there are no input arguments before the eof-str]' + '(--null, -0)'{--null,-0}'[split each input-arg at null bytes, for xargs compatibility]' + '(--replace, -i)'{--replace=,-i}'[substitute replace-str in the initial-args by each initial-arg]' + '(--verbose, -t)'{--verbose,-t}'[print each command line to stderr before executing it]' + '--version[print the version number of zargs and exit]' ) _arguments -S -s $arguments[@] diff -Nru zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Type/_file_descriptors zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Type/_file_descriptors --- zsh-beta-4.3.11-dev-1+20110504/Completion/Zsh/Type/_file_descriptors 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Completion/Zsh/Type/_file_descriptors 2011-10-02 01:10:11.000000000 +0000 @@ -13,7 +13,9 @@ list+=( "$i $sep ${link[1]}" ) done elif (( $+commands[readlink] )); then - for i in "${fds[@]}"; list+=( "$i $sep $(readlink /proc/$$/fd/$i)" ) + for i in "${fds[@]}"; do + list+=( "$i $sep $(readlink /proc/$$/fd/$i)" ) + done else for i in "${fds[@]}"; do list+=( "$i $sep $(ls -l /proc/$$/fd/$i|sed 's/.*-> //' )" ) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Config/version.mk zsh-beta-4.3.12-dev-1+20110925/Config/version.mk --- zsh-beta-4.3.11-dev-1+20110504/Config/version.mk 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Config/version.mk 2011-10-02 01:10:11.000000000 +0000 @@ -27,5 +27,5 @@ # This must also serve as a shell script, so do not add spaces around the # `=' signs. -VERSION=4.3.11-dev-2 -VERSION_DATE='April 19, 2011' +VERSION=4.3.12-dev-1 +VERSION_DATE='June 20, 2011' diff -Nru zsh-beta-4.3.11-dev-1+20110504/configure.ac zsh-beta-4.3.12-dev-1+20110925/configure.ac --- zsh-beta-4.3.11-dev-1+20110504/configure.ac 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/configure.ac 2011-10-02 01:10:11.000000000 +0000 @@ -105,6 +105,18 @@ AC_DEFINE(ZSH_SECURE_FREE) fi]) +dnl Do you want to debug zsh heap allocation? +dnl Does not depend on zsh-mem. +ifdef([zsh-heap-debug],[undefine([zsh-heap-debug])])dnl +AH_TEMPLATE([ZSH_HEAP_DEBUG], +[Define to 1 if you want to turn on error checking for heap allocation.]) +AC_ARG_ENABLE(zsh-heap-debug, +AC_HELP_STRING([--enable-zsh-heap-debug], +[turn on error checking for heap allocation]), +[if test x$enableval = xyes; then + AC_DEFINE(ZSH_HEAP_DEBUG) +fi]) + dnl Do you want debugging information on internal hash tables. dnl This turns on the `hashinfo' builtin command. ifdef([zsh-hash-debug],[undefine([zsh-hash-debug])])dnl @@ -681,6 +693,8 @@ AC_CHECK_LIB(m, pow) +AC_CHECK_LIB(rt, clock_gettime) + dnl Various features of ncurses depend on having the right header dnl (the system's own curses.h may well not be good enough). dnl So don't search for ncurses unless we found the header. @@ -1158,7 +1172,7 @@ dnl AC_FUNC_STRFTIME AC_CHECK_FUNCS(strftime strptime mktime timelocal \ - difftime gettimeofday \ + difftime gettimeofday clock_gettime \ select poll \ readlink faccessx fchdir ftruncate \ fstat lstat lchown fchown fchmod \ diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/changelog zsh-beta-4.3.12-dev-1+20110925/debian/changelog --- zsh-beta-4.3.11-dev-1+20110504/debian/changelog 2011-05-16 14:58:28.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/changelog 2011-11-20 18:42:55.000000000 +0000 @@ -1,3 +1,81 @@ +zsh-beta (4.3.12-dev-1+20110925-1ubuntu1) precise; urgency=low + + * Manual merge from debian testing. (due to MoM not being updated). + Remaining changes: + - Add "add-shell /bin/zsh" because zsh-beta is already registered + as an alternative to zsh, and this is needed to be able to have + zsh-beta as the only installed zsh. + - Don't set PATH in zshenv any more. + + -- Bhavani Shankar Mon, 16 May 2011 20:28:06 +0530 + +zsh-beta (4.3.12-dev-1+20110925-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Mon, 10 Oct 2011 22:50:54 -0400 + +zsh-beta (4.3.12-dev-1+20110922-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Fri, 23 Sep 2011 23:44:37 -0400 + +zsh-beta (4.3.12-dev-1+20110830-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Mon, 05 Sep 2011 12:57:19 -0400 + +zsh-beta (4.3.12-dev-1+20110820-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Thu, 25 Aug 2011 21:57:22 -0400 + +zsh-beta (4.3.12-dev-1+20110729-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Tue, 02 Aug 2011 17:58:47 -0400 + +zsh-beta (4.3.12-dev-1+20110704-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Fri, 08 Jul 2011 10:27:18 -0400 + +zsh-beta (4.3.12-dev-1+20110623-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Thu, 23 Jun 2011 22:18:03 -0400 + +zsh-beta (4.3.12-dev-0+20110608-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Thu, 09 Jun 2011 21:19:27 -0400 + +zsh-beta (4.3.12-dev-0+20110604-1) unstable; urgency=medium + + * Update to HEAD. + + -- Clint Adams Sun, 05 Jun 2011 01:18:30 -0400 + +zsh-beta (4.3.11-dev-4+20110529-1) unstable; urgency=low + + * Update to HEAD. + * Bump to Standards-Version 3.9.2. + + -- Clint Adams Mon, 30 May 2011 10:37:38 -0400 + +zsh-beta (4.3.11-dev-2+20110517-1) unstable; urgency=low + + * Update to HEAD. + + -- Clint Adams Tue, 17 May 2011 15:20:45 -0400 + zsh-beta (4.3.11-dev-1+20110504-1ubuntu1) oneiric; urgency=low * Manual merge from debian unstable (due to MoM not being updated). diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/control zsh-beta-4.3.12-dev-1+20110925/debian/control --- zsh-beta-4.3.11-dev-1+20110504/debian/control 2011-05-16 14:50:15.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/control 2011-11-20 18:44:47.000000000 +0000 @@ -4,7 +4,7 @@ Build-Depends: yodl, texinfo, groff-base, bsdmainutils, libncursesw5-dev, texi2html (>= 1.76-2), libcap-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libpcre3-dev, libgdbm-dev Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Clint Adams -Standards-Version: 3.9.1 +Standards-Version: 3.9.2 Package: zsh-beta Architecture: any diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/patches/debian-changes-4.3.11-dev-1+20110504-1 zsh-beta-4.3.12-dev-1+20110925/debian/patches/debian-changes-4.3.11-dev-1+20110504-1 --- zsh-beta-4.3.11-dev-1+20110504/debian/patches/debian-changes-4.3.11-dev-1+20110504-1 2011-05-05 23:39:14.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/patches/debian-changes-4.3.11-dev-1+20110504-1 1970-01-01 00:00:00.000000000 +0000 @@ -1,82490 +0,0 @@ -Description: Upstream changes introduced in version 4.3.11-dev-1+20110504-1 - This patch has been created by dpkg-source during the package build. - Here's the last changelog entry, hopefully it gives details on why - those changes were made: - . - zsh-beta (4.3.11-dev-1+20110504-1) unstable; urgency=low - . - * Update to HEAD. - . - The person named in the Author field signed this changelog entry. -Author: Clint Adams - ---- -The information above should follow the Patch Tagging Guidelines, please -checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here -are templates for supplementary fields that you might want to add: - -Origin: , -Bug: -Bug-Debian: http://bugs.debian.org/ -Bug-Ubuntu: https://launchpad.net/bugs/ -Forwarded: -Reviewed-By: -Last-Update: - ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/configure -@@ -0,0 +1,14101 @@ -+#! /bin/sh -+# Guess values for system-dependent variables and create Makefiles. -+# Generated by GNU Autoconf 2.68. -+# -+# -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -+# Foundation, Inc. -+# -+# -+# This configure script is free software; the Free Software Foundation -+# gives unlimited permission to copy, distribute and modify it. -+## -------------------- ## -+## M4sh Initialization. ## -+## -------------------- ## -+ -+# Be more Bourne compatible -+DUALCASE=1; export DUALCASE # for MKS sh -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+ setopt NO_GLOB_SUBST -+else -+ case `(set -o) 2>/dev/null` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+ -+ -+as_nl=' -+' -+export as_nl -+# Printing a long string crashes Solaris 7 /usr/bin/printf. -+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -+# Prefer a ksh shell builtin over an external printf program on Solaris, -+# but without wasting forks for bash or zsh. -+if test -z "$BASH_VERSION$ZSH_VERSION" \ -+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='print -r --' -+ as_echo_n='print -rn --' -+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='printf %s\n' -+ as_echo_n='printf %s' -+else -+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then -+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' -+ as_echo_n='/usr/ucb/echo -n' -+ else -+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' -+ as_echo_n_body='eval -+ arg=$1; -+ case $arg in #( -+ *"$as_nl"*) -+ expr "X$arg" : "X\\(.*\\)$as_nl"; -+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; -+ esac; -+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" -+ ' -+ export as_echo_n_body -+ as_echo_n='sh -c $as_echo_n_body as_echo' -+ fi -+ export as_echo_body -+ as_echo='sh -c $as_echo_body as_echo' -+fi -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ PATH_SEPARATOR=: -+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { -+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || -+ PATH_SEPARATOR=';' -+ } -+fi -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. Quoting is -+# there to prevent editors from complaining about space-tab. -+# (If _AS_PATH_WALK were called with IFS unset, it would disable word -+# splitting by setting IFS to empty value.) -+IFS=" "" $as_nl" -+ -+# Find who we are. Look in the path if we contain no directory separator. -+as_myself= -+case $0 in #(( -+ *[\\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+# We did not find ourselves, most probably we were run as `sh COMMAND' -+# in which case we are not to be found in the path. -+if test "x$as_myself" = x; then -+ as_myself=$0 -+fi -+if test ! -f "$as_myself"; then -+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 -+ exit 1 -+fi -+ -+# Unset variables that we do not need and which cause bugs (e.g. in -+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -+# suppresses any "Segmentation fault" message there. '((' could -+# trigger a bug in pdksh 5.2.14. -+for as_var in BASH_ENV ENV MAIL MAILPATH -+do eval test x\${$as_var+set} = xset \ -+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -+done -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+LC_ALL=C -+export LC_ALL -+LANGUAGE=C -+export LANGUAGE -+ -+# CDPATH. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+if test "x$CONFIG_SHELL" = x; then -+ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '\${1+\"\$@\"}'='\"\$@\"' -+ setopt NO_GLOB_SUBST -+else -+ case \`(set -o) 2>/dev/null\` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+" -+ as_required="as_fn_return () { (exit \$1); } -+as_fn_success () { as_fn_return 0; } -+as_fn_failure () { as_fn_return 1; } -+as_fn_ret_success () { return 0; } -+as_fn_ret_failure () { return 1; } -+ -+exitcode=0 -+as_fn_success || { exitcode=1; echo as_fn_success failed.; } -+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : -+ -+else -+ exitcode=1; echo positional parameters were not saved. -+fi -+test x\$exitcode = x0 || exit 1" -+ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO -+ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO -+ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && -+ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 -+test \$(( 1 + 1 )) = 2 || exit 1" -+ if (eval "$as_required") 2>/dev/null; then : -+ as_have_required=yes -+else -+ as_have_required=no -+fi -+ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : -+ -+else -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+as_found=false -+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ as_found=: -+ case $as_dir in #( -+ /*) -+ for as_base in sh bash ksh sh5; do -+ # Try only shells that exist, to save several forks. -+ as_shell=$as_dir/$as_base -+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && -+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : -+ CONFIG_SHELL=$as_shell as_have_required=yes -+ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : -+ break 2 -+fi -+fi -+ done;; -+ esac -+ as_found=false -+done -+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && -+ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : -+ CONFIG_SHELL=$SHELL as_have_required=yes -+fi; } -+IFS=$as_save_IFS -+ -+ -+ if test "x$CONFIG_SHELL" != x; then : -+ # We cannot yet assume a decent shell, so we have to provide a -+ # neutralization value for shells without unset; and this also -+ # works around shells that cannot unset nonexistent variables. -+ # Preserve -v and -x to the replacement shell. -+ BASH_ENV=/dev/null -+ ENV=/dev/null -+ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV -+ export CONFIG_SHELL -+ case $- in # (((( -+ *v*x* | *x*v* ) as_opts=-vx ;; -+ *v* ) as_opts=-v ;; -+ *x* ) as_opts=-x ;; -+ * ) as_opts= ;; -+ esac -+ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} -+fi -+ -+ if test x$as_have_required = xno; then : -+ $as_echo "$0: This script requires a shell more modern than all" -+ $as_echo "$0: the shells that I found on your system." -+ if test x${ZSH_VERSION+set} = xset ; then -+ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" -+ $as_echo "$0: be upgraded to zsh 4.3.4 or later." -+ else -+ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, -+$0: including any error possibly output before this -+$0: message. Then install a modern shell, or manually run -+$0: the script under such a shell if you do have one." -+ fi -+ exit 1 -+fi -+fi -+fi -+SHELL=${CONFIG_SHELL-/bin/sh} -+export SHELL -+# Unset more variables known to interfere with behavior of common tools. -+CLICOLOR_FORCE= GREP_OPTIONS= -+unset CLICOLOR_FORCE GREP_OPTIONS -+ -+## --------------------- ## -+## M4sh Shell Functions. ## -+## --------------------- ## -+# as_fn_unset VAR -+# --------------- -+# Portably unset VAR. -+as_fn_unset () -+{ -+ { eval $1=; unset $1;} -+} -+as_unset=as_fn_unset -+ -+# as_fn_set_status STATUS -+# ----------------------- -+# Set $? to STATUS, without forking. -+as_fn_set_status () -+{ -+ return $1 -+} # as_fn_set_status -+ -+# as_fn_exit STATUS -+# ----------------- -+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -+as_fn_exit () -+{ -+ set +e -+ as_fn_set_status $1 -+ exit $1 -+} # as_fn_exit -+ -+# as_fn_mkdir_p -+# ------------- -+# Create "$as_dir" as a directory, including parents if necessary. -+as_fn_mkdir_p () -+{ -+ -+ case $as_dir in #( -+ -*) as_dir=./$as_dir;; -+ esac -+ test -d "$as_dir" || eval $as_mkdir_p || { -+ as_dirs= -+ while :; do -+ case $as_dir in #( -+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( -+ *) as_qdir=$as_dir;; -+ esac -+ as_dirs="'$as_qdir' $as_dirs" -+ as_dir=`$as_dirname -- "$as_dir" || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ test -d "$as_dir" && break -+ done -+ test -z "$as_dirs" || eval "mkdir $as_dirs" -+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ -+ -+} # as_fn_mkdir_p -+# as_fn_append VAR VALUE -+# ---------------------- -+# Append the text in VALUE to the end of the definition contained in VAR. Take -+# advantage of any shell optimizations that allow amortized linear growth over -+# repeated appends, instead of the typical quadratic growth present in naive -+# implementations. -+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : -+ eval 'as_fn_append () -+ { -+ eval $1+=\$2 -+ }' -+else -+ as_fn_append () -+ { -+ eval $1=\$$1\$2 -+ } -+fi # as_fn_append -+ -+# as_fn_arith ARG... -+# ------------------ -+# Perform arithmetic evaluation on the ARGs, and store the result in the -+# global $as_val. Take advantage of shells that can avoid forks. The arguments -+# must be portable across $(()) and expr. -+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : -+ eval 'as_fn_arith () -+ { -+ as_val=$(( $* )) -+ }' -+else -+ as_fn_arith () -+ { -+ as_val=`expr "$@" || test $? -eq 1` -+ } -+fi # as_fn_arith -+ -+ -+# as_fn_error STATUS ERROR [LINENO LOG_FD] -+# ---------------------------------------- -+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -+# script with STATUS, using 1 if that was 0. -+as_fn_error () -+{ -+ as_status=$1; test $as_status -eq 0 && as_status=1 -+ if test "$4"; then -+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ fi -+ $as_echo "$as_me: error: $2" >&2 -+ as_fn_exit $as_status -+} # as_fn_error -+ -+if expr a : '\(a\)' >/dev/null 2>&1 && -+ test "X`expr 00001 : '.*\(...\)'`" = X001; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then -+ as_dirname=dirname -+else -+ as_dirname=false -+fi -+ -+as_me=`$as_basename -- "$0" || -+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X/"$0" | -+ sed '/^.*\/\([^/][^/]*\)\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+ -+ as_lineno_1=$LINENO as_lineno_1a=$LINENO -+ as_lineno_2=$LINENO as_lineno_2a=$LINENO -+ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && -+ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { -+ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) -+ sed -n ' -+ p -+ /[$]LINENO/= -+ ' <$as_myself | -+ sed ' -+ s/[$]LINENO.*/&-/ -+ t lineno -+ b -+ :lineno -+ N -+ :loop -+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ -+ t loop -+ s/-\n.*// -+ ' >$as_me.lineno && -+ chmod +x "$as_me.lineno" || -+ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } -+ -+ # Don't try to exec as it changes $[0], causing all sort of problems -+ # (the dirname of $[0] is not the place where we might find the -+ # original and so on. Autoconf is especially sensitive to this). -+ . "./$as_me.lineno" -+ # Exit status is that of the last command. -+ exit -+} -+ -+ECHO_C= ECHO_N= ECHO_T= -+case `echo -n x` in #((((( -+-n*) -+ case `echo 'xy\c'` in -+ *c*) ECHO_T=' ';; # ECHO_T is single tab character. -+ xy) ECHO_C='\c';; -+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null -+ ECHO_T=' ';; -+ esac;; -+*) -+ ECHO_N='-n';; -+esac -+ -+rm -f conf$$ conf$$.exe conf$$.file -+if test -d conf$$.dir; then -+ rm -f conf$$.dir/conf$$.file -+else -+ rm -f conf$$.dir -+ mkdir conf$$.dir 2>/dev/null -+fi -+if (echo >conf$$.file) 2>/dev/null; then -+ if ln -s conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s='ln -s' -+ # ... but there are two gotchas: -+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. -+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -+ # In both cases, we have to default to `cp -p'. -+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -+ as_ln_s='cp -p' -+ elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+ else -+ as_ln_s='cp -p' -+ fi -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -+rmdir conf$$.dir 2>/dev/null -+ -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p='mkdir -p "$as_dir"' -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x -+ -+# Sed expression to map a string onto a valid CPP name. -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -+ -+# Sed expression to map a string onto a valid variable name. -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+test -n "$DJDIR" || exec 7<&0 &1 -+ -+# Name of the host. -+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -+# so uname gets run too. -+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -+ -+# -+# Initializations. -+# -+ac_default_prefix=/usr/local -+ac_clean_files= -+ac_config_libobj_dir=. -+LIBOBJS= -+cross_compiling=no -+subdirs= -+MFLAGS= -+MAKEFLAGS= -+ -+# Identity of this package. -+PACKAGE_NAME= -+PACKAGE_TARNAME= -+PACKAGE_VERSION= -+PACKAGE_STRING= -+PACKAGE_BUGREPORT= -+PACKAGE_URL= -+ -+ac_unique_file="Src/zsh.h" -+# Factoring default headers for most tests. -+ac_includes_default="\ -+#include -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_SYS_STAT_H -+# include -+#endif -+#ifdef STDC_HEADERS -+# include -+# include -+#else -+# ifdef HAVE_STDLIB_H -+# include -+# endif -+#endif -+#ifdef HAVE_STRING_H -+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -+# include -+# endif -+# include -+#endif -+#ifdef HAVE_STRINGS_H -+# include -+#endif -+#ifdef HAVE_INTTYPES_H -+# include -+#endif -+#ifdef HAVE_STDINT_H -+# include -+#endif -+#ifdef HAVE_UNISTD_H -+# include -+#endif" -+ -+ac_header_list= -+ac_subst_vars='LTLIBOBJS -+LIBOBJS -+EXTRAZSHOBJS -+MOD_IMPORT_FUNCTION -+MOD_IMPORT_VARIABLE -+MOD_EXPORT -+LINKMODS -+L -+IMPOPT -+EXPOPT -+EXTRA_LDFLAGS -+E -+DLLDFLAGS -+DLCFLAGS -+DLLD -+DL_EXT -+D -+UNINSTLIB -+INSTLIB -+SHORTBOOTNAMES -+RLIMITS_INC_H -+ZSH_TERM_H -+CURSES_KEYS_H -+ZSH_CURSES_H -+ERRNO_H -+SIGNAL_H -+PCRECONF -+ANSI2KNR -+TEXI2HTML -+TEXI2PDF -+PDFETEX -+YODL_OPTIONS -+YODL -+LN -+AWK -+INSTALL_DATA -+INSTALL_SCRIPT -+INSTALL_PROGRAM -+SET_MAKE -+ALLOCA -+U -+EGREP -+GREP -+CPP -+LIBLDFLAGS -+EXELDFLAGS -+OBJEXT -+EXEEXT -+ac_ct_CC -+CPPFLAGS -+LDFLAGS -+CFLAGS -+CC -+sitescriptdir -+scriptdir -+FUNCTIONS_SUBDIRS -+sitefndir -+fndir -+additionalfpath -+zlogout -+zlogin -+zprofile -+zshrc -+zshenv -+tzsh -+host_os -+host_vendor -+host_cpu -+host -+build_os -+build_vendor -+build_cpu -+build -+target_alias -+host_alias -+build_alias -+LIBS -+ECHO_T -+ECHO_N -+ECHO_C -+DEFS -+mandir -+localedir -+libdir -+psdir -+pdfdir -+dvidir -+htmldir -+infodir -+docdir -+oldincludedir -+includedir -+localstatedir -+sharedstatedir -+sysconfdir -+datadir -+datarootdir -+libexecdir -+sbindir -+bindir -+program_transform_name -+prefix -+exec_prefix -+PACKAGE_URL -+PACKAGE_BUGREPORT -+PACKAGE_STRING -+PACKAGE_VERSION -+PACKAGE_TARNAME -+PACKAGE_NAME -+PATH_SEPARATOR -+SHELL' -+ac_subst_files='CLEAN_MK -+CONFIG_MK -+DEFS_MK -+VERSION_MK' -+ac_user_opts=' -+enable_option_checking -+enable_cppflags -+enable_cflags -+enable_ldflags -+enable_libs -+enable_zsh_debug -+enable_zsh_mem -+enable_zsh_mem_debug -+enable_zsh_mem_warning -+enable_zsh_secure_free -+enable_zsh_hash_debug -+enable_etcdir -+enable_zshenv -+enable_zshrc -+enable_zprofile -+enable_zlogin -+enable_zlogout -+enable_dynamic -+enable_restricted_r -+enable_locale -+enable_ansi2knr -+enable_fndir -+enable_site_fndir -+enable_function_subdirs -+enable_additional_fpath -+enable_scriptdir -+enable_site_scriptdir -+enable_custom_patchlevel -+enable_maildir_support -+enable_max_function_depth -+enable_readnullcmd -+enable_pcre -+enable_cap -+enable_gdbm -+enable_largefile -+with_term_lib -+with_tcsetpgrp -+enable_multibyte -+enable_libc_musl -+enable_dynamic_nss -+' -+ ac_precious_vars='build_alias -+host_alias -+target_alias -+CC -+CFLAGS -+LDFLAGS -+LIBS -+CPPFLAGS -+CPP' -+ -+ -+# Initialize some variables set by options. -+ac_init_help= -+ac_init_version=false -+ac_unrecognized_opts= -+ac_unrecognized_sep= -+# The variables have the same names as the options, with -+# dashes changed to underlines. -+cache_file=/dev/null -+exec_prefix=NONE -+no_create= -+no_recursion= -+prefix=NONE -+program_prefix=NONE -+program_suffix=NONE -+program_transform_name=s,x,x, -+silent= -+site= -+srcdir= -+verbose= -+x_includes=NONE -+x_libraries=NONE -+ -+# Installation directory options. -+# These are left unexpanded so users can "make install exec_prefix=/foo" -+# and all the variables that are supposed to be based on exec_prefix -+# by default will actually change. -+# Use braces instead of parens because sh, perl, etc. also accept them. -+# (The list follows the same order as the GNU Coding Standards.) -+bindir='${exec_prefix}/bin' -+sbindir='${exec_prefix}/sbin' -+libexecdir='${exec_prefix}/libexec' -+datarootdir='${prefix}/share' -+datadir='${datarootdir}' -+sysconfdir='${prefix}/etc' -+sharedstatedir='${prefix}/com' -+localstatedir='${prefix}/var' -+includedir='${prefix}/include' -+oldincludedir='/usr/include' -+docdir='${datarootdir}/doc/${PACKAGE}' -+infodir='${datarootdir}/info' -+htmldir='${docdir}' -+dvidir='${docdir}' -+pdfdir='${docdir}' -+psdir='${docdir}' -+libdir='${exec_prefix}/lib' -+localedir='${datarootdir}/locale' -+mandir='${datarootdir}/man' -+ -+ac_prev= -+ac_dashdash= -+for ac_option -+do -+ # If the previous option needs an argument, assign it. -+ if test -n "$ac_prev"; then -+ eval $ac_prev=\$ac_option -+ ac_prev= -+ continue -+ fi -+ -+ case $ac_option in -+ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; -+ *=) ac_optarg= ;; -+ *) ac_optarg=yes ;; -+ esac -+ -+ # Accept the important Cygnus configure options, so we can diagnose typos. -+ -+ case $ac_dashdash$ac_option in -+ --) -+ ac_dashdash=yes ;; -+ -+ -bindir | --bindir | --bindi | --bind | --bin | --bi) -+ ac_prev=bindir ;; -+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) -+ bindir=$ac_optarg ;; -+ -+ -build | --build | --buil | --bui | --bu) -+ ac_prev=build_alias ;; -+ -build=* | --build=* | --buil=* | --bui=* | --bu=*) -+ build_alias=$ac_optarg ;; -+ -+ -cache-file | --cache-file | --cache-fil | --cache-fi \ -+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) -+ ac_prev=cache_file ;; -+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ -+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) -+ cache_file=$ac_optarg ;; -+ -+ --config-cache | -C) -+ cache_file=config.cache ;; -+ -+ -datadir | --datadir | --datadi | --datad) -+ ac_prev=datadir ;; -+ -datadir=* | --datadir=* | --datadi=* | --datad=*) -+ datadir=$ac_optarg ;; -+ -+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ -+ | --dataroo | --dataro | --datar) -+ ac_prev=datarootdir ;; -+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ -+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) -+ datarootdir=$ac_optarg ;; -+ -+ -disable-* | --disable-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid feature name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"enable_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval enable_$ac_useropt=no ;; -+ -+ -docdir | --docdir | --docdi | --doc | --do) -+ ac_prev=docdir ;; -+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) -+ docdir=$ac_optarg ;; -+ -+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) -+ ac_prev=dvidir ;; -+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) -+ dvidir=$ac_optarg ;; -+ -+ -enable-* | --enable-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid feature name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"enable_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval enable_$ac_useropt=\$ac_optarg ;; -+ -+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ -+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ -+ | --exec | --exe | --ex) -+ ac_prev=exec_prefix ;; -+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ -+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ -+ | --exec=* | --exe=* | --ex=*) -+ exec_prefix=$ac_optarg ;; -+ -+ -gas | --gas | --ga | --g) -+ # Obsolete; use --with-gas. -+ with_gas=yes ;; -+ -+ -help | --help | --hel | --he | -h) -+ ac_init_help=long ;; -+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) -+ ac_init_help=recursive ;; -+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) -+ ac_init_help=short ;; -+ -+ -host | --host | --hos | --ho) -+ ac_prev=host_alias ;; -+ -host=* | --host=* | --hos=* | --ho=*) -+ host_alias=$ac_optarg ;; -+ -+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) -+ ac_prev=htmldir ;; -+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ -+ | --ht=*) -+ htmldir=$ac_optarg ;; -+ -+ -includedir | --includedir | --includedi | --included | --include \ -+ | --includ | --inclu | --incl | --inc) -+ ac_prev=includedir ;; -+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ -+ | --includ=* | --inclu=* | --incl=* | --inc=*) -+ includedir=$ac_optarg ;; -+ -+ -infodir | --infodir | --infodi | --infod | --info | --inf) -+ ac_prev=infodir ;; -+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) -+ infodir=$ac_optarg ;; -+ -+ -libdir | --libdir | --libdi | --libd) -+ ac_prev=libdir ;; -+ -libdir=* | --libdir=* | --libdi=* | --libd=*) -+ libdir=$ac_optarg ;; -+ -+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ -+ | --libexe | --libex | --libe) -+ ac_prev=libexecdir ;; -+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ -+ | --libexe=* | --libex=* | --libe=*) -+ libexecdir=$ac_optarg ;; -+ -+ -localedir | --localedir | --localedi | --localed | --locale) -+ ac_prev=localedir ;; -+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) -+ localedir=$ac_optarg ;; -+ -+ -localstatedir | --localstatedir | --localstatedi | --localstated \ -+ | --localstate | --localstat | --localsta | --localst | --locals) -+ ac_prev=localstatedir ;; -+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ -+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) -+ localstatedir=$ac_optarg ;; -+ -+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) -+ ac_prev=mandir ;; -+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) -+ mandir=$ac_optarg ;; -+ -+ -nfp | --nfp | --nf) -+ # Obsolete; use --without-fp. -+ with_fp=no ;; -+ -+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ -+ | --no-cr | --no-c | -n) -+ no_create=yes ;; -+ -+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ -+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) -+ no_recursion=yes ;; -+ -+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ -+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ -+ | --oldin | --oldi | --old | --ol | --o) -+ ac_prev=oldincludedir ;; -+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ -+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ -+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) -+ oldincludedir=$ac_optarg ;; -+ -+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) -+ ac_prev=prefix ;; -+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) -+ prefix=$ac_optarg ;; -+ -+ -program-prefix | --program-prefix | --program-prefi | --program-pref \ -+ | --program-pre | --program-pr | --program-p) -+ ac_prev=program_prefix ;; -+ -program-prefix=* | --program-prefix=* | --program-prefi=* \ -+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) -+ program_prefix=$ac_optarg ;; -+ -+ -program-suffix | --program-suffix | --program-suffi | --program-suff \ -+ | --program-suf | --program-su | --program-s) -+ ac_prev=program_suffix ;; -+ -program-suffix=* | --program-suffix=* | --program-suffi=* \ -+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) -+ program_suffix=$ac_optarg ;; -+ -+ -program-transform-name | --program-transform-name \ -+ | --program-transform-nam | --program-transform-na \ -+ | --program-transform-n | --program-transform- \ -+ | --program-transform | --program-transfor \ -+ | --program-transfo | --program-transf \ -+ | --program-trans | --program-tran \ -+ | --progr-tra | --program-tr | --program-t) -+ ac_prev=program_transform_name ;; -+ -program-transform-name=* | --program-transform-name=* \ -+ | --program-transform-nam=* | --program-transform-na=* \ -+ | --program-transform-n=* | --program-transform-=* \ -+ | --program-transform=* | --program-transfor=* \ -+ | --program-transfo=* | --program-transf=* \ -+ | --program-trans=* | --program-tran=* \ -+ | --progr-tra=* | --program-tr=* | --program-t=*) -+ program_transform_name=$ac_optarg ;; -+ -+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) -+ ac_prev=pdfdir ;; -+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) -+ pdfdir=$ac_optarg ;; -+ -+ -psdir | --psdir | --psdi | --psd | --ps) -+ ac_prev=psdir ;; -+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) -+ psdir=$ac_optarg ;; -+ -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ silent=yes ;; -+ -+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -+ ac_prev=sbindir ;; -+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -+ | --sbi=* | --sb=*) -+ sbindir=$ac_optarg ;; -+ -+ -sharedstatedir | --sharedstatedir | --sharedstatedi \ -+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ -+ | --sharedst | --shareds | --shared | --share | --shar \ -+ | --sha | --sh) -+ ac_prev=sharedstatedir ;; -+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ -+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ -+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ -+ | --sha=* | --sh=*) -+ sharedstatedir=$ac_optarg ;; -+ -+ -site | --site | --sit) -+ ac_prev=site ;; -+ -site=* | --site=* | --sit=*) -+ site=$ac_optarg ;; -+ -+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) -+ ac_prev=srcdir ;; -+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) -+ srcdir=$ac_optarg ;; -+ -+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ -+ | --syscon | --sysco | --sysc | --sys | --sy) -+ ac_prev=sysconfdir ;; -+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ -+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) -+ sysconfdir=$ac_optarg ;; -+ -+ -target | --target | --targe | --targ | --tar | --ta | --t) -+ ac_prev=target_alias ;; -+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) -+ target_alias=$ac_optarg ;; -+ -+ -v | -verbose | --verbose | --verbos | --verbo | --verb) -+ verbose=yes ;; -+ -+ -version | --version | --versio | --versi | --vers | -V) -+ ac_init_version=: ;; -+ -+ -with-* | --with-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid package name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"with_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval with_$ac_useropt=\$ac_optarg ;; -+ -+ -without-* | --without-*) -+ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` -+ # Reject names that are not valid shell variable names. -+ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && -+ as_fn_error $? "invalid package name: $ac_useropt" -+ ac_useropt_orig=$ac_useropt -+ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` -+ case $ac_user_opts in -+ *" -+"with_$ac_useropt" -+"*) ;; -+ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" -+ ac_unrecognized_sep=', ';; -+ esac -+ eval with_$ac_useropt=no ;; -+ -+ --x) -+ # Obsolete; use --with-x. -+ with_x=yes ;; -+ -+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ -+ | --x-incl | --x-inc | --x-in | --x-i) -+ ac_prev=x_includes ;; -+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ -+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) -+ x_includes=$ac_optarg ;; -+ -+ -x-libraries | --x-libraries | --x-librarie | --x-librari \ -+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) -+ ac_prev=x_libraries ;; -+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ -+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) -+ x_libraries=$ac_optarg ;; -+ -+ -*) as_fn_error $? "unrecognized option: \`$ac_option' -+Try \`$0 --help' for more information" -+ ;; -+ -+ *=*) -+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` -+ # Reject names that are not valid shell variable names. -+ case $ac_envvar in #( -+ '' | [0-9]* | *[!_$as_cr_alnum]* ) -+ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; -+ esac -+ eval $ac_envvar=\$ac_optarg -+ export $ac_envvar ;; -+ -+ *) -+ # FIXME: should be removed in autoconf 3.0. -+ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 -+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && -+ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 -+ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" -+ ;; -+ -+ esac -+done -+ -+if test -n "$ac_prev"; then -+ ac_option=--`echo $ac_prev | sed 's/_/-/g'` -+ as_fn_error $? "missing argument to $ac_option" -+fi -+ -+if test -n "$ac_unrecognized_opts"; then -+ case $enable_option_checking in -+ no) ;; -+ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; -+ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; -+ esac -+fi -+ -+# Check all directory arguments for consistency. -+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ -+ datadir sysconfdir sharedstatedir localstatedir includedir \ -+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ -+ libdir localedir mandir -+do -+ eval ac_val=\$$ac_var -+ # Remove trailing slashes. -+ case $ac_val in -+ */ ) -+ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` -+ eval $ac_var=\$ac_val;; -+ esac -+ # Be sure to have absolute directory names. -+ case $ac_val in -+ [\\/$]* | ?:[\\/]* ) continue;; -+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;; -+ esac -+ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -+done -+ -+# There might be people who depend on the old broken behavior: `$host' -+# used to hold the argument of --host etc. -+# FIXME: To remove some day. -+build=$build_alias -+host=$host_alias -+target=$target_alias -+ -+# FIXME: To remove some day. -+if test "x$host_alias" != x; then -+ if test "x$build_alias" = x; then -+ cross_compiling=maybe -+ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. -+ If a cross compiler is detected then cross compile mode will be used" >&2 -+ elif test "x$build_alias" != "x$host_alias"; then -+ cross_compiling=yes -+ fi -+fi -+ -+ac_tool_prefix= -+test -n "$host_alias" && ac_tool_prefix=$host_alias- -+ -+test "$silent" = yes && exec 6>/dev/null -+ -+ -+ac_pwd=`pwd` && test -n "$ac_pwd" && -+ac_ls_di=`ls -di .` && -+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || -+ as_fn_error $? "working directory cannot be determined" -+test "X$ac_ls_di" = "X$ac_pwd_ls_di" || -+ as_fn_error $? "pwd does not report name of working directory" -+ -+ -+# Find the source files, if location was not specified. -+if test -z "$srcdir"; then -+ ac_srcdir_defaulted=yes -+ # Try the directory containing this script, then the parent directory. -+ ac_confdir=`$as_dirname -- "$as_myself" || -+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_myself" : 'X\(//\)[^/]' \| \ -+ X"$as_myself" : 'X\(//\)$' \| \ -+ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_myself" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ srcdir=$ac_confdir -+ if test ! -r "$srcdir/$ac_unique_file"; then -+ srcdir=.. -+ fi -+else -+ ac_srcdir_defaulted=no -+fi -+if test ! -r "$srcdir/$ac_unique_file"; then -+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." -+ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -+fi -+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -+ac_abs_confdir=`( -+ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" -+ pwd)` -+# When building in place, set srcdir=. -+if test "$ac_abs_confdir" = "$ac_pwd"; then -+ srcdir=. -+fi -+# Remove unnecessary trailing slashes from srcdir. -+# Double slashes in file names in object file debugging info -+# mess up M-x gdb in Emacs. -+case $srcdir in -+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -+esac -+for ac_var in $ac_precious_vars; do -+ eval ac_env_${ac_var}_set=\${${ac_var}+set} -+ eval ac_env_${ac_var}_value=\$${ac_var} -+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} -+ eval ac_cv_env_${ac_var}_value=\$${ac_var} -+done -+ -+# -+# Report the --help message. -+# -+if test "$ac_init_help" = "long"; then -+ # Omit some internal or obsolete options to make the list less imposing. -+ # This message is too long to be a string in the A/UX 3.1 sh. -+ cat <<_ACEOF -+\`configure' configures this package to adapt to many kinds of systems. -+ -+Usage: $0 [OPTION]... [VAR=VALUE]... -+ -+To assign environment variables (e.g., CC, CFLAGS...), specify them as -+VAR=VALUE. See below for descriptions of some of the useful variables. -+ -+Defaults for the options are specified in brackets. -+ -+Configuration: -+ -h, --help display this help and exit -+ --help=short display options specific to this package -+ --help=recursive display the short help of all the included packages -+ -V, --version display version information and exit -+ -q, --quiet, --silent do not print \`checking ...' messages -+ --cache-file=FILE cache test results in FILE [disabled] -+ -C, --config-cache alias for \`--cache-file=config.cache' -+ -n, --no-create do not create output files -+ --srcdir=DIR find the sources in DIR [configure dir or \`..'] -+ -+Installation directories: -+ --prefix=PREFIX install architecture-independent files in PREFIX -+ [$ac_default_prefix] -+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX -+ [PREFIX] -+ -+By default, \`make install' will install all the files in -+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -+an installation prefix other than \`$ac_default_prefix' using \`--prefix', -+for instance \`--prefix=\$HOME'. -+ -+For better control, use the options below. -+ -+Fine tuning of the installation directories: -+ --bindir=DIR user executables [EPREFIX/bin] -+ --sbindir=DIR system admin executables [EPREFIX/sbin] -+ --libexecdir=DIR program executables [EPREFIX/libexec] -+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] -+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] -+ --localstatedir=DIR modifiable single-machine data [PREFIX/var] -+ --libdir=DIR object code libraries [EPREFIX/lib] -+ --includedir=DIR C header files [PREFIX/include] -+ --oldincludedir=DIR C header files for non-gcc [/usr/include] -+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] -+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR] -+ --infodir=DIR info documentation [DATAROOTDIR/info] -+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale] -+ --mandir=DIR man documentation [DATAROOTDIR/man] -+ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] -+ --htmldir=DIR html documentation [DOCDIR] -+ --dvidir=DIR dvi documentation [DOCDIR] -+ --pdfdir=DIR pdf documentation [DOCDIR] -+ --psdir=DIR ps documentation [DOCDIR] -+_ACEOF -+ -+ cat <<\_ACEOF -+ -+Program names: -+ --program-prefix=PREFIX prepend PREFIX to installed program names -+ --program-suffix=SUFFIX append SUFFIX to installed program names -+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names -+ -+System types: -+ --build=BUILD configure for building on BUILD [guessed] -+ --host=HOST cross-compile to build programs to run on HOST [BUILD] -+_ACEOF -+fi -+ -+if test -n "$ac_init_help"; then -+ -+ cat <<\_ACEOF -+ -+Optional Features: -+ --disable-option-checking ignore unrecognized --enable/--with options -+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) -+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] -+ --enable-cppflags=... specify C preprocessor flags -+ --enable-cflags=... specify C compiler flags -+ --enable-ldflags=... specify linker flags -+ --enable-libs=... specify link libraries -+ --enable-zsh-debug compile with debug code and debugger symbols -+ --enable-zsh-mem compile with zsh memory allocation routines -+ --enable-zsh-mem-debug debug zsh memory allocation routines -+ --enable-zsh-mem-warning -+ print warnings for errors in memory allocation -+ --enable-zsh-secure-free -+ turn on error checking for free() -+ --enable-zsh-hash-debug turn on debugging of internal hash tables -+ --enable-etcdir=DIR the default directory for global zsh scripts -+ --enable-zshenv=FILE the full pathname of the global zshenv script -+ --enable-zshrc=FILE the full pathname of the global zshrc script -+ --enable-zprofile=FILE the full pathname of the global zprofile script -+ --enable-zlogin=FILE the full pathname of the global zlogin script -+ --enable-zlogout=FILE the full pathname of the global zlogout script -+ --disable-dynamic turn off dynamically loaded binary modules -+ --disable-restricted-r turn off r* invocation for restricted shell -+ --disable-locale turn off locale features -+ --enable-ansi2knr translate source to K&R C before compiling -+ --enable-fndir=DIR the directory in which to install functions -+ --enable-site-fndir=DIR same for site functions (not version specific) -+ --enable-function-subdirs -+ install functions in subdirectories -+ --enable-additional-fpath=DIR -+ add directories to default function path -+ --enable-scriptdir=DIR the directory in which to install scripts -+ --enable-site-scriptdir=DIR -+ same for site scripts (not version specific) -+ --enable-custom-patchlevel -+ set a custom ZSH_PATCHLEVEL value -+ --enable-maildir-support -+ enable maildir support in MAIL and MAILPATH -+ --enable-max-function-depth=MAX -+ limit function depth to MAX, default 1000 -+ --enable-readnullcmd=PAGER -+ pager used when READNULLCMD is not set -+ --enable-pcre enable the search for the pcre library (may create -+ run-time library dependencies) -+ --enable-cap enable the search for POSIX capabilities (may -+ require additional headers to be added by hand) -+ --disable-gdbm turn off search for gdbm library -+ --disable-largefile omit support for large files -+ --enable-multibyte support multibyte characters -+ --enable-libc-musl compile with musl as the C library -+ --disable-dynamic-nss do not call functions that will require dynamic NSS -+ modules -+ -+Optional Packages: -+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] -+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) -+ --with-term-lib=LIBS search space-separated LIBS for terminal handling -+ --with-tcsetpgrp assumes that tcsetpgrp() exists and works correctly -+ -+Some influential environment variables: -+ CC C compiler command -+ CFLAGS C compiler flags -+ LDFLAGS linker flags, e.g. -L if you have libraries in a -+ nonstandard directory -+ LIBS libraries to pass to the linker, e.g. -l -+ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if -+ you have headers in a nonstandard directory -+ CPP C preprocessor -+ -+Use these variables to override the choices made by `configure' or to help -+it to find libraries and programs with nonstandard names/locations. -+ -+Report bugs to the package provider. -+_ACEOF -+ac_status=$? -+fi -+ -+if test "$ac_init_help" = "recursive"; then -+ # If there are subdirs, report their specific --help. -+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue -+ test -d "$ac_dir" || -+ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || -+ continue -+ ac_builddir=. -+ -+case "$ac_dir" in -+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -+*) -+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` -+ # A ".." for each directory in $ac_dir_suffix. -+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` -+ case $ac_top_builddir_sub in -+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; -+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; -+ esac ;; -+esac -+ac_abs_top_builddir=$ac_pwd -+ac_abs_builddir=$ac_pwd$ac_dir_suffix -+# for backward compatibility: -+ac_top_builddir=$ac_top_build_prefix -+ -+case $srcdir in -+ .) # We are building in place. -+ ac_srcdir=. -+ ac_top_srcdir=$ac_top_builddir_sub -+ ac_abs_top_srcdir=$ac_pwd ;; -+ [\\/]* | ?:[\\/]* ) # Absolute name. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir -+ ac_abs_top_srcdir=$srcdir ;; -+ *) # Relative name. -+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_build_prefix$srcdir -+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -+esac -+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -+ -+ cd "$ac_dir" || { ac_status=$?; continue; } -+ # Check for guested configure. -+ if test -f "$ac_srcdir/configure.gnu"; then -+ echo && -+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive -+ elif test -f "$ac_srcdir/configure"; then -+ echo && -+ $SHELL "$ac_srcdir/configure" --help=recursive -+ else -+ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 -+ fi || ac_status=$? -+ cd "$ac_pwd" || { ac_status=$?; break; } -+ done -+fi -+ -+test -n "$ac_init_help" && exit $ac_status -+if $ac_init_version; then -+ cat <<\_ACEOF -+configure -+generated by GNU Autoconf 2.68 -+ -+Copyright (C) 2010 Free Software Foundation, Inc. -+This configure script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it. -+_ACEOF -+ exit -+fi -+ -+## ------------------------ ## -+## Autoconf initialization. ## -+## ------------------------ ## -+ -+# ac_fn_c_try_compile LINENO -+# -------------------------- -+# Try to compile conftest.$ac_ext, and return whether this succeeded. -+ac_fn_c_try_compile () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ rm -f conftest.$ac_objext -+ if { { ac_try="$ac_compile" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_compile") 2>conftest.err -+ ac_status=$? -+ if test -s conftest.err; then -+ grep -v '^ *+' conftest.err >conftest.er1 -+ cat conftest.er1 >&5 -+ mv -f conftest.er1 conftest.err -+ fi -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } && { -+ test -z "$ac_c_werror_flag" || -+ test ! -s conftest.err -+ } && test -s conftest.$ac_objext; then : -+ ac_retval=0 -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_retval=1 -+fi -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ as_fn_set_status $ac_retval -+ -+} # ac_fn_c_try_compile -+ -+# ac_fn_c_try_cpp LINENO -+# ---------------------- -+# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -+ac_fn_c_try_cpp () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ if { { ac_try="$ac_cpp conftest.$ac_ext" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err -+ ac_status=$? -+ if test -s conftest.err; then -+ grep -v '^ *+' conftest.err >conftest.er1 -+ cat conftest.er1 >&5 -+ mv -f conftest.er1 conftest.err -+ fi -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } > conftest.i && { -+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || -+ test ! -s conftest.err -+ }; then : -+ ac_retval=0 -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_retval=1 -+fi -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ as_fn_set_status $ac_retval -+ -+} # ac_fn_c_try_cpp -+ -+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -+# ------------------------------------------- -+# Tests whether TYPE exists after having included INCLUDES, setting cache -+# variable VAR accordingly. -+ac_fn_c_check_type () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -+$as_echo_n "checking for $2... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ eval "$3=no" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$4 -+int -+main () -+{ -+if (sizeof ($2)) -+ return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$4 -+int -+main () -+{ -+if (sizeof (($2))) -+ return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+else -+ eval "$3=yes" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_type -+ -+# ac_fn_c_try_run LINENO -+# ---------------------- -+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -+# that executables *can* be run. -+ac_fn_c_try_run () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ if { { ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_link") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' -+ { { case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_try") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then : -+ ac_retval=0 -+else -+ $as_echo "$as_me: program exited with status $ac_status" >&5 -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_retval=$ac_status -+fi -+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ as_fn_set_status $ac_retval -+ -+} # ac_fn_c_try_run -+ -+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -+# ------------------------------------------------------- -+# Tests whether HEADER exists and can be compiled using the include files in -+# INCLUDES, setting the cache variable VAR accordingly. -+ac_fn_c_check_header_compile () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -+$as_echo_n "checking for $2... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$4 -+#include <$2> -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$3=yes" -+else -+ eval "$3=no" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_header_compile -+ -+# ac_fn_c_try_link LINENO -+# ----------------------- -+# Try to link conftest.$ac_ext, and return whether this succeeded. -+ac_fn_c_try_link () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ rm -f conftest.$ac_objext conftest$ac_exeext -+ if { { ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_link") 2>conftest.err -+ ac_status=$? -+ if test -s conftest.err; then -+ grep -v '^ *+' conftest.err >conftest.er1 -+ cat conftest.er1 >&5 -+ mv -f conftest.er1 conftest.err -+ fi -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } && { -+ test -z "$ac_c_werror_flag" || -+ test ! -s conftest.err -+ } && test -s conftest$ac_exeext && { -+ test "$cross_compiling" = yes || -+ $as_test_x conftest$ac_exeext -+ }; then : -+ ac_retval=0 -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ ac_retval=1 -+fi -+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information -+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would -+ # interfere with the next link command; also delete a directory that is -+ # left behind by Apple's compiler. We do this before executing the actions. -+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ as_fn_set_status $ac_retval -+ -+} # ac_fn_c_try_link -+ -+# ac_fn_c_check_func LINENO FUNC VAR -+# ---------------------------------- -+# Tests whether FUNC exists, setting the cache variable VAR accordingly -+ac_fn_c_check_func () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -+$as_echo_n "checking for $2... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+/* Define $2 to an innocuous variant, in case declares $2. -+ For example, HP-UX 11i declares gettimeofday. */ -+#define $2 innocuous_$2 -+ -+/* System header to define __stub macros and hopefully few prototypes, -+ which can conflict with char $2 (); below. -+ Prefer to if __STDC__ is defined, since -+ exists even on freestanding compilers. */ -+ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ -+#undef $2 -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char $2 (); -+/* The GNU C library defines this for functions which it implements -+ to always fail with ENOSYS. Some functions are actually named -+ something starting with __ and the normal name is an alias. */ -+#if defined __stub_$2 || defined __stub___$2 -+choke me -+#endif -+ -+int -+main () -+{ -+return $2 (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ eval "$3=yes" -+else -+ eval "$3=no" -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_func -+ -+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -+# ------------------------------------------------------- -+# Tests whether HEADER exists, giving a warning if it cannot be compiled using -+# the include files in INCLUDES and setting the cache variable VAR -+# accordingly. -+ac_fn_c_check_header_mongrel () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ if eval \${$3+:} false; then : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -+$as_echo_n "checking for $2... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+else -+ # Is the header compilable? -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -+$as_echo_n "checking $2 usability... " >&6; } -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$4 -+#include <$2> -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_header_compiler=yes -+else -+ ac_header_compiler=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -+$as_echo "$ac_header_compiler" >&6; } -+ -+# Is the header present? -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -+$as_echo_n "checking $2 presence... " >&6; } -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include <$2> -+_ACEOF -+if ac_fn_c_try_cpp "$LINENO"; then : -+ ac_header_preproc=yes -+else -+ ac_header_preproc=no -+fi -+rm -f conftest.err conftest.i conftest.$ac_ext -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -+$as_echo "$ac_header_preproc" >&6; } -+ -+# So? What about this header? -+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( -+ yes:no: ) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -+ ;; -+ no:yes:* ) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -+$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -+$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -+ ;; -+esac -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -+$as_echo_n "checking for $2... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ eval "$3=\$ac_header_compiler" -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+fi -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_header_mongrel -+ -+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -+# --------------------------------------------- -+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -+# accordingly. -+ac_fn_c_check_decl () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ as_decl_name=`echo $2|sed 's/ *(.*//'` -+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -+$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -+if eval \${$3+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$4 -+int -+main () -+{ -+#ifndef $as_decl_name -+#ifdef __cplusplus -+ (void) $as_decl_use; -+#else -+ (void) $as_decl_name; -+#endif -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$3=yes" -+else -+ eval "$3=no" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+eval ac_res=\$$3 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_decl -+ -+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES -+# ---------------------------------------------------- -+# Tries to find if the field MEMBER exists in type AGGR, after including -+# INCLUDES, setting cache variable VAR accordingly. -+ac_fn_c_check_member () -+{ -+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 -+$as_echo_n "checking for $2.$3... " >&6; } -+if eval \${$4+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$5 -+int -+main () -+{ -+static $2 ac_aggr; -+if (ac_aggr.$3) -+return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$4=yes" -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$5 -+int -+main () -+{ -+static $2 ac_aggr; -+if (sizeof ac_aggr.$3) -+return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$4=yes" -+else -+ eval "$4=no" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+eval ac_res=\$$4 -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -+ -+} # ac_fn_c_check_member -+cat >config.log <<_ACEOF -+This file contains any messages produced by compilers while -+running configure, to aid debugging if configure makes a mistake. -+ -+It was created by $as_me, which was -+generated by GNU Autoconf 2.68. Invocation command line was -+ -+ $ $0 $@ -+ -+_ACEOF -+exec 5>>config.log -+{ -+cat <<_ASUNAME -+## --------- ## -+## Platform. ## -+## --------- ## -+ -+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -+uname -m = `(uname -m) 2>/dev/null || echo unknown` -+uname -r = `(uname -r) 2>/dev/null || echo unknown` -+uname -s = `(uname -s) 2>/dev/null || echo unknown` -+uname -v = `(uname -v) 2>/dev/null || echo unknown` -+ -+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` -+ -+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` -+ -+_ASUNAME -+ -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ $as_echo "PATH: $as_dir" -+ done -+IFS=$as_save_IFS -+ -+} >&5 -+ -+cat >&5 <<_ACEOF -+ -+ -+## ----------- ## -+## Core tests. ## -+## ----------- ## -+ -+_ACEOF -+ -+ -+# Keep a trace of the command line. -+# Strip out --no-create and --no-recursion so they do not pile up. -+# Strip out --silent because we don't want to record it for future runs. -+# Also quote any args containing shell meta-characters. -+# Make two passes to allow for proper duplicate-argument suppression. -+ac_configure_args= -+ac_configure_args0= -+ac_configure_args1= -+ac_must_keep_next=false -+for ac_pass in 1 2 -+do -+ for ac_arg -+ do -+ case $ac_arg in -+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil) -+ continue ;; -+ *\'*) -+ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ esac -+ case $ac_pass in -+ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; -+ 2) -+ as_fn_append ac_configure_args1 " '$ac_arg'" -+ if test $ac_must_keep_next = true; then -+ ac_must_keep_next=false # Got value, back to normal. -+ else -+ case $ac_arg in -+ *=* | --config-cache | -C | -disable-* | --disable-* \ -+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ -+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ -+ | -with-* | --with-* | -without-* | --without-* | --x) -+ case "$ac_configure_args0 " in -+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; -+ esac -+ ;; -+ -* ) ac_must_keep_next=true ;; -+ esac -+ fi -+ as_fn_append ac_configure_args " '$ac_arg'" -+ ;; -+ esac -+ done -+done -+{ ac_configure_args0=; unset ac_configure_args0;} -+{ ac_configure_args1=; unset ac_configure_args1;} -+ -+# When interrupted or exit'd, cleanup temporary files, and complete -+# config.log. We remove comments because anyway the quotes in there -+# would cause problems or look ugly. -+# WARNING: Use '\'' to represent an apostrophe within the trap. -+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -+trap 'exit_status=$? -+ # Save into config.log some information that might help in debugging. -+ { -+ echo -+ -+ $as_echo "## ---------------- ## -+## Cache variables. ## -+## ---------------- ##" -+ echo -+ # The following way of writing the cache mishandles newlines in values, -+( -+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do -+ eval ac_val=\$$ac_var -+ case $ac_val in #( -+ *${as_nl}*) -+ case $ac_var in #( -+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; -+ esac -+ case $ac_var in #( -+ _ | IFS | as_nl) ;; #( -+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( -+ *) { eval $ac_var=; unset $ac_var;} ;; -+ esac ;; -+ esac -+ done -+ (set) 2>&1 | -+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( -+ *${as_nl}ac_space=\ *) -+ sed -n \ -+ "s/'\''/'\''\\\\'\'''\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" -+ ;; #( -+ *) -+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" -+ ;; -+ esac | -+ sort -+) -+ echo -+ -+ $as_echo "## ----------------- ## -+## Output variables. ## -+## ----------------- ##" -+ echo -+ for ac_var in $ac_subst_vars -+ do -+ eval ac_val=\$$ac_var -+ case $ac_val in -+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; -+ esac -+ $as_echo "$ac_var='\''$ac_val'\''" -+ done | sort -+ echo -+ -+ if test -n "$ac_subst_files"; then -+ $as_echo "## ------------------- ## -+## File substitutions. ## -+## ------------------- ##" -+ echo -+ for ac_var in $ac_subst_files -+ do -+ eval ac_val=\$$ac_var -+ case $ac_val in -+ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; -+ esac -+ $as_echo "$ac_var='\''$ac_val'\''" -+ done | sort -+ echo -+ fi -+ -+ if test -s confdefs.h; then -+ $as_echo "## ----------- ## -+## confdefs.h. ## -+## ----------- ##" -+ echo -+ cat confdefs.h -+ echo -+ fi -+ test "$ac_signal" != 0 && -+ $as_echo "$as_me: caught signal $ac_signal" -+ $as_echo "$as_me: exit $exit_status" -+ } >&5 -+ rm -f core *.core core.conftest.* && -+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files && -+ exit $exit_status -+' 0 -+for ac_signal in 1 2 13 15; do -+ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -+done -+ac_signal=0 -+ -+# confdefs.h avoids OS command line length limits that DEFS can exceed. -+rm -f -r conftest* confdefs.h -+ -+$as_echo "/* confdefs.h */" > confdefs.h -+ -+# Predefined preprocessor variables. -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_NAME "$PACKAGE_NAME" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_VERSION "$PACKAGE_VERSION" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_STRING "$PACKAGE_STRING" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -+_ACEOF -+ -+cat >>confdefs.h <<_ACEOF -+#define PACKAGE_URL "$PACKAGE_URL" -+_ACEOF -+ -+ -+# Let the site file select an alternate cache file if it wants to. -+# Prefer an explicitly selected file to automatically selected ones. -+ac_site_file1=NONE -+ac_site_file2=NONE -+if test -n "$CONFIG_SITE"; then -+ # We do not want a PATH search for config.site. -+ case $CONFIG_SITE in #(( -+ -*) ac_site_file1=./$CONFIG_SITE;; -+ */*) ac_site_file1=$CONFIG_SITE;; -+ *) ac_site_file1=./$CONFIG_SITE;; -+ esac -+elif test "x$prefix" != xNONE; then -+ ac_site_file1=$prefix/share/config.site -+ ac_site_file2=$prefix/etc/config.site -+else -+ ac_site_file1=$ac_default_prefix/share/config.site -+ ac_site_file2=$ac_default_prefix/etc/config.site -+fi -+for ac_site_file in "$ac_site_file1" "$ac_site_file2" -+do -+ test "x$ac_site_file" = xNONE && continue -+ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -+$as_echo "$as_me: loading site script $ac_site_file" >&6;} -+ sed 's/^/| /' "$ac_site_file" >&5 -+ . "$ac_site_file" \ -+ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "failed to load site script $ac_site_file -+See \`config.log' for more details" "$LINENO" 5; } -+ fi -+done -+ -+if test -r "$cache_file"; then -+ # Some versions of bash will fail to source /dev/null (special files -+ # actually), so we avoid doing that. DJGPP emulates it as a regular file. -+ if test /dev/null != "$cache_file" && test -f "$cache_file"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -+$as_echo "$as_me: loading cache $cache_file" >&6;} -+ case $cache_file in -+ [\\/]* | ?:[\\/]* ) . "$cache_file";; -+ *) . "./$cache_file";; -+ esac -+ fi -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -+$as_echo "$as_me: creating cache $cache_file" >&6;} -+ >$cache_file -+fi -+ -+as_fn_append ac_header_list " stdlib.h" -+as_fn_append ac_header_list " unistd.h" -+as_fn_append ac_header_list " sys/param.h" -+# Check that the precious variables saved in the cache have kept the same -+# value. -+ac_cache_corrupted=false -+for ac_var in $ac_precious_vars; do -+ eval ac_old_set=\$ac_cv_env_${ac_var}_set -+ eval ac_new_set=\$ac_env_${ac_var}_set -+ eval ac_old_val=\$ac_cv_env_${ac_var}_value -+ eval ac_new_val=\$ac_env_${ac_var}_value -+ case $ac_old_set,$ac_new_set in -+ set,) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,set) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} -+ ac_cache_corrupted=: ;; -+ ,);; -+ *) -+ if test "x$ac_old_val" != "x$ac_new_val"; then -+ # differences in whitespace do not lead to failure. -+ ac_old_val_w=`echo x $ac_old_val` -+ ac_new_val_w=`echo x $ac_new_val` -+ if test "$ac_old_val_w" != "$ac_new_val_w"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} -+ ac_cache_corrupted=: -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} -+ eval $ac_var=\$ac_old_val -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -+$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -+$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} -+ fi;; -+ esac -+ # Pass precious variables to config.status. -+ if test "$ac_new_set" = set; then -+ case $ac_new_val in -+ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; -+ *) ac_arg=$ac_var=$ac_new_val ;; -+ esac -+ case " $ac_configure_args " in -+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. -+ *) as_fn_append ac_configure_args " '$ac_arg'" ;; -+ esac -+ fi -+done -+if $ac_cache_corrupted; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} -+ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -+fi -+## -------------------- ## -+## Main body of script. ## -+## -------------------- ## -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+ -+ac_config_headers="$ac_config_headers config.h" -+ -+ -+. ${srcdir}/Config/version.mk -+echo "configuring for zsh $VERSION" -+ -+ac_aux_dir= -+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do -+ if test -f "$ac_dir/install-sh"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install-sh -c" -+ break -+ elif test -f "$ac_dir/install.sh"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/install.sh -c" -+ break -+ elif test -f "$ac_dir/shtool"; then -+ ac_aux_dir=$ac_dir -+ ac_install_sh="$ac_aux_dir/shtool install -c" -+ break -+ fi -+done -+if test -z "$ac_aux_dir"; then -+ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -+fi -+ -+# These three variables are undocumented and unsupported, -+# and are intended to be withdrawn in a future Autoconf release. -+# They can cause serious problems if a builder's source tree is in a directory -+# whose full name contains unusual characters. -+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. -+ -+ -+# Make sure we can run config.sub. -+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || -+ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -+$as_echo_n "checking build system type... " >&6; } -+if ${ac_cv_build+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_build_alias=$build_alias -+test "x$ac_build_alias" = x && -+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -+test "x$ac_build_alias" = x && -+ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || -+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -+$as_echo "$ac_cv_build" >&6; } -+case $ac_cv_build in -+*-*-*) ;; -+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -+esac -+build=$ac_cv_build -+ac_save_IFS=$IFS; IFS='-' -+set x $ac_cv_build -+shift -+build_cpu=$1 -+build_vendor=$2 -+shift; shift -+# Remember, the first character of IFS is used to create $*, -+# except with old shells: -+build_os=$* -+IFS=$ac_save_IFS -+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -+$as_echo_n "checking host system type... " >&6; } -+if ${ac_cv_host+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "x$host_alias" = x; then -+ ac_cv_host=$ac_cv_build -+else -+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || -+ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -+$as_echo "$ac_cv_host" >&6; } -+case $ac_cv_host in -+*-*-*) ;; -+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -+esac -+host=$ac_cv_host -+ac_save_IFS=$IFS; IFS='-' -+set x $ac_cv_host -+shift -+host_cpu=$1 -+host_vendor=$2 -+shift; shift -+# Remember, the first character of IFS is used to create $*, -+# except with old shells: -+host_os=$* -+IFS=$ac_save_IFS -+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -+ -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define MACHTYPE "$host_cpu" -+_ACEOF -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define VENDOR "$host_vendor" -+_ACEOF -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define OSTYPE "$host_os" -+_ACEOF -+ -+ -+test "$program_prefix" != NONE && -+ program_transform_name="s&^&$program_prefix&;$program_transform_name" -+# Use a double $ so make ignores it. -+test "$program_suffix" != NONE && -+ program_transform_name="s&\$&$program_suffix&;$program_transform_name" -+# Double any \ or $. -+# By default was `s,x,x', remove it if useless. -+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -+ -+ -+# Un-double any \ or $ (doubled by AC_ARG_PROGRAM). -+cat <<\EOF_SED > conftestsed -+s,\\\\,\\,g; s,\$\$,$,g -+EOF_SED -+zsh_transform_name=`echo "${program_transform_name}" | sed -f conftestsed` -+rm -f conftestsed -+tzsh_name=`echo zsh | sed -e "${zsh_transform_name}"` -+# Double any \ or $ in the transformed name that results. -+cat <<\EOF_SED >> conftestsed -+s,\\,\\\\,g; s,\$,$$,g -+EOF_SED -+tzsh=`echo ${tzsh_name} | sed -f conftestsed` -+rm -f conftestsed -+ -+ -+# Check whether --enable-cppflags was given. -+if test "${enable_cppflags+set}" = set; then : -+ enableval=$enable_cppflags; if test "$enableval" = "yes" -+ then CPPFLAGS="$CPPFLAGS" -+ else CPPFLAGS="$enable_cppflags" -+ fi -+fi -+ -+ # Check whether --enable-cflags was given. -+if test "${enable_cflags+set}" = set; then : -+ enableval=$enable_cflags; if test "$enableval" = "yes" -+ then CFLAGS="$CFLAGS" -+ else CFLAGS="$enable_cflags" -+ fi -+fi -+ -+ # Check whether --enable-ldflags was given. -+if test "${enable_ldflags+set}" = set; then : -+ enableval=$enable_ldflags; if test "$enableval" = "yes" -+ then LDFLAGS="$LDFLAGS" -+ else LDFLAGS="$enable_ldflags" -+ fi -+fi -+ -+ # Check whether --enable-libs was given. -+if test "${enable_libs+set}" = set; then : -+ enableval=$enable_libs; if test "$enableval" = "yes" -+ then LIBS="$LIBS" -+ else LIBS="$enable_libs" -+ fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-debug was given. -+if test "${enable_zsh_debug+set}" = set; then : -+ enableval=$enable_zsh_debug; if test x$enableval = xyes; then -+ $as_echo "#define DEBUG 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-mem was given. -+if test "${enable_zsh_mem+set}" = set; then : -+ enableval=$enable_zsh_mem; if test x$enableval = xyes; then -+ $as_echo "#define ZSH_MEM 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-mem-debug was given. -+if test "${enable_zsh_mem_debug+set}" = set; then : -+ enableval=$enable_zsh_mem_debug; if test x$enableval = xyes; then -+ $as_echo "#define ZSH_MEM_DEBUG 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-mem-warning was given. -+if test "${enable_zsh_mem_warning+set}" = set; then : -+ enableval=$enable_zsh_mem_warning; if test x$enableval = xyes; then -+ $as_echo "#define ZSH_MEM_WARNING 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-secure-free was given. -+if test "${enable_zsh_secure_free+set}" = set; then : -+ enableval=$enable_zsh_secure_free; if test x$enableval = xyes; then -+ $as_echo "#define ZSH_SECURE_FREE 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-zsh-hash-debug was given. -+if test "${enable_zsh_hash_debug+set}" = set; then : -+ enableval=$enable_zsh_hash_debug; if test x$enableval = xyes; then -+ $as_echo "#define ZSH_HASH_DEBUG 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+# Check whether --enable-etcdir was given. -+if test "${enable_etcdir+set}" = set; then : -+ enableval=$enable_etcdir; etcdir="$enableval" -+else -+ etcdir=/etc -+fi -+ -+ -+# Check whether --enable-zshenv was given. -+if test "${enable_zshenv+set}" = set; then : -+ enableval=$enable_zshenv; zshenv="$enableval" -+else -+ if test "x$etcdir" = xno; then -+ zshenv=no -+else -+ zshenv="$etcdir/zshenv" -+fi -+fi -+ -+ -+if test "x$zshenv" != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define GLOBAL_ZSHENV "$zshenv" -+_ACEOF -+ -+fi -+ -+# Check whether --enable-zshrc was given. -+if test "${enable_zshrc+set}" = set; then : -+ enableval=$enable_zshrc; zshrc="$enableval" -+else -+ if test "x$etcdir" = xno; then -+ zshrc=no -+else -+ zshrc="$etcdir/zshrc" -+fi -+fi -+ -+ -+if test "x$zshrc" != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define GLOBAL_ZSHRC "$zshrc" -+_ACEOF -+ -+fi -+ -+# Check whether --enable-zprofile was given. -+if test "${enable_zprofile+set}" = set; then : -+ enableval=$enable_zprofile; zprofile="$enableval" -+else -+ if test "x$etcdir" = xno; then -+ zprofile=no -+else -+ zprofile="$etcdir/zprofile" -+fi -+fi -+ -+ -+if test "x$zprofile" != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define GLOBAL_ZPROFILE "$zprofile" -+_ACEOF -+ -+fi -+ -+# Check whether --enable-zlogin was given. -+if test "${enable_zlogin+set}" = set; then : -+ enableval=$enable_zlogin; zlogin="$enableval" -+else -+ if test "x$etcdir" = xno; then -+ zlogin=no -+else -+ zlogin="$etcdir/zlogin" -+fi -+fi -+ -+ -+if test "x$zlogin" != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define GLOBAL_ZLOGIN "$zlogin" -+_ACEOF -+ -+fi -+ -+# Check whether --enable-zlogout was given. -+if test "${enable_zlogout+set}" = set; then : -+ enableval=$enable_zlogout; zlogout="$enableval" -+else -+ if test "x$etcdir" = xno; then -+ zlogout=no -+else -+ zlogout="$etcdir/zlogout" -+fi -+fi -+ -+ -+if test "x$zlogout" != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define GLOBAL_ZLOGOUT "$zlogout" -+_ACEOF -+ -+fi -+ -+ -+# Check whether --enable-dynamic was given. -+if test "${enable_dynamic+set}" = set; then : -+ enableval=$enable_dynamic; dynamic="$enableval" -+else -+ dynamic=yes -+fi -+ -+ -+ -+# Check whether --enable-restricted-r was given. -+if test "${enable_restricted_r+set}" = set; then : -+ enableval=$enable_restricted_r; if test x$enableval = xyes; then -+ $as_echo "#define RESTRICTED_R 1" >>confdefs.h -+ -+fi -+else -+ $as_echo "#define RESTRICTED_R 1" >>confdefs.h -+ -+ -+fi -+ -+ -+ -+# Check whether --enable-locale was given. -+if test "${enable_locale+set}" = set; then : -+ enableval=$enable_locale; if test x$enableval = xyes; then -+ $as_echo "#define CONFIG_LOCALE 1" >>confdefs.h -+ -+fi -+else -+ $as_echo "#define CONFIG_LOCALE 1" >>confdefs.h -+ -+ -+fi -+ -+ -+# Check whether --enable-ansi2knr was given. -+if test "${enable_ansi2knr+set}" = set; then : -+ enableval=$enable_ansi2knr; ansi2knr="$enableval" -+else -+ ansi2knr=default -+fi -+ -+ -+# Check whether --enable-fndir was given. -+if test "${enable_fndir+set}" = set; then : -+ enableval=$enable_fndir; if test x$enableval = xyes; then -+ fndir=${datadir}/${tzsh_name}/'${VERSION}'/functions -+else -+ fndir="$enableval" -+fi -+else -+ fndir=${datadir}/${tzsh_name}/'${VERSION}'/functions -+fi -+ -+ -+# Check whether --enable-site-fndir was given. -+if test "${enable_site_fndir+set}" = set; then : -+ enableval=$enable_site_fndir; if test x$enableval = xyes; then -+ sitefndir=${datadir}/${tzsh_name}/site-functions -+else -+ sitefndir="$enableval" -+fi -+else -+ sitefndir=${datadir}/${tzsh_name}/site-functions -+fi -+ -+ -+ -+# Check whether --enable-function-subdirs was given. -+if test "${enable_function_subdirs+set}" = set; then : -+ enableval=$enable_function_subdirs; -+fi -+ -+ -+if test "x${enable_function_subdirs}" != x && -+ test "x${enable_function_subdirs}" != xno; then -+ FUNCTIONS_SUBDIRS=yes -+else -+ FUNCTIONS_SUBDIRS=no -+fi -+ -+# Check whether --enable-additional-fpath was given. -+if test "${enable_additional_fpath+set}" = set; then : -+ enableval=$enable_additional_fpath; if test x$enableval = xyes; then -+ additionalfpath="" -+else -+ additionalfpath="${enableval}" -+fi -+else -+ additionalfpath="" -+fi -+ -+ -+ -+ -+# Check whether --enable-scriptdir was given. -+if test "${enable_scriptdir+set}" = set; then : -+ enableval=$enable_scriptdir; if test x$enableval = xyes; then -+ scriptdir=${datadir}/${tzsh_name}/'${VERSION}'/scripts -+else -+ scriptdir="$enableval" -+fi -+else -+ scriptdir=${datadir}/${tzsh_name}/'${VERSION}'/scripts -+fi -+ -+ -+# Check whether --enable-site-scriptdir was given. -+if test "${enable_site_scriptdir+set}" = set; then : -+ enableval=$enable_site_scriptdir; if test x$enableval = xyes; then -+ sitescriptdir=${datadir}/${tzsh_name}/scripts -+else -+ sitescriptdir="$enableval" -+fi -+else -+ sitescriptdir=${datadir}/${tzsh_name}/scripts -+fi -+ -+ -+ -+if test x$htmldir = x'${docdir}' || test x$htmldir = x; then -+ htmldir='$(datadir)/$(tzsh)/htmldoc' -+fi -+ -+ -+# Check whether --enable-custom-patchlevel was given. -+if test "${enable_custom_patchlevel+set}" = set; then : -+ enableval=$enable_custom_patchlevel; if test x$enableval != x && test x$enableval != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define CUSTOM_PATCHLEVEL "$enableval" -+_ACEOF -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-maildir-support was given. -+if test "${enable_maildir_support+set}" = set; then : -+ enableval=$enable_maildir_support; if test x$enableval = xyes; then -+ $as_echo "#define MAILDIR_SUPPORT 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+ -+# Check whether --enable-max-function-depth was given. -+if test "${enable_max_function_depth+set}" = set; then : -+ enableval=$enable_max_function_depth; if test x$enableval = xyes; then -+ $as_echo "#define MAX_FUNCTION_DEPTH 1000" >>confdefs.h -+ -+elif test x$enableval != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define MAX_FUNCTION_DEPTH $enableval -+_ACEOF -+ -+fi -+else -+ $as_echo "#define MAX_FUNCTION_DEPTH 1000" >>confdefs.h -+ -+ -+fi -+ -+ -+ -+# Check whether --enable-readnullcmd was given. -+if test "${enable_readnullcmd+set}" = set; then : -+ enableval=$enable_readnullcmd; if test x$enableval = xyes; then -+ $as_echo "#define DEFAULT_READNULLCMD \"more\"" >>confdefs.h -+ -+elif test x$enableval != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define DEFAULT_READNULLCMD "$enableval" -+_ACEOF -+ -+fi -+else -+ $as_echo "#define DEFAULT_READNULLCMD \"more\"" >>confdefs.h -+ -+ -+fi -+ -+ -+# Check whether --enable-pcre was given. -+if test "${enable_pcre+set}" = set; then : -+ enableval=$enable_pcre; -+fi -+ -+ -+# Check whether --enable-cap was given. -+if test "${enable_cap+set}" = set; then : -+ enableval=$enable_cap; -+fi -+ -+ -+# Check whether --enable-gdbm was given. -+if test "${enable_gdbm+set}" = set; then : -+ enableval=$enable_gdbm; gdbm="$enableval" -+else -+ gdbm=yes -+fi -+ -+ -+test -z "${CFLAGS+set}" && CFLAGS= auto_cflags=1 -+test -z "${LDFLAGS+set}" && LDFLAGS= auto_ldflags=1 -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -+set dummy ${ac_tool_prefix}gcc; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_CC="${ac_tool_prefix}gcc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$ac_cv_prog_CC"; then -+ ac_ct_CC=$CC -+ # Extract the first word of "gcc", so it can be a program name with args. -+set dummy gcc; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_CC"; then -+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_CC="gcc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_CC=$ac_cv_prog_ac_ct_CC -+if test -n "$ac_ct_CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -+$as_echo "$ac_ct_CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ if test "x$ac_ct_CC" = x; then -+ CC="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ CC=$ac_ct_CC -+ fi -+else -+ CC="$ac_cv_prog_CC" -+fi -+ -+if test -z "$CC"; then -+ if test -n "$ac_tool_prefix"; then -+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -+set dummy ${ac_tool_prefix}cc; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_CC="${ac_tool_prefix}cc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ fi -+fi -+if test -z "$CC"; then -+ # Extract the first word of "cc", so it can be a program name with args. -+set dummy cc; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+ ac_prog_rejected=no -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then -+ ac_prog_rejected=yes -+ continue -+ fi -+ ac_cv_prog_CC="cc" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+if test $ac_prog_rejected = yes; then -+ # We found a bogon in the path, so make sure we never use it. -+ set dummy $ac_cv_prog_CC -+ shift -+ if test $# != 0; then -+ # We chose a different compiler from the bogus one. -+ # However, it has the same basename, so the bogon will be chosen -+ # first if we set CC to just the basename; use the full file name. -+ shift -+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" -+ fi -+fi -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+fi -+if test -z "$CC"; then -+ if test -n "$ac_tool_prefix"; then -+ for ac_prog in cl.exe -+ do -+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -+set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$CC"; then -+ ac_cv_prog_CC="$CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+CC=$ac_cv_prog_CC -+if test -n "$CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -+$as_echo "$CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$CC" && break -+ done -+fi -+if test -z "$CC"; then -+ ac_ct_CC=$CC -+ for ac_prog in cl.exe -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ac_ct_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ac_ct_CC"; then -+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ac_ct_CC="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ac_ct_CC=$ac_cv_prog_ac_ct_CC -+if test -n "$ac_ct_CC"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -+$as_echo "$ac_ct_CC" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$ac_ct_CC" && break -+done -+ -+ if test "x$ac_ct_CC" = x; then -+ CC="" -+ else -+ case $cross_compiling:$ac_tool_warned in -+yes:) -+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -+ac_tool_warned=yes ;; -+esac -+ CC=$ac_ct_CC -+ fi -+fi -+ -+fi -+ -+ -+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "no acceptable C compiler found in \$PATH -+See \`config.log' for more details" "$LINENO" 5; } -+ -+# Provide some information about the compiler. -+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -+set X $ac_compile -+ac_compiler=$2 -+for ac_option in --version -v -V -qversion; do -+ { { ac_try="$ac_compiler $ac_option >&5" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_compiler $ac_option >&5") 2>conftest.err -+ ac_status=$? -+ if test -s conftest.err; then -+ sed '10a\ -+... rest of stderr output deleted ... -+ 10q' conftest.err >conftest.er1 -+ cat conftest.er1 >&5 -+ fi -+ rm -f conftest.er1 conftest.err -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } -+done -+ -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+ac_clean_files_save=$ac_clean_files -+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -+# Try to create an executable without -o first, disregard a.out. -+# It will help us diagnose broken compilers, and finding out an intuition -+# of exeext. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -+$as_echo_n "checking whether the C compiler works... " >&6; } -+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -+ -+# The possible output files: -+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" -+ -+ac_rmfiles= -+for ac_file in $ac_files -+do -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; -+ * ) ac_rmfiles="$ac_rmfiles $ac_file";; -+ esac -+done -+rm -f $ac_rmfiles -+ -+if { { ac_try="$ac_link_default" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_link_default") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then : -+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -+# in a Makefile. We should not override ac_cv_exeext if it was cached, -+# so that the user can short-circuit this test for compilers unknown to -+# Autoconf. -+for ac_file in $ac_files '' -+do -+ test -f "$ac_file" || continue -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) -+ ;; -+ [ab].out ) -+ # We found the default executable, but exeext='' is most -+ # certainly right. -+ break;; -+ *.* ) -+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; -+ then :; else -+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` -+ fi -+ # We set ac_cv_exeext here because the later test for it is not -+ # safe: cross compilers may not add the suffix if given an `-o' -+ # argument, so we may need to know it at that point already. -+ # Even if this section looks crufty: it has the advantage of -+ # actually working. -+ break;; -+ * ) -+ break;; -+ esac -+done -+test "$ac_cv_exeext" = no && ac_cv_exeext= -+ -+else -+ ac_file='' -+fi -+if test -z "$ac_file"; then : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+$as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error 77 "C compiler cannot create executables -+See \`config.log' for more details" "$LINENO" 5; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -+$as_echo_n "checking for C compiler default output file name... " >&6; } -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -+$as_echo "$ac_file" >&6; } -+ac_exeext=$ac_cv_exeext -+ -+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -+ac_clean_files=$ac_clean_files_save -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -+$as_echo_n "checking for suffix of executables... " >&6; } -+if { { ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_link") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then : -+ # If both `conftest.exe' and `conftest' are `present' (well, observable) -+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -+# work properly (i.e., refer to `conftest.exe'), while it won't with -+# `rm'. -+for ac_file in conftest.exe conftest conftest.*; do -+ test -f "$ac_file" || continue -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; -+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` -+ break;; -+ * ) break;; -+ esac -+done -+else -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "cannot compute suffix of executables: cannot compile and link -+See \`config.log' for more details" "$LINENO" 5; } -+fi -+rm -f conftest conftest$ac_cv_exeext -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -+$as_echo "$ac_cv_exeext" >&6; } -+ -+rm -f conftest.$ac_ext -+EXEEXT=$ac_cv_exeext -+ac_exeext=$EXEEXT -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+FILE *f = fopen ("conftest.out", "w"); -+ return ferror (f) || fclose (f) != 0; -+ -+ ; -+ return 0; -+} -+_ACEOF -+ac_clean_files="$ac_clean_files conftest.out" -+# Check that the compiler produces executables we can run. If not, either -+# the compiler is broken, or we cross compile. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -+$as_echo_n "checking whether we are cross compiling... " >&6; } -+if test "$cross_compiling" != yes; then -+ { { ac_try="$ac_link" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_link") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; } -+ if { ac_try='./conftest$ac_cv_exeext' -+ { { case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_try") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ cross_compiling=no -+ else -+ if test "$cross_compiling" = maybe; then -+ cross_compiling=yes -+ else -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "cannot run C compiled programs. -+If you meant to cross compile, use \`--host'. -+See \`config.log' for more details" "$LINENO" 5; } -+ fi -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -+$as_echo "$cross_compiling" >&6; } -+ -+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -+ac_clean_files=$ac_clean_files_save -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -+$as_echo_n "checking for suffix of object files... " >&6; } -+if ${ac_cv_objext+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.o conftest.obj -+if { { ac_try="$ac_compile" -+case "(($ac_try" in -+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; -+ *) ac_try_echo=$ac_try;; -+esac -+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -+$as_echo "$ac_try_echo"; } >&5 -+ (eval "$ac_compile") 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; then : -+ for ac_file in conftest.o conftest.obj conftest.*; do -+ test -f "$ac_file" || continue; -+ case $ac_file in -+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; -+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` -+ break;; -+ esac -+done -+else -+ $as_echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "cannot compute suffix of object files: cannot compile -+See \`config.log' for more details" "$LINENO" 5; } -+fi -+rm -f conftest.$ac_cv_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -+$as_echo "$ac_cv_objext" >&6; } -+OBJEXT=$ac_cv_objext -+ac_objext=$OBJEXT -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -+if ${ac_cv_c_compiler_gnu+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+#ifndef __GNUC__ -+ choke me -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_compiler_gnu=yes -+else -+ ac_compiler_gnu=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ac_cv_c_compiler_gnu=$ac_compiler_gnu -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -+$as_echo "$ac_cv_c_compiler_gnu" >&6; } -+if test $ac_compiler_gnu = yes; then -+ GCC=yes -+else -+ GCC= -+fi -+ac_test_CFLAGS=${CFLAGS+set} -+ac_save_CFLAGS=$CFLAGS -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -+$as_echo_n "checking whether $CC accepts -g... " >&6; } -+if ${ac_cv_prog_cc_g+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_save_c_werror_flag=$ac_c_werror_flag -+ ac_c_werror_flag=yes -+ ac_cv_prog_cc_g=no -+ CFLAGS="-g" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_prog_cc_g=yes -+else -+ CFLAGS="" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ -+else -+ ac_c_werror_flag=$ac_save_c_werror_flag -+ CFLAGS="-g" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_prog_cc_g=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_c_werror_flag=$ac_save_c_werror_flag -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -+$as_echo "$ac_cv_prog_cc_g" >&6; } -+if test "$ac_test_CFLAGS" = set; then -+ CFLAGS=$ac_save_CFLAGS -+elif test $ac_cv_prog_cc_g = yes; then -+ if test "$GCC" = yes; then -+ CFLAGS="-g -O2" -+ else -+ CFLAGS="-g" -+ fi -+else -+ if test "$GCC" = yes; then -+ CFLAGS="-O2" -+ else -+ CFLAGS= -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -+if ${ac_cv_prog_cc_c89+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_cv_prog_cc_c89=no -+ac_save_CC=$CC -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#include -+#include -+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -+struct buf { int x; }; -+FILE * (*rcsopen) (struct buf *, struct stat *, int); -+static char *e (p, i) -+ char **p; -+ int i; -+{ -+ return p[i]; -+} -+static char *f (char * (*g) (char **, int), char **p, ...) -+{ -+ char *s; -+ va_list v; -+ va_start (v,p); -+ s = g (p, va_arg (v,int)); -+ va_end (v); -+ return s; -+} -+ -+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has -+ function prototypes and stuff, but not '\xHH' hex character constants. -+ These don't provoke an error unfortunately, instead are silently treated -+ as 'x'. The following induces an error, until -std is added to get -+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an -+ array size at least. It's necessary to write '\x00'==0 to get something -+ that's true only with -std. */ -+int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -+ -+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters -+ inside strings and character constants. */ -+#define FOO(x) 'x' -+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; -+ -+int test (int i, double x); -+struct s1 {int (*f) (int a);}; -+struct s2 {int (*f) (double a);}; -+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -+int argc; -+char **argv; -+int -+main () -+{ -+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; -+ ; -+ return 0; -+} -+_ACEOF -+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -+do -+ CC="$ac_save_CC $ac_arg" -+ if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_prog_cc_c89=$ac_arg -+fi -+rm -f core conftest.err conftest.$ac_objext -+ test "x$ac_cv_prog_cc_c89" != "xno" && break -+done -+rm -f conftest.$ac_ext -+CC=$ac_save_CC -+ -+fi -+# AC_CACHE_VAL -+case "x$ac_cv_prog_cc_c89" in -+ x) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -+$as_echo "none needed" >&6; } ;; -+ xno) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -+$as_echo "unsupported" >&6; } ;; -+ *) -+ CC="$CC $ac_cv_prog_cc_c89" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -+esac -+if test "x$ac_cv_prog_cc_c89" != xno; then : -+ -+fi -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ -+ -+if test "$host" = mips-sni-sysv4 && test -n "$GCC"; then -+ : -+else -+ -+# Check whether --enable-largefile was given. -+if test "${enable_largefile+set}" = set; then : -+ enableval=$enable_largefile; -+fi -+ -+if test "$enable_largefile" != no; then -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -+$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -+if ${ac_cv_sys_largefile_CC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_cv_sys_largefile_CC=no -+ if test "$GCC" != yes; then -+ ac_save_CC=$CC -+ while :; do -+ # IRIX 6.2 and later do not support large files by default, -+ # so use the C compiler's -n32 option if that helps. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+ if ac_fn_c_try_compile "$LINENO"; then : -+ break -+fi -+rm -f core conftest.err conftest.$ac_objext -+ CC="$CC -n32" -+ if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_largefile_CC=' -n32'; break -+fi -+rm -f core conftest.err conftest.$ac_objext -+ break -+ done -+ CC=$ac_save_CC -+ rm -f conftest.$ac_ext -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -+$as_echo "$ac_cv_sys_largefile_CC" >&6; } -+ if test "$ac_cv_sys_largefile_CC" != no; then -+ CC=$CC$ac_cv_sys_largefile_CC -+ fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -+if ${ac_cv_sys_file_offset_bits+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ while :; do -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_file_offset_bits=no; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#define _FILE_OFFSET_BITS 64 -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_file_offset_bits=64; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_cv_sys_file_offset_bits=unknown -+ break -+done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -+$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -+case $ac_cv_sys_file_offset_bits in #( -+ no | unknown) ;; -+ *) -+cat >>confdefs.h <<_ACEOF -+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -+_ACEOF -+;; -+esac -+rm -rf conftest* -+ if test $ac_cv_sys_file_offset_bits = unknown; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -+if ${ac_cv_sys_large_files+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ while :; do -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_large_files=no; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#define _LARGE_FILES 1 -+#include -+ /* Check that off_t can represent 2**63 - 1 correctly. -+ We can't simply define LARGE_OFF_T to be 9223372036854775807, -+ since some C++ compilers masquerading as C compilers -+ incorrectly reject 9223372036854775807. */ -+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) -+ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 -+ && LARGE_OFF_T % 2147483647 == 1) -+ ? 1 : -1]; -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_sys_large_files=1; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ ac_cv_sys_large_files=unknown -+ break -+done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -+$as_echo "$ac_cv_sys_large_files" >&6; } -+case $ac_cv_sys_large_files in #( -+ no | unknown) ;; -+ *) -+cat >>confdefs.h <<_ACEOF -+#define _LARGE_FILES $ac_cv_sys_large_files -+_ACEOF -+;; -+esac -+rm -rf conftest* -+ fi -+fi -+ -+fi -+ -+if test -n "$auto_cflags" && test ."$ansi2knr" != .yes; then -+ if test "${enable_zsh_debug}" = yes; then -+ if test -n "$GCC"; then -+ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -ggdb" -+ else -+ CFLAGS="$CFLAGS -g" -+ fi -+ else -+ if test -n "$GCC"; then -+ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -O2" -+ else -+ CFLAGS="$CFLAGS -O" -+ fi -+ fi -+fi -+if test -n "$auto_ldflags"; then -+ case "${enable_zsh_debug}$host_os" in -+ yesaix*|yeshpux*|yesnetbsd*|yesopenbsd*) ;; # "ld -g" is not valid on these systems -+ darwin*) LDFLAGS=-Wl,-x ;; -+ yes*) LDFLAGS=-g ;; -+ *) LDFLAGS=-s ;; -+ esac -+fi -+ -+case "$host_os" in -+ sco*) CFLAGS="-D__sco $CFLAGS" ;; -+esac -+ -+sed=':1 -+ s/ -s / /g -+ t1 -+ s/^ *// -+ s/ *$//' -+ -+case " $LDFLAGS " in -+ *" -s "*) strip_exeldflags=true strip_libldflags=true -+ LDFLAGS=`echo " $LDFLAGS " | sed "$sed"` ;; -+ *) strip_exeldflags=false strip_libldflags=false ;; -+esac -+ -+case " ${EXELDFLAGS+$EXELDFLAGS }" in -+ " ") ;; -+ *" -s "*) strip_exeldflags=true -+ EXELDFLAGS=`echo " $EXELDFLAGS " | sed "$sed"` ;; -+ *) strip_exeldflags=false ;; -+esac -+ -+case " ${LIBLDFLAGS+$LIBLDFLAGS }" in -+ " ") ;; -+ *" -s "*) strip_libldflags=true -+ LIBLDFLAGS=`echo " $LIBLDFLAGS " | sed "$sed"` ;; -+ *) strip_libldflags=false ;; -+esac -+ -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -+$as_echo_n "checking how to run the C preprocessor... " >&6; } -+# On Suns, sometimes $CPP names a directory. -+if test -n "$CPP" && test -d "$CPP"; then -+ CPP= -+fi -+if test -z "$CPP"; then -+ if ${ac_cv_prog_CPP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ # Double quotes because CPP needs to be expanded -+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" -+ do -+ ac_preproc_ok=false -+for ac_c_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ Syntax error -+_ACEOF -+if ac_fn_c_try_cpp "$LINENO"; then : -+ -+else -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.i conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether nonexistent headers -+ # can be detected and how. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+_ACEOF -+if ac_fn_c_try_cpp "$LINENO"; then : -+ # Broken: success on invalid input. -+continue -+else -+ # Passes both tests. -+ac_preproc_ok=: -+break -+fi -+rm -f conftest.err conftest.i conftest.$ac_ext -+ -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.i conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then : -+ break -+fi -+ -+ done -+ ac_cv_prog_CPP=$CPP -+ -+fi -+ CPP=$ac_cv_prog_CPP -+else -+ ac_cv_prog_CPP=$CPP -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -+$as_echo "$CPP" >&6; } -+ac_preproc_ok=false -+for ac_c_preproc_warn_flag in '' yes -+do -+ # Use a header file that comes with gcc, so configuring glibc -+ # with a fresh cross-compiler works. -+ # Prefer to if __STDC__ is defined, since -+ # exists even on freestanding compilers. -+ # On the NeXT, cc -E runs the code through the compiler's parser, -+ # not just through cpp. "Syntax error" is here to catch this case. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#ifdef __STDC__ -+# include -+#else -+# include -+#endif -+ Syntax error -+_ACEOF -+if ac_fn_c_try_cpp "$LINENO"; then : -+ -+else -+ # Broken: fails on valid input. -+continue -+fi -+rm -f conftest.err conftest.i conftest.$ac_ext -+ -+ # OK, works on sane cases. Now check whether nonexistent headers -+ # can be detected and how. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+_ACEOF -+if ac_fn_c_try_cpp "$LINENO"; then : -+ # Broken: success on invalid input. -+continue -+else -+ # Passes both tests. -+ac_preproc_ok=: -+break -+fi -+rm -f conftest.err conftest.i conftest.$ac_ext -+ -+done -+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -+rm -f conftest.i conftest.err conftest.$ac_ext -+if $ac_preproc_ok; then : -+ -+else -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -+See \`config.log' for more details" "$LINENO" 5; } -+fi -+ -+ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -+$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -+if ${ac_cv_path_GREP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -z "$GREP"; then -+ ac_path_GREP_found=false -+ # Loop through the user's path and test for each of PROGNAME-LIST -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_prog in grep ggrep; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" -+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -+# Check for GNU ac_path_GREP and select it if it is found. -+ # Check for GNU $ac_path_GREP -+case `"$ac_path_GREP" --version 2>&1` in -+*GNU*) -+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -+*) -+ ac_count=0 -+ $as_echo_n 0123456789 >"conftest.in" -+ while : -+ do -+ cat "conftest.in" "conftest.in" >"conftest.tmp" -+ mv "conftest.tmp" "conftest.in" -+ cp "conftest.in" "conftest.nl" -+ $as_echo 'GREP' >> "conftest.nl" -+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break -+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break -+ as_fn_arith $ac_count + 1 && ac_count=$as_val -+ if test $ac_count -gt ${ac_path_GREP_max-0}; then -+ # Best one so far, save it but keep looking for a better one -+ ac_cv_path_GREP="$ac_path_GREP" -+ ac_path_GREP_max=$ac_count -+ fi -+ # 10*(2^10) chars as input seems more than enough -+ test $ac_count -gt 10 && break -+ done -+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -+esac -+ -+ $ac_path_GREP_found && break 3 -+ done -+ done -+ done -+IFS=$as_save_IFS -+ if test -z "$ac_cv_path_GREP"; then -+ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ fi -+else -+ ac_cv_path_GREP=$GREP -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -+$as_echo "$ac_cv_path_GREP" >&6; } -+ GREP="$ac_cv_path_GREP" -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -+$as_echo_n "checking for egrep... " >&6; } -+if ${ac_cv_path_EGREP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 -+ then ac_cv_path_EGREP="$GREP -E" -+ else -+ if test -z "$EGREP"; then -+ ac_path_EGREP_found=false -+ # Loop through the user's path and test for each of PROGNAME-LIST -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_prog in egrep; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" -+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -+# Check for GNU ac_path_EGREP and select it if it is found. -+ # Check for GNU $ac_path_EGREP -+case `"$ac_path_EGREP" --version 2>&1` in -+*GNU*) -+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -+*) -+ ac_count=0 -+ $as_echo_n 0123456789 >"conftest.in" -+ while : -+ do -+ cat "conftest.in" "conftest.in" >"conftest.tmp" -+ mv "conftest.tmp" "conftest.in" -+ cp "conftest.in" "conftest.nl" -+ $as_echo 'EGREP' >> "conftest.nl" -+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break -+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break -+ as_fn_arith $ac_count + 1 && ac_count=$as_val -+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then -+ # Best one so far, save it but keep looking for a better one -+ ac_cv_path_EGREP="$ac_path_EGREP" -+ ac_path_EGREP_max=$ac_count -+ fi -+ # 10*(2^10) chars as input seems more than enough -+ test $ac_count -gt 10 && break -+ done -+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -+esac -+ -+ $ac_path_EGREP_found && break 3 -+ done -+ done -+ done -+IFS=$as_save_IFS -+ if test -z "$ac_cv_path_EGREP"; then -+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ fi -+else -+ ac_cv_path_EGREP=$EGREP -+fi -+ -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -+$as_echo "$ac_cv_path_EGREP" >&6; } -+ EGREP="$ac_cv_path_EGREP" -+ -+ -+if test $ac_cv_c_compiler_gnu = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -+$as_echo_n "checking whether $CC needs -traditional... " >&6; } -+if ${ac_cv_prog_gcc_traditional+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_pattern="Autoconf.*'x'" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+Autoconf TIOCGETP -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "$ac_pattern" >/dev/null 2>&1; then : -+ ac_cv_prog_gcc_traditional=yes -+else -+ ac_cv_prog_gcc_traditional=no -+fi -+rm -f conftest* -+ -+ -+ if test $ac_cv_prog_gcc_traditional = no; then -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+Autoconf TCGETA -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "$ac_pattern" >/dev/null 2>&1; then : -+ ac_cv_prog_gcc_traditional=yes -+fi -+rm -f conftest* -+ -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -+$as_echo "$ac_cv_prog_gcc_traditional" >&6; } -+ if test $ac_cv_prog_gcc_traditional = yes; then -+ CC="$CC -traditional" -+ fi -+fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -+$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -+if ${ac_cv_c_const+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+/* FIXME: Include the comments suggested by Paul. */ -+#ifndef __cplusplus -+ /* Ultrix mips cc rejects this. */ -+ typedef int charset[2]; -+ const charset cs; -+ /* SunOS 4.1.1 cc rejects this. */ -+ char const *const *pcpcc; -+ char **ppc; -+ /* NEC SVR4.0.2 mips cc rejects this. */ -+ struct point {int x, y;}; -+ static struct point const zero = {0,0}; -+ /* AIX XL C 1.02.0.0 rejects this. -+ It does not let you subtract one const X* pointer from another in -+ an arm of an if-expression whose if-part is not a constant -+ expression */ -+ const char *g = "string"; -+ pcpcc = &g + (g ? g-g : 0); -+ /* HPUX 7.0 cc rejects these. */ -+ ++pcpcc; -+ ppc = (char**) pcpcc; -+ pcpcc = (char const *const *) ppc; -+ { /* SCO 3.2v4 cc rejects this. */ -+ char *t; -+ char const *s = 0 ? (char *) 0 : (char const *) 0; -+ -+ *t++ = 0; -+ if (s) return 0; -+ } -+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ -+ int x[] = {25, 17}; -+ const int *foo = &x[0]; -+ ++foo; -+ } -+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ -+ typedef const int *iptr; -+ iptr p = 0; -+ ++p; -+ } -+ { /* AIX XL C 1.02.0.0 rejects this saying -+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ -+ struct s { int j; const int *ap[3]; }; -+ struct s *b; b->j = 5; -+ } -+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ -+ const int foo = 10; -+ if (!foo) return 0; -+ } -+ return !cs[0] && !zero.x; -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_c_const=yes -+else -+ ac_cv_c_const=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -+$as_echo "$ac_cv_c_const" >&6; } -+if test $ac_cv_c_const = no; then -+ -+$as_echo "#define const /**/" >>confdefs.h -+ -+fi -+ -+case "$host_os" in -+ darwin[0-9].*) CPP="$CPP -traditional-cpp" ;; -+esac -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${CC-cc} option to accept ANSI C" >&5 -+$as_echo_n "checking for ${CC-cc} option to accept ANSI C... " >&6; } -+if ${fp_cv_prog_cc_stdc+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ fp_cv_prog_cc_stdc=no -+ac_save_CFLAGS="$CFLAGS" -+# Don't try gcc -ansi; that turns off useful extensions and -+# breaks some systems' header files. -+# AIX -qlanglvl=ansi -+# Ultrix and OSF/1 -std1 -+# HP-UX -Ae or -Aa -D_HPUX_SOURCE -+# SVR4 -Xc -+# For HP-UX, we try -Ae first; this turns on ANSI but also extensions, -+# as well as defining _HPUX_SOURCE, and we can then use long long. -+# We keep the old version for backward compatibility. -+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" -Xc -+do -+ CFLAGS="$ac_save_CFLAGS $ac_arg" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#ifndef __STDC__ -+choke me -+#endif -+ -+int -+main () -+{ -+int test (int i, double x); -+struct s1 {int (*f) (int a);}; -+struct s2 {int (*f) (double a);}; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ fp_cv_prog_cc_stdc="$ac_arg"; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+done -+CFLAGS="$ac_save_CFLAGS" -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_prog_cc_stdc" >&5 -+$as_echo "$fp_cv_prog_cc_stdc" >&6; } -+case "x$fp_cv_prog_cc_stdc" in -+ x|xno) ;; -+ *) CC="$CC $fp_cv_prog_cc_stdc" ;; -+esac -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use prototypes" >&5 -+$as_echo_n "checking whether to use prototypes... " >&6; } -+if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then -+ msg="(overridden) " -+else -+ msg= -+ if test ."$fp_cv_prog_cc_stdc" = .no; then -+ ansi2knr=yes -+ else -+ ansi2knr=no -+ fi -+fi -+ -+if test "$ansi2knr" = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msg}no" >&5 -+$as_echo "${msg}no" >&6; } -+ U=_ -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msg}yes" >&5 -+$as_echo "${msg}yes" >&6; } -+ $as_echo "#define PROTOTYPES 1" >>confdefs.h -+ -+ U= -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -+$as_echo_n "checking for ANSI C header files... " >&6; } -+if ${ac_cv_header_stdc+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#include -+#include -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_stdc=yes -+else -+ ac_cv_header_stdc=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+if test $ac_cv_header_stdc = yes; then -+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "memchr" >/dev/null 2>&1; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f conftest* -+ -+fi -+ -+if test $ac_cv_header_stdc = yes; then -+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "free" >/dev/null 2>&1; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f conftest* -+ -+fi -+ -+if test $ac_cv_header_stdc = yes; then -+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -+ if test "$cross_compiling" = yes; then : -+ : -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#if ((' ' & 0x0FF) == 0x020) -+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -+#else -+# define ISLOWER(c) \ -+ (('a' <= (c) && (c) <= 'i') \ -+ || ('j' <= (c) && (c) <= 'r') \ -+ || ('s' <= (c) && (c) <= 'z')) -+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -+#endif -+ -+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -+int -+main () -+{ -+ int i; -+ for (i = 0; i < 256; i++) -+ if (XOR (islower (i), ISLOWER (i)) -+ || toupper (i) != TOUPPER (i)) -+ return 2; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -+$as_echo "$ac_cv_header_stdc" >&6; } -+if test $ac_cv_header_stdc = yes; then -+ -+$as_echo "#define STDC_HEADERS 1" >>confdefs.h -+ -+fi -+ -+# On IRIX 5.3, sys/types and inttypes.h are conflicting. -+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ -+ inttypes.h stdint.h unistd.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -+" -+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -+if test "x$ac_cv_type_size_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define size_t unsigned int -+_ACEOF -+ -+fi -+ -+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works -+# for constant arguments. Useless! -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -+$as_echo_n "checking for working alloca.h... " >&6; } -+if ${ac_cv_working_alloca_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+char *p = (char *) alloca (2 * sizeof (int)); -+ if (p) return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_working_alloca_h=yes -+else -+ ac_cv_working_alloca_h=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -+$as_echo "$ac_cv_working_alloca_h" >&6; } -+if test $ac_cv_working_alloca_h = yes; then -+ -+$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -+$as_echo_n "checking for alloca... " >&6; } -+if ${ac_cv_func_alloca_works+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#ifdef __GNUC__ -+# define alloca __builtin_alloca -+#else -+# ifdef _MSC_VER -+# include -+# define alloca _alloca -+# else -+# ifdef HAVE_ALLOCA_H -+# include -+# else -+# ifdef _AIX -+ #pragma alloca -+# else -+# ifndef alloca /* predefined by HP cc +Olibcalls */ -+void *alloca (size_t); -+# endif -+# endif -+# endif -+# endif -+#endif -+ -+int -+main () -+{ -+char *p = (char *) alloca (1); -+ if (p) return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_func_alloca_works=yes -+else -+ ac_cv_func_alloca_works=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -+$as_echo "$ac_cv_func_alloca_works" >&6; } -+ -+if test $ac_cv_func_alloca_works = yes; then -+ -+$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h -+ -+else -+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions -+# that cause trouble. Some versions do not even contain alloca or -+# contain a buggy version. If you still want to use their alloca, -+# use ar to extract alloca.o from them instead of compiling alloca.c. -+ -+ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -+ -+$as_echo "#define C_ALLOCA 1" >>confdefs.h -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -+if ${ac_cv_os_cray+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#if defined CRAY && ! defined CRAY2 -+webecray -+#else -+wenotbecray -+#endif -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "webecray" >/dev/null 2>&1; then : -+ ac_cv_os_cray=yes -+else -+ ac_cv_os_cray=no -+fi -+rm -f conftest* -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -+$as_echo "$ac_cv_os_cray" >&6; } -+if test $ac_cv_os_cray = yes; then -+ for ac_func in _getb67 GETB67 getb67; do -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define CRAY_STACKSEG_END $ac_func -+_ACEOF -+ -+ break -+fi -+ -+ done -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -+$as_echo_n "checking stack direction for C alloca... " >&6; } -+if ${ac_cv_c_stack_direction+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ac_cv_c_stack_direction=0 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$ac_includes_default -+int -+find_stack_direction () -+{ -+ static char *addr = 0; -+ auto char dummy; -+ if (addr == 0) -+ { -+ addr = &dummy; -+ return find_stack_direction (); -+ } -+ else -+ return (&dummy > addr) ? 1 : -1; -+} -+ -+int -+main () -+{ -+ return find_stack_direction () < 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ac_cv_c_stack_direction=1 -+else -+ ac_cv_c_stack_direction=-1 -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -+$as_echo "$ac_cv_c_stack_direction" >&6; } -+cat >>confdefs.h <<_ACEOF -+#define STACK_DIRECTION $ac_cv_c_stack_direction -+_ACEOF -+ -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler supports union initialisation" >&5 -+$as_echo_n "checking if the compiler supports union initialisation... " >&6; } -+if ${zsh_cv_c_have_union_init+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+union{void *p;long l;}u={0}; -+int -+main () -+{ -+u.l=1; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_c_have_union_init=yes -+else -+ zsh_cv_c_have_union_init=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_have_union_init" >&5 -+$as_echo "$zsh_cv_c_have_union_init" >&6; } -+ -+if test x$zsh_cv_c_have_union_init = xyes; then -+ $as_echo "#define HAVE_UNION_INIT 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if signed to unsigned casting is broken" >&5 -+$as_echo_n "checking if signed to unsigned casting is broken... " >&6; } -+if ${zsh_cv_c_broken_signed_to_unsigned_casting+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_c_broken_signed_to_unsigned_casting=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+main(){return((int)(unsigned char)((char) -1) == 255);} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_c_broken_signed_to_unsigned_casting=yes -+else -+ zsh_cv_c_broken_signed_to_unsigned_casting=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_broken_signed_to_unsigned_casting" >&5 -+$as_echo "$zsh_cv_c_broken_signed_to_unsigned_casting" >&6; } -+ -+if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then -+ $as_echo "#define BROKEN_SIGNED_TO_UNSIGNED_CASTING 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler supports variable-length arrays" >&5 -+$as_echo_n "checking if the compiler supports variable-length arrays... " >&6; } -+if ${zsh_cv_c_variable_length_arrays+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+int foo(), n; -+int -+main () -+{ -+int i[foo()], a[n+1]; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_c_variable_length_arrays=yes -+else -+ zsh_cv_c_variable_length_arrays=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_variable_length_arrays" >&5 -+$as_echo "$zsh_cv_c_variable_length_arrays" >&6; } -+ -+if test x$zsh_cv_c_variable_length_arrays = xyes; then -+ $as_echo "#define HAVE_VARIABLE_LENGTH_ARRAYS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -+set x ${MAKE-make} -+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat >conftest.make <<\_ACEOF -+SHELL = /bin/sh -+all: -+ @echo '@@@%%%=$(MAKE)=@@@%%%' -+_ACEOF -+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. -+case `${MAKE-make} -f conftest.make 2>/dev/null` in -+ *@@@%%%=?*=@@@%%%*) -+ eval ac_cv_prog_make_${ac_make}_set=yes;; -+ *) -+ eval ac_cv_prog_make_${ac_make}_set=no;; -+esac -+rm -f conftest.make -+fi -+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ SET_MAKE= -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ SET_MAKE="MAKE=${MAKE-make}" -+fi -+ # Find a good install program. We prefer a C program (faster), -+# so one script is as good as another. But avoid the broken or -+# incompatible versions: -+# SysV /etc/install, /usr/sbin/install -+# SunOS /usr/etc/install -+# IRIX /sbin/install -+# AIX /bin/install -+# AmigaOS /C/install, which installs bootblocks on floppy discs -+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -+# AFS /usr/afsws/bin/install, which mishandles nonexistent args -+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -+# OS/2's system install, which has a completely different semantic -+# ./install, which can be erroneously created by make from ./install.sh. -+# Reject install programs that cannot install multiple files. -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -+$as_echo_n "checking for a BSD-compatible install... " >&6; } -+if test -z "$INSTALL"; then -+if ${ac_cv_path_install+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ # Account for people who put trailing slashes in PATH elements. -+case $as_dir/ in #(( -+ ./ | .// | /[cC]/* | \ -+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ -+ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ -+ /usr/ucb/* ) ;; -+ *) -+ # OSF1 and SCO ODT 3.0 have their own names for install. -+ # Don't use installbsd from OSF since it installs stuff as root -+ # by default. -+ for ac_prog in ginstall scoinst install; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then -+ if test $ac_prog = install && -+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # AIX install. It has an incompatible calling convention. -+ : -+ elif test $ac_prog = install && -+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then -+ # program-specific install script used by HP pwplus--don't use. -+ : -+ else -+ rm -rf conftest.one conftest.two conftest.dir -+ echo one > conftest.one -+ echo two > conftest.two -+ mkdir conftest.dir -+ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && -+ test -s conftest.one && test -s conftest.two && -+ test -s conftest.dir/conftest.one && -+ test -s conftest.dir/conftest.two -+ then -+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" -+ break 3 -+ fi -+ fi -+ fi -+ done -+ done -+ ;; -+esac -+ -+ done -+IFS=$as_save_IFS -+ -+rm -rf conftest.one conftest.two conftest.dir -+ -+fi -+ if test "${ac_cv_path_install+set}" = set; then -+ INSTALL=$ac_cv_path_install -+ else -+ # As a last resort, use the slow shell script. Don't cache a -+ # value for INSTALL within a source directory, because that will -+ # break other packages using the cache if that directory is -+ # removed, or if the value is a relative name. -+ INSTALL=$ac_install_sh -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -+$as_echo "$INSTALL" >&6; } -+ -+# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -+# It thinks the first close brace ends the variable substitution. -+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -+ -+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' -+ -+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -+ for ac_prog in gawk mawk nawk awk -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_AWK+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$AWK"; then -+ ac_cv_prog_AWK="$AWK" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_AWK="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+AWK=$ac_cv_prog_AWK -+if test -n "$AWK"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -+$as_echo "$AWK" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$AWK" && break -+done -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln works" >&5 -+$as_echo_n "checking whether ln works... " >&6; } -+if ${ac_cv_prog_LN+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ rm -f conftestdata conftestlink -+echo > conftestdata -+if ln conftestdata conftestlink 2>/dev/null -+then -+ rm -f conftestdata conftestlink -+ ac_cv_prog_LN="ln" -+else -+ rm -f conftestdata -+ ac_cv_prog_LN="cp" -+fi -+fi -+LN="$ac_cv_prog_LN" -+if test "$ac_cv_prog_LN" = "ln"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -+$as_echo_n "checking for egrep... " >&6; } -+if ${ac_cv_path_EGREP+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 -+ then ac_cv_path_EGREP="$GREP -E" -+ else -+ if test -z "$EGREP"; then -+ ac_path_EGREP_found=false -+ # Loop through the user's path and test for each of PROGNAME-LIST -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_prog in egrep; do -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" -+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -+# Check for GNU ac_path_EGREP and select it if it is found. -+ # Check for GNU $ac_path_EGREP -+case `"$ac_path_EGREP" --version 2>&1` in -+*GNU*) -+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -+*) -+ ac_count=0 -+ $as_echo_n 0123456789 >"conftest.in" -+ while : -+ do -+ cat "conftest.in" "conftest.in" >"conftest.tmp" -+ mv "conftest.tmp" "conftest.in" -+ cp "conftest.in" "conftest.nl" -+ $as_echo 'EGREP' >> "conftest.nl" -+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break -+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break -+ as_fn_arith $ac_count + 1 && ac_count=$as_val -+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then -+ # Best one so far, save it but keep looking for a better one -+ ac_cv_path_EGREP="$ac_path_EGREP" -+ ac_path_EGREP_max=$ac_count -+ fi -+ # 10*(2^10) chars as input seems more than enough -+ test $ac_count -gt 10 && break -+ done -+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -+esac -+ -+ $ac_path_EGREP_found && break 3 -+ done -+ done -+ done -+IFS=$as_save_IFS -+ if test -z "$ac_cv_path_EGREP"; then -+ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 -+ fi -+else -+ ac_cv_path_EGREP=$EGREP -+fi -+ -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -+$as_echo "$ac_cv_path_EGREP" >&6; } -+ EGREP="$ac_cv_path_EGREP" -+ -+ for ac_prog in yodl -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_YODL+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$YODL"; then -+ ac_cv_prog_YODL="$YODL" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_YODL="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+YODL=$ac_cv_prog_YODL -+if test -n "$YODL"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YODL" >&5 -+$as_echo "$YODL" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$YODL" && break -+done -+test -n "$YODL" || YODL=": yodl" -+ -+ -+YODL_OPTIONS='' -+if test "x$ac_cv_prog_YODL" = xyodl; then -+ case `yodl --version` in -+ *"version 3."*) YODL_OPTIONS='-L' ;; -+ esac -+fi -+ -+ -+for ac_prog in pdfetex -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_PDFETEX+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$PDFETEX"; then -+ ac_cv_prog_PDFETEX="$PDFETEX" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_PDFETEX="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+PDFETEX=$ac_cv_prog_PDFETEX -+if test -n "$PDFETEX"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFETEX" >&5 -+$as_echo "$PDFETEX" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$PDFETEX" && break -+done -+test -n "$PDFETEX" || PDFETEX=": pdfetex" -+ -+for ac_prog in texi2pdf -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_TEXI2PDF+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$TEXI2PDF"; then -+ ac_cv_prog_TEXI2PDF="$TEXI2PDF" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_TEXI2PDF="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+TEXI2PDF=$ac_cv_prog_TEXI2PDF -+if test -n "$TEXI2PDF"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2PDF" >&5 -+$as_echo "$TEXI2PDF" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$TEXI2PDF" && break -+done -+ -+for ac_prog in texi2html -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_TEXI2HTML+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$TEXI2HTML"; then -+ ac_cv_prog_TEXI2HTML="$TEXI2HTML" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_TEXI2HTML="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+TEXI2HTML=$ac_cv_prog_TEXI2HTML -+if test -n "$TEXI2HTML"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2HTML" >&5 -+$as_echo "$TEXI2HTML" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$TEXI2HTML" && break -+done -+ -+for ac_prog in ansi2knr -+do -+ # Extract the first word of "$ac_prog", so it can be a program name with args. -+set dummy $ac_prog; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_ANSI2KNR+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$ANSI2KNR"; then -+ ac_cv_prog_ANSI2KNR="$ANSI2KNR" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_ANSI2KNR="$ac_prog" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+ANSI2KNR=$ac_cv_prog_ANSI2KNR -+if test -n "$ANSI2KNR"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANSI2KNR" >&5 -+$as_echo "$ANSI2KNR" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ test -n "$ANSI2KNR" && break -+done -+test -n "$ANSI2KNR" || ANSI2KNR=": ansi2knr" -+ -+ -+if test x"$ansi2knr" = xyes && test x"$ANSI2KNR" = x": ansi2knr"; then -+ echo "----------" -+ echo "configure fatal error:" -+ echo "ansi2knr was specified (--enable-ansi2knr) but the program could not be found." -+ echo "Either remove the configure option if it is not required or build the ansi2knr" -+ echo "program before reconfiguring Zsh. The source code for ansi2knr is also" -+ echo "available in the GPL directory on Zsh distribution sites." -+ exit 1 -+fi -+ -+ac_header_dirent=no -+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do -+ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 -+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } -+if eval \${$as_ac_Header+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include <$ac_hdr> -+ -+int -+main () -+{ -+if ((DIR *) 0) -+return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ eval "$as_ac_Header=yes" -+else -+ eval "$as_ac_Header=no" -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+eval ac_res=\$$as_ac_Header -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 -+_ACEOF -+ -+ac_header_dirent=$ac_hdr; break -+fi -+ -+done -+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. -+if test $ac_header_dirent = dirent.h; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -+$as_echo_n "checking for library containing opendir... " >&6; } -+if ${ac_cv_search_opendir+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char opendir (); -+int -+main () -+{ -+return opendir (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' dir; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_opendir=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_opendir+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_opendir+:} false; then : -+ -+else -+ ac_cv_search_opendir=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -+$as_echo "$ac_cv_search_opendir" >&6; } -+ac_res=$ac_cv_search_opendir -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 -+$as_echo_n "checking for library containing opendir... " >&6; } -+if ${ac_cv_search_opendir+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char opendir (); -+int -+main () -+{ -+return opendir (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' x; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_opendir=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_opendir+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_opendir+:} false; then : -+ -+else -+ ac_cv_search_opendir=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 -+$as_echo "$ac_cv_search_opendir" >&6; } -+ac_res=$ac_cv_search_opendir -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -+$as_echo_n "checking for ANSI C header files... " >&6; } -+if ${ac_cv_header_stdc+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#include -+#include -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_stdc=yes -+else -+ ac_cv_header_stdc=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+if test $ac_cv_header_stdc = yes; then -+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "memchr" >/dev/null 2>&1; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f conftest* -+ -+fi -+ -+if test $ac_cv_header_stdc = yes; then -+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "free" >/dev/null 2>&1; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f conftest* -+ -+fi -+ -+if test $ac_cv_header_stdc = yes; then -+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -+ if test "$cross_compiling" = yes; then : -+ : -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#if ((' ' & 0x0FF) == 0x020) -+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -+#else -+# define ISLOWER(c) \ -+ (('a' <= (c) && (c) <= 'i') \ -+ || ('j' <= (c) && (c) <= 'r') \ -+ || ('s' <= (c) && (c) <= 'z')) -+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -+#endif -+ -+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -+int -+main () -+{ -+ int i; -+ for (i = 0; i < 256; i++) -+ if (XOR (islower (i), ISLOWER (i)) -+ || toupper (i) != TOUPPER (i)) -+ return 2; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ -+else -+ ac_cv_header_stdc=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -+$as_echo "$ac_cv_header_stdc" >&6; } -+if test $ac_cv_header_stdc = yes; then -+ -+$as_echo "#define STDC_HEADERS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 -+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } -+if ${ac_cv_header_time+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#include -+ -+int -+main () -+{ -+if ((struct tm *) 0) -+return 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_time=yes -+else -+ ac_cv_header_time=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 -+$as_echo "$ac_cv_header_time" >&6; } -+if test $ac_cv_header_time = yes; then -+ -+$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 -+$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } -+if ${ac_cv_header_stat_broken+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+ -+#if defined S_ISBLK && defined S_IFDIR -+extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; -+#endif -+ -+#if defined S_ISBLK && defined S_IFCHR -+extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; -+#endif -+ -+#if defined S_ISLNK && defined S_IFREG -+extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; -+#endif -+ -+#if defined S_ISSOCK && defined S_IFREG -+extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; -+#endif -+ -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_stat_broken=no -+else -+ ac_cv_header_stat_broken=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 -+$as_echo "$ac_cv_header_stat_broken" >&6; } -+if test $ac_cv_header_stat_broken = yes; then -+ -+$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 -+$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -+if ${ac_cv_header_sys_wait_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+#ifndef WEXITSTATUS -+# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) -+#endif -+#ifndef WIFEXITED -+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) -+#endif -+ -+int -+main () -+{ -+ int s; -+ wait (&s); -+ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_sys_wait_h=yes -+else -+ ac_cv_header_sys_wait_h=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 -+$as_echo "$ac_cv_header_sys_wait_h" >&6; } -+if test $ac_cv_header_sys_wait_h = yes; then -+ -+$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h -+ -+fi -+ -+ -+oldcflags="$CFLAGS" -+if test x$enable_pcre = xyes; then -+# Extract the first word of "pcre-config", so it can be a program name with args. -+set dummy pcre-config; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_prog_PCRECONF+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -n "$PCRECONF"; then -+ ac_cv_prog_PCRECONF="$PCRECONF" # Let the user override the test. -+else -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then -+ ac_cv_prog_PCRECONF="pcre-config" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+fi -+fi -+PCRECONF=$ac_cv_prog_PCRECONF -+if test -n "$PCRECONF"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRECONF" >&5 -+$as_echo "$PCRECONF" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then -+ CPPFLAGS="$CPPFLAGS `pcre-config --cflags`" -+fi -+fi -+ -+for ac_header in sys/time.h sys/times.h sys/select.h termcap.h termio.h \ -+ termios.h sys/param.h sys/filio.h string.h memory.h \ -+ limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \ -+ locale.h errno.h stdio.h stdarg.h varargs.h stdlib.h \ -+ unistd.h sys/capability.h \ -+ utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ -+ netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \ -+ sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ -+ ncurses/ncurses.h -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+if test x$dynamic = xyes; then -+ for ac_header in dlfcn.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" -+if test "x$ac_cv_header_dlfcn_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_DLFCN_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ for ac_header in dl.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" -+if test "x$ac_cv_header_dl_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_DL_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+fi -+ -+ -+if test x$ac_cv_header_sys_time_h = xyes && test x$ac_cv_header_sys_select_h = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for conflicts in sys/time.h and sys/select.h" >&5 -+$as_echo_n "checking for conflicts in sys/time.h and sys/select.h... " >&6; } -+if ${zsh_cv_header_time_h_select_h_conflicts+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_time_h_select_h_conflicts=no -+else -+ zsh_cv_header_time_h_select_h_conflicts=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_time_h_select_h_conflicts" >&5 -+$as_echo "$zsh_cv_header_time_h_select_h_conflicts" >&6; } -+ if test x$zsh_cv_header_time_h_select_h_conflicts = xyes; then -+ $as_echo "#define TIME_H_SELECT_H_CONFLICTS 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+if test x$ac_cv_header_termios_h = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in termios.h" >&5 -+$as_echo_n "checking TIOCGWINSZ in termios.h... " >&6; } -+if ${zsh_cv_header_termios_h_tiocgwinsz+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#include -+int -+main () -+{ -+int x = TIOCGWINSZ; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_header_termios_h_tiocgwinsz=yes -+else -+ zsh_cv_header_termios_h_tiocgwinsz=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_termios_h_tiocgwinsz" >&5 -+$as_echo "$zsh_cv_header_termios_h_tiocgwinsz" >&6; } -+else -+ zsh_cv_header_termios_h_tiocgwinsz=no -+fi -+if test x$zsh_cv_header_termios_h_tiocgwinsz = xno; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in sys/ioctl.h" >&5 -+$as_echo_n "checking TIOCGWINSZ in sys/ioctl.h... " >&6; } -+if ${zsh_cv_header_sys_ioctl_h_tiocgwinsz+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#include -+int -+main () -+{ -+int x = TIOCGWINSZ; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_header_sys_ioctl_h_tiocgwinsz=yes -+else -+ zsh_cv_header_sys_ioctl_h_tiocgwinsz=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_ioctl_h_tiocgwinsz" >&5 -+$as_echo "$zsh_cv_header_sys_ioctl_h_tiocgwinsz" >&6; } -+ if test x$zsh_cv_header_sys_ioctl_h_tiocgwinsz = xyes; then -+ $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for streams headers including struct winsize" >&5 -+$as_echo_n "checking for streams headers including struct winsize... " >&6; } -+if ${ac_cv_winsize_in_ptem+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+int -+main () -+{ -+struct winsize wsz -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_winsize_in_ptem=yes -+else -+ ac_cv_winsize_in_ptem=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_winsize_in_ptem" >&5 -+$as_echo "$ac_cv_winsize_in_ptem" >&6; } -+if test x$ac_cv_winsize_in_ptem = xyes; then -+ $as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf in -lc" >&5 -+$as_echo_n "checking for printf in -lc... " >&6; } -+if ${ac_cv_lib_c_printf+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lc $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char printf (); -+int -+main () -+{ -+return printf (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_c_printf=yes -+else -+ ac_cv_lib_c_printf=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_printf" >&5 -+$as_echo "$ac_cv_lib_c_printf" >&6; } -+if test "x$ac_cv_lib_c_printf" = xyes; then : -+ LIBS="$LIBS -lc" -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 -+$as_echo_n "checking for pow in -lm... " >&6; } -+if ${ac_cv_lib_m_pow+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lm $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char pow (); -+int -+main () -+{ -+return pow (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_m_pow=yes -+else -+ ac_cv_lib_m_pow=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 -+$as_echo "$ac_cv_lib_m_pow" >&6; } -+if test "x$ac_cv_lib_m_pow" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_LIBM 1 -+_ACEOF -+ -+ LIBS="-lm $LIBS" -+ -+fi -+ -+ -+if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes || test x$ac_cv_header_ncursesw_ncurses_h = xyes; then -+ ncursesw_test=ncursesw -+ ncurses_test=ncurses -+else -+ ncursesw_test= -+ ncurses_test= -+fi -+ -+ -+# Check whether --with-term-lib was given. -+if test "${with_term_lib+set}" = set; then : -+ withval=$with_term_lib; if test "x$withval" != xno && test "x$withval" != x ; then -+ termcap_curses_order="$withval" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tigetstr" >&5 -+$as_echo_n "checking for library containing tigetstr... " >&6; } -+if ${ac_cv_search_tigetstr+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char tigetstr (); -+int -+main () -+{ -+return tigetstr (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' $termcap_curses_order; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_tigetstr=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_tigetstr+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_tigetstr+:} false; then : -+ -+else -+ ac_cv_search_tigetstr=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tigetstr" >&5 -+$as_echo "$ac_cv_search_tigetstr" >&6; } -+ac_res=$ac_cv_search_tigetstr -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+else -+ termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" -+fi -+else -+ case "$host_os" in -+ solaris*) -+ termcap_curses_order="$ncursesw_test $ncurses_test curses termcap" ;; -+ hpux10.*|hpux11.*) -+ DL_EXT="${DL_EXT=sl}" -+ termcap_curses_order="Hcurses $ncursesw_test $ncurses_test curses termcap" ;; -+ *) -+ termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" ;; -+esac -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if _XOPEN_SOURCE_EXTENDED should not be defined" >&5 -+$as_echo_n "checking if _XOPEN_SOURCE_EXTENDED should not be defined... " >&6; } -+if ${zsh_cv_no_xopen+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case "$host_os" in -+ *openbsd*|*freebsd5*|*freebsd6.[012]*|*aix*) -+ zsh_cv_no_xopen=yes -+ ;; -+ *) -+ zsh_cv_no_xopen=no -+ ;; -+esac -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_no_xopen" >&5 -+$as_echo "$zsh_cv_no_xopen" >&6; } -+if test x$zsh_cv_no_xopen = xyes; then -+ $as_echo "#define ZSH_NO_XOPEN 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tigetflag" >&5 -+$as_echo_n "checking for library containing tigetflag... " >&6; } -+if ${ac_cv_search_tigetflag+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char tigetflag (); -+int -+main () -+{ -+return tigetflag (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' $termcap_curses_order; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_tigetflag=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_tigetflag+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_tigetflag+:} false; then : -+ -+else -+ ac_cv_search_tigetflag=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tigetflag" >&5 -+$as_echo "$ac_cv_search_tigetflag" >&6; } -+ac_res=$ac_cv_search_tigetflag -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 -+$as_echo_n "checking for library containing tgetent... " >&6; } -+if ${ac_cv_search_tgetent+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char tgetent (); -+int -+main () -+{ -+return tgetent (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' $termcap_curses_order; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_tgetent=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_tgetent+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_tgetent+:} false; then : -+ -+else -+ ac_cv_search_tgetent=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5 -+$as_echo "$ac_cv_search_tgetent" >&6; } -+ac_res=$ac_cv_search_tgetent -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ true -+else -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error 255 "\"No terminal handling library was found on your system. -+This is probably a library called 'curses' or 'ncurses'. You may -+need to install a package called 'curses-devel' or 'ncurses-devel' on your -+system.\" -+See \`config.log' for more details" "$LINENO" 5; } -+fi -+ -+for ac_header in curses.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" -+if test "x$ac_cv_header_curses_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_CURSES_H 1 -+_ACEOF -+ -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris 8 curses.h mistake" >&5 -+$as_echo_n "checking for Solaris 8 curses.h mistake... " >&6; } -+if ${ac_cv_header_curses_solaris+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_header_curses_h=yes -+ac_cv_header_curses_solaris=yes -+else -+ ac_cv_header_curses_h=no -+ac_cv_header_curses_solaris=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_curses_solaris" >&5 -+$as_echo "$ac_cv_header_curses_solaris" >&6; } -+if test x$ac_cv_header_curses_solaris = xyes; then -+$as_echo "#define HAVE_CURSES_H 1" >>confdefs.h -+ -+fi -+fi -+ -+done -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to ignore ncurses" >&5 -+$as_echo_n "checking if we need to ignore ncurses... " >&6; } -+if ${zsh_cv_ignore_ncurses+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $LIBS in -+ *-lncurses*) -+ zsh_cv_ignore_ncurses=no -+ ;; -+ *) -+ zsh_cv_ignore_ncurses=yes -+ ;; -+esac -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_ignore_ncurses" >&5 -+$as_echo "$zsh_cv_ignore_ncurses" >&6; } -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getpwnam" >&5 -+$as_echo_n "checking for library containing getpwnam... " >&6; } -+if ${ac_cv_search_getpwnam+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char getpwnam (); -+int -+main () -+{ -+return getpwnam (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' nsl; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_getpwnam=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_getpwnam+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_getpwnam+:} false; then : -+ -+else -+ ac_cv_search_getpwnam=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getpwnam" >&5 -+$as_echo "$ac_cv_search_getpwnam" >&6; } -+ac_res=$ac_cv_search_getpwnam -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+ -+if test `echo $host_os | sed 's/^\(unicos\).*/\1/'` = unicos; then -+ LIBS="-lcraylm -lkrb -lnisdb -lnsl -lrpcsvc $LIBS" -+fi -+ -+if test "x$dynamic" = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -+$as_echo_n "checking for dlopen in -ldl... " >&6; } -+if ${ac_cv_lib_dl_dlopen+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-ldl $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char dlopen (); -+int -+main () -+{ -+return dlopen (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_dl_dlopen=yes -+else -+ ac_cv_lib_dl_dlopen=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -+$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -+if test "x$ac_cv_lib_dl_dlopen" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_LIBDL 1 -+_ACEOF -+ -+ LIBS="-ldl $LIBS" -+ -+fi -+ -+fi -+ -+if test x$enable_cap = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap" >&5 -+$as_echo_n "checking for cap_get_proc in -lcap... " >&6; } -+if ${ac_cv_lib_cap_cap_get_proc+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lcap $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char cap_get_proc (); -+int -+main () -+{ -+return cap_get_proc (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_cap_cap_get_proc=yes -+else -+ ac_cv_lib_cap_cap_get_proc=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_proc" >&5 -+$as_echo "$ac_cv_lib_cap_cap_get_proc" >&6; } -+if test "x$ac_cv_lib_cap_cap_get_proc" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_LIBCAP 1 -+_ACEOF -+ -+ LIBS="-lcap $LIBS" -+ -+fi -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 -+$as_echo_n "checking for socket in -lsocket... " >&6; } -+if ${ac_cv_lib_socket_socket+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lsocket $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char socket (); -+int -+main () -+{ -+return socket (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_socket_socket=yes -+else -+ ac_cv_lib_socket_socket=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 -+$as_echo "$ac_cv_lib_socket_socket" >&6; } -+if test "x$ac_cv_lib_socket_socket" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_LIBSOCKET 1 -+_ACEOF -+ -+ LIBS="-lsocket $LIBS" -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname2" >&5 -+$as_echo_n "checking for library containing gethostbyname2... " >&6; } -+if ${ac_cv_search_gethostbyname2+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char gethostbyname2 (); -+int -+main () -+{ -+return gethostbyname2 (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' bind; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_gethostbyname2=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_gethostbyname2+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_gethostbyname2+:} false; then : -+ -+else -+ ac_cv_search_gethostbyname2=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname2" >&5 -+$as_echo "$ac_cv_search_gethostbyname2" >&6; } -+ac_res=$ac_cv_search_gethostbyname2 -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+ -+case $LIBS in -+ *-lbind*) -+ for ac_header in bind/netdb.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "bind/netdb.h" "ac_cv_header_bind_netdb_h" "$ac_includes_default" -+if test "x$ac_cv_header_bind_netdb_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_BIND_NETDB_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ ;; -+esac -+ -+ -+if test "x$ac_cv_header_iconv_h" = "xyes"; then -+ ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" -+if test "x$ac_cv_func_iconv" = xyes; then : -+ ac_found_iconv=yes -+else -+ ac_found_iconv=no -+fi -+ -+ if test "x$ac_found_iconv" = "xno"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 -+$as_echo_n "checking for iconv in -liconv... " >&6; } -+if ${ac_cv_lib_iconv_iconv+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-liconv $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char iconv (); -+int -+main () -+{ -+return iconv (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_iconv_iconv=yes -+else -+ ac_cv_lib_iconv_iconv=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5 -+$as_echo "$ac_cv_lib_iconv_iconv" >&6; } -+if test "x$ac_cv_lib_iconv_iconv" = xyes; then : -+ ac_found_iconv=yes -+fi -+ -+ if test "x$ac_found_iconv" = "xno"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 -+$as_echo_n "checking for libiconv in -liconv... " >&6; } -+if ${ac_cv_lib_iconv_libiconv+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-liconv $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char libiconv (); -+int -+main () -+{ -+return libiconv (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_iconv_libiconv=yes -+else -+ ac_cv_lib_iconv_libiconv=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 -+$as_echo "$ac_cv_lib_iconv_libiconv" >&6; } -+if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : -+ ac_found_iconv=yes -+fi -+ -+ fi -+ if test "x$ac_found_iconv" != "xno"; then -+ LIBS="-liconv $LIBS" -+ fi -+ else -+ ac_fn_c_check_decl "$LINENO" "_libiconv_version" "ac_cv_have_decl__libiconv_version" " #include -+" -+if test "x$ac_cv_have_decl__libiconv_version" = xyes; then : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 -+$as_echo_n "checking for libiconv in -liconv... " >&6; } -+if ${ac_cv_lib_iconv_libiconv+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-liconv $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char libiconv (); -+int -+main () -+{ -+return libiconv (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_iconv_libiconv=yes -+else -+ ac_cv_lib_iconv_libiconv=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 -+$as_echo "$ac_cv_lib_iconv_libiconv" >&6; } -+if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : -+ LIBS="-liconv $LIBS" -+fi -+ -+fi -+ -+ fi -+fi -+ -+if test "x$ac_found_iconv" = xyes; then -+ -+$as_echo "#define HAVE_ICONV 1" >>confdefs.h -+ -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+int myversion = _libiconv_version -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define ICONV_FROM_LIBICONV 1" >>confdefs.h -+ -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+ -+if test "x$ac_found_iconv" = "xyes"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 -+$as_echo_n "checking for iconv declaration... " >&6; } -+if ${ac_cv_iconv_const+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ #include -+int -+main () -+{ -+#ifdef __cplusplus -+ "C" -+ #endif -+ #if defined(__STDC__) || defined(__cplusplus) -+ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); -+ #else -+ size_t iconv(); -+ #endif -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_iconv_const= -+else -+ ac_cv_iconv_const=const -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_iconv_const" >&5 -+$as_echo "$ac_cv_iconv_const" >&6; } -+ -+cat >>confdefs.h <<_ACEOF -+#define ICONV_CONST $ac_cv_iconv_const -+_ACEOF -+ -+fi -+ -+if test x$enable_pcre = xyes; then -+ LIBS="`pcre-config --libs` $LIBS" -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if an include file defines ospeed" >&5 -+$as_echo_n "checking if an include file defines ospeed... " >&6; } -+if ${zsh_cv_decl_ospeed_include_defines+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#if HAVE_TERMIOS_H -+#include -+#endif -+#if HAVE_TERMCAP_H -+#include -+#endif -+int -+main () -+{ -+ospeed = 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_decl_ospeed_include_defines=yes -+else -+ zsh_cv_decl_ospeed_include_defines=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_ospeed_include_defines" >&5 -+$as_echo "$zsh_cv_decl_ospeed_include_defines" >&6; } -+ -+if test x$zsh_cv_decl_ospeed_include_defines = xno; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you must define ospeed" >&5 -+$as_echo_n "checking if you must define ospeed... " >&6; } -+if ${zsh_cv_decl_ospeed_must_define+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+extern short ospeed; ospeed = 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_decl_ospeed_must_define=yes -+else -+ zsh_cv_decl_ospeed_must_define=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_ospeed_must_define" >&5 -+$as_echo "$zsh_cv_decl_ospeed_must_define" >&6; } -+fi -+ -+ -+ -+if test x$zsh_cv_decl_ospeed_include_defines = xyes; then -+ $as_echo "#define HAVE_OSPEED 1" >>confdefs.h -+ -+elif test x$zsh_cv_decl_ospeed_must_define = xyes; then -+ $as_echo "#define HAVE_OSPEED 1" >>confdefs.h -+ -+ $as_echo "#define MUST_DEFINE_OSPEED 1" >>confdefs.h -+ -+fi -+ -+if test x$gdbm != xno; then -+ for ac_header in gdbm.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default" -+if test "x$ac_cv_header_gdbm_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_GDBM_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbm_open in -lgdbm" >&5 -+$as_echo_n "checking for gdbm_open in -lgdbm... " >&6; } -+if ${ac_cv_lib_gdbm_gdbm_open+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lgdbm $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char gdbm_open (); -+int -+main () -+{ -+return gdbm_open (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_gdbm_gdbm_open=yes -+else -+ ac_cv_lib_gdbm_gdbm_open=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5 -+$as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; } -+if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_LIBGDBM 1 -+_ACEOF -+ -+ LIBS="-lgdbm $LIBS" -+ -+fi -+ -+fi -+ -+for ac_header in sys/xattr.h -+do : -+ ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" -+if test "x$ac_cv_header_sys_xattr_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_SYS_XATTR_H 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -+$as_echo_n "checking return type of signal handlers... " >&6; } -+if ${ac_cv_type_signal+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+ -+int -+main () -+{ -+return *(signal (0, 0)) (0) == 1; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_type_signal=int -+else -+ ac_cv_type_signal=void -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -+$as_echo "$ac_cv_type_signal" >&6; } -+ -+cat >>confdefs.h <<_ACEOF -+#define RETSIGTYPE $ac_cv_type_signal -+_ACEOF -+ -+ -+ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -+if test "x$ac_cv_type_pid_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define pid_t int -+_ACEOF -+ -+fi -+ -+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -+if test "x$ac_cv_type_off_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define off_t long int -+_ACEOF -+ -+fi -+ -+ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" -+if test "x$ac_cv_type_ino_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define ino_t unsigned long -+_ACEOF -+ -+fi -+ -+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -+if test "x$ac_cv_type_mode_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define mode_t int -+_ACEOF -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -+$as_echo_n "checking for uid_t in sys/types.h... " >&6; } -+if ${ac_cv_type_uid_t+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ -+_ACEOF -+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | -+ $EGREP "uid_t" >/dev/null 2>&1; then : -+ ac_cv_type_uid_t=yes -+else -+ ac_cv_type_uid_t=no -+fi -+rm -f conftest* -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -+$as_echo "$ac_cv_type_uid_t" >&6; } -+if test $ac_cv_type_uid_t = no; then -+ -+$as_echo "#define uid_t int" >>confdefs.h -+ -+ -+$as_echo "#define gid_t int" >>confdefs.h -+ -+fi -+ -+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -+if test "x$ac_cv_type_size_t" = xyes; then : -+ -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define size_t unsigned int -+_ACEOF -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if long is 64 bits" >&5 -+$as_echo_n "checking if long is 64 bits... " >&6; } -+if ${zsh_cv_long_is_64_bit+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_long_is_64_bit=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+int main() { return sizeof(long) < 8; } -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_long_is_64_bit=yes -+else -+ zsh_cv_long_is_64_bit=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_long_is_64_bit" >&5 -+$as_echo "$zsh_cv_long_is_64_bit" >&6; } -+ -+ -+ -+ -+ -+ -+ -+if test x$zsh_cv_long_is_64_bit = xyes; then -+ $as_echo "#define LONG_IS_64_BIT 1" >>confdefs.h -+ -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if off_t is 64 bit" >&5 -+$as_echo_n "checking if off_t is 64 bit... " >&6; } -+if ${zsh_cv_off_t_is_64_bit+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_off_t_is_64_bit=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+ -+main() { return sizeof(off_t) < 8; } -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_off_t_is_64_bit=yes -+else -+ zsh_cv_off_t_is_64_bit=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_off_t_is_64_bit" >&5 -+$as_echo "$zsh_cv_off_t_is_64_bit" >&6; } -+ if test x$zsh_cv_off_t_is_64_bit = xyes; then -+ $as_echo "#define OFF_T_IS_64_BIT 1" >>confdefs.h -+ -+ fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ino_t is 64 bit" >&5 -+$as_echo_n "checking if ino_t is 64 bit... " >&6; } -+if ${zsh_cv_ino_t_is_64_bit+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_ino_t_is_64_bit=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+ -+main() { return sizeof(ino_t) < 8; } -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_ino_t_is_64_bit=yes -+else -+ zsh_cv_ino_t_is_64_bit=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_ino_t_is_64_bit" >&5 -+$as_echo "$zsh_cv_ino_t_is_64_bit" >&6; } -+ if test x$zsh_cv_ino_t_is_64_bit = xyes; then -+ $as_echo "#define INO_T_IS_64_BIT 1" >>confdefs.h -+ -+ fi -+ -+ if test x$enable_largefile != xno -o x$zsh_cv_off_t_is_64_bit = xyes \ -+ -o $zsh_cv_ino_t_is_64_bit = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler has a 64 bit type" >&5 -+$as_echo_n "checking if compiler has a 64 bit type... " >&6; } -+if ${zsh_cv_64_bit_type+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ if test x != x ; then -+ zsh_cv_64_bit_type="long long" -+ else -+ zsh_cv_64_bit_type=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ long long foo = 0; -+ int bar = (int) foo; -+ return sizeof(long long) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_type="long long" -+else -+ zsh_cv_64_bit_type=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ if test "$zsh_cv_64_bit_type" = no; then -+ if test "$cross_compiling" = yes; then : -+ if test x != x ; then -+ zsh_cv_64_bit_type="quad_t" -+ else -+ zsh_cv_64_bit_type=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ quad_t foo = 0; -+ int bar = (int) foo; -+ return sizeof(quad_t) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_type="quad_t" -+else -+ zsh_cv_64_bit_type=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ fi -+ if test "$zsh_cv_64_bit_type" = no; then -+ if test "$cross_compiling" = yes; then : -+ if test x != x ; then -+ zsh_cv_64_bit_type="__int64_t" -+ else -+ zsh_cv_64_bit_type=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ __int64_t foo = 0; -+ int bar = (int) foo; -+ return sizeof(__int64_t) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_type="__int64_t" -+else -+ zsh_cv_64_bit_type=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ fi -+ if test "$zsh_cv_64_bit_type" = no && -+ test "$zsh_cv_off_t_is_64_bit" = yes; then -+ if test "$cross_compiling" = yes; then : -+ if test x != x ; then -+ zsh_cv_64_bit_type="off_t" -+ else -+ zsh_cv_64_bit_type=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ off_t foo = 0; -+ int bar = (int) foo; -+ return sizeof(off_t) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_type="off_t" -+else -+ zsh_cv_64_bit_type=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_64_bit_type" >&5 -+$as_echo "$zsh_cv_64_bit_type" >&6; } -+ if test "$zsh_cv_64_bit_type" != no; then -+ cat >>confdefs.h <<_ACEOF -+#define ZSH_64_BIT_TYPE $zsh_cv_64_bit_type -+_ACEOF -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a corresponding unsigned 64 bit type" >&5 -+$as_echo_n "checking for a corresponding unsigned 64 bit type... " >&6; } -+if ${zsh_cv_64_bit_utype+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ if test xforce != x ; then -+ zsh_cv_64_bit_utype="unsigned $zsh_cv_64_bit_type" -+ else -+ zsh_cv_64_bit_utype=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ unsigned $zsh_cv_64_bit_type foo = 0; -+ int bar = (int) foo; -+ return sizeof(unsigned $zsh_cv_64_bit_type) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_utype="unsigned $zsh_cv_64_bit_type" -+else -+ zsh_cv_64_bit_utype=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ if test "$zsh_cv_64_bit_utype" = no; then -+ if test "$cross_compiling" = yes; then : -+ if test x != x ; then -+ zsh_cv_64_bit_utype="__uint64_t" -+ else -+ zsh_cv_64_bit_utype=no -+ fi -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+#include -+#endif -+ -+main() -+{ -+ __uint64_t foo = 0; -+ int bar = (int) foo; -+ return sizeof(__uint64_t) != 8; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_64_bit_utype="__uint64_t" -+else -+ zsh_cv_64_bit_utype=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ -+ fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_64_bit_utype" >&5 -+$as_echo "$zsh_cv_64_bit_utype" >&6; } -+ if test "$zsh_cv_64_bit_utype" != no; then -+ cat >>confdefs.h <<_ACEOF -+#define ZSH_64_BIT_UTYPE $zsh_cv_64_bit_utype -+_ACEOF -+ -+ fi -+ fi -+ fi -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigset_t" >&5 -+$as_echo_n "checking for sigset_t... " >&6; } -+if ${zsh_cv_type_sigset_t+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#define _POSIX_C_SOURCE 200809L -+#include -+#include -+int -+main () -+{ -+sigset_t tempsigset; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_sigset_t=yes -+else -+ zsh_cv_type_sigset_t=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_sigset_t" >&5 -+$as_echo "$zsh_cv_type_sigset_t" >&6; } -+ -+if test x$zsh_cv_type_sigset_t = xno; then -+ $as_echo "#define sigset_t unsigned int" >>confdefs.h -+ -+fi -+ -+ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.tv_nsec" "ac_cv_member_struct_stat_st_mtim_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_mtim_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec.tv_nsec" "ac_cv_member_struct_stat_st_mtimespec_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_mtimespec_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim.tv_nsec" "ac_cv_member_struct_stat_st_ctim_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_ctim_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimespec.tv_nsec" "ac_cv_member_struct_stat_st_ctimespec_tv_nsec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_ctimespec_tv_nsec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimensec" "ac_cv_member_struct_stat_st_ctimensec" "$ac_includes_default" -+if test "x$ac_cv_member_struct_stat_st_ctimensec" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_STAT_ST_CTIMENSEC 1 -+_ACEOF -+ -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone" >&5 -+$as_echo_n "checking for struct timezone... " >&6; } -+if ${zsh_cv_type_exists_struct_timezone+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#define _GNU_SOURCE 1 -+#ifdef HAVE_SYS_TIME_H -+# include -+#endif -+ -+int -+main () -+{ -+struct timezone testvar; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_exists_struct_timezone=yes -+else -+ zsh_cv_type_exists_struct_timezone=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_timezone" >&5 -+$as_echo "$zsh_cv_type_exists_struct_timezone" >&6; } -+ -+if test $zsh_cv_type_exists_struct_timezone = yes; then -+ $as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utmp" >&5 -+$as_echo_n "checking for struct utmp... " >&6; } -+if ${zsh_cv_type_exists_struct_utmp+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMP_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmp testvar; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_exists_struct_utmp=yes -+else -+ zsh_cv_type_exists_struct_utmp=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_utmp" >&5 -+$as_echo "$zsh_cv_type_exists_struct_utmp" >&6; } -+ -+if test $zsh_cv_type_exists_struct_utmp = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMP 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utmpx" >&5 -+$as_echo_n "checking for struct utmpx... " >&6; } -+if ${zsh_cv_type_exists_struct_utmpx+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMPX_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmpx testvar; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_exists_struct_utmpx=yes -+else -+ zsh_cv_type_exists_struct_utmpx=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_utmpx" >&5 -+$as_echo "$zsh_cv_type_exists_struct_utmpx" >&6; } -+ -+if test $zsh_cv_type_exists_struct_utmpx = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMPX 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host in struct utmp" >&5 -+$as_echo_n "checking for ut_host in struct utmp... " >&6; } -+if ${zsh_cv_struct_member_struct_utmp_ut_host+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMP_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmp testvar; testvar.ut_host; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_utmp_ut_host=yes -+else -+ zsh_cv_struct_member_struct_utmp_ut_host=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmp_ut_host" >&5 -+$as_echo "$zsh_cv_struct_member_struct_utmp_ut_host" >&6; } -+ -+if test $zsh_cv_struct_member_struct_utmp_ut_host = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMP_UT_HOST 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host in struct utmpx" >&5 -+$as_echo_n "checking for ut_host in struct utmpx... " >&6; } -+if ${zsh_cv_struct_member_struct_utmpx_ut_host+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMPX_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmpx testvar; testvar.ut_host; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_utmpx_ut_host=yes -+else -+ zsh_cv_struct_member_struct_utmpx_ut_host=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_host" >&5 -+$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_host" >&6; } -+ -+if test $zsh_cv_struct_member_struct_utmpx_ut_host = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMPX_UT_HOST 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_xtime in struct utmpx" >&5 -+$as_echo_n "checking for ut_xtime in struct utmpx... " >&6; } -+if ${zsh_cv_struct_member_struct_utmpx_ut_xtime+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMPX_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmpx testvar; testvar.ut_xtime; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_utmpx_ut_xtime=yes -+else -+ zsh_cv_struct_member_struct_utmpx_ut_xtime=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_xtime" >&5 -+$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_xtime" >&6; } -+ -+if test $zsh_cv_struct_member_struct_utmpx_ut_xtime = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMPX_UT_XTIME 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_tv in struct utmpx" >&5 -+$as_echo_n "checking for ut_tv in struct utmpx... " >&6; } -+if ${zsh_cv_struct_member_struct_utmpx_ut_tv+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_UTMPX_H -+# include -+#endif -+ -+int -+main () -+{ -+struct utmpx testvar; testvar.ut_tv; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_utmpx_ut_tv=yes -+else -+ zsh_cv_struct_member_struct_utmpx_ut_tv=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_tv" >&5 -+$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_tv" >&6; } -+ -+if test $zsh_cv_struct_member_struct_utmpx_ut_tv = yes; then -+ $as_echo "#define HAVE_STRUCT_UTMPX_UT_TV 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino in struct dirent" >&5 -+$as_echo_n "checking for d_ino in struct dirent... " >&6; } -+if ${zsh_cv_struct_member_struct_dirent_d_ino+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_DIRENT_H -+# include -+#endif -+ -+int -+main () -+{ -+struct dirent testvar; testvar.d_ino; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_dirent_d_ino=yes -+else -+ zsh_cv_struct_member_struct_dirent_d_ino=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_dirent_d_ino" >&5 -+$as_echo "$zsh_cv_struct_member_struct_dirent_d_ino" >&6; } -+ -+if test $zsh_cv_struct_member_struct_dirent_d_ino = yes; then -+ $as_echo "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_stat in struct dirent" >&5 -+$as_echo_n "checking for d_stat in struct dirent... " >&6; } -+if ${zsh_cv_struct_member_struct_dirent_d_stat+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_DIRENT_H -+# include -+#endif -+ -+int -+main () -+{ -+struct dirent testvar; testvar.d_stat; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_dirent_d_stat=yes -+else -+ zsh_cv_struct_member_struct_dirent_d_stat=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_dirent_d_stat" >&5 -+$as_echo "$zsh_cv_struct_member_struct_dirent_d_stat" >&6; } -+ -+if test $zsh_cv_struct_member_struct_dirent_d_stat = yes; then -+ $as_echo "#define HAVE_STRUCT_DIRENT_D_STAT 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino in struct direct" >&5 -+$as_echo_n "checking for d_ino in struct direct... " >&6; } -+if ${zsh_cv_struct_member_struct_direct_d_ino+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_SYS_NDIR_H -+# include -+#endif -+#ifdef HAVE_SYS_DIR_H -+# include -+#endif -+#ifdef HAVE_NDIR_H -+# include -+#endif -+ -+int -+main () -+{ -+struct direct testvar; testvar.d_ino; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_direct_d_ino=yes -+else -+ zsh_cv_struct_member_struct_direct_d_ino=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_direct_d_ino" >&5 -+$as_echo "$zsh_cv_struct_member_struct_direct_d_ino" >&6; } -+ -+if test $zsh_cv_struct_member_struct_direct_d_ino = yes; then -+ $as_echo "#define HAVE_STRUCT_DIRECT_D_INO 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_stat in struct direct" >&5 -+$as_echo_n "checking for d_stat in struct direct... " >&6; } -+if ${zsh_cv_struct_member_struct_direct_d_stat+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#ifdef HAVE_SYS_NDIR_H -+# include -+#endif -+#ifdef HAVE_SYS_DIR_H -+# include -+#endif -+#ifdef HAVE_NDIR_H -+# include -+#endif -+ -+int -+main () -+{ -+struct direct testvar; testvar.d_stat; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_direct_d_stat=yes -+else -+ zsh_cv_struct_member_struct_direct_d_stat=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_direct_d_stat" >&5 -+$as_echo "$zsh_cv_struct_member_struct_direct_d_stat" >&6; } -+ -+if test $zsh_cv_struct_member_struct_direct_d_stat = yes; then -+ $as_echo "#define HAVE_STRUCT_DIRECT_D_STAT 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin6_scope_id in struct sockaddr_in6" >&5 -+$as_echo_n "checking for sin6_scope_id in struct sockaddr_in6... " >&6; } -+if ${zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TYPES_H -+# include -+#endif -+#include -+ -+int -+main () -+{ -+struct sockaddr_in6 testvar; testvar.sin6_scope_id; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id=yes -+else -+ zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id" >&5 -+$as_echo "$zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id" >&6; } -+ -+if test $zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id = yes; then -+ $as_echo "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h -+ -+fi -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need our own h_errno" >&5 -+$as_echo_n "checking if we need our own h_errno... " >&6; } -+if ${zsh_cv_decl_h_errno_use_local+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+extern int h_errno; h_errno = 0; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_decl_h_errno_use_local=no -+else -+ zsh_cv_decl_h_errno_use_local=yes -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_h_errno_use_local" >&5 -+$as_echo "$zsh_cv_decl_h_errno_use_local" >&6; } -+ -+if test x$zsh_cv_decl_h_errno_use_local = xyes; then -+ $as_echo "#define USE_LOCAL_H_ERRNO 1" >>confdefs.h -+ -+fi -+ -+ -+ -+for ac_func in strftime strptime mktime timelocal \ -+ difftime gettimeofday \ -+ select poll \ -+ readlink faccessx fchdir ftruncate \ -+ fstat lstat lchown fchown fchmod \ -+ fseeko ftello \ -+ mkfifo _mktemp mkstemp \ -+ waitpid wait3 \ -+ sigaction sigblock sighold sigrelse sigsetmask sigprocmask \ -+ killpg setpgid setpgrp tcsetpgrp tcgetattr nice \ -+ gethostname gethostbyname2 getipnodebyname \ -+ inet_aton inet_pton inet_ntop \ -+ getlogin getpwent getpwnam getpwuid getgrgid getgrnam \ -+ initgroups nis_list \ -+ setuid seteuid setreuid setresuid setsid \ -+ memcpy memmove strstr strerror strtoul \ -+ getrlimit getrusage \ -+ setlocale \ -+ uname \ -+ signgam \ -+ putenv getenv setenv unsetenv xw\ -+ brk sbrk \ -+ pathconf sysconf \ -+ tgetent tigetflag tigetnum tigetstr setupterm initscr \ -+ getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ -+ pcre_compile pcre_study pcre_exec \ -+ nl_langinfo \ -+ erand48 open_memstream \ -+ wctomb iconv \ -+ grantpt unlockpt ptsname \ -+ htons ntohs \ -+ regcomp regexec regerror regfree \ -+ gdbm_open getxattr \ -+ realpath canonicalize_file_name \ -+ symlink getcwd -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 -+$as_echo_n "checking for working strcoll... " >&6; } -+if ${ac_cv_func_strcoll_works+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ac_cv_func_strcoll_works=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+return (strcoll ("abc", "def") >= 0 || -+ strcoll ("ABC", "DEF") >= 0 || -+ strcoll ("123", "456") >= 0) -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ac_cv_func_strcoll_works=yes -+else -+ ac_cv_func_strcoll_works=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 -+$as_echo "$ac_cv_func_strcoll_works" >&6; } -+if test $ac_cv_func_strcoll_works = yes; then -+ -+$as_echo "#define HAVE_STRCOLL 1" >>confdefs.h -+ -+fi -+ -+ -+if test x$enable_cap = xyes; then -+ for ac_func in cap_get_proc -+do : -+ ac_fn_c_check_func "$LINENO" "cap_get_proc" "ac_cv_func_cap_get_proc" -+if test "x$ac_cv_func_cap_get_proc" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_CAP_GET_PROC 1 -+_ACEOF -+ -+fi -+done -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent accepts NULL" >&5 -+$as_echo_n "checking if tgetent accepts NULL... " >&6; } -+if ${zsh_cv_func_tgetent_accepts_null+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_func_tgetent_accepts_null=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+main() -+{ -+ char buf[4096]; -+ int r1 = tgetent(buf, "vt100"); -+ int r2 = tgetent((char*)0,"vt100"); -+ if (r1 >= 0 && r1 == r2) { -+ char tbuf[1024], *u; -+ u = tbuf; -+ tgetstr("cl", &u); -+ creat("conftest.tgetent", 0640); -+ } -+ exit((r1 != r2) || r2 == -1); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ if test -f conftest.tgetent; then -+ zsh_cv_func_tgetent_accepts_null=yes -+ else -+ zsh_cv_func_tgetent_accepts_null=no -+ fi -+else -+ zsh_cv_func_tgetent_accepts_null=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_tgetent_accepts_null" >&5 -+$as_echo "$zsh_cv_func_tgetent_accepts_null" >&6; } -+if test x$zsh_cv_func_tgetent_accepts_null = xyes; then -+ $as_echo "#define TGETENT_ACCEPTS_NULL 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent returns 0 on success" >&5 -+$as_echo_n "checking if tgetent returns 0 on success... " >&6; } -+if ${zsh_cv_func_tgetent_zero_success+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_func_tgetent_zero_success=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+main() -+{ -+ char buf[4096]; -+ int r1 = tgetent(buf, "!@#$%^&*"); -+ int r2 = tgetent(buf, "vt100"); -+ if (r1 < 0 && r2 == 0) { -+ char tbuf[1024], *u; -+ u = tbuf; -+ tgetstr("cl", &u); -+ creat("conftest.tgetent0", 0640); -+ } -+ exit(r1 == r2); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ if test -f conftest.tgetent0; then -+ zsh_cv_func_tgetent_zero_success=yes -+ else -+ zsh_cv_func_tgetent_zero_success=no -+ fi -+else -+ zsh_cv_func_tgetent_zero_success=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_tgetent_zero_success" >&5 -+$as_echo "$zsh_cv_func_tgetent_zero_success" >&6; } -+ -+if test x$zsh_cv_func_tgetent_zero_success = xyes; then -+ $as_echo "#define TGETENT_SUCCESS 0" >>confdefs.h -+ -+else -+ $as_echo "#define TGETENT_SUCCESS 1" >>confdefs.h -+ -+fi -+ -+ -+ -+ -+ for ac_header in $ac_header_list -+do : -+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -+" -+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+ -+done -+ -+ -+ -+ -+ -+ -+ -+ -+for ac_func in getpagesize -+do : -+ ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" -+if test "x$ac_cv_func_getpagesize" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_GETPAGESIZE 1 -+_ACEOF -+ -+fi -+done -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 -+$as_echo_n "checking for working mmap... " >&6; } -+if ${ac_cv_func_mmap_fixed_mapped+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ ac_cv_func_mmap_fixed_mapped=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$ac_includes_default -+/* malloc might have been renamed as rpl_malloc. */ -+#undef malloc -+ -+/* Thanks to Mike Haertel and Jim Avera for this test. -+ Here is a matrix of mmap possibilities: -+ mmap private not fixed -+ mmap private fixed at somewhere currently unmapped -+ mmap private fixed at somewhere already mapped -+ mmap shared not fixed -+ mmap shared fixed at somewhere currently unmapped -+ mmap shared fixed at somewhere already mapped -+ For private mappings, we should verify that changes cannot be read() -+ back from the file, nor mmap's back from the file at a different -+ address. (There have been systems where private was not correctly -+ implemented like the infamous i386 svr4.0, and systems where the -+ VM page cache was not coherent with the file system buffer cache -+ like early versions of FreeBSD and possibly contemporary NetBSD.) -+ For shared mappings, we should conversely verify that changes get -+ propagated back to all the places they're supposed to be. -+ -+ Grep wants private fixed already mapped. -+ The main things grep needs to know about mmap are: -+ * does it exist and is it safe to write into the mmap'd area -+ * how to use it (BSD variants) */ -+ -+#include -+#include -+ -+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H -+char *malloc (); -+#endif -+ -+/* This mess was copied from the GNU getpagesize.h. */ -+#ifndef HAVE_GETPAGESIZE -+# ifdef _SC_PAGESIZE -+# define getpagesize() sysconf(_SC_PAGESIZE) -+# else /* no _SC_PAGESIZE */ -+# ifdef HAVE_SYS_PARAM_H -+# include -+# ifdef EXEC_PAGESIZE -+# define getpagesize() EXEC_PAGESIZE -+# else /* no EXEC_PAGESIZE */ -+# ifdef NBPG -+# define getpagesize() NBPG * CLSIZE -+# ifndef CLSIZE -+# define CLSIZE 1 -+# endif /* no CLSIZE */ -+# else /* no NBPG */ -+# ifdef NBPC -+# define getpagesize() NBPC -+# else /* no NBPC */ -+# ifdef PAGESIZE -+# define getpagesize() PAGESIZE -+# endif /* PAGESIZE */ -+# endif /* no NBPC */ -+# endif /* no NBPG */ -+# endif /* no EXEC_PAGESIZE */ -+# else /* no HAVE_SYS_PARAM_H */ -+# define getpagesize() 8192 /* punt totally */ -+# endif /* no HAVE_SYS_PARAM_H */ -+# endif /* no _SC_PAGESIZE */ -+ -+#endif /* no HAVE_GETPAGESIZE */ -+ -+int -+main () -+{ -+ char *data, *data2, *data3; -+ const char *cdata2; -+ int i, pagesize; -+ int fd, fd2; -+ -+ pagesize = getpagesize (); -+ -+ /* First, make a file with some known garbage in it. */ -+ data = (char *) malloc (pagesize); -+ if (!data) -+ return 1; -+ for (i = 0; i < pagesize; ++i) -+ *(data + i) = rand (); -+ umask (0); -+ fd = creat ("conftest.mmap", 0600); -+ if (fd < 0) -+ return 2; -+ if (write (fd, data, pagesize) != pagesize) -+ return 3; -+ close (fd); -+ -+ /* Next, check that the tail of a page is zero-filled. File must have -+ non-zero length, otherwise we risk SIGBUS for entire page. */ -+ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); -+ if (fd2 < 0) -+ return 4; -+ cdata2 = ""; -+ if (write (fd2, cdata2, 1) != 1) -+ return 5; -+ data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); -+ if (data2 == MAP_FAILED) -+ return 6; -+ for (i = 0; i < pagesize; ++i) -+ if (*(data2 + i)) -+ return 7; -+ close (fd2); -+ if (munmap (data2, pagesize)) -+ return 8; -+ -+ /* Next, try to mmap the file at a fixed address which already has -+ something else allocated at it. If we can, also make sure that -+ we see the same garbage. */ -+ fd = open ("conftest.mmap", O_RDWR); -+ if (fd < 0) -+ return 9; -+ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, -+ MAP_PRIVATE | MAP_FIXED, fd, 0L)) -+ return 10; -+ for (i = 0; i < pagesize; ++i) -+ if (*(data + i) != *(data2 + i)) -+ return 11; -+ -+ /* Finally, make sure that changes to the mapped area do not -+ percolate back to the file as seen by read(). (This is a bug on -+ some variants of i386 svr4.0.) */ -+ for (i = 0; i < pagesize; ++i) -+ *(data2 + i) = *(data2 + i) + 1; -+ data3 = (char *) malloc (pagesize); -+ if (!data3) -+ return 12; -+ if (read (fd, data3, pagesize) != pagesize) -+ return 13; -+ for (i = 0; i < pagesize; ++i) -+ if (*(data + i) != *(data3 + i)) -+ return 14; -+ close (fd); -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ ac_cv_func_mmap_fixed_mapped=yes -+else -+ ac_cv_func_mmap_fixed_mapped=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 -+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } -+if test $ac_cv_func_mmap_fixed_mapped = yes; then -+ -+$as_echo "#define HAVE_MMAP 1" >>confdefs.h -+ -+fi -+rm -f conftest.mmap conftest.txt -+ -+if test x$ac_cv_func_mmap_fixed_mapped = xyes; then -+ for ac_func in munmap msync -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+fi -+ -+if test x$ac_cv_func_setpgrp = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5 -+$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; } -+if ${ac_cv_func_getpgrp_void+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ # Use it with a single arg. -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$ac_includes_default -+int -+main () -+{ -+getpgrp (0); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_func_getpgrp_void=no -+else -+ ac_cv_func_getpgrp_void=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5 -+$as_echo "$ac_cv_func_getpgrp_void" >&6; } -+if test $ac_cv_func_getpgrp_void = yes; then -+ -+$as_echo "#define GETPGRP_VOID 1" >>confdefs.h -+ -+fi -+ -+else -+ ac_cv_func_getpgrp_void=yes -+ $as_echo "#define GETPGRP_VOID 1" >>confdefs.h -+ -+fi -+ -+if test x$dynamic = xyes; then -+ for ac_func in dlopen dlerror dlsym dlclose load loadquery loadbind unload \ -+ shl_load shl_unload shl_findsym -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+fi -+ -+ -+if test x$ac_cv_func_getxattr = xyes && test x$ac_cv_header_sys_xattr_h = xyes -+then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are Linux-like" >&5 -+$as_echo_n "checking if getxattr etc. are Linux-like... " >&6; } -+if ${zsh_cv_getxattr_linux+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+int -+main () -+{ -+ -+ (void)listxattr("", 0, 0); -+ (void)getxattr("", "", 0, 0); -+ (void)setxattr("", "", "", 0, 0); -+ (void)removexattr("", ""); -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_getxattr_linux=yes -+else -+ zsh_cv_getxattr_linux=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getxattr_linux" >&5 -+$as_echo "$zsh_cv_getxattr_linux" >&6; } -+ -+ if test x$zsh_cv_getxattr_linux != xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are MAC-like" >&5 -+$as_echo_n "checking if getxattr etc. are MAC-like... " >&6; } -+if ${zsh_cv_getxattr_mac+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+#include -+int -+main () -+{ -+(void)listxattr("", 0, 0, 0); -+ (void)getxattr("", "", 0, 0, 0, 0); -+ (void)setxattr("", "", "", 0, 0, 0); -+ (void)removexattr("", "", 0); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_getxattr_mac=yes -+else -+ zsh_cv_getxattr_mac=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getxattr_mac" >&5 -+$as_echo "$zsh_cv_getxattr_mac" >&6; } -+ -+ if test x$zsh_cv_getxattr_mac = xyes; then -+ $as_echo "#define XATTR_EXTRA_ARGS 1" >>confdefs.h -+ -+ fi -+ fi -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are usable" >&5 -+$as_echo_n "checking if getxattr etc. are usable... " >&6; } -+if ${zsh_cv_use_xattr+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test x$zsh_cv_getxattr_linux = xyes || test x$zsh_cv_getxattr_mac = xyes -+then -+zsh_cv_use_xattr=yes -+else -+zsh_cv_use_xattr=no -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_use_xattr" >&5 -+$as_echo "$zsh_cv_use_xattr" >&6; } -+ -+ -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what style of signals to use" >&5 -+$as_echo_n "checking what style of signals to use... " >&6; } -+if test x$ac_cv_func_sigaction = xyes && test x$ac_cv_func_sigprocmask = xyes; then -+ signals_style=POSIX_SIGNALS -+ $as_echo "#define POSIX_SIGNALS 1" >>confdefs.h -+ -+elif test x$ac_cv_func_sigblock = xyes && test x$ac_cv_func_sigsetmask = xyes; then -+ signals_style=BSD_SIGNALS -+ $as_echo "#define BSD_SIGNALS 1" >>confdefs.h -+ -+elif test x$ac_cv_func_sighold = xyes && test x$ac_cv_func_sigrelse = xyes; then -+ signals_style=SYSV_SIGNALS -+ $as_echo "#define SYSV_SIGNALS 1" >>confdefs.h -+ -+else -+ signals_style=NO_SIGNAL_BLOCKING -+ $as_echo "#define NO_SIGNAL_BLOCKING 1" >>confdefs.h -+ -+fi -+cat >>confdefs.h <<_ACEOF -+#define $signals_style 1 -+_ACEOF -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $signals_style" >&5 -+$as_echo "$signals_style" >&6; } -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where signal.h is located" >&5 -+$as_echo_n "checking where signal.h is located... " >&6; } -+if ${zsh_cv_path_signal_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ echo "#include " > nametmp.c -+sigfile_list="`$CPP $CPPFLAGS nametmp.c | -+sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ -+ -e 's/^#[ ].*\"\(.*\)\"/\1/p' | -+sed 's/\\\\\\\\/\//g' | -+$AWK '{ if ($1 ~ /sig/) files[$1] = $1 } -+ END { for (var in files) print var }'`" -+rm -f nametmp.c -+if test -z "$sigfile_list"; then -+ sigfile_list="/usr/include/sys/iso/signal_iso.h -+/usr/include/bsd/sys/signal.h -+/usr/include/signum.h -+/usr/include/asm/signum.h -+/usr/include/asm/signal.h -+/usr/include/linux/signal.h -+/usr/include/sys/signal.h -+/usr/include/bits/signum.h -+/dev/null" -+fi -+for SIGNAL_H in $sigfile_list -+do -+ nsigs=`test -f $SIGNAL_H && \ -+ grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H | \ -+ wc -l | sed 's/ //g'` -+ test "x$nsigs" != x && test "$nsigs" -ge 7 && break -+done -+if test x$SIGNAL_H = x"/dev/null"; then -+ as_fn_error $? "SIGNAL MACROS NOT FOUND: please report to developers" "$LINENO" 5 -+fi -+zsh_cv_path_signal_h=$SIGNAL_H -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_signal_h" >&5 -+$as_echo "$zsh_cv_path_signal_h" >&6; } -+SIGNAL_H=$zsh_cv_path_signal_h -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where error names are located" >&5 -+$as_echo_n "checking where error names are located... " >&6; } -+if ${zsh_cv_path_errno_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ echo "#include " > nametmp.c -+errfile_list="`$CPP $CPPFLAGS nametmp.c | -+sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ -+ -e 's/^#[ 0-9].*\"\(.*\)\"/\1/p' | -+sed 's/\\\\\\\\/\//g' | -+$AWK '{ if ($1 ~ /err/) files[$1] = $1 } -+ END { for (var in files) print var }'`" -+rm -f nametmp.c -+for ERRNO_TRY_H in $errfile_list /dev/null -+do -+ nerrs=`test -f $ERRNO_TRY_H && \ -+ $EGREP '#[ ]*define[ ][ ]*E[0-9A-Z]*[ ]*(_HURD_ERRNO )?\(?[_A-Z0-9]' $ERRNO_TRY_H | \ -+ wc -l | sed 's/ //g'` -+ if test "x$nerrs" != x && test "$nerrs" -ge 1 -+ then -+ ERRNO_H="$ERRNO_H $ERRNO_TRY_H" -+ fi -+done -+if test x"$ERRNO_H" = x; then -+ as_fn_error $? "ERROR MACROS NOT FOUND: please report to developers" "$LINENO" 5 -+fi -+zsh_cv_path_errno_h="$ERRNO_H" -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_errno_h" >&5 -+$as_echo "$zsh_cv_path_errno_h" >&6; } -+ERRNO_H="$zsh_cv_path_errno_h" -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking location of curses header" >&5 -+$as_echo_n "checking location of curses header... " >&6; } -+if ${zsh_cv_path_curses_header+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test x$zsh_cv_ignore_ncurses = xyes; then -+ if test x$ac_cv_header_curses_h = xyes; then -+ zsh_cv_path_curses_header=curses.h -+ else -+ zsh_cv_path_curses_header=none -+ fi -+elif test x$ac_cv_header_ncursesw_ncurses_h = xyes; then -+ zsh_cv_path_curses_header=ncursesw/ncurses.h -+elif test x$ac_cv_header_ncurses_ncurses_h = xyes; then -+ zsh_cv_path_curses_header=ncurses/ncurses.h -+elif test x$ac_cv_header_ncurses_h = xyes; then -+ zsh_cv_path_curses_header=ncurses.h -+elif test x$ac_cv_header_curses_h = xyes; then -+ zsh_cv_path_curses_header=curses.h -+else -+ zsh_cv_path_curses_header=none -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_curses_header" >&5 -+$as_echo "$zsh_cv_path_curses_header" >&6; } -+ -+if test x$zsh_cv_path_curses_header != xnone; then -+ $as_echo "#define ZSH_HAVE_CURSES_H 1" >>confdefs.h -+ -+ ZSH_CURSES_H=$zsh_cv_path_curses_header -+else -+ ZSH_CURSES_H= -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where curses key definitions are located" >&5 -+$as_echo_n "checking where curses key definitions are located... " >&6; } -+if ${zsh_cv_path_curses_keys_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test x$zsh_cv_path_curses_header = xnone; then -+ echo >nametmp.c -+else -+ echo "#include <$zsh_cv_path_curses_header>" >nametmp.c -+fi -+ -+curses_list="`$CPP $CPPFLAGS nametmp.c | -+sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ -+ -e 's/^#[ 0-9].*\"\(.*\)\"/\1/p' | -+sed 's/\\\\\\\\/\//g' | -+$AWK '{ if ($1 ~ /\.h/) files[$1] = $1 } -+ END { for (var in files) print var }'`" -+rm -f nametmp.c -+for CURSES_TRY_H in $curses_list /dev/null -+do -+ nkeys=`test -f $CURSES_TRY_H && \ -+ $EGREP '#[ ]*define[ ][ ]*KEY_' $CURSES_TRY_H | \ -+ wc -l | sed 's/ //g'` -+ if test "x$nkeys" != x && test "$nkeys" -ge 10 -+ then -+ CURSES_KEYS_H=$CURSES_TRY_H -+ break -+ fi -+done -+zsh_cv_path_curses_keys_h="$CURSES_KEYS_H" -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_curses_keys_h" >&5 -+$as_echo "$zsh_cv_path_curses_keys_h" >&6; } -+CURSES_KEYS_H="$zsh_cv_path_curses_keys_h" -+ -+for ac_header in ncursesw/term.h -+do : -+ ac_fn_c_check_header_compile "$LINENO" "ncursesw/term.h" "ac_cv_header_ncursesw_term_h" "#include -+" -+if test "x$ac_cv_header_ncursesw_term_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_NCURSESW_TERM_H 1 -+_ACEOF -+ true -+else -+ true -+fi -+ -+done -+ -+for ac_header in ncurses/term.h -+do : -+ ac_fn_c_check_header_compile "$LINENO" "ncurses/term.h" "ac_cv_header_ncurses_term_h" "#include -+" -+if test "x$ac_cv_header_ncurses_term_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_NCURSES_TERM_H 1 -+_ACEOF -+ true -+else -+ true -+fi -+ -+done -+ -+for ac_header in term.h -+do : -+ ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "#include -+" -+if test "x$ac_cv_header_term_h" = xyes; then : -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_TERM_H 1 -+_ACEOF -+ true -+else -+ true -+fi -+ -+done -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where term.h is located" >&5 -+$as_echo_n "checking where term.h is located... " >&6; } -+if ${zsh_cv_path_term_header+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case x$zsh_cv_path_curses_header in -+ xncursesw/*) -+ if test x$ac_cv_header_ncursesw_term_h = xyes; then -+ zsh_cv_path_term_header=ncursesw/term.h -+ fi -+ ;; -+ xncurses/*) -+ if test x$ac_cv_header_ncurses_term_h = xyes; then -+ zsh_cv_path_term_header=ncurses/term.h -+ fi -+ ;; -+esac -+if test x$zsh_cv_path_term_header = x; then -+ if test x$ac_cv_header_term_h = xyes; then -+ zsh_cv_path_term_header=term.h -+ else -+ zsh_cv_path_term_header=none -+ fi -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_term_header" >&5 -+$as_echo "$zsh_cv_path_term_header" >&6; } -+ -+ -+ -+ -+ -+ -+ -+ -+ -+if test x$zsh_cv_path_term_header != xnone; then -+ $as_echo "#define ZSH_HAVE_TERM_H 1" >>confdefs.h -+ -+ ZSH_TERM_H=$zsh_cv_path_term_header -+ if test x$zsh_cv_path_curses_header != xnone; then -+ term_includes="#include <$zsh_cv_path_curses_header> -+#include <$zsh_cv_path_term_header>" -+ else -+ term_includes="#include <$zsh_cv_path_term_header>" -+ fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if boolcodes is available" >&5 -+$as_echo_n "checking if boolcodes is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = boolcodes; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_BOOLCODES 1" >>confdefs.h -+ boolcodes=yes -+else -+ boolcodes=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boolcodes" >&5 -+$as_echo "$boolcodes" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numcodes is available" >&5 -+$as_echo_n "checking if numcodes is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = numcodes; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_NUMCODES 1" >>confdefs.h -+ numcodes=yes -+else -+ numcodes=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $numcodes" >&5 -+$as_echo "$numcodes" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcodes is available" >&5 -+$as_echo_n "checking if strcodes is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = strcodes; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_STRCODES 1" >>confdefs.h -+ strcodes=yes -+else -+ strcodes=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $strcodes" >&5 -+$as_echo "$strcodes" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if boolnames is available" >&5 -+$as_echo_n "checking if boolnames is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = boolnames; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_BOOLNAMES 1" >>confdefs.h -+ boolnames=yes -+else -+ boolnames=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boolnames" >&5 -+$as_echo "$boolnames" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numnames is available" >&5 -+$as_echo_n "checking if numnames is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = numnames; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_NUMNAMES 1" >>confdefs.h -+ numnames=yes -+else -+ numnames=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $numnames" >&5 -+$as_echo "$numnames" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnames is available" >&5 -+$as_echo_n "checking if strnames is available... " >&6; } -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$term_includes -+int -+main () -+{ -+char **test = strnames; puts(*test); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ $as_echo "#define HAVE_STRNAMES 1" >>confdefs.h -+ strnames=yes -+else -+ strnames=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $strnames" >&5 -+$as_echo "$strnames" >&6; } -+else -+ ZSH_TERM_H= -+fi -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where the RLIMIT macros are located" >&5 -+$as_echo_n "checking where the RLIMIT macros are located... " >&6; } -+if ${zsh_cv_path_rlimit_h+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ echo "#include " >restmp.c -+resourcefile_list="`$CPP $CPPFLAGS restmp.c | -+sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ -+ -e 's/^#[ ].*\"\(.*\)\"/\1/p' | -+sed 's/\\\\\\\\/\//g' | -+$AWK '{ if ($1 ~ /resource/) files[$1] = $1 } -+ END { for (var in files) print var }'`" -+rm -f restmp.c -+if test -z "$resourcefile_list"; then -+ resourcefile_list="/usr/include/bsd/sys/resource.h -+/usr/include/asm/resource.h -+/usr/include/linux/resource.h -+/usr/include/sys/resource.h -+/usr/include/bits/resource.h -+/usr/include/resourcebits.h" -+fi -+for RESOURCE_H in $resourcefile_list /dev/null; -+do -+ test -f $RESOURCE_H && \ -+ grep '#[ ]*define[ ][ ]*RLIMIT_[A-Z]*[ ]*[0-9A-Z][0-9]*' $RESOURCE_H > /dev/null && \ -+ break -+done -+zsh_cv_path_rlimit_h=$RESOURCE_H -+if test x$RESOURCE_H = x"/dev/null" && test x$ac_cv_func_getrlimit = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: RLIMIT MACROS NOT FOUND: please report to developers" >&5 -+$as_echo "$as_me: WARNING: RLIMIT MACROS NOT FOUND: please report to developers" >&2;} -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_rlimit_h" >&5 -+$as_echo "$zsh_cv_path_rlimit_h" >&6; } -+RLIMITS_INC_H=$zsh_cv_path_rlimit_h -+if test "$RLIMITS_INC_H" = "/dev/null"; then -+ RLIMITS_INC_H='' -+fi -+ -+ -+ -+ -+ -+DEFAULT_RLIM_T=long -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if rlim_t is longer than a long" >&5 -+$as_echo_n "checking if rlim_t is longer than a long... " >&6; } -+if ${zsh_cv_rlim_t_is_longer+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_rlim_t_is_longer=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_rlim_t_is_longer=yes -+else -+ zsh_cv_rlim_t_is_longer=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlim_t_is_longer" >&5 -+$as_echo "$zsh_cv_rlim_t_is_longer" >&6; } -+if test x$zsh_cv_rlim_t_is_longer = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rlim_t is a quad" >&5 -+$as_echo_n "checking if rlim_t is a quad... " >&6; } -+if ${zsh_cv_rlim_t_is_quad_t+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_rlim_t_is_quad_t=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+#include -+main() { -+ struct rlimit r; -+ char buf[20]; -+ r.rlim_cur = 0; -+ sprintf(buf, "%qd", r.rlim_cur); -+ exit(strcmp(buf, "0")); -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_rlim_t_is_quad_t=yes -+else -+ zsh_cv_rlim_t_is_quad_t=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlim_t_is_quad_t" >&5 -+$as_echo "$zsh_cv_rlim_t_is_quad_t" >&6; } -+ if test x$zsh_cv_rlim_t_is_quad_t = xyes; then -+ $as_echo "#define RLIM_T_IS_QUAD_T 1" >>confdefs.h -+ -+ DEFAULT_RLIM_T=quad_t -+ else -+ $as_echo "#define RLIM_T_IS_LONG_LONG 1" >>confdefs.h -+ -+ DEFAULT_RLIM_T='long long' -+ fi -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the rlim_t is unsigned" >&5 -+$as_echo_n "checking if the rlim_t is unsigned... " >&6; } -+if ${zsh_cv_type_rlim_t_is_unsigned+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_type_rlim_t_is_unsigned=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+ main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_type_rlim_t_is_unsigned=yes -+else -+ zsh_cv_type_rlim_t_is_unsigned=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_rlim_t_is_unsigned" >&5 -+$as_echo "$zsh_cv_type_rlim_t_is_unsigned" >&6; } -+ if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then -+ $as_echo "#define RLIM_T_IS_UNSIGNED 1" >>confdefs.h -+ -+ DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" -+ fi -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rlim_t" >&5 -+$as_echo_n "checking for rlim_t... " >&6; } -+if ${zsh_cv_type_rlim_t+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+rlim_t l; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_rlim_t=yes -+else -+ zsh_cv_type_rlim_t=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_rlim_t" >&5 -+$as_echo "$zsh_cv_type_rlim_t" >&6; } -+if test x$zsh_cv_type_rlim_t = xno; then -+ cat >>confdefs.h <<_ACEOF -+#define rlim_t $DEFAULT_RLIM_T -+_ACEOF -+ -+fi -+ -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AIO_MEM" >&5 -+$as_echo_n "checking for limit RLIMIT_AIO_MEM... " >&6; } -+if ${zsh_cv_have_RLIMIT_AIO_MEM+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_AIO_MEM -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_AIO_MEM=yes -+else -+ zsh_cv_have_RLIMIT_AIO_MEM=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AIO_MEM" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_AIO_MEM" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_AIO_MEM = yes; then -+ $as_echo "#define HAVE_RLIMIT_AIO_MEM 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AIO_OPS" >&5 -+$as_echo_n "checking for limit RLIMIT_AIO_OPS... " >&6; } -+if ${zsh_cv_have_RLIMIT_AIO_OPS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_AIO_OPS -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_AIO_OPS=yes -+else -+ zsh_cv_have_RLIMIT_AIO_OPS=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AIO_OPS" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_AIO_OPS" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_AIO_OPS = yes; then -+ $as_echo "#define HAVE_RLIMIT_AIO_OPS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AS" >&5 -+$as_echo_n "checking for limit RLIMIT_AS... " >&6; } -+if ${zsh_cv_have_RLIMIT_AS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_AS -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_AS=yes -+else -+ zsh_cv_have_RLIMIT_AS=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AS" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_AS" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_AS = yes; then -+ $as_echo "#define HAVE_RLIMIT_AS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_LOCKS" >&5 -+$as_echo_n "checking for limit RLIMIT_LOCKS... " >&6; } -+if ${zsh_cv_have_RLIMIT_LOCKS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_LOCKS -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_LOCKS=yes -+else -+ zsh_cv_have_RLIMIT_LOCKS=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_LOCKS" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_LOCKS" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_LOCKS = yes; then -+ $as_echo "#define HAVE_RLIMIT_LOCKS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_MEMLOCK" >&5 -+$as_echo_n "checking for limit RLIMIT_MEMLOCK... " >&6; } -+if ${zsh_cv_have_RLIMIT_MEMLOCK+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_MEMLOCK -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_MEMLOCK=yes -+else -+ zsh_cv_have_RLIMIT_MEMLOCK=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_MEMLOCK" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_MEMLOCK" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_MEMLOCK = yes; then -+ $as_echo "#define HAVE_RLIMIT_MEMLOCK 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NPROC" >&5 -+$as_echo_n "checking for limit RLIMIT_NPROC... " >&6; } -+if ${zsh_cv_have_RLIMIT_NPROC+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_NPROC -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_NPROC=yes -+else -+ zsh_cv_have_RLIMIT_NPROC=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NPROC" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_NPROC" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_NPROC = yes; then -+ $as_echo "#define HAVE_RLIMIT_NPROC 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NOFILE" >&5 -+$as_echo_n "checking for limit RLIMIT_NOFILE... " >&6; } -+if ${zsh_cv_have_RLIMIT_NOFILE+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_NOFILE -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_NOFILE=yes -+else -+ zsh_cv_have_RLIMIT_NOFILE=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NOFILE" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_NOFILE" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_NOFILE = yes; then -+ $as_echo "#define HAVE_RLIMIT_NOFILE 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_PTHREAD" >&5 -+$as_echo_n "checking for limit RLIMIT_PTHREAD... " >&6; } -+if ${zsh_cv_have_RLIMIT_PTHREAD+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_PTHREAD -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_PTHREAD=yes -+else -+ zsh_cv_have_RLIMIT_PTHREAD=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_PTHREAD" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_PTHREAD" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_PTHREAD = yes; then -+ $as_echo "#define HAVE_RLIMIT_PTHREAD 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_RSS" >&5 -+$as_echo_n "checking for limit RLIMIT_RSS... " >&6; } -+if ${zsh_cv_have_RLIMIT_RSS+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_RSS -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_RSS=yes -+else -+ zsh_cv_have_RLIMIT_RSS=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_RSS" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_RSS" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_RSS = yes; then -+ $as_echo "#define HAVE_RLIMIT_RSS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_SBSIZE" >&5 -+$as_echo_n "checking for limit RLIMIT_SBSIZE... " >&6; } -+if ${zsh_cv_have_RLIMIT_SBSIZE+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_SBSIZE -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_SBSIZE=yes -+else -+ zsh_cv_have_RLIMIT_SBSIZE=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_SBSIZE" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_SBSIZE" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_SBSIZE = yes; then -+ $as_echo "#define HAVE_RLIMIT_SBSIZE 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_TCACHE" >&5 -+$as_echo_n "checking for limit RLIMIT_TCACHE... " >&6; } -+if ${zsh_cv_have_RLIMIT_TCACHE+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_TCACHE -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_TCACHE=yes -+else -+ zsh_cv_have_RLIMIT_TCACHE=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_TCACHE" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_TCACHE" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_TCACHE = yes; then -+ $as_echo "#define HAVE_RLIMIT_TCACHE 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_VMEM" >&5 -+$as_echo_n "checking for limit RLIMIT_VMEM... " >&6; } -+if ${zsh_cv_have_RLIMIT_VMEM+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_VMEM -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_VMEM=yes -+else -+ zsh_cv_have_RLIMIT_VMEM=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_VMEM" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_VMEM" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_VMEM = yes; then -+ $as_echo "#define HAVE_RLIMIT_VMEM 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_SIGPENDING" >&5 -+$as_echo_n "checking for limit RLIMIT_SIGPENDING... " >&6; } -+if ${zsh_cv_have_RLIMIT_SIGPENDING+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_SIGPENDING -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_SIGPENDING=yes -+else -+ zsh_cv_have_RLIMIT_SIGPENDING=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_SIGPENDING" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_SIGPENDING" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_SIGPENDING = yes; then -+ $as_echo "#define HAVE_RLIMIT_SIGPENDING 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_MSGQUEUE" >&5 -+$as_echo_n "checking for limit RLIMIT_MSGQUEUE... " >&6; } -+if ${zsh_cv_have_RLIMIT_MSGQUEUE+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_MSGQUEUE -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_MSGQUEUE=yes -+else -+ zsh_cv_have_RLIMIT_MSGQUEUE=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_MSGQUEUE" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_MSGQUEUE" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_MSGQUEUE = yes; then -+ $as_echo "#define HAVE_RLIMIT_MSGQUEUE 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NICE" >&5 -+$as_echo_n "checking for limit RLIMIT_NICE... " >&6; } -+if ${zsh_cv_have_RLIMIT_NICE+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_NICE -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_NICE=yes -+else -+ zsh_cv_have_RLIMIT_NICE=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NICE" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_NICE" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_NICE = yes; then -+ $as_echo "#define HAVE_RLIMIT_NICE 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_RTPRIO" >&5 -+$as_echo_n "checking for limit RLIMIT_RTPRIO... " >&6; } -+if ${zsh_cv_have_RLIMIT_RTPRIO+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int -+main () -+{ -+RLIMIT_RTPRIO -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_have_RLIMIT_RTPRIO=yes -+else -+ zsh_cv_have_RLIMIT_RTPRIO=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_RTPRIO" >&5 -+$as_echo "$zsh_cv_have_RLIMIT_RTPRIO" >&6; } -+ -+if test $zsh_cv_have_RLIMIT_RTPRIO = yes; then -+ $as_echo "#define HAVE_RLIMIT_RTPRIO 1" >>confdefs.h -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_RSS are the same" >&5 -+$as_echo_n "checking if RLIMIT_VMEM and RLIMIT_RSS are the same... " >&6; } -+if ${zsh_cv_rlimit_vmem_is_rss+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_rlimit_vmem_is_rss=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int main() -+{ -+int ret = 1; -+#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS) -+if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0; -+#endif -+return ret; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_rlimit_vmem_is_rss=yes -+else -+ zsh_cv_rlimit_vmem_is_rss=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_rss" >&5 -+$as_echo "$zsh_cv_rlimit_vmem_is_rss" >&6; } -+ -+if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then -+ $as_echo "#define RLIMIT_VMEM_IS_RSS 1" >>confdefs.h -+ -+fi -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_AS are the same" >&5 -+$as_echo_n "checking if RLIMIT_VMEM and RLIMIT_AS are the same... " >&6; } -+if ${zsh_cv_rlimit_vmem_is_as+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_rlimit_vmem_is_as=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int main() -+{ -+int ret = 1; -+#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_AS) -+if (RLIMIT_AS == RLIMIT_VMEM) ret = 0; -+#endif -+return ret; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_rlimit_vmem_is_as=yes -+else -+ zsh_cv_rlimit_vmem_is_as=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_as" >&5 -+$as_echo "$zsh_cv_rlimit_vmem_is_as" >&6; } -+ -+if test x$zsh_cv_rlimit_vmem_is_as = xyes; then -+ $as_echo "#define RLIMIT_VMEM_IS_AS 1" >>confdefs.h -+ -+fi -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_RSS and RLIMIT_AS are the same" >&5 -+$as_echo_n "checking if RLIMIT_RSS and RLIMIT_AS are the same... " >&6; } -+if ${zsh_cv_rlimit_rss_is_as+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_rlimit_rss_is_as=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+int main() -+{ -+int ret = 1; -+#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS) -+if (RLIMIT_AS == RLIMIT_RSS) ret = 0; -+#endif -+return ret; -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_rlimit_rss_is_as=yes -+else -+ zsh_cv_rlimit_rss_is_as=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_rss_is_as" >&5 -+$as_echo "$zsh_cv_rlimit_rss_is_as" >&6; } -+ -+if test x$zsh_cv_rlimit_rss_is_as = xyes; then -+ $as_echo "#define RLIMIT_RSS_IS_AS 1" >>confdefs.h -+ -+fi -+ -+ -+if test x$ac_cv_func_getrusage = xyes; then -+ ac_fn_c_check_member "$LINENO" "struct rusage" "ru_maxrss" "ac_cv_member_struct_rusage_ru_maxrss" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_maxrss" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_ixrss" "ac_cv_member_struct_rusage_ru_ixrss" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_ixrss" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_IXRSS 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_idrss" "ac_cv_member_struct_rusage_ru_idrss" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_idrss" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_IDRSS 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_isrss" "ac_cv_member_struct_rusage_ru_isrss" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_isrss" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_ISRSS 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_minflt" "ac_cv_member_struct_rusage_ru_minflt" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_minflt" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_MINFLT 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_majflt" "ac_cv_member_struct_rusage_ru_majflt" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_majflt" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_MAJFLT 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nswap" "ac_cv_member_struct_rusage_ru_nswap" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_nswap" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_NSWAP 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_inblock" "ac_cv_member_struct_rusage_ru_inblock" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_inblock" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_INBLOCK 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_oublock" "ac_cv_member_struct_rusage_ru_oublock" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_oublock" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_OUBLOCK 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_msgsnd" "ac_cv_member_struct_rusage_ru_msgsnd" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_msgsnd" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_MSGSND 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_msgrcv" "ac_cv_member_struct_rusage_ru_msgrcv" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_msgrcv" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_MSGRCV 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nsignals" "ac_cv_member_struct_rusage_ru_nsignals" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_nsignals" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_NSIGNALS 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nvcsw" "ac_cv_member_struct_rusage_ru_nvcsw" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_nvcsw" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_NVCSW 1 -+_ACEOF -+ -+ -+fi -+ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nivcsw" "ac_cv_member_struct_rusage_ru_nivcsw" "#include -+#ifdef HAVE_SYS_TIME_H -+#include -+#endif -+#include -+" -+if test "x$ac_cv_member_struct_rusage_ru_nivcsw" = xyes; then : -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_STRUCT_RUSAGE_RU_NIVCSW 1 -+_ACEOF -+ -+ -+fi -+ -+fi -+ -+ -+if ${zsh_cv_cs_path+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if getconf _CS_PATH >/dev/null 2>&1; then -+ zsh_cv_cs_path=`getconf _CS_PATH` -+elif getconf CS_PATH >/dev/null 2>&1; then -+ zsh_cv_cs_path=`getconf CS_PATH` -+else -+ zsh_cv_cs_path="/bin:/usr/bin" -+fi -+fi -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define DEFAULT_PATH "$zsh_cv_cs_path" -+_ACEOF -+ -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/fd filesystem" >&5 -+$as_echo_n "checking for /dev/fd filesystem... " >&6; } -+if ${zsh_cv_sys_path_dev_fd+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$host_os" = cygwin; then -+zsh_cv_sys_path_dev_fd=no -+else -+for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do -+ test x`echo ok|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break -+ done -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_path_dev_fd" >&5 -+$as_echo "$zsh_cv_sys_path_dev_fd" >&6; } -+if test x$zsh_cv_sys_path_dev_fd != xno; then -+ cat >>confdefs.h <<_ACEOF -+#define PATH_DEV_FD "$zsh_cv_sys_path_dev_fd" -+_ACEOF -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RFS superroot directory" >&5 -+$as_echo_n "checking for RFS superroot directory... " >&6; } -+if ${zsh_cv_sys_superroot+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ test -d /../.LOCALROOT && zsh_cv_sys_superroot=yes || zsh_cv_sys_superroot=no -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_superroot" >&5 -+$as_echo "$zsh_cv_sys_superroot" >&6; } -+ -+if test x$zsh_cv_sys_superroot = xyes; then -+ $as_echo "#define HAVE_SUPERROOT 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we should use the native getcwd" >&5 -+$as_echo_n "checking whether we should use the native getcwd... " >&6; } -+if ${zsh_cv_use_getcwd+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case "${host_cpu}-${host_vendor}-${host_os}" in -+ *QNX*) zsh_cv_use_getcwd=yes ;; -+ *) zsh_cv_use_getcwd=no ;; -+ esac -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_use_getcwd" >&5 -+$as_echo "$zsh_cv_use_getcwd" >&6; } -+ -+if test x$zsh_cv_use_getcwd = xyes; then -+ $as_echo "#define USE_GETCWD 1" >>confdefs.h -+ -+fi -+ -+ -+if test x$ac_cv_func_getcwd = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd calls malloc to allocate memory" >&5 -+$as_echo_n "checking whether getcwd calls malloc to allocate memory... " >&6; } -+if ${zsh_cv_getcwd_malloc+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_getcwd_malloc=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+int main() { -+ char buf[1024], *ptr1, *ptr2; -+ ptr1 = getcwd(buf, 1024); -+ ptr2 = getcwd(NULL, 0); -+ if (ptr1 && ptr2 && !strcmp(ptr1, ptr2)) { -+ return 0; -+ } -+ return 1; -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_getcwd_malloc=yes -+else -+ zsh_cv_getcwd_malloc=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getcwd_malloc" >&5 -+$as_echo "$zsh_cv_getcwd_malloc" >&6; } -+ if test x$zsh_cv_getcwd_malloc = xyes; then -+ $as_echo "#define GETCWD_CALLS_MALLOC 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" -+if test "x$ac_cv_func_setproctitle" = xyes; then : -+ $as_echo "#define HAVE_SETPROCTITLE 1" >>confdefs.h -+ -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5 -+$as_echo_n "checking for library containing setproctitle... " >&6; } -+if ${ac_cv_search_setproctitle+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char setproctitle (); -+int -+main () -+{ -+return setproctitle (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' util; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_setproctitle=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_setproctitle+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_setproctitle+:} false; then : -+ -+else -+ ac_cv_search_setproctitle=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5 -+$as_echo "$ac_cv_search_setproctitle" >&6; } -+ac_res=$ac_cv_search_setproctitle -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ $as_echo "#define HAVE_SETPROCTITLE 1" >>confdefs.h -+ -+fi -+ -+fi -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIS" >&5 -+$as_echo_n "checking for NIS... " >&6; } -+if ${zsh_cv_sys_nis+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ test -f /usr/bin/ypcat && /usr/bin/ypcat passwd.byname > /dev/null 2>&1 && \ -+zsh_cv_sys_nis=yes || zsh_cv_sys_nis=no -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_nis" >&5 -+$as_echo "$zsh_cv_sys_nis" >&6; } -+if test x$zsh_cv_sys_nis = xyes; then -+ $as_echo "#define HAVE_NIS 1" >>confdefs.h -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_all" >&5 -+$as_echo_n "checking for library containing yp_all... " >&6; } -+if ${ac_cv_search_yp_all+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_func_search_save_LIBS=$LIBS -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char yp_all (); -+int -+main () -+{ -+return yp_all (); -+ ; -+ return 0; -+} -+_ACEOF -+for ac_lib in '' nsl; do -+ if test -z "$ac_lib"; then -+ ac_res="none required" -+ else -+ ac_res=-l$ac_lib -+ LIBS="-l$ac_lib $ac_func_search_save_LIBS" -+ fi -+ if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_search_yp_all=$ac_res -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext -+ if ${ac_cv_search_yp_all+:} false; then : -+ break -+fi -+done -+if ${ac_cv_search_yp_all+:} false; then : -+ -+else -+ ac_cv_search_yp_all=no -+fi -+rm conftest.$ac_ext -+LIBS=$ac_func_search_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_all" >&5 -+$as_echo "$ac_cv_search_yp_all" >&6; } -+ac_res=$ac_cv_search_yp_all -+if test "$ac_res" != no; then : -+ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -+ -+fi -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIS+" >&5 -+$as_echo_n "checking for NIS+... " >&6; } -+if ${zsh_cv_sys_nis_plus+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ test x$ac_cv_func_nis_list = xyes && test -f /usr/bin/nisls && \ -+ /usr/bin/nisls > /dev/null 2>&1 && \ -+zsh_cv_sys_nis_plus=yes || zsh_cv_sys_nis_plus=no -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_nis_plus" >&5 -+$as_echo "$zsh_cv_sys_nis_plus" >&6; } -+if test x$zsh_cv_sys_nis_plus = xyes; then -+ $as_echo "#define HAVE_NIS_PLUS 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for utmp file" >&5 -+$as_echo_n "checking for utmp file... " >&6; } -+if ${zsh_cv_path_utmp+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do -+ zsh_cv_path_utmp=${dir}/utmp -+ test -f $zsh_cv_path_utmp && break -+ zsh_cv_path_utmp=no -+done -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_utmp" >&5 -+$as_echo "$zsh_cv_path_utmp" >&6; } -+ -+if test $zsh_cv_path_utmp != no; then -+ cat >>confdefs.h <<_ACEOF -+#define PATH_UTMP_FILE "$zsh_cv_path_utmp" -+_ACEOF -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wtmp file" >&5 -+$as_echo_n "checking for wtmp file... " >&6; } -+if ${zsh_cv_path_wtmp+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do -+ zsh_cv_path_wtmp=${dir}/wtmp -+ test -f $zsh_cv_path_wtmp && break -+ zsh_cv_path_wtmp=no -+done -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_wtmp" >&5 -+$as_echo "$zsh_cv_path_wtmp" >&6; } -+ -+if test $zsh_cv_path_wtmp != no; then -+ cat >>confdefs.h <<_ACEOF -+#define PATH_WTMP_FILE "$zsh_cv_path_wtmp" -+_ACEOF -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for utmpx file" >&5 -+$as_echo_n "checking for utmpx file... " >&6; } -+if ${zsh_cv_path_utmpx+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do -+ zsh_cv_path_utmpx=${dir}/utmpx -+ test -f $zsh_cv_path_utmpx && break -+ zsh_cv_path_utmpx=no -+done -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_utmpx" >&5 -+$as_echo "$zsh_cv_path_utmpx" >&6; } -+ -+if test $zsh_cv_path_utmpx != no; then -+ cat >>confdefs.h <<_ACEOF -+#define PATH_UTMPX_FILE "$zsh_cv_path_utmpx" -+_ACEOF -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wtmpx file" >&5 -+$as_echo_n "checking for wtmpx file... " >&6; } -+if ${zsh_cv_path_wtmpx+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do -+ zsh_cv_path_wtmpx=${dir}/wtmpx -+ test -f $zsh_cv_path_wtmpx && break -+ zsh_cv_path_wtmpx=no -+done -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_wtmpx" >&5 -+$as_echo "$zsh_cv_path_wtmpx" >&6; } -+ -+if test $zsh_cv_path_wtmpx != no; then -+ cat >>confdefs.h <<_ACEOF -+#define PATH_WTMPX_FILE "$zsh_cv_path_wtmpx" -+_ACEOF -+ -+fi -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for brk() prototype in " >&5 -+$as_echo_n "checking for brk() prototype in ... " >&6; } -+if ${zsh_cv_header_unistd_h_brk_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+double brk(); -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_unistd_h_brk_proto=no -+else -+ zsh_cv_header_unistd_h_brk_proto=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_brk_proto" >&5 -+$as_echo "$zsh_cv_header_unistd_h_brk_proto" >&6; } -+ -+if test x$zsh_cv_header_unistd_h_brk_proto = xyes; then -+ $as_echo "#define HAVE_BRK_PROTO 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sbrk() prototype in " >&5 -+$as_echo_n "checking for sbrk() prototype in ... " >&6; } -+if ${zsh_cv_header_unistd_h_sbrk_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+double sbrk(); -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_unistd_h_sbrk_proto=no -+else -+ zsh_cv_header_unistd_h_sbrk_proto=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_sbrk_proto" >&5 -+$as_echo "$zsh_cv_header_unistd_h_sbrk_proto" >&6; } -+ -+if test x$zsh_cv_header_unistd_h_sbrk_proto = xyes; then -+ $as_echo "#define HAVE_SBRK_PROTO 1" >>confdefs.h -+ -+fi -+ -+ -+if test "$ac_cv_prog_cc_stdc" != no; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mknod prototype in " >&5 -+$as_echo_n "checking for mknod prototype in ... " >&6; } -+if ${zsh_cv_header_sys_stat_h_mknod_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ int mknod(double x); -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_sys_stat_h_mknod_proto=no -+else -+ zsh_cv_header_sys_stat_h_mknod_proto=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_stat_h_mknod_proto" >&5 -+$as_echo "$zsh_cv_header_sys_stat_h_mknod_proto" >&6; } -+ if test x$zsh_cv_header_sys_stat_h_mknod_proto = xyes; then -+ $as_echo "#define HAVE_MKNOD_PROTO 1" >>confdefs.h -+ -+ fi -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctl prototype in or " >&5 -+$as_echo_n "checking for ioctl prototype in or ... " >&6; } -+if ${zsh_cv_header_unistd_h_termios_h_ioctl_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HAVE_UNISTD_H -+# include -+#endif -+#ifdef HAVE_TERMIOS_H -+# include -+#endif -+double ioctl(); -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_unistd_h_termios_h_ioctl_proto=no -+else -+ zsh_cv_header_unistd_h_termios_h_ioctl_proto=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_termios_h_ioctl_proto" >&5 -+$as_echo "$zsh_cv_header_unistd_h_termios_h_ioctl_proto" >&6; } -+ -+if test x$zsh_cv_header_unistd_h_termios_h_ioctl_proto = xno; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctl prototype in " >&5 -+$as_echo_n "checking for ioctl prototype in ... " >&6; } -+if ${zsh_cv_header_sys_ioctl_h_ioctl_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ double ioctl(); -+int -+main () -+{ -+int i; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_sys_ioctl_h_ioctl_proto=no -+else -+ zsh_cv_header_sys_ioctl_h_ioctl_proto=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_ioctl_h_ioctl_proto" >&5 -+$as_echo "$zsh_cv_header_sys_ioctl_h_ioctl_proto" >&6; } -+else -+ zsh_cv_header_sys_ioctl_h_ioctl_proto=no -+fi -+ -+ -+if test x$zsh_cv_header_unistd_h_termios_h_ioctl_proto = xyes || \ -+ test x$zsh_cv_header_sys_ioctl_h_ioctl_proto = xyes; then -+ $as_echo "#define HAVE_IOCTL_PROTO 1" >>confdefs.h -+ -+fi -+ -+if test x$zsh_cv_header_sys_ioctl_h_ioctl_proto = xyes; then -+ $as_echo "#define IOCTL_IN_SYS_IOCTL 1" >>confdefs.h -+ -+fi -+ -+ -+if test x$ac_cv_header_sys_select_h != xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for select() in " >&5 -+$as_echo_n "checking for select() in ... " >&6; } -+if ${zsh_cv_header_socket_h_select_proto+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+fd_set fd; -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_header_socket_h_select_proto=yes -+else -+ zsh_cv_header_socket_h_select_proto=no -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_socket_h_select_proto" >&5 -+$as_echo "$zsh_cv_header_socket_h_select_proto" >&6; } -+ if test x$zsh_cv_header_socket_h_select_proto = xyes; then -+ $as_echo "#define SELECT_IN_SYS_SOCKET_H 1" >>confdefs.h -+ -+ fi -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if named FIFOs work" >&5 -+$as_echo_n "checking if named FIFOs work... " >&6; } -+if ${zsh_cv_sys_fifo+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$host_os" = cygwin; then -+zsh_cv_sys_fifo=yes -+else -+if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_fifo=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+main() -+{ -+ char c; -+ int fd; -+ int pid, ret; -+ unlink("/tmp/fifo$$"); -+#ifdef HAVE_MKFIFO -+ if(mkfifo("/tmp/fifo$$", 0600) < 0) -+#else -+ if(mknod("/tmp/fifo$$", 0010600, 0) < 0) -+#endif -+ exit(1); -+ pid = fork(); -+ if(pid < 0) -+ exit(1); -+ if(pid) { -+ fd = open("/tmp/fifo$$", O_RDONLY); -+ exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); -+ } -+ fd = open("/tmp/fifo$$", O_WRONLY); -+ ret = (fd < 0 || write(fd, "x", 1) < 1); -+ unlink("/tmp/fifo$$"); -+ exit(ret); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_fifo=yes -+else -+ zsh_cv_sys_fifo=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_fifo" >&5 -+$as_echo "$zsh_cv_sys_fifo" >&6; } -+ -+if test x$zsh_cv_sys_fifo = xyes; then -+ $as_echo "#define HAVE_FIFOS 1" >>confdefs.h -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if echo in /bin/sh interprets escape sequences" >&5 -+$as_echo_n "checking if echo in /bin/sh interprets escape sequences... " >&6; } -+if ${zsh_cv_prog_sh_echo_escape+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "`/bin/sh -c \"echo '\\n'\"`" = "\\n"; then -+ zsh_cv_prog_sh_echo_escape=no -+else -+ zsh_cv_prog_sh_echo_escape=yes -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_prog_sh_echo_escape" >&5 -+$as_echo "$zsh_cv_prog_sh_echo_escape" >&6; } -+ -+if test x$zsh_cv_prog_sh_echo_escape = xno; then -+ $as_echo "#define SH_USE_BSD_ECHO 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if link() works" >&5 -+$as_echo_n "checking if link() works... " >&6; } -+if ${zsh_cv_sys_link+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_link=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+main() -+{ -+ int ret; -+ char *tmpfile, *newfile; -+ tmpfile="/tmp/zsh.linktest$$"; -+ newfile="/tmp/zsh.linktest2$$"; -+ unlink(tmpfile); -+ unlink(newfile); -+ if(creat(tmpfile, 0644) < 0) -+ exit(1); -+ ret = link(tmpfile, newfile); -+ unlink(tmpfile); -+ unlink(newfile); -+ exit(ret<0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_link=yes -+else -+ zsh_cv_sys_link=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_link" >&5 -+$as_echo "$zsh_cv_sys_link" >&6; } -+ -+if test x$zsh_cv_sys_link = xyes; then -+ $as_echo "#define HAVE_LINK 1" >>confdefs.h -+ -+fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if kill(pid, 0) returns ESRCH correctly" >&5 -+$as_echo_n "checking if kill(pid, 0) returns ESRCH correctly... " >&6; } -+if ${zsh_cv_sys_killesrch+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_killesrch=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+#include -+main() -+{ -+ int pid = (getpid() + 10000) & 0xffffff; -+ while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; -+ exit(errno!=ESRCH); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_killesrch=yes -+else -+ zsh_cv_sys_killesrch=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_killesrch" >&5 -+$as_echo "$zsh_cv_sys_killesrch" >&6; } -+ -+if test x$zsh_cv_sys_killesrch = xno; then -+ $as_echo "#define BROKEN_KILL_ESRCH 1" >>confdefs.h -+ -+fi -+ -+ -+if test x$signals_style = xPOSIX_SIGNALS; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if POSIX sigsuspend() works" >&5 -+$as_echo_n "checking if POSIX sigsuspend() works... " >&6; } -+if ${zsh_cv_sys_sigsuspend+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_sigsuspend=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+int child=0; -+void handler(sig) -+ int sig; -+{if(sig==SIGCHLD) child=1;} -+main() { -+ struct sigaction act; -+ sigset_t set; -+ int pid, ret; -+ act.sa_handler = &handler; -+ sigfillset(&act.sa_mask); -+ act.sa_flags = 0; -+ sigaction(SIGCHLD, &act, 0); -+ sigfillset(&set); -+ sigprocmask(SIG_SETMASK, &set, 0); -+ pid=fork(); -+ if(pid==0) return 0; -+ if(pid>0) { -+ sigemptyset(&set); -+ ret=sigsuspend(&set); -+ exit(child==0); -+ } -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_sigsuspend=yes -+else -+ zsh_cv_sys_sigsuspend=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_sigsuspend" >&5 -+$as_echo "$zsh_cv_sys_sigsuspend" >&6; } -+ if test x$zsh_cv_sys_sigsuspend = xno; then -+ $as_echo "#define BROKEN_POSIX_SIGSUSPEND 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+ -+# Check whether --with-tcsetpgrp was given. -+if test "${with_tcsetpgrp+set}" = set; then : -+ withval=$with_tcsetpgrp; -+case "x$withval" in -+ xyes) zsh_working_tcsetpgrp=yes;; -+ xno) zsh_working_tcsetpgrp=no;; -+ *) as_fn_error $? "please use --with-tcsetpgrp=yes or --with-tcsetpgrp=no" "$LINENO" 5;; -+esac -+else -+ zsh_working_tcsetpgrp=check -+fi -+ -+if test "x$ac_cv_func_tcsetpgrp" = xyes; then -+case "x$zsh_working_tcsetpgrp" in -+ xcheck) -+ trap "" TTOU > /dev/null 2>&1 || : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcsetpgrp() actually works" >&5 -+$as_echo_n "checking if tcsetpgrp() actually works... " >&6; } -+if ${zsh_cv_sys_tcsetpgrp+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_tcsetpgrp=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#include -+#include -+main() { -+ int fd; -+ int ret; -+ fd=open("/dev/tty", O_RDWR); -+ if (fd < 0) exit(2); -+ ret=tcsetpgrp(fd, tcgetpgrp(fd)); -+ if (ret < 0) exit(1); -+ exit(0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_tcsetpgrp=yes -+else -+ -+case $? in -+ 1) zsh_cv_sys_tcsetpgrp=no;; -+ 2) zsh_cv_sys_tcsetpgrp=notty;; -+ *) zsh_cv_sys_tcsetpgrp=error;; -+esac -+ -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_tcsetpgrp" >&5 -+$as_echo "$zsh_cv_sys_tcsetpgrp" >&6; } -+ case "x$zsh_cv_sys_tcsetpgrp" in -+ xno) $as_echo "#define BROKEN_TCSETPGRP 1" >>confdefs.h -+;; -+ xyes) :;; -+ xnotty) as_fn_error $? "no controlling tty -+Try running configure with --with-tcsetpgrp or --without-tcsetpgrp" "$LINENO" 5;; -+ *) as_fn_error $? "unexpected return status" "$LINENO" 5;; -+ esac -+ trap - TTOU > /dev/null 2>&1 || : -+ ;; -+ xyes) :;; -+ xno) $as_echo "#define BROKEN_TCSETPGRP 1" >>confdefs.h -+;; -+ *) as_fn_error $? "unexpected value zsh_working_tcsetpgrp=$zsh_working_tcsetpgrp" "$LINENO" 5;; -+esac -+fi -+ -+ -+if test x$ac_cv_func_getpwnam = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getpwnam() is faked" >&5 -+$as_echo_n "checking if getpwnam() is faked... " >&6; } -+if ${zsh_cv_sys_getpwnam_faked+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_getpwnam_faked=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+main() { -+ struct passwd *pw1, *pw2; -+ char buf[1024], name[1024]; -+ sprintf(buf, "%d:%d", getpid(), rand()); -+ pw1=getpwnam(buf); -+ if (pw1) strcpy(name, pw1->pw_name); -+ sprintf(buf, "%d:%d", rand(), getpid()); -+ pw2=getpwnam(buf); -+ exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_getpwnam_faked=no -+else -+ zsh_cv_sys_getpwnam_faked=yes -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_getpwnam_faked" >&5 -+$as_echo "$zsh_cv_sys_getpwnam_faked" >&6; } -+ if test x$zsh_cv_sys_getpwnam_faked = xyes; then -+ $as_echo "#define GETPWNAM_FAKED 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking base type of the third argument to accept" >&5 -+$as_echo_n "checking base type of the third argument to accept... " >&6; } -+if ${zsh_cv_type_socklen_t+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ zsh_cv_type_socklen_t= -+ for zsh_type in socklen_t int "unsigned long" size_t ; do -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include -+ #include -+int -+main () -+{ -+extern int accept (int, struct sockaddr *, $zsh_type *); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ zsh_cv_type_socklen_t="$zsh_type"; break -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+ done -+ if test -z "$zsh_cv_type_socklen_t"; then -+ zsh_cv_type_socklen_t=int -+ fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_socklen_t" >&5 -+$as_echo "$zsh_cv_type_socklen_t" >&6; } -+ -+cat >>confdefs.h <<_ACEOF -+#define ZSOCKLEN_T $zsh_cv_type_socklen_t -+_ACEOF -+ -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system has /dev/ptmx" >&5 -+$as_echo_n "checking if your system has /dev/ptmx... " >&6; } -+if ${ac_cv_have_dev_ptmx+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test -w /dev/ptmx; then -+ ac_cv_have_dev_ptmx=yes -+else -+ ac_cv_have_dev_ptmx=no -+fi -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_dev_ptmx" >&5 -+$as_echo "$ac_cv_have_dev_ptmx" >&6; } -+ -+ -+if test x$ac_cv_have_dev_ptmx = xyes && \ -+ test x$ac_cv_func_grantpt = xyes && \ -+ test x$ac_cv_func_unlockpt = xyes && \ -+ test x$ac_cv_func_ptsname = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if /dev/ptmx is usable" >&5 -+$as_echo_n "checking if /dev/ptmx is usable... " >&6; } -+if ${ac_cv_use_dev_ptmx+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#ifdef __linux -+#define _GNU_SOURCE 1 -+#endif -+#include -+int ptsname(); -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_compile "$LINENO"; then : -+ ac_cv_use_dev_ptmx=no -+else -+ ac_cv_use_dev_ptmx=yes -+fi -+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_use_dev_ptmx" >&5 -+$as_echo "$ac_cv_use_dev_ptmx" >&6; } -+ if test x$ac_cv_use_dev_ptmx = xyes; then -+ $as_echo "#define USE_DEV_PTMX 1" >>confdefs.h -+ -+ fi -+fi -+ -+# Check whether --enable-multibyte was given. -+if test "${enable_multibyte+set}" = set; then : -+ enableval=$enable_multibyte; zsh_cv_c_unicode_support=$enableval -+else -+ if ${zsh_cv_c_unicode_support+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for functions supporting multibyte characters" >&5 -+$as_echo "$as_me: checking for functions supporting multibyte characters" >&6;} -+ zfuncs_absent= -+ for zfunc in iswalnum iswcntrl iswdigit iswgraph iswlower iswprint \ -+iswpunct iswspace iswupper iswxdigit mbrlen mbrtowc towupper towlower \ -+wcschr wcscpy wcslen wcsncmp wcsncpy wcrtomb wcwidth wmemchr wmemcmp \ -+wmemcpy wmemmove wmemset; do -+ as_ac_var=`$as_echo "ac_cv_func_$zfunc" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$zfunc" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ : -+else -+ zfuncs_absent="$zfuncs_absent $zfunc" -+fi -+ -+ done -+ if test x"$zfuncs_absent" = x; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: all functions found, multibyte support enabled" >&5 -+$as_echo "$as_me: all functions found, multibyte support enabled" >&6;} -+ zsh_cv_c_unicode_support=yes -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: missing functions, multibyte support disabled" >&5 -+$as_echo "$as_me: missing functions, multibyte support disabled" >&6;} -+ zsh_cv_c_unicode_support=no -+ fi -+ -+fi -+ -+ -+fi -+ -+ -+ -+if test x$zsh_cv_c_unicode_support = xyes; then -+ $as_echo "#define MULTIBYTE_SUPPORT 1" >>confdefs.h -+ -+ -+ locale_prog='char *my_locales[] = { -+ "en_US.UTF-8", "en_GB.UTF-8", "en.UTF-8", ' -+ locale_prog="$locale_prog"`locale -a 2>/dev/null | \ -+ sed -e 's/utf8/UTF-8/' | grep UTF-8 | \ -+ while read line; do echo " \"$line\","; done;` -+ locale_prog="$locale_prog 0 }; -+ #define _XOPEN_SOURCE -+ #include -+ #include -+ #include -+ -+ int main() { -+ char **localep; -+ char comb_acute_mb[] = { (char)0xcc, (char)0x81 }; -+ wchar_t wc; -+ -+ for (localep = my_locales; *localep; localep++) -+ if (setlocale(LC_ALL, *localep) && -+ mbtowc(&wc, comb_acute_mb, 2) == 2) -+ break; -+ if (!*localep) -+ return 1; -+ if (wcwidth(wc) == 0) -+ return 1; -+ return 0; -+ } -+ " -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the wcwidth() function is broken" >&5 -+$as_echo_n "checking if the wcwidth() function is broken... " >&6; } -+if ${zsh_cv_c_broken_wcwidth+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_c_broken_wcwidth=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+$locale_prog -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_c_broken_wcwidth=yes -+else -+ zsh_cv_c_broken_wcwidth=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_broken_wcwidth" >&5 -+$as_echo "$zsh_cv_c_broken_wcwidth" >&6; } -+ if test x$zsh_cv_c_broken_wcwidth = xyes; then -+ $as_echo "#define BROKEN_WCWIDTH 1" >>confdefs.h -+ -+ fi -+fi -+ -+ -+# Check whether --enable-libc-musl was given. -+if test "${enable_libc_musl+set}" = set; then : -+ enableval=$enable_libc_musl; if test x$enableval = xyes; then -+ $as_echo "#define LIBC_MUSL 1" >>confdefs.h -+ -+fi -+fi -+ -+ -+# Check whether --enable-dynamic-nss was given. -+if test "${enable_dynamic_nss+set}" = set; then : -+ enableval=$enable_dynamic_nss; zsh_cv_c_dynamic_nss=$enableval -+fi -+ -+ -+ -+if test x$zsh_cv_c_dynamic_nss = xno; then -+ $as_echo "#define DISABLE_DYNAMIC_NSS 1" >>confdefs.h -+ -+fi -+ -+ -+L=N -+INSTLIB="install.bin-\$(L)" -+UNINSTLIB="uninstall.bin-\$(L)" -+LINKMODS=NOLINKMODS -+MOD_EXPORT= -+MOD_IMPORT_VARIABLE= -+MOD_IMPORT_FUNCTION= -+aixdynamic=no -+hpuxdynamic=no -+if test "$ac_cv_func_load" = yes && -+ test "$ac_cv_func_unload" = yes && -+ test "$ac_cv_func_loadbind" = yes && -+ test "$ac_cv_func_loadquery" = yes; then -+ if test "x$dynamic" = xyes; then -+ aixdynamic=yes -+ fi -+elif test "$ac_cv_func_dlopen" != yes || -+ test "$ac_cv_func_dlsym" != yes || -+ test "$ac_cv_func_dlerror" != yes; then -+ if test "$ac_cv_func_shl_load" != yes || -+ test "$ac_cv_func_shl_unload" != yes || -+ test "$ac_cv_func_shl_findsym" != yes; then -+ dynamic=no -+ elif test "x$dynamic" = xyes; then -+ hpuxdynamic=yes -+ DL_EXT="${DL_EXT=sl}" -+ $as_echo "#define HPUX10DYNAMIC 1" >>confdefs.h -+ fi -+fi -+ -+test -n "$GCC" && LDARG=-Wl, -+ -+ -+ -+if test "x$aixdynamic" = xyes; then -+ DL_EXT="${DL_EXT=so}" -+ DLLD="${DLLD=$CC}" -+ zsh_cv_func_dlsym_needs_underscore=no -+ if test -n "$GCC"; then -+ DLLDFLAGS=${DLLDFLAGS=-shared} -+ else -+ DLLDFLAGS=${DLLDFLAGS=-bM:SRE} -+ fi -+ DLLDFLAGS=${DLLDFLAGS=} -+ EXTRA_LDFLAGS=${EXTRA_LDFLAGS=} -+ EXPOPT=${LDARG}-bE: -+ IMPOPT=${LDARG}-bI: -+ zsh_cv_sys_dynamic_clash_ok="${zsh_cv_sys_dynamic_clash_ok=yes}" -+ zsh_cv_sys_dynamic_rtld_global="${zsh_cv_sys_dynamic_rtld_global=yes}" -+ zsh_cv_sys_dynamic_execsyms="${zsh_cv_sys_dynamic_execsyms=yes}" -+ zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}" -+ zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}" -+ zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}" -+elif test "$host_os" = cygwin; then -+ DL_EXT="${DL_EXT=dll}" -+##DLLD="${DLLD=dllwrap}" -+ DLLD="${DLLD=$CC}" -+##DLLDFLAGS="${DLLDFLAGS=--export-all-symbols}" -+ DLLDFLAGS=${DLLDFLAGS=-shared -Wl,--export-all-symbols} -+ zsh_cv_func_dlsym_needs_underscore=no -+ DLLDFLAGS=${DLLDFLAGS=} -+ EXTRA_LDFLAGS=${EXTRA_LDFLAGS=} -+ zsh_cv_sys_dynamic_clash_ok="${zsh_cv_sys_dynamic_clash_ok=no}" -+ zsh_cv_sys_dynamic_rtld_global="${zsh_cv_sys_dynamic_rtld_global=yes}" -+ zsh_cv_sys_dynamic_execsyms="${zsh_cv_sys_dynamic_execsyms=no}" -+ zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}" -+ zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}" -+ # -+ # THAT SUCKS! and must be changed -+ # -+ zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}" -+ LINKMODS=LINKMODS -+ MOD_EXPORT="__attribute__((__dllexport__))" -+ MOD_IMPORT_VARIABLE="__attribute__((__dllimport__))" -+ MOD_IMPORT_FUNCTION= -+elif test "x$dynamic" = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system uses ELF binaries" >&5 -+$as_echo_n "checking if your system uses ELF binaries... " >&6; } -+if ${zsh_cv_sys_elf+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_elf=yes -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+/* Test for whether ELF binaries are produced */ -+#include -+#include -+main(argc, argv) -+int argc; -+char *argv[]; -+{ -+ char b[4]; -+ int i = open(argv[0],O_RDONLY); -+ if(i == -1) -+ exit(1); /* fail */ -+ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') -+ exit(0); /* succeed (yes, it's ELF) */ -+ else -+ exit(1); /* fail */ -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_elf=yes -+else -+ zsh_cv_sys_elf=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_elf" >&5 -+$as_echo "$zsh_cv_sys_elf" >&6; } -+ -+ # We use [0-9]* in case statements, so need to change quoting -+ -+ -+ DL_EXT="${DL_EXT=so}" -+ if test x$zsh_cv_sys_elf = xyes; then -+ case "$host" in -+ mips-sni-sysv4*) -+ # Forcibly set ld to native compiler to avoid obscure GCC problems -+ DLLD="${DLLD=/usr/ccs/bin/cc}" -+ DLLDARG="${LDARG}" -+ ;; -+ * ) -+ DLLD="${DLLD=$CC}" -+ DLLDARG="${LDARG}" -+ ;; -+ esac -+ else -+ case "$host" in -+ *openbsd*) -+ case "$host_os" in -+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -+ DLLD="${DLLD=ld}" -+ ;; -+ *) -+ DLLD="${DLLD=$CC}" -+ ;; -+ esac -+ DLLDARG="${LDARG}" -+ ;; -+ *darwin*) -+ DLLD="${DLLD=$CC}" -+ DLLDARG="" -+ ;; -+ * ) -+ DLLD="${DLLD=ld}" -+ DLLDARG="" -+ ;; -+ esac -+ fi -+ if test -n "$GCC"; then -+ case "$host_os" in -+ hpux*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; -+ darwin*) DLCFLAGS="${DLCFLAGS=-fno-common}" ;; -+ *) DLCFLAGS="${DLCFLAGS=-fPIC}" ;; -+ esac -+ else -+ case "$host_os" in -+ hpux*) -+ DLCFLAGS="${DLCFLAGS=+z}" -+ DLLDFLAGS="${DLLDFLAGS=-b}" -+ ;; -+ sunos*) DLCFLAGS="${DLCFLAGS=-pic}" ;; -+ solaris*|sysv4*|esix*) DLCFLAGS="${DLCFLAGS=-KPIC}" ;; -+ esac -+ fi -+ case "$host_os" in -+ osf*) DLLDFLAGS="${DLLDFLAGS=-shared -expect_unresolved '*'}" ;; -+ *freebsd*|linux*|irix*|gnu*|dragonfly*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; -+ sunos*) DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;; -+ sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;; -+ netbsd*) DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;; -+ aix*) DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;; -+ solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;; -+ darwin*) DLLDFLAGS="${DLLDFLAGS=-bundle -flat_namespace -undefined suppress}" ;; -+ beos*|haiku*) DLLDFLAGS="${DLLDFLAGS=-nostart}" ;; -+ openbsd*) -+ if test x$zsh_cv_sys_elf = xyes; then -+ DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" -+ else -+ case "$host_os" in -+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) -+ DLLDFLAGS="${DLLDFLAGS=-Bshareable}" -+ ;; -+ *) -+ DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" -+ ;; -+ esac -+ fi -+ ;; -+ esac -+ case "$host" in -+ *-hpux*) EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" ;; -+ *openbsd*) -+ if test x$zsh_cv_sys_elf = xyes; then -+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" -+ fi -+ ;; -+ mips-sni-sysv4) -+ # -+ # unfortunately, we have different compilers -+ # that need different flags -+ # -+ if test -n "$GCC"; then -+ sni_cc_version=GCC -+ else -+ sni_cc_version=`$CC -V 2>&1 | head -1` -+ fi -+ case "$sni_cc_version" in -+ *CDS*|GCC ) -+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-Blargedynsym}" -+ ;; -+ * ) -+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-LD-Blargedynsym}" -+ ;; -+ esac -+ ;; -+ *-beos*) -+ # gcc on BeOS doesn't like -rdynamic... -+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS= }" -+ # also, dlopen() at least in Zeta respects $LIBRARY_PATH, so needs %A added to it. -+ export LIBRARY_PATH="$LIBRARY_PATH:%A/" -+ ;; -+ *-haiku*) -+ # -+ ;; -+ esac -+ -+ # Done with our shell code, so restore autotools quoting -+ -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use -rdynamic" >&5 -+$as_echo_n "checking if we can use -rdynamic... " >&6; } -+if ${zsh_cv_rdynamic_available+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ old_LDFLAGS="$LDFLAGS" -+LDFLAGS="$LDFLAGS -rdynamic" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+int -+main () -+{ -+ -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ zsh_cv_rdynamic_available=yes -+EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-rdynamic}" -+else -+ zsh_cvs_rdynamic_available=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LDFLAGS="$old_LDFLAGS" -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rdynamic_available" >&5 -+$as_echo "$zsh_cv_rdynamic_available" >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your dlsym() needs a leading underscore" >&5 -+$as_echo_n "checking if your dlsym() needs a leading underscore... " >&6; } -+if ${zsh_cv_func_dlsym_needs_underscore+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ echo failed >conftestval && cat >conftest.c <&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+ { ac_try='$DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_func_dlsym_needs_underscore=no -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#include -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+ -+extern int fred() ; -+ -+main() -+{ -+ void * handle ; -+ void * symbol ; -+ FILE *f=fopen("conftestval", "w"); -+ if (!f) exit(1); -+ handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; -+ if (handle == NULL) { -+ fprintf (f, "dlopen failed") ; -+ exit(1); -+ } -+ symbol = dlsym(handle, "fred") ; -+ if (symbol == NULL) { -+ /* try putting a leading underscore */ -+ symbol = dlsym(handle, "_fred") ; -+ if (symbol == NULL) { -+ fprintf (f, "dlsym failed") ; -+ exit(1); -+ } -+ fprintf (f, "yes") ; -+ } -+ else -+ fprintf (f, "no") ; -+ exit(0); -+} -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_func_dlsym_needs_underscore=`cat conftestval` -+else -+ zsh_cv_func_dlsym_needs_underscore=failed -+ dynamic=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_dlsym_needs_underscore" >&5 -+$as_echo "$zsh_cv_func_dlsym_needs_underscore" >&6; } -+ if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then -+ $as_echo "#define DLSYM_NEEDS_UNDERSCORE 1" >>confdefs.h -+ -+ elif test "x$zsh_cv_func_dlsym_needs_underscore" != xno; then -+ unset zsh_cv_func_dlsym_needs_underscore -+ fi -+fi -+ -+if test "x$dynamic" = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is available in shared libraries" >&5 -+$as_echo_n "checking if environ is available in shared libraries... " >&6; } -+if ${zsh_cv_shared_environ+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo ' -+void *zsh_getaddr1() -+{ -+#ifdef __CYGWIN__ -+ __attribute__((__dllimport__)) -+#endif -+ extern char ** environ; -+ return &environ; -+}; -+' > conftest1.c -+sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_shared_environ=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle1, *handle2; -+ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); -+ void *sym1, *sym2; -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle2) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); -+ sym1 = zsh_getaddr1(); -+ sym2 = zsh_getaddr2(); -+ if(!sym1 || !sym2) exit(1); -+ if(sym1 != sym2) exit(1); -+ dlclose(handle1); -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ sym1 = zsh_getaddr1(); -+ if(!sym1) exit(1); -+ if(sym1 != sym2) exit(1); -+ exit(0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_shared_environ=yes -+else -+ zsh_cv_shared_environ=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_shared_environ=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_environ" >&5 -+$as_echo "$zsh_cv_shared_environ" >&6; } -+ -+ test "$zsh_cv_shared_environ" = yes || dynamic=no -+ if test "$ac_cv_func_tgetent" = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent is available in shared libraries" >&5 -+$as_echo_n "checking if tgetent is available in shared libraries... " >&6; } -+if ${zsh_cv_shared_tgetent+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo ' -+void *zsh_getaddr1() -+{ -+#ifdef __CYGWIN__ -+ __attribute__((__dllimport__)) -+#endif -+ extern int tgetent ( ); -+ return tgetent; -+}; -+' > conftest1.c -+sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_shared_tgetent=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle1, *handle2; -+ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); -+ void *sym1, *sym2; -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle2) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); -+ sym1 = zsh_getaddr1(); -+ sym2 = zsh_getaddr2(); -+ if(!sym1 || !sym2) exit(1); -+ if(sym1 != sym2) exit(1); -+ dlclose(handle1); -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ sym1 = zsh_getaddr1(); -+ if(!sym1) exit(1); -+ if(sym1 != sym2) exit(1); -+ exit(0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_shared_tgetent=yes -+else -+ zsh_cv_shared_tgetent=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_shared_tgetent=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_tgetent" >&5 -+$as_echo "$zsh_cv_shared_tgetent" >&6; } -+ -+ fi -+ if test "$ac_cv_func_tigetstr" = yes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tigetstr is available in shared libraries" >&5 -+$as_echo_n "checking if tigetstr is available in shared libraries... " >&6; } -+if ${zsh_cv_shared_tigetstr+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo ' -+void *zsh_getaddr1() -+{ -+#ifdef __CYGWIN__ -+ __attribute__((__dllimport__)) -+#endif -+ extern int tigetstr ( ); -+ return tigetstr; -+}; -+' > conftest1.c -+sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_shared_tigetstr=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle1, *handle2; -+ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); -+ void *sym1, *sym2; -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle2) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); -+ sym1 = zsh_getaddr1(); -+ sym2 = zsh_getaddr2(); -+ if(!sym1 || !sym2) exit(1); -+ if(sym1 != sym2) exit(1); -+ dlclose(handle1); -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); -+ sym1 = zsh_getaddr1(); -+ if(!sym1) exit(1); -+ if(sym1 != sym2) exit(1); -+ exit(0); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_shared_tigetstr=yes -+else -+ zsh_cv_shared_tigetstr=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_shared_tigetstr=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_tigetstr" >&5 -+$as_echo "$zsh_cv_shared_tigetstr" >&6; } -+ -+ fi -+fi -+ -+if test "x$dynamic" = xyes; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if name clashes in shared objects are OK" >&5 -+$as_echo_n "checking if name clashes in shared objects are OK... " >&6; } -+if ${zsh_cv_sys_dynamic_clash_ok+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo 'int fred () { return 42; }' > conftest1.c -+echo 'int fred () { return 69; }' > conftest2.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_dynamic_clash_ok=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+ -+main() -+{ -+ void *handle1, *handle2; -+ int (*fred1)(), (*fred2)(); -+ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle1) exit(1); -+ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle2) exit(1); -+ fred1 = (int (*)()) dlsym(handle1, "${us}fred"); -+ fred2 = (int (*)()) dlsym(handle2, "${us}fred"); -+ if(!fred1 || !fred2) exit(1); -+ exit((*fred1)() != 42 || (*fred2)() != 69); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_dynamic_clash_ok=yes -+else -+ zsh_cv_sys_dynamic_clash_ok=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_sys_dynamic_clash_ok=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_clash_ok" >&5 -+$as_echo "$zsh_cv_sys_dynamic_clash_ok" >&6; } -+if test "$zsh_cv_sys_dynamic_clash_ok" = yes; then -+ $as_echo "#define DYNAMIC_NAME_CLASH_OK 1" >>confdefs.h -+ -+fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working RTLD_GLOBAL" >&5 -+$as_echo_n "checking for working RTLD_GLOBAL... " >&6; } -+if ${zsh_cv_sys_dynamic_rtld_global+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo 'int fred () { return 42; }' > conftest1.c -+echo 'extern int fred(); int barney () { return fred() + 27; }' > conftest2.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_dynamic_rtld_global=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle; -+ int (*barneysym)(); -+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle) exit(1); -+ handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle) exit(1); -+ barneysym = (int (*)()) dlsym(handle, "${us}barney"); -+ if(!barneysym) exit(1); -+ exit((*barneysym)() != 69); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_dynamic_rtld_global=yes -+else -+ zsh_cv_sys_dynamic_rtld_global=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_sys_dynamic_rtld_global=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_rtld_global" >&5 -+$as_echo "$zsh_cv_sys_dynamic_rtld_global" >&6; } -+ -+ RTLD_GLOBAL_OK=$zsh_cv_sys_dynamic_rtld_global -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbols in the executable are available" >&5 -+$as_echo_n "checking whether symbols in the executable are available... " >&6; } -+if ${zsh_cv_sys_dynamic_execsyms+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo 'extern int fred(); int barney () { return fred() + 27; }' > conftest1.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ save_ldflags=$LDFLAGS -+ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_dynamic_execsyms=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle; -+ int (*barneysym)(); -+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle) exit(1); -+ barneysym = (int (*)()) dlsym(handle, "${us}barney"); -+ if(!barneysym) exit(1); -+ exit((*barneysym)() != 69); -+} -+ -+int fred () { return 42; } -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_dynamic_execsyms=yes -+else -+ zsh_cv_sys_dynamic_execsyms=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ LDFLAGS=$save_ldflags -+else -+ zsh_cv_sys_dynamic_execsyms=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_execsyms" >&5 -+$as_echo "$zsh_cv_sys_dynamic_execsyms" >&6; } -+ -+ if test "$zsh_cv_sys_dynamic_execsyms" != yes; then -+ L=L -+ fi -+ -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether executables can be stripped" >&5 -+$as_echo_n "checking whether executables can be stripped... " >&6; } -+if ${zsh_cv_sys_dynamic_strip_exe+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_sys_dynamic_execsyms" != yes; then -+ zsh_cv_sys_dynamic_strip_exe=yes -+elif -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+ else -+ us= -+ fi -+ echo 'extern int fred(); int barney() { return fred() + 27; }' > conftest1.c -+ { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+ { ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ save_ldflags=$LDFLAGS -+ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s" -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_dynamic_strip_exe=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle; -+ int (*barneysym)(); -+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle) exit(1); -+ barneysym = (int (*)()) dlsym(handle, "${us}barney"); -+ if(!barneysym) exit(1); -+ exit((*barneysym)() != 69); -+} -+ -+int fred () { return 42; } -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_dynamic_strip_exe=yes -+else -+ zsh_cv_sys_dynamic_strip_exe=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+ LDFLAGS=$save_ldflags -+else -+ zsh_cv_sys_dynamic_strip_exe=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_strip_exe" >&5 -+$as_echo "$zsh_cv_sys_dynamic_strip_exe" >&6; } -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libraries can be stripped" >&5 -+$as_echo_n "checking whether libraries can be stripped... " >&6; } -+if ${zsh_cv_sys_dynamic_strip_lib+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then -+ us=_ -+else -+ us= -+fi -+echo 'int fred () { return 42; }' > conftest1.c -+if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; } && -+{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&5' -+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 -+ test $ac_status = 0; }; }; then -+ if test "$cross_compiling" = yes; then : -+ zsh_cv_sys_dynamic_strip_lib=no -+ -+else -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+#ifdef HPUX10DYNAMIC -+#include -+#define RTLD_LAZY BIND_DEFERRED -+#define RTLD_GLOBAL DYNAMIC_PATH -+ -+char *zsh_gl_sym_addr ; -+ -+#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) -+#define dlclose(handle) shl_unload((shl_t)(handle)) -+#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) -+#define dlerror() 0 -+#else -+#ifdef HAVE_DLFCN_H -+#include -+#else -+#include -+#include -+#include -+#endif -+#endif -+#ifndef RTLD_LAZY -+#define RTLD_LAZY 1 -+#endif -+#ifndef RTLD_GLOBAL -+#define RTLD_GLOBAL 0 -+#endif -+ -+main() -+{ -+ void *handle; -+ int (*fredsym)(); -+ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); -+ if(!handle) exit(1); -+ fredsym = (int (*)()) dlsym(handle, "${us}fred"); -+ if(!fredsym) exit(1); -+ exit((*fredsym)() != 42); -+} -+ -+_ACEOF -+if ac_fn_c_try_run "$LINENO"; then : -+ zsh_cv_sys_dynamic_strip_lib=yes -+else -+ zsh_cv_sys_dynamic_strip_lib=no -+fi -+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ -+ conftest.$ac_objext conftest.beam conftest.$ac_ext -+fi -+ -+else -+ zsh_cv_sys_dynamic_strip_lib=no -+fi -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_strip_lib" >&5 -+$as_echo "$zsh_cv_sys_dynamic_strip_lib" >&6; } -+ -+ if $strip_exeldflags && test "$zsh_cv_sys_dynamic_strip_exe" = yes; then -+ EXELDFLAGS="$EXELDFLAGS -s" -+ fi -+ if $strip_libldflags && test "$zsh_cv_sys_dynamic_strip_lib" = yes; then -+ LIBLDFLAGS="$LIBLDFLAGS -s" -+ fi -+ if test "$host_os" = cygwin; then -+ INSTLIB="install.cygwin-lib" -+ UNINSTLIB="uninstall.cygwin-lib" -+ fi -+else -+ $strip_exeldflags && EXELDFLAGS="$EXELDFLAGS -s" -+ $strip_libldflags && LIBLDFLAGS="$LIBLDFLAGS -s" -+ RTLD_GLOBAL_OK=no -+fi -+ -+ -+if test "x$dynamic" = xyes; then -+ D=D -+ $as_echo "#define DYNAMIC 1" >>confdefs.h -+else -+ D=N -+fi -+ -+ -+if test "x$aixdynamic" = xyes; then -+ E=E -+ $as_echo "#define AIXDYNAMIC 1" >>confdefs.h -+else -+ E=N -+fi -+ -+if test "x$zsh_cv_sys_dynamic_clash_ok" = xyes; then -+ SHORTBOOTNAMES=yes -+else -+ SHORTBOOTNAMES=no -+fi -+ -+ -+ -+if test "$host_os" = cygwin; then -+ EXTRAZSHOBJS="$EXTRAZSHOBJS zsh.res.o" -+fi -+ -+ -+cat >>confdefs.h <<_ACEOF -+#define DL_EXT "$DL_EXT" -+_ACEOF -+ -+# Generate config.modules. We look for *.mdd files in first and second -+# level subdirectories. Any existing line not containing 'auto=y' will be -+# retained, provided the .mdd file itself was found. -+CONFIG_MODULES=./config.modules -+cat < ${CONFIG_MODULES}.sh -+srcdir="$srcdir" -+dynamic="$dynamic" -+CONFIG_MODULES="${CONFIG_MODULES}" -+EOM -+cat <<\EOM >> ${CONFIG_MODULES}.sh -+echo "creating ${CONFIG_MODULES}" -+userlist=" " -+if test -f ${CONFIG_MODULES}; then -+ userlist="`sed -e '/^#/d' -e '/auto=y/d' -e 's/ .*/ /' -e 's/^name=/ /' \ -+ ${CONFIG_MODULES}`" -+ mv ${CONFIG_MODULES} ${CONFIG_MODULES}.old -+else -+ # Save testing for existence each time. -+ echo > ${CONFIG_MODULES}.old -+fi -+(echo "# Edit this file to change the way modules are loaded." -+echo "# The format is strict; do not break lines or add extra spaces." -+echo "# Run \`make prep' if you change anything here after compiling" -+echo "# (there is no need if you change this just after the first time" -+echo "# you run \`configure')." -+echo "#" -+echo "# Values of \`link' are \`static', \`dynamic' or \`no' to compile the" -+echo "# module into the shell, link it in at run time, or not use it at all." -+echo "# In the final case, no attempt will be made to compile it." -+echo "# Use \`static' or \`no' if you do not have dynamic loading." -+echo "#" -+echo "# Values of \`load' are \`yes' or \`no'; if yes, any builtins etc." -+echo "# provided by the module will be autoloaded by the main shell" -+echo "# (so long as \`link' is not set to \`no')." -+echo "#" -+echo "# Values of \`auto' are \`yes' or \`no'. configure sets the value to" -+echo "# \`yes'. If you set it by hand to \`no', the line will be retained" -+echo "# when the file is regenerated in future." -+echo "#" -+echo "# Note that the \`functions' entry extends to the end of the line." -+echo "# It should not be quoted; it is used verbatim to find files to install." -+echo "#" -+echo "# You will need to run \`config.status --recheck' if you add a new" -+echo "# module." -+echo "#" -+echo "# You should not change the values for the pseudo-module zsh/main," -+echo "# which is the main shell (apart from the functions entry)." -+EOM -+for modfile in `cd ${srcdir}; echo */*.mdd */*/*.mdd`; do -+ name= -+ link= -+ load= -+ functions= -+ result= -+ . ${srcdir}/$modfile -+ if test x$name != x && test x"$link" != x; then -+ case "$link" in -+ *\ *) eval "link=\`$link\`" -+ ;; -+ esac -+ case "${load}" in -+ y*) load=" load=yes" -+ ;; -+ *) load=" load=no" -+ ;; -+ esac -+ if test "x$functions" != x; then -+ # N.B. no additional quotes -+ f=" functions=$functions" -+ else -+ f= -+ fi -+ case "$link" in -+ static) result="name=$name modfile=$modfile link=static auto=yes${load}$f" -+ ;; -+ dynamic) if test x$dynamic != xno; then -+ result="name=$name modfile=$modfile link=dynamic\ -+ auto=yes${load}$f" -+ else -+ result="name=$name modfile=$modfile link=no\ -+ auto=yes load=no$f" -+ fi -+ ;; -+ either) if test x$dynamic != xno; then -+ result="name=$name modfile=$modfile link=dynamic\ -+ auto=yes${load}$f" -+ else -+ result="name=$name modfile=$modfile link=static\ -+ auto=yes${load}$f" -+ fi -+ ;; -+ *) result="name=$name modfile=$modfile link=no auto=yes load=no$f" -+ ;; -+ esac -+cat <> ${CONFIG_MODULES}.sh -+case "\$userlist" in -+ *" $name "*) grep "^name=$name " \${CONFIG_MODULES}.old;; -+ *) echo "$result";; -+esac -+EOM -+ fi -+done -+cat <<\EOM >> ${CONFIG_MODULES}.sh -+) >${CONFIG_MODULES} -+rm -f ${CONFIG_MODULES}.old -+EOM -+ -+ -+ -+CLEAN_MK="${srcdir}/Config/clean.mk" -+CONFIG_MK="${srcdir}/Config/config.mk" -+DEFS_MK="Config/defs.mk" -+VERSION_MK="${srcdir}/Config/version.mk" -+ -+ -+ac_config_files="$ac_config_files Config/defs.mk Makefile Doc/Makefile Etc/Makefile Src/Makefile Test/Makefile" -+ -+ac_config_commands="$ac_config_commands config.modules" -+ -+ac_config_commands="$ac_config_commands stamp-h" -+ -+ -+cat >confcache <<\_ACEOF -+# This file is a shell script that caches the results of configure -+# tests run on this system so they can be shared between configure -+# scripts and configure runs, see configure's option --config-cache. -+# It is not useful on other systems. If it contains results you don't -+# want to keep, you may remove or edit it. -+# -+# config.status only pays attention to the cache file if you give it -+# the --recheck option to rerun configure. -+# -+# `ac_cv_env_foo' variables (set or unset) will be overridden when -+# loading this file, other *unset* `ac_cv_foo' will be assigned the -+# following values. -+ -+_ACEOF -+ -+# The following way of writing the cache mishandles newlines in values, -+# but we know of no workaround that is simple, portable, and efficient. -+# So, we kill variables containing newlines. -+# Ultrix sh set writes to stderr and can't be redirected directly, -+# and sets the high bit in the cache file unless we assign to the vars. -+( -+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do -+ eval ac_val=\$$ac_var -+ case $ac_val in #( -+ *${as_nl}*) -+ case $ac_var in #( -+ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; -+ esac -+ case $ac_var in #( -+ _ | IFS | as_nl) ;; #( -+ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( -+ *) { eval $ac_var=; unset $ac_var;} ;; -+ esac ;; -+ esac -+ done -+ -+ (set) 2>&1 | -+ case $as_nl`(ac_space=' '; set) 2>&1` in #( -+ *${as_nl}ac_space=\ *) -+ # `set' does not quote correctly, so add quotes: double-quote -+ # substitution turns \\\\ into \\, and sed turns \\ into \. -+ sed -n \ -+ "s/'/'\\\\''/g; -+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" -+ ;; #( -+ *) -+ # `set' quotes correctly as required by POSIX, so do not add quotes. -+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" -+ ;; -+ esac | -+ sort -+) | -+ sed ' -+ /^ac_cv_env_/b end -+ t clear -+ :clear -+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ -+ t end -+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ -+ :end' >>confcache -+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else -+ if test -w "$cache_file"; then -+ if test "x$cache_file" != "x/dev/null"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -+$as_echo "$as_me: updating cache $cache_file" >&6;} -+ if test ! -f "$cache_file" || test -h "$cache_file"; then -+ cat confcache >"$cache_file" -+ else -+ case $cache_file in #( -+ */* | ?:*) -+ mv -f confcache "$cache_file"$$ && -+ mv -f "$cache_file"$$ "$cache_file" ;; #( -+ *) -+ mv -f confcache "$cache_file" ;; -+ esac -+ fi -+ fi -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} -+ fi -+fi -+rm -f confcache -+ -+test "x$prefix" = xNONE && prefix=$ac_default_prefix -+# Let make expand exec_prefix. -+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ -+DEFS=-DHAVE_CONFIG_H -+ -+ac_libobjs= -+ac_ltlibobjs= -+U= -+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue -+ # 1. Remove the extension, and $U if already installed. -+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' -+ ac_i=`$as_echo "$ac_i" | sed "$ac_script"` -+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR -+ # will be set to the directory where LIBOBJS objects are built. -+ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" -+ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -+done -+LIBOBJS=$ac_libobjs -+ -+LTLIBOBJS=$ac_ltlibobjs -+ -+ -+ -+: "${CONFIG_STATUS=./config.status}" -+ac_write_fail=0 -+ac_clean_files_save=$ac_clean_files -+ac_clean_files="$ac_clean_files $CONFIG_STATUS" -+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -+as_write_fail=0 -+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -+#! $SHELL -+# Generated by $as_me. -+# Run this file to recreate the current configuration. -+# Compiler output produced by configure, useful for debugging -+# configure, is in config.log if it exists. -+ -+debug=false -+ac_cs_recheck=false -+ac_cs_silent=false -+ -+SHELL=\${CONFIG_SHELL-$SHELL} -+export SHELL -+_ASEOF -+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -+## -------------------- ## -+## M4sh Initialization. ## -+## -------------------- ## -+ -+# Be more Bourne compatible -+DUALCASE=1; export DUALCASE # for MKS sh -+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : -+ emulate sh -+ NULLCMD=: -+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which -+ # is contrary to our usage. Disable this feature. -+ alias -g '${1+"$@"}'='"$@"' -+ setopt NO_GLOB_SUBST -+else -+ case `(set -o) 2>/dev/null` in #( -+ *posix*) : -+ set -o posix ;; #( -+ *) : -+ ;; -+esac -+fi -+ -+ -+as_nl=' -+' -+export as_nl -+# Printing a long string crashes Solaris 7 /usr/bin/printf. -+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -+# Prefer a ksh shell builtin over an external printf program on Solaris, -+# but without wasting forks for bash or zsh. -+if test -z "$BASH_VERSION$ZSH_VERSION" \ -+ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='print -r --' -+ as_echo_n='print -rn --' -+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then -+ as_echo='printf %s\n' -+ as_echo_n='printf %s' -+else -+ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then -+ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' -+ as_echo_n='/usr/ucb/echo -n' -+ else -+ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' -+ as_echo_n_body='eval -+ arg=$1; -+ case $arg in #( -+ *"$as_nl"*) -+ expr "X$arg" : "X\\(.*\\)$as_nl"; -+ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; -+ esac; -+ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" -+ ' -+ export as_echo_n_body -+ as_echo_n='sh -c $as_echo_n_body as_echo' -+ fi -+ export as_echo_body -+ as_echo='sh -c $as_echo_body as_echo' -+fi -+ -+# The user is always right. -+if test "${PATH_SEPARATOR+set}" != set; then -+ PATH_SEPARATOR=: -+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { -+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || -+ PATH_SEPARATOR=';' -+ } -+fi -+ -+ -+# IFS -+# We need space, tab and new line, in precisely that order. Quoting is -+# there to prevent editors from complaining about space-tab. -+# (If _AS_PATH_WALK were called with IFS unset, it would disable word -+# splitting by setting IFS to empty value.) -+IFS=" "" $as_nl" -+ -+# Find who we are. Look in the path if we contain no directory separator. -+as_myself= -+case $0 in #(( -+ *[\\/]* ) as_myself=$0 ;; -+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+# We did not find ourselves, most probably we were run as `sh COMMAND' -+# in which case we are not to be found in the path. -+if test "x$as_myself" = x; then -+ as_myself=$0 -+fi -+if test ! -f "$as_myself"; then -+ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 -+ exit 1 -+fi -+ -+# Unset variables that we do not need and which cause bugs (e.g. in -+# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -+# suppresses any "Segmentation fault" message there. '((' could -+# trigger a bug in pdksh 5.2.14. -+for as_var in BASH_ENV ENV MAIL MAILPATH -+do eval test x\${$as_var+set} = xset \ -+ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -+done -+PS1='$ ' -+PS2='> ' -+PS4='+ ' -+ -+# NLS nuisances. -+LC_ALL=C -+export LC_ALL -+LANGUAGE=C -+export LANGUAGE -+ -+# CDPATH. -+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -+ -+ -+# as_fn_error STATUS ERROR [LINENO LOG_FD] -+# ---------------------------------------- -+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -+# script with STATUS, using 1 if that was 0. -+as_fn_error () -+{ -+ as_status=$1; test $as_status -eq 0 && as_status=1 -+ if test "$4"; then -+ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack -+ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 -+ fi -+ $as_echo "$as_me: error: $2" >&2 -+ as_fn_exit $as_status -+} # as_fn_error -+ -+ -+# as_fn_set_status STATUS -+# ----------------------- -+# Set $? to STATUS, without forking. -+as_fn_set_status () -+{ -+ return $1 -+} # as_fn_set_status -+ -+# as_fn_exit STATUS -+# ----------------- -+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -+as_fn_exit () -+{ -+ set +e -+ as_fn_set_status $1 -+ exit $1 -+} # as_fn_exit -+ -+# as_fn_unset VAR -+# --------------- -+# Portably unset VAR. -+as_fn_unset () -+{ -+ { eval $1=; unset $1;} -+} -+as_unset=as_fn_unset -+# as_fn_append VAR VALUE -+# ---------------------- -+# Append the text in VALUE to the end of the definition contained in VAR. Take -+# advantage of any shell optimizations that allow amortized linear growth over -+# repeated appends, instead of the typical quadratic growth present in naive -+# implementations. -+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : -+ eval 'as_fn_append () -+ { -+ eval $1+=\$2 -+ }' -+else -+ as_fn_append () -+ { -+ eval $1=\$$1\$2 -+ } -+fi # as_fn_append -+ -+# as_fn_arith ARG... -+# ------------------ -+# Perform arithmetic evaluation on the ARGs, and store the result in the -+# global $as_val. Take advantage of shells that can avoid forks. The arguments -+# must be portable across $(()) and expr. -+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : -+ eval 'as_fn_arith () -+ { -+ as_val=$(( $* )) -+ }' -+else -+ as_fn_arith () -+ { -+ as_val=`expr "$@" || test $? -eq 1` -+ } -+fi # as_fn_arith -+ -+ -+if expr a : '\(a\)' >/dev/null 2>&1 && -+ test "X`expr 00001 : '.*\(...\)'`" = X001; then -+ as_expr=expr -+else -+ as_expr=false -+fi -+ -+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then -+ as_basename=basename -+else -+ as_basename=false -+fi -+ -+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then -+ as_dirname=dirname -+else -+ as_dirname=false -+fi -+ -+as_me=`$as_basename -- "$0" || -+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ -+ X"$0" : 'X\(//\)$' \| \ -+ X"$0" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X/"$0" | -+ sed '/^.*\/\([^/][^/]*\)\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\/\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ -+# Avoid depending upon Character Ranges. -+as_cr_letters='abcdefghijklmnopqrstuvwxyz' -+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -+as_cr_Letters=$as_cr_letters$as_cr_LETTERS -+as_cr_digits='0123456789' -+as_cr_alnum=$as_cr_Letters$as_cr_digits -+ -+ECHO_C= ECHO_N= ECHO_T= -+case `echo -n x` in #((((( -+-n*) -+ case `echo 'xy\c'` in -+ *c*) ECHO_T=' ';; # ECHO_T is single tab character. -+ xy) ECHO_C='\c';; -+ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null -+ ECHO_T=' ';; -+ esac;; -+*) -+ ECHO_N='-n';; -+esac -+ -+rm -f conf$$ conf$$.exe conf$$.file -+if test -d conf$$.dir; then -+ rm -f conf$$.dir/conf$$.file -+else -+ rm -f conf$$.dir -+ mkdir conf$$.dir 2>/dev/null -+fi -+if (echo >conf$$.file) 2>/dev/null; then -+ if ln -s conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s='ln -s' -+ # ... but there are two gotchas: -+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. -+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. -+ # In both cases, we have to default to `cp -p'. -+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || -+ as_ln_s='cp -p' -+ elif ln conf$$.file conf$$ 2>/dev/null; then -+ as_ln_s=ln -+ else -+ as_ln_s='cp -p' -+ fi -+else -+ as_ln_s='cp -p' -+fi -+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -+rmdir conf$$.dir 2>/dev/null -+ -+ -+# as_fn_mkdir_p -+# ------------- -+# Create "$as_dir" as a directory, including parents if necessary. -+as_fn_mkdir_p () -+{ -+ -+ case $as_dir in #( -+ -*) as_dir=./$as_dir;; -+ esac -+ test -d "$as_dir" || eval $as_mkdir_p || { -+ as_dirs= -+ while :; do -+ case $as_dir in #( -+ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( -+ *) as_qdir=$as_dir;; -+ esac -+ as_dirs="'$as_qdir' $as_dirs" -+ as_dir=`$as_dirname -- "$as_dir" || -+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$as_dir" : 'X\(//\)[^/]' \| \ -+ X"$as_dir" : 'X\(//\)$' \| \ -+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$as_dir" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ test -d "$as_dir" && break -+ done -+ test -z "$as_dirs" || eval "mkdir $as_dirs" -+ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" -+ -+ -+} # as_fn_mkdir_p -+if mkdir -p . 2>/dev/null; then -+ as_mkdir_p='mkdir -p "$as_dir"' -+else -+ test -d ./-p && rmdir ./-p -+ as_mkdir_p=false -+fi -+ -+if test -x / >/dev/null 2>&1; then -+ as_test_x='test -x' -+else -+ if ls -dL / >/dev/null 2>&1; then -+ as_ls_L_option=L -+ else -+ as_ls_L_option= -+ fi -+ as_test_x=' -+ eval sh -c '\'' -+ if test -d "$1"; then -+ test -d "$1/."; -+ else -+ case $1 in #( -+ -*)set "./$1";; -+ esac; -+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( -+ ???[sx]*):;;*)false;;esac;fi -+ '\'' sh -+ ' -+fi -+as_executable_p=$as_test_x -+ -+# Sed expression to map a string onto a valid CPP name. -+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" -+ -+# Sed expression to map a string onto a valid variable name. -+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -+ -+ -+exec 6>&1 -+## ----------------------------------- ## -+## Main body of $CONFIG_STATUS script. ## -+## ----------------------------------- ## -+_ASEOF -+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# Save the log message, to keep $0 and so on meaningful, and to -+# report actual input values of CONFIG_FILES etc. instead of their -+# values after options handling. -+ac_log=" -+This file was extended by $as_me, which was -+generated by GNU Autoconf 2.68. Invocation command line was -+ -+ CONFIG_FILES = $CONFIG_FILES -+ CONFIG_HEADERS = $CONFIG_HEADERS -+ CONFIG_LINKS = $CONFIG_LINKS -+ CONFIG_COMMANDS = $CONFIG_COMMANDS -+ $ $0 $@ -+ -+on `(hostname || uname -n) 2>/dev/null | sed 1q` -+" -+ -+_ACEOF -+ -+case $ac_config_files in *" -+"*) set x $ac_config_files; shift; ac_config_files=$*;; -+esac -+ -+case $ac_config_headers in *" -+"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -+esac -+ -+ -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+# Files that config.status was made for. -+config_files="$ac_config_files" -+config_headers="$ac_config_headers" -+config_commands="$ac_config_commands" -+ -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+ac_cs_usage="\ -+\`$as_me' instantiates files and other configuration actions -+from templates according to the current configuration. Unless the files -+and actions are specified as TAGs, all are instantiated by default. -+ -+Usage: $0 [OPTION]... [TAG]... -+ -+ -h, --help print this help, then exit -+ -V, --version print version number and configuration settings, then exit -+ --config print configuration, then exit -+ -q, --quiet, --silent -+ do not print progress messages -+ -d, --debug don't remove temporary files -+ --recheck update $as_me by reconfiguring in the same conditions -+ --file=FILE[:TEMPLATE] -+ instantiate the configuration file FILE -+ --header=FILE[:TEMPLATE] -+ instantiate the configuration header FILE -+ -+Configuration files: -+$config_files -+ -+Configuration headers: -+$config_headers -+ -+Configuration commands: -+$config_commands -+ -+Report bugs to the package provider." -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -+ac_cs_version="\\ -+config.status -+configured by $0, generated by GNU Autoconf 2.68, -+ with options \\"\$ac_cs_config\\" -+ -+Copyright (C) 2010 Free Software Foundation, Inc. -+This config.status script is free software; the Free Software Foundation -+gives unlimited permission to copy, distribute and modify it." -+ -+ac_pwd='$ac_pwd' -+srcdir='$srcdir' -+INSTALL='$INSTALL' -+AWK='$AWK' -+test -n "\$AWK" || AWK=awk -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# The default lists apply if the user does not specify any file. -+ac_need_defaults=: -+while test $# != 0 -+do -+ case $1 in -+ --*=?*) -+ ac_option=`expr "X$1" : 'X\([^=]*\)='` -+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` -+ ac_shift=: -+ ;; -+ --*=) -+ ac_option=`expr "X$1" : 'X\([^=]*\)='` -+ ac_optarg= -+ ac_shift=: -+ ;; -+ *) -+ ac_option=$1 -+ ac_optarg=$2 -+ ac_shift=shift -+ ;; -+ esac -+ -+ case $ac_option in -+ # Handling of the options. -+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) -+ ac_cs_recheck=: ;; -+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) -+ $as_echo "$ac_cs_version"; exit ;; -+ --config | --confi | --conf | --con | --co | --c ) -+ $as_echo "$ac_cs_config"; exit ;; -+ --debug | --debu | --deb | --de | --d | -d ) -+ debug=: ;; -+ --file | --fil | --fi | --f ) -+ $ac_shift -+ case $ac_optarg in -+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ '') as_fn_error $? "missing file argument" ;; -+ esac -+ as_fn_append CONFIG_FILES " '$ac_optarg'" -+ ac_need_defaults=false;; -+ --header | --heade | --head | --hea ) -+ $ac_shift -+ case $ac_optarg in -+ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; -+ esac -+ as_fn_append CONFIG_HEADERS " '$ac_optarg'" -+ ac_need_defaults=false;; -+ --he | --h) -+ # Conflict between --help and --header -+ as_fn_error $? "ambiguous option: \`$1' -+Try \`$0 --help' for more information.";; -+ --help | --hel | -h ) -+ $as_echo "$ac_cs_usage"; exit ;; -+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ -+ | -silent | --silent | --silen | --sile | --sil | --si | --s) -+ ac_cs_silent=: ;; -+ -+ # This is an error. -+ -*) as_fn_error $? "unrecognized option: \`$1' -+Try \`$0 --help' for more information." ;; -+ -+ *) as_fn_append ac_config_targets " $1" -+ ac_need_defaults=false ;; -+ -+ esac -+ shift -+done -+ -+ac_configure_extra_args= -+ -+if $ac_cs_silent; then -+ exec 6>/dev/null -+ ac_configure_extra_args="$ac_configure_extra_args --silent" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+if \$ac_cs_recheck; then -+ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -+ shift -+ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 -+ CONFIG_SHELL='$SHELL' -+ export CONFIG_SHELL -+ exec "\$@" -+fi -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+exec 5>>config.log -+{ -+ echo -+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -+## Running $as_me. ## -+_ASBOX -+ $as_echo "$ac_log" -+} >&5 -+ -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+ -+# Handling of arguments. -+for ac_config_target in $ac_config_targets -+do -+ case $ac_config_target in -+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; -+ "Config/defs.mk") CONFIG_FILES="$CONFIG_FILES Config/defs.mk" ;; -+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; -+ "Doc/Makefile") CONFIG_FILES="$CONFIG_FILES Doc/Makefile" ;; -+ "Etc/Makefile") CONFIG_FILES="$CONFIG_FILES Etc/Makefile" ;; -+ "Src/Makefile") CONFIG_FILES="$CONFIG_FILES Src/Makefile" ;; -+ "Test/Makefile") CONFIG_FILES="$CONFIG_FILES Test/Makefile" ;; -+ "config.modules") CONFIG_COMMANDS="$CONFIG_COMMANDS config.modules" ;; -+ "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;; -+ -+ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; -+ esac -+done -+ -+ -+# If the user did not use the arguments to specify the items to instantiate, -+# then the envvar interface is used. Set only those that are not. -+# We use the long form for the default assignment because of an extremely -+# bizarre bug on SunOS 4.1.3. -+if $ac_need_defaults; then -+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files -+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers -+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands -+fi -+ -+# Have a temporary directory for convenience. Make it in the build tree -+# simply because there is no reason against having it here, and in addition, -+# creating and moving files from /tmp can sometimes cause problems. -+# Hook for its removal unless debugging. -+# Note that there is a small window in which the directory will not be cleaned: -+# after its creation but before its name has been assigned to `$tmp'. -+$debug || -+{ -+ tmp= ac_tmp= -+ trap 'exit_status=$? -+ : "${ac_tmp:=$tmp}" -+ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status -+' 0 -+ trap 'as_fn_exit 1' 1 2 13 15 -+} -+# Create a (secure) tmp directory for tmp files. -+ -+{ -+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && -+ test -d "$tmp" -+} || -+{ -+ tmp=./conf$$-$RANDOM -+ (umask 077 && mkdir "$tmp") -+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 -+ac_tmp=$tmp -+ -+# Set up the scripts for CONFIG_FILES section. -+# No need to generate them if there are no CONFIG_FILES. -+# This happens for instance with `./config.status config.h'. -+if test -n "$CONFIG_FILES"; then -+ -+if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then -+ ac_cs_awk_getline=: -+ ac_cs_awk_pipe_init= -+ ac_cs_awk_read_file=' -+ while ((getline aline < (F[key])) > 0) -+ print(aline) -+ close(F[key])' -+ ac_cs_awk_pipe_fini= -+else -+ ac_cs_awk_getline=false -+ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" -+ ac_cs_awk_read_file=' -+ print "|#_!!_#|" -+ print "cat " F[key] " &&" -+ '$ac_cs_awk_pipe_init -+ # The final `:' finishes the AND list. -+ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' -+fi -+ac_cr=`echo X | tr X '\015'` -+# On cygwin, bash can eat \r inside `` if the user requested igncr. -+# But we know of no other shell where ac_cr would be empty at this -+# point, so we can use a bashism as a fallback. -+if test "x$ac_cr" = x; then -+ eval ac_cr=\$\'\\r\' -+fi -+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then -+ ac_cs_awk_cr='\\r' -+else -+ ac_cs_awk_cr=$ac_cr -+fi -+ -+echo 'BEGIN {' >"$ac_tmp/subs1.awk" && -+_ACEOF -+ -+# Create commands to substitute file output variables. -+{ -+ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && -+ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && -+ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && -+ echo "_ACAWK" && -+ echo "_ACEOF" -+} >conf$$files.sh && -+. ./conf$$files.sh || -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+rm -f conf$$files.sh -+ -+{ -+ echo "cat >conf$$subs.awk <<_ACEOF" && -+ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && -+ echo "_ACEOF" -+} >conf$$subs.sh || -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -+ac_delim='%!_!# ' -+for ac_last_try in false false false false false :; do -+ . ./conf$$subs.sh || -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ -+ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` -+ if test $ac_delim_n = $ac_delim_num; then -+ break -+ elif $ac_last_try; then -+ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -+ else -+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " -+ fi -+done -+rm -f conf$$subs.sh -+ -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && -+_ACEOF -+sed -n ' -+h -+s/^/S["/; s/!.*/"]=/ -+p -+g -+s/^[^!]*!// -+:repl -+t repl -+s/'"$ac_delim"'$// -+t delim -+:nl -+h -+s/\(.\{148\}\)..*/\1/ -+t more1 -+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -+p -+n -+b repl -+:more1 -+s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -+p -+g -+s/.\{148\}// -+t nl -+:delim -+h -+s/\(.\{148\}\)..*/\1/ -+t more2 -+s/["\\]/\\&/g; s/^/"/; s/$/"/ -+p -+b -+:more2 -+s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -+p -+g -+s/.\{148\}// -+t delim -+' >$CONFIG_STATUS || ac_write_fail=1 -+rm -f conf$$subs.awk -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+_ACAWK -+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && -+ for (key in S) S_is_set[key] = 1 -+ FS = "" -+ \$ac_cs_awk_pipe_init -+} -+{ -+ line = $ 0 -+ nfields = split(line, field, "@") -+ substed = 0 -+ len = length(field[1]) -+ for (i = 2; i < nfields; i++) { -+ key = field[i] -+ keylen = length(key) -+ if (S_is_set[key]) { -+ value = S[key] -+ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) -+ len += length(value) + length(field[++i]) -+ substed = 1 -+ } else -+ len += 1 + keylen -+ } -+ if (nfields == 3 && !substed) { -+ key = field[2] -+ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { -+ \$ac_cs_awk_read_file -+ next -+ } -+ } -+ print line -+} -+\$ac_cs_awk_pipe_fini -+_ACAWK -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then -+ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -+else -+ cat -+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ -+ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 -+_ACEOF -+ -+# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -+# trailing colons and then remove the whole line if VPATH becomes empty -+# (actually we leave an empty line to preserve line numbers). -+if test "x$srcdir" = x.; then -+ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -+h -+s/// -+s/^/:/ -+s/[ ]*$/:/ -+s/:\$(srcdir):/:/g -+s/:\${srcdir}:/:/g -+s/:@srcdir@:/:/g -+s/^:*// -+s/:*$// -+x -+s/\(=[ ]*\).*/\1/ -+G -+s/\n// -+s/^[^=]*=[ ]*$// -+}' -+fi -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+fi # test -n "$CONFIG_FILES" -+ -+# Set up the scripts for CONFIG_HEADERS section. -+# No need to generate them if there are no CONFIG_HEADERS. -+# This happens for instance with `./config.status Makefile'. -+if test -n "$CONFIG_HEADERS"; then -+cat >"$ac_tmp/defines.awk" <<\_ACAWK || -+BEGIN { -+_ACEOF -+ -+# Transform confdefs.h into an awk script `defines.awk', embedded as -+# here-document in config.status, that substitutes the proper values into -+# config.h.in to produce config.h. -+ -+# Create a delimiter string that does not exist in confdefs.h, to ease -+# handling of long lines. -+ac_delim='%!_!# ' -+for ac_last_try in false false :; do -+ ac_tt=`sed -n "/$ac_delim/p" confdefs.h` -+ if test -z "$ac_tt"; then -+ break -+ elif $ac_last_try; then -+ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 -+ else -+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " -+ fi -+done -+ -+# For the awk script, D is an array of macro values keyed by name, -+# likewise P contains macro parameters if any. Preserve backslash -+# newline sequences. -+ -+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -+sed -n ' -+s/.\{148\}/&'"$ac_delim"'/g -+t rset -+:rset -+s/^[ ]*#[ ]*define[ ][ ]*/ / -+t def -+d -+:def -+s/\\$// -+t bsnl -+s/["\\]/\\&/g -+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -+D["\1"]=" \3"/p -+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -+d -+:bsnl -+s/["\\]/\\&/g -+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -+D["\1"]=" \3\\\\\\n"\\/p -+t cont -+s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -+t cont -+d -+:cont -+n -+s/.\{148\}/&'"$ac_delim"'/g -+t clear -+:clear -+s/\\$// -+t bsnlc -+s/["\\]/\\&/g; s/^/"/; s/$/"/p -+d -+:bsnlc -+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -+b cont -+' >$CONFIG_STATUS || ac_write_fail=1 -+ -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ for (key in D) D_is_set[key] = 1 -+ FS = "" -+} -+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { -+ line = \$ 0 -+ split(line, arg, " ") -+ if (arg[1] == "#") { -+ defundef = arg[2] -+ mac1 = arg[3] -+ } else { -+ defundef = substr(arg[1], 2) -+ mac1 = arg[2] -+ } -+ split(mac1, mac2, "(") #) -+ macro = mac2[1] -+ prefix = substr(line, 1, index(line, defundef) - 1) -+ if (D_is_set[macro]) { -+ # Preserve the white space surrounding the "#". -+ print prefix "define", macro P[macro] D[macro] -+ next -+ } else { -+ # Replace #undef with comments. This is necessary, for example, -+ # in the case of _POSIX_SOURCE, which is predefined and required -+ # on some systems where configure will not decide to define it. -+ if (defundef == "undef") { -+ print "/*", prefix defundef, macro, "*/" -+ next -+ } -+ } -+} -+{ print } -+_ACAWK -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -+fi # test -n "$CONFIG_HEADERS" -+ -+ -+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -+shift -+for ac_tag -+do -+ case $ac_tag in -+ :[FHLC]) ac_mode=$ac_tag; continue;; -+ esac -+ case $ac_mode$ac_tag in -+ :[FHL]*:*);; -+ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; -+ :[FH]-) ac_tag=-:-;; -+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; -+ esac -+ ac_save_IFS=$IFS -+ IFS=: -+ set x $ac_tag -+ IFS=$ac_save_IFS -+ shift -+ ac_file=$1 -+ shift -+ -+ case $ac_mode in -+ :L) ac_source=$1;; -+ :[FH]) -+ ac_file_inputs= -+ for ac_f -+ do -+ case $ac_f in -+ -) ac_f="$ac_tmp/stdin";; -+ *) # Look for the file first in the build tree, then in the source tree -+ # (if the path is not absolute). The absolute path cannot be DOS-style, -+ # because $ac_f cannot contain `:'. -+ test -f "$ac_f" || -+ case $ac_f in -+ [\\/$]*) false;; -+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; -+ esac || -+ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; -+ esac -+ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac -+ as_fn_append ac_file_inputs " '$ac_f'" -+ done -+ -+ # Let's still pretend it is `configure' which instantiates (i.e., don't -+ # use $as_me), people would be surprised to read: -+ # /* config.h. Generated by config.status. */ -+ configure_input='Generated from '` -+ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' -+ `' by configure.' -+ if test x"$ac_file" != x-; then -+ configure_input="$ac_file. $configure_input" -+ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -+$as_echo "$as_me: creating $ac_file" >&6;} -+ fi -+ # Neutralize special characters interpreted by sed in replacement strings. -+ case $configure_input in #( -+ *\&* | *\|* | *\\* ) -+ ac_sed_conf_input=`$as_echo "$configure_input" | -+ sed 's/[\\\\&|]/\\\\&/g'`;; #( -+ *) ac_sed_conf_input=$configure_input;; -+ esac -+ -+ case $ac_tag in -+ *:-:* | *:-) cat >"$ac_tmp/stdin" \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; -+ esac -+ ;; -+ esac -+ -+ ac_dir=`$as_dirname -- "$ac_file" || -+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ -+ X"$ac_file" : 'X\(//\)[^/]' \| \ -+ X"$ac_file" : 'X\(//\)$' \| \ -+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -+$as_echo X"$ac_file" | -+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)[^/].*/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\/\)$/{ -+ s//\1/ -+ q -+ } -+ /^X\(\/\).*/{ -+ s//\1/ -+ q -+ } -+ s/.*/./; q'` -+ as_dir="$ac_dir"; as_fn_mkdir_p -+ ac_builddir=. -+ -+case "$ac_dir" in -+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -+*) -+ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` -+ # A ".." for each directory in $ac_dir_suffix. -+ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` -+ case $ac_top_builddir_sub in -+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; -+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; -+ esac ;; -+esac -+ac_abs_top_builddir=$ac_pwd -+ac_abs_builddir=$ac_pwd$ac_dir_suffix -+# for backward compatibility: -+ac_top_builddir=$ac_top_build_prefix -+ -+case $srcdir in -+ .) # We are building in place. -+ ac_srcdir=. -+ ac_top_srcdir=$ac_top_builddir_sub -+ ac_abs_top_srcdir=$ac_pwd ;; -+ [\\/]* | ?:[\\/]* ) # Absolute name. -+ ac_srcdir=$srcdir$ac_dir_suffix; -+ ac_top_srcdir=$srcdir -+ ac_abs_top_srcdir=$srcdir ;; -+ *) # Relative name. -+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix -+ ac_top_srcdir=$ac_top_build_prefix$srcdir -+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -+esac -+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -+ -+ -+ case $ac_mode in -+ :F) -+ # -+ # CONFIG_FILE -+ # -+ -+ case $INSTALL in -+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; -+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; -+ esac -+_ACEOF -+ -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+# If the template does not know about datarootdir, expand it. -+# FIXME: This hack should be removed a few years after 2.60. -+ac_datarootdir_hack=; ac_datarootdir_seen= -+ac_sed_dataroot=' -+/datarootdir/ { -+ p -+ q -+} -+/@datadir@/p -+/@docdir@/p -+/@infodir@/p -+/@localedir@/p -+/@mandir@/p' -+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -+*datarootdir*) ac_datarootdir_seen=yes;; -+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -+_ACEOF -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ ac_datarootdir_hack=' -+ s&@datadir@&$datadir&g -+ s&@docdir@&$docdir&g -+ s&@infodir@&$infodir&g -+ s&@localedir@&$localedir&g -+ s&@mandir@&$mandir&g -+ s&\\\${datarootdir}&$datarootdir&g' ;; -+esac -+_ACEOF -+ -+# Neutralize VPATH when `$srcdir' = `.'. -+# Shell code in configure.ac might set extrasub. -+# FIXME: do we really want to maintain this feature? -+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -+ac_sed_extra="$ac_vpsub -+$extrasub -+_ACEOF -+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -+:t -+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -+s|@configure_input@|$ac_sed_conf_input|;t t -+s&@top_builddir@&$ac_top_builddir_sub&;t t -+s&@top_build_prefix@&$ac_top_build_prefix&;t t -+s&@srcdir@&$ac_srcdir&;t t -+s&@abs_srcdir@&$ac_abs_srcdir&;t t -+s&@top_srcdir@&$ac_top_srcdir&;t t -+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -+s&@builddir@&$ac_builddir&;t t -+s&@abs_builddir@&$ac_abs_builddir&;t t -+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -+s&@INSTALL@&$ac_INSTALL&;t t -+$ac_datarootdir_hack -+" -+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | -+if $ac_cs_awk_getline; then -+ $AWK -f "$ac_tmp/subs.awk" -+else -+ $AWK -f "$ac_tmp/subs.awk" | $SHELL -+fi \ -+ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ -+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && -+ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && -+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ -+ "$ac_tmp/out"`; test -z "$ac_out"; } && -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -+which seems to be undefined. Please make sure it is defined" >&5 -+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -+which seems to be undefined. Please make sure it is defined" >&2;} -+ -+ rm -f "$ac_tmp/stdin" -+ case $ac_file in -+ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; -+ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; -+ esac \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ ;; -+ :H) -+ # -+ # CONFIG_HEADER -+ # -+ if test x"$ac_file" != x-; then -+ { -+ $as_echo "/* $configure_input */" \ -+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" -+ } >"$ac_tmp/config.h" \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -+$as_echo "$as_me: $ac_file is unchanged" >&6;} -+ else -+ rm -f "$ac_file" -+ mv "$ac_tmp/config.h" "$ac_file" \ -+ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 -+ fi -+ else -+ $as_echo "/* $configure_input */" \ -+ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ -+ || as_fn_error $? "could not create -" "$LINENO" 5 -+ fi -+ ;; -+ -+ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -+$as_echo "$as_me: executing $ac_file commands" >&6;} -+ ;; -+ esac -+ -+ -+ case $ac_file$ac_mode in -+ "config.modules":C) . ./config.modules.sh ;; -+ "stamp-h":C) echo >stamp-h ;; -+ -+ esac -+done # for ac_tag -+ -+ -+as_fn_exit 0 -+_ACEOF -+ac_clean_files=$ac_clean_files_save -+ -+test $ac_write_fail = 0 || -+ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 -+ -+ -+# configure is writing to config.log, and then calls config.status. -+# config.status does its own redirection, appending to config.log. -+# Unfortunately, on DOS this fails, as config.log is still kept open -+# by configure, so config.status won't be able to write to it; its -+# output is simply discarded. So we exec the FD to /dev/null, -+# effectively closing config.log, so it can be properly (re)opened and -+# appended to by config.status. When coming back to configure, we -+# need to make the FD available again. -+if test "$no_create" != yes; then -+ ac_cs_success=: -+ ac_config_status_args= -+ test "$silent" = yes && -+ ac_config_status_args="$ac_config_status_args --quiet" -+ exec 5>/dev/null -+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false -+ exec 5>>config.log -+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which -+ # would make configure fail if this is the last instruction. -+ $ac_cs_success || as_fn_exit 1 -+fi -+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -+fi -+ -+ -+eval "zshbin1=${bindir}" -+eval "zshbin2=${zshbin1}" -+eval "zshman=${mandir}" -+eval "zshinfo=${infodir}" -+eval "zshfndir=${fndir}" -+ -+echo " -+zsh configuration -+----------------- -+zsh version : ${VERSION} -+host operating system : ${host_cpu}-${host_vendor}-${host_os} -+source code location : ${srcdir} -+compiler : ${CC} -+preprocessor flags : ${CPPFLAGS} -+executable compiler flags : ${CFLAGS}" -+if test "x$dynamic" = xyes; then -+ echo "\ -+module compiler flags : ${CFLAGS} ${DLCFLAGS}" -+fi -+echo "\ -+executable linker flags : ${LDFLAGS} ${EXELDFLAGS} ${EXTRA_LDFLAGS}" -+if test "x$dynamic" = xyes; then -+ echo "\ -+module linker flags : ${LDFLAGS} ${LIBLDFLAGS} ${DLLDFLAGS}" -+fi -+echo "\ -+library flags : ${LIBS} -+installation basename : ${tzsh_name} -+binary install path : ${zshbin2} -+man page install path : ${zshman} -+info install path : ${zshinfo}" -+if test "$zshfndir" != no; then -+ echo "functions install path : ${zshfndir}" -+fi -+if test "x$additionalfpath" != x; then -+ echo "additional fpath entries : ${additionalfpath}" -+fi -+echo "See config.modules for installed modules and functions. -+" -+ -+case x$LIBS in -+ *-lgdbm*) -+ echo "WARNING: zsh will be linked against libgdbm. -+This means the binary is covered by the GNU General Public License. -+This does not affect the source code. -+Run configure with --disable-gdbm if required." -+ ;; -+esac -+ -+exit 0 ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/config.h.in -@@ -0,0 +1,1153 @@ -+/* config.h.in. Generated from configure.ac by autoheader. */ -+ -+/***** begin user configuration section *****/ -+ -+/* Define this to be the location of your password file */ -+#define PASSWD_FILE "/etc/passwd" -+ -+/* Define this to be the name of your NIS/YP password * -+ * map (if applicable) */ -+#define PASSWD_MAP "passwd.byname" -+ -+/* Define to 1 if you want user names to be cached */ -+#define CACHE_USERNAMES 1 -+ -+/* Define to 1 if system supports job control */ -+#define JOB_CONTROL 1 -+ -+/* Define this if you use "suspended" instead of "stopped" */ -+#define USE_SUSPENDED 1 -+ -+/* The default history buffer size in lines */ -+#define DEFAULT_HISTSIZE 30 -+ -+/* The default editor for the fc builtin */ -+#define DEFAULT_FCEDIT "vi" -+ -+/* The default prefix for temporary files */ -+#define DEFAULT_TMPPREFIX "/tmp/zsh" -+ -+/***** end of user configuration section *****/ -+/***** shouldn't have to change anything below here *****/ -+ -+ -+ -+/* Define to 1 if you want to use dynamically loaded modules on AIX. */ -+#undef AIXDYNAMIC -+ -+/* Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51. */ -+#undef BROKEN_KILL_ESRCH -+ -+/* Define to 1 if sigsuspend() is broken */ -+#undef BROKEN_POSIX_SIGSUSPEND -+ -+/* Define to 1 if compiler incorrectly cast signed to unsigned. */ -+#undef BROKEN_SIGNED_TO_UNSIGNED_CASTING -+ -+/* Define to 1 if tcsetpgrp() doesn't work, ie BeOS R4.51. */ -+#undef BROKEN_TCSETPGRP -+ -+/* Define to 1 if the wcwidth() function is present but broken. */ -+#undef BROKEN_WCWIDTH -+ -+/* Define to 1 if you use BSD style signal handling (and can block signals). -+ */ -+#undef BSD_SIGNALS -+ -+/* Undefine if you don't want local features. By default this is defined. */ -+#undef CONFIG_LOCALE -+ -+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP -+ systems. This function is required for `alloca.c' support on those systems. -+ */ -+#undef CRAY_STACKSEG_END -+ -+/* Define to a custom value for the ZSH_PATCHLEVEL parameter */ -+#undef CUSTOM_PATCHLEVEL -+ -+/* Define to 1 if using `alloca.c'. */ -+#undef C_ALLOCA -+ -+/* Define to 1 if you want to debug zsh. */ -+#undef DEBUG -+ -+/* The default path; used when running commands with command -p */ -+#undef DEFAULT_PATH -+ -+/* Define default pager used by readnullcmd */ -+#undef DEFAULT_READNULLCMD -+ -+/* Define to 1 if you want to avoid calling functions that will require -+ dynamic NSS modules. */ -+#undef DISABLE_DYNAMIC_NSS -+ -+/* Define to 1 if an underscore has to be prepended to dlsym() argument. */ -+#undef DLSYM_NEEDS_UNDERSCORE -+ -+/* The extension used for dynamically loaded modules. */ -+#undef DL_EXT -+ -+/* Define to 1 if you want to use dynamically loaded modules. */ -+#undef DYNAMIC -+ -+/* Define to 1 if multiple modules defining the same symbol are OK. */ -+#undef DYNAMIC_NAME_CLASH_OK -+ -+/* Define to 1 if getcwd() calls malloc to allocate memory. */ -+#undef GETCWD_CALLS_MALLOC -+ -+/* Define to 1 if the `getpgrp' function requires zero arguments. */ -+#undef GETPGRP_VOID -+ -+/* Define to 1 if getpwnam() is faked, ie BeOS R4.51. */ -+#undef GETPWNAM_FAKED -+ -+/* The global file to source whenever zsh is run as a login shell; if -+ undefined, don't source anything */ -+#undef GLOBAL_ZLOGIN -+ -+/* The global file to source whenever zsh was run as a login shell. This is -+ sourced right before exiting. If undefined, don't source anything. */ -+#undef GLOBAL_ZLOGOUT -+ -+/* The global file to source whenever zsh is run as a login shell, before -+ zshrc is read; if undefined, don't source anything. */ -+#undef GLOBAL_ZPROFILE -+ -+/* The global file to source absolutely first whenever zsh is run; if -+ undefined, don't source anything. */ -+#undef GLOBAL_ZSHENV -+ -+/* The global file to source whenever zsh is run; if undefined, don't source -+ anything */ -+#undef GLOBAL_ZSHRC -+ -+/* Define if TIOCGWINSZ is defined in sys/ioctl.h but not in termios.h. */ -+#undef GWINSZ_IN_SYS_IOCTL -+ -+/* Define to 1 if you have `alloca', as a function or macro. */ -+#undef HAVE_ALLOCA -+ -+/* Define to 1 if you have and it should be used (not on Ultrix). -+ */ -+#undef HAVE_ALLOCA_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_BIND_NETDB_H -+ -+/* Define if you have the termcap boolcodes symbol. */ -+#undef HAVE_BOOLCODES -+ -+/* Define if you have the terminfo boolnames symbol. */ -+#undef HAVE_BOOLNAMES -+ -+/* Define to 1 if you have the `brk' function. */ -+#undef HAVE_BRK -+ -+/* Define to 1 if there is a prototype defined for brk() on your system. */ -+#undef HAVE_BRK_PROTO -+ -+/* Define to 1 if you have the `canonicalize_file_name' function. */ -+#undef HAVE_CANONICALIZE_FILE_NAME -+ -+/* Define to 1 if you have the `cap_get_proc' function. */ -+#undef HAVE_CAP_GET_PROC -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_CURSES_H -+ -+/* Define to 1 if you have the `difftime' function. */ -+#undef HAVE_DIFFTIME -+ -+/* Define to 1 if you have the header file, and it defines `DIR'. -+ */ -+#undef HAVE_DIRENT_H -+ -+/* Define to 1 if you have the `dlclose' function. */ -+#undef HAVE_DLCLOSE -+ -+/* Define to 1 if you have the `dlerror' function. */ -+#undef HAVE_DLERROR -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_DLFCN_H -+ -+/* Define to 1 if you have the `dlopen' function. */ -+#undef HAVE_DLOPEN -+ -+/* Define to 1 if you have the `dlsym' function. */ -+#undef HAVE_DLSYM -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_DL_H -+ -+/* Define to 1 if you have the `erand48' function. */ -+#undef HAVE_ERAND48 -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_ERRNO_H -+ -+/* Define to 1 if you have the `faccessx' function. */ -+#undef HAVE_FACCESSX -+ -+/* Define to 1 if you have the `fchdir' function. */ -+#undef HAVE_FCHDIR -+ -+/* Define to 1 if you have the `fchmod' function. */ -+#undef HAVE_FCHMOD -+ -+/* Define to 1 if you have the `fchown' function. */ -+#undef HAVE_FCHOWN -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_FCNTL_H -+ -+/* Define to 1 if system has working FIFOs. */ -+#undef HAVE_FIFOS -+ -+/* Define to 1 if you have the `fseeko' function. */ -+#undef HAVE_FSEEKO -+ -+/* Define to 1 if you have the `fstat' function. */ -+#undef HAVE_FSTAT -+ -+/* Define to 1 if you have the `ftello' function. */ -+#undef HAVE_FTELLO -+ -+/* Define to 1 if you have the `ftruncate' function. */ -+#undef HAVE_FTRUNCATE -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_GDBM_H -+ -+/* Define to 1 if you have the `gdbm_open' function. */ -+#undef HAVE_GDBM_OPEN -+ -+/* Define to 1 if you have the `getcchar' function. */ -+#undef HAVE_GETCCHAR -+ -+/* Define to 1 if you have the `getcwd' function. */ -+#undef HAVE_GETCWD -+ -+/* Define to 1 if you have the `getenv' function. */ -+#undef HAVE_GETENV -+ -+/* Define to 1 if you have the `getgrgid' function. */ -+#undef HAVE_GETGRGID -+ -+/* Define to 1 if you have the `getgrnam' function. */ -+#undef HAVE_GETGRNAM -+ -+/* Define to 1 if you have the `gethostbyname2' function. */ -+#undef HAVE_GETHOSTBYNAME2 -+ -+/* Define to 1 if you have the `gethostname' function. */ -+#undef HAVE_GETHOSTNAME -+ -+/* Define to 1 if you have the `getipnodebyname' function. */ -+#undef HAVE_GETIPNODEBYNAME -+ -+/* Define to 1 if you have the `getlogin' function. */ -+#undef HAVE_GETLOGIN -+ -+/* Define to 1 if you have the `getpagesize' function. */ -+#undef HAVE_GETPAGESIZE -+ -+/* Define to 1 if you have the `getpwent' function. */ -+#undef HAVE_GETPWENT -+ -+/* Define to 1 if you have the `getpwnam' function. */ -+#undef HAVE_GETPWNAM -+ -+/* Define to 1 if you have the `getpwuid' function. */ -+#undef HAVE_GETPWUID -+ -+/* Define to 1 if you have the `getrlimit' function. */ -+#undef HAVE_GETRLIMIT -+ -+/* Define to 1 if you have the `getrusage' function. */ -+#undef HAVE_GETRUSAGE -+ -+/* Define to 1 if you have the `gettimeofday' function. */ -+#undef HAVE_GETTIMEOFDAY -+ -+/* Define to 1 if you have the `getxattr' function. */ -+#undef HAVE_GETXATTR -+ -+/* Define to 1 if you have the `grantpt' function. */ -+#undef HAVE_GRANTPT -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_GRP_H -+ -+/* Define to 1 if you have the `htons' function. */ -+#undef HAVE_HTONS -+ -+/* Define to 1 if you have the `iconv' function. */ -+#undef HAVE_ICONV -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_ICONV_H -+ -+/* Define to 1 if you have the `inet_aton' function. */ -+#undef HAVE_INET_ATON -+ -+/* Define to 1 if you have the `inet_ntop' function. */ -+#undef HAVE_INET_NTOP -+ -+/* Define to 1 if you have the `inet_pton' function. */ -+#undef HAVE_INET_PTON -+ -+/* Define to 1 if you have the `initgroups' function. */ -+#undef HAVE_INITGROUPS -+ -+/* Define to 1 if you have the `initscr' function. */ -+#undef HAVE_INITSCR -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_INTTYPES_H -+ -+/* Define to 1 if there is a prototype defined for ioctl() on your system. */ -+#undef HAVE_IOCTL_PROTO -+ -+/* Define to 1 if you have the `killpg' function. */ -+#undef HAVE_KILLPG -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LANGINFO_H -+ -+/* Define to 1 if you have the `lchown' function. */ -+#undef HAVE_LCHOWN -+ -+/* Define to 1 if you have the `cap' library (-lcap). */ -+#undef HAVE_LIBCAP -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LIBC_H -+ -+/* Define to 1 if you have the `dl' library (-ldl). */ -+#undef HAVE_LIBDL -+ -+/* Define to 1 if you have the `gdbm' library (-lgdbm). */ -+#undef HAVE_LIBGDBM -+ -+/* Define to 1 if you have the `m' library (-lm). */ -+#undef HAVE_LIBM -+ -+/* Define to 1 if you have the `socket' library (-lsocket). */ -+#undef HAVE_LIBSOCKET -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LIMITS_H -+ -+/* Define to 1 if system has working link(). */ -+#undef HAVE_LINK -+ -+/* Define to 1 if you have the `load' function. */ -+#undef HAVE_LOAD -+ -+/* Define to 1 if you have the `loadbind' function. */ -+#undef HAVE_LOADBIND -+ -+/* Define to 1 if you have the `loadquery' function. */ -+#undef HAVE_LOADQUERY -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_LOCALE_H -+ -+/* Define to 1 if you have the `lstat' function. */ -+#undef HAVE_LSTAT -+ -+/* Define to 1 if you have the `memcpy' function. */ -+#undef HAVE_MEMCPY -+ -+/* Define to 1 if you have the `memmove' function. */ -+#undef HAVE_MEMMOVE -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_MEMORY_H -+ -+/* Define to 1 if you have the `mkfifo' function. */ -+#undef HAVE_MKFIFO -+ -+/* Define to 1 if there is a prototype defined for mknod() on your system. */ -+#undef HAVE_MKNOD_PROTO -+ -+/* Define to 1 if you have the `mkstemp' function. */ -+#undef HAVE_MKSTEMP -+ -+/* Define to 1 if you have the `mktime' function. */ -+#undef HAVE_MKTIME -+ -+/* Define to 1 if you have a working `mmap' system call. */ -+#undef HAVE_MMAP -+ -+/* Define to 1 if you have the `msync' function. */ -+#undef HAVE_MSYNC -+ -+/* Define to 1 if you have the `munmap' function. */ -+#undef HAVE_MUNMAP -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NCURSESW_NCURSES_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NCURSESW_TERM_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NCURSES_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NCURSES_NCURSES_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NCURSES_TERM_H -+ -+/* Define to 1 if you have the header file, and it defines `DIR'. */ -+#undef HAVE_NDIR_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_NETINET_IN_SYSTM_H -+ -+/* Define to 1 if you have the `nice' function. */ -+#undef HAVE_NICE -+ -+/* Define to 1 if you have NIS. */ -+#undef HAVE_NIS -+ -+/* Define to 1 if you have the `nis_list' function. */ -+#undef HAVE_NIS_LIST -+ -+/* Define to 1 if you have NISPLUS. */ -+#undef HAVE_NIS_PLUS -+ -+/* Define to 1 if you have the `nl_langinfo' function. */ -+#undef HAVE_NL_LANGINFO -+ -+/* Define to 1 if you have the `ntohs' function. */ -+#undef HAVE_NTOHS -+ -+/* Define if you have the termcap numcodes symbol. */ -+#undef HAVE_NUMCODES -+ -+/* Define if you have the terminfo numnames symbol. */ -+#undef HAVE_NUMNAMES -+ -+/* Define to 1 if you have the `open_memstream' function. */ -+#undef HAVE_OPEN_MEMSTREAM -+ -+/* Define to 1 if your termcap library has the ospeed variable */ -+#undef HAVE_OSPEED -+ -+/* Define to 1 if you have the `pathconf' function. */ -+#undef HAVE_PATHCONF -+ -+/* Define to 1 if you have the `pcre_compile' function. */ -+#undef HAVE_PCRE_COMPILE -+ -+/* Define to 1 if you have the `pcre_exec' function. */ -+#undef HAVE_PCRE_EXEC -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_PCRE_H -+ -+/* Define to 1 if you have the `pcre_study' function. */ -+#undef HAVE_PCRE_STUDY -+ -+/* Define to 1 if you have the `poll' function. */ -+#undef HAVE_POLL -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_POLL_H -+ -+/* Define to 1 if you have the `ptsname' function. */ -+#undef HAVE_PTSNAME -+ -+/* Define to 1 if you have the `putenv' function. */ -+#undef HAVE_PUTENV -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_PWD_H -+ -+/* Define to 1 if you have the `readlink' function. */ -+#undef HAVE_READLINK -+ -+/* Define to 1 if you have the `realpath' function. */ -+#undef HAVE_REALPATH -+ -+/* Define to 1 if you have the `regcomp' function. */ -+#undef HAVE_REGCOMP -+ -+/* Define to 1 if you have the `regerror' function. */ -+#undef HAVE_REGERROR -+ -+/* Define to 1 if you have the `regexec' function. */ -+#undef HAVE_REGEXEC -+ -+/* Define to 1 if you have the `regfree' function. */ -+#undef HAVE_REGFREE -+ -+/* Define to 1 if RLIMIT_AIO_MEM is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_AIO_MEM -+ -+/* Define to 1 if RLIMIT_AIO_OPS is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_AIO_OPS -+ -+/* Define to 1 if RLIMIT_AS is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_AS -+ -+/* Define to 1 if RLIMIT_LOCKS is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_LOCKS -+ -+/* Define to 1 if RLIMIT_MEMLOCK is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_MEMLOCK -+ -+/* Define to 1 if RLIMIT_MSGQUEUE is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_MSGQUEUE -+ -+/* Define to 1 if RLIMIT_NICE is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_NICE -+ -+/* Define to 1 if RLIMIT_NOFILE is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_NOFILE -+ -+/* Define to 1 if RLIMIT_NPROC is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_NPROC -+ -+/* Define to 1 if RLIMIT_PTHREAD is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_PTHREAD -+ -+/* Define to 1 if RLIMIT_RSS is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_RSS -+ -+/* Define to 1 if RLIMIT_RTPRIO is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_RTPRIO -+ -+/* Define to 1 if RLIMIT_SBSIZE is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_SBSIZE -+ -+/* Define to 1 if RLIMIT_SIGPENDING is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_SIGPENDING -+ -+/* Define to 1 if RLIMIT_TCACHE is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_TCACHE -+ -+/* Define to 1 if RLIMIT_VMEM is present (whether or not as a macro). */ -+#undef HAVE_RLIMIT_VMEM -+ -+/* Define to 1 if you have the `sbrk' function. */ -+#undef HAVE_SBRK -+ -+/* Define to 1 if there is a prototype defined for sbrk() on your system. */ -+#undef HAVE_SBRK_PROTO -+ -+/* Define to 1 if you have the `select' function. */ -+#undef HAVE_SELECT -+ -+/* Define to 1 if you have the `setcchar' function. */ -+#undef HAVE_SETCCHAR -+ -+/* Define to 1 if you have the `setenv' function. */ -+#undef HAVE_SETENV -+ -+/* Define to 1 if you have the `seteuid' function. */ -+#undef HAVE_SETEUID -+ -+/* Define to 1 if you have the `setlocale' function. */ -+#undef HAVE_SETLOCALE -+ -+/* Define to 1 if you have the `setpgid' function. */ -+#undef HAVE_SETPGID -+ -+/* Define to 1 if you have the `setpgrp' function. */ -+#undef HAVE_SETPGRP -+ -+/* Define to 1 if the system supports `setproctitle' to change process name */ -+#undef HAVE_SETPROCTITLE -+ -+/* Define to 1 if you have the `setresuid' function. */ -+#undef HAVE_SETRESUID -+ -+/* Define to 1 if you have the `setreuid' function. */ -+#undef HAVE_SETREUID -+ -+/* Define to 1 if you have the `setsid' function. */ -+#undef HAVE_SETSID -+ -+/* Define to 1 if you have the `setuid' function. */ -+#undef HAVE_SETUID -+ -+/* Define to 1 if you have the `setupterm' function. */ -+#undef HAVE_SETUPTERM -+ -+/* Define to 1 if you have the `shl_findsym' function. */ -+#undef HAVE_SHL_FINDSYM -+ -+/* Define to 1 if you have the `shl_load' function. */ -+#undef HAVE_SHL_LOAD -+ -+/* Define to 1 if you have the `shl_unload' function. */ -+#undef HAVE_SHL_UNLOAD -+ -+/* Define to 1 if you have the `sigaction' function. */ -+#undef HAVE_SIGACTION -+ -+/* Define to 1 if you have the `sigblock' function. */ -+#undef HAVE_SIGBLOCK -+ -+/* Define to 1 if you have the `sighold' function. */ -+#undef HAVE_SIGHOLD -+ -+/* Define to 1 if you have the `signgam' function. */ -+#undef HAVE_SIGNGAM -+ -+/* Define to 1 if you have the `sigprocmask' function. */ -+#undef HAVE_SIGPROCMASK -+ -+/* Define to 1 if you have the `sigrelse' function. */ -+#undef HAVE_SIGRELSE -+ -+/* Define to 1 if you have the `sigsetmask' function. */ -+#undef HAVE_SIGSETMASK -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STDARG_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STDDEF_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STDINT_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STDIO_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STDLIB_H -+ -+/* Define if you have the termcap strcodes symbol. */ -+#undef HAVE_STRCODES -+ -+/* Define to 1 if you have the `strcoll' function and it is properly defined. -+ */ -+#undef HAVE_STRCOLL -+ -+/* Define to 1 if you have the `strerror' function. */ -+#undef HAVE_STRERROR -+ -+/* Define to 1 if you have the `strftime' function. */ -+#undef HAVE_STRFTIME -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STRINGS_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_STRING_H -+ -+/* Define if you have the terminfo strnames symbol. */ -+#undef HAVE_STRNAMES -+ -+/* Define to 1 if you have the `strptime' function. */ -+#undef HAVE_STRPTIME -+ -+/* Define to 1 if you have the `strstr' function. */ -+#undef HAVE_STRSTR -+ -+/* Define to 1 if you have the `strtoul' function. */ -+#undef HAVE_STRTOUL -+ -+/* Define if your system's struct direct has a member named d_ino. */ -+#undef HAVE_STRUCT_DIRECT_D_INO -+ -+/* Define if your system's struct direct has a member named d_stat. */ -+#undef HAVE_STRUCT_DIRECT_D_STAT -+ -+/* Define if your system's struct dirent has a member named d_ino. */ -+#undef HAVE_STRUCT_DIRENT_D_INO -+ -+/* Define if your system's struct dirent has a member named d_stat. */ -+#undef HAVE_STRUCT_DIRENT_D_STAT -+ -+/* Define to 1 if `ru_idrss' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_IDRSS -+ -+/* Define to 1 if `ru_inblock' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_INBLOCK -+ -+/* Define to 1 if `ru_isrss' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_ISRSS -+ -+/* Define to 1 if `ru_ixrss' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_IXRSS -+ -+/* Define to 1 if `ru_majflt' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_MAJFLT -+ -+/* Define to 1 if `ru_maxrss' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_MAXRSS -+ -+/* Define to 1 if `ru_minflt' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_MINFLT -+ -+/* Define to 1 if `ru_msgrcv' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_MSGRCV -+ -+/* Define to 1 if `ru_msgsnd' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_MSGSND -+ -+/* Define to 1 if `ru_nivcsw' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_NIVCSW -+ -+/* Define to 1 if `ru_nsignals' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_NSIGNALS -+ -+/* Define to 1 if `ru_nswap' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_NSWAP -+ -+/* Define to 1 if `ru_nvcsw' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_NVCSW -+ -+/* Define to 1 if `ru_oublock' is a member of `struct rusage'. */ -+#undef HAVE_STRUCT_RUSAGE_RU_OUBLOCK -+ -+/* Define if your system's struct sockaddr_in6 has a member named -+ sin6_scope_id. */ -+#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID -+ -+/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_ATIMENSEC -+ -+/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC -+ -+/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC -+ -+/* Define to 1 if `st_ctimensec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_CTIMENSEC -+ -+/* Define to 1 if `st_ctimespec.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC -+ -+/* Define to 1 if `st_ctim.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC -+ -+/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_MTIMENSEC -+ -+/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC -+ -+/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ -+#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -+ -+/* Define to 1 if struct timezone is defined by a system header */ -+#undef HAVE_STRUCT_TIMEZONE -+ -+/* Define to 1 if struct utmp is defined by a system header */ -+#undef HAVE_STRUCT_UTMP -+ -+/* Define to 1 if struct utmpx is defined by a system header */ -+#undef HAVE_STRUCT_UTMPX -+ -+/* Define if your system's struct utmpx has a member named ut_host. */ -+#undef HAVE_STRUCT_UTMPX_UT_HOST -+ -+/* Define if your system's struct utmpx has a member named ut_tv. */ -+#undef HAVE_STRUCT_UTMPX_UT_TV -+ -+/* Define if your system's struct utmpx has a member named ut_xtime. */ -+#undef HAVE_STRUCT_UTMPX_UT_XTIME -+ -+/* Define if your system's struct utmp has a member named ut_host. */ -+#undef HAVE_STRUCT_UTMP_UT_HOST -+ -+/* Define to 1 if you have RFS superroot directory. */ -+#undef HAVE_SUPERROOT -+ -+/* Define to 1 if you have the `symlink' function. */ -+#undef HAVE_SYMLINK -+ -+/* Define to 1 if you have the `sysconf' function. */ -+#undef HAVE_SYSCONF -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_CAPABILITY_H -+ -+/* Define to 1 if you have the header file, and it defines `DIR'. -+ */ -+#undef HAVE_SYS_DIR_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_FILIO_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_MMAN_H -+ -+/* Define to 1 if you have the header file, and it defines `DIR'. -+ */ -+#undef HAVE_SYS_NDIR_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_PARAM_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_RESOURCE_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_SELECT_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_STAT_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_STROPTS_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_TIMES_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_TIME_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_TYPES_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_UTSNAME_H -+ -+/* Define to 1 if you have that is POSIX.1 compatible. */ -+#undef HAVE_SYS_WAIT_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_SYS_XATTR_H -+ -+/* Define to 1 if you have the `tcgetattr' function. */ -+#undef HAVE_TCGETATTR -+ -+/* Define to 1 if you have the `tcsetpgrp' function. */ -+#undef HAVE_TCSETPGRP -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_TERMCAP_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_TERMIOS_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_TERMIO_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_TERM_H -+ -+/* Define to 1 if you have the `tgetent' function. */ -+#undef HAVE_TGETENT -+ -+/* Define to 1 if you have the `tigetflag' function. */ -+#undef HAVE_TIGETFLAG -+ -+/* Define to 1 if you have the `tigetnum' function. */ -+#undef HAVE_TIGETNUM -+ -+/* Define to 1 if you have the `tigetstr' function. */ -+#undef HAVE_TIGETSTR -+ -+/* Define to 1 if you have the `timelocal' function. */ -+#undef HAVE_TIMELOCAL -+ -+/* Define to 1 if you have the `uname' function. */ -+#undef HAVE_UNAME -+ -+/* Define to 1 if the compiler can initialise a union. */ -+#undef HAVE_UNION_INIT -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UNISTD_H -+ -+/* Define to 1 if you have the `unload' function. */ -+#undef HAVE_UNLOAD -+ -+/* Define to 1 if you have the `unlockpt' function. */ -+#undef HAVE_UNLOCKPT -+ -+/* Define to 1 if you have the `unsetenv' function. */ -+#undef HAVE_UNSETENV -+ -+/* Define to 1 if you have the `use_default_colors' function. */ -+#undef HAVE_USE_DEFAULT_COLORS -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UTMPX_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_UTMP_H -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_VARARGS_H -+ -+/* Define to 1 if compiler supports variable-length arrays */ -+#undef HAVE_VARIABLE_LENGTH_ARRAYS -+ -+/* Define to 1 if you have the `waddwstr' function. */ -+#undef HAVE_WADDWSTR -+ -+/* Define to 1 if you have the `wait3' function. */ -+#undef HAVE_WAIT3 -+ -+/* Define to 1 if you have the `waitpid' function. */ -+#undef HAVE_WAITPID -+ -+/* Define to 1 if you have the header file. */ -+#undef HAVE_WCHAR_H -+ -+/* Define to 1 if you have the `wctomb' function. */ -+#undef HAVE_WCTOMB -+ -+/* Define to 1 if you have the `wget_wch' function. */ -+#undef HAVE_WGET_WCH -+ -+/* Define to 1 if you have the `win_wch' function. */ -+#undef HAVE_WIN_WCH -+ -+/* Define to 1 if you have the `xw' function. */ -+#undef HAVE_XW -+ -+/* Define to 1 if you have the `_mktemp' function. */ -+#undef HAVE__MKTEMP -+ -+/* Define to 1 if you want to use dynamically loaded modules on HPUX 10. */ -+#undef HPUX10DYNAMIC -+ -+/* Define as const if the declaration of iconv() needs const. */ -+#undef ICONV_CONST -+ -+/* Define to 1 if iconv() is linked from libiconv */ -+#undef ICONV_FROM_LIBICONV -+ -+/* Define to 1 if ino_t is 64 bit (for large file support). */ -+#undef INO_T_IS_64_BIT -+ -+/* Define to 1 if we must include to get a prototype for -+ ioctl(). */ -+#undef IOCTL_IN_SYS_IOCTL -+ -+/* Define to 1 if musl is being used as the C library */ -+#undef LIBC_MUSL -+ -+/* Definitions used when a long is less than eight byte, to try to provide -+ some support for eight byte operations. Note that ZSH_64_BIT_TYPE, -+ OFF_T_IS_64_BIT, INO_T_IS_64_BIT do *not* get defined if long is already 64 -+ bits, since in that case no special handling is required. Define to 1 if -+ long is 64 bits */ -+#undef LONG_IS_64_BIT -+ -+/* Define to be the machine type (microprocessor class or machine model). */ -+#undef MACHTYPE -+ -+/* Define for Maildir support */ -+#undef MAILDIR_SUPPORT -+ -+/* Define for function depth limits */ -+#undef MAX_FUNCTION_DEPTH -+ -+/* Define to 1 if you want support for multibyte character sets. */ -+#undef MULTIBYTE_SUPPORT -+ -+/* Define to 1 if you have ospeed, but it is not defined in termcap.h */ -+#undef MUST_DEFINE_OSPEED -+ -+/* Define to 1 if you have no signal blocking at all (bummer). */ -+#undef NO_SIGNAL_BLOCKING -+ -+/* Define to 1 if off_t is 64 bit (for large file support) */ -+#undef OFF_T_IS_64_BIT -+ -+/* Define to be the name of the operating system. */ -+#undef OSTYPE -+ -+/* Define to the address where bug reports for this package should be sent. */ -+#undef PACKAGE_BUGREPORT -+ -+/* Define to the full name of this package. */ -+#undef PACKAGE_NAME -+ -+/* Define to the full name and version of this package. */ -+#undef PACKAGE_STRING -+ -+/* Define to the one symbol short name of this package. */ -+#undef PACKAGE_TARNAME -+ -+/* Define to the home page for this package. */ -+#undef PACKAGE_URL -+ -+/* Define to the version of this package. */ -+#undef PACKAGE_VERSION -+ -+/* Define to the path of the /dev/fd filesystem. */ -+#undef PATH_DEV_FD -+ -+/* Define to be location of utmpx file. */ -+#undef PATH_UTMPX_FILE -+ -+/* Define to be location of utmp file. */ -+#undef PATH_UTMP_FILE -+ -+/* Define to be location of wtmpx file. */ -+#undef PATH_WTMPX_FILE -+ -+/* Define to be location of wtmp file. */ -+#undef PATH_WTMP_FILE -+ -+/* Define to 1 if you use POSIX style signal handling. */ -+#undef POSIX_SIGNALS -+ -+/* Define to 1 if ANSI function prototypes are usable. */ -+#undef PROTOTYPES -+ -+/* Undefine this if you don't want to get a restricted shell when zsh is -+ exec'd with basename that starts with r. By default this is defined. */ -+#undef RESTRICTED_R -+ -+/* Define as the return type of signal handlers (`int' or `void'). */ -+#undef RETSIGTYPE -+ -+/* Define to 1 if RLIMIT_RSS and RLIMIT_AS both exist and are equal. */ -+#undef RLIMIT_RSS_IS_AS -+ -+/* Define to 1 if RLIMIT_VMEM and RLIMIT_AS both exist and are equal. */ -+#undef RLIMIT_VMEM_IS_AS -+ -+/* Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal. */ -+#undef RLIMIT_VMEM_IS_RSS -+ -+/* Define to 1 if struct rlimit uses long long */ -+#undef RLIM_T_IS_LONG_LONG -+ -+/* Define to 1 if struct rlimit uses quad_t. */ -+#undef RLIM_T_IS_QUAD_T -+ -+/* Define to 1 if struct rlimit uses unsigned. */ -+#undef RLIM_T_IS_UNSIGNED -+ -+/* Define to 1 if select() is defined in , ie BeOS R4.51 */ -+#undef SELECT_IN_SYS_SOCKET_H -+ -+/* Define to 1 if /bin/sh does not interpret \ escape sequences. */ -+#undef SH_USE_BSD_ECHO -+ -+/* If using the C implementation of alloca, define if you know the -+ direction of stack growth for your system; otherwise it will be -+ automatically deduced at runtime. -+ STACK_DIRECTION > 0 => grows toward higher addresses -+ STACK_DIRECTION < 0 => grows toward lower addresses -+ STACK_DIRECTION = 0 => direction of growth unknown */ -+#undef STACK_DIRECTION -+ -+/* Define to 1 if the `S_IS*' macros in do not work properly. */ -+#undef STAT_MACROS_BROKEN -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#undef STDC_HEADERS -+ -+/* Define to 1 if you use SYS style signal handling (and can block signals). -+ */ -+#undef SYSV_SIGNALS -+ -+/* Define to 1 if tgetent() accepts NULL as a buffer. */ -+#undef TGETENT_ACCEPTS_NULL -+ -+/* Define to what tgetent() returns on success (0 on HP-UX X/Open curses). */ -+#undef TGETENT_SUCCESS -+ -+/* Define if sys/time.h and sys/select.h cannot be both included. */ -+#undef TIME_H_SELECT_H_CONFLICTS -+ -+/* Define to 1 if you can safely include both and . */ -+#undef TIME_WITH_SYS_TIME -+ -+/* Define to 1 if all the kit for using /dev/ptmx for ptys is available. */ -+#undef USE_DEV_PTMX -+ -+/* Define to 1 if you need to use the native getcwd. */ -+#undef USE_GETCWD -+ -+/* Define to 1 if h_errno is not defined by the system. */ -+#undef USE_LOCAL_H_ERRNO -+ -+/* Define to be a string corresponding the vendor of the machine. */ -+#undef VENDOR -+ -+/* Define if your should include sys/stream.h and sys/ptem.h. */ -+#undef WINSIZE_IN_PTEM -+ -+/* Define if getxattr() etc. require additional MacOS-style arguments */ -+#undef XATTR_EXTRA_ARGS -+ -+/* Define to a 64 bit integer type if there is one, but long is shorter. */ -+#undef ZSH_64_BIT_TYPE -+ -+/* Define to an unsigned variant of ZSH_64_BIT_TYPE if that is defined. */ -+#undef ZSH_64_BIT_UTYPE -+ -+/* Define to 1 if you want to get debugging information on internal hash -+ tables. This turns on the `hashinfo' builtin. */ -+#undef ZSH_HASH_DEBUG -+ -+/* Define to 1 if some variant of a curses header can be included */ -+#undef ZSH_HAVE_CURSES_H -+ -+/* Define to 1 if some variant of term.h can be included */ -+#undef ZSH_HAVE_TERM_H -+ -+/* Define to 1 if you want to use zsh's own memory allocation routines */ -+#undef ZSH_MEM -+ -+/* Define to 1 if you want to debug zsh memory allocation routines. */ -+#undef ZSH_MEM_DEBUG -+ -+/* Define to 1 if you want to turn on warnings of memory allocation errors */ -+#undef ZSH_MEM_WARNING -+ -+/* Define if _XOPEN_SOURCE_EXTENDED should not be defined to avoid clashes */ -+#undef ZSH_NO_XOPEN -+ -+/* Define to 1 if you want to turn on memory checking for free(). */ -+#undef ZSH_SECURE_FREE -+ -+/* Define to the base type of the third argument of accept */ -+#undef ZSOCKLEN_T -+ -+/* Number of bits in a file offset, on hosts where this is settable. */ -+#undef _FILE_OFFSET_BITS -+ -+/* Define for large files, on AIX-style hosts. */ -+#undef _LARGE_FILES -+ -+/* Define to empty if `const' does not conform to ANSI C. */ -+#undef const -+ -+/* Define to `int' if doesn't define. */ -+#undef gid_t -+ -+/* Define to `unsigned long' if doesn't define. */ -+#undef ino_t -+ -+/* Define to `int' if does not define. */ -+#undef mode_t -+ -+/* Define to `long int' if does not define. */ -+#undef off_t -+ -+/* Define to `int' if does not define. */ -+#undef pid_t -+ -+/* Define to the type used in struct rlimit. */ -+#undef rlim_t -+ -+/* Define to `unsigned int' if or doesn't define */ -+#undef sigset_t -+ -+/* Define to `unsigned int' if does not define. */ -+#undef size_t -+ -+/* Define to `int' if doesn't define. */ -+#undef uid_t ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/META-FAQ -@@ -0,0 +1,98 @@ -+------------------------ -+META-FAQ for the Z Shell -+------------------------ -+ -+The latest version of this META-FAQ can be found at any of the FTP sites -+listed below. -+SECTHEADAuthor -+Zsh was originally written by Paul Falstad . -+Zsh is now maintained by the members of the zsh-workers mailing -+list . The development is currently -+coordinated by Peter Stephenson . The coordinator -+can be contacted at , but matters relating to -+the code should generally go to the mailing list. -+SECTHEADAvailability -+Zsh is available from the following anonymous FTP sites. These mirror -+sites are kept frequently up to date. The sites marked with (H) may be -+mirroring ftp.cs.elte.hu instead of the primary site. -+ -+ ftp://ftp.zsh.org/pub/ -+ http://www.zsh.org/pub/ -+Australia -+ ftp://ftp.zsh.org/pub/ -+ http://www.zsh.org/pub/ -+Denmark -+ ftp://mirrors.dotsrc.org/zsh/ -+Finland -+ ftp://ftp.funet.fi/pub/unix/shells/zsh/ -+France -+ ftp://nephtys.lip6.fr/pub/unix/shells/zsh/ -+Germany -+ ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ -+Hungary -+ ftp://ftp.kfki.hu/pub/packages/zsh/ -+Poland -+ ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/ -+ -+The up-to-date source code is available via anonymous CVS and Git from -+Sourceforge. See http://sourceforge.net/projects/zsh/ for details. -+A summary of instructions for the CVS and Git archives can be found at -+http://zsh.sourceforget.net/. -+ -+SECTHEADMailing Lists -+Zsh has 3 mailing lists: -+ -+ Announcements about releases, major changes in the shell and the -+ monthly posting of the Zsh FAQ. (moderated) -+ -+ User discussions. -+ -+ Hacking, development, bug reports and patches. -+ -+To subscribe or unsubscribe, send mail -+to the associated administrative address for the mailing list. -+ -+ -+ -+ -+ -+ -+ -+ -+ -+YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED. -+All submissions to zsh-announce are automatically forwarded to -+zsh-users. All submissions to zsh-users are automatically -+forwarded to zsh-workers. -+ -+If you have problems subscribing/unsubscribing to any of the mailing -+lists, send mail to . The mailing lists are -+maintained by Karsten Thygesen . -+ -+The mailing lists are archived; the archives can be accessed via the -+administrative addresses listed above. There is also a hypertext -+archive, maintained by Geoff Wing , available at -+http://www.zsh.org/mla/. -+SECTHEADThe Zsh FAQ -+Zsh has a list of Frequently Asked Questions (FAQ), maintained by -+Peter Stephenson . It is regularly posted to the -+newsgroup comp.unix.shell and the zsh-announce mailing list. -+The latest version can be found at any of the Zsh FTP sites, or at -+http://www.zsh.org/FAQ/. The contact address for FAQ-related matters -+is . -+SECTHEADThe Zsh Web Page -+Zsh has a web page which is located at http://www.zsh.org/. This is -+maintained by Karsten Thygesen , of SunSITE Denmark. -+The contact address for web-related matters is . -+SECTHEADThe Zsh Userguide -+A userguide is currently in preparation. It is intended to complement the -+manual, with explanations and hints on issues where the manual can be -+cabbalistic, hierographic, or downright mystifying (for example, the word -+`hierographic' does not exist). It can be viewed in its current state at -+http://zsh.sourceforge.net/Guide/. At the time of writing, chapters -+dealing with startup files and their contents and the new completion system -+were essentially complete. -+SECTHEADThe Zsh Wiki -+A `wiki' website for zsh has been created at http://www.zshwiki.org/. -+This is a site which can be added to and modified directly by users without -+any special permission. You can add your own zsh tips and configurations. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/stamp-h.in -@@ -0,0 +1 @@ -+ ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshcompwid.1 -@@ -0,0 +1,1209 @@ -+.TH "ZSHCOMPWID" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshcompwid \- zsh completion widgets -+.\" Yodl file: Zsh/compwid.yo -+.SH "DESCRIPTION" -+The shell\&'s programmable completion mechanism can be manipulated in two -+ways; here the low\-level features supporting the newer, function\-based -+mechanism are defined\&. A complete set of shell functions based on these -+features is described in -+\fIzshcompsys\fP(1), -+and users with no interest in adding to that system (or, potentially, -+writing their own \-\- see dictionary entry for `hubris\&') should skip -+the current section\&. The older system based on the \fBcompctl\fP builtin -+command is described in -+\fIzshcompctl\fP(1)\&. -+.PP -+Completion widgets are defined by the \fB\-C\fP option to the \fBzle\fP -+builtin command provided by the \fBzsh/zle\fP module (see -+\fIzshzle\fP(1))\&. For example, -+.PP -+.RS -+.nf -+\fBzle \-C complete expand\-or\-complete completer\fP -+.fi -+.RE -+.PP -+defines a widget named `\fBcomplete\fP\&'\&. The second argument is the name -+of any of the builtin widgets that handle completions: -+\fBcomplete\-word\fP, \fBexpand\-or\-complete\fP, -+\fBexpand\-or\-complete\-prefix\fP, \fBmenu\-complete\fP, -+\fBmenu\-expand\-or\-complete\fP, \fBreverse\-menu\-complete\fP, -+\fBlist\-choices\fP, or \fBdelete\-char\-or\-list\fP\&. Note that this will still -+work even if the widget in question has been re\-bound\&. -+.PP -+When this newly defined widget is bound to a key -+using the \fBbindkey\fP builtin command defined in the \fBzsh/zle\fP module -+(see \fIzshzle\fP(1)), typing that key will call the shell function `\fBcompleter\fP\&'\&. This -+function is responsible for generating the possible matches using the -+builtins described below\&. As with other ZLE widgets, the function is -+called with its standard input closed\&. -+.PP -+Once the function returns, the completion code takes over control again -+and treats the matches in the same manner as the specified builtin -+widget, in this case \fBexpand\-or\-complete\fP\&. -+.PP -+.PP -+.SH "COMPLETION SPECIAL PARAMETERS" -+.PP -+The parameters \fBZLE_REMOVE_SUFFIX_CHARS\fP and \fBZLE_SPACE_SUFFIX_CHARS\fP -+are used by the completion mechanism, but are not special\&. -+See \fIParameters Used By The Shell\fP in \fIzshparam\fP(1)\&. -+.PP -+Inside completion widgets, and any functions called from them, some -+parameters have special meaning; outside these functions they are not -+special to the shell in any way\&. These parameters are used to pass -+information between the completion code and the completion widget\&. Some of -+the builtin commands and the condition codes use or change the current -+values of these parameters\&. Any existing values will be hidden during -+execution of completion widgets; except for \fBcompstate\fP, the parameters -+are reset on each function exit (including nested function calls from -+within the completion widget) to the values they had when the function was -+entered\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBCURRENT\fP -+This is the number of the current word, i\&.e\&. the word the cursor is -+currently on in the \fBwords\fP array\&. Note that this value is only -+correct if the \fBksharrays\fP option is not set\&. -+.TP -+\fBIPREFIX\fP -+Initially this will be set to the empty string\&. This parameter functions -+like \fBPREFIX\fP; it contains a string which precedes the one in \fBPREFIX\fP -+and is not considered part of the list of matches\&. Typically, a string is -+transferred from the beginning of \fBPREFIX\fP to the end of \fBIPREFIX\fP, for -+example: -+.RS -+.PP -+.RS -+.nf -+\fBIPREFIX=${PREFIX%%\e=*}= -+PREFIX=${PREFIX#*=}\fP -+.fi -+.RE -+.PP -+causes the part of the prefix up to and including the first equal sign not -+to be treated as part of a matched string\&. This can be done automatically -+by the \fBcompset\fP builtin, see below\&. -+.RE -+.TP -+\fBISUFFIX\fP -+As \fBIPREFIX\fP, but for a suffix that should not be considered part -+of the matches; note that the \fBISUFFIX\fP string follows the \fBSUFFIX\fP -+string\&. -+.TP -+\fBPREFIX\fP -+Initially this will be set to the part of the current word from the -+beginning of the word up to the position of the cursor; it may be altered -+to give a common prefix for all matches\&. -+.TP -+\fBQIPREFIX\fP -+This parameter is read\-only and contains the quoted string up to the -+word being completed\&. E\&.g\&. when completing `\fB"foo\fP\&', this parameter -+contains the double quote\&. If the \fB\-q\fP option of \fBcompset\fP is used -+(see below), and the original string was `\fB"foo bar\fP\&' with the -+cursor on the `\fBbar\fP\&', this parameter contains `\fB"foo \fP'\&. -+.TP -+\fBQISUFFIX\fP -+Like \fBQIPREFIX\fP, but containing the suffix\&. -+.TP -+\fBSUFFIX\fP -+Initially this will be set to the part of the current word from the -+cursor position to the end; it may be altered to give a common suffix for -+all matches\&. It is most useful when the option \fBCOMPLETE_IN_WORD\fP is -+set, as otherwise the whole word on the command line is treated as a -+prefix\&. -+.TP -+\fBcompstate\fP -+This is an associative array with various keys and values that the -+completion code uses to exchange information with the completion widget\&. -+The keys are: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBall_quotes\fP -+The \fB\-q\fP option of the \fBcompset\fP builtin command (see below) -+allows a quoted string to be broken into separate words; if the cursor is -+on one of those words, that word will be completed, possibly invoking -+`\fBcompset \-q\fP\&' recursively\&. With this key it is possible to test the -+types of quoted strings which are currently broken into parts in this -+fashion\&. Its value contains one character for each quoting level\&. The -+characters are a single quote or a double quote for strings quoted with -+these characters, a dollars sign for strings quoted with -+\fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP and a backslash for strings not starting with a -+quote character\&. The first character in the value always corresponds to the -+innermost quoting level\&. -+.TP -+\fBcontext\fP -+This will be set by the completion code to the overall context -+in which completion is attempted\&. Possible values are: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBarray_value\fP -+when completing inside the value of an array parameter assignment; in -+this case the \fBwords\fP array contains the words inside the parentheses\&. -+.TP -+\fBbrace_parameter\fP -+when completing the name of a parameter in a parameter expansion beginning -+with \fB${\fP\&. -+.TP -+\fBassign_parameter\fP -+when completing the name of a parameter in a parameter assignment\&. -+.TP -+\fBcommand\fP -+when completing for a normal command (either in command position or for -+an argument of the command)\&. -+.TP -+\fBcondition\fP -+when completing inside a `\fB[[\fP\&.\&.\&.\fB]]\fP\&' conditional expression; in -+this case the \fBwords\fP array contains only the words inside the -+conditional expression\&. -+.TP -+\fBmath\fP -+when completing in a mathematical environment such as a -+`\fB((\fP\&.\&.\&.\fB))\fP\&' construct\&. -+.TP -+\fBparameter\fP -+when completing the name of a parameter in a parameter expansion beginning -+with \fB$\fP but not \fB${\fP\&. -+.TP -+\fBredirect\fP -+when completing after a redirection operator\&. -+.TP -+\fBsubscript\fP -+when completing inside a parameter subscript\&. -+.TP -+\fBvalue\fP -+when completing the value of a parameter assignment\&. -+.RE -+.TP -+\fBexact\fP -+Controls the behaviour when the \fBREC_EXACT\fP option is set\&. It will be -+set to \fBaccept\fP if an exact match would be accepted, and will be unset -+otherwise\&. -+.RS -+.PP -+If it was set when at least one match equal to the string on the line -+was generated, the match is accepted\&. -+.RE -+.TP -+\fBexact_string\fP -+The string of an exact match if one was found, otherwise unset\&. -+.TP -+\fBignored\fP -+The number of words that were ignored because they matched one of the -+patterns given with the \fB\-F\fP option to the \fBcompadd\fP builtin -+command\&. -+.TP -+\fBinsert\fP -+This controls the manner in which a match is inserted into the command -+line\&. On entry to the widget function, if it is unset the command line is -+not to be changed; if set to \fBunambiguous\fP, any prefix common to all -+matches is to be inserted; if set to \fBautomenu\-unambiguous\fP, the -+common prefix is to be inserted and the next invocation of the -+completion code may start menu completion (due to the \fBAUTO_MENU\fP -+option being set); if set to \fBmenu\fP or \fBautomenu\fP menu completion -+will be started for the matches currently generated (in the -+latter case this will happen because the \fBAUTO_MENU\fP is set)\&. The -+value may also contain the string `\fBtab\fP\&' when the completion code -+would normally not really do completion, but only insert the TAB -+character\&. -+.RS -+.PP -+On exit it may be set to any of the values above (where setting it to -+the empty string is the same as unsetting it), or to a number, in which -+case the match whose number is given will be inserted into the command line\&. -+Negative numbers count backward from the last match (with `\fB\-1\fP\&' -+selecting the last match) and out\-of\-range values are wrapped -+around, so that a value of zero selects the last match and a value -+one more than the maximum selects the first\&. Unless the value of this -+key ends in a space, the match is inserted as in a menu completion, -+i\&.e\&. without automatically appending a space\&. -+.PP -+Both \fBmenu\fP and \fBautomenu\fP may also specify the the number of the -+match to insert, given after a colon\&. For example, `\fBmenu:2\fP\&' says -+to start menu completion, beginning with the second match\&. -+.PP -+Note that a value containing the substring `\fBtab\fP\&' makes the -+matches generated be ignored and only the TAB be inserted\&. -+.PP -+Finally, it may also be set to \fBall\fP, which makes all matches -+generated be inserted into the line\&. -+.RE -+.TP -+\fBinsert_positions\fP -+When the completion system inserts an unambiguous string into the -+line, there may be multiple places where characters are missing or -+where the character inserted differs from at least one match\&. The -+value of this key contains a colon separated list of all these -+positions, as indexes into the command line\&. -+.TP -+\fBlast_prompt\fP -+If this is set to a non\-empty string for every match added, the -+completion code will move the cursor back to the previous prompt after -+the list of completions has been displayed\&. Initially this is set or -+unset according to the \fBALWAYS_LAST_PROMPT\fP option\&. -+.TP -+\fBlist\fP -+This controls whether or how the list of matches will be displayed\&. If it -+is unset or empty they will never be listed; if its value begins with -+\fBlist\fP, they will always be listed; if it begins with \fBautolist\fP -+or \fBambiguous\fP, they will be listed when the \fBAUTO_LIST\fP or -+\fBLIST_AMBIGUOUS\fP options respectively would normally cause them to -+be\&. -+.RS -+.PP -+If the substring \fBforce\fP appears in the value, this makes the -+list be shown even if there is only one match\&. Normally, the list -+would be shown only if there are at least two matches\&. -+.PP -+The value contains the substring \fBpacked\fP if the \fBLIST_PACKED\fP -+option is set\&. If this substring is given for all matches added to a -+group, this group will show the \fBLIST_PACKED\fP behavior\&. The same is -+done for the \fBLIST_ROWS_FIRST\fP option with the substring \fBrows\fP\&. -+.PP -+Finally, if the value contains the string \fBexplanations\fP, only the -+explanation strings, if any, will be listed and if it contains -+\fBmessages\fP, only the messages (added with the \fB\-x\fP option of -+\fBcompadd\fP) will be listed\&. If it contains both \fBexplanations\fP and -+\fBmessages\fP both kinds of explanation strings will be listed\&. It -+will be set appropriately on entry to a completion widget and may be -+changed there\&. -+.RE -+.TP -+\fBlist_lines\fP -+This gives the number of lines that are needed to display the full -+list of completions\&. Note that to calculate the total number of lines -+to display you need to add the number of lines needed for the command -+line to this value, this is available as the value of the \fBBUFFERLINES\fP -+special parameter\&. -+.TP -+\fBlist_max\fP -+Initially this is set to the value of the \fBLISTMAX\fP parameter\&. -+It may be set to any other value; when the widget exits this value -+will be used in the same way as the value of \fBLISTMAX\fP\&. -+.TP -+\fBnmatches\fP -+The number of matches generated and accepted by the completion code so -+far\&. -+.TP -+\fBold_insert\fP -+On entry to the widget this will be set to the number of the match of -+an old list of completions that is currently inserted into the command -+line\&. If no match has been inserted, this is unset\&. -+.RS -+.PP -+As with \fBold_list\fP, the value of this key will only be used if it is the -+string \fBkeep\fP\&. If it was set to this value by the widget and there was an -+old match inserted into the command line, this match will be kept and if -+the value of the \fBinsert\fP key specifies that another match should be -+inserted, this will be inserted after the old one\&. -+.RE -+.TP -+\fBold_list\fP -+This is set to \fByes\fP if there is still a valid list of completions -+from a previous completion at the time the widget is invoked\&. This will -+usually be the case if and only if the previous editing operation was a -+completion widget or one of the builtin completion functions\&. If there is a -+valid list and it is also currently shown on the screen, the value of this -+key is \fBshown\fP\&. -+.RS -+.PP -+After the widget has exited the value of this key is only used if it -+was set to \fBkeep\fP\&. In this case the completion code will continue -+to use this old list\&. If the widget generated new matches, they will -+not be used\&. -+.RE -+.TP -+\fBparameter\fP -+The name of the parameter when completing in a subscript or in the -+value of a parameter assignment\&. -+.TP -+\fBpattern_insert\fP -+Normally this is set to \fBmenu\fP, which specifies that menu completion will -+be used whenever a set of matches was generated using pattern matching\&. If -+it is set to any other non\-empty string by the user and menu completion is -+not selected by other option settings, the code will instead insert any -+common prefix for the generated matches as with normal completion\&. -+.TP -+\fBpattern_match\fP -+Locally controls the behaviour given by the \fBGLOB_COMPLETE\fP option\&. -+Initially it is set to `\fB*\fP\&' if and only if the option is set\&. -+The completion widget may set it to this value, to an empty string -+(which has the same effect as unsetting it), or to any -+other non\-empty string\&. If it is non\-empty, unquoted metacharacters on the -+command line will be treated as patterns; if it is `\fB*\fP\&', then -+additionally a wildcard `\fB*\fP\&' is assumed at the cursor position; if -+it is empty or unset, metacharacters will be treated literally\&. -+.RS -+.PP -+Note that the matcher specifications given to the \fBcompadd\fP builtin -+command are not used if this is set to a non\-empty string\&. -+.RE -+.TP -+\fBquote\fP -+When completing inside quotes, this contains the quotation character -+(i\&.e\&. either a single quote, a double quote, or a backtick)\&. Otherwise it -+is unset\&. -+.TP -+\fBquoting\fP -+When completing inside single quotes, this is set to the string -+\fBsingle\fP; inside double quotes, the string -+\fBdouble\fP; inside backticks, the string \fBbacktick\fP\&. -+Otherwise it is unset\&. -+.TP -+\fBredirect\fP -+The redirection operator when completing in a redirection position, -+i\&.e\&. one of \fB<\fP, \fB>\fP, etc\&. -+.TP -+\fBrestore\fP -+This is set to \fBauto\fP before a function is entered, which forces the -+special parameters mentioned above (\fBwords\fP, \fBCURRENT\fP, \fBPREFIX\fP, -+\fBIPREFIX\fP, \fBSUFFIX\fP, and \fBISUFFIX\fP) to be restored to their -+previous values when the function exits\&. If a function unsets it or -+sets it to any other string, they will not be restored\&. -+.TP -+\fBto_end\fP -+Specifies the occasions on which the cursor is moved to the end of a string -+when a match is inserted\&. On entry to a widget function, it may be -+\fBsingle\fP if this will happen when a single unambiguous match was inserted -+or \fBmatch\fP if it will happen any time a match is inserted (for example, -+by menu completion; this is likely to be the effect of the \fBALWAYS_TO_END\fP -+option)\&. -+.RS -+.PP -+On exit, it may be set to \fBsingle\fP as above\&. It may also be set to -+\fBalways\fP, or to the empty string or unset; in those cases the cursor will -+be moved to the end of the string always or never respectively\&. Any -+other string is treated as \fBmatch\fP\&. -+.RE -+.TP -+\fBunambiguous\fP -+This key is read\-only and will always be set to the common (unambiguous) -+prefix the completion code has generated for all matches added so far\&. -+.TP -+\fBunambiguous_cursor\fP -+This gives the position the cursor would be placed at if the -+common prefix in the \fBunambiguous\fP key were inserted, relative to -+the value of that key\&. The cursor would be placed before the character -+whose index is given by this key\&. -+.TP -+\fBunambiguous_positions\fP -+This contains all positions where characters in the unambiguous string -+are missing or where the character inserted differs from at least one -+of the matches\&. The positions are given as indexes into the string -+given by the value of the \fBunambiguous\fP key\&. -+.TP -+\fBvared\fP -+If completion is called while editing a line using the \fBvared\fP -+builtin, the value of this key is set to the name of the parameter -+given as an argument to \fBvared\fP\&. This key is only set while a \fBvared\fP -+command is active\&. -+.RE -+.TP -+\fBwords\fP -+This array contains the words present on the command line currently being -+edited\&. -+.PP -+.SH "COMPLETION BUILTIN COMMANDS" -+.PD 0 -+.TP -+.PD 0 -+\fBcompadd\fP [ \fB\-akqQfenUld12C\fP ] [ \fB\-F\fP \fIarray\fP ] -+.TP -+.PD 0 -+[ \fB\-P\fP \fIprefix\fP ] [ \fB\-S\fP \fIsuffix\fP ] -+.TP -+.PD 0 -+[ \fB\-p\fP \fIhidden\-prefix\fP ] [ \fB\-s\fP \fIhidden\-suffix\fP ] -+.TP -+.PD 0 -+[ \fB\-i\fP \fIignored\-prefix\fP ] [ \fB\-I\fP \fIignored\-suffix\fP ] -+.TP -+.PD 0 -+[ \fB\-W\fP \fIfile\-prefix\fP ] [ \fB\-d\fP \fIarray\fP ] -+.TP -+.PD 0 -+[ \fB\-J\fP \fIname\fP ] [ \fB\-V\fP \fIname\fP ] [ \fB\-X\fP \fIexplanation\fP ] [ \fB\-x\fP \fImessage\fP ] -+.TP -+.PD 0 -+[ \fB\-r\fP \fIremove\-chars\fP ] [ \fB\-R\fP \fIremove\-func\fP ] -+.TP -+.PD 0 -+[ \fB\-D\fP \fIarray\fP ] [ \fB\-O\fP \fIarray\fP ] [ \fB\-A\fP \fIarray\fP ] -+.TP -+.PD 0 -+[ \fB\-E\fP \fInumber\fP ] -+.TP -+.PD -+[ \fB\-M\fP \fImatch\-spec\fP ] [ \fB\-\fP\fB\-\fP ] [ \fIwords\fP \&.\&.\&. ] -+.RS -+.PP -+This builtin command can be used to add matches directly and control -+all the information the completion code stores with each possible -+match\&. The return status is zero if at least one match was added and -+non\-zero if no matches were added\&. -+.PP -+The completion code breaks the string to complete into seven fields in -+the order: -+.PP -+.RS -+.nf -+\fI\fP -+.fi -+.RE -+.PP -+The first field -+is an ignored prefix taken from the command line, the contents of the -+\fBIPREFIX\fP parameter plus the string given with the \fB\-i\fP -+option\&. With the \fB\-U\fP option, only the string from the \fB\-i\fP -+option is used\&. The field \fI\fP is an optional prefix string -+given with the \fB\-P\fP option\&. The \fI\fP field is a string -+that is considered part of the match but that should not be shown when -+listing completions, given with the \fB\-p\fP option; for example, -+functions that do filename generation might specify -+a common path prefix this way\&. \fI\fP is the part of the match that -+should appear in the list of completions, i\&.e\&. one of the \fIwords\fP given -+at the end of the \fBcompadd\fP command line\&. The suffixes \fI\fP, -+\fI\fP and \fI\fP correspond to the prefixes \fI\fP, -+\fI\fP and \fI\fP and are given by the options \fB\-s\fP, \fB\-S\fP and -+\fB\-I\fP, respectively\&. -+.PP -+The supported flags are: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-P\fP \fIprefix\fP -+This gives a string to be inserted before the given \fIwords\fP\&. The -+string given is not considered as part of the match and any shell -+metacharacters in it will not be quoted when the string is inserted\&. -+.TP -+\fB\-S\fP \fIsuffix\fP -+Like \fB\-P\fP, but gives a string to be inserted after the match\&. -+.TP -+\fB\-p\fP \fIhidden\-prefix\fP -+This gives a string that should be inserted into the command line before the -+match but that should not appear in the list of matches\&. Unless the -+\fB\-U\fP option is given, this string must be matched as part of the string -+on the command line\&. -+.TP -+\fB\-s\fP \fIhidden\-suffix\fP -+Like `\fB\-p\fP\&', but gives a string to insert after the match\&. -+.TP -+\fB\-i\fP \fIignored\-prefix\fP -+This gives a string to insert into the command line just before any -+string given with the `\fB\-P\fP\&' option\&. Without `\fB\-P\fP' the string is -+inserted before the string given with `\fB\-p\fP\&' or directly before the -+match\&. -+.TP -+\fB\-I\fP \fIignored\-suffix\fP -+Like \fB\-i\fP, but gives an ignored suffix\&. -+.TP -+\fB\-a\fP -+With this flag the \fIwords\fP are taken as names of arrays and the -+possible matches are their values\&. If only some elements of the -+arrays are needed, the \fIwords\fP may also contain subscripts, as in -+`\fBfoo[2,\-1]\fP\&'\&. -+.TP -+\fB\-k\fP -+With this flag the \fIwords\fP are taken as names of associative arrays -+and the possible matches are their keys\&. As for \fB\-a\fP, the -+\fIwords\fP may also contain subscripts, as in `\fBfoo[(R)*bar*]\fP\&'\&. -+.TP -+\fB\-d\fP \fIarray\fP -+This adds per\-match display strings\&. The \fIarray\fP should contain one -+element per \fIword\fP given\&. The completion code will then display the -+first element instead of the first \fIword\fP, and so on\&. The -+\fIarray\fP may be given as the name of an array parameter or directly -+as a space\-separated list of words in parentheses\&. -+.RS -+.PP -+If there are fewer display strings than \fIwords\fP, the leftover -+\fIwords\fP will be displayed unchanged and if there are more display -+strings than \fIwords\fP, the leftover display strings will be silently -+ignored\&. -+.RE -+.TP -+\fB\-l\fP -+This option only has an effect if used together with the \fB\-d\fP -+option\&. If it is given, the display strings are listed one per line, -+not arrayed in columns\&. -+.TP -+\fB\-o\fP -+This option only has an effect if used together with the \fB\-d\fP -+option\&. If it is given, the order of the output is determined by the -+match strings; otherwise it is determined by the display strings -+(i\&.e\&. the strings given by the \fB\-d\fP option)\&. -+.TP -+\fB\-J\fP \fIname\fP -+Gives the name of the group of matches the words should be stored in\&. -+.TP -+\fB\-V\fP \fIname\fP -+Like \fB\-J\fP but naming an unsorted group\&. These are in a different name -+space than groups created with the \fB\-J\fP flag\&. -+.TP -+\fB\-1\fP -+If given together with the \fB\-V\fP option, makes -+only consecutive duplicates in the group be removed\&. If combined with -+the \fB\-J\fP option, this has no visible effect\&. Note that groups -+with and without this flag are in different name spaces\&. -+.TP -+\fB\-2\fP -+If given together with the \fB\-J\fP or \fB\-V\fP option, makes all -+duplicates be kept\&. Again, groups with and without this flag are in -+different name spaces\&. -+.TP -+\fB\-X\fP \fIexplanation\fP -+The \fIexplanation\fP string will be printed with the list of matches, -+above the group currently selected\&. -+.TP -+\fB\-x\fP \fImessage\fP -+Like \fB\-X\fP, but the \fImessage\fP will be printed even if there are no -+matches in the group\&. -+.TP -+\fB\-q\fP -+The suffix given with \fB\-S\fP will be automatically removed if -+the next character typed is a blank or does not insert anything, or if -+the suffix consists of only one character and the next character typed -+is the same character\&. -+.TP -+\fB\-r\fP \fIremove\-chars\fP -+This is a more versatile form of the \fB\-q\fP option\&. -+The suffix given with \fB\-S\fP or the slash automatically added after -+completing directories will be automatically removed if -+the next character typed inserts one of the characters given in the -+\fIremove\-chars\fP\&. This string is parsed as a characters class and -+understands the backslash sequences used by the \fBprint\fP command\&. For -+example, `\fB\-r "a\-z\et"\fP\&' removes the suffix if the next character typed -+inserts a lower case character or a TAB, and `\fB\-r "^0\-9"\fP\&' removes the -+suffix if the next character typed inserts anything but a digit\&. One extra -+backslash sequence is understood in this string: `\fB\e\-\fP\&' stands for -+all characters that insert nothing\&. Thus `\fB\-S "=" \-q\fP\&' is the same -+as `\fB\-S "=" \-r "= \et\en\e\-"\fP\&'\&. -+.RS -+.PP -+This option may also be used without the \fB\-S\fP option; then any -+automatically added space will be removed when one of the characters in the -+list is typed\&. -+.RE -+.TP -+\fB\-R\fP \fIremove\-func\fP -+This is another form of the \fB\-r\fP option\&. When a suffix -+has been inserted and the completion accepted, the function -+\fIremove\-func\fP will be called after the next character typed\&. It is -+passed the length of the suffix as an argument and can use the special -+parameters available in ordinary (non\-completion) zle widgets (see -+\fIzshzle\fP(1)) to analyse and modify the command line\&. -+.TP -+\fB\-f\fP -+If this flag is given, all of the matches built from \fIwords\fP are -+marked as being the names of files\&. They are not required to be actual -+filenames, but if they are, and the option \fBLIST_TYPES\fP is set, the -+characters describing the types of the files in the completion lists will -+be shown\&. This also forces a slash to be added when the name of a -+directory is completed\&. -+.TP -+\fB\-e\fP -+This flag can be used to tell the completion code that the matches -+added are parameter names for a parameter expansion\&. This will make -+the \fBAUTO_PARAM_SLASH\fP and \fBAUTO_PARAM_KEYS\fP options be used for -+the matches\&. -+.TP -+\fB\-W\fP \fIfile\-prefix\fP -+This string is a pathname that will be -+prepended to each of the matches formed by the given \fIwords\fP together -+with any prefix specified by the \fB\-p\fP option to form a complete filename -+for testing\&. Hence it is only useful if combined with the \fB\-f\fP flag, as -+the tests will not otherwise be performed\&. -+.TP -+\fB\-F\fP \fIarray\fP -+Specifies an array containing patterns\&. Words matching one of these -+patterns are ignored, i\&.e\&. not considered to be possible matches\&. -+.RS -+.PP -+The \fIarray\fP may be the name of an array parameter or a list of -+literal patterns enclosed in parentheses and quoted, as in `\fB\-F "(*?\&.o -+*?\&.h)"\fP\&'\&. If the name of an array is given, the elements of the array are -+taken as the patterns\&. -+.RE -+.TP -+\fB\-Q\fP -+This flag instructs the completion -+code not to quote any metacharacters in the words when inserting them -+into the command line\&. -+.TP -+\fB\-M\fP \fImatch\-spec\fP -+This gives local match specifications as described below in -+the section `Completion Matching Control\&'\&. This option may be given more than once\&. -+In this case all \fImatch\-spec\fPs given are concatenated with spaces -+between them to form the specification string to use\&. -+Note that they will only be used if the \fB\-U\fP option is not given\&. -+.TP -+\fB\-n\fP -+Specifies that the words added are to be used as possible -+matches, but are not to appear in the completion listing\&. -+.TP -+\fB\-U\fP -+If this flag is given, all words given will be accepted and no matching -+will be done by the completion code\&. Normally this is used in -+functions that do the matching themselves\&. -+.TP -+\fB\-O\fP \fIarray\fP -+If this option is given, the \fIwords\fP are \fInot\fP added to the set of -+possible completions\&. Instead, matching is done as usual and all of the -+\fIwords\fP given as arguments that match the string on the command line -+will be stored in the array parameter whose name is given as \fIarray\fP\&. -+.TP -+\fB\-A\fP \fIarray\fP -+As the \fB\-O\fP option, except that instead of those of the \fIwords\fP which -+match being stored in \fIarray\fP, the strings generated internally by the -+completion code are stored\&. For example, -+with a matching specification of `\fB\-M "L:|no="\fP\&', the string `\fBnof\fP' -+on the command line and the string `\fBfoo\fP\&' as one of the \fIwords\fP, this -+option stores the string `\fBnofoo\fP\&' in the array, whereas the \fB\-O\fP -+option stores the `\fBfoo\fP\&' originally given\&. -+.TP -+\fB\-D\fP \fIarray\fP -+As with \fB\-O\fP, the \fIwords\fP are not added to the set of possible -+completions\&. Instead, the completion code tests whether each \fIword\fP -+in turn matches what is on the line\&. If the \fIn\fPth \fIword\fP does not -+match, the \fIn\fPth element of the \fIarray\fP is removed\&. Elements -+for which the corresponding \fIword\fP is matched are retained\&. -+.TP -+\fB\-C\fP -+This option adds a special match which expands to all other matches -+when inserted into the line, even those that are added after this -+option is used\&. Together with the \fB\-d\fP option it is possible to -+specify a string that should be displayed in the list for this special -+match\&. If no string is given, it will be shown as a string containing -+the strings that would be inserted for the other matches, truncated to -+the width of the screen\&. -+.TP -+\fB\-E\fP -+This option adds \fInumber\fP empty matches after the \fIwords\fP have -+been added\&. An empty match takes up space in completion listings but -+will never be inserted in the line and can\&'t be selected with menu -+completion or menu selection\&. This makes empty matches only useful to -+format completion lists and to make explanatory string be shown in -+completion lists (since empty matches can be given display strings -+with the \fB\-d\fP option)\&. And because all but one empty string would -+otherwise be removed, this option implies the \fB\-V\fP and \fB\-2\fP -+options (even if an explicit \fB\-J\fP option is given)\&. -+.TP -+.PD 0 -+\fB\-\fP -+.TP -+.PD -+\fB\-\fP\fB\-\fP -+This flag ends the list of flags and options\&. All arguments after it -+will be taken as the words to use as matches even if they begin with -+hyphens\&. -+.PP -+Except for the \fB\-M\fP flag, if any of these flags is given more than -+once, the first one (and its argument) will be used\&. -+.RE -+.TP -+.PD 0 -+\fBcompset \-p\fP \fInumber\fP -+.TP -+.PD 0 -+\fBcompset \-P\fP [ \fInumber\fP ] \fIpattern\fP -+.TP -+.PD 0 -+\fBcompset \-s\fP \fInumber\fP -+.TP -+.PD 0 -+\fBcompset \-S\fP [ \fInumber\fP ] \fIpattern\fP -+.TP -+.PD 0 -+\fBcompset \-n\fP \fIbegin\fP [ \fIend\fP ] -+.TP -+.PD 0 -+\fBcompset \-N\fP \fIbeg\-pat\fP [ \fIend\-pat\fP ] -+.TP -+.PD -+\fBcompset \-q\fP -+This command simplifies modification of the special parameters, -+while its return status allows tests on them to be carried out\&. -+.RS -+.PP -+The options are: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-p\fP \fInumber\fP -+If the contents of the \fBPREFIX\fP parameter is longer than \fInumber\fP -+characters, the first \fInumber\fP characters are removed from it and -+appended to the contents of the \fBIPREFIX\fP parameter\&. -+.TP -+\fB\-P\fP [ \fInumber\fP ] \fIpattern\fP -+If the value of the \fBPREFIX\fP parameter begins with anything that -+matches the \fIpattern\fP, the matched portion is removed from -+\fBPREFIX\fP and appended to \fBIPREFIX\fP\&. -+.RS -+.PP -+Without the optional \fInumber\fP, the longest match is taken, but -+if \fInumber\fP is given, anything up to the \fInumber\fPth match is -+moved\&. If the \fInumber\fP is negative, the \fInumber\fPth longest -+match is moved\&. For example, if \fBPREFIX\fP contains the string -+`\fBa=b=c\fP\&', then \fBcompset \-P '*\e='\fP will move the string `\fBa=b=\fP' -+into the \fBIPREFIX\fP parameter, but \fBcompset \-P 1 \&'*\e='\fP will move only -+the string `\fBa=\fP\&'\&. -+.RE -+.TP -+\fB\-s\fP \fInumber\fP -+As \fB\-p\fP, but transfer the last \fInumber\fP characters from the -+value of \fBSUFFIX\fP to the front of the value of \fBISUFFIX\fP\&. -+.TP -+\fB\-S\fP [ \fInumber\fP ] \fIpattern\fP -+As \fB\-P\fP, but match the last portion of \fBSUFFIX\fP and transfer the -+matched portion to the front of the value of \fBISUFFIX\fP\&. -+.TP -+\fB\-n\fP \fIbegin\fP [ \fIend\fP ] -+If the current word position as specified by the parameter \fBCURRENT\fP -+is greater than or equal to \fIbegin\fP, anything up to the -+\fIbegin\fPth word is removed from the \fBwords\fP array and the value -+of the parameter \fBCURRENT\fP is decremented by \fIbegin\fP\&. -+.RS -+.PP -+If the optional \fIend\fP is given, the modification is done only if -+the current word position is also less than or equal to \fIend\fP\&. In -+this case, the words from position \fIend\fP onwards are also removed from -+the \fBwords\fP array\&. -+.PP -+Both \fIbegin\fP and \fIend\fP may be negative to count backwards -+from the last element of the \fBwords\fP array\&. -+.RE -+.TP -+\fB\-N\fP \fIbeg\-pat\fP [ \fIend\-pat\fP ] -+If one of the elements of the \fBwords\fP array before the one at the -+index given by the value of the parameter \fBCURRENT\fP matches the -+pattern \fIbeg\-pat\fP, all elements up to and including the matching one are -+removed from the \fBwords\fP array and the value of \fBCURRENT\fP is changed to -+point to the same word in the changed array\&. -+.RS -+.PP -+If the optional pattern \fIend\-pat\fP is also given, and there is an -+element in the \fBwords\fP array matching this pattern, the parameters -+are modified only if the index of this word is higher than the one -+given by the \fBCURRENT\fP parameter (so that the matching word has -+to be after the cursor)\&. In this case, the words starting with the one -+matching \fBend\-pat\fP are also removed from the \fBwords\fP -+array\&. If \fBwords\fP contains no word matching \fIend\-pat\fP, the -+testing and modification is performed as if it were not given\&. -+.RE -+.TP -+\fB\-q\fP -+The word -+currently being completed is split on spaces into separate words, -+respecting the usual shell quoting conventions\&. The -+resulting words are stored in the \fBwords\fP array, and \fBCURRENT\fP, -+\fBPREFIX\fP, \fBSUFFIX\fP, \fBQIPREFIX\fP, and \fBQISUFFIX\fP are modified to -+reflect the word part that is completed\&. -+.PP -+In all the above cases the return status is zero if the test succeeded -+and the parameters were modified and non\-zero otherwise\&. This allows -+one to use this builtin in tests such as: -+.PP -+.RS -+.nf -+\fBif compset \-P \&'*\e='; then \&.\&.\&.\fP -+.fi -+.RE -+.PP -+This forces anything up to and including the last equal sign to be -+ignored by the completion code\&. -+.RE -+.TP -+\fBcompcall\fP [ \fB\-TD\fP ] -+This allows the use of completions defined with the \fBcompctl\fP builtin -+from within completion widgets\&. The list of matches will be generated as -+if one of the non\-widget completion functions (\fBcomplete\-word\fP, etc\&.) -+had been called, except that only \fBcompctl\fPs given for specific commands -+are used\&. To force the code to try completions defined with the \fB\-T\fP -+option of \fBcompctl\fP and/or the default completion (whether defined by -+\fBcompctl \-D\fP or the builtin default) in the appropriate places, the -+\fB\-T\fP and/or \fB\-D\fP flags can be passed to \fBcompcall\fP\&. -+.RS -+.PP -+The return status can be used to test if a matching \fBcompctl\fP -+definition was found\&. It is non\-zero if a \fBcompctl\fP was found and -+zero otherwise\&. -+.PP -+Note that this builtin is defined by the \fBzsh/compctl\fP module\&. -+.RE -+.RE -+.PP -+.SH "COMPLETION CONDITION CODES" -+.PP -+The following additional condition codes for use within the \fB[[ \&.\&.\&. ]]\fP -+construct are available in completion widgets\&. These work on the special -+parameters\&. All of these tests can also be performed by the \fBcompset\fP -+builtin, but in the case of the condition codes the contents of the special -+parameters are not modified\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-prefix\fP [ \fInumber\fP ] \fIpattern\fP -+true if the test for the \fB\-P\fP option of \fBcompset\fP would succeed\&. -+.TP -+\fB\-suffix\fP [ \fInumber\fP ] \fIpattern\fP -+true if the test for the \fB\-S\fP option of \fBcompset\fP would succeed\&. -+.TP -+\fB\-after\fP \fIbeg\-pat\fP -+true if the test of the \fB\-N\fP option with only the \fIbeg\-pat\fP given -+would succeed\&. -+.TP -+\fB\-between\fP \fIbeg\-pat end\-pat\fP -+true if the test for the \fB\-N\fP option with both patterns would succeed\&. -+.PP -+.SH "COMPLETION MATCHING CONTROL" -+.PP -+It is possible by use of the -+\fB\-M\fP option of the \fBcompadd\fP builtin command to specify how the -+characters in the string to be completed (referred to here as the -+command line) map onto the characters in the list of matches produced by -+the completion code (referred to here as the trial completions)\&. Note -+that this is not used if the command line contains a glob pattern and -+the \fBGLOB_COMPLETE\fP option is set or the \fBpattern_match\fP of the -+\fBcompstate\fP special association is set to a non\-empty string\&. -+.PP -+The \fImatch\-spec\fP given as the argument to the \fB\-M\fP option (see -+`Completion Builtin Commands\&' above) consists of one or more matching descriptions separated by -+whitespace\&. Each description consists of a letter followed by a colon -+and then the patterns describing which character sequences on the line match -+which character sequences in the trial completion\&. Any sequence of -+characters not handled in this fashion must match exactly, as usual\&. -+.PP -+The forms of \fImatch\-spec\fP understood are as follows\&. In each case, the -+form with an upper case initial character retains the string already -+typed on the command line as the final result of completion, while with -+a lower case initial character the string on the command line is changed -+into the corresponding part of the trial completion\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBm:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+.TP -+.PD -+\fBM:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+Here, \fIlpat\fP is a pattern that matches on the command line, -+corresponding to \fItpat\fP which matches in the trial completion\&. -+.TP -+.PD 0 -+\fBl:\fP\fIlanchor\fP\fB|\fP\fIlpat\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBL:\fP\fIlanchor\fP\fB|\fP\fIlpat\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBl:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBL:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBb:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+.TP -+.PD -+\fBB:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+These letters are for patterns that are anchored by another pattern on -+the left side\&. Matching for \fIlpat\fP and \fItpat\fP is as for \fBm\fP and -+\fBM\fP, but the pattern \fIlpat\fP matched on the command line must be -+preceded by the pattern \fIlanchor\fP\&. The \fIlanchor\fP can be blank to -+anchor the match to the start of the command line string; otherwise the -+anchor can occur anywhere, but must match in both the command line and -+trial completion strings\&. -+.RS -+.PP -+If no \fIlpat\fP is given but a \fIranchor\fP is, this matches the gap -+between substrings matched by \fIlanchor\fP and \fIranchor\fP\&. Unlike -+\fIlanchor\fP, the \fIranchor\fP only needs to match the trial -+completion string\&. -+.PP -+The \fBb\fP and \fBB\fP forms are similar to \fBl\fP and \fBL\fP with an empty -+anchor, but need to match only the beginning of the trial completion -+or the word on the command line, respectively\&. -+.RE -+.TP -+.PD 0 -+\fBr:\fP\fIlpat\fP\fB|\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBR:\fP\fIlpat\fP\fB|\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBr:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBR:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP -+.TP -+.PD 0 -+\fBe:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+.TP -+.PD -+\fBE:\fP\fIlpat\fP\fB=\fP\fItpat\fP -+As \fBl\fP, \fBL\fP, \fBb\fP and \fBB\fP, with the difference that the command -+line and trial completion patterns are anchored on the right side\&. -+Here an empty \fIranchor\fP and the \fBe\fP and \fBE\fP forms force the -+match to the end of the trial completion or command line string\&. -+.PP -+Each \fIlpat\fP, \fItpat\fP or \fIanchor\fP is either an empty string or -+consists of a sequence of literal characters (which may be quoted with a -+backslash), question marks, character classes, and correspondence -+classes; ordinary shell patterns are not used\&. Literal characters match -+only themselves, question marks match any character, and character -+classes are formed as for globbing and match any character in the given -+set\&. -+.PP -+Correspondence classes are defined like character classes, but with two -+differences: they are delimited by a pair of braces, and negated classes -+are not allowed, so the characters \fB!\fP and \fB^\fP have no special -+meaning directly after the opening brace\&. They indicate that a range of -+characters on the line match a range of characters in the trial -+completion, but (unlike ordinary character classes) paired according to -+the corresponding position in the sequence\&. For example, to make any -+ASCII lower case letter on the line match the corresponding upper case -+letter in the trial completion, you can use `\fBm:{a\-z}={A\-Z}\fP\&' -+(however, see below for the recommended form for this)\&. More -+than one pair of classes can occur, in which case the first class before -+the \fB=\fP corresponds to the first after it, and so on\&. If one side has -+more such classes than the other side, the superfluous classes behave -+like normal character classes\&. In anchor patterns correspondence classes -+also behave like normal character classes\&. -+.PP -+The standard `\fB[:\fP\fIname\fP\fB:]\fP\&' forms described for standard shell -+patterns, -+see the section FILENAME GENERATION in \fIzshexpn\fP(1), -+may appear in correspondence classes as well as normal character -+classes\&. The only special behaviour in correspondence classes is if -+the form on the left and the form on the right are each one of -+\fB[:upper:]\fP, \fB[:lower:]\fP\&. In these cases the -+character in the word and the character on the line must be the same up -+to a difference in case\&. Hence to make any lower case character on the -+line match the corresponding upper case character in the trial -+completion you can use `\fBm:{[:lower:]}={[:upper:]}\fP\&'\&. Although the -+matching system does not yet handle multibyte characters, this is likely -+to be a future extension, at which point this syntax will handle -+arbitrary alphabets; hence this form, rather than the use of explicit -+ranges, is the recommended form\&. In other cases -+`\fB[:\fP\fIname\fP\fB:]\fP\&' forms are allowed\&. If the two forms on the left -+and right are the same, the characters must match exactly\&. In remaining -+cases, the corresponding tests are applied to both characters, but they -+are not otherwise constrained; any matching character in one set goes -+with any matching character in the other set: this is equivalent to the -+behaviour of ordinary character classes\&. -+.PP -+The pattern \fItpat\fP may also be one or two stars, `\fB*\fP\&' or -+`\fB**\fP\&'\&. This means that the pattern on the command line can match -+any number of characters in the trial completion\&. In this case the -+pattern must be anchored (on either side); in the case of a single -+star, the \fIanchor\fP then determines how much of the trial completion -+is to be included \-\- only the characters up to the next appearance of -+the anchor will be matched\&. With two stars, substrings matched by the -+anchor can be matched, too\&. -+.PP -+Examples: -+.PP -+The keys of the \fBoptions\fP association defined by the \fBparameter\fP -+module are the option names in all\-lower\-case form, without -+underscores, and without the optional \fBno\fP at the beginning even -+though the builtins \fBsetopt\fP and \fBunsetopt\fP understand option names -+with upper case letters, underscores, and the optional \fBno\fP\&. The -+following alters the matching rules so that the prefix \fBno\fP and any -+underscore are ignored when trying to match the trial completions -+generated and upper case letters on the line match the corresponding -+lower case letters in the words: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'L:|[nN][oO]= M:_= M:{[:upper:]}={[:lower:]}' \- \e -+ ${(k)options} \fP -+.fi -+.RE -+.PP -+The first part says that the pattern `\fB[nN][oO]\fP\&' at the beginning -+(the empty anchor before the pipe symbol) of the string on the -+line matches the empty string in the list of words generated by -+completion, so it will be ignored if present\&. The second part does the -+same for an underscore anywhere in the command line string, and the -+third part uses correspondence classes so that any -+upper case letter on the line matches the corresponding lower case -+letter in the word\&. The use of the upper case forms of the -+specification characters (\fBL\fP and \fBM\fP) guarantees that what has -+already been typed on the command line (in particular the prefix -+\fBno\fP) will not be deleted\&. -+.PP -+Note that the use of \fBL\fP in the first part means that it matches -+only when at the beginning of both the command line string and the -+trial completion\&. I\&.e\&., the string `\fB_NO_f\fP\&' would not be -+completed to `\fB_NO_foo\fP\&', nor would `\fBNONO_f\fP' be completed to -+`\fBNONO_foo\fP\&' because of the leading underscore or the second -+`\fBNO\fP\&' on the line which makes the pattern fail even though they are -+otherwise ignored\&. To fix this, one would use `\fBB:[nN][oO]=\fP\&' -+instead of the first part\&. As described above, this matches at the -+beginning of the trial completion, independent of other characters or -+substrings at the beginning of the command line word which are ignored -+by the same or other \fImatch\-spec\fPs\&. -+.PP -+The second example makes completion case insensitive\&. This is just -+the same as in the option example, except here we wish to retain the -+characters in the list of completions: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'m:{[:lower:]}={[:upper:]}' \&.\&.\&. \fP -+.fi -+.RE -+.PP -+This makes lower case letters match their upper case counterparts\&. -+To make upper case letters match the lower case forms as well: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'m:{[:lower:][:upper:]}={[:upper:][:lower:]}' \&.\&.\&. \fP -+.fi -+.RE -+.PP -+A nice example for the use of \fB*\fP patterns is partial word -+completion\&. Sometimes you would like to make strings like `\fBc\&.s\&.u\fP\&' -+complete to strings like `\fBcomp\&.source\&.unix\fP\&', i\&.e\&. the word on the -+command line consists of multiple parts, separated by a dot in this -+example, where each part should be completed separately \-\- note, -+however, that the case where each part of the word, i\&.e\&. `\fBcomp\fP\&', -+`\fBsource\fP\&' and `\fBunix\fP' in this example, is to be completed from -+separate sets of matches -+is a different problem to be solved by the implementation of the -+completion widget\&. The example can be handled by: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'r:|\&.=* r:|=*' \e -+ \- comp\&.sources\&.unix comp\&.sources\&.misc \&.\&.\&.\fP -+.fi -+.RE -+.PP -+The first specification says that \fIlpat\fP is the empty string, while -+\fIanchor\fP is a dot; \fItpat\fP is \fB*\fP, so this can match anything -+except for the `\fB\&.\fP\&' from the anchor in -+the trial completion word\&. So in `\fBc\&.s\&.u\fP\&', the matcher sees `\fBc\fP', -+followed by the empty string, followed by the anchor `\fB\&.\fP\&', and -+likewise for the second dot, and replaces the empty strings before the -+anchors, giving `\fBc\fP[\fBomp\fP]\fB\&.s\fP[\fBources\fP]\fB\&.u\fP[\fBnix\fP]\&', where -+the last part of the completion is just as normal\&. -+.PP -+With the pattern shown above, the string `\fBc\&.u\fP\&' could not be -+completed to `\fBcomp\&.sources\&.unix\fP\&' because the single star means -+that no dot (matched by the anchor) can be skipped\&. By using two stars -+as in `\fBr:|\&.=**\fP\&', however, `\fBc\&.u\fP' could be completed to -+`\fBcomp\&.sources\&.unix\fP\&'\&. This also shows that in some cases, -+especially if the anchor is a real pattern, like a character class, -+the form with two stars may result in more matches than one would like\&. -+.PP -+The second specification is needed to make this work when the cursor is -+in the middle of the string on the command line and the option -+\fBCOMPLETE_IN_WORD\fP is set\&. In this case the completion code would -+normally try to match trial completions that end with the string as -+typed so far, i\&.e\&. it will only insert new characters at the cursor -+position rather than at the end\&. However in our example we would like -+the code to recognise matches which contain extra characters after the -+string on the line (the `\fBnix\fP\&' in the example)\&. Hence we say that the -+empty string at the end of the string on the line matches any characters -+at the end of the trial completion\&. -+.PP -+More generally, the specification -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'r:|[\&.,_\-]=* r:|=*' \&.\&.\&. \fP -+.fi -+.RE -+.PP -+allows one to complete words with abbreviations before any of the -+characters in the square brackets\&. For example, to -+complete \fBveryverylongfile\&.c\fP rather than \fBveryverylongheader\&.h\fP -+with the above in effect, you can just type \fBvery\&.c\fP before attempting -+completion\&. -+.PP -+The specifications with both a left and a right anchor are useful to -+complete partial words whose parts are not separated by some -+special character\&. For example, in some places strings have to be -+completed that are formed `\fBLikeThis\fP\&' (i\&.e\&. the separate parts are -+determined by a leading upper case letter) or maybe one has to -+complete strings with trailing numbers\&. Here one could use the simple -+form with only one anchor as in: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'r:|[[:upper:]0\-9]=* r:|=*' LikeTHIS FooHoo 5foo123 5bar234\fP -+.fi -+.RE -+.PP -+But with this, the string `\fBH\fP\&' would neither complete to `\fBFooHoo\fP' -+nor to `\fBLikeTHIS\fP\&' because in each case there is an upper case -+letter before the `\fBH\fP\&' and that is matched by the anchor\&. Likewise, -+a `\fB2\fP\&' would not be completed\&. In both cases this could be changed -+by using `\fBr:|[[:upper:]0\-9]=**\fP\&', but then `\fBH\fP' completes to both -+`\fBLikeTHIS\fP\&' and `\fBFooHoo\fP' and a `\fB2\fP' matches the other -+strings because characters can be inserted before every upper case -+letter and digit\&. To avoid this one would use: -+.PP -+.RS -+.nf -+\fBcompadd \-M \&'r:[^[:upper:]0\-9]||[[:upper:]0\-9]=** r:|=*' \e -+ LikeTHIS FooHoo foo123 bar234\fP -+.fi -+.RE -+.PP -+By using these two anchors, a `\fBH\fP\&' matches only upper case `\fBH\fP's that -+are immediately preceded by something matching the left anchor -+`\fB[^[:upper:]0\-9]\fP\&'\&. The effect is, of course, that `\fBH\fP' matches only -+the string `\fBFooHoo\fP\&', a `\fB2\fP' matches only `\fBbar234\fP' and so on\&. -+.PP -+When using the completion system (see -+\fIzshcompsys\fP(1)), users can define match specifications that are to be used for -+specific contexts by using the \fBmatcher\fP and \fBmatcher\-list\fP -+styles\&. The values for the latter will be used everywhere\&. -+.PP -+.SH "COMPLETION WIDGET EXAMPLE" -+.PP -+The first step is to define the widget: -+.PP -+.RS -+.nf -+\fBzle \-C complete complete\-word complete\-files\fP -+.fi -+.RE -+.PP -+Then the widget can be bound to a key using the \fBbindkey\fP builtin -+command: -+.PP -+.RS -+.nf -+\fBbindkey \&'^X\et' complete\fP -+.fi -+.RE -+.PP -+After that the shell function \fBcomplete\-files\fP will be invoked -+after typing control\-X and TAB\&. The function should then generate the -+matches, e\&.g\&.: -+.PP -+.RS -+.nf -+\fBcomplete\-files () { compadd \- * }\fP -+.fi -+.RE -+.PP -+This function will complete files in the current directory matching the -+current word\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshmisc.1 -@@ -0,0 +1,2368 @@ -+.TH "ZSHMISC" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshmisc \- everything and then some -+.\" Yodl file: Zsh/grammar.yo -+.SH "SIMPLE COMMANDS & PIPELINES" -+A \fIsimple command\fP is a sequence of optional parameter -+assignments followed by blank\-separated words, -+with optional redirections interspersed\&. -+The first word is the command to be executed, and the remaining -+words, if any, are arguments to the command\&. -+If a command name is given, the parameter assignments modify -+the environment of the command when it is executed\&. -+The value of a simple command is its exit status, -+or 128 plus the signal number if terminated by a signal\&. -+For example, -+.PP -+.RS -+.nf -+\fBecho foo\fP -+.fi -+.RE -+.PP -+is a simple command with arguments\&. -+.PP -+A \fIpipeline\fP is either a simple command, or a sequence of two or more -+simple commands where each command is separated from the next by `\fB|\fP\&' -+or `\fB|&\fP\&'\&. Where commands are separated by `\fB|\fP', the standard -+output of the first command is connected to the -+standard input of the next\&. `\fB|&\fP\&' is shorthand for `\fB2>&1 |\fP', which -+connects both the standard output and the standard error of the -+command to the standard input of the next\&. The value of a pipeline -+is the value of the last command, unless the pipeline is preceded by -+`\fB!\fP\&' in which case the value is the logical inverse of the value of the -+last command\&. -+For example, -+.PP -+.RS -+.nf -+\fBecho foo | sed \&'s/foo/bar/'\fP -+.fi -+.RE -+.PP -+is a pipeline, where the output (`\fBfoo\fP\&' plus a newline) of the first -+command will be passed to the input of the second\&. -+.PP -+If a pipeline is preceded by `\fBcoproc\fP\&', it is executed as a coprocess; -+a two\-way pipe is established between it and the parent shell\&. The -+shell can read from or write to the coprocess by means of the `\fB>&p\fP\&' -+and `\fB<&p\fP\&' redirection operators or with `\fBprint \-p\fP' and `\fBread \-p\fP'\&. -+A pipeline cannot be preceded by both `\fBcoproc\fP\&' and `\fB!\fP'\&. -+If job control is active, the coprocess can be treated in other than input -+and output as an ordinary background job\&. -+.PP -+A \fIsublist\fP is either a single pipeline, or a sequence of two or more -+pipelines separated by `\fB&&\fP\&' or `\fB||\fP'\&. If two pipelines are separated -+by `\fB&&\fP\&', the second pipeline is executed only if the first succeeds -+(returns a zero status)\&. If two pipelines are separated by `\fB||\fP\&', the -+second is executed only if the first fails (returns a nonzero status)\&. -+Both operators have equal precedence and are left associative\&. -+The value of the sublist is the value of the last pipeline executed\&. -+For example, -+.PP -+.RS -+.nf -+\fBdmesg | grep panic && print yes\fP -+.fi -+.RE -+.PP -+is a sublist consisting of two pipelines, the second just a simple command -+which will be executed if and only if the \fBgrep\fP command returns a zero -+status\&. If it does not, the value of the sublist is that return status, else -+it is the status returned by the \fBprint\fP (almost certainly zero)\&. -+.PP -+A \fIlist\fP is a sequence of zero or more sublists, in which each sublist -+is terminated by `\fB;\fP\&', `\fB&\fP', `\fB&|\fP', `\fB&!\fP', or a newline\&. -+This terminator -+may optionally be omitted from the last sublist in the list when the -+list appears as a complex command inside `\fB(\fP\&.\&.\&.\fB)\fP\&' -+or `\fB{\fP\&.\&.\&.\fB}\fP\&'\&. When a -+sublist is terminated by `\fB;\fP\&' or newline, the shell waits for it to -+finish before executing the next sublist\&. If a sublist is terminated -+by a `\fB&\fP\&', `\fB&|\fP', or `\fB&!\fP', -+the shell executes the last pipeline in it in the background, and -+does not wait for it to finish (note the difference from other shells -+which execute the whole sublist in the background)\&. -+A backgrounded pipeline returns a status of zero\&. -+.PP -+More generally, a list can be seen as a set of any shell commands -+whatsoever, including the complex commands below; this is implied wherever -+the word `list\&' appears in later descriptions\&. For example, the commands -+in a shell function form a special sort of list\&. -+.SH "PRECOMMAND MODIFIERS" -+A simple command may be preceded by a \fIprecommand modifier\fP, -+which will alter how the command is interpreted\&. These modifiers are -+shell builtin commands with the exception of \fBnocorrect\fP which is -+a reserved word\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-\fP -+The command is executed with a `\fB\-\fP\&' prepended to its -+\fBargv[0]\fP string\&. -+.TP -+\fBbuiltin\fP -+The command word is taken to be the name of a builtin command, -+rather than a shell function or external command\&. -+.TP -+\fBcommand\fP [ \fB\-pvV\fP ] -+The command word is taken to be the name of an external command, -+rather than a shell function or builtin\&. If the \fBPOSIX_BUILTINS\fP option -+is set, builtins will also be executed but certain special properties -+of them are suppressed\&. The \fB\-p\fP flag causes a default path to be -+searched instead of that in \fB$path\fP\&. With the \fB\-v\fP flag, \fBcommand\fP -+is similar to \fBwhence\fP and with \fB\-V\fP, it is equivalent to \fBwhence -+\-v\fP\&. -+.TP -+\fBexec\fP [ \fB\-cl\fP ] [ \fB\-a\fP \fIargv0\fP ] -+The following command together with any arguments is run in place -+of the current process, rather than as a sub\-process\&. The shell does not -+fork and is replaced\&. The shell does not invoke \fBTRAPEXIT\fP, nor does it -+source \fBzlogout\fP files\&. -+The options are provided for compatibility with other shells\&. -+.RS -+.PP -+The \fB\-c\fP option clears the environment\&. -+.PP -+The \fB\-l\fP option is equivalent to the \fB\-\fP precommand modifier, to -+treat the replacement command as a login shell; the command is executed -+with a \fB\-\fP prepended to its \fBargv[0]\fP string\&. This flag has no effect -+if used together with the \fB\-a\fP option\&. -+.PP -+The \fB\-a\fP option is used to specify explicitly the \fBargv[0]\fP string -+(the name of the command as seen by the process itself) to be used by the -+replacement command and is directly equivalent to setting a value -+for the \fBARGV0\fP environment variable\&. -+.RE -+.TP -+\fBnocorrect\fP -+Spelling correction is not done on any of the words\&. This must appear -+before any other precommand modifier, as it is interpreted immediately, -+before any parsing is done\&. It has no effect in non\-interactive shells\&. -+.TP -+\fBnoglob\fP -+Filename generation (globbing) is not performed on any of -+the words\&. -+.SH "COMPLEX COMMANDS" -+A \fIcomplex command\fP in zsh is one of the following: -+.PP -+.PD 0 -+.TP -+.PD -+\fBif\fP \fIlist\fP \fBthen\fP \fIlist\fP [ \fBelif\fP \fIlist\fP \fBthen\fP \fIlist\fP ] \&.\&.\&. [ \fBelse\fP \fIlist\fP ] \fBfi\fP -+The \fBif\fP \fIlist\fP is executed, and if it returns a zero exit status, -+the \fBthen\fP \fIlist\fP is executed\&. -+Otherwise, the \fBelif\fP \fIlist\fP is executed and if its status is zero, -+the \fBthen\fP \fIlist\fP is executed\&. -+If each \fBelif\fP \fIlist\fP returns nonzero status, the \fBelse\fP \fIlist\fP -+is executed\&. -+.TP -+\fBfor\fP \fIname\fP \&.\&.\&. [ \fBin\fP \fIword\fP \&.\&.\&. ] \fIterm\fP \fBdo\fP \fIlist\fP \fBdone\fP -+where \fIterm\fP is at least one newline or \fB;\fP\&. -+Expand the list of \fIword\fPs, and set the parameter -+\fIname\fP to each of them in turn, executing -+\fIlist\fP each time\&. If the \fBin\fP \fIword\fP is omitted, -+use the positional parameters instead of the \fIword\fPs\&. -+.RS -+.PP -+More than one parameter \fIname\fP can appear before the list of -+\fIword\fPs\&. If \fIN\fP \fIname\fPs are given, then on each execution of the -+loop the next \fBN\fP \fIword\fPs are assigned to the corresponding -+parameters\&. If there are more \fIname\fPs than remaining \fIword\fPs, the -+remaining parameters are each set to the empty string\&. Execution of the -+loop ends when there is no remaining \fIword\fP to assign to the first -+\fIname\fP\&. It is only possible for \fBin\fP to appear as the first \fIname\fP -+in the list, else it will be treated as marking the end of the list\&. -+.RE -+.TP -+\fBfor ((\fP [\fIexpr1\fP] \fB;\fP [\fIexpr2\fP] \fB;\fP [\fIexpr3\fP] \fB)) do\fP \fIlist\fP \fBdone\fP -+The arithmetic expression \fIexpr1\fP is evaluated first (see -+the section `Arithmetic Evaluation\&')\&. The arithmetic expression -+\fIexpr2\fP is repeatedly evaluated until it evaluates to zero and -+when non\-zero, \fIlist\fP is executed and the arithmetic expression -+\fIexpr3\fP evaluated\&. If any expression is omitted, then it behaves -+as if it evaluated to 1\&. -+.TP -+\fBwhile\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP -+Execute the \fBdo\fP \fIlist\fP as long as the \fBwhile\fP \fIlist\fP -+returns a zero exit status\&. -+.TP -+\fBuntil\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP -+Execute the \fBdo\fP \fIlist\fP as long as \fBuntil\fP \fIlist\fP -+returns a nonzero exit status\&. -+.TP -+\fBrepeat\fP \fIword\fP \fBdo\fP \fIlist\fP \fBdone\fP -+\fIword\fP is expanded and treated as an arithmetic expression, -+which must evaluate to a number \fIn\fP\&. -+\fIlist\fP is then executed \fIn\fP times\&. -+.RS -+.PP -+The \fBrepeat\fP syntax is disabled by default when the -+shell starts in a mode emulating another shell\&. It can be enabled -+with the command `\fBenable \-r repeat\fP\&' -+.RE -+.TP -+\fBcase\fP \fIword\fP \fBin\fP [ [\fB(\fP] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \&.\&.\&. \fB)\fP \fIlist\fP (\fB;;\fP|\fB;&\fP|\fB;|\fP) ] \&.\&.\&. \fBesac\fP -+Execute the \fIlist\fP associated with the first \fIpattern\fP -+that matches \fIword\fP, if any\&. The form of the patterns -+is the same as that used for filename generation\&. See -+the section `Filename Generation\&'\&. -+.RS -+.PP -+If the \fIlist\fP that is executed is terminated with \fB;&\fP rather than -+\fB;;\fP, the following list is also executed\&. The rule for -+the terminator of the following list \fB;;\fP, \fB;&\fP or \fB;|\fP is -+applied unless the \fBesac\fP is reached\&. -+.PP -+If the \fIlist\fP that is executed is terminated with \fB;|\fP the -+shell continues to scan the \fIpattern\fPs looking for the next match, -+executing the corresponding \fIlist\fP, and applying the rule for -+the corresponding terminator \fB;;\fP, \fB;&\fP or \fB;|\fP\&. -+Note that \fIword\fP is not re\-expanded; all applicable \fIpattern\fPs -+are tested with the same \fIword\fP\&. -+.RE -+.TP -+\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP \&.\&.\&. \fIterm\fP ] \fBdo\fP \fIlist\fP \fBdone\fP -+where \fIterm\fP is one or more newline or \fB;\fP to terminate the \fIword\fPs\&. -+Print the set of \fIword\fPs, each preceded by a number\&. -+If the \fBin\fP \fIword\fP is omitted, use the positional parameters\&. -+The \fBPROMPT3\fP prompt is printed and a line is read from the line editor -+if the shell is interactive and that is active, or else standard input\&. -+If this line consists of the -+number of one of the listed \fIword\fPs, then the parameter \fIname\fP -+is set to the \fIword\fP corresponding to this number\&. -+If this line is empty, the selection list is printed again\&. -+Otherwise, the value of the parameter \fIname\fP is set to null\&. -+The contents of the line read from standard input is saved -+in the parameter \fBREPLY\fP\&. \fIlist\fP is executed -+for each selection until a break or end\-of\-file is encountered\&. -+.TP -+\fB(\fP \fIlist\fP \fB)\fP -+Execute \fIlist\fP in a subshell\&. Traps set by the \fBtrap\fP builtin -+are reset to their default values while executing \fIlist\fP\&. -+.TP -+\fB{\fP \fIlist\fP \fB}\fP -+Execute \fIlist\fP\&. -+.TP -+\fB{\fP \fItry\-list\fP \fB} always {\fP \fIalways\-list\fP \fB}\fP -+First execute \fItry\-list\fP\&. Regardless of errors, or \fBbreak\fP, -+\fBcontinue\fP, or \fBreturn\fP commands encountered within \fItry\-list\fP, -+execute \fIalways\-list\fP\&. Execution then continues from the -+result of the execution of \fItry\-list\fP; in other words, any error, -+or \fBbreak\fP, \fBcontinue\fP, or \fBreturn\fP command is treated in the -+normal way, as if \fIalways\-list\fP were not present\&. The two -+chunks of code are referred to as the `try block\&' and the `always block'\&. -+.RS -+.PP -+Optional newlines or semicolons may appear after the \fBalways\fP; -+note, however, that they may \fInot\fP appear between the preceding -+closing brace and the \fBalways\fP\&. -+.PP -+An `error\&' in this context is a condition such as a syntax error which -+causes the shell to abort execution of the current function, script, or -+list\&. Syntax errors encountered while the shell is parsing the -+code do not cause the \fIalways\-list\fP to be executed\&. For example, -+an erroneously constructed \fBif\fP block in \fBtry\-list\fP would cause the -+shell to abort during parsing, so that \fBalways\-list\fP would not be -+executed, while an erroneous substitution such as \fB${*foo*}\fP would -+cause a run\-time error, after which \fBalways\-list\fP would be executed\&. -+.PP -+An error condition can be tested and reset with the special integer -+variable \fBTRY_BLOCK_ERROR\fP\&. Outside an \fBalways\-list\fP the value is -+irrelevant, but it is initialised to \fB\-1\fP\&. Inside \fBalways\-list\fP, the -+value is 1 if an error occurred in the \fBtry\-list\fP, else 0\&. If -+\fBTRY_BLOCK_ERROR\fP is set to 0 during the \fBalways\-list\fP, the error -+condition caused by the \fBtry\-list\fP is reset, and shell execution -+continues normally after the end of \fBalways\-list\fP\&. Altering the value -+during the \fBtry\-list\fP is not useful (unless this forms part of an -+enclosing \fBalways\fP block)\&. -+.PP -+Regardless of \fBTRY_BLOCK_ERROR\fP, after the end of \fBalways\-list\fP the -+normal shell status \fB$?\fP is the value returned from \fBalways\-list\fP\&. -+This will be non\-zero if there was an error, even if \fBTRY_BLOCK_ERROR\fP -+was set to zero\&. -+.PP -+The following executes the given code, ignoring any errors it causes\&. -+This is an alternative to the usual convention of protecting code by -+executing it in a subshell\&. -+.PP -+.RS -+.nf -+\fB{ -+ # code which may cause an error -+ } always { -+ # This code is executed regardless of the error\&. -+ (( TRY_BLOCK_ERROR = 0 )) -+} -+# The error condition has been reset\&.\fP -+.fi -+.RE -+.PP -+An \fBexit\fP command (or a \fBreturn\fP command executed at the outermost -+function level of a script) encountered in \fBtry\-list\fP does \fInot\fP cause -+the execution of \fIalways\-list\fP\&. Instead, the shell exits immediately -+after any \fBEXIT\fP trap has been executed\&. -+.RE -+.TP -+.PD 0 -+\fBfunction\fP \fIword\fP \&.\&.\&. [ \fB()\fP ] [ \fIterm\fP ] \fB{\fP \fIlist\fP \fB}\fP -+.TP -+.PD 0 -+\fIword\fP \&.\&.\&. \fB()\fP [ \fIterm\fP ] \fB{\fP \fIlist\fP \fB}\fP -+.TP -+.PD -+\fIword\fP \&.\&.\&. \fB()\fP [ \fIterm\fP ] \fIcommand\fP -+where \fIterm\fP is one or more newline or \fB;\fP\&. -+Define a function which is referenced by any one of \fIword\fP\&. -+Normally, only one \fIword\fP is provided; multiple \fIword\fPs -+are usually only useful for setting traps\&. -+The body of the function is the \fIlist\fP between -+the \fB{\fP and \fB}\fP\&. See the section `Functions\&'\&. -+.RS -+.PP -+If the option \fBSH_GLOB\fP is set for compatibility with other shells, then -+whitespace may appear between between the left and right parentheses when -+there is a single \fIword\fP; otherwise, the parentheses will be treated as -+forming a globbing pattern in that case\&. -+.RE -+.TP -+\fBtime\fP [ \fIpipeline\fP ] -+The \fIpipeline\fP is executed, and timing statistics are -+reported on the standard error in the form specified -+by the \fBTIMEFMT\fP parameter\&. -+If \fIpipeline\fP is omitted, print statistics about the -+shell process and its children\&. -+.TP -+\fB[[\fP \fIexp\fP \fB]]\fP -+Evaluates the conditional expression \fIexp\fP -+and return a zero exit status if it is true\&. -+See the section `Conditional Expressions\&' -+for a description of \fIexp\fP\&. -+.SH "ALTERNATE FORMS FOR COMPLEX COMMANDS" -+Many of zsh\&'s complex commands have alternate forms\&. These are -+non\-standard and are likely not to be obvious even to seasoned shell -+programmers; they should not be used anywhere that portability of shell -+code is a concern\&. -+.PP -+The short versions below only work if \fIsublist\fP is of the form `\fB{\fP -+\fIlist\fP \fB}\fP\&' or if the \fBSHORT_LOOPS\fP option is set\&. For the \fBif\fP, -+\fBwhile\fP and \fBuntil\fP commands, in both these cases the test part of the -+loop must also be suitably delimited, such as by `\fB[[ \&.\&.\&. ]]\fP\&' or `\fB(( -+\&.\&.\&. ))\fP\&', else the end of the test will not be recognized\&. For the -+\fBfor\fP, \fBrepeat\fP, \fBcase\fP and \fBselect\fP commands no such special form -+for the arguments is necessary, but the other condition (the special form -+of \fIsublist\fP or use of the \fBSHORT_LOOPS\fP option) still applies\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBif\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP [ \fBelif\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP ] \&.\&.\&. [ \fBelse {\fP \fIlist\fP \fB}\fP ] -+An alternate form of \fBif\fP\&. The rules mean that -+.RS -+.PP -+.RS -+.nf -+\fBif [[ \-o ignorebraces ]] { -+ print yes -+}\fP -+.fi -+.RE -+.PP -+works, but -+.PP -+.RS -+.nf -+\fBif true { # Does not work! -+ print yes -+} -+\fP -+.fi -+.RE -+.PP -+does \fInot\fP, since the test is not suitably delimited\&. -+.RE -+.TP -+\fBif\fP \fIlist\fP \fIsublist\fP -+A short form of the alternate `if\&'\&. The same limitations on the form of -+\fIlist\fP apply as for the previous form\&. -+.TP -+\fBfor\fP \fIname\fP \&.\&.\&. \fB(\fP \fIword\fP \&.\&.\&. \fB)\fP \fIsublist\fP -+A short form of \fBfor\fP\&. -+.TP -+\fBfor\fP \fIname\fP \&.\&.\&. [ \fBin\fP \fIword\fP \&.\&.\&. ] \fIterm\fP \fIsublist\fP -+where \fIterm\fP is at least one newline or \fB;\fP\&. -+Another short form of \fBfor\fP\&. -+.TP -+\fBfor ((\fP [\fIexpr1\fP] \fB;\fP [\fIexpr2\fP] \fB;\fP [\fIexpr3\fP] \fB))\fP \fIsublist\fP -+A short form of the arithmetic \fBfor\fP command\&. -+.TP -+\fBforeach\fP \fIname\fP \&.\&.\&. \fB(\fP \fIword\fP \&.\&.\&. \fB)\fP \fIlist\fP \fBend\fP -+Another form of \fBfor\fP\&. -+.TP -+\fBwhile\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP -+An alternative form of \fBwhile\fP\&. Note the limitations on the form of -+\fIlist\fP mentioned above\&. -+.TP -+\fBuntil\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP -+An alternative form of \fBuntil\fP\&. Note the limitations on the form of -+\fIlist\fP mentioned above\&. -+.TP -+\fBrepeat\fP \fIword\fP \fIsublist\fP -+This is a short form of \fBrepeat\fP\&. -+.TP -+\fBcase\fP \fIword\fP \fB{\fP [ [\fB(\fP] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \&.\&.\&. \fB)\fP \fIlist\fP (\fB;;\fP|\fB;&\fP|\fB;|\fP) ] \&.\&.\&. \fB}\fP -+An alternative form of \fBcase\fP\&. -+.TP -+\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP \fIterm\fP ] \fIsublist\fP -+where \fIterm\fP is at least one newline or \fB;\fP\&. -+A short form of \fBselect\fP\&. -+.SH "RESERVED WORDS" -+The following words are recognized as reserved words when used as the first -+word of a command unless quoted or disabled using \fBdisable \-r\fP: -+.PP -+\fBdo done esac then elif else fi for case -+if while function repeat time until -+select coproc nocorrect foreach end ! [[ { }\fP -+.PP -+Additionally, `\fB}\fP\&' is recognized in any position if the \fBIGNORE_BRACES\fP option -+is not set\&. -+.SH "COMMENTS" -+In non\-interactive shells, or in interactive shells with the -+\fBINTERACTIVE_COMMENTS\fP option set, a word beginning -+with the third character of the \fBhistchars\fP parameter -+(`\fB#\fP\&' by default) causes that word and all the following -+characters up to a newline to be ignored\&. -+.SH "ALIASING" -+Every token in the shell input is checked to see if there -+is an alias defined for it\&. -+If so, it is replaced by the text of the alias if it is in command -+position (if it could be the first word of a simple command), -+or if the alias is global\&. -+If the text ends with a space, the next word in the shell input -+is treated as though it were in command position for purposes of alias -+expansion\&. -+An alias is defined using the \fBalias\fP builtin; global aliases -+may be defined using the \fB\-g\fP option to that builtin\&. -+.PP -+Alias expansion is done on the shell input before any other expansion -+except history expansion\&. Therefore, if an alias is defined for the -+word \fBfoo\fP, alias expansion may be avoided by quoting part of the -+word, e\&.g\&. \fB\efoo\fP\&. Any form of quoting works, although there is -+nothing to prevent an alias being defined for the quoted form such as -+\fB\efoo\fP as well\&. For use with completion, which would remove an -+initial backslash followed by a character that isn\&'t special, it may be -+more convenient to quote the word by starting with a single quote, -+i\&.e\&. \fB\&'foo\fP; completion will automatically add the trailing single -+quote\&. -+.PP -+There is a commonly encountered problem with aliases -+illustrated by the following code: -+.PP -+.RS -+.nf -+\fBalias echobar=\&'echo bar'; echobar\fP -+.fi -+.RE -+.PP -+This prints a message that the command \fBechobar\fP could not be found\&. -+This happens because aliases are expanded when the code is read in; -+the entire line is read in one go, so that when \fBechobar\fP is executed it -+is too late to expand the newly defined alias\&. This is often -+a problem in shell scripts, functions, and code executed with `\fBsource\fP\&' -+or `\fB\&.\fP\&'\&. Consequently, use of functions rather than aliases is -+recommended in non\-interactive code\&. -+.PP -+Note also the unhelpful interaction of aliases and function definitions: -+.PP -+.RS -+.nf -+\fBalias func=\&'noglob func' -+func() { -+ echo Do something with $* -+}\fP -+.fi -+.RE -+.PP -+Because aliases are expanded in function defintions, this causes the -+following command to be executed: -+.PP -+.RS -+.nf -+\fBnoglob func() { -+ echo Do something with $* -+}\fP -+.fi -+.RE -+.PP -+which defines \fBnoglob\fP as well as \fBfunc\fP as functions with the -+body given\&. To avoid this, either quote the name \fBfunc\fP or use the -+alternative function definition form `\fBfunction func\fP\&'\&. Ensuring the -+alias is defined after the function works but is problematic if the -+code fragment might be re\-executed\&. -+.PP -+.SH "QUOTING" -+A character may be \fIquoted\fP (that is, made -+to stand for itself) by preceding it with a `\fB\e\fP\&'\&. -+`\fB\e\fP\&' followed by a newline is ignored\&. -+.PP -+A string enclosed between `\fB$\&'\fP' and `\fB'\fP' is -+processed the same way as the string arguments of the -+\fBprint\fP builtin, and the resulting string is considered to be -+entirely quoted\&. A literal `\fB\&'\fP' character can be included in the -+string by using the `\fB\e\&'\fP' escape\&. -+.PP -+All characters enclosed between a pair of single quotes (\fB\&''\fP) that -+is not preceded by a `\fB$\fP\&' are quoted\&. A single quote cannot appear -+within single quotes unless the option \fBRC_QUOTES\fP is set, in which case -+a pair of single quotes are turned into a single quote\&. For example, -+.PP -+.RS -+.nf -+\fBprint \&''''\fP -+.fi -+.RE -+.PP -+outputs nothing apart from a newline if \fBRC_QUOTES\fP is not set, but one -+single quote if it is set\&. -+.PP -+Inside double quotes (\fB""\fP), parameter and -+command substitution occur, and `\fB\e\fP\&' quotes the characters -+`\fB\e\fP\&', `\fB`\fP', `\fB"\fP', and `\fB$\fP'\&. -+.\" Yodl file: Zsh/redirect.yo -+.SH "REDIRECTION" -+If a command is followed by \fB&\fP -+and job control is not active, -+then the default standard input -+for the command is the empty file \fB/dev/null\fP\&. -+Otherwise, the environment for the execution of a command contains the -+file descriptors of the invoking shell as modified by -+input/output specifications\&. -+.PP -+The following may appear anywhere in a simple command -+or may precede or follow a complex command\&. -+Expansion occurs before \fIword\fP or \fIdigit\fP -+is used except as noted below\&. -+If the result of substitution on \fIword\fP -+produces more than one filename, -+redirection occurs for each -+separate filename in turn\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB<\fP \fIword\fP -+Open file \fIword\fP for reading as standard input\&. -+.TP -+\fB<>\fP \fIword\fP -+Open file \fIword\fP for reading and writing as standard input\&. -+If the file does not exist then it is created\&. -+.TP -+\fB>\fP \fIword\fP -+Open file \fIword\fP for writing as standard output\&. -+If the file does not exist then it is created\&. -+If the file exists, and the \fBCLOBBER\fP option is unset, -+this causes an error; -+otherwise, it is truncated to zero length\&. -+.TP -+.PD 0 -+\fB>|\fP \fIword\fP -+.TP -+.PD -+\fB>!\fP \fIword\fP -+Same as \fB>\fP, except that the file is truncated to zero length -+if it exists, even if \fBCLOBBER\fP is unset\&. -+.TP -+\fB>>\fP \fIword\fP -+Open file \fIword\fP for writing in append mode as standard output\&. -+If the file does not exist, and the \fBCLOBBER\fP -+option is unset, this causes an error; -+otherwise, the file is created\&. -+.TP -+.PD 0 -+\fB>>|\fP \fIword\fP -+.TP -+.PD -+\fB>>!\fP \fIword\fP -+Same as \fB>>\fP, except that the file is created if it does not -+exist, even if \fBCLOBBER\fP is unset\&. -+.TP -+\fB<<\fP[\fB\-\fP] \fIword\fP -+The shell input is read up to a line that is the same as -+\fIword\fP, or to an end\-of\-file\&. -+No parameter expansion, command substitution or -+filename generation is performed on \fIword\fP\&. -+The resulting document, called a -+\fIhere\-document\fP, becomes the standard input\&. -+.RS -+.PP -+If any character of \fIword\fP is quoted with -+single or double quotes or a `\fB\e\fP\&', -+no interpretation is placed upon the characters of the document\&. -+Otherwise, parameter and command substitution -+occurs, `\fB\e\fP\&' followed by a newline is removed, -+and `\fB\e\fP\&' must be used to quote the characters -+`\fB\e\fP\&', `\fB$\fP', `\fB`\fP' and the first character of \fIword\fP\&. -+.PP -+Note that \fIword\fP itself does not undergo shell expansion\&. Backquotes -+in \fIword\fP do not have their usual effect; instead they behave -+similarly to double quotes, except that the backquotes themselves are -+passed through unchanged\&. (This information is given for completeness -+and it is not recommended that backquotes be used\&.) Quotes in the form -+\fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP have their standard effect of expanding backslashed -+references to special characters\&. -+.PP -+If \fB<<\-\fP is used, then all leading -+tabs are stripped from \fIword\fP and from the document\&. -+.RE -+.TP -+\fB<<<\fP \fIword\fP -+Perform shell expansion on \fIword\fP and pass the result -+to standard input\&. This is known as a \fIhere\-string\fP\&. -+Compare the use of \fIword\fP in here\-documents above, where \fIword\fP -+does not undergo shell expansion\&. -+.TP -+.PD 0 -+\fB<&\fP \fInumber\fP -+.TP -+.PD -+\fB>&\fP \fInumber\fP -+The standard input/output is duplicated from file descriptor -+\fInumber\fP (see \fIdup2\fP(2))\&. -+.TP -+.PD 0 -+\fB<& \-\fP -+.TP -+.PD -+\fB>& \-\fP -+Close the standard input/output\&. -+.TP -+.PD 0 -+\fB<& p\fP -+.TP -+.PD -+\fB>& p\fP -+The input/output from/to the coprocess is moved to the standard input/output\&. -+.TP -+.PD 0 -+\fB>&\fP \fIword\fP -+.TP -+.PD -+\fB&>\fP \fIword\fP -+(Except where `\fB>&\fP \fIword\fP\&' matches one of the above syntaxes; -+`\fB&>\fP\&' can always be used to avoid this ambiguity\&.) -+Redirects both standard output and standard error (file descriptor 2) -+in the manner of `\fB>\fP \fIword\fP\&'\&. -+Note that this does \fInot\fP have the same effect as `\fB>\fP \fIword\fP \fB2>&1\fP\&' -+in the presence of multios (see the section below)\&. -+.TP -+.PD 0 -+\fB>&|\fP \fIword\fP -+.TP -+.PD 0 -+\fB>&!\fP \fIword\fP -+.TP -+.PD 0 -+\fB&>|\fP \fIword\fP -+.TP -+.PD -+\fB&>!\fP \fIword\fP -+Redirects both standard output and standard error (file descriptor 2) -+in the manner of `\fB>|\fP \fIword\fP\&'\&. -+.TP -+.PD 0 -+\fB>>&\fP \fIword\fP -+.TP -+.PD -+\fB&>>\fP \fIword\fP -+Redirects both standard output and standard error (file descriptor 2) -+in the manner of `\fB>>\fP \fIword\fP\&'\&. -+.TP -+.PD 0 -+\fB>>&|\fP \fIword\fP -+.TP -+.PD 0 -+\fB>>&!\fP \fIword\fP -+.TP -+.PD 0 -+\fB&>>|\fP \fIword\fP -+.TP -+.PD -+\fB&>>!\fP \fIword\fP -+Redirects both standard output and standard error (file descriptor 2) -+in the manner of `\fB>>|\fP \fIword\fP\&'\&. -+.PP -+If one of the above is preceded by a digit, then the file -+descriptor referred to is that specified by the digit -+instead of the default 0 or 1\&. -+The order in which redirections are specified is significant\&. -+The shell evaluates each redirection in terms of the -+(\fIfile descriptor\fP, \fIfile\fP) -+association at the time of evaluation\&. -+For example: -+.PP -+.RS -+.nf -+\&.\&.\&. \fB1>\fP\fIfname\fP \fB2>&1\fP -+.fi -+.RE -+.PP -+first associates file descriptor 1 with file \fIfname\fP\&. -+It then associates file descriptor 2 with the file associated with file -+descriptor 1 (that is, \fIfname\fP)\&. -+If the order of redirections were reversed, -+file descriptor 2 would be associated -+with the terminal (assuming file descriptor 1 had been) -+and then file descriptor 1 would be associated with file \fIfname\fP\&. -+.PP -+If instead of a digit one of the operators above is preceded by -+a valid identifier enclosed in braces, the shell will open a new -+file descriptor that is guaranteed to be at least 10 and set the -+parameter named by the identifier to the file descriptor opened\&. -+No whitespace is allowed between the closing brace and the redirection -+character\&. The option \fBIGNORE_BRACES\fP must not be set\&. -+For example: -+.PP -+.RS -+.nf -+\&.\&.\&. {myfd}>&1 -+.fi -+.RE -+.PP -+This opens a new file descriptor that is a duplicate of file descriptor -+1 and sets the parameter \fBmyfd\fP to the number of the file descriptor, -+which will be at least 10\&. The new file descriptor can be written to using -+the syntax \fB>&$myfd\fP\&. -+.PP -+The syntax \fB{\fP\fIvarid\fP\fB}>&\-\fP, for example \fB{myfd}>&\-\fP, may be used -+to close a file descriptor opened in this fashion\&. Note that the -+parameter given by \fIvarid\fP must previously be set to a file descriptor -+in this case\&. -+.PP -+It is an error to open or close a file descriptor in this fashion when the -+parameter is readonly\&. However, it is not an error to read or write a file -+descriptor using \fB<&$\fP\fIparam\fP or \fB>&$\fP\fIparam\fP if \fIparam\fP is -+readonly\&. -+.PP -+If the option \fBCLOBBER\fP is unset, it is an error to open a file -+descriptor using a parameter that is already set to an open file descriptor -+previously allocated by this mechanism\&. Unsetting the parameter before -+using it for allocating a file descriptor avoids the error\&. -+.PP -+Note that this mechanism merely allocates or closes a file descriptor; it -+does not perform any redirections from or to it\&. It is usually convenient -+to allocate a file descriptor prior to use as an argument to \fBexec\fP\&. The -+following shows a typical sequence of allocation, use, and closing of a -+file descriptor: -+.PP -+.RS -+.nf -+\fBinteger myfd -+exec {myfd}>~/logs/mylogfile\&.txt -+print This is a log message\&. >&$myfd -+exec {myfd}>&\-\fP -+.fi -+.RE -+.PP -+Note that the expansion of the variable in the expression \fB>&$myfd\fP -+occurs at the point the redirection is opened\&. This is after the expansion -+of command arguments and after any redirections to the left on the command -+line have been processed\&. -+.PP -+The `\fB|&\fP\&' command separator described in -+\fISimple Commands & Pipelines\fP in \fIzshmisc\fP(1) -+is a shorthand for `\fB2>&1 |\fP\&'\&. -+.PP -+The various forms of process substitution, `\fB<(\fP\fIlist\fP\fB)\fP\&', -+and `\fB=(\fP\fIlist\fP())\&' for input and -+`\fB>(\fP\fIlist\fP\fB)\fP\&' for output, are often used together with -+redirection\&. For example, if \fIword\fP in an output redirection is of the -+form `\fB>(\fP\fIlist\fP\fB)\fP\&' then the output is piped to the -+command represented by \fIlist\fP\&. See -+\fIProcess Substitution\fP in \fIzshexpn\fP(1)\&. -+.SH "MULTIOS" -+If the user tries to open a file descriptor for writing more than once, -+the shell opens the file descriptor as a pipe to a process that copies -+its input to all the specified outputs, similar to \fBtee\fP, -+provided the \fBMULTIOS\fP option is set, as it is by default\&. Thus: -+.PP -+.RS -+.nf -+\fBdate >foo >bar\fP -+.fi -+.RE -+.PP -+writes the date to two files, named `\fBfoo\fP\&' and `\fBbar\fP'\&. -+Note that a pipe is an implicit redirection; thus -+.PP -+.RS -+.nf -+\fBdate >foo | cat\fP -+.fi -+.RE -+.PP -+writes the date to the file `\fBfoo\fP\&', and also pipes it to cat\&. -+.PP -+If the \fBMULTIOS\fP -+option is set, the word after a redirection operator is also subjected -+to filename generation (globbing)\&. Thus -+.PP -+.RS -+.nf -+\fB: > *\fP -+.fi -+.RE -+.PP -+will truncate all files in the current directory, -+assuming there\&'s at least one\&. (Without the \fBMULTIOS\fP -+option, it would create an empty file called `\fB*\fP\&'\&.) -+Similarly, you can do -+.PP -+.RS -+.nf -+\fBecho exit 0 >> *\&.sh\fP -+.fi -+.RE -+.PP -+If the user tries to open a file descriptor for reading more than once, -+the shell opens the file descriptor as a pipe to a process that copies -+all the specified inputs to its output in the order -+specified, similar to \fBcat\fP, -+provided the \fBMULTIOS\fP option is set\&. Thus -+.PP -+.RS -+.nf -+\fBsort &$myfd\fP\&. -+.PP -+Note that a pipe is an implicit redirection; thus -+.PP -+.RS -+.nf -+\fBcat bar | sort bar > baz\fP -+.fi -+.RE -+.PP -+when \fBMULTIOS\fP is unset will truncate bar, and write `\fBfoo\fP\&' into baz\&. -+.PP -+There is a problem when an output multio is attached to an external -+program\&. A simple example shows this: -+.PP -+.RS -+.nf -+\fBcat file >file1 >file2 -+cat file1 file2\fP -+.fi -+.RE -+.PP -+Here, it is possible that the second `\fBcat\fP\&' will not display the full -+contents of \fBfile1\fP and \fBfile2\fP (i\&.e\&. the original contents of -+\fBfile\fP repeated twice)\&. -+.PP -+The reason for this is that the multios are spawned after the \fBcat\fP -+process is forked from the parent shell, so the parent shell does not -+wait for the multios to finish writing data\&. This means the command as -+shown can exit before \fBfile1\fP and \fBfile2\fP are completely written\&. -+As a workaround, it is possible to run the \fBcat\fP process as part of a -+job in the current shell: -+.PP -+.RS -+.nf -+\fB{ cat file } >file >file2\fP -+.fi -+.RE -+.PP -+Here, the \fB{\fP\fI\&.\&.\&.\fP\fB}\fP job will pause to wait for both files to be -+written\&. -+.PP -+.SH "REDIRECTIONS WITH NO COMMAND" -+When a simple command consists of one or more redirection operators -+and zero or more parameter assignments, but no command name, zsh can -+behave in several ways\&. -+.PP -+If the parameter \fBNULLCMD\fP is not set or the option \fBCSH_NULLCMD\fP is -+set, an error is caused\&. This is the \fBcsh\fP behavior and \fBCSH_NULLCMD\fP -+is set by default when emulating \fBcsh\fP\&. -+.PP -+If the option \fBSH_NULLCMD\fP is set, the builtin `\fB:\fP\&' is inserted as a -+command with the given redirections\&. This is the default when emulating -+\fBsh\fP or \fBksh\fP\&. -+.PP -+Otherwise, if the parameter \fBNULLCMD\fP is set, its value will be used as a -+command with the given redirections\&. If both \fBNULLCMD\fP and -+\fBREADNULLCMD\fP are set, then the value of the latter will be used instead -+of that of the former when the redirection is an input\&. The default for -+\fBNULLCMD\fP is `\fBcat\fP\&' and for \fBREADNULLCMD\fP is `\fBmore\fP'\&. Thus -+.PP -+.RS -+.nf -+\fB< file\fP -+.fi -+.RE -+.PP -+shows the contents of \fBfile\fP on standard output, with paging if that is a -+terminal\&. \fBNULLCMD\fP and \fBREADNULLCMD\fP may refer to shell functions\&. -+.PP -+.\" Yodl file: Zsh/exec.yo -+.SH "COMMAND EXECUTION" -+If a command name contains no slashes, the shell attempts to locate -+it\&. If there exists a shell function by that name, the function -+is invoked as described in the section `Functions\&'\&. If there exists -+a shell builtin by that name, the builtin is invoked\&. -+.PP -+Otherwise, the shell searches each element of \fB$path\fP for a -+directory containing an executable file by that name\&. If the -+search is unsuccessful, the shell prints an error message and returns -+a nonzero exit status\&. -+.PP -+If execution fails because the file is not in executable format, -+and the file is not a directory, it is assumed to be a shell -+script\&. \fB/bin/sh\fP is spawned to execute it\&. If the program -+is a file beginning with `\fB#!\fP\&', the remainder of the first line -+specifies an interpreter for the program\&. The shell will -+execute the specified interpreter on operating systems that do -+not handle this executable format in the kernel\&. -+.PP -+If no external command is found but a function \fBcommand_not_found_handler\fP -+exists the shell executes this function with all -+command line arguments\&. The function should return status zero if it -+successfully handled the command, or non\-zero status if it failed\&. -+In the latter case the standard handling is applied: `command not -+found\&' is printed to standard error and the shell exits with status 127\&. -+Note that the handler is executed in a subshell forked to execute -+an external command, hence changes to directories, shell parameters, -+etc\&. have no effect on the main shell\&. -+.\" Yodl file: Zsh/func.yo -+.SH "FUNCTIONS" -+Shell functions are defined with the \fBfunction\fP reserved word or the -+special syntax `\fIfuncname\fP \fB()\fP\&'\&. -+Shell functions are read in and stored internally\&. -+Alias names are resolved when the function is read\&. -+Functions are executed like commands with the arguments -+passed as positional parameters\&. -+(See the section `Command Execution\&'\&.) -+.PP -+Functions execute in the same process as the caller and -+share all files -+and present working directory with the -+caller\&. A trap on \fBEXIT\fP set inside a function -+is executed after the function completes in the environment -+of the caller\&. -+.PP -+The \fBreturn\fP builtin is used to return from function calls\&. -+.PP -+Function identifiers can be listed with the \fBfunctions\fP builtin\&. -+Functions can be undefined with the \fBunfunction\fP builtin\&. -+.SH "AUTOLOADING FUNCTIONS" -+.PP -+A function can be marked as \fIundefined\fP using the \fBautoload\fP builtin -+(or `\fBfunctions \-u\fP\&' or `\fBtypeset \-fu\fP')\&. Such a function has no -+body\&. When the function is first executed, the shell searches for its -+definition using the elements of the \fBfpath\fP variable\&. Thus to define -+functions for autoloading, a typical sequence is: -+.PP -+.RS -+.nf -+\fBfpath=(~/myfuncs $fpath) -+autoload myfunc1 myfunc2 \&.\&.\&.\fP -+.fi -+.RE -+.PP -+The usual alias expansion during reading will be suppressed if the -+\fBautoload\fP builtin or its equivalent is given the option \fB\-U\fP\&. This is -+recommended for the use of functions supplied with the zsh distribution\&. -+Note that for functions precompiled with the \fBzcompile\fP builtin command -+the flag \fB\-U\fP must be provided when the \fB\&.zwc\fP file is created, as the -+corresponding information is compiled into the latter\&. -+.PP -+For each \fIelement\fP in \fBfpath\fP, the shell looks for three possible -+files, the newest of which is used to load the definition for the function: -+.PP -+.PD 0 -+.TP -+.PD -+\fIelement\fP\fB\&.zwc\fP -+A file created with the \fBzcompile\fP builtin command, which is expected to -+contain the definitions for all functions in the directory named -+\fIelement\fP\&. The file is treated in the same manner as a directory -+containing files for functions and is searched for the definition of the -+function\&. If the definition is not found, the search for a definition -+proceeds with the other two possibilities described below\&. -+.RS -+.PP -+If \fIelement\fP already includes a \fB\&.zwc\fP extension (i\&.e\&. the extension -+was explicitly given by the user), \fIelement\fP is searched for the -+definition of the function without comparing its age to that of other -+files; in fact, there does not need to be any directory named \fIelement\fP -+without the suffix\&. Thus including an element such as -+`\fB/usr/local/funcs\&.zwc\fP\&' in \fBfpath\fP will speed up the search for -+functions, with the disadvantage that functions included must be explicitly -+recompiled by hand before the shell notices any changes\&. -+.RE -+.TP -+\fIelement\fP\fB/\fP\fIfunction\fP\fB\&.zwc\fP -+A file created with \fBzcompile\fP, which is expected to contain the -+definition for \fIfunction\fP\&. It may include other function definitions -+as well, but those are neither loaded nor executed; a file found in this -+way is searched \fIonly\fP for the definition of \fIfunction\fP\&. -+.TP -+\fIelement\fP\fB/\fP\fIfunction\fP -+A file of zsh command text, taken to be the definition for \fIfunction\fP\&. -+.PP -+In summary, the order of searching is, first, in the \fIparents of\fP -+directories in \fBfpath\fP for the newer of either a compiled directory or -+a directory in \fBfpath\fP; second, if more than one of these contains a -+definition for the function that is sought, the leftmost in the \fBfpath\fP -+is chosen; and third, within a directory, the newer of either a compiled -+function or an ordinary function definition is used\&. -+.PP -+If the \fBKSH_AUTOLOAD\fP option is set, or the file contains only a -+simple definition of the function, the file\&'s contents will be executed\&. -+This will normally define the function in question, but may also perform -+initialization, which is executed in the context of the function execution, -+and may therefore define local parameters\&. It is an error if the function -+is not defined by loading the file\&. -+.PP -+Otherwise, the function body (with no surrounding `\fIfuncname\fP\fB() -+{\fP\fI\&.\&.\&.\fP\fB}\fP\&') is taken to be the complete contents of the file\&. This -+form allows the file to be used directly as an executable shell script\&. If -+processing of the file results in the function being re\-defined, the -+function itself is not re\-executed\&. To force the shell to perform -+initialization and then call the function defined, the file should contain -+initialization code (which will be executed then discarded) in addition to -+a complete function definition (which will be retained for subsequent calls -+to the function), and a call to the shell function, including any -+arguments, at the end\&. -+.PP -+For example, suppose the autoload file \fBfunc\fP contains -+.PP -+.RS -+.nf -+\fBfunc() { print This is func; } -+print func is initialized -+\fP -+.fi -+.RE -+.PP -+then `\fBfunc; func\fP\&' with \fBKSH_AUTOLOAD\fP set will produce both messages -+on the first call, but only the message `\fBThis is func\fP\&' on the second -+and subsequent calls\&. Without \fBKSH_AUTOLOAD\fP set, it will produce -+the initialization message on the first call, and the other message on the -+second and subsequent calls\&. -+.PP -+It is also possible to create a function that is not marked as autoloaded, -+but which loads its own definition by searching \fBfpath\fP, by using -+`\fBautoload \-X\fP\&' within a shell function\&. For example, the following are -+equivalent: -+.PP -+.RS -+.nf -+\fBmyfunc() { -+ autoload \-X -+} -+myfunc args\&.\&.\&.\fP -+.fi -+.RE -+.PP -+and -+.PP -+.RS -+.nf -+\fBunfunction myfunc # if myfunc was defined -+autoload myfunc -+myfunc args\&.\&.\&.\fP -+.fi -+.RE -+.PP -+In fact, the \fBfunctions\fP command outputs `\fBbuiltin autoload \-X\fP\&' as -+the body of an autoloaded function\&. This is done so that -+.PP -+.RS -+.nf -+\fBeval "$(functions)"\fP -+.fi -+.RE -+.PP -+produces a reasonable result\&. A true autoloaded function can be -+identified by the presence of the comment `\fB# undefined\fP\&' in the body, -+because all comments are discarded from defined functions\&. -+.PP -+To load the definition of an autoloaded function \fBmyfunc\fP without -+executing \fBmyfunc\fP, use: -+.PP -+.RS -+.nf -+\fBautoload +X myfunc\fP -+.fi -+.RE -+.PP -+.SH "ANONYMOUS FUNCTIONS" -+.PP -+If no name is given for a function, it is `anonymous\&' and is handled -+specially\&. Either form of function definition may be used: a `\fB()\fP\&' with -+no preceding name, or a `\fBfunction\fP\&' with an immediately following open -+brace\&. The function is executed immediately at the point of definition and -+is not stored for future use\&. The function name is set to `\fB(anon)\fP\&' and -+the parameter list passed to the function is empty\&. Note that this means -+the argument list of any enclosing script or function is hidden\&. -+Redirections may be applied to the anonymous function in the same manner as -+to a current\-shell structure enclosed in braces\&. The main use of anonymous -+functions is to provide a scope for local variables\&. This is particularly -+convenient in start\-up files as these do not provide their own local -+variable scope\&. -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBvariable=outside -+function { -+ local variable=inside -+ print "I am $variable" -+} -+print "I am $variable"\fP -+.fi -+.RE -+.PP -+outputs the following: -+.PP -+.RS -+.nf -+\fBI am inside -+I am outside\fP -+.fi -+.RE -+.PP -+Note that function definitions with arguments that expand to nothing, -+for example `\fBname=; function $name { \fP\fI\&.\&.\&.\fP\fB }\fP\&', are not -+treated as anonymous functions\&. Instead, they are treated as normal -+function definitions where the definition is silently discarded\&. -+.PP -+.SH "SPECIAL FUNCTIONS" -+Certain functions, if defined, have special meaning to the shell\&. -+.PP -+.SS "Hook Functions" -+.PP -+For the functions below, it is possible to define an array that has the -+same name as the function with `\fB_functions\fP\&' appended\&. Any element in -+such an array is taken as the name of a function to execute; it is executed -+in the same context and with the same arguments as the basic function\&. For -+example, if \fB$chpwd_functions\fP is an array containing the values -+`\fBmychpwd\fP\&', `\fBchpwd_save_dirstack\fP', then the shell attempts to -+execute the functions `\fBchpwd\fP\&', `\fBmychpwd\fP' and -+`\fBchpwd_save_dirstack\fP\&', in that order\&. Any function that does not exist -+is silently ignored\&. A function found by this mechanism is referred to -+elsewhere as a `hook function\&'\&. An error in any function causes subsequent -+functions not to be run\&. Note further that an error in a \fBprecmd\fP hook -+causes an immediately following \fBperiodic\fP function not to run (though -+it may run at the next opportunity)\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBchpwd\fP -+Executed whenever the current working directory is changed\&. -+.TP -+\fBperiodic\fP -+If the parameter \fBPERIOD\fP -+is set, this function is executed every \fB$PERIOD\fP -+seconds, just before a prompt\&. Note that if multiple functions -+are defined using the array \fBperiodic_functions\fP only one -+period is applied to the complete set of functions, and the -+scheduled time is not reset if the list of functions is altered\&. -+Hence the set of functions is always called together\&. -+.TP -+\fBprecmd\fP -+Executed before each prompt\&. Note that precommand functions are not -+re\-executed simply because the command line is redrawn, as happens, for -+example, when a notification about an exiting job is displayed\&. -+.TP -+\fBpreexec\fP -+Executed just after a command has been read and is about to be -+executed\&. If the history mechanism is active (and the line was not -+discarded from the history buffer), the string that the user typed is -+passed as the first argument, otherwise it is an empty string\&. The -+actual command that will be executed (including expanded aliases) is -+passed in two different forms: the second argument is a single\-line, -+size\-limited version of the command (with things like function bodies -+elided); the third argument contains the full text that is being -+executed\&. -+.TP -+\fBzshaddhistory\fP -+Executed when a history line has been read interactively, but -+before it is executed\&. The sole argument is the complete history -+line (so that any terminating newline will still be present)\&. -+.RS -+.PP -+If any of the hook functions return a non\-zero value the history -+line will not be saved, although it lingers in the history until the -+next line is executed allow you to reuse or edit it immediately\&. -+.PP -+A hook function may call `\fBfc \-p\fP \fI\&.\&.\&.\fP\&' to switch the history -+context so that the history is saved in a different file from the -+that in the global \fBHISTFILE\fP parameter\&. This is handled specially: -+the history context is automatically restored after the processing -+of the history line is finished\&. -+.PP -+The following example function first adds the history line to the normal -+history with the newline stripped, which is usually the correct behaviour\&. -+Then it switches the history context so that the line will -+be written to a history file in the current directory\&. -+.PP -+.RS -+.nf -+\fBzshaddhistory() { -+ print \-sr \-\- ${1%%$\&'\en'} -+ fc \-p \&.zsh_local_history -+}\fP -+.fi -+.RE -+.RE -+.TP -+\fBzshexit\fP -+Executed at the point where the main shell is about to exit normally\&. -+This is not called by exiting subshells, nor when the \fBexec\fP -+precommand modifier is used before an external command\&. Also, unlike -+\fBTRAPEXIT\fP, it is not called when functions exit\&. -+.PP -+.SS "Trap Functions" -+.PP -+The functions below are treated specially but do not have corresponding -+hook arrays\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBTRAP\fP\fINAL\fP -+If defined and non\-null, -+this function will be executed whenever the shell -+catches a signal \fBSIG\fP\fINAL\fP, where \fINAL\fP is a signal -+name as specified for the \fBkill\fP builtin\&. -+The signal number will be passed as the first parameter to the function\&. -+.RS -+.PP -+If a function of this form is defined and null, -+the shell and processes spawned by it will ignore \fBSIG\fP\fINAL\fP\&. -+.PP -+The return status from the function is handled specially\&. If it is -+zero, the signal is assumed to have been handled, and execution continues -+normally\&. Otherwise, the shell will behave as interrupted except that -+the return status of the trap is retained\&. -+.PP -+Programs terminated by uncaught signals typically return the status 128 -+plus the signal number\&. Hence the following causes the handler for -+\fBSIGINT\fP to print a message, then mimic the usual effect of the signal\&. -+.PP -+.RS -+.nf -+\fBTRAPINT() { -+ print "Caught SIGINT, aborting\&." -+ return $(( 128 + $1 )) -+}\fP -+.fi -+.RE -+.PP -+The functions \fBTRAPZERR\fP, \fBTRAPDEBUG\fP and \fBTRAPEXIT\fP are never -+executed inside other traps\&. -+.RE -+.TP -+\fBTRAPDEBUG\fP -+If the option \fBDEBUG_BEFORE_CMD\fP is set (as it is by default), executed -+before each command; otherwise executed after each command\&. See -+the description of the \fBtrap\fP builtin in -+\fIzshbuiltins\fP(1) for details of additional features provided -+in debug traps\&. -+.TP -+\fBTRAPEXIT\fP -+Executed when the shell exits, -+or when the current function exits if defined inside a function\&. -+The value of \fB$?\fP at the start of execution is the exit status of the -+shell or the return status of the function exiting\&. -+.TP -+\fBTRAPZERR\fP -+Executed whenever a command has a non\-zero exit status\&. However, the -+function is not executed if the command occurred in a sublist followed by -+`\fB&&\fP\&' or `\fB||\fP'; only the final command in a sublist of this type -+causes the trap to be executed\&. The function \fBTRAPERR\fP acts the same as -+\fBTRAPZERR\fP on systems where there is no \fBSIGERR\fP (this is the usual -+case)\&. -+.PP -+The functions beginning `\fBTRAP\fP\&' may alternatively be defined with the -+\fBtrap\fP builtin: this may be preferable for some uses\&. Setting a trap -+with one form removes any trap of the other form for the same signal; -+removing a trap in either form removes all traps for the same signal\&. -+The forms -+.PP -+.RS -+.nf -+\fBTRAPNAL() { -+ # code -+}\fP -+.fi -+.RE -+.PP -+(\&'function traps') and -+.PP -+.RS -+.nf -+\fBtrap \&' -+ # code -+\&' NAL\fP -+.fi -+.RE -+.PP -+(\&'list traps') are equivalent in most ways, the exceptions being the -+following: -+.PP -+.PD 0 -+.TP -+.PD -+\(bu -+Function traps have all the properties of normal functions, -+appearing in the list of functions and being called with their own -+function context rather than the context where the trap was triggered\&. -+.TP -+\(bu -+The return status from function traps is special, whereas a return -+from a list trap causes the surrounding context to return with the given -+status\&. -+.TP -+\(bu -+Function traps are not reset within subshells, in accordance with -+zsh behaviour; list traps are reset, in accordance with POSIX -+behaviour\&. -+.\" Yodl file: Zsh/jobs.yo -+.SH "JOBS" -+If the \fBMONITOR\fP option is set, -+an interactive shell associates a \fIjob\fP with each pipeline\&. -+It keeps a table of current jobs, printed by the \fBjobs\fP -+command, and assigns them small integer numbers\&. -+When a job is started asynchronously with `\fB&\fP\&', -+the shell prints a line to standard error which looks like: -+.PP -+.RS -+.nf -+\fB[1] 1234\fP -+.fi -+.RE -+.PP -+indicating that the job which was started asynchronously was job number -+1 and had one (top\-level) process, whose process ID was 1234\&. -+.PP -+If a job is started with `\fB&|\fP\&' or `\fB&!\fP', -+then that job is immediately disowned\&. After startup, it -+does not have a place in the job table, and is not subject -+to the job control features described here\&. -+.PP -+If you are running a job and wish to do something else you may hit the key -+^Z (control\-Z) which sends a \fBTSTP\fP signal to the current job: this key -+may be redefined by the \fBsusp\fP option of the external \fBstty\fP command\&. -+The shell will then normally indicate that the job has been `suspended\&', -+and print another prompt\&. You can then manipulate the state of this job, -+putting it in the background with the \fBbg\fP command, or run some other -+commands and then eventually bring the job back into the foreground with -+the foreground command \fBfg\fP\&. A ^Z takes effect immediately and -+is like an interrupt in that pending output and unread input are discarded -+when it is typed\&. -+.PP -+A job being run in the background will suspend if it tries to read -+from the terminal\&. -+Background jobs are normally allowed to produce output, -+but this can be disabled by giving the command `\fBstty tostop\fP\&'\&. -+If you set this -+tty option, then background jobs will suspend when they try to produce -+output like they do when they try to read input\&. -+.PP -+When a command is suspended and continued later with the \fBfg\fP or -+\fBwait\fP builtins, zsh restores tty modes that were in effect when it was -+suspended\&. This (intentionally) does not apply if the command is -+continued via `\fBkill \-CONT\fP\&', nor when it is continued with \fBbg\fP\&. -+.PP -+There are several ways to refer to jobs in the shell\&. -+A job can be referred to by the process ID of any process of the job -+or by one of the following: -+.PP -+.PD 0 -+.TP -+\fB%\fP\fInumber\fP -+The job with the given number\&. -+.TP -+\fB%\fP\fIstring\fP -+Any job whose command line begins with \fIstring\fP\&. -+.TP -+\fB%?\fP\fIstring\fP -+Any job whose command line contains \fIstring\fP\&. -+.TP -+\fB%%\fP -+Current job\&. -+.TP -+\fB%+\fP -+Equivalent to `\fB%%\fP\&'\&. -+.TP -+\fB%\-\fP -+Previous job\&. -+.PD -+.PP -+The shell learns immediately whenever a process changes state\&. -+It normally informs you whenever a job becomes blocked so that -+no further progress is possible\&. If the \fBNOTIFY\fP option is not set, -+it waits until just before it prints a prompt before it informs you\&. -+All such notifications are sent directly to the terminal, not to -+the standard output or standard error\&. -+.PP -+When the monitor mode is on, each background job that completes -+triggers any trap set for \fBCHLD\fP\&. -+.PP -+When you try to leave the shell while jobs are running or suspended, you will -+be warned that `You have suspended (running) jobs\&'\&. -+You may use the \fBjobs\fP command to see what they are\&. -+If you do this or immediately try to -+exit again, the shell will not warn you a second time; the suspended -+jobs will be terminated, and the running jobs will be sent -+a \fBSIGHUP\fP signal, if the \fBHUP\fP option is set\&. -+.PP -+To avoid having the shell terminate the running jobs, either -+use the \fBnohup\fP command (see \fInohup\fP(1)) -+or the \fBdisown\fP builtin\&. -+.SH "SIGNALS" -+The \fBINT\fP and \fBQUIT\fP signals for an invoked -+command are ignored if the command is followed by -+`\fB&\fP\&' and the \fBMONITOR\fP option is not active\&. -+The shell itself always ignores the \fBQUIT\fP signal\&. -+Otherwise, signals have the values -+inherited by the shell from its parent -+(but see the \fBTRAP\fP\fINAL\fP special functions in the section `Functions\&')\&. -+.\" Yodl file: Zsh/arith.yo -+.SH "ARITHMETIC EVALUATION" -+The shell can perform integer and floating point arithmetic, either using -+the builtin \fBlet\fP, or via a substitution of the form \fB$((\&.\&.\&.))\fP\&. For -+integers, the shell is usually compiled to use 8\-byte precision where this -+is available, otherwise precision is 4 bytes\&. This can be tested, for -+example, by giving the command `\fBprint \- $(( 12345678901 ))\fP\&'; if the -+number appears unchanged, the precision is at least 8 bytes\&. Floating -+point arithmetic always uses the `double\&' type with whatever corresponding -+precision is provided by the compiler and the library\&. -+.PP -+The \fBlet\fP builtin command takes arithmetic expressions as arguments; each -+is evaluated separately\&. Since many of the arithmetic operators, as well -+as spaces, require quoting, an alternative form is provided: for any -+command which begins with a `\fB((\fP\&', all the characters until a -+matching `\fB))\fP\&' are treated as a quoted expression and -+arithmetic expansion performed as for an argument of \fBlet\fP\&. More -+precisely, `\fB((\fP\fI\&.\&.\&.\fP\fB))\fP\&' is equivalent to -+`\fBlet "\fP\fI\&.\&.\&.\fP\fB"\fP\&'\&. The return status is 0 if the arithmetic value -+of the expression is non\-zero, 1 if it is zero, and 2 if an error occurred\&. -+.PP -+For example, the following statement -+.PP -+.RS -+.nf -+\fB(( val = 2 + 1 ))\fP -+.fi -+.RE -+.PP -+is equivalent to -+.PP -+.RS -+.nf -+\fBlet "val = 2 + 1"\fP -+.fi -+.RE -+.PP -+both assigning the value 3 to the shell variable \fBval\fP and returning a -+zero status\&. -+.PP -+Integers can be in bases other than 10\&. -+A leading `\fB0x\fP\&' or `\fB0X\fP' denotes hexadecimal\&. -+Integers may also be of the form `\fIbase\fP\fB#\fP\fIn\fP\&', -+where \fIbase\fP is a decimal number between two and thirty\-six -+representing the arithmetic base and \fIn\fP -+is a number in that base (for example, `\fB16#ff\fP\&' is 255 in hexadecimal)\&. -+The \fIbase\fP\fB#\fP may also be omitted, in which case -+base 10 is used\&. For backwards compatibility the form -+`\fB[\fP\fIbase\fP\fB]\fP\fIn\fP\&' is also accepted\&. -+.PP -+It is also possible to specify a base to be used for output in the form -+`\fB[#\fP\fIbase\fP\fB]\fP\&', for example `\fB[#16]\fP'\&. This is used when -+outputting arithmetical substitutions or when assigning to scalar -+parameters, but an explicitly defined integer or floating point parameter -+will not be affected\&. If an integer variable is implicitly defined by an -+arithmetic expression, any base specified in this way will be set as the -+variable\&'s output arithmetic base as if the option `\fB\-i\fP \fIbase\fP' to -+the \fBtypeset\fP builtin had been used\&. The expression has no precedence -+and if it occurs more than once in a mathematical expression, the last -+encountered is used\&. For clarity it is recommended that it appear at the -+beginning of an expression\&. As an example: -+.PP -+.RS -+.nf -+\fBtypeset \-i 16 y -+print $(( [#8] x = 32, y = 32 )) -+print $x $y\fP -+.fi -+.RE -+.PP -+outputs first `\fB8#40\fP\&', the rightmost value in the given output base, and -+then `\fB8#40 16#20\fP\&', because \fBy\fP has been explicitly declared to -+have output base 16, while \fBx\fP (assuming it does not already exist) is -+implicitly typed by the arithmetic evaluation, where it acquires the output -+base 8\&. -+.PP -+If the \fBC_BASES\fP option is set, hexadecimal numbers in the standard C -+format, for example \fB0xFF\fP instead of the usual `\fB16#FF\fP\&'\&. If the -+option \fBOCTAL_ZEROES\fP is also set (it is not by default), octal numbers -+will be treated similarly and hence appear as `\fB077\fP\&' instead of -+`\fB8#77\fP\&'\&. This option has no effect on the output of bases other than -+hexadecimal and octal, and these formats are always understood on input\&. -+.PP -+When an output base is specified using the `\fB[#\fP\fIbase\fP\fB]\fP\&' syntax, -+an appropriate base prefix will be output if necessary, so that the value -+output is valid syntax for input\&. If the \fB#\fP is doubled, for example -+`\fB[##16]\fP\&', then no base prefix is output\&. -+.PP -+Floating point constants are recognized by the presence of a decimal point -+or an exponent\&. The decimal point may be the first character of the -+constant, but the exponent character \fBe\fP or \fBE\fP may not, as it will be -+taken for a parameter name\&. -+.PP -+An arithmetic expression uses nearly the same syntax and -+associativity of expressions as in C\&. -+.PP -+In the native mode of operation, the following operators are supported -+(listed in decreasing order of precedence): -+.PP -+.PD 0 -+.TP -+\fB+ \- ! ~ ++ \-\-\fP -+unary plus/minus, logical NOT, complement, {pre,post}{in,de}crement -+.TP -+\fB<< >>\fP -+bitwise shift left, right -+.TP -+\fB&\fP -+bitwise AND -+.TP -+\fB^\fP -+bitwise XOR -+.TP -+\fB|\fP -+bitwise OR -+.TP -+\fB**\fP -+exponentiation -+.TP -+\fB* / %\fP -+multiplication, division, modulus (remainder) -+.TP -+\fB+ \-\fP -+addition, subtraction -+.TP -+\fB< > <= >=\fP -+comparison -+.TP -+\fB== !=\fP -+equality and inequality -+.TP -+\fB&&\fP -+logical AND -+.TP -+\fB|| ^^\fP -+logical OR, XOR -+.TP -+\fB? :\fP -+ternary operator -+.TP -+\fB= += \-= *= /= %= &= ^= |= <<= >>= &&= ||= ^^= **=\fP -+assignment -+.TP -+\fB,\fP -+comma operator -+.PD -+.PP -+The operators `\fB&&\fP\&', `\fB||\fP', `\fB&&=\fP', and `\fB||=\fP' are -+short\-circuiting, and only one of the latter two expressions in a ternary -+operator is evaluated\&. Note the precedence of the bitwise AND, OR, -+and XOR operators\&. -+.PP -+With the option \fBC_PRECEDENCES\fP the precedences (but no other -+properties) of the operators are altered to be the same as those in -+most other languages that support the relevant operators: -+.PP -+.PD 0 -+.TP -+\fB+ \- ! ~ ++ \-\-\fP -+unary plus/minus, logical NOT, complement, {pre,post}{in,de}crement -+.TP -+\fB**\fP -+exponentiation -+.TP -+\fB* / %\fP -+multiplication, division, modulus (remainder) -+.TP -+\fB+ \-\fP -+addition, subtraction -+.TP -+\fB<< >>\fP -+bitwise shift left, right -+.TP -+\fB< > <= >=\fP -+comparison -+.TP -+\fB== !=\fP -+equality and inequality -+.TP -+\fB&\fP -+bitwise AND -+.TP -+\fB^\fP -+bitwise XOR -+.TP -+\fB|\fP -+bitwise OR -+.TP -+\fB&&\fP -+logical AND -+.TP -+\fB^^\fP -+logical XOR -+.TP -+\fB||\fP -+logical OR -+.TP -+\fB? :\fP -+ternary operator -+.TP -+\fB= += \-= *= /= %= &= ^= |= <<= >>= &&= ||= ^^= **=\fP -+assignment -+.TP -+\fB,\fP -+comma operator -+.PD -+.PP -+Note the precedence of exponentiation in both cases is below -+that of unary operators, hence `\fB\-3**2\fP\&' evaluates as `\fB9\fP', not -+\fB\-9\fP\&. Use parentheses where necessary: `\fB\-(3**2)\fP\&'\&. This is -+for compatibility with other shells\&. -+.PP -+Mathematical functions can be called with the syntax -+`\fIfunc\fP\fB(\fP\fIargs\fP\fB)\fP\&', where the function decides -+if the \fIargs\fP is used as a string or a comma\-separated list of -+arithmetic expressions\&. The shell currently defines no mathematical -+functions by default, but the module \fBzsh/mathfunc\fP may be loaded with -+the \fBzmodload\fP builtin to provide standard floating point mathematical -+functions\&. -+.PP -+An expression of the form `\fB##\fP\fIx\fP\&' where \fIx\fP is any character -+sequence such as `\fBa\fP\&', `\fB^A\fP', or `\fB\eM\-\eC\-x\fP' gives the value of -+this character and an expression of the form `\fB#\fP\fIfoo\fP\&' gives the -+value of the first character of the contents of the parameter \fIfoo\fP\&. -+Character values are according to the character set used in the current -+locale; for multibyte character handling the option \fBMULTIBYTE\fP must be -+set\&. Note that this form is different from `\fB$#\fP\fIfoo\fP\&', a standard -+parameter substitution which gives the length of the parameter \fIfoo\fP\&. -+`\fB#\e\fP\&' is accepted instead of `\fB##\fP', but its use is deprecated\&. -+.PP -+Named parameters and subscripted arrays can be referenced by name within an -+arithmetic expression without using the parameter expansion syntax\&. For -+example, -+.PP -+.RS -+.nf -+\fB((val2 = val1 * 2))\fP -+.fi -+.RE -+.PP -+assigns twice the value of \fB$val1\fP to the parameter named \fBval2\fP\&. -+.PP -+An internal integer representation of a named parameter -+can be specified with the \fBinteger\fP builtin\&. -+Arithmetic evaluation is performed on the value of each -+assignment to a named parameter declared integer -+in this manner\&. Assigning a floating point number to an integer results in -+rounding down to the next integer\&. -+.PP -+Likewise, floating point numbers can be declared with the \fBfloat\fP -+builtin; there are two types, differing only in their output format, as -+described for the \fBtypeset\fP builtin\&. The output format can be bypassed -+by using arithmetic substitution instead of the parameter substitution, -+i\&.e\&. `\fB${\fP\fIfloat\fP\fB}\fP\&' uses the defined format, but -+`\fB$((\fP\fIfloat\fP\fB))\fP\&' uses a generic floating point -+format\&. -+.PP -+Promotion of integer to floating point values is performed where -+necessary\&. In addition, if any operator which requires an integer -+(`\fB~\fP\&', `\fB&\fP', `\fB|\fP', `\fB^\fP', `\fB%\fP', `\fB<<\fP', `\fB>>\fP' and their -+equivalents with assignment) is given a floating point argument, it will be -+silently rounded down to the next integer\&. -+.PP -+Scalar variables can hold integer or floating point values at different -+times; there is no memory of the numeric type in this case\&. -+.PP -+If a variable is first assigned in a numeric context without previously -+being declared, it will be implicitly typed as \fBinteger\fP or \fBfloat\fP and -+retain that type either until the type is explicitly changed or until the -+end of the scope\&. This can have unforeseen consequences\&. For example, in -+the loop -+.PP -+.RS -+.nf -+\fBfor (( f = 0; f < 1; f += 0\&.1 )); do -+# use $f -+done\fP -+.fi -+.RE -+.PP -+if \fBf\fP has not already been declared, the first assignment will cause it -+to be created as an integer, and consequently the operation `\fBf += 0\&.1\fP\&' -+will always cause the result to be truncated to zero, so that the loop will -+fail\&. A simple fix would be to turn the initialization into `\fBf = 0\&.0\fP\&'\&. -+It is therefore best to declare numeric variables with explicit types\&. -+.\" Yodl file: Zsh/cond.yo -+.SH "CONDITIONAL EXPRESSIONS" -+A \fIconditional expression\fP is used with the \fB[[\fP -+compound command to test attributes of files and to compare strings\&. -+Each expression can be constructed from one or more -+of the following unary or binary expressions: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-a\fP \fIfile\fP -+true if \fIfile\fP exists\&. -+.TP -+\fB\-b\fP \fIfile\fP -+true if \fIfile\fP exists and is a block special file\&. -+.TP -+\fB\-c\fP \fIfile\fP -+true if \fIfile\fP exists and is a character special file\&. -+.TP -+\fB\-d\fP \fIfile\fP -+true if \fIfile\fP exists and is a directory\&. -+.TP -+\fB\-e\fP \fIfile\fP -+true if \fIfile\fP exists\&. -+.TP -+\fB\-f\fP \fIfile\fP -+true if \fIfile\fP exists and is a regular file\&. -+.TP -+\fB\-g\fP \fIfile\fP -+true if \fIfile\fP exists and has its setgid bit set\&. -+.TP -+\fB\-h\fP \fIfile\fP -+true if \fIfile\fP exists and is a symbolic link\&. -+.TP -+\fB\-k\fP \fIfile\fP -+true if \fIfile\fP exists and has its sticky bit set\&. -+.TP -+\fB\-n\fP \fIstring\fP -+true if length of \fIstring\fP is non\-zero\&. -+.TP -+\fB\-o\fP \fIoption\fP -+true if option named \fIoption\fP is on\&. \fIoption\fP -+may be a single character, in which case it is a single letter option name\&. -+(See the section `Specifying Options\&'\&.) -+.TP -+\fB\-p\fP \fIfile\fP -+true if \fIfile\fP exists and is a FIFO special file (named pipe)\&. -+.TP -+\fB\-r\fP \fIfile\fP -+true if \fIfile\fP exists and is readable by current process\&. -+.TP -+\fB\-s\fP \fIfile\fP -+true if \fIfile\fP exists and has size greater than zero\&. -+.TP -+\fB\-t\fP \fIfd\fP -+true if file descriptor number \fIfd\fP -+is open and associated with a terminal device\&. -+(note: \fIfd\fP is not optional) -+.TP -+\fB\-u\fP \fIfile\fP -+true if \fIfile\fP exists and has its setuid bit set\&. -+.TP -+\fB\-w\fP \fIfile\fP -+true if \fIfile\fP exists and is writable by current process\&. -+.TP -+\fB\-x\fP \fIfile\fP -+true if \fIfile\fP exists and is executable by current process\&. -+If \fIfile\fP exists and is a directory, then the current process -+has permission to search in the directory\&. -+.TP -+\fB\-z\fP \fIstring\fP -+true if length of \fIstring\fP is zero\&. -+.TP -+\fB\-L\fP \fIfile\fP -+true if \fIfile\fP exists and is a symbolic link\&. -+.TP -+\fB\-O\fP \fIfile\fP -+true if \fIfile\fP exists and is owned by the effective user ID of this process\&. -+.TP -+\fB\-G\fP \fIfile\fP -+true if \fIfile\fP exists and its group matches -+the effective group ID of this process\&. -+.TP -+\fB\-S\fP \fIfile\fP -+true if \fIfile\fP exists and is a socket\&. -+.TP -+\fB\-N\fP \fIfile\fP -+true if \fIfile\fP exists and its access time is -+not newer than its modification time\&. -+.TP -+\fIfile1\fP \fB\-nt\fP \fIfile2\fP -+true if \fIfile1\fP exists and is newer than \fIfile2\fP\&. -+.TP -+\fIfile1\fP \fB\-ot\fP \fIfile2\fP -+true if \fIfile1\fP exists and is older than \fIfile2\fP\&. -+.TP -+\fIfile1\fP \fB\-ef\fP \fIfile2\fP -+true if \fIfile1\fP and \fIfile2\fP exist and refer to the same file\&. -+.TP -+.PD 0 -+\fIstring\fP \fB=\fP \fIpattern\fP -+.TP -+.PD -+\fIstring\fP \fB==\fP \fIpattern\fP -+true if \fIstring\fP matches \fIpattern\fP\&. -+The `\fB==\fP\&' form is the preferred one\&. The `\fB=\fP' form is for -+backward compatibility and should be considered obsolete\&. -+.TP -+\fIstring\fP \fB!=\fP \fIpattern\fP -+true if \fIstring\fP does not match \fIpattern\fP\&. -+.TP -+\fIstring\fP \fB=~\fP \fIregexp\fP -+true if \fIstring\fP matches the regular expression -+\fIregexp\fP\&. If the option \fBRE_MATCH_PCRE\fP is set -+\fIregexp\fP is tested as a PCRE regular expression using -+the \fBzsh/pcre\fP module, else it is tested as a POSIX -+extended regular expression using the \fBzsh/regex\fP module\&. -+Upon successful match, some variables will be updated; no variables -+are changed if the matching fails\&. -+.RS -+.PP -+If the option \fBBASH_REMATCH\fP is not set the scalar parameter -+\fBMATCH\fP is set to the substring that matched the pattern and -+the integer parameters \fBMBEGIN\fP and \fBMEND\fP to the index of the start -+and end, respectively, of the match in \fIstring\fP, such that if -+\fIstring\fP is contained in variable \fBvar\fP the expression -+`${var[$MBEGIN,$MEND]}\&' is identical to `$MATCH'\&. The setting -+of the option \fBKSH_ARRAYS\fP is respected\&. Likewise, the array -+\fBmatch\fP is set to the substrings that matched parenthesised -+subexpressions and the arrays \fBmbegin\fP and \fBmend\fP to the indices of -+the start and end positions, respectively, of the substrings within -+\fIstring\fP\&. The arrays are not set if there were no parenthesised -+subexpresssions\&. For example, if the string `\fBa short string\fP\&' is matched -+against the regular expression `\fBs(\&.\&.\&.)t\fP\&', then (assuming the -+option \fBKSH_ARRAYS\fP is not set) \fBMATCH\fP, \fBMBEGIN\fP -+and \fBMEND\fP are `\fBshort\fP\&', 3 and 7, respectively, while \fBmatch\fP, -+\fBmbegin\fP and \fBmend\fP are single entry arrays containing -+the strings `\fBhor\fP\&', `\fB4\fP' and `\fB6\fP, respectively\&. -+.PP -+If the option \fBBASH_REMATCH\fP is set the array -+\fBBASH_REMATCH\fP is set to the substring that matched the pattern -+followed by the substrings that matched parenthesised -+subexpressions within the pattern\&. -+.RE -+.TP -+\fIstring1\fP \fB<\fP \fIstring2\fP -+true if \fIstring1\fP comes before \fIstring2\fP -+based on ASCII value of their characters\&. -+.TP -+\fIstring1\fP \fB>\fP \fIstring2\fP -+true if \fIstring1\fP comes after \fIstring2\fP -+based on ASCII value of their characters\&. -+.TP -+\fIexp1\fP \fB\-eq\fP \fIexp2\fP -+true if \fIexp1\fP is numerically equal to \fIexp2\fP\&. -+.TP -+\fIexp1\fP \fB\-ne\fP \fIexp2\fP -+true if \fIexp1\fP is numerically not equal to \fIexp2\fP\&. -+.TP -+\fIexp1\fP \fB\-lt\fP \fIexp2\fP -+true if \fIexp1\fP is numerically less than \fIexp2\fP\&. -+.TP -+\fIexp1\fP \fB\-gt\fP \fIexp2\fP -+true if \fIexp1\fP is numerically greater than \fIexp2\fP\&. -+.TP -+\fIexp1\fP \fB\-le\fP \fIexp2\fP -+true if \fIexp1\fP is numerically less than or equal to \fIexp2\fP\&. -+.TP -+\fIexp1\fP \fB\-ge\fP \fIexp2\fP -+true if \fIexp1\fP is numerically greater than or equal to \fIexp2\fP\&. -+.TP -+\fB(\fP \fIexp\fP \fB)\fP -+true if \fIexp\fP is true\&. -+.TP -+\fB!\fP \fIexp\fP -+true if \fIexp\fP is false\&. -+.TP -+\fIexp1\fP \fB&&\fP \fIexp2\fP -+true if \fIexp1\fP and \fIexp2\fP are both true\&. -+.TP -+\fIexp1\fP \fB||\fP \fIexp2\fP -+true if either \fIexp1\fP or \fIexp2\fP is true\&. -+.PP -+Normal shell expansion is performed on the \fIfile\fP, \fIstring\fP and -+\fIpattern\fP arguments, but the result of each expansion is constrained to -+be a single word, similar to the effect of double quotes\&. -+File generation is not performed on any form of argument to conditions\&. -+However, pattern metacharacters are active for the \fIpattern\fP arguments; -+the patterns are the same as those used for filename generation, see -+\fIzshexpn\fP(1), but there is no special behaviour -+of `\fB/\fP\&' nor initial dots, and no glob qualifiers are allowed\&. -+.PP -+In each of the above expressions, if -+\fIfile\fP is of the form `\fB/dev/fd/\fP\fIn\fP\&', -+where \fIn\fP is an integer, -+then the test applied to the open file whose -+descriptor number is \fIn\fP, -+even if the underlying system does not support -+the \fB/dev/fd\fP directory\&. -+.PP -+In the forms which do numeric comparison, the expressions \fIexp\fP -+undergo arithmetic expansion as if they were enclosed in \fB$((\&.\&.\&.))\fP\&. -+.PP -+For example, the following: -+.PP -+.RS -+.nf -+\fB[[ ( \-f foo || \-f bar ) && $report = y* ]] && print File exists\&.\fP -+.fi -+.RE -+.PP -+tests if either file \fBfoo\fP or file \fBbar\fP exists, and if so, if the -+value of the parameter \fBreport\fP begins with `\fBy\fP\&'; if the complete -+condition is true, the message `\fBFile exists\&.\fP\&' is printed\&. -+.\" Yodl file: Zsh/prompt.yo -+.SH "EXPANSION OF PROMPT SEQUENCES" -+Prompt sequences undergo a special form of expansion\&. This type of expansion -+is also available using the \fB\-P\fP option to the \fBprint\fP builtin\&. -+.PP -+If the \fBPROMPT_SUBST\fP option is set, the prompt string is first subjected to -+\fIparameter expansion\fP, -+\fIcommand substitution\fP and -+\fIarithmetic expansion\fP\&. -+See -+\fIzshexpn\fP(1)\&. -+ -+Certain escape sequences may be recognised in the prompt string\&. -+.PP -+If the \fBPROMPT_BANG\fP option is set, a `\fB!\fP\&' in the prompt is replaced -+by the current history event number\&. A literal `\fB!\fP\&' may then be -+represented as `\fB!!\fP\&'\&. -+.PP -+If the \fBPROMPT_PERCENT\fP option is set, certain escape sequences that -+start with `\fB%\fP\&' are expanded\&. -+Many escapes are followed by a single character, although some of these -+take an optional integer argument that -+should appear between the `\fB%\fP\&' and the next character of the -+sequence\&. More complicated escape sequences are available to provide -+conditional expansion\&. -+.PP -+.SH "SIMPLE PROMPT ESCAPES" -+.PP -+.SS "Special characters" -+.PD 0 -+.TP -+.PD -+\fB%%\fP -+A `\fB%\fP\&'\&. -+.TP -+\fB%)\fP -+A `\fB)\fP\&'\&. -+.PP -+.SS "Login information" -+.PD 0 -+.TP -+.PD -+\fB%l\fP -+The line (tty) the user is logged in on, without `\fB/dev/\fP\&' prefix\&. -+If the name starts with `\fB/dev/tty\fP\&', that prefix is stripped\&. -+.TP -+\fB%M\fP -+The full machine hostname\&. -+.TP -+\fB%m\fP -+The hostname up to the first `\fB\&.\fP\&'\&. -+An integer may follow the `\fB%\fP\&' to specify -+how many components of the hostname are desired\&. With a negative integer, -+trailing components of the hostname are shown\&. -+.TP -+\fB%n\fP -+\fB$USERNAME\fP\&. -+.TP -+\fB%y\fP -+The line (tty) the user is logged in on, without `\fB/dev/\fP\&' prefix\&. -+This does not treat `\fB/dev/tty\fP\&' names specially\&. -+.PP -+.SS "Shell state" -+.PD 0 -+.TP -+.PD -+\fB%#\fP -+A `\fB#\fP\&' if the shell is running with privileges, a `\fB%\fP' if not\&. -+Equivalent to `\fB%(!\&.#\&.%%)\fP\&'\&. -+The definition of `privileged\&', for these purposes, is that either the -+effective user ID is zero, or, if POSIX\&.1e capabilities are supported, that -+at least one capability is raised in either the Effective or Inheritable -+capability vectors\&. -+.TP -+\fB%?\fP -+The return status of the last command executed just before the prompt\&. -+.TP -+\fB%_\fP -+The status of the parser, i\&.e\&. the shell constructs (like `\fBif\fP\&' and -+`\fBfor\fP\&') that have been started on the command line\&. If given an integer -+number that many strings will be printed; zero or negative or no integer means -+print as many as there are\&. This is most useful in prompts \fBPS2\fP for -+continuation lines and \fBPS4\fP for debugging with the \fBXTRACE\fP option; in -+the latter case it will also work non\-interactively\&. -+.TP -+.PD 0 -+\fB%d\fP -+.TP -+.PD -+\fB/\fP -+Current working directory\&. If an integer follows the `\fB%\fP\&', -+it specifies a number of trailing components of the current working -+directory to show; zero means the whole path\&. A negative integer -+specifies leading components, i\&.e\&. \fB%\-1d\fP specifies the first component\&. -+.TP -+\fB%~\fP -+As \fB%d\fP and \fB%/\fP, but if the current working directory has a named -+directory as its prefix, that part is replaced by a `\fB~\fP\&' followed by -+the name of the directory\&. If it starts with \fB$HOME\fP, that part is -+replaced by a `\fB~\fP\&'\&. -+.TP -+.PD 0 -+\fB%h\fP -+.TP -+.PD -+\fB%!\fP -+Current history event number\&. -+.TP -+\fB%i\fP -+The line number currently being executed in the script, sourced file, or -+shell function given by \fB%N\fP\&. This is most useful for debugging as part -+of \fB$PS4\fP\&. -+.TP -+\fB%I\fP -+The line number currently being executed in the file \fB%x\fP\&. This is -+similar to \fB%i\fP, but the line number is always a line number in the -+file where the code was defined, even if the code is a shell function\&. -+.TP -+\fB%j\fP -+The number of jobs\&. -+.TP -+\fB%L\fP -+The current value of \fB$SHLVL\fP\&. -+.TP -+\fB%N\fP -+The name of the script, sourced file, or shell function that zsh is -+currently executing, whichever was started most recently\&. If there is -+none, this is equivalent to the parameter \fB$0\fP\&. An integer may follow -+the `\fB%\fP\&' to specify a number of trailing path components to show; zero -+means the full path\&. A negative integer specifies leading components\&. -+.TP -+\fB%x\fP -+The name of the file containing the source code currently being -+executed\&. This behaves as \fB%N\fP except that function and eval command -+names are not shown, instead the file where they were defined\&. -+.TP -+.PD 0 -+\fB%c\fP -+.TP -+.PD 0 -+\fB%\&.\fP -+.TP -+.PD -+\fB%C\fP -+Trailing component of the current working directory\&. -+An integer may follow the `\fB%\fP\&' to get more than one component\&. -+Unless `\fB%C\fP\&' is used, tilde contraction is performed first\&. These are -+deprecated as \fB%c\fP and \fB%C\fP are equivalent to \fB%1~\fP and \fB%1/\fP, -+respectively, while explicit positive integers have the same effect as for -+the latter two sequences\&. -+.PP -+.SS "Date and time" -+.PD 0 -+.TP -+.PD -+\fB%D\fP -+The date in \fIyy\fP\fB\-\fP\fImm\fP\fB\-\fP\fIdd\fP format\&. -+.TP -+\fB%T\fP -+Current time of day, in 24\-hour format\&. -+.TP -+.PD 0 -+\fB%t\fP -+.TP -+.PD -+\fB%@\fP -+Current time of day, in 12\-hour, am/pm format\&. -+.TP -+\fB%*\fP -+Current time of day in 24\-hour format, with seconds\&. -+.TP -+\fB%w\fP -+The date in \fIday\fP\fB\-\fP\fIdd\fP format\&. -+.TP -+\fB%W\fP -+The date in \fImm\fP\fB/\fP\fIdd\fP\fB/\fP\fIyy\fP format\&. -+.TP -+\fB%D{\fP\fIstring\fP\fB}\fP -+\fIstring\fP is formatted using the \fBstrftime\fP function\&. -+See \fIstrftime\fP(3) for more details\&. Various zsh -+extensions provide numbers with no leading zero or space -+if the number is a single digit: -+.RS -+.PP -+.PD 0 -+.TP -+\fB%f\fP -+a day of the month -+.TP -+\fB%K\fP -+the hour of the day on the 24\-hour clock -+.TP -+\fB%L\fP -+the hour of the day on the 12\-hour clock -+.PD -+.PP -+The GNU extension that a `\fB\-\fP\&' between the \fB%\fP and the -+format character causes a leading zero or space to be stripped -+is handled directly by the shell for the format characters \fBd\fP, \fBf\fP, -+\fBH\fP, \fBk\fP, \fBl\fP, \fBm\fP, \fBM\fP, \fBS\fP and \fBy\fP; any other format -+characters are provided to \fBstrftime()\fP with any leading `\fB\-\fP\&', -+present, so the handling is system dependent\&. Further GNU -+extensions are not supported at present\&. -+.RE -+.RE -+.PP -+.SS "Visual effects" -+.PD 0 -+.TP -+.PD -+\fB%B\fP (\fB%b\fP) -+Start (stop) boldface mode\&. -+.TP -+\fB%E\fP -+Clear to end of line\&. -+.TP -+\fB%U\fP (\fB%u\fP) -+Start (stop) underline mode\&. -+.TP -+\fB%S\fP (\fB%s\fP) -+Start (stop) standout mode\&. -+.TP -+\fB%F\fP (\fB%f\fP) -+Start (stop) using a different foreground colour, if supported -+by the terminal\&. The colour may be specified two ways: either -+as a numeric argument, as normal, or by a sequence in braces -+following the \fB%F\fP, for example \fB%F{red}\fP\&. In the latter case -+the values allowed are as described for the \fBfg\fP \fBzle_highlight\fP -+attribute; -+see \fICharacter Highlighting\fP in \fIzshzle\fP(1)\&. This means that numeric -+colours are allowed in the second format also\&. -+.TP -+\fB%K\fP (\fB%k\fP) -+Start (stop) using a different bacKground colour\&. The syntax is -+identical to that for \fB%F\fP and \fB%f\fP\&. -+.TP -+\fB%{\fP\&.\&.\&.\fB%}\fP -+Include a string as a literal escape sequence\&. -+The string within the braces should not change the cursor -+position\&. Brace pairs can nest\&. -+.RS -+.PP -+A positive numeric argument between the \fB%\fP and the \fB{\fP is treated as -+described for \fB%G\fP below\&. -+.RE -+.TP -+\fB%G\fP -+Within a \fB%{\fP\&.\&.\&.\fB%}\fP sequence, include a `glitch\&': that is, assume -+that a single character width will be output\&. This is useful when -+outputting characters that otherwise cannot be correctly handled by the -+shell, such as the alternate character set on some terminals\&. -+The characters in question can be included within a \fB%{\fP\&.\&.\&.\fB%}\fP -+sequence together with the appropriate number of \fB%G\fP sequences to -+indicate the correct width\&. An integer between the `\fB%\fP\&' and `\fBG\fP' -+indicates a character width other than one\&. Hence \fB%{\fP\fIseq\fP\fB%2G%}\fP -+outputs \fIseq\fP and assumes it takes up the width of two standard -+characters\&. -+.RS -+.PP -+Multiple uses of \fB%G\fP accumulate in the obvious fashion; the position -+of the \fB%G\fP is unimportant\&. Negative integers are not handled\&. -+.PP -+Note that when prompt truncation is in use it is advisable to divide up -+output into single characters within each \fB%{\fP\&.\&.\&.\fB%}\fP group so that -+the correct truncation point can be found\&. -+.RE -+.RE -+.PP -+.SH "CONDITIONAL SUBSTRINGS IN PROMPTS" -+.PD 0 -+.TP -+.PD -+\fB%v\fP -+The value of the first element of the \fBpsvar\fP array parameter\&. Following -+the `\fB%\fP\&' with an integer gives that element of the array\&. Negative -+integers count from the end of the array\&. -+.TP -+\fB%(\fP\fIx\&.true\-text\&.false\-text\fP\fB)\fP -+Specifies a ternary expression\&. The character following the \fIx\fP is -+arbitrary; the same character is used to separate the text for the -+`true\&' result from that for the `false' result\&. -+This separator may not appear in the \fItrue\-text\fP, except as part of a -+%\-escape -+sequence\&. A `\fB)\fP\&' may appear in the \fIfalse\-text\fP as `\fB%)\fP'\&. -+\fItrue\-text\fP -+and \fIfalse\-text\fP may both contain arbitrarily\-nested escape -+sequences, including further ternary expressions\&. -+.RS -+.PP -+The left parenthesis may be preceded or followed by a positive integer \fIn\fP, -+which defaults to zero\&. A negative integer will be multiplied by \-1\&. -+The test character \fIx\fP may be any of the following: -+.PP -+.PD 0 -+.TP -+\fB!\fP -+True if the shell is running with privileges\&. -+.TP -+\fB#\fP -+True if the effective uid of the current process is \fIn\fP\&. -+.TP -+\fB?\fP -+True if the exit status of the last command was \fIn\fP\&. -+.TP -+\fB_\fP -+True if at least \fIn\fP shell constructs were started\&. -+.TP -+\fBC\fP -+.TP -+\fB/\fP -+True if the current absolute path has at least \fIn\fP elements -+relative to the root directory, hence \fB/\fP is counted as 0 elements\&. -+.TP -+\fBc\fP -+.TP -+\fB\&.\fP -+.TP -+\fB~\fP -+True if the current path, with prefix replacement, has at -+least \fIn\fP elements relative to the root directory, hence \fB/\fP is -+counted as 0 elements\&. -+.TP -+\fBD\fP -+True if the month is equal to \fIn\fP (January = 0)\&. -+.TP -+\fBd\fP -+True if the day of the month is equal to \fIn\fP\&. -+.TP -+\fBg\fP -+True if the effective gid of the current process is \fIn\fP\&. -+.TP -+\fBj\fP -+True if the number of jobs is at least \fIn\fP\&. -+.TP -+\fBL\fP -+True if the \fBSHLVL\fP parameter is at least \fIn\fP\&. -+.TP -+\fBl\fP -+True if at least \fIn\fP characters have already been -+printed on the current line\&. -+.TP -+\fBS\fP -+True if the \fBSECONDS\fP parameter is at least \fIn\fP\&. -+.TP -+\fBT\fP -+True if the time in hours is equal to \fIn\fP\&. -+.TP -+\fBt\fP -+True if the time in minutes is equal to \fIn\fP\&. -+.TP -+\fBv\fP -+True if the array \fBpsvar\fP has at least \fIn\fP elements\&. -+.TP -+\fBV\fP -+True if element \fIn\fP of the array \fBpsvar\fP is set and -+non\-empty\&. -+.TP -+\fBw\fP -+True if the day of the week is equal to \fIn\fP (Sunday = 0)\&. -+.PD -+.RE -+.TP -+.PD 0 -+\fB%<\fP\fIstring\fP\fB<\fP -+.TP -+.PD 0 -+\fB%>\fP\fIstring\fP\fB>\fP -+.TP -+.PD -+\fB%[\fP\fIxstring\fP\fB]\fP -+Specifies truncation behaviour for the remainder of the prompt string\&. -+The third, deprecated, form is equivalent to `\fB%\fP\fIxstringx\fP\&', -+i\&.e\&. \fIx\fP may be `\fB<\fP\&' or `\fB>\fP'\&. -+The numeric argument, which in the third form may appear immediately -+after the `\fB[\fP\&', specifies the maximum permitted length of -+the various strings that can be displayed in the prompt\&. -+The \fIstring\fP will be displayed in -+place of the truncated portion of any string; note this does not -+undergo prompt expansion\&. -+.RS -+.PP -+The forms with `\fB<\fP\&' truncate at the left of the string, -+and the forms with `\fB>\fP\&' truncate at the right of the string\&. -+For example, if the current directory is `\fB/home/pike\fP\&', -+the prompt `\fB%8<\&.\&.<%/\fP\&' will expand to `\fB\&.\&.e/pike\fP'\&. -+In this string, the terminating character (`\fB<\fP\&', `\fB>\fP' or `\fB]\fP'), -+or in fact any character, may be quoted by a preceding `\fB\e\fP\&'; note -+when using \fBprint \-P\fP, however, that this must be doubled as the -+string is also subject to standard \fBprint\fP processing, in addition -+to any backslashes removed by a double quoted string: the worst case -+is therefore `\fBprint \-P "%<\e\e\e\e<<\&.\&.\&."\fP\&'\&. -+.PP -+If the \fIstring\fP is longer than the specified truncation length, -+it will appear in full, completely replacing the truncated string\&. -+.PP -+The part of the prompt string to be truncated runs to the end of the -+string, or to the end of the next enclosing group of the `\fB%(\fP\&' -+construct, or to the next truncation encountered at the same grouping -+level (i\&.e\&. truncations inside a `\fB%(\fP\&' are separate), which -+ever comes first\&. In particular, a truncation with argument zero -+(e\&.g\&. `\fB%<<\fP\&') marks the end of the range of the string to be -+truncated while turning off truncation from there on\&. For example, the -+prompt \&'%10<\&.\&.\&.<%~%<<%# ' will print a truncated representation of the -+current directory, followed by a `\fB%\fP\&' or `\fB#\fP', followed by a -+space\&. Without the `\fB%<<\fP\&', those two characters would be included -+in the string to be truncated\&. -+.RE -+.RE ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshzftpsys.1 -@@ -0,0 +1,667 @@ -+.TH "ZSHZFTPSYS" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshzftpsys \- zftp function front\-end -+.\" Yodl file: Zsh/zftpsys.yo -+.SH "DESCRIPTION" -+.PP -+This describes the set of shell functions supplied with the source -+distribution as an interface to the \fBzftp\fP builtin command, allowing you -+to perform FTP operations from the shell command line or within functions -+or scripts\&. The interface is similar to a traditional FTP client (e\&.g\&. the -+\fBftp\fP command itself, see \fIftp\fP(1)), but as it is entirely done -+within the shell all the familiar completion, editing and globbing features, -+and so on, are present, and macros are particularly simple to write as they -+are just ordinary shell functions\&. -+.PP -+The prerequisite is that the \fBzftp\fP command, as described in -+\fIzshmodules\fP(1) -+, must be available in the -+version of \fBzsh\fP installed at your site\&. If the shell is configured to -+load new commands at run time, it probably is: typing `\fBzmodload zsh/zftp\fP\&' -+will make sure (if that runs silently, it has worked)\&. If this is not the -+case, it is possible \fBzftp\fP was linked into the shell anyway: to test -+this, type `\fBwhich zftp\fP\&' and if \fBzftp\fP is available you will get the -+message `\fBzftp: shell built\-in command\fP\&'\&. -+.PP -+Commands given directly with \fBzftp\fP builtin may be interspersed between -+the functions in this suite; in a few cases, using \fBzftp\fP directly may -+cause some of the status information stored in shell parameters to become -+invalid\&. Note in particular the description of the variables -+\fB$ZFTP_TMOUT\fP, \fB$ZFTP_PREFS\fP and \fB$ZFTP_VERBOSE\fP for \fBzftp\fP\&. -+.PP -+.PP -+.SH "INSTALLATION" -+.PP -+You should make sure all the functions from the \fBFunctions/Zftp\fP -+directory of the source distribution are available; they all begin with the -+two letters `\fBzf\fP\&'\&. They may already have been installed on your system; -+otherwise, you will need to find them and copy them\&. The directory should -+appear as one of the elements of the \fB$fpath\fP array (this should already -+be the case if they were installed), and at least the function \fBzfinit\fP -+should be autoloaded; it will autoload the rest\&. Finally, to initialize -+the use of the system you need to call the \fBzfinit\fP function\&. The -+following code in your \fB\&.zshrc\fP will arrange for this; assume the -+functions are stored in the directory \fB~/myfns\fP: -+.PP -+.RS -+.nf -+\fBfpath=(~/myfns $fpath) -+autoload \-U zfinit -+zfinit\fP -+.fi -+.RE -+.PP -+Note that \fBzfinit\fP assumes you are using the \fBzmodload\fP method to -+load the \fBzftp\fP command\&. If it is already built into the shell, change -+\fBzfinit\fP to \fBzfinit \-n\fP\&. It is helpful (though not essential) if the -+call to \fBzfinit\fP appears after any code to initialize the new completion -+system, else unnecessary \fBcompctl\fP commands will be given\&. -+.PP -+.SH "FUNCTIONS" -+.PP -+The sequence of operations in performing a file transfer is essentially the -+same as that in a standard FTP client\&. Note that, due to a quirk of the -+shell\&'s \fBgetopts\fP builtin, for those functions that handle options you -+must use `\fB\-\fP\fB\-\fP\&' rather than `\fB\-\fP' to ensure the remaining arguments -+are treated literally (a single `\fB\-\fP\&' is treated as an argument)\&. -+.PP -+.SS "Opening a connection" -+.PD 0 -+.TP -+.PD -+\fBzfparams [ \fIhost\fP [ \fIuser\fP [ \fIpassword\fP \&.\&.\&. ] ] ]\fP -+Set or show the parameters for a future \fBzfopen\fP with no arguments\&. If -+no arguments are given, the current parameters are displayed (the password -+will be shown as a line of asterisks)\&. If a host is given, and either the -+\fIuser\fP or \fIpassword\fP is not, they will be prompted for; also, any -+parameter given as `\fB?\fP\&' will be prompted for, and if the `\fB?\fP' is -+followed by a string, that will be used as the prompt\&. As \fBzfopen\fP calls -+\fBzfparams\fP to store the parameters, this usually need not be called -+directly\&. -+.RS -+.PP -+A single argument `\fB\-\fP\&' will delete the stored parameters\&. This will -+also cause the memory of the last directory (and so on) on the other host -+to be deleted\&. -+.RE -+.TP -+\fBzfopen [ \-1 ] [ \fIhost\fP [ \fIuser\fP [ \fIpassword\fP [ \fIaccount\fP ] ] ] ]\fP -+If \fIhost\fP is present, open a connection to that host under username -+\fIuser\fP with password \fIpassword\fP (and, on the rare occasions when it -+is necessary, account \fIaccount\fP)\&. If a necessary parameter is missing or -+given as `\fB?\fP\&' it will be prompted for\&. If \fIhost\fP is not present, use -+a previously stored set of parameters\&. -+.RS -+.PP -+If the command was successful, and the terminal is compatible with -+\fBxterm\fP or is \fBsun\-cmd\fP, a summary will appear in the title bar, -+giving the local \fBhost:directory\fP and the remote \fBhost:directory\fP; -+this is handled by the function \fBzftp_chpwd\fP, described below\&. -+.PP -+Normally, the \fIhost\fP, \fIuser\fP and \fIpassword\fP are internally -+recorded for later re\-opening, either by a \fBzfopen\fP with no arguments, or -+automatically (see below)\&. With the option `\fB\-1\fP\&', no information is -+stored\&. Also, if an open command with arguments failed, the parameters -+will not be retained (and any previous parameters will also be deleted)\&. -+A \fBzfopen\fP on its own, or a \fBzfopen \-1\fP, never alters the stored -+parameters\&. -+.PP -+Both \fBzfopen\fP and \fBzfanon\fP (but not \fBzfparams\fP) understand URLs of -+the form \fBftp://\fP\fIhost\fP/\fIpath\&.\&.\&.\fP as meaning to connect to the -+\fIhost\fP, then change directory to \fIpath\fP (which must be a directory, -+not a file)\&. The `\fBftp://\fP\&' can be omitted; the trailing `\fB/\fP' is enough -+to trigger recognition of the \fIpath\fP\&. Note prefixes other than -+`\fBftp:\fP\&' are not recognized, and that all characters after the first -+slash beyond \fIhost\fP are significant in \fIpath\fP\&. -+.RE -+.TP -+\fBzfanon [ \-1 ] \fIhost\fP\fP -+Open a connection \fIhost\fP for anonymous FTP\&. The username used is -+`\fBanonymous\fP\&'\&. The password (which will be reported the first time) is -+generated as \fIuser\fP\fB@\fP\fIhost\fP; this is then stored in the shell -+parameter \fB$EMAIL_ADDR\fP which can alternatively be set manually to a -+suitable string\&. -+.PP -+.SS "Directory management" -+.PD 0 -+.TP -+.PD 0 -+\fBzfcd [ \fIdir\fP ]\fP -+.TP -+.PD 0 -+\fBzfcd \-\fP -+.TP -+.PD -+\fBzfcd \fIold\fP \fInew\fP\fP -+Change the current directory on the remote server: this is implemented to -+have many of the features of the shell builtin \fBcd\fP\&. -+.RS -+.PP -+In the first form with \fIdir\fP present, change to the directory \fIdir\fP\&. -+The command `\fBzfcd \&.\&.\fP\&' is treated specially, so is guaranteed to work on -+non\-UNIX servers (note this is handled internally by \fBzftp\fP)\&. If \fIdir\fP -+is omitted, has the effect of `\fBzfcd ~\fP\&'\&. -+.PP -+The second form changes to the directory previously current\&. -+.PP -+The third form attempts to change the current directory by replacing the -+first occurrence of the string \fIold\fP with the string \fInew\fP in the -+current directory\&. -+.PP -+Note that in this command, and indeed anywhere a remote filename is -+expected, the string which on the local host corresponds to `\fB~\fP\&' is -+converted back to a `\fB~\fP\&' before being passed to the remote machine\&. -+This is convenient because of the way expansion is performed on the command -+line before \fBzfcd\fP receives a string\&. For example, suppose the command -+is `\fBzfcd ~/foo\fP\&'\&. The shell will expand this to a full path such as -+`\fBzfcd /home/user2/pws/foo\fP\&'\&. At this stage, \fBzfcd\fP recognises the -+initial path as corresponding to `\fB~\fP\&' and will send the directory to -+the remote host as \fB~/foo\fP, so that the `\fB~\fP\&' will be expanded by the -+server to the correct remote host directory\&. Other named directories of -+the form `\fB~name\fP\&' are not treated in this fashion\&. -+.RE -+.TP -+\fBzfhere\fP -+Change directory on the remote server to the one corresponding to the -+current local directory, with special handling of `\fB~\fP\&' as in \fBzfcd\fP\&. -+For example, if the current local directory is \fB~/foo/bar\fP, then -+\fBzfhere\fP performs the effect of `\fBzfcd ~/foo/bar\fP\&'\&. -+.TP -+\fBzfdir [ \-rfd ] [ \- ] [ \fIdir\-options\fP ] [ \fIdir\fP ]\fP -+Produce a long directory listing\&. The arguments \fIdir\-options\fP and -+\fIdir\fP are passed directly to the server and their effect is -+implementation dependent, but specifying a particular remote directory -+\fIdir\fP is usually possible\&. The output is passed through a pager -+given by the environment variable \fB$PAGER\fP, or `\fBmore\fP\&' if that is not -+set\&. -+.RS -+.PP -+The directory is usually cached for re\-use\&. In fact, two caches are -+maintained\&. One is for use when there is no \fIdir\-options\fP or \fIdir\fP, -+i\&.e\&. a full listing of the current remote directory; it is flushed -+when the current remote directory changes\&. The other is -+kept for repeated use of \fBzfdir\fP with the same arguments; for example, -+repeated use of `\fBzfdir /pub/gnu\fP\&' will only require the directory to be -+retrieved on the first call\&. Alternatively, this cache can be re\-viewed with -+the \fB\-r\fP option\&. As relative directories will confuse -+\fBzfdir\fP, the \fB\-f\fP option can be used to force the cache to be flushed -+before the directory is listed\&. The option \fB\-d\fP will delete both -+caches without showing a directory listing; it will also delete the cache -+of file names in the current remote directory, if any\&. -+.RE -+.TP -+\fBzfls\fP [ \fIls\-options\fP ] [ \fIdir\fP ] -+List files on the remote server\&. With no arguments, this will produce a -+simple list of file names for the current remote directory\&. Any arguments -+are passed directly to the server\&. No pager and no caching is used\&. -+.PP -+.SS "Status commands" -+.PD 0 -+.TP -+.PD -+\fBzftype\fP [ \fItype\fP ] -+With no arguments, show the type of data to be transferred, usually ASCII -+or binary\&. With an argument, change the type: the types `\fBA\fP\&' or -+`\fBASCII\fP\&' for ASCII data and `\fBB\fP' or `\fBBINARY\fP', `\fBI\fP' or -+`\fBIMAGE\fP\&' for binary data are understood case\-insensitively\&. -+.TP -+\fBzfstat\fP [ \-v ] -+Show the status of the current or last connection, as well as the status of -+some of \fBzftp\fP\&'s status variables\&. With the \fB\-v\fP option, a more -+verbose listing is produced by querying the server for its version of -+events, too\&. -+.PP -+.SS "Retrieving files" -+The commands for retrieving files all take at least two options\&. \fB\-G\fP -+suppresses remote filename expansion which would otherwise be performed -+(see below for a more detailed description of that)\&. \fB\-t\fP attempts -+to set the modification time of the local file to that of the remote file: -+see the description of the function \fBzfrtime\fP below for more information\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBzfget [ \-Gtc ] \fIfile1\fP \&.\&.\&.\fP -+Retrieve all the listed files \fIfile1\fP \&.\&.\&. one at a time from the remote -+server\&. If a file contains a `\fB/\fP\&', the full name is passed to the -+remote server, but the file is stored locally under the name given by the -+part after the final `\fB/\fP\&'\&. The option \fB\-c\fP (cat) forces all files to -+be sent as a single stream to standard output; in this case the \fB\-t\fP -+option has no effect\&. -+.TP -+\fBzfuget [ \-Gvst ] \fIfile1\fP \&.\&.\&.\fP -+As \fBzfget\fP, but only retrieve files where the version on the remote -+server is newer (has a later modification time), or where the local file -+does not exist\&. If the remote file is older but the files have different -+sizes, or if the sizes are the same but the remote file is newer, the user -+will usually be queried\&. With the option \fB\-s\fP, the command runs silently -+and will always retrieve the file in either of those two cases\&. With the -+option \fB\-v\fP, the command prints more information about the files while it -+is working out whether or not to transfer them\&. -+.TP -+\fBzfcget [ \-Gt ] \fIfile1\fP \&.\&.\&.\fP -+As \fBzfget\fP, but if any of the local files exists, and is shorter than -+the corresponding remote file, the command assumes that it is the result of -+a partially completed transfer and attempts to transfer the rest of the -+file\&. This is useful on a poor connection which keeps failing\&. -+.RS -+.PP -+Note that this requires a commonly implemented, but non\-standard, version -+of the FTP protocol, so is not guaranteed to work on all servers\&. -+.RE -+.TP -+.PD 0 -+\fBzfgcp [ \-Gt ] \fIremote\-file\fP \fIlocal\-file\fP\fP -+.TP -+.PD -+\fBzfgcp [ \-Gt ] \fIrfile1\fP \&.\&.\&. \fIldir\fP\fP -+This retrieves files from the remote server with arguments behaving -+similarly to the \fBcp\fP command\&. -+.RS -+.PP -+In the first form, copy \fIremote\-file\fP from the server to the local file -+\fIlocal\-file\fP\&. -+.PP -+In the second form, copy all the remote files \fIrfile1\fP \&.\&.\&. into the -+local directory \fIldir\fP retaining the same basenames\&. This assumes UNIX -+directory semantics\&. -+.RE -+.RE -+.PP -+.SS "Sending files" -+.PD 0 -+.TP -+.PD -+\fBzfput [ \-r ] \fIfile1\fP \&.\&.\&.\fP -+Send all the \fIfile1\fP \&.\&.\&. given separately to the remote server\&. If a -+filename contains a `\fB/\fP\&', the full filename is used locally to find the -+file, but only the basename is used for the remote file name\&. -+.RS -+.PP -+With the option \fB\-r\fP, if any of the \fIfiles\fP are directories they are -+sent recursively with all their subdirectories, including files beginning -+with `\fB\&.\fP\&'\&. This requires that the remote machine understand UNIX file -+semantics, since `\fB/\fP\&' is used as a directory separator\&. -+.RE -+.TP -+\fBzfuput [ \-vs ] \fIfile1\fP \&.\&.\&.\fP -+As \fBzfput\fP, but only send files which are newer than their local -+equivalents, or if the remote file does not exist\&. The logic is the same -+as for \fBzfuget\fP, but reversed between local and remote files\&. -+.TP -+\fBzfcput \fIfile1\fP \&.\&.\&.\fP -+As \fBzfput\fP, but if any remote file already exists and is shorter than the -+local equivalent, assume it is the result of an incomplete transfer and -+send the rest of the file to append to the existing part\&. As the FTP -+append command is part of the standard set, this is in principle more -+likely to work than \fBzfcget\fP\&. -+.TP -+.PD 0 -+\fBzfpcp \fIlocal\-file\fP \fIremote\-file\fP\fP -+.TP -+.PD -+\fBzfpcp \fIlfile1\fP \&.\&.\&. \fIrdir\fP\fP -+This sends files to the remote server with arguments behaving similarly to -+the \fBcp\fP command\&. -+.RS -+.PP -+With two arguments, copy \fIlocal\-file\fP to the server as -+\fIremote\-file\fP\&. -+.PP -+With more than two arguments, copy all the local files \fIlfile1\fP \&.\&.\&. into -+the existing remote directory \fIrdir\fP retaining the same basenames\&. This -+assumes UNIX directory semantics\&. -+.PP -+A problem arises if you attempt to use \fBzfpcp\fP \fIlfile1\fP \fIrdir\fP, -+i\&.e\&. the second form of copying but with two arguments, as the command has -+no simple way of knowing if \fIrdir\fP corresponds to a directory or a -+filename\&. It attempts to resolve this in various ways\&. First, if the -+\fIrdir\fP argument is `\fB\&.\fP\&' or `\fB\&.\&.\fP' or ends in a slash, it is assumed -+to be a directory\&. Secondly, if the operation of copying to a remote file -+in the first form failed, and the remote server sends back the expected -+failure code 553 and a reply including the string `\fBIs a directory\fP\&', -+then \fBzfpcp\fP will retry using the second form\&. -+.RE -+.RE -+.PP -+.SS "Closing the connection" -+.PD 0 -+.TP -+.PD -+\fBzfclose\fP -+Close the connection\&. -+.PP -+.SS "Session management" -+.PD 0 -+.TP -+.PD -+\fBzfsession\fP [ \fB\-lvod\fP ] [ \fIsessname\fP ] -+Allows you to manage multiple FTP sessions at once\&. By default, -+connections take place in a session called `\fBdefault\fP\&'; by giving the -+command `\fBzfsession\fP \fIsessname\fP\&' you can change to a new or existing -+session with a name of your choice\&. The new session remembers its own -+connection, as well as associated shell parameters, and also the host/user -+parameters set by \fBzfparams\fP\&. Hence you can have different sessions set -+up to connect to different hosts, each remembering the appropriate host, -+user and password\&. -+.RS -+.PP -+With no arguments, \fBzfsession\fP prints the name of the current session; -+with the option \fB\-l\fP it lists all sessions which currently exist, and -+with the option \fB\-v\fP it gives a verbose list showing the host and -+directory for each session, where the current session is marked with an -+asterisk\&. With \fB\-o\fP, it will switch to the most recent previous session\&. -+.PP -+With \fB\-d\fP, the given session (or else the current one) is removed; -+everything to do with it is completely forgotten\&. If it was the only -+session, a new session called `\fBdefault\fP\&' is created and made current\&. -+It is safest not to delete sessions while background commands using -+\fBzftp\fP are active\&. -+.RE -+.TP -+\fBzftransfer\fP \fIsess1\fP\fB:\fP\fIfile1\fP \fIsess2\fP\fB:\fP\fIfile2\fP -+Transfer files between two sessions; no local copy is made\&. The file -+is read from the session \fIsess1\fP as \fIfile1\fP and written to session -+\fIsess2\fP as file \fIfile2\fP; \fIfile1\fP and \fIfile2\fP may be relative to -+the current directories of the session\&. Either \fIsess1\fP or \fIsess2\fP -+may be omitted (though the colon should be retained if there is a -+possibility of a colon appearing in the file name) and defaults to the -+current session; \fIfile2\fP may be omitted or may end with a slash, in -+which case the basename of \fIfile1\fP will be added\&. The sessions -+\fIsess1\fP and \fIsess2\fP must be distinct\&. -+.RS -+.PP -+The operation is performed using pipes, so it is required that the -+connections still be valid in a subshell, which is not the case under -+versions of some operating systems, presumably due to a system bug\&. -+.RE -+.RE -+.PP -+.SS "Bookmarks" -+The two functions \fBzfmark\fP and \fBzfgoto\fP allow you to `bookmark\&' the -+present location (host, user and directory) of the current FTP connection -+for later use\&. The file to be used for storing and retrieving bookmarks is -+given by the parameter \fB$ZFTP_BMFILE\fP; if not set when one of the two -+functions is called, it will be set to the file \fB\&.zfbkmarks\fP in the -+directory where your zsh startup files live (usually \fB~\fP)\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBzfmark [ \fP\fIbookmark\fP\fB ]\fP -+If given an argument, mark the current host, user and directory under the -+name \fIbookmark\fP for later use by \fBzfgoto\fP\&. If there is no connection -+open, use the values for the last connection immediately before it was -+closed; it is an error if there was none\&. Any existing bookmark -+under the same name will be silently replaced\&. -+.RS -+.PP -+If not given an argument, list the existing bookmarks and the points to -+which they refer in the form \fIuser\fP\fB@\fP\fIhost\fP\fB:\fP\fIdirectory\fP; -+this is the format in which they are stored, and the file may be edited -+directly\&. -+.RE -+.TP -+\fBzfgoto [ \-n ] \fP\fIbookmark\fP -+Return to the location given by \fIbookmark\fP, as previously set by -+\fBzfmark\fP\&. If the location has user `\fBftp\fP\&' or `\fBanonymous\fP', open -+the connection with \fBzfanon\fP, so that no password is required\&. If the -+user and host parameters match those stored for the current session, if -+any, those will be used, and again no password is required\&. Otherwise a -+password will be prompted for\&. -+.RS -+.PP -+With the option \fB\-n\fP, the bookmark is taken to be a nickname stored by -+the \fBncftp\fP program in its bookmark file, which is assumed to be -+\fB~/\&.ncftp/bookmarks\fP\&. The function works identically in other ways\&. -+Note that there is no mechanism for adding or modifying \fBncftp\fP bookmarks -+from the zftp functions\&. -+.RE -+.RE -+.PP -+.SS "Other functions" -+Mostly, these functions will not be called directly (apart from -+\fBzfinit\fP), but are described here for completeness\&. You may wish to -+alter \fBzftp_chpwd\fP and \fBzftp_progress\fP, in particular\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBzfinit [ \-n ]\fP -+As described above, this is used to initialize the zftp function system\&. -+The \fB\-n\fP option should be used if the zftp command is already built into -+the shell\&. -+.TP -+\fBzfautocheck [ \-dn ]\fP -+This function is called to implement automatic reopening behaviour, as -+described in more detail below\&. The options must appear in the first -+argument; \fB\-n\fP prevents the command from changing to the old directory, -+while \fB\-d\fP prevents it from setting the variable \fBdo_close\fP, which it -+otherwise does as a flag for automatically closing the connection after a -+transfer\&. The host and directory for the last session are stored in the -+variable \fB$zflastsession\fP, but the internal host/user/password parameters -+must also be correctly set\&. -+.TP -+\fBzfcd_match \fIprefix\fP \fIsuffix\fP\fP -+This performs matching for completion of remote directory names\&. If the -+remote server is UNIX, it will attempt to persuade the server to list the -+remote directory with subdirectories marked, which usually works but is not -+guaranteed\&. On other hosts it simply calls \fBzfget_match\fP and hence -+completes all files, not just directories\&. On some systems, directories -+may not even look like filenames\&. -+.TP -+\fBzfget_match \fIprefix\fP \fIsuffix\fP\fP -+This performs matching for completion of remote filenames\&. It caches files -+for the current directory (only) in the shell parameter \fB$zftp_fcache\fP\&. -+It is in the form to be called by the \fB\-K\fP option of \fBcompctl\fP, but -+also works when called from a widget\-style completion function with -+\fIprefix\fP and \fIsuffix\fP set appropriately\&. -+.TP -+\fBzfrglob \fIvarname\fP\fP -+Perform remote globbing, as describes in more detail below\&. \fIvarname\fP -+is the name of a variable containing the pattern to be expanded; if there -+were any matches, the same variable will be set to the expanded set of -+filenames on return\&. -+.TP -+\fBzfrtime \fIlfile\fP \fIrfile\fP [ \fItime\fP ]\fP -+Set the local file \fIlfile\fP to have the same modification time as the -+remote file \fIrfile\fP, or the explicit time \fItime\fP in FTP format -+\fBCCYYMMDDhhmmSS\fP for the GMT timezone\&. This uses the shell\&'s -+\fBzsh/datetime\fP module to perform the conversion from -+GMT to local time\&. -+.TP -+\fBzftp_chpwd\fP -+This function is called every time a connection is opened, or closed, or -+the remote directory changes\&. This version alters the title bar of an -+\fBxterm\fP\-compatible or \fBsun\-cmd\fP terminal emulator to reflect the -+local and remote hostnames and current directories\&. It works best when -+combined with the function \fBchpwd\fP\&. In particular, a function of -+the form -+.RS -+.PP -+.RS -+.nf -+\fBchpwd() { -+ if [[ \-n $ZFTP_USER ]]; then -+ zftp_chpwd -+ else -+ # usual chpwd e\&.g put host:directory in title bar -+ fi -+}\fP -+.fi -+.RE -+.PP -+fits in well\&. -+.RE -+.TP -+\fBzftp_progress\fP -+This function shows the status of the transfer\&. It will not write anything -+unless the output is going to a terminal; however, if you transfer files in -+the background, you should turn off progress reports by hand using -+`\fBzstyle \&':zftp:*' progress none\fP'\&. Note also that if you alter it, any -+output \fImust\fP be to standard error, as standard output may be a file -+being received\&. The form of the progress meter, or whether it is used at -+all, can be configured without altering the function, as described in the -+next section\&. -+.TP -+\fBzffcache\fP -+This is used to implement caching of files in the current directory for -+each session separately\&. It is used by \fBzfget_match\fP and \fBzfrglob\fP\&. -+.PP -+.SH "MISCELLANEOUS FEATURES" -+.PP -+.SS "Configuration" -+.PP -+Various styles are available using the standard shell style mechanism, -+described in -+\fIzshmodules\fP(1)\&. Briefly, the -+command `\fBzstyle \&':zftp:*'\fP \fIstyle\fP \fIvalue\fP \&.\&.\&.'\&. -+defines the \fIstyle\fP to have value \fIvalue\fP; more than one value may be -+given, although that is not useful in the cases described here\&. These -+values will then be used throughout the zftp function system\&. For more -+precise control, the first argument, which gives a context in which the -+style applies, can be modified to include a particular function, as for -+example `\fB:zftp:zfget\fP\&': the style will then have the given value only -+in the \fBzfget\fP function\&. Values for the same style in different contexts -+may be set; the most specific function will be used, where -+strings are held to be more specific than patterns, and longer patterns and -+shorter patterns\&. Note that only the top level function name, as called by -+the user, is used; calling of lower level functions is transparent to the -+user\&. Hence modifications to the title bar in \fBzftp_chpwd\fP use the -+contexts \fB:zftp:zfopen\fP, \fB:zftp:zfcd\fP, etc\&., depending where it was -+called from\&. The following styles are understood: -+.PP -+.PD 0 -+.TP -+.PD -+\fBprogress\fP -+Controls the way that \fBzftp_progress\fP reports on the progress of a -+transfer\&. If empty, unset, or `\fBnone\fP\&', no progress report is made; if -+`\fBbar\fP\&' a growing bar of inverse video is shown; if `\fBpercent\fP' (or any -+other string, though this may change in future), the percentage of the file -+transferred is shown\&. The bar meter requires that the width of the -+terminal be available via the \fB$COLUMNS\fP parameter (normally this is set -+automatically)\&. If the size of the file being transferred is not -+available, \fBbar\fP and \fBpercent\fP meters will simply show the number of -+bytes transferred so far\&. -+.RS -+.PP -+When \fBzfinit\fP is run, if this style is not defined for the context -+\fB:zftp:*\fP, it will be set to `bar\&'\&. -+.RE -+.TP -+\fBupdate\fP -+Specifies the minimum time interval between updates of the progress meter -+in seconds\&. No update is made unless new data has been received, so the -+actual time interval is limited only by \fB$ZFTP_TIMEOUT\fP\&. -+.RS -+.PP -+As described for \fBprogress\fP, \fBzfinit\fP will force this to default to 1\&. -+.RE -+.TP -+\fBremote\-glob\fP -+If set to `1\&', `yes' or `true', filename generation (globbing) is -+performed on the remote machine instead of by zsh itself; see below\&. -+.TP -+\fBtitlebar\fP -+If set to `1\&', `yes' or `true', \fBzftp_chpwd\fP will put the remote host and -+remote directory into the titlebar of terminal emulators such as xterm or -+sun\-cmd that allow this\&. -+.RS -+.PP -+As described for \fBprogress\fP, \fBzfinit\fP will force this to default to 1\&. -+.RE -+.TP -+\fBchpwd\fP -+If set to `1\&' `yes' or `true', \fBzftp_chpwd\fP will call the function -+\fBchpwd\fP when a connection is closed\&. This is useful if the remote host -+details were put into the terminal title bar by \fBzftp_chpwd\fP and your -+usual \fBchpwd\fP also modifies the title bar\&. -+.RS -+.PP -+When \fBzfinit\fP is run, it will determine whether \fBchpwd\fP exists and if -+so it will set the default value for the style to 1 if none exists -+already\&. -+.RE -+.RE -+.PP -+Note that there is also an associative array \fBzfconfig\fP which contains -+values used by the function system\&. This should not be modified or -+overwritten\&. -+.PP -+.SS "Remote globbing" -+.PP -+The commands for retrieving files usually perform filename generation -+(globbing) on their arguments; this can be turned off by passing the option -+\fB\-G\fP to each of the commands\&. Normally this operates by retrieving a -+complete list of files for the directory in question, then matching these -+locally against the pattern supplied\&. This has the advantage that the full -+range of zsh patterns (respecting the setting of the option -+\fBEXTENDED_GLOB\fP) can be used\&. However, it means that the directory part -+of a filename will not be expanded and must be given exactly\&. If the -+remote server does not support the UNIX directory semantics, directory -+handling is problematic and it is recommended that globbing only be used -+within the current directory\&. The list of files in the current directory, -+if retrieved, will be cached, so that subsequent globs in the same -+directory without an intervening \fBzfcd\fP are much faster\&. -+.PP -+If the \fBremote\-glob\fP style (see above) is set, globbing is instead -+performed on the remote host: the server is asked for a list of matching -+files\&. This is highly dependent on how the server is implemented, though -+typically UNIX servers will provide support for basic glob patterns\&. This -+may in some cases be faster, as it avoids retrieving the entire list of -+directory contents\&. -+.PP -+.SS "Automatic and temporary reopening" -+.PP -+As described for the \fBzfopen\fP command, a subsequent \fBzfopen\fP with no -+parameters will reopen the connection to the last host (this includes -+connections made with the \fBzfanon\fP command)\&. Opened in this fashion, the -+connection starts in the default remote directory and will remain open -+until explicitly closed\&. -+.PP -+Automatic re\-opening is also available\&. If a connection is not currently -+open and a command requiring a connection is given, the last connection is -+implicitly reopened\&. In this case the directory which was current when the -+connection was closed again becomes the current directory (unless, of -+course, the command given changes it)\&. Automatic reopening will also take -+place if the connection was close by the remote server for whatever reason -+(e\&.g\&. a timeout)\&. It is not available if the \fB\-1\fP option to \fBzfopen\fP -+or \fBzfanon\fP was used\&. -+.PP -+Furthermore, if the command issued is a file transfer, the connection will -+be closed after the transfer is finished, hence providing a one\-shot mode -+for transfers\&. This does not apply to directory changing or listing -+commands; for example a \fBzfdir\fP may reopen a connection but will leave it -+open\&. Also, automatic closure will only ever happen in the same command as -+automatic opening, i\&.e a \fBzfdir\fP directly followed by a \fBzfget\fP will -+never close the connection automatically\&. -+.PP -+Information about the previous connection is given by the \fBzfstat\fP -+function\&. So, for example, if that reports: -+.PP -+.RS -+.nf -+\fBSession: default -+Not connected\&. -+Last session: ftp\&.bar\&.com:/pub/textfiles\fP -+.fi -+.RE -+.PP -+then the command \fBzfget file\&.txt\fP will attempt to reopen a connection to -+\fBftp\&.bar\&.com\fP, retrieve the file \fB/pub/textfiles/file\&.txt\fP, and -+immediately close the connection again\&. On the other hand, \fBzfcd \&.\&.\fP -+will open the connection in the directory \fB/pub\fP and leave it open\&. -+.PP -+Note that all the above is local to each session; if you return to a -+previous session, the connection for that session is the one which will be -+reopened\&. -+.PP -+.SS "Completion" -+.PP -+Completion of local and remote files, directories, sessions and bookmarks -+is supported\&. The older, \fBcompctl\fP\-style completion is defined when -+\fBzfinit\fP is called; support for the new widget\-based completion system is -+provided in the function \fBCompletion/Zsh/Command/_zftp\fP, which should be -+installed with the other functions of the completion system and hence -+should automatically be available\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zsh.1 -@@ -0,0 +1,496 @@ -+.TH "ZSH" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zsh \- the Z shell -+.\" Yodl file: Zsh/intro.yo -+.SH "OVERVIEW" -+Because zsh contains many features, the zsh manual has been split into -+a number of sections: -+.PP -+.PD 0 -+.TP -+\fIzsh\fP Zsh overview (this section) -+.TP -+\fIzshroadmap\fP Informal introduction to the manual -+.TP -+\fIzshmisc\fP Anything not fitting into the other sections -+.TP -+\fIzshexpn\fP Zsh command and parameter expansion -+.TP -+\fIzshparam\fP Zsh parameters -+.TP -+\fIzshoptions\fP Zsh options -+.TP -+\fIzshbuiltins\fP Zsh built\-in functions -+.TP -+\fIzshzle\fP Zsh command line editing -+.TP -+\fIzshcompwid\fP Zsh completion widgets -+.TP -+\fIzshcompsys\fP Zsh completion system -+.TP -+\fIzshcompctl\fP Zsh completion control -+.TP -+\fIzshmodules\fP Zsh loadable modules -+.TP -+\fIzshcalsys\fP Zsh built\-in calendar functions -+.TP -+\fIzshtcpsys\fP Zsh built\-in TCP functions -+.TP -+\fIzshzftpsys\fP Zsh built\-in FTP client -+.TP -+\fIzshcontrib\fP Additional zsh functions and utilities -+.TP -+\fIzshall\fP Meta\-man page containing all of the above -+.PD -+.SH "DESCRIPTION" -+Zsh is a UNIX command interpreter (shell) usable as an interactive -+login shell and as a shell script command processor\&. Of the standard shells, -+zsh most closely resembles \fBksh\fP but includes many enhancements\&. Zsh -+has command line editing, builtin spelling correction, programmable -+command completion, shell functions (with autoloading), a history -+mechanism, and a host of other features\&. -+.\" Yodl file: Zsh/metafaq.yo -+.SH "AUTHOR" -+Zsh was originally written by Paul Falstad \fB\fP\&. -+Zsh is now maintained by the members of the zsh\-workers mailing -+list \fB\fP\&. The development is currently -+coordinated by Peter Stephenson \fB\fP\&. The coordinator -+can be contacted at \fB\fP, but matters relating to -+the code should generally go to the mailing list\&. -+.SH "AVAILABILITY" -+Zsh is available from the following anonymous FTP sites\&. These mirror -+sites are kept frequently up to date\&. The sites marked with \fI(H)\fP may be -+mirroring \fBftp\&.cs\&.elte\&.hu\fP instead of the primary site\&. -+.PP -+.PD 0 -+.TP -+.PD -+Primary site -+.nf -+\fBftp://ftp\&.zsh\&.org/pub/\fP -+\fBhttp://www\&.zsh\&.org/pub/\fP -+.fi -+.TP -+Australia -+.nf -+\fBftp://ftp\&.zsh\&.org/pub/\fP -+\fBhttp://www\&.zsh\&.org/pub/\fP -+.fi -+.TP -+Denmark -+.nf -+\fBftp://mirrors\&.dotsrc\&.org/zsh/\fP -+.fi -+.TP -+Finland -+.nf -+\fBftp://ftp\&.funet\&.fi/pub/unix/shells/zsh/\fP -+.fi -+.TP -+France -+.nf -+\fBftp://nephtys\&.lip6\&.fr/pub/unix/shells/zsh/\fP -+.fi -+.TP -+Germany -+.nf -+\fBftp://ftp\&.fu\-berlin\&.de/pub/unix/shells/zsh/\fP -+.fi -+.TP -+Hungary -+.nf -+\fBftp://ftp\&.kfki\&.hu/pub/packages/zsh/\fP -+.fi -+.TP -+Poland -+.nf -+\fBftp://sunsite\&.icm\&.edu\&.pl/pub/unix/shells/zsh/\fP -+.fi -+.PP -+The up\-to\-date source code is available via anonymous CVS and Git from -+Sourceforge\&. See \fBhttp://sourceforge\&.net/projects/zsh/\fP for details\&. -+A summary of instructions for the CVS and Git archives can be found at -+\fBhttp://zsh\&.sourceforget\&.net/\fP\&. -+.PP -+.SH "MAILING LISTS" -+Zsh has 3 mailing lists: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\fP -+Announcements about releases, major changes in the shell and the -+monthly posting of the Zsh FAQ\&. (moderated) -+.TP -+\fB\fP -+User discussions\&. -+.TP -+\fB\fP -+Hacking, development, bug reports and patches\&. -+.PP -+To subscribe or unsubscribe, send mail -+to the associated administrative address for the mailing list\&. -+.PP -+.PD 0 -+.TP -+\fB\fP -+.TP -+\fB\fP -+.TP -+\fB\fP -+.PP -+.TP -+\fB\fP -+.TP -+\fB\fP -+.TP -+\fB\fP -+.PD -+.PP -+YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED\&. -+All submissions to \fBzsh\-announce\fP are automatically forwarded to -+\fBzsh\-users\fP\&. All submissions to \fBzsh\-users\fP are automatically -+forwarded to \fBzsh\-workers\fP\&. -+.PP -+If you have problems subscribing/unsubscribing to any of the mailing -+lists, send mail to \fB\fP\&. The mailing lists are -+maintained by Karsten Thygesen \fB\fP\&. -+.PP -+The mailing lists are archived; the archives can be accessed via the -+administrative addresses listed above\&. There is also a hypertext -+archive, maintained by Geoff Wing \fB\fP, available at -+\fBhttp://www\&.zsh\&.org/mla/\fP\&. -+.SH "THE ZSH FAQ" -+Zsh has a list of Frequently Asked Questions (FAQ), maintained by -+Peter Stephenson \fB\fP\&. It is regularly posted to the -+newsgroup \fBcomp\&.unix\&.shell\fP and the \fBzsh\-announce\fP mailing list\&. -+The latest version can be found at any of the Zsh FTP sites, or at -+\fBhttp://www\&.zsh\&.org/FAQ/\fP\&. The contact address for FAQ\-related matters -+is \fB\fP\&. -+.SH "THE ZSH WEB PAGE" -+Zsh has a web page which is located at \fBhttp://www\&.zsh\&.org/\fP\&. This is -+maintained by Karsten Thygesen \fB\fP, of SunSITE Denmark\&. -+The contact address for web\-related matters is \fB\fP\&. -+.SH "THE ZSH USERGUIDE" -+A userguide is currently in preparation\&. It is intended to complement the -+manual, with explanations and hints on issues where the manual can be -+cabbalistic, hierographic, or downright mystifying (for example, the word -+`hierographic\&' does not exist)\&. It can be viewed in its current state at -+\fBhttp://zsh\&.sourceforge\&.net/Guide/\fP\&. At the time of writing, chapters -+dealing with startup files and their contents and the new completion system -+were essentially complete\&. -+.SH "THE ZSH WIKI" -+A `wiki\&' website for zsh has been created at \fBhttp://www\&.zshwiki\&.org/\fP\&. -+This is a site which can be added to and modified directly by users without -+any special permission\&. You can add your own zsh tips and configurations\&. -+.\" Yodl file: Zsh/invoke.yo -+.SH "INVOCATION" -+The following flags are interpreted by the shell when invoked to determine -+where the shell will read commands from: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-c\fP -+Take the first argument as a command to execute, rather than reading commands -+from a script or standard input\&. If any further arguments are given, the -+first one is assigned to \fB$0\fP, rather than being used as a positional -+parameter\&. -+.TP -+\fB\-i\fP -+Force shell to be interactive\&. It is still possible to specify a -+script to execute\&. -+.TP -+\fB\-s\fP -+Force shell to read commands from the standard input\&. -+If the \fB\-s\fP flag is not present and an argument is given, -+the first argument is taken to be the pathname of a script to -+execute\&. -+.PP -+If there are any remaining arguments after option processing, and neither -+of the options \fB\-c\fP or \fB\-s\fP was supplied, the first argument is taken -+as the file name of a script containing shell commands to be executed\&. If -+the option \fBPATH_SCRIPT\fP is set, and the file name does not contain a -+directory path (i\&.e\&. there is no `\fB/\fP\&' in the name), first the current -+directory and then the command path given by the variable \fBPATH\fP are -+searched for the script\&. If the option is not set or the file name -+contains a `\fB/\fP\&' it is used directly\&. -+.PP -+After the first one or two arguments have been appropriated as described above, -+the remaining arguments are assigned to the positional parameters\&. -+.PP -+For further options, which are common to invocation and the \fBset\fP -+builtin, see -+\fIzshoptions\fP(1)\&. -+.PP -+Options may be specified by name using the \fB\-o\fP option\&. \fB\-o\fP acts like -+a single\-letter option, but takes a following string as the option name\&. -+For example, -+.PP -+.RS -+.nf -+\fBzsh \-x \-o shwordsplit scr\fP -+.fi -+.RE -+.PP -+runs the script \fBscr\fP, setting the \fBXTRACE\fP option by the corresponding -+letter `\fB\-x\fP\&' and the \fBSH_WORD_SPLIT\fP option by name\&. -+Options may be turned \fIoff\fP by name by using \fB+o\fP instead of \fB\-o\fP\&. -+\fB\-o\fP can be stacked up with preceding single\-letter options, so for example -+`\fB\-xo shwordsplit\fP\&' or `\fB\-xoshwordsplit\fP' is equivalent to -+`\fB\-x \-o shwordsplit\fP\&'\&. -+.PP -+Options may also be specified by name in GNU long option style, -+`\fB\-\fP\fB\-\fP\fIoption\-name\fP\&'\&. When this is done, `\fB\-\fP' characters in the -+option name are permitted: they are translated into `\fB_\fP\&', and thus ignored\&. -+So, for example, `\fBzsh \-\fP\fB\-sh\-word\-split\fP\&' invokes zsh with the -+\fBSH_WORD_SPLIT\fP option turned on\&. Like other option syntaxes, options can -+be turned off by replacing the initial `\fB\-\fP\&' with a `\fB+\fP'; thus -+`\fB+\-sh\-word\-split\fP\&' is equivalent to `\fB\-\fP\fB\-no\-sh\-word\-split\fP'\&. -+Unlike other option syntaxes, GNU\-style long options cannot be stacked with -+any other options, so for example `\fB\-x\-shwordsplit\fP\&' is an error, -+rather than being treated like `\fB\-x \-\fP\fB\-shwordsplit\fP\&'\&. -+.PP -+The special GNU\-style option `\fB\-\fP\fB\-version\fP\&' is handled; it sends to -+standard output the shell\&'s version information, then exits successfully\&. -+`\fB\-\fP\fB\-help\fP\&' is also handled; it sends to standard output a list of -+options that can be used when invoking the shell, then exits successfully\&. -+.PP -+Option processing may be finished, allowing following arguments that start with -+`\fB\-\fP\&' or `\fB+\fP' to be treated as normal arguments, in two ways\&. -+Firstly, a lone `\fB\-\fP\&' (or `\fB+\fP') as an argument by itself ends -+option processing\&. Secondly, a special option `\fB\-\fP\fB\-\fP\&' (or -+`\fB+\-\fP\&'), which may be specified on its own (which is the standard -+POSIX usage) or may be stacked with preceding options (so `\fB\-x\-\fP\&' is -+equivalent to `\fB\-x \-\fP\fB\-\fP\&')\&. Options are not permitted to be stacked -+after `\fB\-\fP\fB\-\fP\&' (so `\fB\-x\-f\fP' is an error), but note the GNU\-style -+option form discussed above, where `\fB\-\fP\fB\-shwordsplit\fP\&' is permitted -+and does not end option processing\&. -+.PP -+Except when the \fBsh\fP/\fBksh\fP emulation single\-letter options are in effect, -+the option `\fB\-b\fP\&' (or `\fB+b\fP') ends option processing\&. -+`\fB\-b\fP\&' is like `\fB\-\fP\fB\-\fP', except that further single\-letter options -+can be stacked after the `\fB\-b\fP\&' and will take effect as normal\&. -+.PP -+.PP -+.\" Yodl file: Zsh/compat.yo -+.SH "COMPATIBILITY" -+Zsh tries to emulate \fBsh\fP or \fBksh\fP when it is invoked as -+\fBsh\fP or \fBksh\fP respectively; more precisely, it looks at the first -+letter of the name by which it was invoked, excluding any initial `\fBr\fP\&' -+(assumed to stand for `restricted\&'), and if that is `\fBs\fP' or `\fBk\fP' it -+will emulate \fBsh\fP or \fBksh\fP\&. Furthermore, if invoked as \fBsu\fP (which -+happens on certain systems when the shell is executed by the \fBsu\fP -+command), the shell will try to find an alternative name from the \fBSHELL\fP -+environment variable and perform emulation based on that\&. -+.PP -+In \fBsh\fP and \fBksh\fP compatibility modes the following -+parameters are not special and not initialized by the shell: -+\fBARGC\fP, -+\fBargv\fP, -+\fBcdpath\fP, -+\fBfignore\fP, -+\fBfpath\fP, -+\fBHISTCHARS\fP, -+\fBmailpath\fP, -+\fBMANPATH\fP, -+\fBmanpath\fP, -+\fBpath\fP, -+\fBprompt\fP, -+\fBPROMPT\fP, -+\fBPROMPT2\fP, -+\fBPROMPT3\fP, -+\fBPROMPT4\fP, -+\fBpsvar\fP, -+\fBstatus\fP, -+\fBwatch\fP\&. -+.PP -+The usual zsh startup/shutdown scripts are not executed\&. Login shells -+source \fB/etc/profile\fP followed by \fB$HOME/\&.profile\fP\&. If the -+\fBENV\fP environment variable is set on invocation, \fB$ENV\fP is sourced -+after the profile scripts\&. The value of \fBENV\fP is subjected to -+parameter expansion, command substitution, and arithmetic expansion -+before being interpreted as a pathname\&. Note that the \fBPRIVILEGED\fP -+option also affects the execution of startup files\&. -+.PP -+The following options are set if the shell is invoked as \fBsh\fP or -+\fBksh\fP: -+\fBNO_BAD_PATTERN\fP, -+\fBNO_BANG_HIST\fP, -+\fBNO_BG_NICE\fP, -+\fBNO_EQUALS\fP, -+\fBNO_FUNCTION_ARGZERO\fP, -+\fBGLOB_SUBST\fP, -+\fBNO_GLOBAL_EXPORT\fP, -+\fBNO_HUP\fP, -+\fBINTERACTIVE_COMMENTS\fP, -+\fBKSH_ARRAYS\fP, -+\fBNO_MULTIOS\fP, -+\fBNO_NOMATCH\fP, -+\fBNO_NOTIFY\fP, -+\fBPOSIX_BUILTINS\fP, -+\fBNO_PROMPT_PERCENT\fP, -+\fBRM_STAR_SILENT\fP, -+\fBSH_FILE_EXPANSION\fP, -+\fBSH_GLOB\fP, -+\fBSH_OPTION_LETTERS\fP, -+\fBSH_WORD_SPLIT\fP\&. -+Additionally the \fBBSD_ECHO\fP and \fBIGNORE_BRACES\fP -+options are set if zsh is invoked as \fBsh\fP\&. -+Also, the -+\fBKSH_OPTION_PRINT\fP, -+\fBLOCAL_OPTIONS\fP, -+\fBPROMPT_BANG\fP, -+\fBPROMPT_SUBST\fP -+and -+\fBSINGLE_LINE_ZLE\fP -+options are set if zsh is invoked as \fBksh\fP\&. -+.\" Yodl file: Zsh/restricted.yo -+.SH "RESTRICTED SHELL" -+When the basename of the command used to invoke zsh starts with the letter -+`\fBr\fP\&' or the `\fB\-r\fP' command line option is supplied at invocation, the -+shell becomes restricted\&. Emulation mode is determined after stripping the -+letter `\fBr\fP\&' from the invocation name\&. The following are disabled in -+restricted mode: -+.PP -+.PD 0 -+.TP -+.PD -+\(bu -+changing directories with the \fBcd\fP builtin -+.TP -+\(bu -+changing or unsetting the \fBPATH\fP, \fBpath\fP, \fBMODULE_PATH\fP, -+\fBmodule_path\fP, \fBSHELL\fP, \fBHISTFILE\fP, \fBHISTSIZE\fP, \fBGID\fP, \fBEGID\fP, -+\fBUID\fP, \fBEUID\fP, \fBUSERNAME\fP, \fBLD_LIBRARY_PATH\fP, -+\fBLD_AOUT_LIBRARY_PATH\fP, \fBLD_PRELOAD\fP and \fBLD_AOUT_PRELOAD\fP -+parameters -+.TP -+\(bu -+specifying command names containing \fB/\fP -+.TP -+\(bu -+specifying command pathnames using \fBhash\fP -+.TP -+\(bu -+redirecting output to files -+.TP -+\(bu -+using the \fBexec\fP builtin command to replace the shell with another -+command -+.TP -+\(bu -+using \fBjobs \-Z\fP to overwrite the shell process\&' argument and -+environment space -+.TP -+\(bu -+using the \fBARGV0\fP parameter to override \fBargv[0]\fP for external -+commands -+.TP -+\(bu -+turning off restricted mode with \fBset +r\fP or \fBunsetopt -+RESTRICTED\fP -+.PP -+These restrictions are enforced after processing the startup files\&. The -+startup files should set up \fBPATH\fP to point to a directory of commands -+which can be safely invoked in the restricted environment\&. They may also -+add further restrictions by disabling selected builtins\&. -+.PP -+Restricted mode can also be activated any time by setting the -+\fBRESTRICTED\fP option\&. This immediately enables all the restrictions -+described above even if the shell still has not processed all startup -+files\&. -+.\" Yodl file: Zsh/files.yo -+.SH "STARTUP/SHUTDOWN FILES" -+Commands are first read from \fB/etc/zshenv\fP; this cannot be overridden\&. -+Subsequent behaviour is modified by the \fBRCS\fP and -+\fBGLOBAL_RCS\fP options; the former affects all startup files, while the -+second only affects global startup files (those shown here with an -+path starting with a \fB/\fP)\&. If one of the options -+is unset at any point, any subsequent startup file(s) -+of the corresponding -+type will not be read\&. It is also possible for a file in \fB$ZDOTDIR\fP to -+re\-enable \fBGLOBAL_RCS\fP\&. Both \fBRCS\fP and \fBGLOBAL_RCS\fP are set by -+default\&. -+.PP -+Commands are then read from \fB$ZDOTDIR/\&.zshenv\fP\&. -+If the shell is a login shell, commands -+are read from \fB/etc/zprofile\fP and then \fB$ZDOTDIR/\&.zprofile\fP\&. -+Then, if the shell is interactive, -+commands are read from \fB/etc/zshrc\fP and then \fB$ZDOTDIR/\&.zshrc\fP\&. -+Finally, if the shell is a login shell, \fB/etc/zlogin\fP and -+\fB$ZDOTDIR/\&.zlogin\fP are read\&. -+.PP -+When a login shell exits, the files \fB$ZDOTDIR/\&.zlogout\fP and then -+\fB/etc/zlogout\fP are read\&. This happens with either an explicit exit -+via the \fBexit\fP or \fBlogout\fP commands, or an implicit exit by reading -+end\-of\-file from the terminal\&. However, if the shell terminates due -+to \fBexec\fP\&'ing another process, the logout files are not read\&. -+These are also affected by the \fBRCS\fP and \fBGLOBAL_RCS\fP options\&. -+Note also that the \fBRCS\fP option affects the saving of history files, -+i\&.e\&. if \fBRCS\fP is unset when the shell exits, no history file will be -+saved\&. -+.PP -+If \fBZDOTDIR\fP is unset, \fBHOME\fP is used instead\&. -+Files listed above as being in \fB/etc\fP may be in another -+directory, depending on the installation\&. -+.PP -+As \fB/etc/zshenv\fP is run for all instances of zsh, it is important that -+it be kept as small as possible\&. In particular, it is a good idea to -+put code that does not need to be run for every single shell behind -+a test of the form `\fBif [[ \-o rcs ]]; then \&.\&.\&.\fP\&' so that it will not -+be executed when zsh is invoked with the `\fB\-f\fP\&' option\&. -+.PP -+Any of these files may be pre\-compiled with the \fBzcompile\fP builtin -+command (see \fIzshbuiltins\fP(1))\&. If a compiled file exists (named for the original file plus the -+\fB\&.zwc\fP extension) and it is newer than the original file, the compiled -+file will be used instead\&. -+.\" Yodl file: Zsh/filelist.yo -+.SH "FILES" -+.PD 0 -+.TP -+\fB$ZDOTDIR/\&.zshenv\fP -+.TP -+\fB$ZDOTDIR/\&.zprofile\fP -+.TP -+\fB$ZDOTDIR/\&.zshrc\fP -+.TP -+\fB$ZDOTDIR/\&.zlogin\fP -+.TP -+\fB$ZDOTDIR/\&.zlogout\fP -+.TP -+\fB${TMPPREFIX}*\fP (default is /tmp/zsh*) -+.TP -+\fB/etc/zshenv\fP -+.TP -+\fB/etc/zprofile\fP -+.TP -+\fB/etc/zshrc\fP -+.TP -+\fB/etc/zlogin\fP -+.TP -+\fB/etc/zlogout\fP (installation\-specific \- \fB/etc\fP is the default) -+.PD -+.\" Yodl file: Zsh/seealso.yo -+.SH "SEE ALSO" -+\fIsh\fP(1), -+\fIcsh\fP(1), -+\fItcsh\fP(1), -+\fIrc\fP(1), -+\fIbash\fP(1), -+\fIksh\fP(1), -+\fIzshbuiltins\fP(1), -+\fIzshcompwid\fP(1), -+\fIzshcompsys\fP(1), -+\fIzshcompctl\fP(1), -+\fIzshexpn\fP(1), -+\fIzshmisc\fP(1), -+\fIzshmodules\fP(1), -+\fIzshoptions\fP(1), -+\fIzshparam\fP(1), -+\fIzshzle\fP(1) -+.PP -+\fBIEEE Standard for information Technology \- -+Portable Operating System Interface (POSIX) \- -+Part 2: Shell and Utilities\fP, -+IEEE Inc, 1993, ISBN 1\-55937\-255\-9\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshcalsys.1 -@@ -0,0 +1,948 @@ -+.TH "ZSHCALSYS" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshcalsys \- zsh calendar system -+.\" Yodl file: Zsh/calsys.yo -+.SH "DESCRIPTION" -+.PP -+The shell is supplied with a series of functions to replace and enhance the -+traditional Unix \fBcalendar\fP programme, which warns the user of imminent -+or future events, details of which are stored in a text file (typically -+\fBcalendar\fP in the user\&'s home directory)\&. The version provided here -+includes a mechanism for alerting the user when an event is due\&. -+.PP -+In addition a function \fBage\fP is provided that can be used in a glob -+qualifier; it allows files to be selected based on their modification -+times\&. -+.PP -+The format of the \fBcalendar\fP file and the dates used there in and in -+the \fBage\fP function are described first, then the functions that can -+be called to examine and modify the \fBcalendar\fP file\&. -+.PP -+The functions here depend on the availability of the \fBzsh/datetime\fP -+module which is usually installed with the shell\&. The library function -+\fBstrptime()\fP must be available; it is present on most recent -+operating systems\&. -+.PP -+.PP -+.SH "FILE AND DATE FORMATS" -+.PP -+.SS "Calendar File Format" -+.PP -+The calendar file is by default \fB~/calendar\fP\&. This can be configured -+by the \fBcalendar\-file\fP style, see -+the section STYLES below\&. The basic format consists -+of a series of separate lines, with no indentation, each including -+a date and time specification followed by a description of the event\&. -+.PP -+Various enhancements to this format are supported, based on the syntax -+of Emacs calendar mode\&. An indented line indicates a continuation line -+that continues the description of the event from the preceding line -+(note the date may not be continued in this way)\&. An initial ampersand -+(\fB&\fP) is ignored for compatibility\&. -+.PP -+An indented line on which the first non\-whitespace character is \fB#\fP -+is not displayed with the calendar entry, but is still scanned for -+information\&. This can be used to hide information useful to the -+calendar system but not to the user, such as the unique identifier -+used by \fBcalendar_add\fP\&. -+.PP -+The Emacs extension that a date with no description may refer to a number -+of succeeding events at different times is not supported\&. -+.PP -+Unless the \fBdone\-file\fP style has been altered, any events which -+have been processed are appended to the file with the same name as the -+calendar file with the suffix \fB\&.done\fP, hence \fB~/calendar\&.done\fP by -+default\&. -+.PP -+An example is shown below\&. -+.PP -+.SS "Date Format" -+.PP -+The format of the date and time is designed to allow flexibility without -+admitting ambiguity\&. (The words `date\&' and `time' are both used in the -+documentation below; except where specifically noted this implies a string -+that may include both a date and a time specification\&.) Note that there is -+no localization support; month and day names must be in English and -+separator characters are fixed\&. Matching is case insensitive, and only the -+first three letters of the names are significant, although as a special -+case a form beginning "month" does not match "Monday"\&. Furthermore, time -+zones are not handled; all times are assumed to be local\&. -+.PP -+It is recommended that, rather than exploring the intricacies of the -+system, users find a date format that is natural to them and stick to it\&. -+This will avoid unexpected effects\&. Various key facts should be noted\&. -+.PP -+.PD 0 -+.TP -+.PD -+\(bu -+In particular, note the confusion between -+\fImonth\fP\fB/\fP\fIday\fP\fB/\fP\fIyear\fP and -+\fIday\fP\fB/\fP\fImonth\fP\fB/\fP\fIyear\fP when the month is numeric; these -+formats should be avoided if at all possible\&. Many alternatives are -+available\&. -+.TP -+\(bu -+The year must be given in full to avoid confusion, and only years -+from 1900 to 2099 inclusive are matched\&. -+.PP -+The following give some obvious examples; users finding here -+a format they like and not subject to vagaries of style may skip -+the full description\&. As dates and times are matched separately -+(even though the time may be embedded in the date), any date format -+may be mixed with any format for the time of day provide the -+separators are clear (whitespace, colons, commas)\&. -+.PP -+.RS -+.nf -+\fB2007/04/03 13:13 -+2007/04/03:13:13 -+2007/04/03 1:13 pm -+3rd April 2007, 13:13 -+April 3rd 2007 1:13 p\&.m\&. -+Apr 3, 2007 13:13 -+Tue Apr 03 13:13:00 2007 -+13:13 2007/apr/3\fP -+.fi -+.RE -+.PP -+More detailed rules follow\&. -+.PP -+Times are parsed and extracted before dates\&. They must use colons -+to separate hours and minutes, though a dot is allowed before seconds -+if they are present\&. This limits time formats to the following: -+.PP -+.PD 0 -+.TP -+.PD -+\(bu -+\fIHH\fP\fB:\fP\fIMM\fP[\fB:\fP\fISS\fP[\fB\&.\fP\fIFFFFF\fP]] [\fBam\fP|\fBpm\fP|\fBa\&.m\&.\fP|\fBp\&.m\&.\fP] -+.TP -+\(bu -+\fIHH\fP\fB:\fP\fIMM\fP\fB\&.\fP\fISS\fP[\fB\&.\fP\fIFFFFF\fP] [\fBam\fP|\fBpm\fP|\fBa\&.m\&.\fP|\fBp\&.m\&.\fP] -+.PP -+Here, square brackets indicate optional elements, possibly with -+alternatives\&. Fractions of a second are recognised but ignored\&. For -+absolute times (the normal format require by the \fBcalendar\fP file and the -+\fBage\fP function) a date is mandatory but a time of day is not; the time -+returned is at the start of the date\&. One variation is allowed: if -+\fBa\&.m\&.\fP or \fBp\&.m\&.\fP or one of their variants is present, an hour without a -+minute is allowed, e\&.g\&. \fB3 p\&.m\&.\fP\&. -+.PP -+Time zones are not handled, though if one is matched following a time -+specification it will be removed to allow a surrounding date to be -+parsed\&. This only happens if the format of the timezone is not too -+unusual\&. The following are examples of forms that are understood: -+.PP -+.RS -+.nf -+\fB+0100 -+GMT -+GMT\-7 -+CET+1CDT\fP -+.fi -+.RE -+.PP -+Any part of the timezone that is not numeric must have exactly three -+capital letters in the name\&. -+.PP -+Dates suffer from the ambiguity between \fIDD\fP\fB/\fP\fIMM\fP\fB/\fP\fIYYYY\fP -+and \fIMM\fP\fB/\fP\fIDD\fP\fB/\fP\fIYYYY\fP\&. It is recommended this form is -+avoided with purely numeric dates, but use of ordinals, -+eg\&. \fB3rd/04/2007\fP, will resolve the ambiguity as the ordinal is always -+parsed as the day of the month\&. Years must be four digits (and the first -+two must be \fB19\fP or \fB20\fP); \fB03/04/08\fP is not recognised\&. Other -+numbers may have leading zeroes, but they are not required\&. The following -+are handled: -+.PP -+.PD 0 -+.TP -+.PD -+\(bu -+\fIYYYY\fP\fB/\fP\fIMM\fP\fB/\fP\fIDD\fP -+.TP -+\(bu -+\fIYYYY\fP\fB\-\fP\fIMM\fP\fB\-\fP\fIDD\fP -+.TP -+\(bu -+\fIYYYY\fP\fB/\fP\fIMNM\fP\fB/\fP\fIDD\fP -+.TP -+\(bu -+\fIYYYY\fP\fB\-\fP\fIMNM\fP\fB\-\fP\fIDD\fP -+.TP -+\(bu -+\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP] \fIMNM\fP[\fB,\fP] [ \fIYYYY\fP ] -+.TP -+\(bu -+\fIMNM\fP \fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP][\fB,\fP] [ \fIYYYY\fP ] -+.TP -+\(bu -+\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIMM\fP[\fB,\fP] \fIYYYY\fP -+.TP -+\(bu -+\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIMM\fP\fB/\fP\fIYYYY\fP -+.TP -+\(bu -+\fIMM\fP\fB/\fP\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP][\fB,\fP] \fIYYYY\fP -+.TP -+\(bu -+\fIMM\fP\fB/\fP\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIYYYY\fP -+.PP -+Here, \fIMNM\fP is at least the first three letters of a month name, -+matched case\-insensitively\&. The remainder of the month name may appear but -+its contents are irrelevant, so janissary, febrile, martial, apricot, -+maybe, junta, etc\&. are happily handled\&. -+.PP -+Where the year is shown as optional, the current year is assumed\&. There -+are only two such cases, the form \fBJun 20\fP or \fB14 September\fP (the only -+two commonly occurring forms, apart from a "the" in some forms of English, -+which isn\&'t currently supported)\&. Such dates will of course become -+ambiguous in the future, so should ideally be avoided\&. -+.PP -+Times may follow dates with a colon, e\&.g\&. \fB1965/07/12:09:45\fP; this is in -+order to provide a format with no whitespace\&. A comma and whitespace are -+allowed, e\&.g\&. \fB1965/07/12, 09:45\fP\&. Currently the order of these -+separators is not checked, so illogical formats such as \fB1965/07/12, : -+,09:45\fP will also be matched\&. For simplicity such variations are not shown -+in the list above\&. Otherwise, a time is only recognised as being -+associated with a date if there is only whitespace in between, or if the -+time was embedded in the date\&. -+.PP -+Days of the week are not normally scanned, but will be ignored if they -+occur at the start of the date pattern only\&. However, in contexts where it -+is useful to specify dates relative to today, days of the week with no -+other date specification may be given\&. The day is assumed to be either -+today or within the past week\&. Likewise, the words \fByesterday\fP, -+\fBtoday\fP and \fBtomorrow\fP are handled\&. All matches are case\-insensitive\&. -+Hence if today is Monday, then \fBSunday\fP is equivalent to \fByesterday\fP, -+\fBMonday\fP is equivalent to \fBtoday\fP, but \fBTuesday\fP gives a date six -+days ago\&. This is not generally useful within the calendar file\&. -+Dates in this format may be combined with a time specification; for -+example \fBTomorrow, 8 p\&.m\&.\fP\&. -+.PP -+For example, the standard date format: -+.PP -+.RS -+.nf -+\fBFri Aug 18 17:00:48 BST 2006\fP -+.fi -+.RE -+.PP -+is handled by matching \fIHH\fP\fB:\fP\fIMM\fP\fB:\fP\fISS\fP and removing it -+together with the matched (but unused) time zone\&. This leaves the following: -+.PP -+.RS -+.nf -+\fBFri Aug 18 2006\fP -+.fi -+.RE -+.PP -+\fBFri\fP is ignored and the rest is matched according to the standard rules\&. -+.PP -+.SS "Relative Time Format" -+.PP -+In certain places relative times are handled\&. Here, a date is not allowed; -+instead a combination of various supported periods are allowed, together -+with an optional time\&. The periods must be in order from most to -+least significant\&. -+.PP -+In some cases, a more accurate calculation is possible when there is an -+anchor date: offsets of months or years pick the correct day, rather than -+being rounded, and it is possible to pick a particular day in a month as -+`(1st Friday)\&', etc\&., as described in more detail below\&. -+.PP -+Anchors are available in the following cases\&. If one or two times are -+passed to the function \fBcalendar\fP, the start time acts an anchor for the -+end time when the end time is relative (even if the start time is -+implicit)\&. When examining calendar files, the scheduled event being -+examined anchors the warning time when it is given explicitly by means of -+the \fBWARN\fP keyword; likewise, the scheduled event anchors a repetition -+period when given by the \fBRPT\fP keyword, so that specifications such as -+\fBRPT 2 months, 3rd Thursday\fP are handled properly\&. Finally, the \fB\-R\fP -+argument to \fBcalendar_scandate\fP directly provides an anchor for relative -+calculations\&. -+.PP -+The periods handled, with possible abbreviations are: -+.PP -+.PD 0 -+.TP -+.PD -+Years -+\fByears\fP, \fByrs\fP, \fBys\fP, \fByear\fP, \fByr\fP, \fBy\fP, \fByearly\fP\&. -+A year is 365\&.25 days unless there is an anchor\&. -+.TP -+Months -+\fBmonths\fP, \fBmons\fP, \fBmnths\fP, \fBmths\fP, \fBmonth\fP, \fBmon\fP, -+\fBmnth\fP, \fBmth\fP, \fBmonthly\fP\&. Note that \fBm\fP, \fBms\fP, \fBmn\fP, \fBmns\fP -+are ambiguous and are \fInot\fP handled\&. A month is a period -+of 30 days rather than a calendar month unless there is an anchor\&. -+.TP -+Weeks -+\fBweeks\fP, \fBwks\fP, \fBws\fP, \fBweek\fP, \fBwk\fP, \fBw\fP, \fBweekly\fP -+.TP -+Days -+\fBdays\fP, \fBdys\fP, \fBds\fP, \fBday\fP, \fBdy\fP, \fBd\fP, \fBdaily\fP -+.TP -+Hours -+\fBhours\fP, \fBhrs\fP, \fBhs\fP, \fBhour\fP, \fBhr\fP, \fBh\fP, \fBhourly\fP -+.TP -+Minutes -+\fBminutes\fP, \fBmins\fP, \fBminute\fP, \fBmin\fP, but \fInot\fP \fBm\fP, -+\fBms\fP, \fBmn\fP or \fBmns\fP -+.TP -+Seconds -+\fBseconds\fP, \fBsecs\fP, \fBss\fP, \fBsecond\fP, \fBsec\fP, \fBs\fP -+.PP -+Spaces between the numbers are optional, but are required between items, -+although a comma may be used (with or without spaces)\&. -+.PP -+The forms \fByearly\fP to \fBhourly\fP allow the number to be omitted; it is -+assumed to be 1\&. For example, \fB1 d\fP and \fBdaily\fP are equivalent\&. Note -+that using those forms with plurals is confusing; \fB2 yearly\fP is the same -+as \fB2 years\fP, \fInot\fP twice yearly, so it is recommended they only -+be used without numbers\&. -+.PP -+When an anchor time is present, there is an extension to handle regular -+events in the form of the \fIn\fPth \fIsome\fPday of the month\&. Such a -+specification must occur immediately after any year and month -+specification, but before any time of day, and must be in the form -+\fIn\fP\fB(th|st|rd)\fP \fIday\fP, for example \fB1st Tuesday\fP or -+\fB3rd Monday\fP\&. As in other places, days are matched case insensitively, -+must be in English, and only the first three letters are significant except -+that a form beginning `month\&' does not match `Monday'\&. No attempt is made -+to sanitize the resulting date; attempts to squeeze too many occurrences -+into a month will push the day into the next month (but in the obvious -+fashion, retaining the correct day of the week)\&. -+.PP -+Here are some examples: -+.PP -+.RS -+.nf -+\fB30 years 3 months 4 days 3:42:41 -+14 days 5 hours -+Monthly, 3rd Thursday -+4d,10hr\fP -+.fi -+.RE -+.PP -+.SS "Example" -+.PP -+Here is an example calendar file\&. It uses a consistent date format, -+as recommended above\&. -+.PP -+.RS -+.nf -+\fBFeb 1, 2006 14:30 Pointless bureaucratic meeting -+Mar 27, 2006 11:00 Mutual recrimination and finger pointing -+ Bring water pistol and waterproofs -+Mar 31, 2006 14:00 Very serious managerial pontification -+ # UID 12C7878A9A50 -+Apr 10, 2006 13:30 Even more pointless blame assignment exercise WARN 30 mins -+May 18, 2006 16:00 Regular moaning session RPT monthly, 3rd Thursday\fP -+.fi -+.RE -+.PP -+The second entry has a continuation line\&. The third entry has a -+continuation line that will not be shown when the entry is displayed, but -+the unique identifier will be used by the \fBcalendar_add\fP function when -+updating the event\&. The fourth entry will produce a warning 30 minutes -+before the event (to allow you to equip yourself appropriately)\&. The fifth -+entry repeats after a month on the 3rd Thursday, i\&.e\&. June 15, 2006, at the -+same time\&. -+.PP -+.SH "USER FUNCTIONS" -+.PP -+This section describes functions that are designed to be called -+directly by the user\&. The first part describes those functions -+associated with the user\&'s calendar; the second part describes -+the use in glob qualifiers\&. -+.PP -+.SS "Calendar system functions" -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBcalendar\fP [ \fB\-abdDsv\fP ] [ \fB\-C\fP \fIcalfile\fP ] [ \-n \fInum\fP ] [ \fB\-S\fP \fIshowprog\fP ] [ [ \fIstart\fP ] \fIend\fP ]( -+.TP -+.PD -+\fBcalendar \-r\fP [ \fB\-abdDrsv\fP ] [ \fB\-C\fP \fIcalfile\fP ] [ \-n \fInum\fP ] [ \fB\-S\fP \fIshowprog\fP ] [ \fIstart\fP ] -+Show events in the calendar\&. -+.RS -+.PP -+With no arguments, show events from the start of today until the end of -+the next working day after today\&. In other words, if today is Friday, -+Saturday, or Sunday, show up to the end of the following Monday, otherwise -+show today and tomorrow\&. -+.PP -+If \fIend\fP is given, show events from the start of today up to the time -+and date given, which is in the format described in the previous section\&. -+Note that if this is a date the time is assumed to be midnight at the -+start of the date, so that effectively this shows all events before -+the given date\&. -+.PP -+\fIend\fP may start with a \fB+\fP, in which case the remainder of the -+specification is a relative time format as described in the previous -+section indicating the range of time from the start time that is to -+be included\&. -+.PP -+If \fIstart\fP is also given, show events starting from that time and date\&. -+The word \fBnow\fP can be used to indicate the current time\&. -+.PP -+To implement an alert when events are due, include \fBcalendar \-s\fP in your -+\fB~/\&.zshrc\fP file\&. -+.PP -+Options: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-a\fP -+Show all items in the calendar, regardless of the \fBstart\fP and -+\fBend\fP\&. -+.TP -+\fB\-b\fP -+Brief: don\&'t display continuation lines (i\&.e\&. indented lines following -+the line with the date/time), just the first line\&. -+.TP -+\fB\-B\fP \fIlines\fP -+Brief: display at most the first \fIlines\fP lines of the calendar -+entry\&. `\fB\-B 1\fP\&' is equivalent to `\fB\-b\fP'\&. -+.TP -+\fB\-C\fP \fIcalfile\fP -+Explicitly specify a calendar file instead of the value of -+the \fBcalendar\-file\fP style or the the default \fB~/calendar\fP\&. -+.TP -+\fB\-d\fP -+Move any events that have passed from the calendar file to the -+"done" file, as given by the \fBdone\-file\fP style or the default -+which is the calendar file with \fB\&.done\fP appended\&. This option -+is implied by the \fB\-s\fP option\&. -+.TP -+\fB\-D\fP -+Turns off the option \fB\-d\fP, even if the \fB\-s\fP option is also present\&. -+.TP -+\fB\-n\fP \fInum\fP, \fB\-\fP\fInum\fP -+Show at least \fInum\fP events, if present in the calendar file, regardless -+of the \fBstart\fP and \fBend\fP\&. -+.TP -+\fB\-r\fP -+Show all the remaining options in the calendar, ignoring the given \fBend\fP -+time\&. The \fBstart\fP time is respected; any argument given is treated -+as a \fBstart\fP time\&. -+.TP -+\fB\-s\fP -+Use the shell\&'s \fBsched\fP command to schedule a timed event that -+will warn the user when an event is due\&. Note that the \fBsched\fP command -+only runs if the shell is at an interactive prompt; a foreground task -+blocks the scheduled task from running until it is finished\&. -+.RS -+.PP -+The timed event usually runs the programme \fBcalendar_show\fP to show -+the event, as described in -+the section UTILITY FUNCTIONS below\&. -+.PP -+By default, a warning of the event is shown five minutes before it is due\&. -+The warning period can be configured by the style \fBwarn\-time\fP or -+for a single calendar entry by including \fBWARN\fP \fIreltime\fP in the first -+line of the entry, where \fIreltime\fP is one of the usual relative time -+formats\&. -+.PP -+A repeated event may be indicated by including \fBRPT\fP \fIreldate\fP in the -+first line of the entry\&. After the scheduled event has been displayed -+it will be re\-entered into the calendar file at a time \fIreldate\fP -+after the existing event\&. Note that this is currently the only use -+made of the repeat count, so that it is not possible to query the schedule -+for a recurrence of an event in the calendar until the previous event -+has passed\&. -+.PP -+If \fBRPT\fP is used, it is also possible to specify that certain -+recurrences of an event are rescheduled or cancelled\&. This is -+done with the \fBOCCURRENCE\fP keyword, followed by whitespace and the -+date and time of the occurrence in the regular sequence, followed by -+whitespace and either the date and time of the rescheduled event or -+the exact string \fBCANCELLED\fP\&. In this case the date and time must -+be in exactly the "date with local time" format used by the -+\fBtext/calendar\fP MIME type (RFC 2445), -+\fI
\fP\fBT\fP\fI\fP (note the presence of the literal -+character \fBT\fP)\&. The first word (the regular recurrence) may be -+something other than a proper date/time to indicate that the event -+is additional to the normal sequence; a convention that retains -+the formatting appearance is \fBXXXXXXXXTXXXXXX\fP\&. -+.PP -+Furthermore, it is useful to record the next regular recurrence -+(as then the displayed date may be for a rescheduled event so cannot -+be used for calculating the regular sequence)\&. This is specified by -+\fBRECURRENCE\fP and a time or date in the same format\&. \fBcalendar_add\fP -+adds such an indication when it encounters a recurring event that does not -+include one, based on the headline date/time\&. -+.PP -+If \fBcalendar_add\fP is used to update occurrences the \fBUID\fP keyword -+described there should be present in both the existing entry and the added -+occurrence in order to identify recurring event sequences\&. -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBThu May 6, 2010 11:00 Informal chat RPT 1 week -+ # RECURRENCE 20100506T110000 -+ # OCCURRENCE 20100513T110000 20100513T120000 -+ # OCCURRENCE 20100520T110000 CANCELLED\fP -+.fi -+.RE -+.PP -+The event that occurs at 11:00 on 13th May 2010 is rescheduled an hour -+later\&. The event that occurs a week later is cancelled\&. The occurrences -+are given on a continuation line starting with a \fB#\fP character so will -+not usually be displayed as part of the event\&. As elsewhere, no account of -+time zones is taken with the times\&. After the next event occurs the headline -+date/time will be `\fBThu May 13, 2010 12:00\fP\&' while the \fBRECURRENCE\fP -+date/time will be `\fB20100513T110000\fP\&' (note that cancelled and -+moved events are not taken account of in the \fBRECURRENCE\fP, which -+records what the next regular recurrence is, but they are accounted for in -+the headline date/time)\&. -+.PP -+It is safe to run \fBcalendar \-s\fP to reschedule an existing event -+(if the calendar file has changed, for example), and also to have it -+running in multiples instances of the shell since the calendar file -+is locked when in use\&. -+.PP -+By default, expired events are moved to the "done" file; see the \fB\-d\fP -+option\&. Use \fB\-D\fP to prevent this\&. -+.RE -+.TP -+\fB\-S\fP \fIshowprog\fP -+Explicitly specify a programme to be used for showing events instead -+of the value of the \fBshow\-prog\fP style or the default \fBcalendar_show\fP\&. -+.TP -+\fB\-v\fP -+Verbose: show more information about stages of processing\&. This -+is useful for confirming that the function has successfully parsed -+the dates in the calendar file\&. -+.RE -+.TP -+\fBcalendar_add\fP [ \fB\-BL\fP ] \fIevent \&.\&.\&.\fP -+Adds a single event to the calendar in the appropriate location\&. -+The event can contain multiple lines, as described in -+the section Calendar File Format above\&. -+Using this function ensures that the calendar file is sorted in date -+and time order\&. It also makes special arrangements for locking -+the file while it is altered\&. The old calendar is left in a file -+with the suffix \fB\&.old\fP\&. -+.RS -+.PP -+The option \fB\-B\fP indicates that backing up the calendar file will be -+handled by the caller and should not be performed by \fBcalendar_add\fP\&. The -+option \fB\-L\fP indicates that \fBcalendar_add\fP does not need to lock the -+calendar file as it is already locked\&. These options will not usually be -+needed by users\&. -+.PP -+If the style \fBreformat\-date\fP is true, the date and time of the -+new entry will be rewritten into the standard date format: see -+the descriptions of this style and the style \fBdate\-format\fP\&. -+.PP -+The function can use a unique identifier stored with each event to ensure -+that updates to existing events are treated correctly\&. The entry -+should contain the word \fBUID\fP, followed by whitespace, followed by -+a word consisting entirely of hexadecimal digits of arbitrary length -+(all digits are significant, including leading zeroes)\&. As the UID -+is not directly useful to the user, it is convenient to hide it on -+an indented continuation line starting with a \fB#\fP, for example: -+.PP -+.RS -+.nf -+\fBAug 31, 2007 09:30 Celebrate the end of the holidays -+ # UID 045B78A0\fP -+.fi -+.RE -+.PP -+The second line will not be shown by the \fBcalendar\fP function\&. -+.PP -+It is possible to specify the \fBRPT\fP keyword followed by \fBCANCELLED\fP -+instead of a relative time\&. This causes any matched event or series -+of events to be cancelled (the original event does not have to be marked -+as recurring in order to be cancelled by this method)\&. A \fBUID\fP is -+required in order to match an existing event in the calendar\&. -+.PP -+\fBcalendar_add\fP will attempt to manage recurrences and occurrences of -+repeating events as described for event scheduling by \fBcalendar \-s\fP -+above\&. To reschedule or cancel a single event \fBcalendar_add\fP should be -+called with an entry that includes the correct \fBUID\fP but does \fInot\fP -+include the \fBRPT\fP keyword as this is taken to mean the entry applies to a -+series of repeating events and hence replaces all existing information\&. -+Each rescheduled or cancelled occurrence must have an \fBOCCURRENCE\fP -+keyword in the entry passed to \fBcalendar_add\fP which will be merged into -+the calendar file\&. Any existing reference to the occurrence is replaced\&. -+An occurrence that does not refer to a valid existing event is added as a -+one\-off occurrence to the same calendar entry\&. -+.RE -+.TP -+\fBcalendar_edit\fP -+This calls the user\&'s editor to edit the calendar file\&. If -+there are arguments, they are taken as the editor to use (the file name -+is appended to the commands); otherwise, the editor is given by the -+variable \fBVISUAL\fP, if set, else the variable \fBEDITOR\fP\&. -+.RS -+.PP -+If the calendar scheduler was running, then after editing the file -+\fBcalendar \-s\fP is called to update it\&. -+.PP -+This function locks out the calendar system during the edit\&. -+Hence it should be used to edit the calendar file if there is any -+possibility of a calendar event occurring meanwhile\&. Note this -+can lead to another shell with calendar functions enabled hanging waiting -+for a lock, so it is necessary to quit the editor as soon as possible\&. -+.RE -+.TP -+\fBcalendar_parse\fP \fIcalendar\-entry\fP -+This is the internal function that analyses the parts of a calendar -+entry, which is passed as the only argument\&. The function returns -+status 1 if the argument could not be parsed as a calendar entry -+and status 2 if the wrong number of arguments were passed; it also sets the -+parameter \fBreply\fP to an empty associative array\&. Otherwise, -+it returns status 0 and sets elements of the associative -+array \fBreply\fP as follows: -+.PD 0 -+.TP -+time -+The time as a string of digits in the same units as -+\fB$EPOCHSECONDS\fP -+.TP -+schedtime -+The regularly scheduled time\&. This may differ from -+the actual event time \fBtime\fP if this is a recurring event and the next -+occurrence has been rescheduled\&. Then \fBtime\fP gives the actual time -+and \fBschedtime\fP the time of the regular recurrence before modification\&. -+.TP -+text1 -+The text from the line not including the date and time of the -+event, but including any \fBWARN\fP or \fBRPT\fP keywords and values\&. -+.TP -+warntime -+Any warning time given by the \fBWARN\fP keyword as a string -+of digits containing the time at which to warn in the same units as -+\fB$EPOCHSECONDS\fP\&. (Note this is an absolute time, not the relative time -+passed down\&.) Not set no \fBWARN\fP keyword and value were -+matched\&. -+.TP -+warnstr -+The raw string matched after the \fBWARN\fP keyword, else unset\&. -+.TP -+rpttime -+Any recurrence time given by the \fBRPT\fP keyword as a string -+of digits containing the time of the recurrence in the same units -+as \fB$EPOCHSECONDS\fP\&. (Note this is an absolute time\&.) Not set if -+no \fBRPT\fP keyword and value were matched\&. -+.TP -+schedrpttime -+The next regularly scheduled occurrence of a recurring -+event before modification\&. This may differ from \fBrpttime\fP, which is the -+actual time of the event that may have been rescheduled from the regular -+time\&. -+.TP -+rptstr -+The raw string matched after the \fBRPT\fP keyword, else unset\&. -+.TP -+text2 -+The text from the line after removal of the date and any -+keywords and values\&. -+.PD -+) -+.TP -+\fBcalendar_showdate\fP [ \fB\-r\fP ] [ \fB\-f\fP \fIfmt\fP ] \fIdate\-spec \&.\&.\&.\fP -+The given \fIdate\-spec\fP is interpreted and the corresponding date and -+time printed\&. If the initial \fIdate\-spec\fP begins with a \fB+\fP or -+\fB\-\fP it is treated as relative to the current time; \fIdate\-spec\fPs after -+the first are treated as relative to the date calculated so far and -+a leading \fB+\fP is optional in that case\&. This allows one to -+use the system as a date calculator\&. For example, \fBcalendar_showdate \&'+1 -+month, 1st Friday\&'\fP shows the date of the first Friday of next month\&. -+.RS -+.PP -+With the option \fB\-r\fP nothing is printed but the value of the date and -+time in seconds since the epoch is stored in the parameter \fBREPLY\fP\&. -+.PP -+With the option \fB\-f\fP \fIfmt\fP the given date/time conversion format -+is passed to \fBstrftime\fP; see notes on the \fBdate\-format\fP style below\&. -+.PP -+In order to avoid ambiguity with negative relative date specifications, -+options must occur in separate words; in other words, \fB\-r\fP and \fB\-f\fP -+should not be combined in the same word\&. -+.RE -+.TP -+\fBcalendar_sort\fP -+Sorts the calendar file into date and time order\&. The old calendar is -+left in a file with the suffix \fB\&.old\fP\&. -+.PP -+.SS "Glob qualifiers" -+.PP -+The function \fBage\fP can be autoloaded and use separately from -+the calendar system, although it uses the function \fBcalendar_scandate\fP -+for date formatting\&. It requires the \fBzsh/stat\fP builtin, but uses -+only the builtin \fBzstat\fP\&. -+.PP -+\fBage\fP selects files having a given modification time for use -+as a glob qualifier\&. The format of the date is the same as that -+understood by the calendar system, described in -+the section FILE AND DATE FORMATS above\&. -+.PP -+The function can take one or two arguments, which can be supplied either -+directly as command or arguments, or separately as shell parameters\&. -+.PP -+.RS -+.nf -+\fBprint *(e:age 2006/10/04 2006/10/09:)\fP -+.fi -+.RE -+.PP -+The example above matches all files modified between the start of those -+dates\&. The second argument may alternatively be a relative time -+introduced by a \fB+\fP: -+.PP -+.RS -+.nf -+\fBprint *(e:age 2006/10/04 +5d:)\fP -+.fi -+.RE -+.PP -+The example above is equivalent to the previous example\&. -+.PP -+In addition to the special use of days of the week, \fBtoday\fP and -+\fByesterday\fP, times with no date may be specified; these apply to today\&. -+Obviously such uses become problematic around midnight\&. -+.PP -+.RS -+.nf -+\fBprint *(e\-age 12:00 13:30\-)\fP -+.fi -+.RE -+.PP -+The example above shows files modified between 12:00 and 13:00 today\&. -+.PP -+.RS -+.nf -+\fBprint *(e:age 2006/10/04:)\fP -+.fi -+.RE -+.PP -+The example above matches all files modified on that date\&. If the second -+argument is omitted it is taken to be exactly 24 hours after the first -+argument (even if the first argument contains a time)\&. -+.PP -+.RS -+.nf -+\fBprint *(e\-age 2006/10/04:10:15 2006/10/04:10:45\-)\fP -+.fi -+.RE -+.PP -+The example above supplies times\&. Note that whitespace within the time and -+date specification must be quoted to ensure \fBage\fP receives the correct -+arguments, hence the use of the additional colon to separate the date and -+time\&. -+.PP -+.RS -+.nf -+\fBAGEREF1=2006/10/04:10:15 -+AGEREF2=2006/10/04:10:45 -+print *(+age)\fP -+.fi -+.RE -+.PP -+This shows the same example before using another form of argument -+passing\&. The dates and times in the parameters \fBAGEREF1\fP and \fBAGEREF2\fP -+stay in effect until unset, but will be overridden if any argument is -+passed as an explicit argument to age\&. Any explicit argument -+causes both parameters to be ignored\&. -+.PP -+.SH "STYLES" -+.PP -+The zsh style mechanism using the \fBzstyle\fP command is describe in -+\fIzshmodules\fP(1)\&. This is the same mechanism -+used in the completion system\&. -+.PP -+The styles below are all examined in the context -+\fB:datetime:\fP\fIfunction\fP\fB:\fP, for example \fB:datetime:calendar:\fP\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBcalendar\-file\fP -+The location of the main calendar\&. The default is \fB~/calendar\fP\&. -+.TP -+\fBdate\-format\fP -+A \fBstrftime\fP format string (see \fIstrftime\fP(3)) with the zsh -+extensions providing various numbers with no leading zero or space -+if the number is a single digit as described for the -+\fB%D{\fP\fIstring\fP\fB}\fP prompt format in -+the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. -+.RS -+.PP -+This is used for outputting dates in \fBcalendar\fP, both to support -+the \fB\-v\fP option and when adding recurring events back to the calendar -+file, and in \fBcalendar_showdate\fP as the final output format\&. -+.PP -+If the style is not set, the default used is similar the standard system -+format as output by the \fBdate\fP command (also known as `ctime format\&'): -+`\fB%a %b %d %H:%M:%S %Z %Y\fP\&'\&. -+.RE -+.TP -+\fBdone\-file\fP -+The location of the file to which events which have passed are appended\&. -+The default is the calendar file location with the suffix \fB\&.done\fP\&. -+The style may be set to an empty string in which case a "done" file -+will not be maintained\&. -+.TP -+\fBreformat\-date\fP -+Boolean, used by \fBcalendar_add\fP\&. If it is true, the date and time -+of new entries added to the calendar will be reformatted to the format -+given by the style \fBdate\-format\fP or its default\&. Only the date and -+time of the event itself is reformatted; any subsidiary dates and times -+such as those associated with repeat and warning times are left alone\&. -+.TP -+\fBshow\-prog\fP -+The programme run by \fBcalendar\fP for showing events\&. It will -+be passed the start time and stop time of the events requested in seconds -+since the epoch followed by the event text\&. Note that \fBcalendar \-s\fP uses -+a start time and stop time equal to one another to indicate alerts -+for specific events\&. -+.RS -+.PP -+The default is the function \fBcalendar_show\fP\&. -+.RE -+.TP -+\fBwarn\-time\fP -+The time before an event at which a warning will be displayed, if the -+first line of the event does not include the text \fBEVENT\fP \fIreltime\fP\&. -+The default is 5 minutes\&. -+.PP -+.SH "UTILITY FUNCTIONS" -+.PP -+.PD 0 -+.TP -+.PD -+\fBcalendar_lockfiles\fP -+Attempt to lock the files given in the argument\&. To prevent -+problems with network file locking this is done in an ad hoc fashion -+by attempting to create a symbolic link to the file with the name -+\fIfile\fP\fB\&.lockfile\fP\&. No other system level functions are used -+for locking, i\&.e\&. the file can be accessed and modified by any -+utility that does not use this mechanism\&. In particular, the user is not -+prevented from editing the calendar file at the same time unless -+\fBcalendar_edit\fP is used\&. -+.RS -+.PP -+Three attempts are made to lock the file before giving up\&. If the module -+\fBzsh/zselect\fP is available, the times of the attempts are jittered so that -+multiple instances of the calling function are unlikely to retry at the -+same time\&. -+.PP -+The files locked are appended to the array \fBlockfiles\fP, which should -+be local to the caller\&. -+.PP -+If all files were successfully locked, status zero is returned, else status one\&. -+.PP -+This function may be used as a general file locking function, although -+this will only work if only this mechanism is used to lock files\&. -+.RE -+.TP -+\fBcalendar_read\fP -+This is a backend used by various other functions to parse the -+calendar file, which is passed as the only argument\&. The array -+\fBcalendar_entries\fP is set to the list of events in the file; no -+pruning is done except that ampersands are removed from the start of -+the line\&. Each entry may contain multiple lines\&. -+.TP -+\fBcalendar_scandate\fP -+This is a generic function to parse dates and times that may be -+used separately from the calendar system\&. The argument is a date -+or time specification as described in -+the section FILE AND DATE FORMATS above\&. The parameter \fBREPLY\fP -+is set to the number of seconds since the epoch corresponding to that date -+or time\&. By default, the date and time may occur anywhere within the given -+argument\&. -+.RS -+.PP -+Returns status zero if the date and time were successfully parsed, -+else one\&. -+.PP -+Options: -+.PD 0 -+.TP -+.PD -+\fB\-a\fP -+The date and time are anchored to the start of the argument; they -+will not be matched if there is preceding text\&. -+.TP -+\fB\-A\fP -+The date and time are anchored to both the start and end of the argument; -+they will not be matched if the is any other text in the argument\&. -+.TP -+\fB\-d\fP -+Enable additional debugging output\&. -+.TP -+\fB\-m\fP -+Minus\&. When \fB\-R\fP \fIanchor_time\fP is also given the relative time is -+calculated backwards from \fIanchor_time\fP\&. -+.TP -+\fB\-r\fP -+The argument passed is to be parsed as a relative time\&. -+.TP -+\fB\-R\fP \fIanchor_time\fP -+The argument passed is to be parsed as a relative time\&. The time is -+relative to \fIanchor_time\fP, a time in seconds since the epoch, -+and the returned value is the absolute time corresponding to advancing -+\fIanchor_time\fP by the relative time given\&. -+This allows lengths of months to be correctly taken into account\&. If -+the final day does not exist in the given month, the last day of the -+final month is given\&. For example, if the anchor time is during 31st -+January 2007 and the relative time is 1 month, the final time is the -+same time of day during 28th February 2007\&. -+.TP -+\fB\-s\fP -+In addition to setting \fBREPLY\fP, set \fBREPLY2\fP to the remainder of -+the argument after the date and time have been stripped\&. This is -+empty if the option \fB\-A\fP was given\&. -+.TP -+\fB\-t\fP -+Allow a time with no date specification\&. The date is assumed to be -+today\&. The behaviour is unspecified if the iron tongue of midnight -+is tolling twelve\&. -+.RE -+.TP -+\fBcalendar_show\fP -+The function used by default to display events\&. It accepts a start time -+and end time for events, both in epoch seconds, and an event description\&. -+.RS -+.PP -+The event is always printed to standard output\&. If the command line editor -+is active (which will usually be the case) the command line will be -+redisplayed after the output\&. -+.PP -+If the parameter \fBDISPLAY\fP is set and the start and end times are -+the same (indicating a scheduled event), the function uses the -+command \fBxmessage\fP to display a window with the event details\&. -+.RE -+.RE -+.PP -+.SH "BUGS" -+.PP -+As the system is based entirely on shell functions (with a little support -+from the \fBzsh/datetime\fP module) the mechanisms used are not as robust as -+those provided by a dedicated calendar utility\&. Consequently the user -+should not rely on the shell for vital alerts\&. -+.PP -+There is no \fBcalendar_delete\fP function\&. -+.PP -+There is no localization support for dates and times, nor any support -+for the use of time zones\&. -+.PP -+Relative periods of months and years do not take into account the variable -+number of days\&. -+.PP -+The \fBcalendar_show\fP function is currently hardwired to use \fBxmessage\fP -+for displaying alerts on X Window System displays\&. This should be -+configurable and ideally integrate better with the desktop\&. -+.PP -+\fBcalendar_lockfiles\fP hangs the shell while waiting for a lock on a file\&. -+If called from a scheduled task, it should instead reschedule the event -+that caused it\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshoptions.1 -@@ -0,0 +1,1674 @@ -+.TH "ZSHOPTIONS" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshoptions \- zsh options -+.\" Yodl file: Zsh/options.yo -+.SH "SPECIFYING OPTIONS" -+Options are primarily referred to by name\&. -+These names are case insensitive and underscores are ignored\&. -+For example, `\fBallexport\fP\&' is equivalent to `\fBA__lleXP_ort\fP'\&. -+.PP -+The sense of an option name may be inverted by preceding it with -+`\fBno\fP\&', so `\fBsetopt No_Beep\fP' is equivalent to `\fBunsetopt beep\fP'\&. -+This inversion can only be done once, so `\fBnonobeep\fP\&' is \fInot\fP -+a synonym for `\fBbeep\fP\&'\&. Similarly, `\fBtify\fP' is not a synonym for -+`\fBnonotify\fP\&' (the inversion of `\fBnotify\fP')\&. -+.PP -+Some options also have one or more single letter names\&. -+There are two sets of single letter options: one used by default, -+and another used to emulate \fBsh\fP/\fBksh\fP (used when the -+\fBSH_OPTION_LETTERS\fP option is set)\&. -+The single letter options can be used on the shell command line, -+or with the \fBset\fP, \fBsetopt\fP and \fBunsetopt\fP -+builtins, as normal Unix options preceded by `\fB\-\fP\&'\&. -+.PP -+The sense of the single letter options may be inverted by using -+`\fB+\fP\&' instead of `\fB\-\fP'\&. -+Some of the single letter option names refer to an option being off, -+in which case the inversion of that name refers to the option being on\&. -+For example, `\fB+n\fP\&' is the short name of `\fBexec\fP', and -+`\fB\-n\fP\&' is the short name of its inversion, `\fBnoexec\fP'\&. -+.PP -+In strings of single letter options supplied to the shell at startup, -+trailing whitespace will be ignored; for example the string `\fB\-f \fP\&' -+will be treated just as `\fB\-f\fP\&', but the string `\fB\-f i\fP' is an error\&. -+This is because many systems which implement the `\fB#!\fP\&' mechanism for -+calling scripts do not strip trailing whitespace\&. -+.PP -+.SH "DESCRIPTION OF OPTIONS" -+In the following list, options set by default in all emulations are marked -+; those set by default only in csh, ksh, sh, or zsh emulations are marked -+, , , as appropriate\&. When listing options (by `\fBsetopt\fP\&', -+`\fBunsetopt\fP\&', `\fBset \-o\fP' or `\fBset +o\fP'), those turned on by default -+appear in the list prefixed with `\fBno\fP\&'\&. Hence (unless -+\fBKSH_OPTION_PRINT\fP is set), `\fBsetopt\fP\&' shows all options whose settings -+are changed from the default\&. -+.PP -+.SS "Changing Directories" -+.PD 0 -+.TP -+.PD -+\fBAUTO_CD\fP (\fB\-J\fP) -+If a command is issued that can\&'t be executed as a normal command, -+and the command is the name of a directory, perform the \fBcd\fP -+command to that directory\&. -+.TP -+\fBAUTO_PUSHD\fP (\fB\-N\fP) -+Make \fBcd\fP push the old directory onto the directory stack\&. -+.TP -+\fBCDABLE_VARS\fP (\fB\-T\fP) -+If the argument to a \fBcd\fP command (or an implied \fBcd\fP with the -+\fBAUTO_CD\fP option set) is not a directory, and does not begin with a -+slash, try to expand the expression as if it were preceded by a `\fB~\fP\&' (see -+the section `Filename Expansion\&')\&. -+.TP -+\fBCHASE_DOTS\fP -+When changing to a directory containing a path segment `\fB\&.\&.\fP\&' which would -+otherwise be treated as canceling the previous segment in the path (in -+other words, `\fBfoo/\&.\&.\fP\&' would be removed from the path, or if `\fB\&.\&.\fP' is -+the first part of the path, the last part of the current working directory -+would be removed), instead resolve the path to the physical directory\&. -+This option is overridden by \fBCHASE_LINKS\fP\&. -+.RS -+.PP -+For example, suppose \fB/foo/bar\fP is a link to the directory \fB/alt/rod\fP\&. -+Without this option set, `\fBcd /foo/bar/\&.\&.\fP\&' changes to \fB/foo\fP; with it -+set, it changes to \fB/alt\fP\&. The same applies if the current directory -+is \fB/foo/bar\fP and `\fBcd \&.\&.\fP\&' is used\&. Note that all other symbolic -+links in the path will also be resolved\&. -+.RE -+.TP -+\fBCHASE_LINKS\fP (\fB\-w\fP) -+Resolve symbolic links to their true values when changing directory\&. -+This also has the effect of \fBCHASE_DOTS\fP, i\&.e\&. a `\fB\&.\&.\fP\&' path segment -+will be treated as referring to the physical parent, even if the preceding -+path segment is a symbolic link\&. -+.TP -+\fBPOSIX_CD\fP -+Modifies the behaviour of \fBcd\fP, \fBchdir\fP and \fBpushd\fP commands -+to make them more compatible with the POSIX standard\&. The behaviour with -+the option unset is described in the documentation for the \fBcd\fP -+builtin in -+\fIzshbuiltins\fP(1)\&. -+If the option is set, the shell does not test for directories beneath -+the local directory (`\fB\&.\fP\&') until after all directories in \fBcdpath\fP -+have been tested\&. -+.RS -+.PP -+Also, if the option is set, the conditions under which the shell -+prints the new directory after changing to it are modified\&. It is -+no longer restricted to interactive shells (although printing of -+the directory stack with \fBpushd\fP is still limited to interactive -+shells); and any use of a component of \fBCDPATH\fP, including a `\fB\&.\fP\&' but -+excluding an empty component that is otherwise treated as `\fB\&.\fP\&', causes -+the directory to be printed\&. -+.RE -+.TP -+\fBPUSHD_IGNORE_DUPS\fP -+Don\&'t push multiple copies of the same directory onto the directory stack\&. -+.TP -+\fBPUSHD_MINUS\fP -+Exchanges the meanings of `\fB+\fP\&' and `\fB\-\fP' -+when used with a number to specify a directory in the stack\&. -+.TP -+\fBPUSHD_SILENT\fP (\fB\-E\fP) -+Do not print the directory stack after \fBpushd\fP or \fBpopd\fP\&. -+.TP -+\fBPUSHD_TO_HOME\fP (\fB\-D\fP) -+Have \fBpushd\fP with no arguments act like `\fBpushd $HOME\fP\&'\&. -+.PP -+.SS "Completion" -+.PD 0 -+.TP -+.PD -+\fBALWAYS_LAST_PROMPT\fP -+If unset, key functions that list completions try to return to the last -+prompt if given a numeric argument\&. If set these functions try to -+return to the last prompt if given \fIno\fP numeric argument\&. -+.TP -+\fBALWAYS_TO_END\fP -+If a completion is performed with the cursor within a word, and a -+full completion is inserted, the cursor is moved to the end of the -+word\&. That is, the cursor is moved to the end of the word if either -+a single match is inserted or menu completion is performed\&. -+.TP -+\fBAUTO_LIST\fP (\fB\-9\fP) -+Automatically list choices on an ambiguous completion\&. -+.TP -+\fBAUTO_MENU\fP -+Automatically use menu completion after the second consecutive request for -+completion, for example by pressing the tab key repeatedly\&. This option -+is overridden by \fBMENU_COMPLETE\fP\&. -+.TP -+\fBAUTO_NAME_DIRS\fP -+Any parameter that is set to the absolute name of a directory -+immediately becomes a name for that directory, that will be used -+by the `\fB%~\fP\&' -+and related prompt sequences, and will be available when completion -+is performed on a word starting with `\fB~\fP\&'\&. -+(Otherwise, the parameter must be used in the form `\fB~\fP\fIparam\fP\&' first\&.) -+.TP -+\fBAUTO_PARAM_KEYS\fP -+If a parameter name was completed and a following character -+(normally a space) automatically -+inserted, and the next character typed is one -+of those that have to come directly after the name (like `\fB}\fP\&', `\fB:\fP', -+etc\&.), the automatically added character is deleted, so that the character -+typed comes immediately after the parameter name\&. -+Completion in a brace expansion is affected similarly: the added character -+is a `\fB,\fP\&', which will be removed if `\fB}\fP' is typed next\&. -+.TP -+\fBAUTO_PARAM_SLASH\fP -+If a parameter is completed whose content is the name of a directory, -+then add a trailing slash instead of a space\&. -+.TP -+\fBAUTO_REMOVE_SLASH\fP -+When the last character resulting from a completion is a slash and the next -+character typed is a word delimiter, a slash, or a character that ends -+a command (such as a semicolon or an ampersand), remove the slash\&. -+.TP -+\fBBASH_AUTO_LIST\fP -+On an ambiguous completion, automatically list choices when the -+completion function is called twice in succession\&. This takes -+precedence over \fBAUTO_LIST\fP\&. The setting of \fBLIST_AMBIGUOUS\fP is -+respected\&. If \fBAUTO_MENU\fP is set, the menu behaviour will then start -+with the third press\&. Note that this will not work with -+\fBMENU_COMPLETE\fP, since repeated completion calls immediately cycle -+through the list in that case\&. -+.TP -+\fBCOMPLETE_ALIASES\fP -+Prevents aliases on the command line from being internally substituted -+before completion is attempted\&. The effect is to make the alias a -+distinct command for completion purposes\&. -+.TP -+\fBCOMPLETE_IN_WORD\fP -+If unset, the cursor is set to the end of the word if completion is -+started\&. Otherwise it stays there and completion is done from both ends\&. -+.TP -+\fBGLOB_COMPLETE\fP -+When the current word has a glob pattern, do not insert all the words -+resulting from the expansion but generate matches as for completion and -+cycle through them like \fBMENU_COMPLETE\fP\&. The matches are generated as if -+a `\fB*\fP\&' was added to the end of the word, or inserted at the cursor when -+\fBCOMPLETE_IN_WORD\fP is set\&. This actually uses pattern matching, not -+globbing, so it works not only for files but for any completion, such as -+options, user names, etc\&. -+.RS -+.PP -+Note that when the pattern matcher is used, matching control (for example, -+case\-insensitive or anchored matching) cannot be used\&. This limitation -+only applies when the current word contains a pattern; simply turning -+on the \fBGLOB_COMPLETE\fP option does not have this effect\&. -+.RE -+.TP -+\fBHASH_LIST_ALL\fP -+Whenever a command completion is attempted, make sure the entire -+command path is hashed first\&. This makes the first completion slower\&. -+.TP -+\fBLIST_AMBIGUOUS\fP -+This option works when \fBAUTO_LIST\fP or \fBBASH_AUTO_LIST\fP is also -+set\&. If there is an unambiguous prefix to insert on the command line, -+that is done without a completion list being displayed; in other -+words, auto\-listing behaviour only takes place when nothing would be -+inserted\&. In the case of \fBBASH_AUTO_LIST\fP, this means that the list -+will be delayed to the third call of the function\&. -+.TP -+\fBLIST_BEEP\fP -+Beep on an ambiguous completion\&. More accurately, this forces the -+completion widgets to return status 1 on an ambiguous completion, which -+causes the shell to beep if the option \fBBEEP\fP is also set; this may -+be modified if completion is called from a user\-defined widget\&. -+.TP -+\fBLIST_PACKED\fP -+Try to make the completion list smaller (occupying less lines) by -+printing the matches in columns with different widths\&. -+.TP -+\fBLIST_ROWS_FIRST\fP -+Lay out the matches in completion lists sorted horizontally, that is, -+the second match is to the right of the first one, not under it as -+usual\&. -+.TP -+\fBLIST_TYPES\fP (\fB\-X\fP) -+When listing files that are possible completions, show the -+type of each file with a trailing identifying mark\&. -+.TP -+\fBMENU_COMPLETE\fP (\fB\-Y\fP) -+On an ambiguous completion, instead of listing possibilities or beeping, -+insert the first match immediately\&. Then when completion is requested -+again, remove the first match and insert the second match, etc\&. -+When there are no more matches, go back to the first one again\&. -+\fBreverse\-menu\-complete\fP may be used to loop through the list -+in the other direction\&. This option overrides \fBAUTO_MENU\fP\&. -+.TP -+\fBREC_EXACT\fP (\fB\-S\fP) -+In completion, recognize exact matches even -+if they are ambiguous\&. -+.PP -+.SS "Expansion and Globbing" -+.PD 0 -+.TP -+.PD -+\fBBAD_PATTERN\fP (\fB+2\fP) -+If a pattern for filename generation is badly formed, print an error message\&. -+(If this option is unset, the pattern will be left unchanged\&.) -+.TP -+\fBBARE_GLOB_QUAL\fP -+In a glob pattern, treat a trailing set of parentheses as a qualifier -+list, if it contains no `\fB|\fP\&', `\fB(\fP' or (if special) `\fB~\fP' -+characters\&. See the section `Filename Generation\&'\&. -+.TP -+\fBBRACE_CCL\fP -+Expand expressions in braces which would not otherwise undergo brace -+expansion to a lexically ordered list of all the characters\&. See -+the section `Brace Expansion\&'\&. -+.TP -+\fBCASE_GLOB\fP -+Make globbing (filename generation) sensitive to case\&. Note that other -+uses of patterns are always sensitive to case\&. If the option is unset, -+the presence of any character which is special to filename generation -+will cause case\-insensitive matching\&. For example, \fBcvs(/)\fP -+can match the directory \fBCVS\fP owing to the presence of the globbing flag -+(unless the option \fBBARE_GLOB_QUAL\fP is unset)\&. -+.TP -+\fBCASE_MATCH\fP -+Make regular expressions using the \fBzsh/regex\fP module (including -+matches with \fB=~\fP) sensitive to case\&. -+.TP -+\fBCSH_NULL_GLOB\fP -+If a pattern for filename generation has no matches, -+delete the pattern from the argument list; -+do not report an error unless all the patterns -+in a command have no matches\&. -+Overrides \fBNOMATCH\fP\&. -+.TP -+\fBEQUALS\fP -+Perform \fB=\fP filename expansion\&. -+(See the section `Filename Expansion\&'\&.) -+.TP -+\fBEXTENDED_GLOB\fP -+Treat the `\fB#\fP\&', `\fB~\fP' and `\fB^\fP' characters as part of patterns -+for filename generation, etc\&. (An initial unquoted `\fB~\fP\&' -+always produces named directory expansion\&.) -+.TP -+\fBGLOB\fP (\fB+F\fP, ksh: \fB+f\fP) -+Perform filename generation (globbing)\&. -+(See the section `Filename Generation\&'\&.) -+.TP -+\fBGLOB_ASSIGN\fP -+If this option is set, filename generation (globbing) is -+performed on the right hand side of scalar parameter assignments of -+the form `\fIname\fP\fB=\fP\fIpattern\fP (e\&.g\&. `\fBfoo=*\fP\&')\&. -+If the result has more than one word the parameter will become an array -+with those words as arguments\&. This option is provided for backwards -+compatibility only: globbing is always performed on the right hand side -+of array assignments of the form `\fIname\fP\fB=(\fP\fIvalue\fP\fB)\fP\&' -+(e\&.g\&. `\fBfoo=(*)\fP\&') and this form is recommended for clarity; -+with this option set, it is not possible to predict whether the result -+will be an array or a scalar\&. -+.TP -+\fBGLOB_DOTS\fP (\fB\-4\fP) -+Do not require a leading `\fB\&.\fP\&' in a filename to be matched explicitly\&. -+.TP -+\fBGLOB_SUBST\fP -+Treat any characters resulting from parameter expansion as being -+eligible for file expansion and filename generation, and any -+characters resulting from command substitution as being eligible for -+filename generation\&. Braces (and commas in between) do not become eligible -+for expansion\&. -+.TP -+\fBHIST_SUBST_PATTERN\fP -+Substitutions using the \fB:s\fP and \fB:&\fP history modifiers are performed -+with pattern matching instead of string matching\&. This occurs wherever -+history modifiers are valid, including glob qualifiers and parameters\&. -+See -+the section Modifiers in \fIzshexpn\fP(1)\&. -+.TP -+\fBIGNORE_BRACES\fP (\fB\-I\fP) -+Do not perform brace expansion\&. -+.TP -+\fBKSH_GLOB\fP -+In pattern matching, the interpretation of parentheses is affected by -+a preceding `\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP'\&. -+See the section `Filename Generation\&'\&. -+.TP -+\fBMAGIC_EQUAL_SUBST\fP -+All unquoted arguments of the form `\fIanything\fP\fB=\fP\fIexpression\fP\&' -+appearing after the command name have filename expansion (that is, -+where \fIexpression\fP has a leading `\fB~\fP\&' or `\fB=\fP') performed on -+\fIexpression\fP as if it were a parameter assignment\&. The argument is -+not otherwise treated specially; it is passed to the command as a single -+argument, and not used as an actual parameter assignment\&. For example, in -+\fBecho foo=~/bar:~/rod\fP, both occurrences of \fB~\fP would be replaced\&. -+Note that this happens anyway with \fBtypeset\fP and similar statements\&. -+.RS -+.PP -+This option respects the setting of the \fBKSH_TYPESET\fP option\&. In other -+words, if both options are in effect, arguments looking like -+assignments will not undergo word splitting\&. -+.RE -+.TP -+\fBMARK_DIRS\fP (\fB\-8\fP, ksh: \fB\-X\fP) -+Append a trailing `\fB/\fP\&' to all directory -+names resulting from filename generation (globbing)\&. -+.TP -+\fBMULTIBYTE\fP -+Respect multibyte characters when found in strings\&. -+When this option is set, strings are examined using the -+system library to determine how many bytes form a character, depending -+on the current locale\&. This affects the way characters are counted in -+pattern matching, parameter values and various delimiters\&. -+.RS -+.PP -+The option is on by default if the shell was compiled with -+\fBMULTIBYTE_SUPPORT\fP except in \fBsh\fP emulation; otherwise it is off by -+default and has no effect if turned on\&. The mode is off in \fBsh\fP -+emulation for compatibility but for interactive use may need to be -+turned on if the terminal interprets multibyte characters\&. -+.PP -+If the option is off a single byte is always treated as a single -+character\&. This setting is designed purely for examining strings -+known to contain raw bytes or other values that may not be characters -+in the current locale\&. It is not necessary to unset the option merely -+because the character set for the current locale does not contain multibyte -+characters\&. -+.PP -+The option does not affect the shell\&'s editor, which always uses the -+locale to determine multibyte characters\&. This is because -+the character set displayed by the terminal emulator is independent of -+shell settings\&. -+.RE -+.TP -+\fBNOMATCH\fP (\fB+3\fP) -+If a pattern for filename generation has no matches, -+print an error, instead of -+leaving it unchanged in the argument list\&. -+This also applies to file expansion -+of an initial `\fB~\fP\&' or `\fB=\fP'\&. -+.TP -+\fBNULL_GLOB\fP (\fB\-G\fP) -+If a pattern for filename generation has no matches, -+delete the pattern from the argument list instead -+of reporting an error\&. Overrides \fBNOMATCH\fP\&. -+.TP -+\fBNUMERIC_GLOB_SORT\fP -+If numeric filenames are matched by a filename generation pattern, -+sort the filenames numerically rather than lexicographically\&. -+.TP -+\fBRC_EXPAND_PARAM\fP (\fB\-P\fP) -+Array expansions of the form -+`\fIfoo\fP\fB${\fP\fIxx\fP\fB}\fP\fIbar\fP\&', where the parameter -+\fIxx\fP is set to \fB(\fP\fIa b c\fP\fB)\fP, are substituted with -+`\fIfooabar foobbar foocbar\fP\&' instead of the default -+`\fIfooa b cbar\fP\&'\&. Note that an empty array will therefore cause -+all arguments to be removed\&. -+.TP -+\fBREMATCH_PCRE\fP -+If set, regular expression matching with the \fB=~\fP operator will use -+Perl\-Compatible Regular Expressions from the PCRE library, if available\&. -+If not set, regular expressions will use the extended regexp syntax -+provided by the system libraries\&. -+.TP -+\fBSH_GLOB\fP -+Disables the special meaning of `\fB(\fP\&', `\fB|\fP', `\fB)\fP' -+and \&'\fB<\fP' for globbing the result of parameter and command substitutions, -+and in some other places where -+the shell accepts patterns\&. If \fBSH_GLOB\fP is set but \fBKSH_GLOB\fP is -+not, the shell allows the interpretation of -+subshell expressions enclosed in parentheses in some cases where there -+is no space before the opening parenthesis, e\&.g\&. \fB!(true)\fP -+is interpreted as if there were a space after the \fB!\fP\&. This option is -+set by default if zsh is invoked as \fBsh\fP or \fBksh\fP\&. -+.TP -+\fBUNSET\fP (\fB+u\fP, ksh: \fB+u\fP) -+Treat unset parameters as if they were empty when substituting\&. -+Otherwise they are treated as an error\&. -+.TP -+\fBWARN_CREATE_GLOBAL\fP -+Print a warning message when a global parameter is created in a function -+by an assignment\&. This often indicates that a parameter has not been -+declared local when it should have been\&. Parameters explicitly declared -+global from within a function using \fBtypeset \-g\fP do not cause a warning\&. -+Note that there is no warning when a local parameter is assigned to in -+a nested function, which may also indicate an error\&. -+.PP -+.SS "History" -+.PD 0 -+.TP -+.PD -+\fBAPPEND_HISTORY\fP -+If this is set, zsh sessions will append their history list to -+the history file, rather than replace it\&. Thus, multiple parallel -+zsh sessions will all have the new entries from their history lists -+added to the history file, in the order that they exit\&. -+The file will still be periodically re\-written to trim it when the -+number of lines grows 20% beyond the value specified by -+\fB$SAVEHIST\fP (see also the HIST_SAVE_BY_COPY option)\&. -+.TP -+\fBBANG_HIST\fP (\fB+K\fP) -+Perform textual history expansion, \fBcsh\fP\-style, -+treating the character `\fB!\fP\&' specially\&. -+.TP -+\fBEXTENDED_HISTORY\fP -+Save each command\&'s beginning timestamp (in seconds since the epoch) -+and the duration (in seconds) to the history file\&. The format of -+this prefixed data is: -+.RS -+.PP -+`\fB:\fP \fI\fP\fB:\fP\fI\fP\fB;\fP\fI\fP\&'\&. -+.RE -+.TP -+\fBHIST_ALLOW_CLOBBER\fP -+Add `\fB|\fP\&' to output redirections in the history\&. This allows history -+references to clobber files even when \fBCLOBBER\fP is unset\&. -+.TP -+\fBHIST_BEEP\fP -+Beep when an attempt is made to access a history entry which -+isn\&'t there\&. -+.TP -+\fBHIST_EXPIRE_DUPS_FIRST\fP -+If the internal history needs to be trimmed to add the current command line, -+setting this option will cause the oldest history event that has a duplicate -+to be lost before losing a unique event from the list\&. -+You should be sure to set the value of \fBHISTSIZE\fP to a larger number -+than \fBSAVEHIST\fP in order to give you some room for the duplicated -+events, otherwise this option will behave just like -+\fBHIST_IGNORE_ALL_DUPS\fP once the history fills up with unique events\&. -+.TP -+\fBHIST_FCNTL_LOCK\fP -+When writing out the history file, by default zsh uses ad\-hoc file locking -+to avoid known problems with locking on some operating systems\&. With this -+option locking is done by means of the system\&'s \fBfcntl\fP call, where -+this method is available\&. On recent operating systems this may -+provide better performance, in particular avoiding history corruption when -+files are stored on NFS\&. -+.TP -+\fBHIST_FIND_NO_DUPS\fP -+When searching for history entries in the line editor, do not display -+duplicates of a line previously found, even if the duplicates are not -+contiguous\&. -+.TP -+\fBHIST_IGNORE_ALL_DUPS\fP -+If a new command line being added to the history list duplicates an -+older one, the older command is removed from the list (even if it is -+not the previous event)\&. -+.TP -+\fBHIST_IGNORE_DUPS\fP (\fB\-h\fP) -+Do not enter command lines into the history list -+if they are duplicates of the previous event\&. -+.TP -+\fBHIST_IGNORE_SPACE\fP (\fB\-g\fP) -+Remove command lines from the history list when the first character on -+the line is a space, or when one of the expanded aliases contains a -+leading space\&. Only normal aliases (not global or suffix aliases) -+have this behaviour\&. -+Note that the command lingers in the internal history until the next -+command is entered before it vanishes, allowing you to briefly reuse -+or edit the line\&. If you want to make it vanish right away without -+entering another command, type a space and press return\&. -+.TP -+\fBHIST_LEX_WORDS\fP -+By default, shell history that is read in from files is split into -+words on all white space\&. This means that arguments with quoted -+whitespace are not correctly handled, with the consequence that -+references to words in history lines that have been read from a file -+may be inaccurate\&. When this option is set, words read in from a -+history file are divided up in a similar fashion to normal shell -+command line handling\&. Although this produces more accurately delimited -+words, if the size of the history file is large this can be slow\&. Trial -+and error is necessary to decide\&. -+.TP -+\fBHIST_NO_FUNCTIONS\fP -+Remove function definitions from the history list\&. -+Note that the function lingers in the internal history until the next -+command is entered before it vanishes, allowing you to briefly reuse -+or edit the definition\&. -+.TP -+\fBHIST_NO_STORE\fP -+Remove the \fBhistory\fP (\fBfc \-l\fP) command from the history list -+when invoked\&. -+Note that the command lingers in the internal history until the next -+command is entered before it vanishes, allowing you to briefly reuse -+or edit the line\&. -+.TP -+\fBHIST_REDUCE_BLANKS\fP -+Remove superfluous blanks from each command line -+being added to the history list\&. -+.TP -+\fBHIST_SAVE_BY_COPY\fP -+When the history file is re\-written, we normally write out a copy of -+the file named $HISTFILE\&.new and then rename it over the old one\&. -+However, if this option is unset, we instead truncate the old -+history file and write out the new version in\-place\&. If one of the -+history\-appending options is enabled, this option only has an effect -+when the enlarged history file needs to be re\-written to trim it -+down to size\&. Disable this only if you have special needs, as doing -+so makes it possible to lose history entries if zsh gets interrupted -+during the save\&. -+.RS -+.PP -+When writing out a copy of the history file, zsh preserves the old -+file\&'s permissions and group information, but will refuse to write -+out a new file if it would change the history file\&'s owner\&. -+.RE -+.TP -+\fBHIST_SAVE_NO_DUPS\fP -+When writing out the history file, older commands that duplicate -+newer ones are omitted\&. -+.TP -+\fBHIST_VERIFY\fP -+Whenever the user enters a line with history expansion, -+don\&'t execute the line directly; instead, perform -+history expansion and reload the line into the editing buffer\&. -+.TP -+\fBINC_APPEND_HISTORY\fP -+This options works like \fBAPPEND_HISTORY\fP except that new history lines -+are added to the \fB$HISTFILE\fP incrementally (as soon as they are -+entered), rather than waiting until the shell exits\&. -+The file will still be periodically re\-written to trim it when the -+number of lines grows 20% beyond the value specified by -+\fB$SAVEHIST\fP (see also the HIST_SAVE_BY_COPY option)\&. -+.TP -+\fBSHARE_HISTORY\fP -+.RS -+.PP -+This option both imports new commands from the history file, and also -+causes your typed commands to be appended to the history file (the -+latter is like specifying \fBINC_APPEND_HISTORY\fP)\&. -+The history lines are also output with timestamps ala -+\fBEXTENDED_HISTORY\fP (which makes it easier to find the spot where -+we left off reading the file after it gets re\-written)\&. -+.PP -+By default, history movement commands visit the imported lines as -+well as the local lines, but you can toggle this on and off with the -+set\-local\-history zle binding\&. It is also possible to create a zle -+widget that will make some commands ignore imported commands, and -+some include them\&. -+.PP -+If you find that you want more control over when commands -+get imported, you may wish to turn \fBSHARE_HISTORY\fP off, -+\fBINC_APPEND_HISTORY\fP on, and then manually import -+commands whenever you need them using `\fBfc \-RI\fP\&'\&. -+.RE -+.RE -+.PP -+.SS "Initialisation" -+.PD 0 -+.TP -+.PD -+\fBALL_EXPORT\fP (\fB\-a\fP, ksh: \fB\-a\fP) -+All parameters subsequently defined are automatically exported\&. -+.TP -+\fBGLOBAL_EXPORT\fP (\fB\fP) -+If this option is set, passing the \fB\-x\fP flag to the builtins \fBdeclare\fP, -+\fBfloat\fP, \fBinteger\fP, \fBreadonly\fP and \fBtypeset\fP (but not \fBlocal\fP) -+will also set the \fB\-g\fP flag; hence parameters exported to -+the environment will not be made local to the enclosing function, unless -+they were already or the flag \fB+g\fP is given explicitly\&. If the option is -+unset, exported parameters will be made local in just the same way as any -+other parameter\&. -+.RS -+.PP -+This option is set by default for backward compatibility; it is not -+recommended that its behaviour be relied upon\&. Note that the builtin -+\fBexport\fP always sets both the \fB\-x\fP and \fB\-g\fP flags, and hence its -+effect extends beyond the scope of the enclosing function; this is the -+most portable way to achieve this behaviour\&. -+.RE -+.TP -+\fBGLOBAL_RCS\fP (\fB\-d\fP) -+If this option is unset, the startup files \fB/etc/zprofile\fP, -+\fB/etc/zshrc\fP, \fB/etc/zlogin\fP and \fB/etc/zlogout\fP will not be run\&. It -+can be disabled and re\-enabled at any time, including inside local startup -+files (\fB\&.zshrc\fP, etc\&.)\&. -+.TP -+\fBRCS\fP (\fB+f\fP) -+After \fB/etc/zshenv\fP is sourced on startup, source the -+\fB\&.zshenv\fP, \fB/etc/zprofile\fP, \fB\&.zprofile\fP, -+\fB/etc/zshrc\fP, \fB\&.zshrc\fP, \fB/etc/zlogin\fP, \fB\&.zlogin\fP, and \fB\&.zlogout\fP -+files, as described in the section `Files\&'\&. -+If this option is unset, the \fB/etc/zshenv\fP file is still sourced, but any -+of the others will not be; it can be set at any time to prevent the -+remaining startup files after the currently executing one from -+being sourced\&. -+.PP -+.SS "Input/Output" -+.PD 0 -+.TP -+.PD -+\fBALIASES\fP -+Expand aliases\&. -+.TP -+\fBCLOBBER\fP (\fB+C\fP, ksh: \fB+C\fP) -+Allows `\fB>\fP\&' redirection to truncate existing files, -+and `\fB>>\fP\&' to create files\&. -+Otherwise `\fB>!\fP\&' or `\fB>|\fP' must be used to truncate a file, -+and `\fB>>!\fP\&' or `\fB>>|\fP' to create a file\&. -+.TP -+\fBCORRECT\fP (\fB\-0\fP) -+Try to correct the spelling of commands\&. -+Note that, when the \fBHASH_LIST_ALL\fP option is not set or when some -+directories in the path are not readable, this may falsely report spelling -+errors the first time some commands are used\&. -+.RS -+.PP -+The shell variable \fBCORRECT_IGNORE\fP may be set to a pattern to -+match words that will never be offered as corrections\&. -+.RE -+.TP -+\fBCORRECT_ALL\fP (\fB\-O\fP) -+Try to correct the spelling of all arguments in a line\&. -+.TP -+\fBDVORAK\fP -+Use the Dvorak keyboard instead of the standard qwerty keyboard as a basis -+for examining spelling mistakes for the \fBCORRECT\fP and \fBCORRECT_ALL\fP -+options and the \fBspell\-word\fP editor command\&. -+.TP -+\fBFLOW_CONTROL\fP -+If this option is unset, -+output flow control via start/stop characters (usually assigned to -+^S/^Q) is disabled in the shell\&'s editor\&. -+.TP -+\fBIGNORE_EOF\fP (\fB\-7\fP) -+Do not exit on end\-of\-file\&. Require the use -+of \fBexit\fP or \fBlogout\fP instead\&. -+However, ten consecutive EOFs will cause the shell to exit anyway, -+to avoid the shell hanging if its tty goes away\&. -+.RS -+.PP -+Also, if this option is set and the Zsh Line Editor is used, widgets -+implemented by shell functions can be bound to EOF (normally -+Control\-D) without printing the normal warning message\&. This works -+only for normal widgets, not for completion widgets\&. -+.RE -+.TP -+\fBINTERACTIVE_COMMENTS\fP (\fB\-k\fP) -+Allow comments even in interactive shells\&. -+.TP -+\fBHASH_CMDS\fP -+Note the location of each command the first time it is executed\&. -+Subsequent invocations of the same command will use the -+saved location, avoiding a path search\&. -+If this option is unset, no path hashing is done at all\&. -+However, when \fBCORRECT\fP is set, commands whose names do not appear in -+the functions or aliases hash tables are hashed in order to avoid -+reporting them as spelling errors\&. -+.TP -+\fBHASH_DIRS\fP -+Whenever a command name is hashed, hash the directory containing it, -+as well as all directories that occur earlier in the path\&. -+Has no effect if neither \fBHASH_CMDS\fP nor \fBCORRECT\fP is set\&. -+.TP -+\fBMAIL_WARNING\fP (\fB\-U\fP) -+Print a warning message if a mail file has been -+accessed since the shell last checked\&. -+.TP -+\fBPATH_DIRS\fP (\fB\-Q\fP) -+Perform a path search even on command names with slashes in them\&. -+Thus if `\fB/usr/local/bin\fP\&' is in the user's path, and he or she types -+`\fBX11/xinit\fP\&', the command `\fB/usr/local/bin/X11/xinit\fP' will be executed -+(assuming it exists)\&. -+Commands explicitly beginning with `\fB/\fP\&', `\fB\&./\fP' or `\fB\&.\&./\fP' -+are not subject to the path search\&. -+This also applies to the `\fB\&.\fP\&' builtin\&. -+.RS -+.PP -+Note that subdirectories of the current directory are always searched for -+executables specified in this form\&. This takes place before any search -+indicated by this option, and regardless of whether `\fB\&.\fP\&' or the current -+directory appear in the command search path\&. -+.RE -+.TP -+\fBPATH_SCRIPT\fP -+If this option is not set, a script passed as the first non\-option argument -+to the shell must contain the name of the file to open\&. If this -+option is set, and the script does not specify a directory path, -+the script is looked for first in the current directory, then in the -+command path\&. See -+the section INVOCATION in \fIzsh\fP(1)\&. -+.TP -+\fBPRINT_EIGHT_BIT\fP -+Print eight bit characters literally in completion lists, etc\&. -+This option is not necessary if your system correctly returns the -+printability of eight bit characters (see \fIctype\fP(3))\&. -+.TP -+\fBPRINT_EXIT_VALUE\fP (\fB\-1\fP) -+Print the exit value of programs with non\-zero exit status\&. -+.TP -+\fBRC_QUOTES\fP -+Allow the character sequence `\fB\&''\fP' to signify a single quote -+within singly quoted strings\&. Note this does not apply in quoted strings -+using the format \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP, where a backslashed single quote can -+be used\&. -+.TP -+\fBRM_STAR_SILENT\fP (\fB\-H\fP) -+Do not query the user before executing `\fBrm *\fP\&' or `\fBrm path/*\fP'\&. -+.TP -+\fBRM_STAR_WAIT\fP -+If querying the user before executing `\fBrm *\fP\&' or `\fBrm path/*\fP', -+first wait ten seconds and ignore anything typed in that time\&. -+This avoids the problem of reflexively answering `yes\&' to the query -+when one didn\&'t really mean it\&. The wait and query can always be -+avoided by expanding the `\fB*\fP\&' in ZLE (with tab)\&. -+.TP -+\fBSHORT_LOOPS\fP -+Allow the short forms of \fBfor\fP, \fBrepeat\fP, \fBselect\fP, -+\fBif\fP, and \fBfunction\fP constructs\&. -+.TP -+\fBSUN_KEYBOARD_HACK\fP (\fB\-L\fP) -+If a line ends with a backquote, and there are an odd number -+of backquotes on the line, ignore the trailing backquote\&. -+This is useful on some keyboards where the return key is -+too small, and the backquote key lies annoyingly close to it\&. -+As an alternative the variable \fBKEYBOARD_HACK\fP lets you choose the -+character to be removed\&. -+.PP -+.SS "Job Control" -+.PD 0 -+.TP -+.PD -+\fBAUTO_CONTINUE\fP -+With this option set, stopped jobs that are removed from the job table -+with the \fBdisown\fP builtin command are automatically sent a \fBCONT\fP -+signal to make them running\&. -+.TP -+\fBAUTO_RESUME\fP (\fB\-W\fP) -+Treat single word simple commands without redirection -+as candidates for resumption of an existing job\&. -+.TP -+\fBBG_NICE\fP (\fB\-6\fP) -+Run all background jobs at a lower priority\&. This option -+is set by default\&. -+.TP -+\fBCHECK_JOBS\fP -+Report the status of background and suspended jobs before exiting a shell -+with job control; a second attempt to exit the shell will succeed\&. -+\fBNO_CHECK_JOBS\fP is best used only in combination with \fBNO_HUP\fP, else -+such jobs will be killed automatically\&. -+.RS -+.PP -+The check is omitted if the commands run from the previous command line -+included a `\fBjobs\fP\&' command, since it is assumed the user is aware that -+there are background or suspended jobs\&. A `\fBjobs\fP\&' command run from one -+of the hook functions defined in -+the section SPECIAL FUNCTIONS in \fIzshmisc\fP(1) -+is not counted for this purpose\&. -+.RE -+.TP -+\fBHUP\fP -+Send the \fBHUP\fP signal to running jobs when the -+shell exits\&. -+.TP -+\fBLONG_LIST_JOBS\fP (\fB\-R\fP) -+List jobs in the long format by default\&. -+.TP -+\fBMONITOR\fP (\fB\-m\fP, ksh: \fB\-m\fP) -+Allow job control\&. Set by default in interactive shells\&. -+.TP -+\fBNOTIFY\fP (\fB\-5\fP, ksh: \fB\-b\fP) -+Report the status of background jobs immediately, rather than -+waiting until just before printing a prompt\&. -+.TP -+\fBPOSIX_JOBS\fP -+This option makes job control more compliant with the POSIX standard\&. -+.RS -+.PP -+When the option is not set, the \fBMONITOR\fP option is unset on entry to -+subshells, so that job control is no longer active\&. When the option is -+set, the \fBMONITOR\fP option and job control remain active in the -+subshell, but note that the subshell has no access to jobs in the parent -+shell\&. -+.PP -+When the option is not set, jobs put in the background or foreground -+with \fBbg\fP or \fBfg\fP are displayed with the same information that would -+be reported by \fBjobs\fP\&. When the option is set, only the text is -+printed\&. The output from \fBjobs\fP itself is not affected by the option\&. -+.PP -+When the option is not set, job information from the parent -+shell is saved for output within a subshell (for example, within a -+pipeline)\&. When the option is set, the output of \fBjobs\fP is empty -+until a job is started within the subshell\&. -+.PP -+When the option is set, it becomes possible to use the \fBwait\fP builtin to -+wait for the last job started in the background (as given by \fB$!\fP) even -+if that job has already exited\&. This works even if the option is turned -+on temporarily around the use of the \fBwait\fP builtin\&. -+.RE -+.RE -+.PP -+.SS "Prompting" -+.PD 0 -+.TP -+.PD -+\fBPROMPT_BANG\fP -+If set, `\fB!\fP\&' is treated specially in prompt expansion\&. -+See -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. -+.TP -+\fBPROMPT_CR\fP (\fB+V\fP) -+Print a carriage return just before printing -+a prompt in the line editor\&. This is on by default as multi\-line editing -+is only possible if the editor knows where the start of the line appears\&. -+.TP -+\fBPROMPT_SP\fP -+Attempt to preserve a partial line (i\&.e\&. a line that did not end with a -+newline) that would otherwise be covered up by the command prompt due to -+the \fBPROMPT_CR\fP option\&. This works by outputting some cursor\-control -+characters, including a series of spaces, that should make the terminal -+wrap to the next line when a partial line is present (note that this is -+only successful if your terminal has automatic margins, which is typical)\&. -+.RS -+.PP -+When a partial line is preserved, by default you will see an inverse+bold -+character at the end of the partial line: a "%" for a normal user or -+a "#" for root\&. If set, the shell parameter \fBPROMPT_EOL_MARK\fP can be -+used to customize how the end of partial lines are shown\&. -+.PP -+NOTE: if the \fBPROMPT_CR\fP option is not set, enabling this option will -+have no effect\&. This option is on by default\&. -+.RE -+.TP -+\fBPROMPT_PERCENT\fP -+If set, `\fB%\fP\&' is treated specially in prompt expansion\&. -+See -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. -+.TP -+\fBPROMPT_SUBST\fP -+If set, \fIparameter expansion\fP, \fIcommand substitution\fP and -+\fIarithmetic expansion\fP are performed in prompts\&. Substitutions -+within prompts do not affect the command status\&. -+.TP -+\fBTRANSIENT_RPROMPT\fP -+Remove any right prompt from display when accepting a command -+line\&. This may be useful with terminals with other cut/paste methods\&. -+.PP -+.SS "Scripts and Functions" -+.PD 0 -+.TP -+.PD -+\fBC_BASES\fP -+Output hexadecimal numbers in the standard C format, for example `\fB0xFF\fP\&' -+instead of the usual `\fB16#FF\fP\&'\&. If the option \fBOCTAL_ZEROES\fP is also -+set (it is not by default), octal numbers will be treated similarly and -+hence appear as `\fB077\fP\&' instead of `\fB8#77\fP'\&. This option has no effect -+on the choice of the output base, nor on the output of bases other than -+hexadecimal and octal\&. Note that these formats will be understood on input -+irrespective of the setting of \fBC_BASES\fP\&. -+.TP -+\fBC_PRECEDENCES\fP -+This alters the precedence of arithmetic operators to be more -+like C and other programming languages; -+the section ARITHMETIC EVALUATION in \fIzshmisc\fP(1) -+has an explicit list\&. -+.TP -+\fBDEBUG_BEFORE_CMD\fP -+Run the \fBDEBUG\fP trap before each command; otherwise it is run after -+each command\&. Setting this option mimics the behaviour of ksh 93; with -+the option unset the behaviour is that of ksh 88\&. -+.TP -+\fBERR_EXIT\fP (\fB\-e\fP, ksh: \fB\-e\fP) -+If a command has a non\-zero exit status, execute the \fBZERR\fP -+trap, if set, and exit\&. This is disabled while running initialization -+scripts\&. -+.RS -+.PP -+The behaviour is also disabled inside \fBDEBUG\fP traps\&. In this -+case the option is handled specially: it is unset on entry to -+the trap\&. If the option \fBDEBUG_BEFORE_CMD\fP is set, -+as it is by default, and the option \fBERR_EXIT\fP is found to have been set -+on exit, then the command for which the \fBDEBUG\fP trap is being executed is -+skipped\&. The option is restored after the trap exits\&. -+.RE -+.TP -+\fBERR_RETURN\fP -+If a command has a non\-zero exit status, return immediately from the -+enclosing function\&. The logic is identical to that for \fBERR_EXIT\fP, -+except that an implicit \fBreturn\fP statement is executed instead of an -+\fBexit\fP\&. This will trigger an exit at the outermost level of a -+non\-interactive script\&. -+.TP -+\fBEVAL_LINENO\fP -+If set, line numbers of expressions evaluated using the builtin \fBeval\fP -+are tracked separately of the enclosing environment\&. This applies both -+to the parameter \fBLINENO\fP and the line number output by the prompt -+escape \fB%i\fP\&. If the option is set, the prompt escape \fB%N\fP will output -+the string `\fB(eval)\fP\&' instead of the script or function name as an -+indication\&. (The two prompt escapes are typically used in the parameter -+\fBPS4\fP to be output when the option \fBXTRACE\fP is set\&.) If -+\fBEVAL_LINENO\fP is unset, the line number of the surrounding script or -+function is retained during the evaluation\&. -+.TP -+\fBEXEC\fP (\fB+n\fP, ksh: \fB+n\fP) -+Do execute commands\&. Without this option, commands are -+read and checked for syntax errors, but not executed\&. -+This option cannot be turned off in an interactive shell, -+except when `\fB\-n\fP\&' is supplied to the shell at startup\&. -+.TP -+\fBFUNCTION_ARGZERO\fP -+When executing a shell function or sourcing a script, set \fB$0\fP -+temporarily to the name of the function/script\&. -+.TP -+\fBLOCAL_OPTIONS\fP -+If this option is set at the point of return from a shell function, -+most options (including this one) which were in force upon entry to -+the function are restored; options that are not restored are -+\fBPRIVILEGED\fP and \fBRESTRICTED\fP\&. Otherwise, only this option and the -+\fBXTRACE\fP and \fBPRINT_EXIT_VALUE\fP options are restored\&. Hence -+if this is explicitly unset by a shell function the other options in -+force at the point of return will remain so\&. -+A shell function can also guarantee itself a known shell configuration -+with a formulation like `\fBemulate \-L zsh\fP\&'; the \fB\-L\fP activates -+\fBLOCAL_OPTIONS\fP\&. -+.TP -+\fBLOCAL_TRAPS\fP -+If this option is set when a signal trap is set inside a function, then the -+previous status of the trap for that signal will be restored when the -+function exits\&. Note that this option must be set \fIprior\fP to altering the -+trap behaviour in a function; unlike \fBLOCAL_OPTIONS\fP, the value on exit -+from the function is irrelevant\&. However, it does not need to be set -+before any global trap for that to be correctly restored by a function\&. -+For example, -+.RS -+.PP -+.RS -+.nf -+\fBunsetopt localtraps -+trap \- INT -+fn() { setopt localtraps; trap \&'' INT; sleep 3; }\fP -+.fi -+.RE -+.PP -+will restore normal handling of \fBSIGINT\fP after the function exits\&. -+.RE -+.TP -+\fBMULTI_FUNC_DEF\fP -+Allow definitions of multiple functions at once in the form `\fBfn1 -+fn2\fP\fI\&.\&.\&.\fP\fB()\fP\&'; if the option is not set, this causes -+a parse error\&. Definition of multiple functions with the \fBfunction\fP -+keyword is always allowed\&. Multiple function definitions are not often -+used and can cause obscure errors\&. -+.TP -+\fBMULTIOS\fP -+Perform implicit \fBtee\fPs or \fBcat\fPs when multiple -+redirections are attempted (see the section `Redirection\&')\&. -+.TP -+\fBOCTAL_ZEROES\fP -+Interpret any integer constant beginning with a 0 as octal, per IEEE Std -+1003\&.2\-1992 (ISO 9945\-2:1993)\&. This is not enabled by default as it -+causes problems with parsing of, for example, date and time strings with -+leading zeroes\&. -+.RS -+.PP -+Sequences of digits indicating a numeric base such as the `\fB08\fP\&' -+component in `\fB08#77\fP\&' are always interpreted as decimal, regardless -+of leading zeroes\&. -+.RE -+.TP -+\fBSOURCE_TRACE\fP -+If set, zsh will print an informational message announcing the name of -+each file it loads\&. The format of the output is similar to that -+for the \fBXTRACE\fP option, with the message \fB\fP\&. -+A file may be loaded by the shell itself when it -+starts up and shuts down (\fBStartup/Shutdown Files\fP) or by the use of -+the `\fBsource\fP\&' and `\fBdot\fP' builtin commands\&. -+.TP -+\fBTYPESET_SILENT\fP -+If this is unset, executing any of the `\fBtypeset\fP\&' family of -+commands with no options and a list of parameters that have no values -+to be assigned but already exist will display the value of the parameter\&. -+If the option is set, they will only be shown when parameters are selected -+with the `\fB\-m\fP\&' option\&. The option `\fB\-p\fP' is available whether or not -+the option is set\&. -+.TP -+\fBVERBOSE\fP (\fB\-v\fP, ksh: \fB\-v\fP) -+Print shell input lines as they are read\&. -+.TP -+\fBXTRACE\fP (\fB\-x\fP, ksh: \fB\-x\fP) -+Print commands and their arguments as they are executed\&. The -+output is proceded by the value of \fB$PS4\fP, formatted as described -+in -+the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. -+.PP -+.SS "Shell Emulation" -+.PD 0 -+.TP -+.PD -+\fBBASH_REMATCH\fP -+When set, matches performed with the \fB=~\fP operator will set the -+\fBBASH_REMATCH\fP array variable, instead of the default \fBMATCH\fP and -+\fBmatch\fP variables\&. The first element of the \fBBASH_REMATCH\fP array -+will contain the entire matched text and subsequent elements will contain -+extracted substrings\&. This option makes more sense when \fBKSH_ARRAYS\fP is -+also set, so that the entire matched portion is stored at index 0 and the -+first substring is at index 1\&. Without this option, the \fBMATCH\fP variable -+contains the entire matched text and the \fBmatch\fP array variable contains -+substrings\&. -+.TP -+\fBBSD_ECHO\fP -+Make the \fBecho\fP builtin compatible with the BSD \fIecho\fP(1) command\&. -+This disables backslashed escape sequences in echo strings unless the -+\fB\-e\fP option is specified\&. -+.TP -+\fBCSH_JUNKIE_HISTORY\fP -+A history reference without an event specifier will always refer to the -+previous command\&. Without this option, such a history reference refers -+to the same event as the previous history reference, defaulting to the -+previous command\&. -+.TP -+\fBCSH_JUNKIE_LOOPS\fP -+Allow loop bodies to take the form `\fIlist\fP; \fBend\fP\&' instead of -+`\fBdo\fP \fIlist\fP; \fBdone\fP\&'\&. -+.TP -+\fBCSH_JUNKIE_QUOTES\fP -+Changes the rules for single\- and double\-quoted text to match that of -+\fBcsh\fP\&. These require that embedded newlines be preceded by a backslash; -+unescaped newlines will cause an error message\&. -+In double\-quoted strings, it is made impossible to escape `\fB$\fP\&', `\fB`\fP' -+or `\fB"\fP\&' (and `\fB\e\fP' itself no longer needs escaping)\&. -+Command substitutions are only expanded once, and cannot be nested\&. -+.TP -+\fBCSH_NULLCMD\fP -+Do not use the values of \fBNULLCMD\fP and \fBREADNULLCMD\fP -+when running redirections with no command\&. This make -+such redirections fail (see the section `Redirection\&')\&. -+.TP -+\fBKSH_ARRAYS\fP -+Emulate \fBksh\fP array handling as closely as possible\&. If this option -+is set, array elements are numbered from zero, an array parameter -+without subscript refers to the first element instead of the whole array, -+and braces are required to delimit a subscript (`\fB${path[2]}\fP\&' rather -+than just `\fB$path[2]\fP\&')\&. -+.TP -+\fBKSH_AUTOLOAD\fP -+Emulate \fBksh\fP function autoloading\&. This means that when a function is -+autoloaded, the corresponding file is merely executed, and must define -+the function itself\&. (By default, the function is defined to the contents -+of the file\&. However, the most common \fBksh\fP\-style case \- of the file -+containing only a simple definition of the function \- is always handled -+in the \fBksh\fP\-compatible manner\&.) -+.TP -+\fBKSH_OPTION_PRINT\fP -+Alters the way options settings are printed: instead of separate lists of -+set and unset options, all options are shown, marked `on\&' if -+they are in the non\-default state, `off\&' otherwise\&. -+.TP -+\fBKSH_TYPESET\fP -+Alters the way arguments to the \fBtypeset\fP family of commands, including -+\fBdeclare\fP, \fBexport\fP, \fBfloat\fP, \fBinteger\fP, \fBlocal\fP and -+\fBreadonly\fP, are processed\&. Without this option, zsh will perform normal -+word splitting after command and parameter expansion in arguments of an -+assignment; with it, word splitting does not take place in those cases\&. -+.TP -+\fBKSH_ZERO_SUBSCRIPT\fP -+Treat use of a subscript of value zero in array or string expressions as a -+reference to the first element, i\&.e\&. the element that usually has the -+subscript 1\&. Ignored if \fBKSH_ARRAYS\fP is also set\&. -+.RS -+.PP -+If neither this option nor \fBKSH_ARRAYS\fP is set, accesses to an element of -+an array or string with subscript zero return an empty element or string, -+while attempts to set element zero of an array or string are treated as an -+error\&. However, attempts to set an otherwise valid subscript range that -+includes zero will succeed\&. For example, if \fBKSH_ZERO_SUBSCRIPT\fP is not -+set, -+.PP -+.RS -+.nf -+\fBarray[0]=(element)\fP -+.fi -+.RE -+.PP -+is an error, while -+.PP -+.RS -+.nf -+\fBarray[0,1]=(element)\fP -+.fi -+.RE -+.PP -+is not and will replace the first element of the array\&. -+.PP -+This option is for compatibility with older versions of the shell and -+is not recommended in new code\&. -+.RE -+.TP -+\fBPOSIX_ALIASES\fP -+When this option is set, reserved words are not candidates for -+alias expansion: it is still possible to declare any of them as an alias, -+but the alias will never be expanded\&. Reserved words are described in -+the section RESERVED WORDS in \fIzshmisc\fP(1)\&. -+.RS -+.PP -+Alias expansion takes place while text is being read; hence when this -+option is set it does not take effect until the end of any function or -+other piece of shell code parsed as one unit\&. Note this may -+cause differences from other shells even when the option is in -+effect\&. For example, when running a command with `\fBzsh \-c\fP\&', -+or even `\fBzsh \-o posixaliases \-c\fP\&', the entire command argument is parsed -+as one unit, so aliases defined within the argument are not available even -+in later lines\&. If in doubt, avoid use of aliases in non\-interactive -+code\&. -+.RE -+.TP -+\fBPOSIX_BUILTINS\fP -+When this option is set the \fBcommand\fP builtin can be used to execute -+shell builtin commands\&. Parameter assignments specified before shell -+functions and special builtins are kept after the command completes unless -+the special builtin is prefixed with the \fBcommand\fP builtin\&. Special -+builtins are -+\fB\&.\fP, -+\fB:\fP, -+\fBbreak\fP, -+\fBcontinue\fP, -+\fBdeclare\fP, -+\fBeval\fP, -+\fBexit\fP, -+\fBexport\fP, -+\fBinteger\fP, -+\fBlocal\fP, -+\fBreadonly\fP, -+\fBreturn\fP, -+\fBset\fP, -+\fBshift\fP, -+\fBsource\fP, -+\fBtimes\fP, -+\fBtrap\fP and -+\fBunset\fP\&. -+.RS -+.PP -+In addition, various error conditions associated with the above builtins -+or \fBexec\fP cause a non\-interactive shell to exit and an interactive -+shell to return to its top\-level processing\&. -+.RE -+.TP -+\fBPOSIX_IDENTIFIERS\fP -+When this option is set, only the ASCII characters \fBa\fP to \fBz\fP, \fBA\fP to -+\fBZ\fP, \fB0\fP to \fB9\fP and \fB_\fP may be used in identifiers (names -+of shell parameters and modules)\&. -+.RS -+.PP -+When the option is unset and multibyte character support is enabled (i\&.e\&. it -+is compiled in and the option \fBMULTIBYTE\fP is set), then additionally any -+alphanumeric characters in the local character set may be used in -+identifiers\&. Note that scripts and functions written with this feature are -+not portable, and also that both options must be set before the script -+or function is parsed; setting them during execution is not sufficient -+as the syntax \fIvariable\fP\fB=\fP\fIvalue\fP has already been parsed as -+a command rather than an assignment\&. -+.PP -+If multibyte character support is not compiled into the shell this option is -+ignored; all octets with the top bit set may be used in identifiers\&. -+This is non\-standard but is the traditional zsh behaviour\&. -+.RE -+.TP -+\fBPOSIX_STRINGS\fP -+This option affects processing of quoted strings\&. Currently it only -+affects the behaviour of null characters, i\&.e\&. character 0 in the -+portable character set corresponding to US ASCII\&. -+.RS -+.PP -+When this option is not set, null characters embedded within strings -+of the form \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP are treated as ordinary characters\&. The -+entire string is maintained within the shell and output to files where -+necessary, although owing to restrictions of the library interface -+the string is truncated at the null character in file names, environment -+variables, or in arguments to external programs\&. -+.PP -+When this option is set, the \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP expression is truncated at -+the null character\&. Note that remaining parts of the same string -+beyond the termination of the quotes are not trunctated\&. -+.PP -+For example, the command line argument \fBa$\&'b\e0c'd\fP is treated with -+the option off as the characters \fBa\fP, \fBb\fP, null, \fBc\fP, \fBd\fP, -+and with the option on as the characters \fBa\fP, \fBb\fP, \fBd\fP\&. -+.RE -+.TP -+\fBPOSIX_TRAPS\fP -+When the is option is set, the usual zsh behaviour of executing -+traps for \fBEXIT\fP on exit from shell functions is suppressed\&. -+In that case, manipulating \fBEXIT\fP traps always alters the global -+trap for exiting the shell; the \fBLOCAL_TRAPS\fP option is -+ignored for the \fBEXIT\fP trap\&. -+.TP -+\fBSH_FILE_EXPANSION\fP -+Perform filename expansion (e\&.g\&., ~ expansion) \fIbefore\fP -+parameter expansion, command substitution, arithmetic expansion -+and brace expansion\&. -+If this option is unset, it is performed \fIafter\fP -+brace expansion, so things like `\fB~$USERNAME\fP\&' and -+`\fB~{pfalstad,rc}\fP\&' will work\&. -+.TP -+\fBSH_NULLCMD\fP -+Do not use the values of \fBNULLCMD\fP and \fBREADNULLCMD\fP -+when doing redirections, use `\fB:\fP\&' instead (see the section `Redirection')\&. -+.TP -+\fBSH_OPTION_LETTERS\fP -+If this option is set the shell tries to interpret single letter options -+(which are used with \fBset\fP and \fBsetopt\fP) like \fBksh\fP does\&. -+This also affects the value of the \fB\-\fP special parameter\&. -+.TP -+\fBSH_WORD_SPLIT\fP (\fB\-y\fP) -+Causes field splitting to be performed on unquoted parameter expansions\&. -+Note that this option has nothing to do with word splitting\&. -+(See the section `Parameter Expansion\&'\&.) -+.TP -+\fBTRAPS_ASYNC\fP -+While waiting for a program to exit, handle signals and run traps -+immediately\&. Otherwise the trap is run after a child process has exited\&. -+Note this does not affect the point at which traps are run for any case -+other than when the shell is waiting for a child process\&. -+.PP -+.SS "Shell State" -+.PD 0 -+.TP -+.PD -+\fBINTERACTIVE\fP (\fB\-i\fP, ksh: \fB\-i\fP) -+This is an interactive shell\&. This option is set upon initialisation if -+the standard input is a tty and commands are being read from standard input\&. -+(See the discussion of \fBSHIN_STDIN\fP\&.) -+This heuristic may be overridden by specifying a state for this option -+on the command line\&. -+The value of this option can only be changed via flags supplied at -+invocation of the shell\&. -+It cannot be changed once zsh is running\&. -+.TP -+\fBLOGIN\fP (\fB\-l\fP, ksh: \fB\-l\fP) -+This is a login shell\&. -+If this option is not explicitly set, the shell is a login shell if -+the first character of the \fBargv[0]\fP passed to the shell is a `\fB\-\fP\&'\&. -+.TP -+\fBPRIVILEGED\fP (\fB\-p\fP, ksh: \fB\-p\fP) -+Turn on privileged mode\&. This is enabled automatically on startup if the -+effective user (group) ID is not equal to the real user (group) ID\&. Turning -+this option off causes the effective user and group IDs to be set to the -+real user and group IDs\&. This option disables sourcing user startup files\&. -+If zsh is invoked as `\fBsh\fP\&' or `\fBksh\fP' with this option set, -+\fB/etc/suid_profile\fP is sourced (after \fB/etc/profile\fP on interactive -+shells)\&. Sourcing \fB~/\&.profile\fP is disabled and the contents of the -+\fBENV\fP variable is ignored\&. This option cannot be changed using the -+\fB\-m\fP option of \fBsetopt\fP and \fBunsetopt\fP, and changing it inside a -+function always changes it globally regardless of the \fBLOCAL_OPTIONS\fP -+option\&. -+.TP -+\fBRESTRICTED\fP (\fB\-r\fP) -+Enables restricted mode\&. This option cannot be changed using -+\fBunsetopt\fP, and setting it inside a function always changes it -+globally regardless of the \fBLOCAL_OPTIONS\fP option\&. See -+the section `Restricted Shell\&'\&. -+.TP -+\fBSHIN_STDIN\fP (\fB\-s\fP, ksh: \fB\-s\fP) -+Commands are being read from the standard input\&. -+Commands are read from standard input if no command is specified with -+\fB\-c\fP and no file of commands is specified\&. If \fBSHIN_STDIN\fP -+is set explicitly on the command line, -+any argument that would otherwise have been -+taken as a file to run will instead be treated as a normal positional -+parameter\&. -+Note that setting or unsetting this option on the command line does not -+necessarily affect the state the option will have while the shell is -+running \- that is purely an indicator of whether on not commands are -+\fIactually\fP being read from standard input\&. -+The value of this option can only be changed via flags supplied at -+invocation of the shell\&. -+It cannot be changed once zsh is running\&. -+.TP -+\fBSINGLE_COMMAND\fP (\fB\-t\fP, ksh: \fB\-t\fP) -+If the shell is reading from standard input, it exits after a single command -+has been executed\&. This also makes the shell non\-interactive, unless the -+\fBINTERACTIVE\fP option is explicitly set on the command line\&. -+The value of this option can only be changed via flags supplied at -+invocation of the shell\&. -+It cannot be changed once zsh is running\&. -+.PP -+.SS "Zle" -+.PD 0 -+.TP -+.PD -+\fBBEEP\fP (\fB+B\fP) -+Beep on error in ZLE\&. -+.TP -+\fBCOMBINING_CHARS\fP -+Assume that the terminal displays combining characters correctly\&. -+Specifically, if a base alphanumeric character is followed by one or more -+zero\-width punctuation characters, assume that the zero\-width characters -+will be displayed as modifications to the base character within the -+same width\&. Not all terminals handle this\&. If this option is not -+set, zero\-width characters are displayed separately with special -+mark\-up\&. -+.RS -+.PP -+If this option is set, the pattern test \fB[[:WORD:]]\fP matches a -+zero\-width punctuation character on the assumption that it will be -+used as part of a word in combination with a word character\&. -+Otherwise the base shell does not handle combining characters specially\&. -+.RE -+.TP -+\fBEMACS\fP -+If ZLE is loaded, turning on this option has the equivalent effect -+of `\fBbindkey \-e\fP\&'\&. In addition, the VI option is unset\&. -+Turning it off has no effect\&. The option setting is -+not guaranteed to reflect the current keymap\&. This option is -+provided for compatibility; \fBbindkey\fP is the recommended interface\&. -+.TP -+\fBOVERSTRIKE\fP -+Start up the line editor in overstrike mode\&. -+.TP -+\fBSINGLE_LINE_ZLE\fP (\fB\-M\fP) -+Use single\-line command line editing instead of multi\-line\&. -+.RS -+.PP -+Note that although this is on by default in ksh emulation it only -+provides superficial compatibility with the ksh line editor and -+reduces the effectiveness of the zsh line editor\&. As it has no -+effect on shell syntax, many users may wish to disable this option -+when using ksh emulation interactively\&. -+.RE -+.TP -+\fBVI\fP -+If ZLE is loaded, turning on this option has the equivalent effect -+of `\fBbindkey \-v\fP\&'\&. In addition, the EMACS option is unset\&. -+Turning it off has no effect\&. The option setting is -+not guaranteed to reflect the current keymap\&. This option is -+provided for compatibility; \fBbindkey\fP is the recommended interface\&. -+.TP -+\fBZLE\fP (\fB\-Z\fP) -+Use the zsh line editor\&. Set by default in interactive shells connected to -+a terminal\&. -+.PP -+.SH "OPTION ALIASES" -+Some options have alternative names\&. These aliases are never used for -+output, but can be used just like normal option names when specifying -+options to the shell\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBBRACE_EXPAND\fP -+\fINO_\fP\fBIGNORE_BRACES\fP -+(ksh and bash compatibility) -+.TP -+\fBDOT_GLOB\fP -+\fBGLOB_DOTS\fP -+(bash compatibility) -+.TP -+\fBHASH_ALL\fP -+\fBHASH_CMDS\fP -+(bash compatibility) -+.TP -+\fBHIST_APPEND\fP -+\fBAPPEND_HISTORY\fP -+(bash compatibility) -+.TP -+\fBHIST_EXPAND\fP -+\fBBANG_HIST\fP -+(bash compatibility) -+.TP -+\fBLOG\fP -+\fINO_\fP\fBHIST_NO_FUNCTIONS\fP -+(ksh compatibility) -+.TP -+\fBMAIL_WARN\fP -+\fBMAIL_WARNING\fP -+(bash compatibility) -+.TP -+\fBONE_CMD\fP -+\fBSINGLE_COMMAND\fP -+(bash compatibility) -+.TP -+\fBPHYSICAL\fP -+\fBCHASE_LINKS\fP -+(ksh and bash compatibility) -+.TP -+\fBPROMPT_VARS\fP -+\fBPROMPT_SUBST\fP -+(bash compatibility) -+.TP -+\fBSTDIN\fP -+\fBSHIN_STDIN\fP -+(ksh compatibility) -+.TP -+\fBTRACK_ALL\fP -+\fBHASH_CMDS\fP -+(ksh compatibility) -+.SH "SINGLE LETTER OPTIONS" -+.SS "Default set" -+.PD 0 -+.TP -+\fB\-0\fP -+CORRECT -+.TP -+\fB\-1\fP -+PRINT_EXIT_VALUE -+.TP -+\fB\-2\fP -+\fINO_\fPBAD_PATTERN -+.TP -+\fB\-3\fP -+\fINO_\fPNOMATCH -+.TP -+\fB\-4\fP -+GLOB_DOTS -+.TP -+\fB\-5\fP -+NOTIFY -+.TP -+\fB\-6\fP -+BG_NICE -+.TP -+\fB\-7\fP -+IGNORE_EOF -+.TP -+\fB\-8\fP -+MARK_DIRS -+.TP -+\fB\-9\fP -+AUTO_LIST -+.TP -+\fB\-B\fP -+\fINO_\fPBEEP -+.TP -+\fB\-C\fP -+\fINO_\fPCLOBBER -+.TP -+\fB\-D\fP -+PUSHD_TO_HOME -+.TP -+\fB\-E\fP -+PUSHD_SILENT -+.TP -+\fB\-F\fP -+\fINO_\fPGLOB -+.TP -+\fB\-G\fP -+NULL_GLOB -+.TP -+\fB\-H\fP -+RM_STAR_SILENT -+.TP -+\fB\-I\fP -+IGNORE_BRACES -+.TP -+\fB\-J\fP -+AUTO_CD -+.TP -+\fB\-K\fP -+\fINO_\fPBANG_HIST -+.TP -+\fB\-L\fP -+SUN_KEYBOARD_HACK -+.TP -+\fB\-M\fP -+SINGLE_LINE_ZLE -+.TP -+\fB\-N\fP -+AUTO_PUSHD -+.TP -+\fB\-O\fP -+CORRECT_ALL -+.TP -+\fB\-P\fP -+RC_EXPAND_PARAM -+.TP -+\fB\-Q\fP -+PATH_DIRS -+.TP -+\fB\-R\fP -+LONG_LIST_JOBS -+.TP -+\fB\-S\fP -+REC_EXACT -+.TP -+\fB\-T\fP -+CDABLE_VARS -+.TP -+\fB\-U\fP -+MAIL_WARNING -+.TP -+\fB\-V\fP -+\fINO_\fPPROMPT_CR -+.TP -+\fB\-W\fP -+AUTO_RESUME -+.TP -+\fB\-X\fP -+LIST_TYPES -+.TP -+\fB\-Y\fP -+MENU_COMPLETE -+.TP -+\fB\-Z\fP -+ZLE -+.TP -+\fB\-a\fP -+ALL_EXPORT -+.TP -+\fB\-e\fP -+ERR_EXIT -+.TP -+\fB\-f\fP -+\fINO_\fPRCS -+.TP -+\fB\-g\fP -+HIST_IGNORE_SPACE -+.TP -+\fB\-h\fP -+HIST_IGNORE_DUPS -+.TP -+\fB\-i\fP -+INTERACTIVE -+.TP -+\fB\-k\fP -+INTERACTIVE_COMMENTS -+.TP -+\fB\-l\fP -+LOGIN -+.TP -+\fB\-m\fP -+MONITOR -+.TP -+\fB\-n\fP -+\fINO_\fPEXEC -+.TP -+\fB\-p\fP -+PRIVILEGED -+.TP -+\fB\-r\fP -+RESTRICTED -+.TP -+\fB\-s\fP -+SHIN_STDIN -+.TP -+\fB\-t\fP -+SINGLE_COMMAND -+.TP -+\fB\-u\fP -+\fINO_\fPUNSET -+.TP -+\fB\-v\fP -+VERBOSE -+.TP -+\fB\-w\fP -+CHASE_LINKS -+.TP -+\fB\-x\fP -+XTRACE -+.TP -+\fB\-y\fP -+SH_WORD_SPLIT -+.PD -+.SS "sh/ksh emulation set" -+.PD 0 -+.TP -+\fB\-C\fP -+\fINO_\fPCLOBBER -+.TP -+\fB\-T\fP -+TRAPS_ASYNC -+.TP -+\fB\-X\fP -+MARK_DIRS -+.TP -+\fB\-a\fP -+ALL_EXPORT -+.TP -+\fB\-b\fP -+NOTIFY -+.TP -+\fB\-e\fP -+ERR_EXIT -+.TP -+\fB\-f\fP -+\fINO_\fPGLOB -+.TP -+\fB\-i\fP -+INTERACTIVE -+.TP -+\fB\-l\fP -+LOGIN -+.TP -+\fB\-m\fP -+MONITOR -+.TP -+\fB\-n\fP -+\fINO_\fPEXEC -+.TP -+\fB\-p\fP -+PRIVILEGED -+.TP -+\fB\-r\fP -+RESTRICTED -+.TP -+\fB\-s\fP -+SHIN_STDIN -+.TP -+\fB\-t\fP -+SINGLE_COMMAND -+.TP -+\fB\-u\fP -+\fINO_\fPUNSET -+.TP -+\fB\-v\fP -+VERBOSE -+.TP -+\fB\-x\fP -+XTRACE -+.PD -+.SS "Also note" -+.PD 0 -+.TP -+\fB\-A\fP -+Used by \fBset\fP for setting arrays -+.TP -+\fB\-b\fP -+Used on the command line to specify end of option processing -+.TP -+\fB\-c\fP -+Used on the command line to specify a single command -+.TP -+\fB\-m\fP -+Used by \fBsetopt\fP for pattern\-matching option setting -+.TP -+\fB\-o\fP -+Used in all places to allow use of long option names -+.TP -+\fB\-s\fP -+Used by \fBset\fP to sort positional parameters -+.PD ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshtcpsys.1 -@@ -0,0 +1,835 @@ -+.TH "ZSHTCPSYS" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshtcpsys \- zsh tcp system -+.\" Yodl file: Zsh/tcpsys.yo -+.SH "DESCRIPTION" -+.PP -+A module \fBzsh/net/tcp\fP is provided to provide network I/O over -+TCP/IP from within the shell; see its description in -+\fIzshmodules\fP(1) -+\&. This manual page describes a function suite based on the module\&. -+If the module is installed, the functions are usually installed at the -+same time, in which case they will be available for -+autoloading in the default function search path\&. In addition to the -+\fBzsh/net/tcp\fP module, the \fBzsh/zselect\fP module is used to implement -+timeouts on read operations\&. For troubleshooting tips, consult the -+corresponding advice for the \fBzftp\fP functions described in -+\fIzshzftpsys\fP(1) -+\&. -+.PP -+There are functions corresponding to the basic I/O operations open, close, -+read and send, named \fBtcp_open\fP etc\&., as well as a function -+\fBtcp_expect\fP for pattern match analysis of data read as input\&. The -+system makes it easy to receive data from and send data to multiple named -+sessions at once\&. In addition, it can be linked with the shell\&'s line -+editor in such a way that input data is automatically shown at the -+terminal\&. Other facilities available including logging, filtering and -+configurable output prompts\&. -+.PP -+To use the system where it is available, it should be enough to -+`\fBautoload \-U tcp_open\fP\&' and run \fBtcp_open\fP as documented below to -+start a session\&. The \fBtcp_open\fP function will autoload the remaining -+functions\&. -+.PP -+.PP -+.SH "TCP USER FUNCTIONS" -+.PP -+.SS "Basic I/O" -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBtcp_open [\-qz]\fP \fIhost port\fP \fB[\fP \fIsess\fP \fB]\fP -+.TP -+.PD 0 -+\fBtcp_open [\-qz] [ \-s\fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ] \&.\&.\&. \fP -+.TP -+.PD -+\fBtcp_open [\-qz] [\-a\fP \fIfd\fP \fB| \-f\fP \fIfd\fP \fB] [\fP \fIsess\fP \fB]\fP -+Open a new session\&. In the first and simplest form, open a TCP connection -+to host \fIhost\fP at port \fIport\fP; numeric and symbolic forms are -+understood for both\&. -+.RS -+.PP -+If \fIsess\fP is given, this becomes the name of the session which can be -+used to refer to multiple different TCP connections\&. If \fIsess\fP is -+not given, the function will invent a numeric name value (note this is -+\fInot\fP the same as the file descriptor to which the session is attached)\&. -+It is recommended that session names not include `funny\&' characters, where -+funny characters are not well\-defined but certainly do not include -+alphanumerics or underscores, and certainly do include whitespace\&. -+.PP -+In the second case, one or more sessions to be opened are given by name\&. -+A single session name is given after \fB\-s\fP and a comma\-separated list -+after \fB\-l\fP; both options may be repeated as many times as necessary\&. -+A failure to open any session causes \fBtcp_open\fP to abort\&. -+The host and port are read from the file \fB\&.ztcp_sessions\fP in the same -+directory as the user\&'s zsh initialisation files, i\&.e\&. usually the home -+directory, but \fB$ZDOTDIR\fP if that is set\&. The file consists of lines -+each giving a session name and the corresponding host and port, in that -+order (note the session name comes first, not last), separated by -+whitespace\&. -+.PP -+The third form allows passive and fake TCP connections\&. If the option -+\fB\-a\fP is used, its argument is a file descriptor open for listening for -+connections\&. No function front\-end is provided to open such a file -+descriptor, but a call to `\fBztcp \-l\fP \fIport\fP\&' will create one with the -+file descriptor stored in the parameter \fB$REPLY\fP\&. The listening port can -+be closed with `\fBztcp \-c\fP \fIfd\fP\&'\&. A call to `\fBtcp_open \-a\fP \fIfd\fP' -+will block until a remote TCP connection is made to \fIport\fP on the local -+machine\&. At this point, a session is created in the usual way and is -+largely indistinguishable from an active connection created with one of the -+first two forms\&. -+.PP -+If the option \fB\-f\fP is used, its argument is a file descriptor which is -+used directly as if it were a TCP session\&. How well the remainder of the -+TCP function system copes with this depends on what actually underlies this -+file descriptor\&. A regular file is likely to be unusable; a FIFO (pipe) of -+some sort will work better, but note that it is not a good idea for two -+different sessions to attempt to read from the same FIFO at once\&. -+.PP -+If the option \fB\-q\fP is given with any of the three forms, \fBtcp_open\fP -+will not print informational messages, although it will in any case exit -+with an appropriate status\&. -+.PP -+If the line editor (zle) is in use, which is typically the case if the -+shell is interactive, \fBtcp_open\fP installs a handler inside \fBzle\fP which -+will check for new data at the same time as it checks for keyboard input\&. -+This is convenient as the shell consumes no CPU time while waiting; the -+test is performed by the operating system\&. Giving the option \fB\-z\fP to -+any of the forms of \fBtcp_open\fP prevents the handler from being -+installed, so data must be read explicitly\&. Note, however, this is not -+necessary for executing complete sets of send and read commands from a -+function, as zle is not active at this point\&. Generally speaking, the -+handler is only active when the shell is waiting for input at a command -+prompt or in the \fBvared\fP builtin\&. The option has no effect if zle is not -+active; `\fB[[ \-o zle]]\fP\&' will test for this\&. -+.PP -+The first session to be opened becomes the current session and subsequent -+calls to \fBtcp_open\fP do not change it\&. The current session is stored -+in the parameter \fB$TCP_SESS\fP; see below for more detail about the -+parameters used by the system\&. -+.PP -+The function \fBtcp_on_open\fP, if defined, is called when a session -+is opened\&. See the description below\&. -+.RE -+.TP -+\fBtcp_close [\-qn] [ \-a | \-l\fP \fIsess\fP\fB,\&.\&.\&. |\fP \fIsess\fP \fB\&.\&.\&. ]\fP -+Close the named sessions, or the current session if none is given, -+or all open sessions if \fB\-a\fP is given\&. The options \fB\-l\fP and \fB\-s\fP are -+both handled for consistency with \fBtcp_open\fP, although the latter is -+redundant\&. -+.RS -+.PP -+If the session being closed is the current one, \fB$TCP_SESS\fP is unset, -+leaving no current session, even if there are other sessions still open\&. -+.PP -+If the session was opened with \fBtcp_open \-f\fP, the file descriptor is -+closed so long as it is in the range 0 to 9 accessible directly from the -+command line\&. If the option \fB\-n\fP is given, no attempt will be made to -+close file descriptors in this case\&. The \fB\-n\fP option is not used for -+genuine \fBztcp\fP session; the file descriptors are always closed with the -+session\&. -+.PP -+If the option \fB\-q\fP is given, no informational messages will be printed\&. -+.RE -+.TP -+.PD 0 -+\fBtcp_read [\-bdq] [ \-t\fP \fITO\fP \fB] [ \-T\fP \fITO\fP \fB]\fP -+.TP -+.PD -+ \fB[ \-a | \-u\fP \fIfd\fP \fB\&.\&.\&. | \-l\fP \fIsess\fP\fB,\&.\&.\&. | \-s\fP \fIsess\fP \fB\&.\&.\&.]\fP -+Perform a read operation on the current session, or on a list of -+sessions if any are given with \fB\-u\fP, \fB\-l\fP or \fB\-s\fP, or all open -+sessions if the option \fB\-a\fP is given\&. Any of the \fB\-u\fP, \fB\-l\fP or -+\fB\-s\fP options may be repeated or mixed together\&. The \fB\-u\fP option -+specifies a file descriptor directly (only those managed by this system -+are useful), the other two specify sessions as described for -+\fBtcp_open\fP above\&. -+.RS -+.PP -+The function checks for new data available on all the sessions listed\&. -+Unless the \fB\-b\fP option is given, it will not block waiting for new data\&. -+Any one line of data from any of the available sessions will be read, -+stored in the parameter \fB$TCP_LINE\fP, and displayed to standard output -+unless \fB$TCP_SILENT\fP contains a non\-empty string\&. When printed to -+standard output the string \fB$TCP_PROMPT\fP will be shown at the start of -+the line; the default form for this includes the name of the session being -+read\&. See below for more information on these parameters\&. In this mode, -+\fBtcp_read\fP can be called repeatedly until it returns status 2 which -+indicates all pending input from all specified sessions has been handled\&. -+.PP -+With the option \fB\-b\fP, equivalent to an infinite timeout, the function -+will block until a line is available to read from one of the specified -+sessions\&. However, only a single line is returned\&. -+.PP -+The option \fB\-d\fP indicates that all pending input should be drained\&. In -+this case \fBtcp_read\fP may process multiple lines in the manner given -+above; only the last is stored in \fB$TCP_LINE\fP, but the complete set is -+stored in the array \fB$tcp_lines\fP\&. This is cleared at the start of each -+call to \fBtcp_read\fP\&. -+.PP -+The options \fB\-t\fP and \fB\-T\fP specify a timeout in seconds, which may be a -+floating point number for increased accuracy\&. With \fB\-t\fP the timeout is -+applied before each line read\&. With \fB\-T\fP, the timeout applies to the -+overall operation, possibly including multiple read operations if the -+option \fB\-d\fP is present; without this option, there is no distinction -+between \fB\-t\fP and \fB\-T\fP\&. -+.PP -+The function does not print informational messages, but if the option -+\fB\-q\fP is given, no error message is printed for a non\-existent session\&. -+.PP -+A return status of 2 indicates a timeout or no data to read\&. Any other -+non\-zero return status indicates some error condition\&. -+.PP -+See \fBtcp_log\fP for how to control where data is sent by \fBtcp_read\fP\&. -+.RE -+.TP -+.PD 0 -+\fBtcp_send [\-cnq] [ \-s\fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIdata\fP \fB\&.\&.\&.\fP -+.TP -+.PD -+\fBtcp_send [\-cnq] \-a\fP \fIdata\fP \fB\&.\&.\&.\fP -+Send the supplied data strings to all the specified sessions in turn\&. The -+underlying operation differs little from a `\fBprint \-r\fP\&' to the session's -+file descriptor, although it attempts to prevent the shell from dying owing -+to a \fBSIGPIPE\fP caused by an attempt to write to a defunct session\&. -+.RS -+.PP -+The option \fB\-c\fP causes \fBtcp_send\fP to behave like \fBcat\fP\&. It reads -+lines from standard input until end of input and sends them in turn to the -+specified session(s) exactly as if they were given as \fIdata\fP -+arguments to individual \fBtcp_send\fP commands\&. -+.PP -+The option \fB\-n\fP prevents \fBtcp_send\fP from putting a newline at the end -+of the data strings\&. -+.PP -+The remaining options all behave as for \fBtcp_read\fP\&. -+.PP -+The data arguments are not further processed once they have been passed to -+\fBtcp_send\fP; they are simply passed down to \fBprint \-r\fP\&. -+.PP -+If the parameter \fB$TCP_OUTPUT\fP is a non\-empty string and logging is -+enabled then the data sent to each session will be echoed to the log -+file(s) with \fB$TCP_OUTPUT\fP in front where appropriate, much -+in the manner of \fB$TCP_PROMPT\fP\&. -+.RE -+.RE -+.PP -+.SS "Session Management" -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBtcp_alias [\-q]\fP \fIalias\fP\fB=\fP\fIsess\fP \fB\&.\&.\&.\fP -+.TP -+.PD 0 -+\fBtcp_alias [\-q] [\fP \fIalias\fP \fB] \&.\&.\&.\fP -+.TP -+.PD -+\fBtcp_alias \-d [\-q]\fP \fIalias\fP \fB\&.\&.\&.\fP -+This function is not particularly well tested\&. -+.RS -+.PP -+The first form creates an alias for a session name; \fIalias\fP can then be -+used to refer to the existing session \fIsess\fP\&. As many aliases may be -+listed as required\&. -+.PP -+The second form lists any aliases specified, or all aliases if none\&. -+.PP -+The third form deletes all the aliases listed\&. The underlying sessions are -+not affected\&. -+.PP -+The option \fB\-q\fP suppresses an inconsistently chosen subset of error -+messages\&. -+.RE -+.TP -+\fBtcp_log [\-asc] [ \-n | \-N ] [\fP \fIlogfile\fP \fB]\fP -+With an argument \fIlogfile\fP, all future input from \fBtcp_read\fP will be -+logged to the named file\&. Unless \fB\-a\fP (append) is given, this file will -+first be truncated or created empty\&. With no arguments, show the current -+status of logging\&. -+.RS -+.PP -+With the option \fB\-s\fP, per\-session logging is enabled\&. Input from -+\fBtcp_read\fP is output to the file \fIlogfile\fP\&.\fIsess\fP\&. As the -+session is automatically discriminated by the filename, the contents are -+raw (no \fB$TCP_PROMPT\fP)\&. The option \fB\-a\fP applies as above\&. -+Per\-session logging and logging of all data in one file are not mutually -+exclusive\&. -+.PP -+The option \fB\-c\fP closes all logging, both complete and per\-session logs\&. -+.PP -+The options \fB\-n\fP and \fB\-N\fP respectively turn off or restore output of -+data read by \fBtcp_read\fP to standard output; hence `\fBtcp_log \-cn\fP\&' turns -+off all output by \fBtcp_read\fP\&. -+.PP -+The function is purely a convenient front end to setting the parameters -+\fB$TCP_LOG\fP, \fB$TCP_LOG_SESS\fP, \fB$TCP_SILENT\fP, which are described below\&. -+.RE -+.TP -+\fBtcp_rename\fP \fIold\fP \fInew\fP -+Rename session \fIold\fP to session \fInew\fP\&. The old name becomes invalid\&. -+.TP -+\fBtcp_sess [\fP \fIsess\fP \fB[\fP \fIcommand\fP \fB\&.\&.\&. ] ]\fP -+With no arguments, list all the open sessions and associated file -+descriptors\&. The current session is marked with a star\&. For use in -+functions, direct access to the parameters \fB$tcp_by_name\fP, \fB$tcp_by_fd\fP -+and \fB$TCP_SESS\fP is probably more convenient; see below\&. -+.RS -+.PP -+With a \fIsess\fP argument, set the current session to \fIsess\fP\&. -+This is equivalent to changing \fB$TCP_SESS\fP directly\&. -+.PP -+With additional arguments, temporarily set the current session while -+executing the string \fBcommand \&.\&.\&.\fP\&. The first argument is re\-evaluated -+so as to expand aliases etc\&., but the remaining arguments are passed -+through as the appear to \fBtcp_sess\fP\&. The original session is restored -+when \fBtcp_sess\fP exits\&. -+.RE -+.RE -+.PP -+.SS "Advanced I/O" -+.PP -+.PD 0 -+.TP -+.PD -+\fBtcp_command\fP \fIsend\-options\fP \fB\&.\&.\&.\fP \fIsend\-arguments\fP \fB\&.\&.\&.\fP -+This is a convenient front\-end to \fBtcp_send\fP\&. All arguments are passed -+to \fBtcp_send\fP, then the function pauses waiting for data\&. While data is -+arriving at least every \fB$TCP_TIMEOUT\fP (default 0\&.3) seconds, data is -+handled and printed out according to the current settings\&. Status 0 is -+always returned\&. -+.RS -+.PP -+This is generally only useful for interactive use, to prevent the display -+becoming fragmented by output returned from the connection\&. Within a -+programme or function it is generally better to handle reading data by a -+more explicit method\&. -+.RE -+.TP -+.PD 0 -+\fBtcp_expect [ \-q ] [ \-p\fP \fIvar\fP \fB] [ \-t \fP \fIto\fP \fB| \-T\fP \fITO\fP\fB]\fP -+.TP -+.PD -+\fB [ \-a | \-s\fP \fIsess\fP \fB\&.\&.\&. | \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIpattern\fP \&.\&.\&. -+Wait for input matching any of the given \fIpattern\fPs from any of the -+specified sessions\&. Input is ignored until an input line matches one of -+the given patterns; at this point status zero is returned, the matching -+line is stored in \fB$TCP_LINE\fP, and the full set of lines read during the -+call to \fBtcp_expect\fP is stored in the array \fB$tcp_expect_lines\fP\&. -+.RS -+.PP -+Sessions are specified in the same way as \fBtcp_read\fP: the default is to -+use the current session, otherwise the sessions specified by \fB\-a\fP, -+\fB\-s\fP, or \fB\-l\fP are used\&. -+.PP -+Each \fIpattern\fP is a standard zsh extended\-globbing pattern; note that it -+needs to be quoted to avoid it being expanded immediately by filename -+generation\&. It must match the full line, so to match a substring there -+must be a `\fB*\fP\&' at the start and end\&. The line matched against includes -+the \fB$TCP_PROMPT\fP added by \fBtcp_read\fP\&. It is possible to include the -+globbing flags `\fB#b\fP\&' or `\fB#m\fP' in the patterns to make backreferences -+available in the parameters \fB$MATCH\fP, \fB$match\fP, etc\&., as described in -+the base zsh documentation on pattern matching\&. -+.PP -+Unlike \fBtcp_read\fP, the default behaviour of \fBtcp_expect\fP is to block -+indefinitely until the required input is found\&. This can be modified by -+specifying a timeout with \fB\-t\fP or \fB\-T\fP; these function as in -+\fBtcp_read\fP, specifying a per\-read or overall timeout, respectively, in -+seconds, as an integer or floating\-point number\&. As \fBtcp_read\fP, the -+function returns status 2 if a timeout occurs\&. -+.PP -+The function returns as soon as any one of the patterns given match\&. If -+the caller needs to know which of the patterns matched, the option \fB\-p\fP -+\fIvar\fP can be used; on return, \fB$var\fP is set to the number of the -+pattern using ordinary zsh indexing, i\&.e\&. the first is 1, and so on\&. Note -+the absence of a `\fB$\fP\&' in front of \fIvar\fP\&. To avoid clashes, the -+parameter cannot begin with `\fB_expect\fP\&'\&. -+.PP -+The option \fB\-q\fP is passed directly down to \fBtcp_read\fP\&. -+.PP -+As all input is done via \fBtcp_read\fP, all the usual rules about output of -+lines read apply\&. One exception is that the parameter \fB$tcp_lines\fP will -+only reflect the line actually matched by \fBtcp_expect\fP; use -+\fB$tcp_expect_lines\fP for the full set of lines read during the function -+call\&. -+.RE -+.TP -+\fBtcp_proxy\fP -+This is a simple\-minded function to accept a TCP connection and execute a -+command with I/O redirected to the connection\&. Extreme caution should be -+taken as there is no security whatsoever and this can leave your computer -+open to the world\&. Ideally, it should only be used behind a firewall\&. -+.RS -+.PP -+The first argument is a TCP port on which the function will listen\&. -+.PP -+The remaining arguments give a command and its arguments to execute with -+standard input, standard output and standard error redirected to the -+file descriptor on which the TCP session has been accepted\&. -+If no command is given, a new zsh is started\&. This gives everyone on -+your network direct access to your account, which in many cases will be a -+bad thing\&. -+.PP -+The command is run in the background, so \fBtcp_proxy\fP can then accept new -+connections\&. It continues to accept new connections until interrupted\&. -+.RE -+.TP -+\fBtcp_spam [\-ertv] [ \-a | \-s \fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIcmd\fP \fB\&.\&.\&.\fP -+Execute `\fIcmd\fP \fB\&.\&.\&.\fP\&' for each session in turn\&. Note this executes -+the command and arguments; it does not send the command line as data -+unless the \fB\-t\fP (transmit) option is given\&. -+.RS -+.PP -+The sessions may be selected explicitly with the standard \fB\-a\fP, \fB\-s\fP or -+\fB\-l\fP options, or may be chosen implicitly\&. If none of the three options -+is given the rules are: first, if the array \fB$tcp_spam_list\fP is set, this -+is taken as the list of sessions, otherwise all sessions are taken\&. -+Second, any sessions given in the array \fB$tcp_no_spam_list\fP are removed -+from the list of sessions\&. -+.PP -+Normally, any sessions added by the `\fB\-a\fP\&' flag or when all sessions are -+chosen implicitly are spammed in alphabetic order; sessions given by the -+\fB$tcp_spam_list\fP array or on the command line are spammed in the order -+given\&. The \fB\-r\fP flag reverses the order however it was arrived it\&. -+.PP -+The \fB\-v\fP flag specifies that a \fB$TCP_PROMPT\fP will be output before each -+session\&. This is output after any modification to TCP_SESS by the -+user\-defined \fBtcp_on_spam\fP function described below\&. (Obviously that -+function is able to generate its own output\&.) -+.PP -+If the option \fB\-e\fP is present, the line given as \fIcmd \&.\&.\&.\fP is executed -+using \fBeval\fP, otherwise it is executed without any further processing\&. -+.RE -+.TP -+\fBtcp_talk\fP -+This is a fairly simple\-minded attempt to force input to the line editor to -+go straight to the default TCP_SESSION\&. -+.RS -+.PP -+An escape string, \fB$TCP_TALK_ESCAPE\fP, default `:\&', is used to allow -+access to normal shell operation\&. If it is on its own at the start of the -+line, or followed only by whitespace, the line editor returns to normal -+operation\&. Otherwise, the string and any following whitespace are skipped -+and the remainder of the line executed as shell input without any change of -+the line editor\&'s operating mode\&. -+.PP -+The current implementation is somewhat deficient in terms of use of the -+command history\&. For this reason, many users will prefer to use some form -+of alternative approach for sending data easily to the current session\&. -+One simple approach is to alias some special character (such as `\fB%\fP\&') to -+`\fBtcp_command \-\fP\fB\-\fP\&'\&. -+.RE -+.TP -+\fBtcp_wait\fP -+The sole argument is an integer or floating point number which gives the -+seconds to delay\&. The shell will do nothing for that period except wait -+for input on all TCP sessions by calling \fBtcp_read \-a\fP\&. This is similar -+to the interactive behaviour at the command prompt when zle handlers are -+installed\&. -+.PP -+.SS "`One\-shot\&' file transfer" -+.PD 0 -+.TP -+.PD 0 -+\fBtcp_point\fP \fIport\fP -+.TP -+.PD -+\fBtcp_shoot\fP \fIhost\fP \fIport\fP -+This pair of functions provide a simple way to transfer a file between -+two hosts within the shell\&. Note, however, that bulk data transfer is -+currently done using \fBcat\fP\&. \fBtcp_point\fP reads any data arriving at -+\fIport\fP and sends it to standard output; \fBtcp_shoot\fP connects to -+\fIport\fP on \fIhost\fP and sends its standard input\&. Any unused \fIport\fP -+may be used; the standard mechanism for picking a port is to think of a -+random four\-digit number above 1024 until one works\&. -+.RS -+.PP -+To transfer a file from host \fBwoodcock\fP to host \fBspringes\fP, on -+\fBspringes\fP: -+.PP -+.RS -+.nf -+\fBtcp_point 8091 >output_file\fP -+.fi -+.RE -+.PP -+and on \fBwoodcock\fP: -+.PP -+.RS -+.nf -+\fBtcp_shoot springes 8091
}@t{T}@var{} (note the presence of the literal -+character @t{T}). The first word (the regular recurrence) may be -+something other than a proper date/time to indicate that the event -+is additional to the normal sequence; a convention that retains -+the formatting appearance is @t{XXXXXXXXTXXXXXX}. -+ -+@noindent -+Furthermore, it is useful to record the next regular recurrence -+(as then the displayed date may be for a rescheduled event so cannot -+be used for calculating the regular sequence). This is specified by -+@t{RECURRENCE} and a time or date in the same format. @t{calendar_add} -+adds such an indication when it encounters a recurring event that does not -+include one, based on the headline date/time. -+ -+@noindent -+If @t{calendar_add} is used to update occurrences the @t{UID} keyword -+described there should be present in both the existing entry and the added -+occurrence in order to identify recurring event sequences. -+ -+@noindent -+For example, -+ -+@noindent -+@example -+Thu May 6, 2010 11:00 Informal chat RPT 1 week -+ # RECURRENCE 20100506T110000 -+ # OCCURRENCE 20100513T110000 20100513T120000 -+ # OCCURRENCE 20100520T110000 CANCELLED -+@end example -+ -+@noindent -+The event that occurs at 11:00 on 13th May 2010 is rescheduled an hour -+later. The event that occurs a week later is cancelled. The occurrences -+are given on a continuation line starting with a @t{#} character so will -+not usually be displayed as part of the event. As elsewhere, no account of -+time zones is taken with the times. After the next event occurs the headline -+date/time will be `@t{Thu May 13, 2010 12:00}' while the @t{RECURRENCE} -+date/time will be `@t{20100513T110000}' (note that cancelled and -+moved events are not taken account of in the @t{RECURRENCE}, which -+records what the next regular recurrence is, but they are accounted for in -+the headline date/time). -+ -+@noindent -+It is safe to run @t{calendar -s} to reschedule an existing event -+(if the calendar file has changed, for example), and also to have it -+running in multiples instances of the shell since the calendar file -+is locked when in use. -+ -+@noindent -+By default, expired events are moved to the "done" file; see the @t{-d} -+option. Use @t{-D} to prevent this. -+ -+@item @t{-S} @var{showprog} -+Explicitly specify a programme to be used for showing events instead -+of the value of the @t{show-prog} style or the default @t{calendar_show}. -+ -+@item @t{-v} -+Verbose: show more information about stages of processing. This -+is useful for confirming that the function has successfully parsed -+the dates in the calendar file. -+ -+@end table -+ -+@findex calendar_add -+@item @t{calendar_add} [ @t{-BL} ] @var{event ...} -+Adds a single event to the calendar in the appropriate location. -+The event can contain multiple lines, as described in -+@ref{Calendar File and Date Formats}. -+Using this function ensures that the calendar file is sorted in date -+and time order. It also makes special arrangements for locking -+the file while it is altered. The old calendar is left in a file -+with the suffix @t{.old}. -+ -+@noindent -+The option @t{-B} indicates that backing up the calendar file will be -+handled by the caller and should not be performed by @t{calendar_add}. The -+option @t{-L} indicates that @t{calendar_add} does not need to lock the -+calendar file as it is already locked. These options will not usually be -+needed by users. -+ -+@noindent -+If the style @t{reformat-date} is true, the date and time of the -+new entry will be rewritten into the standard date format: see -+the descriptions of this style and the style @t{date-format}. -+ -+@noindent -+The function can use a unique identifier stored with each event to ensure -+that updates to existing events are treated correctly. The entry -+should contain the word @t{UID}, followed by whitespace, followed by -+a word consisting entirely of hexadecimal digits of arbitrary length -+(all digits are significant, including leading zeroes). As the UID -+is not directly useful to the user, it is convenient to hide it on -+an indented continuation line starting with a @t{#}, for example: -+ -+@noindent -+@example -+Aug 31, 2007 09:30 Celebrate the end of the holidays -+ # UID 045B78A0 -+@end example -+ -+@noindent -+The second line will not be shown by the @t{calendar} function. -+ -+@noindent -+It is possible to specify the @t{RPT} keyword followed by @t{CANCELLED} -+instead of a relative time. This causes any matched event or series -+of events to be cancelled (the original event does not have to be marked -+as recurring in order to be cancelled by this method). A @t{UID} is -+required in order to match an existing event in the calendar. -+ -+@noindent -+@t{calendar_add} will attempt to manage recurrences and occurrences of -+repeating events as described for event scheduling by @t{calendar -s} -+above. To reschedule or cancel a single event @t{calendar_add} should be -+called with an entry that includes the correct @t{UID} but does @emph{not} -+include the @t{RPT} keyword as this is taken to mean the entry applies to a -+series of repeating events and hence replaces all existing information. -+Each rescheduled or cancelled occurrence must have an @t{OCCURRENCE} -+keyword in the entry passed to @t{calendar_add} which will be merged into -+the calendar file. Any existing reference to the occurrence is replaced. -+An occurrence that does not refer to a valid existing event is added as a -+one-off occurrence to the same calendar entry. -+ -+@findex calendar_edit -+@item @t{calendar_edit} -+This calls the user's editor to edit the calendar file. If -+there are arguments, they are taken as the editor to use (the file name -+is appended to the commands); otherwise, the editor is given by the -+variable @t{VISUAL}, if set, else the variable @t{EDITOR}. -+ -+@noindent -+If the calendar scheduler was running, then after editing the file -+@t{calendar -s} is called to update it. -+ -+@noindent -+This function locks out the calendar system during the edit. -+Hence it should be used to edit the calendar file if there is any -+possibility of a calendar event occurring meanwhile. Note this -+can lead to another shell with calendar functions enabled hanging waiting -+for a lock, so it is necessary to quit the editor as soon as possible. -+ -+@findex calendar_parse -+@item @t{calendar_parse} @var{calendar-entry} -+This is the internal function that analyses the parts of a calendar -+entry, which is passed as the only argument. The function returns -+status 1 if the argument could not be parsed as a calendar entry -+and status 2 if the wrong number of arguments were passed; it also sets the -+parameter @t{reply} to an empty associative array. Otherwise, -+it returns status 0 and sets elements of the associative -+array @t{reply} as follows: -+@table @asis -+@item time -+The time as a string of digits in the same units as -+@t{$EPOCHSECONDS} -+@item schedtime -+The regularly scheduled time. This may differ from -+the actual event time @t{time} if this is a recurring event and the next -+occurrence has been rescheduled. Then @t{time} gives the actual time -+and @t{schedtime} the time of the regular recurrence before modification. -+@item text1 -+The text from the line not including the date and time of the -+event, but including any @t{WARN} or @t{RPT} keywords and values. -+@item warntime -+Any warning time given by the @t{WARN} keyword as a string -+of digits containing the time at which to warn in the same units as -+@t{$EPOCHSECONDS}. (Note this is an absolute time, not the relative time -+passed down.) Not set no @t{WARN} keyword and value were -+matched. -+@item warnstr -+The raw string matched after the @t{WARN} keyword, else unset. -+@item rpttime -+Any recurrence time given by the @t{RPT} keyword as a string -+of digits containing the time of the recurrence in the same units -+as @t{$EPOCHSECONDS}. (Note this is an absolute time.) Not set if -+no @t{RPT} keyword and value were matched. -+@item schedrpttime -+The next regularly scheduled occurrence of a recurring -+event before modification. This may differ from @t{rpttime}, which is the -+actual time of the event that may have been rescheduled from the regular -+time. -+@item rptstr -+The raw string matched after the @t{RPT} keyword, else unset. -+@item text2 -+The text from the line after removal of the date and any -+keywords and values. -+ -+@end table -+) -+@findex calendar_showdate -+@item @t{calendar_showdate} [ @t{-r} ] [ @t{-f} @var{fmt} ] @var{date-spec ...} -+The given @var{date-spec} is interpreted and the corresponding date and -+time printed. If the initial @var{date-spec} begins with a @t{+} or -+@t{-} it is treated as relative to the current time; @var{date-spec}s after -+the first are treated as relative to the date calculated so far and -+a leading @t{+} is optional in that case. This allows one to -+use the system as a date calculator. For example, @t{calendar_showdate '+1 -+month, 1st Friday'} shows the date of the first Friday of next month. -+ -+@noindent -+With the option @t{-r} nothing is printed but the value of the date and -+time in seconds since the epoch is stored in the parameter @t{REPLY}. -+ -+@noindent -+With the option @t{-f} @var{fmt} the given date/time conversion format -+is passed to @t{strftime}; see notes on the @t{date-format} style below. -+ -+@noindent -+In order to avoid ambiguity with negative relative date specifications, -+options must occur in separate words; in other words, @t{-r} and @t{-f} -+should not be combined in the same word. -+ -+@findex calendar_sort -+@item @t{calendar_sort} -+Sorts the calendar file into date and time order. The old calendar is -+left in a file with the suffix @t{.old}. -+ -+@end table -+ -+@noindent -+ -+@subsection Glob qualifiers -+@noindent -+@findex age -+ -+@noindent -+The function @t{age} can be autoloaded and use separately from -+the calendar system, although it uses the function @t{calendar_scandate} -+for date formatting. It requires the @t{zsh/stat} builtin, but uses -+only the builtin @t{zstat}. -+ -+@noindent -+@t{age} selects files having a given modification time for use -+as a glob qualifier. The format of the date is the same as that -+understood by the calendar system, described in -+@ref{Calendar File and Date Formats}. -+ -+@noindent -+The function can take one or two arguments, which can be supplied either -+directly as command or arguments, or separately as shell parameters. -+ -+@noindent -+@example -+print *(e:age 2006/10/04 2006/10/09:) -+@end example -+ -+@noindent -+The example above matches all files modified between the start of those -+dates. The second argument may alternatively be a relative time -+introduced by a @t{+}: -+ -+@noindent -+@example -+print *(e:age 2006/10/04 +5d:) -+@end example -+ -+@noindent -+The example above is equivalent to the previous example. -+ -+@noindent -+In addition to the special use of days of the week, @t{today} and -+@t{yesterday}, times with no date may be specified; these apply to today. -+Obviously such uses become problematic around midnight. -+ -+@noindent -+@example -+print *(e-age 12:00 13:30-) -+@end example -+ -+@noindent -+The example above shows files modified between 12:00 and 13:00 today. -+ -+@noindent -+@example -+print *(e:age 2006/10/04:) -+@end example -+ -+@noindent -+The example above matches all files modified on that date. If the second -+argument is omitted it is taken to be exactly 24 hours after the first -+argument (even if the first argument contains a time). -+ -+@noindent -+@example -+print *(e-age 2006/10/04:10:15 2006/10/04:10:45-) -+@end example -+ -+@noindent -+The example above supplies times. Note that whitespace within the time and -+date specification must be quoted to ensure @t{age} receives the correct -+arguments, hence the use of the additional colon to separate the date and -+time. -+ -+@noindent -+@example -+AGEREF1=2006/10/04:10:15 -+AGEREF2=2006/10/04:10:45 -+print *(+age) -+@end example -+ -+@noindent -+This shows the same example before using another form of argument -+passing. The dates and times in the parameters @t{AGEREF1} and @t{AGEREF2} -+stay in effect until unset, but will be overridden if any argument is -+passed as an explicit argument to age. Any explicit argument -+causes both parameters to be ignored. -+ -+@noindent -+@node Calendar Styles, Calendar Utility Functions, Calendar System User Functions, Calendar Function System -+ -+@section Styles -+@noindent -+ -+@noindent -+The zsh style mechanism using the @t{zstyle} command is describe in -+@ref{The zsh/zutil Module}. This is the same mechanism -+used in the completion system. -+ -+@noindent -+The styles below are all examined in the context -+@t{:datetime:}@var{function}@t{:}, for example @t{:datetime:calendar:}. -+ -+@noindent -+@table @asis -+@kindex calendar-file -+@item @t{calendar-file} -+The location of the main calendar. The default is @t{~/calendar}. -+ -+@kindex date-format -+@item @t{date-format} -+A @t{strftime} format string (see man page strftime(3)) with the zsh -+extensions providing various numbers with no leading zero or space -+if the number is a single digit as described for the -+@t{%D@{}@var{string}@t{@}} prompt format in -+@ref{Prompt Expansion}. -+ -+@noindent -+This is used for outputting dates in @t{calendar}, both to support -+the @t{-v} option and when adding recurring events back to the calendar -+file, and in @t{calendar_showdate} as the final output format. -+ -+@noindent -+If the style is not set, the default used is similar the standard system -+format as output by the @t{date} command (also known as `ctime format'): -+`@t{%a %b %d %H:%M:%S %Z %Y}'. -+ -+@kindex done-file -+@item @t{done-file} -+The location of the file to which events which have passed are appended. -+The default is the calendar file location with the suffix @t{.done}. -+The style may be set to an empty string in which case a "done" file -+will not be maintained. -+ -+@kindex reformat-date -+@item @t{reformat-date} -+Boolean, used by @t{calendar_add}. If it is true, the date and time -+of new entries added to the calendar will be reformatted to the format -+given by the style @t{date-format} or its default. Only the date and -+time of the event itself is reformatted; any subsidiary dates and times -+such as those associated with repeat and warning times are left alone. -+ -+@kindex show-prog -+@item @t{show-prog} -+The programme run by @t{calendar} for showing events. It will -+be passed the start time and stop time of the events requested in seconds -+since the epoch followed by the event text. Note that @t{calendar -s} uses -+a start time and stop time equal to one another to indicate alerts -+for specific events. -+ -+@noindent -+The default is the function @t{calendar_show}. -+ -+@kindex warn-time -+@item @t{warn-time} -+The time before an event at which a warning will be displayed, if the -+first line of the event does not include the text @t{EVENT} @var{reltime}. -+The default is 5 minutes. -+ -+@end table -+ -+@noindent -+@node Calendar Utility Functions, Calendar Bugs, Calendar Styles, Calendar Function System -+ -+@section Utility functions -+@noindent -+ -+@noindent -+@table @asis -+@findex calendar_lockfiles -+@item @t{calendar_lockfiles} -+Attempt to lock the files given in the argument. To prevent -+problems with network file locking this is done in an ad hoc fashion -+by attempting to create a symbolic link to the file with the name -+@var{file}@t{.lockfile}. No other system level functions are used -+for locking, i.e. the file can be accessed and modified by any -+utility that does not use this mechanism. In particular, the user is not -+prevented from editing the calendar file at the same time unless -+@t{calendar_edit} is used. -+ -+@noindent -+Three attempts are made to lock the file before giving up. If the module -+@t{zsh/zselect} is available, the times of the attempts are jittered so that -+multiple instances of the calling function are unlikely to retry at the -+same time. -+ -+@noindent -+The files locked are appended to the array @t{lockfiles}, which should -+be local to the caller. -+ -+@noindent -+If all files were successfully locked, status zero is returned, else status one. -+ -+@noindent -+This function may be used as a general file locking function, although -+this will only work if only this mechanism is used to lock files. -+ -+@findex calendar_read -+@item @t{calendar_read} -+This is a backend used by various other functions to parse the -+calendar file, which is passed as the only argument. The array -+@t{calendar_entries} is set to the list of events in the file; no -+pruning is done except that ampersands are removed from the start of -+the line. Each entry may contain multiple lines. -+ -+@findex calendar_scandate -+@item @t{calendar_scandate} -+This is a generic function to parse dates and times that may be -+used separately from the calendar system. The argument is a date -+or time specification as described in -+@ref{Calendar File and Date Formats}. The parameter @t{REPLY} -+is set to the number of seconds since the epoch corresponding to that date -+or time. By default, the date and time may occur anywhere within the given -+argument. -+ -+@noindent -+Returns status zero if the date and time were successfully parsed, -+else one. -+ -+@noindent -+Options: -+@table @asis -+@item @t{-a} -+The date and time are anchored to the start of the argument; they -+will not be matched if there is preceding text. -+ -+@item @t{-A} -+The date and time are anchored to both the start and end of the argument; -+they will not be matched if the is any other text in the argument. -+ -+@item @t{-d} -+Enable additional debugging output. -+ -+@item @t{-m} -+Minus. When @t{-R} @var{anchor_time} is also given the relative time is -+calculated backwards from @var{anchor_time}. -+ -+@item @t{-r} -+The argument passed is to be parsed as a relative time. -+ -+@item @t{-R} @var{anchor_time} -+The argument passed is to be parsed as a relative time. The time is -+relative to @var{anchor_time}, a time in seconds since the epoch, -+and the returned value is the absolute time corresponding to advancing -+@var{anchor_time} by the relative time given. -+This allows lengths of months to be correctly taken into account. If -+the final day does not exist in the given month, the last day of the -+final month is given. For example, if the anchor time is during 31st -+January 2007 and the relative time is 1 month, the final time is the -+same time of day during 28th February 2007. -+ -+@item @t{-s} -+In addition to setting @t{REPLY}, set @t{REPLY2} to the remainder of -+the argument after the date and time have been stripped. This is -+empty if the option @t{-A} was given. -+ -+@item @t{-t} -+Allow a time with no date specification. The date is assumed to be -+today. The behaviour is unspecified if the iron tongue of midnight -+is tolling twelve. -+ -+@end table -+ -+@findex calendar_show -+@item @t{calendar_show} -+The function used by default to display events. It accepts a start time -+and end time for events, both in epoch seconds, and an event description. -+ -+@noindent -+The event is always printed to standard output. If the command line editor -+is active (which will usually be the case) the command line will be -+redisplayed after the output. -+ -+@noindent -+If the parameter @t{DISPLAY} is set and the start and end times are -+the same (indicating a scheduled event), the function uses the -+command @t{xmessage} to display a window with the event details. -+ -+@end table -+ -+@noindent -+@node Calendar Bugs, , Calendar Utility Functions, Calendar Function System -+ -+@section Bugs -+@noindent -+ -+@noindent -+As the system is based entirely on shell functions (with a little support -+from the @t{zsh/datetime} module) the mechanisms used are not as robust as -+those provided by a dedicated calendar utility. Consequently the user -+should not rely on the shell for vital alerts. -+ -+@noindent -+There is no @t{calendar_delete} function. -+ -+@noindent -+There is no localization support for dates and times, nor any support -+for the use of time zones. -+ -+@noindent -+Relative periods of months and years do not take into account the variable -+number of days. -+ -+@noindent -+The @t{calendar_show} function is currently hardwired to use @t{xmessage} -+for displaying alerts on X Window System displays. This should be -+configurable and ideally integrate better with the desktop. -+ -+@noindent -+@t{calendar_lockfiles} hangs the shell while waiting for a lock on a file. -+If called from a scheduled task, it should instead reschedule the event -+that caused it. -+@c (avoiding a yodl bug) -+@c Yodl file: Zsh/tcpsys.yo -+@node TCP Function System, Zftp Function System, Calendar Function System, Top -+ -+@chapter TCP Function System -+@noindent -+@cindex TCP function system -+@cindex ztcp, function system based on -+ -+@section Description -+@noindent -+ -+@noindent -+A module @t{zsh/net/tcp} is provided to provide network I/O over -+TCP/IP from within the shell; see its description in -+@ref{Zsh Modules} -+. This manual page describes a function suite based on the module. -+If the module is installed, the functions are usually installed at the -+same time, in which case they will be available for -+autoloading in the default function search path. In addition to the -+@t{zsh/net/tcp} module, the @t{zsh/zselect} module is used to implement -+timeouts on read operations. For troubleshooting tips, consult the -+corresponding advice for the @t{zftp} functions described in -+@ref{Zftp Function System} -+. -+ -+@noindent -+There are functions corresponding to the basic I/O operations open, close, -+read and send, named @t{tcp_open} etc., as well as a function -+@t{tcp_expect} for pattern match analysis of data read as input. The -+system makes it easy to receive data from and send data to multiple named -+sessions at once. In addition, it can be linked with the shell's line -+editor in such a way that input data is automatically shown at the -+terminal. Other facilities available including logging, filtering and -+configurable output prompts. -+ -+@noindent -+To use the system where it is available, it should be enough to -+`@t{autoload -U tcp_open}' and run @t{tcp_open} as documented below to -+start a session. The @t{tcp_open} function will autoload the remaining -+functions. -+ -+@noindent -+@menu -+* TCP Functions:: -+* TCP Parameters:: -+* TCP Examples:: -+* TCP Bugs:: -+@end menu -+ -+@noindent -+@node TCP Functions, TCP Parameters, , TCP Function System -+ -+@section TCP User Functions -+@noindent -+ -+@noindent -+ -+@subsection Basic I/O -+@noindent -+ -+@noindent -+@table @asis -+@findex tcp_open -+@item @t{tcp_open [-qz]} @var{host port} @t{[} @var{sess} @t{]} -+@itemx @t{tcp_open [-qz] [ -s} @var{sess} @t{| -l} @var{sess}@t{,... ] ... } -+@itemx @t{tcp_open [-qz] [-a} @var{fd} @t{| -f} @var{fd} @t{] [} @var{sess} @t{]} -+Open a new session. In the first and simplest form, open a TCP connection -+to host @var{host} at port @var{port}; numeric and symbolic forms are -+understood for both. -+ -+@noindent -+If @var{sess} is given, this becomes the name of the session which can be -+used to refer to multiple different TCP connections. If @var{sess} is -+not given, the function will invent a numeric name value (note this is -+@emph{not} the same as the file descriptor to which the session is attached). -+It is recommended that session names not include `funny' characters, where -+funny characters are not well-defined but certainly do not include -+alphanumerics or underscores, and certainly do include whitespace. -+ -+@noindent -+In the second case, one or more sessions to be opened are given by name. -+A single session name is given after @t{-s} and a comma-separated list -+after @t{-l}; both options may be repeated as many times as necessary. -+A failure to open any session causes @t{tcp_open} to abort. -+The host and port are read from the file @t{.ztcp_sessions} in the same -+directory as the user's zsh initialisation files, i.e. usually the home -+directory, but @t{$ZDOTDIR} if that is set. The file consists of lines -+each giving a session name and the corresponding host and port, in that -+order (note the session name comes first, not last), separated by -+whitespace. -+ -+@noindent -+The third form allows passive and fake TCP connections. If the option -+@t{-a} is used, its argument is a file descriptor open for listening for -+connections. No function front-end is provided to open such a file -+descriptor, but a call to `@t{ztcp -l} @var{port}' will create one with the -+file descriptor stored in the parameter @t{$REPLY}. The listening port can -+be closed with `@t{ztcp -c} @var{fd}'. A call to `@t{tcp_open -a} @var{fd}' -+will block until a remote TCP connection is made to @var{port} on the local -+machine. At this point, a session is created in the usual way and is -+largely indistinguishable from an active connection created with one of the -+first two forms. -+ -+@noindent -+If the option @t{-f} is used, its argument is a file descriptor which is -+used directly as if it were a TCP session. How well the remainder of the -+TCP function system copes with this depends on what actually underlies this -+file descriptor. A regular file is likely to be unusable; a FIFO (pipe) of -+some sort will work better, but note that it is not a good idea for two -+different sessions to attempt to read from the same FIFO at once. -+ -+@noindent -+If the option @t{-q} is given with any of the three forms, @t{tcp_open} -+will not print informational messages, although it will in any case exit -+with an appropriate status. -+ -+@noindent -+If the line editor (zle) is in use, which is typically the case if the -+shell is interactive, @t{tcp_open} installs a handler inside @t{zle} which -+will check for new data at the same time as it checks for keyboard input. -+This is convenient as the shell consumes no CPU time while waiting; the -+test is performed by the operating system. Giving the option @t{-z} to -+any of the forms of @t{tcp_open} prevents the handler from being -+installed, so data must be read explicitly. Note, however, this is not -+necessary for executing complete sets of send and read commands from a -+function, as zle is not active at this point. Generally speaking, the -+handler is only active when the shell is waiting for input at a command -+prompt or in the @t{vared} builtin. The option has no effect if zle is not -+active; `@t{[[ -o zle]]}' will test for this. -+ -+@noindent -+The first session to be opened becomes the current session and subsequent -+calls to @t{tcp_open} do not change it. The current session is stored -+in the parameter @t{$TCP_SESS}; see below for more detail about the -+parameters used by the system. -+ -+@noindent -+The function @t{tcp_on_open}, if defined, is called when a session -+is opened. See the description below. -+ -+@findex tcp_close -+@item @t{tcp_close [-qn] [ -a | -l} @var{sess}@t{,... |} @var{sess} @t{... ]} -+Close the named sessions, or the current session if none is given, -+or all open sessions if @t{-a} is given. The options @t{-l} and @t{-s} are -+both handled for consistency with @t{tcp_open}, although the latter is -+redundant. -+ -+@noindent -+If the session being closed is the current one, @t{$TCP_SESS} is unset, -+leaving no current session, even if there are other sessions still open. -+ -+@noindent -+If the session was opened with @t{tcp_open -f}, the file descriptor is -+closed so long as it is in the range 0 to 9 accessible directly from the -+command line. If the option @t{-n} is given, no attempt will be made to -+close file descriptors in this case. The @t{-n} option is not used for -+genuine @t{ztcp} session; the file descriptors are always closed with the -+session. -+ -+@noindent -+If the option @t{-q} is given, no informational messages will be printed. -+ -+@findex tcp_read -+@item @t{tcp_read [-bdq] [ -t} @var{TO} @t{] [ -T} @var{TO} @t{]} -+@itemx @t{[ -a | -u} @var{fd} @t{... | -l} @var{sess}@t{,... | -s} @var{sess} @t{...]} -+Perform a read operation on the current session, or on a list of -+sessions if any are given with @t{-u}, @t{-l} or @t{-s}, or all open -+sessions if the option @t{-a} is given. Any of the @t{-u}, @t{-l} or -+@t{-s} options may be repeated or mixed together. The @t{-u} option -+specifies a file descriptor directly (only those managed by this system -+are useful), the other two specify sessions as described for -+@t{tcp_open} above. -+ -+@noindent -+The function checks for new data available on all the sessions listed. -+Unless the @t{-b} option is given, it will not block waiting for new data. -+Any one line of data from any of the available sessions will be read, -+stored in the parameter @t{$TCP_LINE}, and displayed to standard output -+unless @t{$TCP_SILENT} contains a non-empty string. When printed to -+standard output the string @t{$TCP_PROMPT} will be shown at the start of -+the line; the default form for this includes the name of the session being -+read. See below for more information on these parameters. In this mode, -+@t{tcp_read} can be called repeatedly until it returns status 2 which -+indicates all pending input from all specified sessions has been handled. -+ -+@noindent -+With the option @t{-b}, equivalent to an infinite timeout, the function -+will block until a line is available to read from one of the specified -+sessions. However, only a single line is returned. -+ -+@noindent -+The option @t{-d} indicates that all pending input should be drained. In -+this case @t{tcp_read} may process multiple lines in the manner given -+above; only the last is stored in @t{$TCP_LINE}, but the complete set is -+stored in the array @t{$tcp_lines}. This is cleared at the start of each -+call to @t{tcp_read}. -+ -+@noindent -+The options @t{-t} and @t{-T} specify a timeout in seconds, which may be a -+floating point number for increased accuracy. With @t{-t} the timeout is -+applied before each line read. With @t{-T}, the timeout applies to the -+overall operation, possibly including multiple read operations if the -+option @t{-d} is present; without this option, there is no distinction -+between @t{-t} and @t{-T}. -+ -+@noindent -+The function does not print informational messages, but if the option -+@t{-q} is given, no error message is printed for a non-existent session. -+ -+@noindent -+A return status of 2 indicates a timeout or no data to read. Any other -+non-zero return status indicates some error condition. -+ -+@noindent -+See @t{tcp_log} for how to control where data is sent by @t{tcp_read}. -+ -+@findex tcp_send -+@item @t{tcp_send [-cnq] [ -s} @var{sess} @t{| -l} @var{sess}@t{,... ]} @var{data} @t{...} -+@itemx @t{tcp_send [-cnq] -a} @var{data} @t{...} -+Send the supplied data strings to all the specified sessions in turn. The -+underlying operation differs little from a `@t{print -r}' to the session's -+file descriptor, although it attempts to prevent the shell from dying owing -+to a @t{SIGPIPE} caused by an attempt to write to a defunct session. -+ -+@noindent -+The option @t{-c} causes @t{tcp_send} to behave like @t{cat}. It reads -+lines from standard input until end of input and sends them in turn to the -+specified session(s) exactly as if they were given as @var{data} -+arguments to individual @t{tcp_send} commands. -+ -+@noindent -+The option @t{-n} prevents @t{tcp_send} from putting a newline at the end -+of the data strings. -+ -+@noindent -+The remaining options all behave as for @t{tcp_read}. -+ -+@noindent -+The data arguments are not further processed once they have been passed to -+@t{tcp_send}; they are simply passed down to @t{print -r}. -+ -+@noindent -+If the parameter @t{$TCP_OUTPUT} is a non-empty string and logging is -+enabled then the data sent to each session will be echoed to the log -+file(s) with @t{$TCP_OUTPUT} in front where appropriate, much -+in the manner of @t{$TCP_PROMPT}. -+ -+@end table -+ -+@noindent -+ -+@subsection Session Management -+@noindent -+ -+@noindent -+@table @asis -+@findex tcp_alias -+@item @t{tcp_alias [-q]} @var{alias}@t{=}@var{sess} @t{...} -+@itemx @t{tcp_alias [-q] [} @var{alias} @t{] ...} -+@itemx @t{tcp_alias -d [-q]} @var{alias} @t{...} -+This function is not particularly well tested. -+ -+@noindent -+The first form creates an alias for a session name; @var{alias} can then be -+used to refer to the existing session @var{sess}. As many aliases may be -+listed as required. -+ -+@noindent -+The second form lists any aliases specified, or all aliases if none. -+ -+@noindent -+The third form deletes all the aliases listed. The underlying sessions are -+not affected. -+ -+@noindent -+The option @t{-q} suppresses an inconsistently chosen subset of error -+messages. -+ -+@findex tcp_log -+@item @t{tcp_log [-asc] [ -n | -N ] [} @var{logfile} @t{]} -+With an argument @var{logfile}, all future input from @t{tcp_read} will be -+logged to the named file. Unless @t{-a} (append) is given, this file will -+first be truncated or created empty. With no arguments, show the current -+status of logging. -+ -+@noindent -+With the option @t{-s}, per-session logging is enabled. Input from -+@t{tcp_read} is output to the file @var{logfile}.@var{sess}. As the -+session is automatically discriminated by the filename, the contents are -+raw (no @t{$TCP_PROMPT}). The option @t{-a} applies as above. -+Per-session logging and logging of all data in one file are not mutually -+exclusive. -+ -+@noindent -+The option @t{-c} closes all logging, both complete and per-session logs. -+ -+@noindent -+The options @t{-n} and @t{-N} respectively turn off or restore output of -+data read by @t{tcp_read} to standard output; hence `@t{tcp_log -cn}' turns -+off all output by @t{tcp_read}. -+ -+@noindent -+The function is purely a convenient front end to setting the parameters -+@t{$TCP_LOG}, @t{$TCP_LOG_SESS}, @t{$TCP_SILENT}, which are described below. -+ -+@findex tcp_rename -+@item @t{tcp_rename} @var{old} @var{new} -+Rename session @var{old} to session @var{new}. The old name becomes invalid. -+ -+@findex tcp_sess -+@item @t{tcp_sess [} @var{sess} @t{[} @var{command} @t{... ] ]} -+With no arguments, list all the open sessions and associated file -+descriptors. The current session is marked with a star. For use in -+functions, direct access to the parameters @t{$tcp_by_name}, @t{$tcp_by_fd} -+and @t{$TCP_SESS} is probably more convenient; see below. -+ -+@noindent -+With a @var{sess} argument, set the current session to @var{sess}. -+This is equivalent to changing @t{$TCP_SESS} directly. -+ -+@noindent -+With additional arguments, temporarily set the current session while -+executing the string @t{command ...}. The first argument is re-evaluated -+so as to expand aliases etc., but the remaining arguments are passed -+through as the appear to @t{tcp_sess}. The original session is restored -+when @t{tcp_sess} exits. -+ -+@end table -+ -+@noindent -+ -+@subsection Advanced I/O -+@noindent -+ -+@noindent -+@table @asis -+@findex tcp_command -+@item @t{tcp_command} @var{send-options} @t{...} @var{send-arguments} @t{...} -+This is a convenient front-end to @t{tcp_send}. All arguments are passed -+to @t{tcp_send}, then the function pauses waiting for data. While data is -+arriving at least every @t{$TCP_TIMEOUT} (default 0.3) seconds, data is -+handled and printed out according to the current settings. Status 0 is -+always returned. -+ -+@noindent -+This is generally only useful for interactive use, to prevent the display -+becoming fragmented by output returned from the connection. Within a -+programme or function it is generally better to handle reading data by a -+more explicit method. -+ -+@findex tcp_expect -+@item @t{tcp_expect [ -q ] [ -p} @var{var} @t{] [ -t } @var{to} @t{| -T} @var{TO}@t{]} -+@itemx @t{ [ -a | -s} @var{sess} @t{... | -l} @var{sess}@t{,... ]} @var{pattern} ... -+Wait for input matching any of the given @var{pattern}s from any of the -+specified sessions. Input is ignored until an input line matches one of -+the given patterns; at this point status zero is returned, the matching -+line is stored in @t{$TCP_LINE}, and the full set of lines read during the -+call to @t{tcp_expect} is stored in the array @t{$tcp_expect_lines}. -+ -+@noindent -+Sessions are specified in the same way as @t{tcp_read}: the default is to -+use the current session, otherwise the sessions specified by @t{-a}, -+@t{-s}, or @t{-l} are used. -+ -+@noindent -+Each @var{pattern} is a standard zsh extended-globbing pattern; note that it -+needs to be quoted to avoid it being expanded immediately by filename -+generation. It must match the full line, so to match a substring there -+must be a `@t{*}' at the start and end. The line matched against includes -+the @t{$TCP_PROMPT} added by @t{tcp_read}. It is possible to include the -+globbing flags `@t{#b}' or `@t{#m}' in the patterns to make backreferences -+available in the parameters @t{$MATCH}, @t{$match}, etc., as described in -+the base zsh documentation on pattern matching. -+ -+@noindent -+Unlike @t{tcp_read}, the default behaviour of @t{tcp_expect} is to block -+indefinitely until the required input is found. This can be modified by -+specifying a timeout with @t{-t} or @t{-T}; these function as in -+@t{tcp_read}, specifying a per-read or overall timeout, respectively, in -+seconds, as an integer or floating-point number. As @t{tcp_read}, the -+function returns status 2 if a timeout occurs. -+ -+@noindent -+The function returns as soon as any one of the patterns given match. If -+the caller needs to know which of the patterns matched, the option @t{-p} -+@var{var} can be used; on return, @t{$var} is set to the number of the -+pattern using ordinary zsh indexing, i.e. the first is 1, and so on. Note -+the absence of a `@t{$}' in front of @var{var}. To avoid clashes, the -+parameter cannot begin with `@t{_expect}'. -+ -+@noindent -+The option @t{-q} is passed directly down to @t{tcp_read}. -+ -+@noindent -+As all input is done via @t{tcp_read}, all the usual rules about output of -+lines read apply. One exception is that the parameter @t{$tcp_lines} will -+only reflect the line actually matched by @t{tcp_expect}; use -+@t{$tcp_expect_lines} for the full set of lines read during the function -+call. -+ -+@findex tcp_proxy -+@item @t{tcp_proxy} -+This is a simple-minded function to accept a TCP connection and execute a -+command with I/O redirected to the connection. Extreme caution should be -+taken as there is no security whatsoever and this can leave your computer -+open to the world. Ideally, it should only be used behind a firewall. -+ -+@noindent -+The first argument is a TCP port on which the function will listen. -+ -+@noindent -+The remaining arguments give a command and its arguments to execute with -+standard input, standard output and standard error redirected to the -+file descriptor on which the TCP session has been accepted. -+If no command is given, a new zsh is started. This gives everyone on -+your network direct access to your account, which in many cases will be a -+bad thing. -+ -+@noindent -+The command is run in the background, so @t{tcp_proxy} can then accept new -+connections. It continues to accept new connections until interrupted. -+ -+@findex tcp_spam -+@item @t{tcp_spam [-ertv] [ -a | -s } @var{sess} @t{| -l} @var{sess}@t{,... ]} @var{cmd} @t{...} -+Execute `@var{cmd} @t{...}' for each session in turn. Note this executes -+the command and arguments; it does not send the command line as data -+unless the @t{-t} (transmit) option is given. -+ -+@noindent -+The sessions may be selected explicitly with the standard @t{-a}, @t{-s} or -+@t{-l} options, or may be chosen implicitly. If none of the three options -+is given the rules are: first, if the array @t{$tcp_spam_list} is set, this -+is taken as the list of sessions, otherwise all sessions are taken. -+Second, any sessions given in the array @t{$tcp_no_spam_list} are removed -+from the list of sessions. -+ -+@noindent -+Normally, any sessions added by the `@t{-a}' flag or when all sessions are -+chosen implicitly are spammed in alphabetic order; sessions given by the -+@t{$tcp_spam_list} array or on the command line are spammed in the order -+given. The @t{-r} flag reverses the order however it was arrived it. -+ -+@noindent -+The @t{-v} flag specifies that a @t{$TCP_PROMPT} will be output before each -+session. This is output after any modification to TCP_SESS by the -+user-defined @t{tcp_on_spam} function described below. (Obviously that -+function is able to generate its own output.) -+ -+@noindent -+If the option @t{-e} is present, the line given as @var{cmd ...} is executed -+using @t{eval}, otherwise it is executed without any further processing. -+ -+@findex tcp_talk -+@item @t{tcp_talk} -+This is a fairly simple-minded attempt to force input to the line editor to -+go straight to the default TCP_SESSION. -+ -+@noindent -+An escape string, @t{$TCP_TALK_ESCAPE}, default `:', is used to allow -+access to normal shell operation. If it is on its own at the start of the -+line, or followed only by whitespace, the line editor returns to normal -+operation. Otherwise, the string and any following whitespace are skipped -+and the remainder of the line executed as shell input without any change of -+the line editor's operating mode. -+ -+@noindent -+The current implementation is somewhat deficient in terms of use of the -+command history. For this reason, many users will prefer to use some form -+of alternative approach for sending data easily to the current session. -+One simple approach is to alias some special character (such as `@t{%}') to -+`@t{tcp_command -}@t{-}'. -+ -+@findex tcp_wait -+@item @t{tcp_wait} -+The sole argument is an integer or floating point number which gives the -+seconds to delay. The shell will do nothing for that period except wait -+for input on all TCP sessions by calling @t{tcp_read -a}. This is similar -+to the interactive behaviour at the command prompt when zle handlers are -+installed. -+ -+@end table -+ -+@noindent -+ -+@subsection `One-shot' file transfer -+@noindent -+@table @asis -+@item @t{tcp_point} @var{port} -+@itemx @t{tcp_shoot} @var{host} @var{port} -+This pair of functions provide a simple way to transfer a file between -+two hosts within the shell. Note, however, that bulk data transfer is -+currently done using @t{cat}. @t{tcp_point} reads any data arriving at -+@var{port} and sends it to standard output; @t{tcp_shoot} connects to -+@var{port} on @var{host} and sends its standard input. Any unused @var{port} -+may be used; the standard mechanism for picking a port is to think of a -+random four-digit number above 1024 until one works. -+ -+@noindent -+To transfer a file from host @t{woodcock} to host @t{springes}, on -+@t{springes}: -+ -+@noindent -+@example -+tcp_point 8091 >output_file -+@end example -+ -+@noindent -+and on @t{woodcock}: -+ -+@noindent -+@example -+tcp_shoot springes 8091 zsh.report -+@end example -+ -+@noindent -+You should check the @t{zsh.report} file for any sensitive information -+such as passwords and delete them by hand before sending the script to the -+developers. Also, as the output can be voluminous, it's best to wait for -+the developers to ask for this information before sending it. -+ -+@noindent -+You can also use @t{reporter} to dump only a subset of the shell state. -+This is sometimes useful for creating startup files for the first time. -+Most of the output from reporter is far more detailed than usually is -+necessary for a startup file, but the @t{aliases}, @t{options}, and -+@t{zstyles} states may be useful because they include only changes from -+the defaults. The @t{bindings} state may be useful if you have created -+any of your own keymaps, because @t{reporter} arranges to dump the keymap -+creation commands as well as the bindings for every keymap. -+ -+@noindent -+As is usual with automated tools, if you create a startup file with -+@t{reporter}, you should edit the results to remove unnecessary commands. -+Note that if you're using the new completion system, you should @emph{not} -+dump the @t{functions} state to your startup files with @t{reporter}; use -+the @t{compdump} function instead (see -+@ref{Completion System}). -+ -+@noindent -+@table @asis -+@item @t{reporter} [ @var{state} ... ] -+@findex reporter -+Print to standard output the indicated subset of the current shell state. -+The @var{state} arguments may be one or more of: -+ -+@noindent -+@table @asis -+@item @t{all} -+Output everything listed below. -+@item @t{aliases} -+Output alias definitions. -+@item @t{bindings} -+Output ZLE key maps and bindings. -+@item @t{completion} -+Output old-style @t{compctl} commands. -+New completion is covered by @t{functions} and @t{zstyles}. -+@item @t{functions} -+Output autoloads and function definitions. -+@item @t{limits} -+Output @t{limit} commands. -+@item @t{options} -+Output @t{setopt} commands. -+@item @t{styles} -+Same as @t{zstyles}. -+@item @t{variables} -+Output shell parameter assignments, plus @t{export} -+commands for any environment variables. -+@item @t{zstyles} -+Output @t{zstyle} commands. -+@end table -+ -+@noindent -+If the @var{state} is omitted, @t{all} is assumed. -+ -+ -+@noindent -+With the exception of `@t{all}', every @var{state} can be abbreviated by -+any prefix, even a single letter; thus @t{a} is the same as @t{aliases}, -+@t{z} is the same as @t{zstyles}, etc. -+@end table -+ -+@noindent -+ -+@subsection Manipulating Hook Functions -+@noindent -+@cindex hook function utility -+ -+@noindent -+@table @asis -+@findex add-zsh-hook -+@item @t{add-zsh-hook} [-dD] @var{hook} @var{function} -+Several functions are special to the shell, as described in the section -+Special Functions, @ref{Functions}, -+in that they are automatic called at a specific point during shell execution. -+Each has an associated array consisting of names of functions to be -+called at the same point; these are so-called `hook functions'. -+The shell function @t{add-zsh-hook} provides a simple way of adding or -+removing functions from the array. -+ -+@noindent -+@var{hook} is one of @t{chpwd}, @t{periodic}, @t{precmd}, @t{preexec}, -+@t{zshaddhistory}, @t{zshexit}, or @t{zsh_directory_name}, -+the special functions in question. Note that @t{zsh_directory_name} -+is called in a different way from the other functions, but may -+still be manipulated as a hook. -+ -+@noindent -+@var{function} is name of an ordinary shell function. If no options -+are given this will be added to the array of functions to be executed -+in the given context. -+ -+@noindent -+If the option @t{-d} is given, the @var{function} is removed from -+the array of functions to be executed. -+ -+@noindent -+If the option @t{-D} is given, the @var{function} is treated as a pattern -+and any matching names of functions are removed from the array of -+functions to be executed. -+ -+@noindent -+The options @t{-U}, @t{-z} and @t{-k} are passed as arguments to -+@t{autoload} for @var{function}. For functions contributed with zsh, the -+options @t{-Uz} are appropriate. -+ -+@end table -+ -+@noindent -+@node Recent Directories, Version Control Information, Utilities, User Contributions -+@cindex recent directories, maintaining list of -+@cindex directories, maintaining list of recent -+@findex cdr -+@findex _cdr -+@findex chpwd_recent_add -+@findex chpwd_recent_dirs -+@findex chpwd_recent_filehandler -+ -+@section Remembering Recent Directories -+@noindent -+ -+@noindent -+The function @t{cdr} allows you to change the working directory to a -+previous working directory from a list maintained automatically. It is -+similar in concept to the directory stack controlled by the @t{pushd}, -+@t{popd} and @t{dirs} builtins, but is more configurable, and as it stores -+all entries in files it is maintained across sessions and (by default) -+between terminal emulators in the current session. (The @t{pushd} -+directory stack is not actually modified or used by @t{cdr} unless you -+configure it to do so as described in the configuration section below.) -+ -+@noindent -+ -+@subsection Installation -+@noindent -+ -+@noindent -+The system works by means of a hook function that is called every time the -+directory changes. To install the system, autoload the required functions -+and use the @t{add-zsh-hook} function described above: -+ -+@noindent -+@example -+autoload -Uz chpwd_recent_dirs cdr add-zsh-hook -+add-zsh-hook chpwd chpwd_recent_dirs -+@end example -+ -+@noindent -+Now every time you change directly interactively, no matter which -+command you use, the directory to which you change will be remembered -+in most-recent-first order. -+ -+@noindent -+ -+@subsection Use -+@noindent -+ -+@noindent -+All direct user interaction is via the @t{cdr} function. -+ -+@noindent -+The argument to cdr is a number @var{N} corresponding to the @var{N}th most -+recently changed-to directory. 1 is the immediately preceding directory; -+the current directory is remembered but is not offered as a destination. -+Note that if you have multiple windows open 1 may refer to a directory -+changed to in another window; you can avoid this by having per-terminal -+files for storing directory as described for the -+@t{recent-dirs-file} style below. -+ -+@noindent -+If you set the @t{recent-dirs-default} style described below @t{cdr} -+will behave the same as @t{cd} if given a non-numeric argument, or more -+than one argument. The recent directory list is updated just the same -+however you change directory. -+ -+@noindent -+If the argument is omitted, 1 is assumed. This is similar to @t{pushd}'s -+behaviour of swapping the two most recent directories on the stack. -+ -+@noindent -+Completion for the argument to @t{cdr} is available if compinit has been -+run; menu selection is recommended, using: -+ -+@noindent -+@example -+zstyle ':completion:*:*:cdr:*:*' menu selection -+@end example -+ -+@noindent -+to allow you to cycle through recent directories; the order is preserved, -+so the first choice is the most recent directory before the current one. -+The verbose style is also recommended to ensure the directory is shown; this -+style is on by default so no action is required unless you have changed it. -+ -+@noindent -+ -+@subsection Options -+@noindent -+ -+@noindent -+The behaviour of @t{cdr} may be modified by the following options. -+ -+@noindent -+@table @asis -+@item @t{-l} -+lists the numbers and the corresponding directories in -+abbreviated form (i.e. with @t{~} substitution reapplied), one per line. -+The directories here are not quoted (this would only be an issue if a -+directory name contained a newline). This is used by the completion -+system. -+ -+@item @t{-r} -+sets the variable @t{reply} to the current set of directories. Nothing -+is printed and the directory is not changed. -+ -+@item @t{-e} -+allows you to edit the list of directories, one per line. The -+list can be edited to any extent you like; no sanity checking is -+performed. Completion is available. No quoting is necessary (except for -+newlines, where I have in any case no sympathy); directories are in -+unabbreviated from and contain an absolute path, i.e. they start with @t{/}. -+Usually the first entry should be left as the current directory. -+ -+@end table -+ -+@noindent -+ -+@subsection Configuration -+@noindent -+ -+@noindent -+Configuration is by means of the styles mechanism that should be familiar -+from completion; if not, see the description of the @t{zstyle} command in -+@ref{The zsh/zutil Module}. The context for setting styles -+should be @t{':chpwd:*'} in case the meaning of the context is extended in -+future, for example: -+ -+@noindent -+@example -+zstyle ':chpwd:*' recent-dirs-max 0 -+@end example -+ -+@noindent -+sets the value of the @t{recent-dirs-max} style to 0. In practice the -+style name is specific enough that a context of '*' should be fine. -+ -+@noindent -+An exception is @t{recent-dirs-insert}, which is used exclusively by the -+completion system and so has the usual completion system context -+(@t{':completion:*'} if nothing more specific is needed), though again -+@t{'*'} should be fine in practice. -+ -+@noindent -+@table @asis -+@item @t{recent-dirs-default} -+If true, and the command is expecting a recent directory index, and -+either there is more than one argument or the argument is not an -+integer, then fall through to "cd". This allows the lazy to use only -+one command for directory changing. Completion recognises this, too; -+see recent-dirs-insert for how to control completion when this option -+is in use. -+ -+@item @t{recent-dirs-file} -+The file where the list of directories is saved. The default -+is @t{$@{ZDOTDIR:-$HOME@}/.chpwd-recent-dirs}, i.e. this is in your -+home directory unless you have set the variable @t{ZDOTDIR} to point -+somewhere else. Directory names are saved in @t{$'}@var{...}@t{'} quoted -+form, so each line in the file can be supplied directly to the shell as an -+argument. -+ -+@noindent -+The value of this style may be an array. In this case, the first -+file in the list will always be used for saving directories while any -+other files are left untouched. When reading the recent directory -+list, if there are fewer than the maximum number of entries in the -+first file, the contents of later files in the array will be appended -+with duplicates removed from the list shown. The contents of the two -+files are not sorted together, i.e. all the entries in the first file -+are shown first. The special value @t{+} can appear in the list to -+indicate the default file should be read at that point. This allows -+effects like the following: -+ -+@noindent -+@example -+zstyle ':chpwd:*' recent-dirs-file \ -+~/.chpwd-recent-dirs-$@{TTY##*/@} + -+@end example -+ -+@noindent -+Recent directories are read from a file numbered according to -+the terminal. If there are insufficient entries the list -+is supplemented from the default file. -+ -+@noindent -+It is possible to use @t{zstyle -e} to make the directory configurable -+at run time: -+ -+@noindent -+@example -+zstyle -e ':chpwd:*' recent-dirs-file pick-recent-dirs-file -+pick-recent-dirs-file() @{ -+ if [[ $PWD = ~/text/writing(|/*) ]]; then -+ reply=(~/.chpwd-recent-dirs-writing) -+ else -+ reply=(+) -+ fi -+@} -+@end example -+ -+@noindent -+In this example, if the current directory is @t{~/text/writing} or a -+directory under it, then use a special file for saving recent -+directories, else use the default. -+ -+@item @t{recent-dirs-insert} -+Used by completion. If @t{recent-dirs-default} is true, then setting -+this to @t{true} causes the actual directory, rather than its index, to -+be inserted on the command line; this has the same effect as using -+the corresponding index, but makes the history clearer and the line -+easier to edit. With this setting, if part of an argument was -+already typed, normal directory completion rather than recent -+directory completion is done; this is because recent directory -+completion is expected to be done by cycling through entries menu -+fashion. -+ -+@noindent -+If the value of the style is @t{always}, then only recent directories will -+be completed; in that case, use the @t{cd} command when you want to -+complete other directories. -+ -+@noindent -+If the value is @t{fallback}, recent directories will be tried first, then -+normal directory completion is performed if recent directory completion -+failed to find a match. -+ -+@noindent -+Finally, if the value is @t{both} then both sets of completions are -+presented; the usual tag mechanism can be used to distinguish results, with -+recent directories tagged as @t{recent-dirs}. Note that the recent -+directories inserted are abbreviated with directory names where appropriate. -+ -+@item @t{recent-dirs-max} -+The maximum number of directories to save to the file. If -+this is zero or negative there is no maximum. The default is 20. -+Note this includes the current directory, which isn't offered, -+so the highest number of directories you will be offered -+is one less than the maximum. -+ -+@item @t{recent-dirs-prune} -+This style is an array determining what directories should (or should -+not) be added to the recent list. Elements of the array can include: -+ -+@noindent -+@table @asis -+@item @t{parent} -+Prune parents (more accurately, ancestors) from the recent list. -+If present, changing directly down by any number of directories -+causes the current directory to be overwritten. For example, -+changing from ~pws to ~pws/some/other/dir causes ~pws not to be -+left on the recent directory stack. This only applies to direct -+changes to descendant directories; earlier directories on the -+list are not pruned. For example, changing from ~pws/yet/another -+to ~pws/some/other/dir does not cause ~pws to be pruned. -+ -+@item @t{pattern:@var{pattern}} -+Gives a zsh pattern for directories that should not be -+added to the recent list (if not already there). This element -+can be repeated to add different patterns. For example, -+@t{'pattern:/tmp(|/*)'} stops @t{/tmp} or its descendants -+from being added. The @t{EXTENDED_GLOB} option is always turned on -+for these patterns. -+ -+@end table -+ -+@item @t{recent-dirs-pushd} -+If set to true, @t{cdr} will use @t{pushd} instead of @t{cd} to change the -+directory, so the directory is saved on the directory stack. As the -+directory stack is completely separate from the list of files saved -+by the mechanism used in this file there is no obvious reason to do -+this. -+ -+@end table -+ -+@noindent -+ -+@subsection Use with dynamic directory naming -+@noindent -+ -+@noindent -+It is possible to refer to recent directories using the dynamic directory -+name syntax by using the supplied function @t{zsh_directory_name_cdr} -+a hook: -+ -+@noindent -+@example -+autoload -Uz add-zsh-hook -+add-zsh-hook -Uz zsh_directory_name zsh_directory_name_cdr -+@end example -+ -+@noindent -+When this is done, @t{~[1]} will refer to the most recent -+directory other than $PWD, and so on. Completion after @t{~[}@var{...} -+also works. -+ -+@noindent -+ -+@subsection Details of directory handling -+@noindent -+ -+@noindent -+This section is for the curious or confused; most users will not -+need to know this information. -+ -+@noindent -+Recent directories are saved to a file immediately and hence are -+preserved across sessions. Note currently no file locking is applied: -+the list is updated immediately on interactive commands and nowhere else -+(unlike history), and it is assumed you are only going to change -+directory in one window at once. This is not safe on shared accounts, -+but in any case the system has limited utility when someone else is -+changing to a different set of directories behind your back. -+ -+@noindent -+To make this a little safer, only directory changes instituted from the -+command line, either directly or indirectly through shell function calls -+(but not through subshells, evals, traps, completion functions and the -+like) are saved. Shell functions should use @t{cd -q} or @t{pushd -q} to -+avoid side effects if the change to the directory is to be invisible at the -+command line. See the contents of the function @t{chpwd_recent_dirs} for -+more details. -+ -+@noindent -+@node Version Control Information, Prompt Themes, Recent Directories, User Contributions -+ -+@section Gathering information from version control systems -+@noindent -+@cindex version control utility -+ -+@noindent -+In a lot of cases, it is nice to automatically retrieve information from -+version control systems (VCSs), such as subversion, CVS or git, to be able -+to provide it to the user; possibly in the user's prompt. So that you can -+instantly tell which branch you are currently on, for example. -+ -+@noindent -+In order to do that, you may use the @t{vcs_info} function. -+ -+@noindent -+The following VCSs are supported, showing the abbreviated name by which -+they are referred to within the system: -+@table @asis -+@item Bazaar (@t{bzr}) -+http://bazaar-vcs.org/ -+@item Codeville (@t{cdv}) -+http://codeville.org/ -+@item Concurrent Versioning System (@t{cvs}) -+http://www.nongnu.org/cvs/ -+@item Darcs (@t{darcs}) -+http://darcs.net/ -+@item Fossil (@t{fossil}) -+http://fossil-scm.org/ -+@item Git (@t{git}) -+http://git-scm.com/ -+@item GNU arch (@t{tla}) -+http://www.gnu.org/software/gnu-arch/ -+@item Mercurial (@t{hg}) -+http://mercurial.selenic.com/ -+@item Monotone (@t{mtn}) -+http://monotone.ca/ -+@item Perforce (@t{p4}) -+http://www.perforce.com/ -+@item Subversion (@t{svn}) -+http://subversion.tigris.org/ -+@item SVK (@t{svk}) -+http://svk.bestpractical.com/ -+@end table -+ -+@noindent -+There is also support for the patch management system @t{quilt} -+(http://savannah.nongnu.org/projects/quilt). See @t{Quilt Support} -+below for details. -+ -+@noindent -+To load @var{vcs_info}: -+ -+@noindent -+@example -+autoload -Uz vcs_info -+@end example -+ -+@noindent -+It can be used in any existing prompt, because it does not require any -+@t{$psvar} entries to be left available. -+ -+@noindent -+ -+@subsection Quickstart -+@noindent -+ -+@noindent -+To get this feature working quickly (including colors), you can do the -+following (assuming, you loaded @var{vcs_info} properly - see above): -+ -+@noindent -+@example -+zstyle ':vcs_info:*' actionformats '%F@{5@}(%f%s%F@{5@})%F@{3@}-%F@{5@}[%F@{2@}%b%F@{3@}|%F@{1@}%a%F@{5@}]%f ' -+zstyle ':vcs_info:*' formats '%F@{5@}(%f%s%F@{5@})%F@{3@}-%F@{5@}[%F@{2@}%b%F@{5@}]%f ' -+zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F@{1@}:%F@{3@}%r' -+precmd () @{ vcs_info @} -+PS1='%F@{5@}[%F@{2@}%n%F@{5@}] %F@{3@}%3~ $@{vcs_info_msg_0_@}%f%# ' -+@end example -+ -+@noindent -+Obviously, the last two lines are there for demonstration. You need to -+call @var{vcs_info} from your @var{precmd} function. Once that is done you need -+a @t{single quoted} @var{'$@{vcs_info_msg_0_@}'} in your prompt. -+ -+@noindent -+To be able to use @var{'$@{vcs_info_msg_0_@}'} directly in your prompt like -+this, you will need to have the @t{PROMPT_SUBST} option enabled. -+ -+@noindent -+Now call the @t{vcs_info_printsys} utility from the command line: -+ -+@noindent -+@example -+% vcs_info_printsys -+## list of supported version control backends: -+## disabled systems are prefixed by a hash sign (#) -+bzr -+cdv -+cvs -+darcs -+fossil -+git -+hg -+mtn -+p4 -+svk -+svn -+tla -+## flavours (cannot be used in the enable or disable styles; they -+## are enabled and disabled with their master [git-svn -> git]) -+## they *can* be used in contexts: ':vcs_info:git-svn:*'. -+git-p4 -+git-svn -+hg-git -+hg-hgsubversion -+hg-hgsvn -+@end example -+ -+@noindent -+You may not want all of these because there is no point in running the -+code to detect systems you do not use. So there is a way to disable -+some backends altogether: -+ -+@noindent -+@example -+zstyle ':vcs_info:*' disable bzr cdv darcs mtn svk tla -+@end example -+ -+@noindent -+You may also pick a few from that list and enable only those: -+ -+@noindent -+@example -+zstyle ':vcs_info:*' enable git cvs svn -+@end example -+ -+@noindent -+If you rerun @t{vcs_info_printsys} after one of these commands, you will -+see the backends listed in the @var{disable} style (or backends not in the -+@var{enable} style - if you used that) marked as disabled by a hash sign. -+That means the detection of these systems is skipped @t{completely}. No -+wasted time there. -+ -+@noindent -+ -+@subsection Configuration -+@noindent -+ -+@noindent -+The @var{vcs_info} feature can be configured via @var{zstyle}. -+ -+@noindent -+First, the context in which we are working: -+@example -+:vcs_info::: -+@end example -+ -+@noindent -+@table @asis -+@item @t{} -+is one of: git, git-svn, git-p4, hg, hg-git, hg-hgsubversion, hg-hgsvn, -+darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil. When hooks are -+active the hooks name is added after a `+'. (See @t{Hooks in vcs_info} -+below.) -+ -+@item @t{} -+is a freely configurable string, assignable by -+the user as the first argument to @var{vcs_info} (see its description -+below). -+ -+@item @t{} -+is the name of a repository in which you want a -+style to match. So, if you want a setting specific to @var{/usr/src/zsh}, -+with that being a CVS checkout, you can set @t{} to -+@var{zsh} to make it so. -+ -+@end table -+ -+@noindent -+There are three special values for @t{}: The first is named -+@var{-init-}, that is in effect as long as there was no decision what VCS -+backend to use. The second is @var{-preinit-}; it is used @t{before} -+@var{vcs_info} is run, when initializing the data exporting variables. The -+third special value is @var{formats} and is used by the @t{vcs_info_lastmsg} -+for looking up its styles. -+ -+@noindent -+The initial value of @t{} is @var{-all-} and it is replaced -+with the actual name, as soon as it is known. Only use this part of the -+context for defining the @var{formats}, @var{actionformats} or -+@var{branchformat} styles, as it is guaranteed that @t{} is -+set up correctly for these only. For all other styles, just use @t{'*'} -+instead. -+ -+@noindent -+There are two pre-defined values for @t{}: -+@table @asis -+@item @t{default} -+the one used if none is specified -+@item @t{command} -+used by vcs_info_lastmsg to lookup its styles -+@end table -+ -+@noindent -+You can of course use @t{':vcs_info:*'} to match all VCSs in all -+user-contexts at once. -+ -+@noindent -+This is a description of all styles that are looked up. -+ -+@noindent -+@table @asis -+@kindex formats -+@item @t{formats} -+A list of formats, used when actionformats is not used -+(which is most of the time). -+ -+@kindex actionformats -+@item @t{actionformats} -+A list of formats, used if there is a special -+action going on in your current repository; like an interactive rebase or -+a merge conflict. -+ -+@kindex branchformat -+@item @t{branchformat} -+Some backends replace @var{%b} in the formats and -+actionformats styles above, not only by a branch name but also by a -+revision number. This style lets you modify how that string should look. -+ -+@kindex nvcsformats -+@item @t{nvcsformats} -+These "formats" are exported when we didn't detect a version control system -+for the current directory or @var{vcs_info} was disabled. This is useful if -+you want @var{vcs_info} to completely take over the generation of your -+prompt. You would do something like @t{PS1='$@{vcs_info_msg_0_@}'} to -+accomplish that. -+ -+@kindex hgrevformat -+@item @t{hgrevformat} -+@t{hg} uses both a hash and a revision number to reference a specific -+changeset in a repository. With this style you can format the revision -+string (see @var{branchformat}) to include either or both. It's only -+useful when @var{get-revision} is true. -+ -+@kindex max-exports -+@item @t{max-exports} -+Defines the maximum number of -+@var{vcs_info_msg_*_} variables @var{vcs_info} will export. -+ -+@kindex enable -+@item @t{enable} -+A list of backends you want to use. Checked in the @var{-init-} context. If -+this list contains an item called @t{NONE} no backend is used at all and -+@var{vcs_info} will do nothing. If this list contains @t{ALL} @var{vcs_info} -+will use all known backends. Only with @t{ALL} in @t{enable} will the -+@t{disable} style have any effect. @t{ALL} and @t{NONE} are case insensitive. -+ -+@kindex disable -+@item @t{disable} -+A list of VCSs you don't want @var{vcs_info} to test for -+repositories (checked in the @var{-init-} context, too). Only used if -+@t{enable} contains @t{ALL}. -+ -+@kindex disable-patterns -+@item @t{disable-patterns} -+A list of patterns that are checked against @t{$PWD}. If a pattern -+matches, @var{vcs_info} will be disabled. This style is checked in the -+@var{:vcs_info:-init-:*:-all-} context. -+ -+@noindent -+Say, @t{~/.zsh} is a directory under version control, in which you do -+not want @var{vcs_info} to be active, do: -+@example -+zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh(|/*)" -+@end example -+ -+@kindex use-quilt -+@item @t{use-quilt} -+If enabled, the @t{quilt} support code is active in `addon' mode. -+See @t{Quilt Support} for details. -+ -+@kindex quilt-standalone -+@item @t{quilt-standalone} -+If enabled, `standalone' mode detection is attempted if no VCS is active -+in a given directory. See @t{Quilt Support} for details. -+ -+@kindex quilt-patch-dir -+@item @t{quilt-patch-dir} -+Overwrite the value of the @var{$QUILT_PATCHES} environment variable. See -+@t{Quilt Support} for details. -+ -+@kindex quiltcommand -+@item @t{quiltcommand} -+When @t{quilt} itself is called in quilt support the value of this style -+is used as the command name. -+ -+@kindex check-for-changes -+@item @t{check-for-changes} -+If enabled, this style causes the @t{%c} and @t{%u} format escapes to show -+when the working directory has uncommitted changes. The strings displayed by -+these escapes can be controlled via the @var{stagedstr} and @var{unstagedstr} -+styles. The only backends that currently support this option are @t{git} and -+@t{hg} (@t{hg} only supports unstaged). -+ -+@noindent -+Note, the actions taken if this style is enabled are potentially expensive -+(read: they may be slow, depending on how big the current repository is). -+Therefore, it is disabled by default. -+ -+@kindex stagedstr -+@item @t{stagedstr} -+This string will be used in the @t{%c} escape if there are staged changes in -+the repository. -+ -+@kindex unstagedstr -+@item @t{unstagedstr} -+This string will be used in the @t{%u} escape if there are unstaged changes -+in the repository. -+ -+@kindex command -+@item @t{command} -+This style causes @var{vcs_info} to use the supplied string as the command -+to use as the VCS's binary. Note, that setting this in ':vcs_info:*' is -+not a good idea. -+ -+@noindent -+If the value of this style is empty (which is the default), the used binary -+name is the name of the backend in use (e.g. @var{svn} is used in an @var{svn} -+repository). -+ -+@noindent -+The @var{repo-root-name} part in the context is always the default @t{-all-} -+when this style is looked up. -+ -+@noindent -+For example, this style can be used to use binaries from non-default -+installation directories. Assume, @var{git} is installed in /usr/bin but -+your sysadmin installed a newer version in /usr/bin/local. Instead of -+changing the order of your @t{$PATH} parameter, you can do this: -+@example -+zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git -+@end example -+ -+@kindex use-server -+@item @t{use-server} -+This is used by the Perforce backend (@t{p4}) to decide if it should -+contact the Perforce server to find out if a directory is managed -+by Perforce. This is the only reliable way of doing this, but runs -+the risk of a delay if the server name cannot be found. If the -+server (more specifically, the @var{host}@t{:}@var{port} pair describing the -+server) cannot be contacted, its name is put into the associative array -+@t{vcs_info_p4_dead_servers} and is not contacted again during the session -+until it is removed by hand. If you do not set this style, the @t{p4} -+backend is only usable if you have set the environment variable -+@t{P4CONFIG} to a file name and have corresponding files in the root -+directories of each Perforce client. See comments in the function -+@t{VCS_INFO_detect_p4} for more detail. -+ -+@kindex use-simple -+@item @t{use-simple} -+If there are two different ways of gathering -+information, you can select the simpler one by setting this style to true; -+the default is to use the not-that-simple code, which is potentially a lot -+slower but might be more accurate in all possible cases. This style is -+used by the @t{bzr} and @t{hg} backends. In the case of @t{hg} it will invoke -+the external hexdump program to parse the binary dirstate cache file; this -+method will not return the local revision number. -+ -+@kindex get-revision -+@item @t{get-revision} -+If set to true, vcs_info goes the extra mile to figure out the revision of -+a repository's work tree (currently for the @t{git} and @t{hg} backends, -+where this kind of information is not always vital). For @t{git}, the -+hash value of the currently checked out commit is available via the @t{%i} -+expansion. With @t{hg}, the local revision number and the corresponding -+global hash are available via @t{%i}. -+ -+@kindex get-mq -+@item @t{get-mq} -+If set to true, the @t{hg} backend will look for a Mercurial Queue (@t{mq}) -+patch directory. Information will be available via the `@t{%m}' replacement. -+ -+@kindex get-bookmarks -+@item @t{get-bookmarks} -+If set to true, the @t{hg} backend will try to get a list of current -+bookmarks. They will be available via the `@t{%m}' replacement. -+ -+@kindex use-prompt-escapes -+@item @t{use-prompt-escapes} -+Determines if we assume that the assembled -+string from @var{vcs_info} includes prompt escapes. (Used by -+@t{vcs_info_lastmsg}.) -+ -+@kindex debug -+@item @t{debug} -+Enable debugging output to track possible problems. Currently this style -+is only used by @var{vcs_info}'s hooks system. -+ -+@kindex hooks -+@item @t{hooks} -+A list style that defines hook-function names. See @t{Hooks in vcs_info} -+below for details. -+ -+@end table -+ -+@noindent -+The default values for these styles in all contexts are: -+ -+@noindent -+@table @asis -+@item @t{formats} -+" (%s)-[%b]%u%c-" -+@item @t{actionformats} -+" (%s)-[%b|%a]%u%c-" -+@item @t{branchformat} -+"%b:%r" (for bzr, svn, svk and hg) -+@item @t{nvcsformats} -+"" -+@item @t{hgrevformat} -+"%r:%h" -+@item @t{max-exports} -+2 -+@item @t{enable} -+ALL -+@item @t{disable} -+(empty list) -+@item @t{disable-patterns} -+(empty list) -+@item @t{check-for-changes} -+false -+@item @t{stagedstr} -+(string: "S") -+@item @t{unstagedstr} -+(string: "U") -+@item @t{command} -+(empty string) -+@item @t{use-server} -+false -+@item @t{use-simple} -+false -+@item @t{get-revision} -+false -+@item @t{get-mq} -+true -+@item @t{get-bookmarks} -+false -+@item @t{use-prompt-escapes} -+true -+@item @t{debug} -+false -+@item @t{hooks} -+(empty list) -+@item @t{use-quilt} -+false -+@item @t{quilt-standalone} -+false -+@item @t{quilt-patch-dir} -+empty - use @var{$QUILT_PATCHES} -+@item @t{quiltcommand} -+quilt -+@end table -+ -+@noindent -+In normal @t{formats} and @t{actionformats} the following replacements are -+done: -+ -+@noindent -+@table @asis -+@item @t{%s} -+The VCS in use (git, hg, svn, etc.). -+@item @t{%b} -+Information about the current branch. -+@item @t{%a} -+An identifier that describes the action. Only makes sense in -+@var{actionformats}. -+@item @t{%i} -+The current revision number or identifier. For @t{hg} -+the @var{hgrevformat} style may be used to customize the output. -+@item @t{%c} -+The string from the @var{stagedstr} style if there are staged -+changes in the repository. -+@item @t{%u} -+The string from the @var{unstagedstr} style if there are -+unstaged changes in the repository. -+@item @t{%R} -+The base directory of the repository. -+@item @t{%r} -+The repository name. If @t{%R} is @var{/foo/bar/repoXY}, @t{%r} -+is @var{repoXY}. -+@item @t{%S} -+A subdirectory within a repository. If @t{$PWD} is -+@var{/foo/bar/repoXY/beer/tasty}, @t{%S} is @var{beer/tasty}. -+@item @t{%m} -+A "misc" replacement. It is at the discretion of the backend to -+decide what this replacement expands to. It is currently used by the @t{hg} -+and @t{git} backends to display patch information from the @t{mq} and -+@t{stgit} extensions. -+@end table -+ -+@noindent -+In @t{branchformat} these replacements are done: -+ -+@noindent -+@table @asis -+@item @t{%b} -+The branch name. -+@item @t{%r} -+The current revision number or the @var{hgrevformat} style for -+@t{hg}. -+@end table -+ -+@noindent -+In @t{hgrevformat} these replacements are done: -+ -+@noindent -+@table @asis -+@item @t{%r} -+The current local revision number. -+@item @t{%h} -+The current 40-character changeset ID hash identifier. -+@end table -+ -+@noindent -+In @t{patch-format} and @t{nopatch-format} these replacements are done: -+ -+@noindent -+@table @asis -+@item @t{%p} -+The name of the top-most applied patch. -+@item @t{%u} -+The number of unapplied patches. -+@item @t{%n} -+The number of applied patches. -+@item @t{%c} -+The number of unapplied patches. -+@item @t{%g} -+The names of active @t{mq} guards (@t{hg} backend). -+@item @t{%G} -+The number of active @t{mq} guards (@t{hg} backend). -+@end table -+ -+@noindent -+Not all VCS backends have to support all replacements. For @t{nvcsformats} -+no replacements are performed at all, it is just a string. -+ -+@noindent -+ -+@subsection Oddities -+@noindent -+ -+@noindent -+If you want to use the @t{%b} (bold off) prompt expansion in @var{formats}, -+which expands @t{%b} itself, use @t{%%b}. That will cause the @var{vcs_info} -+expansion to replace @t{%%b} with @t{%b}, so that zsh's prompt expansion -+mechanism can handle it. Similarly, to hand down @t{%b} from -+@var{branchformat}, use @t{%%%%b}. Sorry for this inconvenience, but it -+cannot be easily avoided. Luckily we do not clash with a lot of prompt -+expansions and this only needs to be done for those. -+ -+@noindent -+ -+@subsection Quilt Support -+@noindent -+ -+@noindent -+@t{Quilt} is not a version control system, therefore this is not implemented -+as a backend. It can help keeping track of a series of patches. People use it -+to keep a set of changes they want to use on top of software packages (which -+is tightly integrated into the package build process - the Debian project -+does this for a large number of packages). Quilt can also help individual -+developers keep track of their own patches on top of real version control -+systems. -+ -+@noindent -+The @var{vcs_info} integration tries to support both ways of using quilt by -+having two slightly different modes of operation: `addon' mode and -+`standalone' mode). -+ -+@noindent -+For `addon' mode to become active @var{vcs_info} must have already detected a -+real version control system controlling the directory. If that is the case, -+a directory that holds quilt's patches needs to be found. That directory is -+configurable via the @var{`QUILT_PATCHES'} environment variable. If that -+variable exists its value is used, otherwise the value @t{`patches'} is -+assumed. The value from @var{$QUILT_PATCHES} can be overwritten using the -+@t{`quilt-patches'} style. (Note: you can use @var{vcs_info} to keep the value -+of @var{$QUILT_PATCHES} correct all the time via the @t{post-quilt} hook). -+ -+@noindent -+When the directory in question is found, quilt is assumed to be active. To -+gather more information, @var{vcs_info} looks for a directory called `.pc'; -+Quilt uses that directory to track its current state. If this directory does -+not exist we know that quilt has not done anything to the working directory -+(read: no patches have been applied yet). -+ -+@noindent -+If patches are applied, @var{vcs_info} will try to find out which. If you want -+to know which patches of a series are not yet applied, you need to activate -+the @t{get-unapplied} style in the appropriate context. -+ -+@noindent -+@var{vcs_info} allows for very detailed control over how the gathered -+information is presented (see the below sections, @t{Styles} and @t{Hooks in -+vcs_info}), all of which are documented below. Note there are a number of -+other patch tracking systems that work on top of a certain version control -+system (like @t{stgit} for @t{git}, or @t{mq} for @t{hg}); the configuration -+for systems like that are generally configured the same way as the @t{quilt} -+support. -+ -+@noindent -+If the @t{quilt} support is working in `addon' mode, the produced string is -+available as a simple format replacement (@var{%Q} to be precise), which can -+be used in @t{formats} and @t{actionformats}; see below for details). -+ -+@noindent -+If, on the other hand, the support code is working in `standalone' mode, -+@var{vcs_info} will pretend as if @t{quilt} were an actual version control -+system. That means that the version control system identifier (which -+otherwise would be something like `svn' or `cvs') will be set to -+`@t{-quilt-}'. This has implications on the used style context where this -+identifier is the second element. @var{vcs_info} will have filled in a proper -+value for the "repository's" root directory and the string containing the -+information about quilt's state will be available as the `misc' replacement -+(and @var{%Q} for compatibility with `addon' mode. -+ -+@noindent -+What is left to discuss is how `standalone' mode is detected. The detection -+itself is a series of searches for directories. You can have this detection -+enabled all the time in every directory that is not otherwise under version -+control. If you know there is only a limited set of trees where you would -+like @var{vcs_info} to try and look for Quilt in `standalone' mode to minimise -+the amount of searching on every call to @var{vcs_info}, there are a number of -+ways to do that: -+ -+@noindent -+Essentially, `standalone' mode detection is controlled by a style called -+`@t{quilt-standalone}'. It is a string style and its value can have different -+effects. The simplest values are: `@t{always}' to run detection every time -+@var{vcs_info} is run, and `@t{never}' to turn the detection off entirely. -+ -+@noindent -+If the value of @t{quilt-standalone} is something else, it is interpreted -+differently. If the value is the name of a scalar variable the value of that -+variable is checked and that value is used in the same `always'/`never' way -+as described above. -+ -+@noindent -+If the value of @t{quilt-standalone} is an array, the elements of that array -+are used as directory names under which you want the detection to be active. -+ -+@noindent -+If @t{quilt-standalone} is an associative array, the keys are taken as -+directory names under which you want the detection to be active, but only if -+the corresponding value is the string `@t{true}'. -+ -+@noindent -+Last, but not least, if the value of @t{quilt-standalone} is the name of a -+function, the function is called without arguments and the return value -+decides whether detection should be active. A `0' return value is true; a -+non-zero return value is interpreted as false. -+ -+@noindent -+Note, if there is both a function and a variable by the name of -+@t{quilt-standalone}, the function will take precedence. -+ -+@noindent -+ -+@subsection Function Descriptions (Public API) -+@noindent -+ -+@noindent -+@table @asis -+@findex vcs_info -+@item @t{vcs_info} [@var{user-context}] -+The main function, that runs all backends and assembles all data into -+@var{$@{vcs_info_msg_*_@}}. This is the function you want to call from -+@t{precmd} if you want to include up-to-date information in your prompt (see -+@t{Variable description} below). If an argument is given, that string will be -+used instead of @t{default} in the @t{user-context} field of the style -+context. -+ -+@findex vcs_info_hookadd -+@item @t{vcs_info_hookadd} -+Statically registers a number of functions to a given hook. The hook needs -+to be given as the first argument; what follows is a list of hook-function -+names to register to the hook. The `@t{+vi-}' prefix needs to be left out -+here. See @t{Hooks in vcs_info} below for details. -+ -+@findex vcs_info_hookdel -+@item @t{vcs_info_hookdel} -+Remove hook-functions from a given hook. The hook needs to be given as the -+first non-option argument; what follows is a list of hook-function -+names to un-register from the hook. If `@t{-a}' is used as the first -+argument, @t{all} occurances of the functions are unregistered. Otherwise -+only the last occurance is removed (if a function was registered to a hook -+more than once) . The `@t{+vi-}' prefix needs to be left out here. See -+@t{Hooks in vcs_info} below for details. -+ -+@findex vcs_info_lastmsg -+@item @t{vcs_info_lastmsg} -+Outputs the last @var{$@{vcs_info_msg_*_@}} value. -+Takes into account the value of the @t{use-prompt-escapes} style in -+@var{':vcs_info:formats:command:-all-'}. It also only prints @t{max-exports} -+values. -+ -+@findex vcs_info_printsys -+@item @t{vcs_info_printsys} [@var{user-context}] -+Prints a list of all -+supported version control systems. Useful to find out possible contexts -+(and which of them are enabled) or values for the @var{disable} style. -+ -+@findex vcs_info_setsys -+@item @t{vcs_info_setsys} -+Initializes @var{vcs_info}'s internal list of -+available backends. With this function, you can add support for new VCSs -+without restarting the shell. -+ -+@end table -+ -+@noindent -+All functions named VCS_INFO_* are for internal use only. -+ -+@noindent -+ -+@subsection Variable Description -+@noindent -+ -+@noindent -+@table @asis -+@item @t{$@{vcs_info_msg_N_@}} (Note the trailing underscore) -+Where @var{N} is an integer, e.g., @var{vcs_info_msg_0_}. These variables -+are the storage for the informational message the last @var{vcs_info} call -+has assembled. These are strongly connected to the @t{formats}, -+@t{actionformats} and @t{nvcsformats} styles described above. Those styles -+are lists. The first member of that list gets expanded into -+@var{$@{vcs_info_msg_0_@}}, the second into @var{$@{vcs_info_msg_1_@}} -+and the Nth into @var{$@{vcs_info_msg_N-1_@}}. These parameters are -+exported into the environment. (See the @t{max-exports} style above.) -+ -+@end table -+ -+@noindent -+All variables named VCS_INFO_* are for internal use only. -+ -+@noindent -+ -+@subsection Hooks in vcs_info -+@noindent -+ -+@noindent -+Hooks are places in @var{vcs_info} where you can run your own code. That -+code can communicate with the code that called it and through that, -+change the system's behaviour. -+ -+@noindent -+For configuration, hooks change the style context: -+@example -+:vcs_info:+:: -+@end example -+ -+@noindent -+To register functions to a hook, you need to list them in the @t{hooks} -+style in the appropriate context. -+ -+@noindent -+Example: -+@example -+zstyle ':vcs_info:*+foo:*' hooks bar baz -+@end example -+ -+@noindent -+This registers functions to the hook `foo' for all backends. In order to -+avoid namespace problems, all registered function names are prepended by -+a `+vi-', so the actual functions called for the `foo' hook are -+`@t{+vi-bar}' and `@t{+vi-baz}'. -+ -+@noindent -+If you would like to register a function to a hook regardless of the -+current context, you may use the @var{vcs_info_hookadd} function. To remove -+a function that was added like that, the @var{vcs_info_hookdel} function -+can be used. -+ -+@noindent -+If something seems weird, you can enable the `debug' boolean style in -+the proper context and the hook-calling code will print what it tried -+to execute and whether the function in question existed. -+ -+@noindent -+When you register more than one function to a hook, all functions are -+executed one after another until one function returns non-zero or until -+all functions have been called. Context-sensitive hook functions are -+executed @t{before} statically registered ones (the ones added by -+@var{vcs_info_hookadd}). -+ -+@noindent -+You may pass data between functions via an associative array, @t{user_data}. -+For example: -+@example -+ -++vi-git-myfirsthook()@{ -+ user_data[myval]=$myval -+@} -++vi-git-mysecondhook()@{ -+ # do something with $@{user_data[myval]@} -+@} -+@end example -+ -+@noindent -+There are a number of variables that are special in hook contexts: -+ -+@noindent -+@table @asis -+@item @t{ret} -+The return value that the hooks system will return to the caller. The -+default is an integer `zero'. If and how a changed @t{ret} value changes -+the execution of the caller depends on the specific hook. See the hook -+documentation below for details. -+ -+@item @t{hook_com} -+An associated array which is used for bidirectional communication from -+the caller to hook functions. The used keys depend on the specific hook. -+ -+@item @t{context} -+The active context of the hook. Functions that wish to change this -+variable should make it local scope first. -+ -+@item @t{vcs} -+The current VCS after it was detected. The same values as in the -+enable/disable style are used. Available in all hooks except @t{start-up}. -+ -+@end table -+ -+@noindent -+Finally, the full list of currently available hooks: -+ -+@noindent -+@table @asis -+@item @t{start-up} -+Called after starting @var{vcs_info} but before the VCS in this directory is -+determined. It can be used to deactivate @var{vcs_info} temporarily if -+necessary. When @t{ret} is set to @var{1}, @var{vcs_info} aborts and does -+nothing; when set to @var{2}, @var{vcs_info} sets up everything as if no -+version control were active and exits. -+ -+@item @t{pre-get-data} -+Same as @t{start-up} but after the VCS was detected. -+ -+@item @t{gen-hg-bookmark-string} -+Called in the Mercurial backend when a bookmark string is generated; the -+@t{get-revision} and @t{get-bookmarks} styles must be true. -+ -+@noindent -+This hook gets the names of the Mercurial bookmarks that -+@var{vcs_info} collected from `hg'. -+ -+@noindent -+When setting @t{ret} to non-zero, the string in -+@t{$@{hook_com[hg-bookmark-string]@}} will be used in the @var{%m} escape in -+@t{formats} and @t{actionformats} and will be availabe in the global -+@var{backend_misc} array as @t{$@{backend_misc[bookmarks]@}}. -+ -+@item @t{gen-applied-string} -+Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backends -+and in @t{quilt} support when the @var{applied-string} is generated; the -+@t{use-quilt} zstyle must be true for @t{quilt} (the @t{mq} and @t{stgit} -+backends are active by default). -+ -+@noindent -+This hook gets the names of all applied patches which @var{vcs_info} collected -+so far in the opposite order, which means that the first argument is the -+top-most patch and so forth. -+ -+@noindent -+When setting @t{ret} to non-zero, the string in -+@t{$@{hook_com[applied-string]@}} will be used in the @var{%m} escape in -+@t{formats} and @t{actionformats}; it will be available in the global -+@var{backend_misc} array as @t{$backend_misc[patches]@}}; and it will be -+available as @var{%p} in the @t{patch-format} and @t{nopatch-format} styles. -+ -+@item @t{gen-unapplied-string} -+Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backend -+and in @t{quilt} support when the @var{unapplied-string} is generated; the -+@t{get-unapplied} style must be true. -+ -+@noindent -+This hook gets the names of all unapplied patches which @var{vcs_info} -+collected so far in the opposite order, which mean that the first argument is -+the patch next-in-line to be applied and so forth. -+ -+@noindent -+When setting @t{ret} to non-zero, the string in -+@t{$@{hook_com[unapplied-string]@}} will be available as @var{%u} in the -+@t{patch-format} and @t{nopatch-format} styles. -+ -+@item @t{gen-mqguards-string} -+Called in the @t{hg} backend when @t{guards-string} is generated; the -+@t{get-mq} style must be true (default). -+ -+@noindent -+This hook gets the names of any active @t{mq} guards. -+ -+@noindent -+When setting @t{ret} to non-zero, the string in -+@t{$@{hook_com[guards-string]@}} will be used in the @var{%g} escape in the -+@t{patch-format} and @t{nopatch-format} styles. -+ -+@item @t{no-vcs} -+This hooks is called when no version control system was detected. -+ -+@noindent -+The `hook_com' parameter is not used. -+ -+@item @t{post-quilt} -+Called after the @t{quilt} support is done. The following information -+is passed as arguments to the hook: 1. the quilt-support mode (`addon' or -+`standalone'); 2. the directory that contains the patch series; 3. the -+directory that holds quilt's status information (the `.pc' directory) or -+the string @t{"-nopc-"} if that directory wasn't found. -+ -+@noindent -+The `hook_com' parameter is not used. -+ -+@item @t{set-branch-format} -+Called before `@t{branchformat}' is set. The only argument to the -+hook is the format that is configured at this point. -+ -+@noindent -+The `@t{hook_com}' keys considered are `@t{branch}' and `@t{revision}'. -+They are set to the values figured out so far by @var{vcs_info} and any -+change will be used directly when the actual replacement is done. -+ -+@noindent -+If @t{ret} is set to to non-zero, the string in -+@t{$@{hook_com[branch-replace]@}} will be used unchanged as the -+`@t{%b}' replacement in the variables set by @var{vcs_info}. -+ -+@item @t{set-hgrev-format} -+Called before a `@t{hgrevformat}' is set. The only argument to the -+hook is the format that is configured at this point. -+ -+@noindent -+The `@t{hook_com}' keys considered are `@t{hash}' and `@t{localrev}'. -+They are set to the values figured out so far by @var{vcs_info} and any -+change will be used directly when the actual replacement is done. -+ -+@noindent -+If @t{ret} is set to to non-zero, the string in -+@t{$@{hook_com[rev-replace]@}} will be used unchanged as the -+`@t{%i}' replacement in the variables set by @var{vcs_info}. -+ -+@item @t{set-message} -+Called each time before a `@t{vcs_info_msg_N_}' message is set. -+It takes two arguments; the first being the `N' in the message -+variable name, the second is the currently configured @t{formats} or -+@t{actionformats}. -+ -+@noindent -+There are a number of `@t{hook_com}' keys, that are used here: -+`@t{action}', `@t{branch}', `@t{base}', `@t{base-name}', `@t{subdir}', -+`@t{staged}', `@t{unstaged}', `@t{revision}', `@t{misc}', `@t{vcs}' -+and one `@t{miscN}' entry for each backend-specific data field (@t{N} -+starting at zero). They are set to the values figured out so far by -+@var{vcs_info} and any change will be used directly when the actual -+replacement is done. -+ -+@noindent -+Since this hook is triggered multiple times (once for each configured -+@t{formats} or @t{actionformats}), each of the `@t{hook_com}' keys mentioned -+above (except for the @t{miscN} entries) has an `@t{_orig}' counterpart, -+so even if you changed a value to your liking you can still get the -+original value in the next run. Changing the `@t{_orig}' values is -+probably not a good idea. -+ -+@noindent -+If @t{ret} is set to to non-zero, the string in -+@t{$@{hook_com[message]@}} will be used unchanged as the message by -+@var{vcs_info}. -+ -+@end table -+ -+@noindent -+If all of this sounds rather confusing, take a look at the @t{Examples} -+section below and also in the Misc/vcs_info-examples file in the Zsh source. -+They contain some explanatory code. -+ -+@noindent -+ -+@subsection Examples -+@noindent -+ -+@noindent -+Don't use @var{vcs_info} at all (even though it's in your prompt): -+@example -+zstyle ':vcs_info:*' enable NONE -+@end example -+ -+@noindent -+Disable the backends for @t{bzr} and @t{svk}: -+@example -+zstyle ':vcs_info:*' disable bzr svk -+@end example -+ -+@noindent -+Disable everything @emph{but} @t{bzr} and @t{svk}: -+@example -+zstyle ':vcs_info:*' enable bzr svk -+@end example -+ -+@noindent -+Provide a special formats for @t{git}: -+@example -+zstyle ':vcs_info:git:*' formats ' GIT, BABY! [%b]' -+zstyle ':vcs_info:git:*' actionformats ' GIT ACTION! [%b|%a]' -+@end example -+ -+@noindent -+All @t{%x} expansion in all sorts of formats ("formats", "actionformats", -+branchformat, you name it) are done using the `@t{zformat}' builtin from -+the `@t{zsh/zutil}' module. That means you can do everything with these -+@t{%x} items what zformat supports. In particular, if you want something -+that is really long to have a fixed width, like a hash in a mercurial -+branchformat, you can do this: @t{%12.12i}. That'll shrink the 40 character -+hash to its 12 leading characters. The form is actually -+`@t{%}@var{min}@t{.}@var{max}@t{x}'. More is possible. -+See @ref{The zsh/zutil Module} for details. -+ -+@noindent -+Use the quicker @t{bzr} backend -+@example -+zstyle ':vcs_info:bzr:*' use-simple true -+@end example -+ -+@noindent -+If you do use @t{use-simple}, please report if it does `the-right-thing[tm]'. -+ -+@noindent -+Display the revision number in yellow for @t{bzr} and @t{svn}: -+@example -+zstyle ':vcs_info:(svn|bzr):*' branchformat '%b%@{'$@{fg[yellow]@}'%@}:%r' -+@end example -+ -+@noindent -+If you want colors, make sure you enclose the color codes in @t{%@{...%@}} -+if you want to use the string provided by @var{vcs_info} in prompts. -+ -+@noindent -+Here is how to print the VCS information as a command (not in a prompt): -+@example -+alias vcsi='vcs_info command; vcs_info_lastmsg' -+@end example -+ -+@noindent -+This way, you can even define different formats for output via -+@t{vcs_info_lastmsg} in the ':vcs_info:*:command:*' namespace. -+ -+@noindent -+Now as promised, some code that uses hooks: -+say, you'd like to replace the string `svn' by `subversion' in -+@var{vcs_info}'s @t{%s} @t{formats} replacement. -+ -+@noindent -+First, we will tell @var{vcs_info} to call a function when populating -+the message variables with the gathered information: -+@example -+zstyle ':vcs_info:*+set-message:*' hooks svn2subversion -+@end example -+ -+@noindent -+Nothing happens. Which is reasonable, since we didn't define the actual -+function yet. To see what the hooks subsystem is trying to do, enable the -+`@t{debug}' style: -+@example -+zstyle ':vcs_info:*+*:*' debug true -+@end example -+ -+@noindent -+That should give you an idea what is going on. Specifically, the function -+that we are looking for is `@t{+vi-svn2subversion}'. Note, the `@t{+vi-}' -+prefix. So, everything is in order, just as documented. When you are done -+checking out the debugging output, disable it again: -+@example -+zstyle ':vcs_info:*+*:*' debug false -+@end example -+ -+@noindent -+Now, let's define the function: -+@example -+ -+function +vi-svn2subversion() @{ -+ [[ $@{hook_com[vcs_orig]@} == svn ]] && hook_com[vcs]=subversion -+@} -+@end example -+ -+@noindent -+Simple enough. And it could have even been simpler, if only we had -+registered our function in a less generic context. If we do it only in -+the `@t{svn}' backend's context, we don't need to test which the active -+backend is: -+@example -+zstyle ':vcs_info:svn+set-message:*' hooks svn2subversion -+@end example -+@example -+ -+function +vi-svn2subversion() @{ -+ hook_com[vcs]=subversion -+@} -+@end example -+ -+@noindent -+And finally a little more elaborate example, that uses a hook to create -+a customised bookmark string for the @t{hg} backend. -+ -+@noindent -+Again, we start off by registering a function: -+@example -+zstyle ':vcs_info:hg+gen-hg-bookmark-string:*' hooks hgbookmarks -+@end example -+ -+@noindent -+And then we define the `@t{+vi-hgbookmarks} function: -+@example -+ -+function +vi-hgbookmarks() @{ -+ # The default is to connect all bookmark names by -+ # commas. This mixes things up a little. -+ # Imagine, there's one type of bookmarks that is -+ # special to you. Say, because it's *your* work. -+ # Those bookmarks look always like this: "sh/*" -+ # (because your initials are sh, for example). -+ # This makes the bookmarks string use only those -+ # bookmarks. If there's more than one, it -+ # concatenates them using commas. -+ local s i -+ # The bookmarks returned by `hg' are available in -+ # the functions positional parameters. -+ (( $# == 0 )) && return 0 -+ for i in "$@@"; do -+ if [[ $i == sh/* ]]; then -+ [[ -n $s ]] && s=$s, -+ s=$@{s@}$i -+ fi -+ done -+ # Now, the communication with the code that calls -+ # the hook functions is done via the hook_com[] -+ # hash. The key, at which the `gen-hg-bookmark-string' -+ # hook looks at is `hg-bookmark-string'. So: -+ hook_com[hg-bookmark-string]=$s -+ # And to signal, that we want to use the sting we -+ # just generated, set the special variable `ret' to -+ # something other than the default zero: -+ ret=1 -+ return 0 -+@} -+ -+@end example -+ -+@noindent -+Some longer examples and code snippets which might be useful are available in -+the examples file located at Misc/vcs_info-examples in the Zsh source -+directory. -+ -+@noindent -+This concludes our guided tour through zsh's @var{vcs_info}. -+ -+@noindent -+@node Prompt Themes, ZLE Functions, Version Control Information, User Contributions -+ -+@section Prompt Themes -+@noindent -+ -+@noindent -+ -+@subsection Installation -+@noindent -+ -+@noindent -+You should make sure all the functions from the @t{Functions/Prompts} -+directory of the source distribution are available; they all begin with -+the string `@t{prompt_}' except for the special function`@t{promptinit}'. -+You also need the `@t{colors}' function from @t{Functions/Misc}. All of -+these functions may already have been installed on your system; if not, -+you will need to find them and copy them. The directory should appear as -+one of the elements of the @t{fpath} array (this should already be the -+case if they were installed), and at least the function @t{promptinit} -+should be autoloaded; it will autoload the rest. Finally, to initialize -+the use of the system you need to call the @t{promptinit} function. The -+following code in your @t{.zshrc} will arrange for this; assume the -+functions are stored in the directory @t{~/myfns}: -+ -+@noindent -+@example -+fpath=(~/myfns $fpath) -+autoload -U promptinit -+promptinit -+@end example -+ -+@noindent -+ -+@subsection Theme Selection -+@noindent -+ -+@noindent -+Use the @t{prompt} command to select your preferred theme. This command -+may be added to your @t{.zshrc} following the call to @t{promptinit} in -+order to start zsh with a theme already selected. -+ -+@noindent -+@table @asis -+@item @t{prompt} [ @t{-c} | @t{-l} ] -+@itemx @t{prompt} [ @t{-p} | @t{-h} ] [ @var{theme} ... ] -+@itemx @t{prompt} [ @t{-s} ] @var{theme} [ @var{arg} ... ] -+Set or examine the prompt theme. With no options and a @var{theme} -+argument, the theme with that name is set as the current theme. The -+available themes are determined at run time; use the @t{-l} option to see -+a list. The special @var{theme} `@t{random}' selects at random one of the -+available themes and sets your prompt to that. -+ -+@noindent -+In some cases the @var{theme} may be modified by one or more arguments, -+which should be given after the theme name. See the help for each theme -+for descriptions of these arguments. -+ -+@noindent -+Options are: -+ -+@noindent -+@table @asis -+@item @t{-c} -+Show the currently selected theme and its parameters, if any. -+@item @t{-l} -+List all available prompt themes. -+@item @t{-p} -+Preview the theme named by @var{theme}, or all themes if no -+@var{theme} is given. -+@item @t{-h} -+Show help for the theme named by @var{theme}, or for the -+@t{prompt} function if no @var{theme} is given. -+@item @t{-s} -+Set @var{theme} as the current theme and save state. -+@end table -+ -+@item @t{prompt_}@var{theme}@t{_setup} -+Each available @var{theme} has a setup function which is called by the -+@t{prompt} function to install that theme. This function may define -+other functions as necessary to maintain the prompt, including functions -+used to preview the prompt or provide help for its use. You should not -+normally call a theme's setup function directly. -+ -+@end table -+ -+@noindent -+@node ZLE Functions, Exception Handling, Prompt Themes, User Contributions -+ -+@section ZLE Functions -+@noindent -+ -+@noindent -+ -+@subsection Widgets -+@noindent -+ -+@noindent -+These functions all implement user-defined ZLE widgets (see -+@ref{Zsh Line Editor}) which can be bound to keystrokes in interactive shells. To use them, -+your @t{.zshrc} should contain lines of the form -+ -+@noindent -+@example -+autoload @var{function} -+zle -N @var{function} -+@end example -+ -+@noindent -+followed by an appropriate @t{bindkey} command to associate the function -+with a key sequence. Suggested bindings are described below. -+ -+@noindent -+@table @asis -+@item bash-style word functions -+If you are looking for functions to implement moving over and editing -+words in the manner of bash, where only alphanumeric characters are -+considered word characters, you can use the functions described in -+the next section. The following is sufficient: -+ -+@noindent -+@example -+autoload -U select-word-style -+select-word-style bash -+@end example -+ -+@noindent -+ -+@tindex forward-word-match -+@tindex backward-word-match -+@tindex kill-word-match -+@tindex backward-kill-word-match -+@tindex transpose-words-match -+@tindex capitalize-word-match -+@tindex up-case-word-match -+@tindex down-case-word-match -+@tindex select-word-style -+@tindex match-word-context -+@tindex match-words-by-style -+@item @t{forward-word-match}, @t{backward-word-match} -+@itemx @t{kill-word-match}, @t{backward-kill-word-match} -+@itemx @t{transpose-words-match}, @t{capitalize-word-match} -+@itemx @t{up-case-word-match}, @t{down-case-word-match} -+@itemx @t{select-word-style}, @t{match-word-context}, @t{match-words-by-style} -+The eight `@t{-match}' functions are drop-in replacements for the -+builtin widgets without the suffix. By default they behave in a similar -+way. However, by the use of styles and the function @t{select-word-style}, -+the way words are matched can be altered. -+ -+@noindent -+The simplest way of configuring the functions is to use -+@t{select-word-style}, which can either be called as a normal function with -+the appropriate argument, or invoked as a user-defined widget that will -+prompt for the first character of the word style to be used. The first -+time it is invoked, the eight @t{-match} functions will automatically -+replace the builtin versions, so they do not need to be loaded explicitly. -+ -+@noindent -+The word styles available are as follows. Only the first character -+is examined. -+ -+@noindent -+@table @asis -+@item @t{bash} -+Word characters are alphanumeric characters only. -+ -+@item @t{normal} -+As in normal shell operation: word characters are alphanumeric characters -+plus any characters present in the string given by the parameter -+@t{$WORDCHARS}. -+ -+@item @t{shell} -+Words are complete shell command arguments, possibly including complete -+quoted strings, or any tokens special to the shell. -+ -+@item @t{whitespace} -+Words are any set of characters delimited by whitespace. -+ -+@item @t{default} -+Restore the default settings; this is usually the same as `@t{normal}'. -+ -+@end table -+ -+@noindent -+All but `@t{default}' can be input as an upper case character, which has -+the same effect but with subword matching turned on. In this case, words -+with upper case characters are treated specially: each separate run of -+upper case characters, or an upper case character followed by any number of -+other characters, is considered a word. The style @t{subword-range} -+can supply an alternative character range to the default `@t{[:upper:]}'; -+the value of the style is treated as the contents of a `@t{[}@var{...}@t{]}' -+pattern (note that the outer brackets should not be supplied, only -+those surrounding named ranges). -+ -+@noindent -+More control can be obtained using the @t{zstyle} command, as described in -+@ref{The zsh/zutil Module}. Each style is looked up in the -+context @t{:zle:}@var{widget} where @var{widget} is the name of the -+user-defined widget, not the name of the function implementing it, so in -+the case of the definitions supplied by @t{select-word-style} the -+appropriate contexts are @t{:zle:forward-word}, and so on. The function -+@t{select-word-style} itself always defines styles for the context -+`@t{:zle:*}' which can be overridden by more specific (longer) patterns as -+well as explicit contexts. -+ -+@noindent -+The style @t{word-style} specifies the rules to use. This may have the -+following values. -+ -+@noindent -+@table @asis -+@item @t{normal} -+Use the standard shell rules, i.e. alphanumerics and @t{$WORDCHARS}, unless -+overridden by the styles @t{word-chars} or @t{word-class}. -+ -+@item @t{specified} -+Similar to @t{normal}, but @emph{only} the specified characters, and not also -+alphanumerics, are considered word characters. -+ -+@item @t{unspecified} -+The negation of specified. The given characters are those which will -+@emph{not} be considered part of a word. -+ -+@item @t{shell} -+Words are obtained by using the syntactic rules for generating shell -+command arguments. In addition, special tokens which are never command -+arguments such as `@t{()}' are also treated as words. -+ -+@item @t{whitespace} -+Words are whitespace-delimited strings of characters. -+ -+@end table -+ -+@noindent -+The first three of those rules usually use @t{$WORDCHARS}, but the value -+in the parameter can be overridden by the style @t{word-chars}, which works -+in exactly the same way as @t{$WORDCHARS}. In addition, the style -+@t{word-class} uses character class syntax to group characters and takes -+precedence over @t{word-chars} if both are set. The @t{word-class} style -+does not include the surrounding brackets of the character class; for -+example, `@t{-:[:alnum:]}' is a valid @t{word-class} to include all -+alphanumerics plus the characters `@t{-}' and `@t{:}'. Be careful -+including `@t{]}', `@t{^}' and `@t{-}' as these are special inside -+character classes. -+ -+@noindent -+@t{word-style} may also have `@t{-subword}' appended to its value to -+turn on subword matching, as described above. -+ -+@noindent -+The style @t{skip-chars} is mostly useful for -+@t{transpose-words} and similar functions. If set, it gives a count of -+characters starting at the cursor position which will not be considered -+part of the word and are treated as space, regardless of what they actually -+are. For example, if -+ -+@noindent -+@example -+zstyle ':zle:transpose-words' skip-chars 1 -+@end example -+ -+@noindent -+has been set, and @t{transpose-words-match} is called with the cursor on -+the @var{X} of @t{foo}@var{X}@t{bar}, where @var{X} can be any character, then -+the resulting expression is @t{bar}@var{X}@t{foo}. -+ -+@noindent -+Finer grained control can be obtained by setting the style @t{word-context} -+to an array of pairs of entries. Each pair of entries consists of a -+@var{pattern} and a @var{subcontext}. The shell argument the cursor is on is -+matched against each @var{pattern} in turn until one matches; if it does, -+the context is extended by a colon and the corresponding @var{subcontext}. -+Note that the test is made against the original word on the line, with no -+stripping of quotes. Special handling is done between words: the current -+context is examined and if it contains the string @t{back}, the word before -+the cursor is considered, else the word after cursor is considered. Some -+examples are given below. -+ -+@noindent -+Here are some examples of use of the styles, actually taken from the -+simplified interface in @t{select-word-style}: -+ -+@noindent -+@example -+zstyle ':zle:*' word-style standard -+zstyle ':zle:*' word-chars @value{dsq} -+@end example -+ -+@noindent -+Implements bash-style word handling for all widgets, i.e. only -+alphanumerics are word characters; equivalent to setting -+the parameter @t{WORDCHARS} empty for the given context. -+ -+@noindent -+@example -+style ':zle:*kill*' word-style space -+@end example -+ -+@noindent -+Uses space-delimited words for widgets with the word `kill' in the name. -+Neither of the styles @t{word-chars} nor @t{word-class} is used in this case. -+ -+@noindent -+Here are some examples of use of the @t{word-context} style to extend -+the context. -+ -+@noindent -+@example -+zstyle ':zle:*' word-context "*/*" file "[[:space:]]" whitespace -+zstyle ':zle:transpose-words:whitespace' word-style shell -+zstyle ':zle:transpose-words:filename' word-style normal -+zstyle ':zle:transpose-words:filename' word-chars @value{dsq} -+@end example -+ -+@noindent -+This provides two different ways of using @t{transpose-words} depending on -+whether the cursor is on whitespace between words or on a filename, here -+any word containing a @t{/}. On whitespace, complete arguments as defined -+by standard shell rules will be transposed. In a filename, only -+alphanumerics will be transposed. Elsewhere, words will be transposed -+using the default style for @t{:zle:transpose-words}. -+ -+@noindent -+The word matching and all the handling of @t{zstyle} settings is actually -+implemented by the function @t{match-words-by-style}. This can be used to -+create new user-defined widgets. The calling function should set the local -+parameter @t{curcontext} to @t{:zle:}@var{widget}, create the local -+parameter @t{matched_words} and call @t{match-words-by-style} with no -+arguments. On return, @t{matched_words} will be set to an array with the -+elements: (1) the start of the line (2) the word before the cursor (3) any -+non-word characters between that word and the cursor (4) any non-word -+character at the cursor position plus any remaining non-word characters -+before the next word, including all characters specified by the -+@t{skip-chars} style, (5) the word at or following the cursor (6) any -+non-word characters following that word (7) the remainder of the line. Any -+of the elements may be an empty string; the calling function should test -+for this to decide whether it can perform its function. -+ -+@noindent -+It is possible to pass options with arguments to @t{match-words-by-style} -+to override the use of styles. The options are: -+@table @asis -+@item @t{-w} -+@var{word-style} -+@item @t{-s} -+@var{skip-chars} -+@item @t{-c} -+@var{word-class} -+@item @t{-C} -+@var{word-chars} -+@item @t{-r} -+@var{subword-range} -+@end table -+ -+@noindent -+For example, @t{match-words-by-style -w shell -c 0} may be used to -+extract the command argument around the cursor. -+ -+@noindent -+The @t{word-context} style is implemented by the function -+@t{match-word-context}. This should not usually need to be called -+directly. -+ -+@tindex copy-earlier-word -+@item @t{copy-earlier-word} -+This widget works like a combination of @t{insert-last-word} and -+@t{copy-prev-shell-word}. Repeated invocations of the widget retrieve -+earlier words on the relevant history line. With a numeric argument -+@var{N}, insert the @var{N}th word from the history line; @var{N} may be -+negative to count from the end of the line. -+ -+@noindent -+If @t{insert-last-word} has been used to retrieve the last word on a -+previous history line, repeated invocations will replace that word with -+earlier words from the same line. -+ -+@noindent -+Otherwise, the widget applies to words on the line currently being edited. -+The @t{widget} style can be set to the name of another widget that should -+be called to retrieve words. This widget must accept the same three -+arguments as @t{insert-last-word}. -+ -+@tindex cycle-completion-positions -+@item @t{cycle-completion-positions} -+After inserting an unambiguous string into the command line, the new -+function based completion system may know about multiple places in -+this string where characters are missing or differ from at least one -+of the possible matches. It will then place the cursor on the -+position it considers to be the most interesting one, i.e. the one -+where one can disambiguate between as many matches as possible with as -+little typing as possible. -+ -+@noindent -+This widget allows the cursor to be easily moved to the other interesting -+spots. It can be invoked repeatedly to cycle between all positions -+reported by the completion system. -+ -+@tindex delete-whole-word-match -+@item @t{delete-whole-word-match} -+This is another function which works like the @t{-match} functions -+described immediately above, i.e. using styles to decide the word -+boundaries. However, it is not a replacement for any existing function. -+ -+@noindent -+The basic behaviour is to delete the word around the cursor. There is no -+numeric prefix handling; only the single word around the cursor is -+considered. If the widget contains the string @t{kill}, the removed text -+will be placed in the cutbuffer for future yanking. This can be obtained -+by defining @t{kill-whole-word-match} as follows: -+ -+@noindent -+@example -+zle -N kill-whole-word-match delete-whole-word-match -+@end example -+ -+@noindent -+and then binding the widget @t{kill-whole-word-match}. -+ -+@tindex down-line-or-beginning-search -+@tindex up-line-or-beginning-search -+@item @t{up-line-or-beginning-search}, @t{down-line-or-beginning-search} -+These widgets are similar to the builtin functions @t{up-line-or-search} -+and @t{down-line-or-search}: if in a multiline buffer they move up or -+down within the buffer, otherwise they search for a history line matching -+the start of the current line. In this case, however, they search for -+a line which matches the current line up to the current cursor position, in -+the manner of @t{history-beginning-search-backward} and @t{-forward}, rather -+than the first word on the line. -+ -+@tindex edit-command-line -+@item @t{edit-command-line} -+Edit the command line using your visual editor, as in @t{ksh}. -+ -+@noindent -+@example -+bindkey -M vicmd v edit-command-line -+@end example -+ -+@tindex history-beginning-search-backward-end -+@tindex history-beginning-search-forward-end -+@item @t{history-search-end} -+This function implements the widgets -+@t{history-beginning-search-backward-end} and -+@t{history-beginning-search-forward-end}. These commands work by first -+calling the corresponding builtin widget (see -+@ref{History Control}) and then moving the cursor to the end of the line. The original cursor -+position is remembered and restored before calling the builtin widget a -+second time, so that the same search is repeated to look farther through -+the history. -+ -+@noindent -+Although you @t{autoload} only one function, the commands to use it are -+slightly different because it implements two widgets. -+ -+@noindent -+@example -+zle -N history-beginning-search-backward-end \ -+ history-search-end -+zle -N history-beginning-search-forward-end \ -+ history-search-end -+bindkey '\e^P' history-beginning-search-backward-end -+bindkey '\e^N' history-beginning-search-forward-end -+@end example -+ -+@tindex history-beginning-search-menu -+@item @t{history-beginning-search-menu} -+This function implements yet another form of history searching. The -+text before the cursor is used to select lines from the history, -+as for @t{history-beginning-search-backward} except that all matches are -+shown in a numbered menu. Typing the appropriate digits inserts the -+full history line. Note that leading zeroes must be typed (they are only -+shown when necessary for removing ambiguity). The entire history is -+searched; there is no distinction between forwards and backwards. -+ -+@noindent -+With a prefix argument, the search is not anchored to the start of -+the line; the string typed by the use may appear anywhere in the line -+in the history. -+ -+@noindent -+If the widget name contains `@t{-end}' the cursor is moved to the end of -+the line inserted. If the widget name contains `@t{-space}' any space -+in the text typed is treated as a wildcard and can match anything (hence -+a leading space is equivalent to giving a prefix argument). Both -+forms can be combined, for example: -+ -+@noindent -+@example -+zle -N history-beginning-search-menu-space-end \ -+ history-beginning-search-menu -+@end example -+ -+@tindex history-pattern-search -+@tindex history-pattern-search-backward -+@tindex history-pattern-search-forward -+@item @t{history-pattern-search} -+The function @t{history-pattern-search} implements widgets which prompt -+for a pattern with which to search the history backwards or forwards. The -+pattern is in the usual zsh format, however the first character may be -+@t{^} to anchor the search to the start of the line, and the last character -+may be @t{$} to anchor the search to the end of the line. If the -+search was not anchored to the end of the line the cursor is positioned -+just after the pattern found. -+ -+@noindent -+The commands to create bindable widgets are similar to those in the -+example immediately above: -+ -+@noindent -+@example -+autoload -U history-pattern-search -+zle -N history-pattern-search-backward history-pattern-search -+zle -N history-pattern-search-forward history-pattern-search -+@end example -+ -+@tindex incarg -+@vindex incarg, use of -+@item @t{incarg} -+Typing the keystrokes for this widget with the cursor placed on or to the -+left of an integer causes that integer to be incremented by one. With a -+numeric prefix argument, the number is incremented by the amount of the -+argument (decremented if the prefix argument is negative). The shell -+parameter @t{incarg} may be set to change the default increment to -+something other than one. -+ -+@noindent -+@example -+bindkey '^X+' incarg -+@end example -+ -+@tindex incremental-complete-word -+@item @t{incremental-complete-word} -+This allows incremental completion of a word. After starting this -+command, a list of completion choices can be shown after every character -+you type, which you can delete with @t{^H} or @t{DEL}. Pressing return -+accepts the completion so far and returns you to normal editing (that is, -+the command line is @emph{not} immediately executed). You can hit @t{TAB} to -+do normal completion, @t{^G} to abort back to the state when you started, -+and @t{^D} to list the matches. -+ -+@noindent -+This works only with the new function based completion system. -+ -+@noindent -+@example -+bindkey '^Xi' incremental-complete-word -+@end example -+ -+@tindex insert-composed-char -+@item @t{insert-composed-char} -+This function allows you to compose characters that don't appear on the -+keyboard to be inserted into the command line. The command is followed by -+two keys corresponding to ASCII characters (there is no prompt). For -+accented characters, the two keys are a base character followed by a code -+for the accent, while for other special characters the two characters -+together form a mnemonic for the character to be inserted. The -+two-character codes are a subset of those given by RFC 1345 (see for -+example @t{http://www.faqs.org/rfcs/rfc1345.html}). -+ -+@noindent -+The function may optionally be followed by up to two characters which -+replace one or both of the characters read from the keyboard; if both -+characters are supplied, no input is read. For example, -+@t{insert-composed-char a:} can be used within a widget to insert an a with -+umlaut into the command line. This has the advantages over use of a -+literal character that it is more portable. -+ -+@noindent -+For best results zsh should have been built with support for multibyte -+characters (configured with @t{--enable-multibyte}); however, the function -+works for the limited range of characters available in single-byte -+character sets such as ISO-8859-1. -+ -+@noindent -+The character is converted into the local representation and -+inserted into the command line at the cursor position. -+(The conversion is done within the shell, using whatever facilities -+the C library provides.) With a numeric argument, the character and its -+code are previewed in the status line -+ -+@noindent -+The function may be run outside zle in which case it prints the character -+(together with a newline) to standard output. Input is still read from -+keystrokes. -+ -+@noindent -+See @t{insert-unicode-char} for an alternative way of inserting Unicode -+characters using their hexadecimal character number. -+ -+@noindent -+The set of accented characters is reasonably complete up to Unicode -+character U+0180, the set of special characters less so. However, it it -+is very sporadic from that point. Adding new characters is easy, -+however; see the function @t{define-composed-chars}. Please send any -+additions to @t{zsh-workers@@zsh.org}. -+ -+@noindent -+The codes for the second character when used to accent the first are as -+follows. Note that not every character can take every accent. -+@table @asis -+@item @t{!} -+Grave. -+@item @t{'} -+Acute. -+@item @t{>} -+Circumflex. -+@item @t{?} -+Tilde. (This is not @t{~} as RFC 1345 does not assume that -+character is present on the keyboard.) -+@item @t{-} -+Macron. (A horizontal bar over the base character.) -+@item @t{(} -+Breve. (A shallow dish shape over the base character.) -+@item @t{.} -+Dot above the base character, or in the case of @t{i} no dot, -+or in the case of @t{L} and @t{l} a centered dot. -+@item @t{:} -+Diaeresis (Umlaut). -+@item @t{c} -+Cedilla. -+@item @t{_} -+Underline, however there are currently no underlined characters. -+@item @t{/} -+Stroke through the base character. -+@item @t{"} -+Double acute (only supported on a few letters). -+@item @t{;} -+Ogonek. (A little forward facing hook at the bottom right -+of the character.) -+@item @t{<} -+Caron. (A little v over the letter.) -+@item @t{0} -+Circle over the base character. -+@item @t{2} -+Hook over the base character. -+@item @t{9} -+Horn over the base character. -+@end table -+ -+@noindent -+The most common characters from the Arabic, Cyrillic, Greek and Hebrew -+alphabets are available; consult RFC 1345 for the appropriate sequences. -+In addition, a set of two letter codes not in RFC 1345 are available for -+the double-width characters corresponding to ASCII characters from @t{!} -+to @t{~} (0x21 to 0x7e) by preceding the character with @t{^}, for -+example @t{^A} for a double-width @t{A}. -+ -+@noindent -+The following other two-character sequences are understood. -+ -+@noindent -+@table @asis -+@item ASCII characters -+These are already present on most keyboards: -+@table @asis -+@item @t{<(} -+Left square bracket -+@item @t{//} -+Backslash (solidus) -+@item @t{)>} -+Right square bracket -+@item @t{(!} -+Left brace (curly bracket) -+@item @t{!!} -+Vertical bar (pipe symbol) -+@item @t{!)} -+Right brace (curly bracket) -+@item @t{'?} -+Tilde -+@end table -+ -+@item Special letters -+Characters found in various variants of the Latin alphabet: -+@table @asis -+@item @t{ss} -+Eszett (scharfes S) -+@item @t{D-}, @t{d-} -+Eth -+@item @t{TH}, @t{th} -+Thorn -+@item @t{kk} -+Kra -+@item @t{'n} -+'n -+@item @t{NG}, @t{ng} -+Ng -+@item @t{OI}, @t{oi} -+Oi -+@item @t{yr} -+yr -+@item @t{ED} -+ezh -+@end table -+ -+@item Currency symbols -+@table @asis -+@item @t{Ct} -+Cent -+@item @t{Pd} -+Pound sterling (also lira and others) -+@item @t{Cu} -+Currency -+@item @t{Ye} -+Yen -+@item @t{Eu} -+Euro (N.B. not in RFC 1345) -+@end table -+ -+@item Punctuation characters -+References to "right" quotes indicate the shape (like a 9 rather than 6) -+rather than their grammatical use. (For example, a "right" low double -+quote is used to open quotations in German.) -+@table @asis -+@item @t{!I} -+Inverted exclamation mark -+@item @t{BB} -+Broken vertical bar -+@item @t{SE} -+Section -+@item @t{Co} -+Copyright -+@item @t{-a} -+Spanish feminine ordinal indicator -+@item @t{<<} -+Left guillemet -+@item @t{-}@t{-} -+Soft hyphen -+@item @t{Rg} -+Registered trade mark -+@item @t{PI} -+Pilcrow (paragraph) -+@item @t{-o} -+Spanish masculine ordinal indicator -+@item @t{>>} -+Right guillemet -+@item @t{?I} -+Inverted question mark -+@item @t{-1} -+Hyphen -+@item @t{-N} -+En dash -+@item @t{-M} -+Em dash -+@item @t{-3} -+Horizontal bar -+@item @t{:3} -+Vertical ellipsis -+@item @t{.3} -+Horizontal midline ellipsis -+@item @t{!2} -+Double vertical line -+@item @t{=2} -+Double low line -+@item @t{'6} -+Left single quote -+@item @t{'9} -+Right single quote -+@item @t{.9} -+"Right" low quote -+@item @t{9'} -+Reversed "right" quote -+@item @t{"6} -+Left double quote -+@item @t{"9} -+Right double quote -+@item @t{:9} -+"Right" low double quote -+@item @t{9"} -+Reversed "right" double quote -+@item @t{/-} -+Dagger -+@item @t{/=} -+Double dagger -+@end table -+ -+@item Mathematical symbols -+@table @asis -+@item @t{DG} -+Degree -+@item @t{-2}, @t{+-}, @t{-+} -+- sign, +/- sign, -/+ sign -+@item @t{2S} -+Superscript 2 -+@item @t{3S} -+Superscript 3 -+@item @t{1S} -+Superscript 1 -+@item @t{My} -+Micro -+@item @t{.M} -+Middle dot -+@item @t{14} -+Quarter -+@item @t{12} -+Half -+@item @t{34} -+Three quarters -+@item @t{*X} -+Multiplication -+@item @t{-:} -+Division -+@item @t{%0} -+Per mille -+@item @t{FA}, @t{TE}, @t{/0} -+For all, there exists, empty set -+@item @t{dP}, @t{DE}, @t{NB} -+Partial derivative, delta (increment), del -+(nabla) -+@item @t{(-}, @t{-)} -+Element of, contains -+@item @t{*P}, @t{+Z} -+Product, sum -+@item @t{*-}, @t{Ob}, @t{Sb} -+Asterisk, ring, bullet -+@item @t{RT}, @t{0(}, @t{00} -+Root sign, proportional to, infinity -+@end table -+ -+@item Other symbols -+@table @asis -+@item @t{cS}, @t{cH}, @t{cD}, @t{cC} -+Card suits: spades, hearts, diamonds, -+clubs -+@item @t{Md}, @t{M8}, @t{M2}, @t{Mb}, @t{Mx}, @t{MX} -+Musical notation: -+crotchet (quarter note), quaver (eighth note), semiquavers (sixteenth -+notes), flag sign, natural sign, sharp sign -+@item @t{Fm}, @t{Ml} -+Female, male -+@end table -+ -+@item Accents on their own -+@table @asis -+@item @t{'>} -+Circumflex (same as caret, @t{^}) -+@item @t{'!} -+Grave (same as backtick, @t{`}) -+@item @t{',} -+Cedilla -+@item @t{':} -+Diaeresis (Umlaut) -+@item @t{'m} -+Macron -+@item @t{''} -+Acute -+@end table -+ -+@end table -+ -+@tindex insert-files -+@item @t{insert-files} -+This function allows you type a file pattern, and see the results of the -+expansion at each step. When you hit return, all expansions are inserted -+into the command line. -+ -+@noindent -+@example -+bindkey '^Xf' insert-files -+@end example -+ -+@tindex insert-unicode-char -+@item @t{insert-unicode-char} -+When first executed, the user inputs a set of hexadecimal digits. -+This is terminated with another call to @t{insert-unicode-char}. -+The digits are then turned into the corresponding Unicode character. -+For example, if the widget is bound to @t{^XU}, the character sequence -+`@t{^XU 4 c ^XU}' inserts @t{L} (Unicode U+004c). -+ -+@noindent -+See @t{insert-composed-char} for a way of inserting characters -+using a two-character mnemonic. -+ -+@tindex narrow-to-region -+@tindex narrow-to-region-invisible -+@item @t{narrow-to-region [ -p} @var{pre} @t{] [ -P} @var{post} @t{]} -+@itemx @t{[ -S} @var{statepm} @t{| -R} @var{statepm} @t{] [ -n ] [} @var{start} @var{end} @t{]}) -+@itemx @t{narrow-to-region-invisible} -+Narrow the editable portion of the buffer to the region between the cursor -+and the mark, which may be in either order. The region may not be empty. -+ -+@noindent -+@t{narrow-to-region} may be used as a widget or called as a function from a -+user-defined widget; by default, the text outside the editable area remains -+visible. A @t{recursive-edit} is performed and the original widening -+status is then restored. Various options and arguments are available when -+it is called as a function. -+ -+@noindent -+The options @t{-p} @var{pretext} and @t{-P} @var{posttext} may be -+used to replace the text before and after the display for the duration of -+the function; either or both may be an empty string. -+ -+@noindent -+If the option @t{-n} is also given, @var{pretext} or @var{posttext} will only -+be inserted if there is text before or after the region respectively which -+will be made invisible. -+ -+@noindent -+Two numeric arguments may be given which will be used instead of the cursor -+and mark positions. -+ -+@noindent -+The option @t{-S} @var{statepm} is used to narrow according to the other -+options while saving the original state in the parameter with name -+@var{statepm}, while the option @t{-R} @var{statepm} is used to restore the -+state from the parameter; note in both cases the @emph{name} of the parameter -+is required. In the second case, other options and arguments are -+irrelevant. When this method is used, no @t{recursive-edit} is performed; -+the calling widget should call this function with the option @t{-S}, -+perform its own editing on the command line or pass control to the user -+via `@t{zle recursive-edit}', then call this function with the option -+@t{-R}. The argument @var{statepm} must be a suitable name for an ordinary -+parameter, except that parameters beginning with the prefix @t{_ntr_} are -+reserved for use within @t{narrow-to-region}. Typically the parameter will -+be local to the calling function. -+ -+@noindent -+@t{narrow-to-region-invisible} is a simple widget which calls -+@t{narrow-to-region} with arguments which replace any text outside the -+region with `@t{...}'. -+ -+@noindent -+The display is restored (and the widget returns) upon any zle command -+which would usually cause the line to be accepted or aborted. Hence an -+additional such command is required to accept or abort the current line. -+ -+@noindent -+The return status of both widgets is zero if the line was accepted, else -+non-zero. -+ -+@noindent -+Here is a trivial example of a widget using this feature. -+@example -+local state -+narrow-to-region -p $'Editing restricted region\n' \ -+ -P @value{dsq} -S state -+zle recursive-edit -+narrow-to-region -R state -+@end example -+ -+@tindex predict-on -+@tindex predict-off -+@item @t{predict-on} -+This set of functions implements predictive typing using history search. -+After @t{predict-on}, typing characters causes the editor to look backward -+in the history for the first line beginning with what you have typed so -+far. After @t{predict-off}, editing returns to normal for the line found. -+In fact, you often don't even need to use @t{predict-off}, because if the -+line doesn't match something in the history, adding a key performs -+standard completion, and then inserts itself if no completions were found. -+However, editing in the middle of a line is liable to confuse prediction; -+see the @t{toggle} style below. -+ -+@noindent -+With the function based completion system (which is needed for this), you -+should be able to type @t{TAB} at almost any point to advance the cursor -+to the next @value{dsbq}interesting@value{dsq} character position (usually the end of the -+current word, but sometimes somewhere in the middle of the word). And of -+course as soon as the entire line is what you want, you can accept with -+return, without needing to move the cursor to the end first. -+ -+@noindent -+The first time @t{predict-on} is used, it creates several additional -+widget functions: -+ -+@noindent -+@table @asis -+@item @t{delete-backward-and-predict} -+Replaces the @t{backward-delete-char} -+widget. You do not need to bind this yourself. -+@item @t{insert-and-predict} -+Implements predictive typing by replacing the -+@t{self-insert} widget. You do not need to bind this yourself. -+@item @t{predict-off} -+Turns off predictive typing. -+@end table -+ -+@noindent -+Although you @t{autoload} only the @t{predict-on} function, it is -+necessary to create a keybinding for @t{predict-off} as well. -+ -+@noindent -+@example -+zle -N predict-on -+zle -N predict-off -+bindkey '^X^Z' predict-on -+bindkey '^Z' predict-off -+@end example -+ -+@tindex read-from-minibuffer -+@item @t{read-from-minibuffer} -+This is most useful when called as a function from inside a widget, but will -+work correctly as a widget in its own right. It prompts for a value -+below the current command line; a value may be input using all of the -+standard zle operations (and not merely the restricted set available -+when executing, for example, @t{execute-named-cmd}). The value is then -+returned to the calling function in the parameter @t{$REPLY} and the -+editing buffer restored to its previous state. If the read was aborted -+by a keyboard break (typically @t{^G}), the function returns status 1 -+and @t{$REPLY} is not set. -+ -+@noindent -+If one argument is supplied to the function it is taken as a prompt, -+otherwise `@t{? }' is used. If two arguments are supplied, they are the -+prompt and the initial value of @t{$LBUFFER}, and if a third argument is -+given it is the initial value of @t{$RBUFFER}. This provides a default -+value and starting cursor placement. Upon return the entire buffer is the -+value of @t{$REPLY}. -+ -+@noindent -+One option is available: `@t{-k} @var{num}' specifies that @var{num} -+characters are to be read instead of a whole line. The line editor is not -+invoked recursively in this case, so depending on the terminal settings -+the input may not be visible, and only the input keys are placed in -+@t{$REPLY}, not the entire buffer. Note that unlike the @t{read} builtin -+@var{num} must be given; there is no default. -+ -+@noindent -+The name is a slight misnomer, as in fact the shell's own minibuffer is -+not used. Hence it is still possible to call @t{executed-named-cmd} and -+similar functions while reading a value. -+ -+@tindex replace-string -+@tindex replace-string-again -+@tindex replace-pattern -+@item @t{replace-string}, @t{replace-pattern} -+@itemx @t{replace-string-again}, @t{replace-pattern-again} -+The function @t{replace-string} implements three widgets. -+If defined under the same name as the function, it prompts for two -+strings; the first (source) string will be replaced by the second -+everywhere it occurs in the line editing buffer. -+ -+@noindent -+If the widget name contains the word `@t{pattern}', for example by -+defining the widget using the command `@t{zle -N replace-pattern -+replace-string}', then the matching is performed using zsh patterns. All -+zsh extended globbing patterns can be used in the source string; note -+that unlike filename generation the pattern does not need to match an -+entire word, nor do glob qualifiers have any effect. In addition, the -+replacement string can contain parameter or command substitutions. -+Furthermore, a `@t{&}' in the replacement string will be replaced with -+the matched source string, and a backquoted digit `@t{\}@var{N}' will be -+replaced by the @var{N}th parenthesised expression matched. The form -+`@t{\@{}@var{N}@t{@}}' may be used to protect the digit from following -+digits. -+ -+@noindent -+If the widget instead contains the word `@t{regex}' (or `@t{regexp}'), -+then the matching is performed using regular expressions, respecting -+the setting of the option @t{RE_MATCH_PCRE} (see the description of the -+function @t{regexp-replace} below). The special replacement facilities -+described above for pattern matching are available. -+ -+@noindent -+By default the previous source or replacement string will not be offered -+for editing. However, this feature can be activated by setting the style -+@t{edit-previous} in the context @t{:zle:}@var{widget} (for example, -+@t{:zle:replace-string}) to @t{true}. In addition, a positive -+numeric argument forces the previous values to be offered, a negative or -+zero argument forces them not to be. -+ -+@noindent -+The function @t{replace-string-again} can be used to repeat the previous -+replacement; no prompting is done. As with @t{replace-string}, if the name -+of the widget contains the word `@t{pattern}' or `@t{regex}', pattern or -+regular expression matching is performed, else a literal string -+replacement. Note that the previous source and replacement text are the -+same whether pattern, regular expression or string matching is used. -+ -+@noindent -+For example, starting from the line: -+ -+@noindent -+@example -+print This line contains fan and fond -+@end example -+ -+@noindent -+and invoking @t{replace-pattern} with the source string -+`@t{f(?)n}' and -+the replacement string `@t{c\1r}' produces the not very useful line: -+ -+@noindent -+@example -+print This line contains car and cord -+@end example -+ -+@noindent -+The range of the replacement string can be limited by using the -+@t{narrow-to-region-invisible} widget. One limitation of the current -+version is that @t{undo} will cycle through changes to the replacement -+and source strings before undoing the replacement itself. -+ -+@tindex send-invisible -+@item @t{send-invisible} -+This is similar to read-from-minibuffer in that it may be called as a -+function from a widget or as a widget of its own, and interactively reads -+input from the keyboard. However, the input being typed is concealed and -+a string of asterisks (`@t{*}') is shown instead. The value is saved in -+the paramter @t{$INVISIBLE} to which a reference is inserted into the -+editing buffer at the restored cursor position. If the read was aborted -+by a keyboard break (typically @t{^G}) or another escape from editing such -+as @t{push-line}, @t{$INVISIBLE} is set to empty and the original buffer -+is restored unchanged. -+ -+@noindent -+If one argument is supplied to the function it is taken as a prompt, -+otherwise `@t{Non-echoed text: }' is used (as in emacs). If a second and -+third argument are supplied they are used to begin and end the reference -+to @t{$INVISIBLE} that is inserted into the buffer. The default is to -+open with @t{$@{}, then @t{INVISIBLE}, and close with @t{@}}, but many -+other effects are possible. -+ -+@tindex smart-insert-last-word -+@item @t{smart-insert-last-word} -+This function may replace the @t{insert-last-word} widget, like so: -+ -+@noindent -+@example -+zle -N insert-last-word smart-insert-last-word -+@end example -+ -+@noindent -+With a numeric prefix, or when passed command line arguments in a call -+from another widget, it behaves like @t{insert-last-word}, except that -+words in comments are ignored when @t{INTERACTIVE_COMMENTS} is set. -+ -+@noindent -+Otherwise, the rightmost @value{dsbq}interesting@value{dsq} word from the previous command is -+found and inserted. The default definition of @value{dsbq}interesting@value{dsq} is that the -+word contains at least one alphabetic character, slash, or backslash. -+This definition may be overridden by use of the @t{match} style. The -+context used to look up the style is the widget name, so usually the -+context is @t{:insert-last-word}. However, you can bind this function to -+different widgets to use different patterns: -+ -+@noindent -+@example -+zle -N insert-last-assignment smart-insert-last-word -+zstyle :insert-last-assignment match '[[:alpha:]][][[:alnum:]]#=*' -+bindkey '\e=' insert-last-assignment -+@end example -+ -+@noindent -+If no interesting word is found and the @t{auto-previous} style is set to -+a true value, the search continues upward through the history. When -+@t{auto-previous} is unset or false (the default), the widget must be -+invoked repeatedly in order to search earlier history lines. -+ -+@tindex transpose-lines -+@item @t{transpose-lines} -+Only useful with a multi-line editing buffer; the lines here are -+lines within the current on-screen buffer, not history lines. -+The effect is similar to the function of the same name in Emacs. -+ -+@noindent -+Transpose the current line with the previous line and move the cursor -+to the start of the next line. Repeating this (which can be done by -+providing a positive numeric prefix argument) has the effect of moving -+the line above the cursor down by a number of lines. -+ -+@noindent -+With a negative numeric prefix argument, requires two lines above the -+cursor. These two lines are transposed and the cursor moved to the -+start of the previous line. Using a numeric prefix less than -1 -+has the effect of moving the line above the cursor up by minus that -+number of lines. -+ -+@tindex which-command -+@item @t{which-command} -+This function is a drop-in replacement for the builtin widget -+@t{which-command}. It has enhanced behaviour, in that it correctly -+detects whether or not the command word needs to be expanded as an -+alias; if so, it continues tracing the command word from the expanded -+alias until it reaches the command that will be executed. -+ -+@noindent -+The style @t{whence} is available in the context @t{:zle:$WIDGET}; this -+may be set to an array to give the command and options that will be used to -+investigate the command word found. The default is @t{whence -c}. -+ -+@end table -+ -+@noindent -+ -+@subsection Utility Functions -+@noindent -+ -+@noindent -+These functions are useful in constructing widgets. They -+should be loaded with `@t{autoload -U} @var{function}' and called -+as indicated from user-defined widgets. -+ -+@noindent -+@table @asis -+@tindex split-shell-arguments -+@item @t{split-shell-arguments} -+This function splits the line currently being edited into shell arguments -+and whitespace. The result is stored in the array @t{reply}. The array -+contains all the parts of the line in order, starting with any whitespace -+before the first argument, and finishing with any whitespace after the last -+argument. Hence (so long as the option @t{KSH_ARRAYS} is not set) -+whitespace is given by odd indices in the array and arguments by -+even indices. Note that no stripping of quotes is done; joining together -+all the elements of @t{reply} in order is guaranteed to produce the -+original line. -+ -+@noindent -+The parameter @t{REPLY} is set to the index of the word in @t{reply} which -+contains the character after the cursor, where the first element has index -+1. The parameter @t{REPLY2} is set to the index of the character under the -+cursor in that word, where the first character has index 1. -+ -+@noindent -+Hence @t{reply}, @t{REPLY} and @t{REPLY2} should all be made local to -+the enclosing function. -+ -+@noindent -+See the function @t{modify-current-argument}, described below, for -+an example of how to call this function. -+ -+@tindex modify-current-argument -+@item @t{modify-current-argument} @var{expr-using-}@t{$ARG} -+This function provides a simple method of allowing user-defined widgets -+to modify the command line argument under the cursor (or immediately to the -+left of the cursor if the cursor is between arguments). The argument -+should be an expression which when evaluated operates on the shell -+parameter @t{ARG}, which will have been set to the command line argument -+under the cursor. The expression should be suitably quoted to prevent -+it being evaluated too early. -+ -+@noindent -+For example, a user-defined widget containing the following code -+converts the characters in the argument under the cursor into all upper -+case: -+ -+@noindent -+@example -+modify-current-argument '$@{(U)ARG@}' -+@end example -+ -+@noindent -+The following strips any quoting from the current word (whether backslashes -+or one of the styles of quotes), and replaces it with single quoting -+throughout: -+ -+@noindent -+@example -+modify-current-argument '$@{(qq)$@{(Q)ARG@}@}' -+@end example -+ -+@end table -+ -+@noindent -+ -+@subsection Styles -+@noindent -+ -+@noindent -+The behavior of several of the above widgets can be controlled by the use -+of the @t{zstyle} mechanism. In particular, widgets that interact with -+the completion system pass along their context to any completions that -+they invoke. -+ -+@noindent -+@table @asis -+@kindex break-keys, widget style -+@item @t{break-keys} -+This style is used by the @t{incremental-complete-word} widget. Its value -+should be a pattern, and all keys matching this pattern will cause the -+widget to stop incremental completion without the key having any further -+effect. Like all styles used directly by -+@t{incremental-complete-word}, this style is looked up using the -+context `@t{:incremental}'. -+ -+@kindex completer, completion style -+@item @t{completer} -+The @t{incremental-complete-word} and @t{insert-and-predict} widgets set -+up their top-level context name before calling completion. This allows -+one to define different sets of completer functions for normal completion -+and for these widgets. For example, to use completion, approximation and -+correction for normal completion, completion and correction for -+incremental completion and only completion for prediction one could use: -+ -+@noindent -+@example -+zstyle ':completion:*' completer \ -+ _complete _correct _approximate -+zstyle ':completion:incremental:*' completer \ -+ _complete _correct -+zstyle ':completion:predict:*' completer \ -+ _complete -+@end example -+ -+@noindent -+It is a good idea to restrict the completers used in prediction, because -+they may be automatically invoked as you type. The @t{_list} and -+@t{_menu} completers should never be used with prediction. The -+@t{_approximate}, @t{_correct}, @t{_expand}, and @t{_match} completers may -+be used, but be aware that they may change characters anywhere in the word -+behind the cursor, so you need to watch carefully that the result is what -+you intended. -+ -+@kindex cursor, completion style -+@item @t{cursor} -+The @t{insert-and-predict} widget uses this style, in the context -+`@t{:predict}', to decide where to place the cursor after completion has -+been tried. Values are: -+ -+@noindent -+@table @asis -+@item @t{complete} -+The cursor is left where it was when completion finished, but only if -+it is after a character equal to the one just inserted by the user. If -+it is after another character, this value is the same as `@t{key}'. -+ -+@item @t{key} -+The cursor is left -+after the @var{n}th occurrence of the character just inserted, where -+@var{n} is the number of times that character appeared in the word -+before completion was attempted. In short, this has the effect of -+leaving the cursor after the character just typed even if the -+completion code found out that no other characters need to be inserted -+at that position. -+ -+@end table -+ -+@noindent -+Any other value for this style unconditionally leaves the cursor at the -+position where the completion code left it. -+ -+@kindex list, widget style -+@item @t{list} -+When using the @t{incremental-complete-word} widget, this style says -+if the matches should be listed on every key press (if they fit on the -+screen). Use the context prefix `@t{:completion:incremental}'. -+ -+@noindent -+The @t{insert-and-predict} widget uses this style to decide if the -+completion should be shown even if there is only one possible completion. -+This is done if the value of this style is the string @t{always}. In this -+case the context is `@t{:predict}' (@emph{not} `@t{:completion:predict}'). -+ -+@kindex match, widget style -+@item @t{match} -+This style is used by @t{smart-insert-last-word} to provide a pattern -+(using full @t{EXTENDED_GLOB} syntax) that matches an interesting word. -+The context is the name of the widget to which @t{smart-insert-last-word} -+is bound (see above). The default behavior of @t{smart-insert-last-word} -+is equivalent to: -+ -+@noindent -+@example -+zstyle :insert-last-word match '*[[:alpha:]/\\]*' -+@end example -+ -+@noindent -+However, you might want to include words that contain spaces: -+ -+@noindent -+@example -+zstyle :insert-last-word match '*[[:alpha:][:space:]/\\]*' -+@end example -+ -+@noindent -+Or include numbers as long as the word is at least two characters long: -+ -+@noindent -+@example -+zstyle :insert-last-word match '*([[:digit:]]?|[[:alpha:]/\\])*' -+@end example -+ -+@noindent -+The above example causes redirections like "2>" to be included. -+ -+@kindex prompt, widget style -+@item @t{prompt} -+The @t{incremental-complete-word} widget shows the value of this -+style in the status line during incremental completion. The string -+value may contain any of the following substrings in the manner of -+the @t{PS1} and other prompt parameters: -+ -+@noindent -+@table @asis -+@item @t{%c} -+Replaced by the name of the completer function that generated the -+matches (without the leading underscore). -+ -+@item @t{%l} -+When the @t{list} style is set, -+replaced by `@t{...}' if the list of matches is too long to fit on the -+screen and with an empty string otherwise. If the @t{list} style is -+`false' or not set, `@t{%l}' is always removed. -+ -+@item @t{%n} -+Replaced by the number of matches generated. -+ -+@item @t{%s} -+Replaced by `@t{-no match-}', `@t{-no prefix-}', or an empty string -+if there is no completion matching the word on the line, if the -+matches have no common prefix different from the word on the line, or -+if there is such a common prefix, respectively. -+ -+@item @t{%u} -+Replaced by the unambiguous part of all matches, if there -+is any, and if it is different from the word on the line. -+ -+@end table -+ -+@noindent -+Like `@t{break-keys}', this uses the `@t{:incremental}' context. -+ -+@kindex stop-keys, widget style -+@item @t{stop-keys} -+This style is used by the @t{incremental-complete-word} widget. Its value -+is treated similarly to the one for the @t{break-keys} style (and uses -+the same context: `@t{:incremental}'). However, in -+this case all keys matching the pattern given as its value will stop -+incremental completion and will then execute their usual function. -+ -+@kindex toggle, widget style -+@item @t{toggle} -+This boolean style is used by @t{predict-on} and its related widgets in -+the context `@t{:predict}'. If set to one of the standard `true' values, -+predictive typing is automatically toggled off in situations where it is -+unlikely to be useful, such as when editing a multi-line buffer or after -+moving into the middle of a line and then deleting a character. The -+default is to leave prediction turned on until an explicit call to -+@t{predict-off}. -+ -+@kindex verbose, widget style -+@item @t{verbose} -+This boolean style is used by @t{predict-on} and its related widgets in -+the context `@t{:predict}'. If set to one of the standard `true' values, -+these widgets display a message below the prompt when the predictive state -+is toggled. This is most useful in combination with the @t{toggle} style. -+The default does not display these messages. -+ -+@kindex widget, widget style -+@item @t{widget} -+This style is similar to the @t{command} style: For widget functions that -+use @t{zle} to call other widgets, this style can sometimes be used to -+override the widget which is called. The context for this style is the -+name of the calling widget (@emph{not} the name of the calling function, -+because one function may be bound to multiple widget names). -+ -+@noindent -+@example -+zstyle :copy-earlier-word widget smart-insert-last-word -+@end example -+ -+@noindent -+Check the documentation for the calling widget or function to determine -+whether the @t{widget} style is used. -+ -+@end table -+ -+@noindent -+@node Exception Handling, MIME Functions, ZLE Functions, User Contributions -+ -+@section Exception Handling -+@noindent -+ -+@noindent -+Two functions are provided to enable zsh to provide exception handling in a -+form that should be familiar from other languages. -+ -+@noindent -+@table @asis -+@findex throw -+@item @t{throw} @var{exception} -+The function @t{throw} throws the named @var{exception}. The name is -+an arbitrary string and is only used by the @t{throw} and @t{catch} -+functions. An exception is for the most part treated the same as a -+shell error, i.e. an unhandled exception will cause the shell to abort all -+processing in a function or script and to return to the top level in an -+interactive shell. -+ -+@item @t{catch} @var{exception-pattern} -+The function @t{catch} returns status zero if an exception was thrown and -+the pattern @var{exception-pattern} matches its name. Otherwise it -+returns status 1. @var{exception-pattern} is a standard -+shell pattern, respecting the current setting of the @t{EXTENDED_GLOB} -+option. An alias @t{catch} is also defined to prevent the argument to the -+function from matching filenames, so patterns may be used unquoted. Note -+that as exceptions are not fundamentally different from other shell errors -+it is possible to catch shell errors by using an empty string as the -+exception name. The shell variable @t{CAUGHT} is set by @t{catch} to the -+name of the exception caught. It is possible to rethrow an exception by -+calling the @t{throw} function again once an exception has been caught. -+@findex catch -+ -+@end table -+ -+@noindent -+The functions are designed to be used together with the @t{always} construct -+described in -+@ref{Complex Commands}. This is important as only this -+construct provides the required support for exceptions. A typical example -+is as follows. -+ -+@noindent -+@example -+@{ -+ # "try" block -+ # ... nested code here calls "throw MyExcept" -+@} always @{ -+ # "always" block -+ if catch MyExcept; then -+ print "Caught exception MyExcept" -+ elif catch @value{dsq}; then -+ print "Caught a shell error. Propagating..." -+ throw @value{dsq} -+ fi -+ # Other exceptions are not handled but may be caught further -+ # up the call stack. -+@} -+@end example -+ -+@noindent -+If all exceptions should be caught, the following idiom might be -+preferable. -+ -+@noindent -+@example -+@{ -+ # ... nested code here throws an exception -+@} always @{ -+ if catch *; then -+ case $CAUGHT in -+ (MyExcept) -+ print "Caught my own exception" -+ ;; -+ (*) -+ print "Caught some other exception" -+ ;; -+ esac -+ fi -+@} -+@end example -+ -+@noindent -+In common with exception handling in other languages, the exception may be -+thrown by code deeply nested inside the `try' block. However, note that it -+must be thrown inside the current shell, not in a subshell forked for a -+pipeline, parenthesised current-shell construct, or some form of -+command or process substitution. -+ -+@noindent -+The system internally uses the shell variable @t{EXCEPTION} to record the -+name of the exception between throwing and catching. One drawback of this -+scheme is that if the exception is not handled the variable @t{EXCEPTION} -+remains set and may be incorrectly recognised as the name of an exception -+if a shell error subsequently occurs. Adding @t{unset EXCEPTION} at the -+start of the outermost layer of any code that uses exception handling will -+eliminate this problem. -+ -+@noindent -+@node MIME Functions, Mathematical Functions, Exception Handling, User Contributions -+ -+@section MIME Functions -+@noindent -+ -+@noindent -+Three functions are available to provide handling of files recognised by -+extension, for example to dispatch a file @t{text.ps} when executed as a -+command to an appropriate viewer. -+ -+@noindent -+@table @asis -+@findex zsh-mime-setup -+@findex zsh-mime-handler -+@item @t{zsh-mime-setup} [ @t{-fv} ] [ @t{-l} [ @var{suffix ...} ] ] -+@itemx @t{zsh-mime-handler [-l] @var{command arguments ...}} -+These two functions use the files @t{~/.mime.types} and @t{/etc/mime.types}, -+which associate types and extensions, as well as @t{~/.mailcap} and -+@t{/etc/mailcap} files, which associate types and the programs that -+handle them. These are provided on many systems with the Multimedia -+Internet Mail Extensions. -+ -+@noindent -+To enable the system, the function @t{zsh-mime-setup} should be -+autoloaded and run. This allows files with extensions to be treated -+as executable; such files be completed by the function completion system. -+The function @t{zsh-mime-handler} should not need to be called by the -+user. -+ -+@noindent -+The system works by setting up suffix aliases with `@t{alias -s}'. -+Suffix aliases already installed by the user will not be overwritten. -+ -+@noindent -+For suffixes defined in lower case, upper case variants will also -+automatically be handled (e.g. @t{PDF} is automatically handled if -+handling for the suffix @t{pdf} is defined), but not vice versa. -+ -+@noindent -+Repeated calls to @t{zsh-mime-setup} do not override the existing -+mapping between suffixes and executable files unless the option @t{-f} -+is given. Note, however, that this does not override existing suffix -+aliases assigned to handlers other than @t{zsh-mime-handler}. -+ -+@noindent -+Calling @t{zsh-mime-setup} with the option @t{-l} lists the existing -+mappings without altering them. Suffixes to list (which may contain -+pattern characters that should be quoted from immediate interpretation -+on the command line) may be given as additional arguments, otherwise -+all suffixes are listed. -+ -+@noindent -+Calling @t{zsh-mime-setup} with the option -+@t{-v} causes verbose output to be shown during the setup operation. -+ -+@noindent -+The system respects the @t{mailcap} flags @t{needsterminal} and -+@t{copiousoutput}, see man page mailcap(4). -+ -+@noindent -+The functions use the following styles, which are defined with the -+@t{zstyle} builtin command (@ref{The zsh/zutil Module}). They should be defined -+before @t{zsh-mime-setup} is run. The contexts used all -+start with @t{:mime:}, with additional components in some cases. -+It is recommended that a trailing @t{*} (suitably quoted) be appended -+to style patterns in case the system is extended in future. Some -+examples are given below. -+@table @asis -+@kindex current-shell, MIME style -+@item @t{current-shell} -+If this boolean style is true, the mailcap handler for the context in -+question is run using the @t{eval} builtin instead of by starting a new -+@t{sh} process. This is more efficient, but may not work in the occasional -+cases where the mailcap handler uses strict POSIX syntax. -+ -+@kindex execute-as-is, MIME style -+@item @t{execute-as-is} -+This style gives a list of patterns to be matched against files -+passed for execution with a handler program. If the file matches -+the pattern, the entire command line is executed in its current form, -+with no handler. This is useful for files which might have suffixes -+but nonetheless be executable in their own right. If the style -+is not set, the pattern @t{*(*) *(/)} is used; -+hence executable files are executed directly and not passed to a -+handler, and the option @t{AUTO_CD} may be used to change to directories -+that happen to have MIME suffixes. -+ -+@kindex file-path, MIME style -+@item @t{file-path} -+Used if the style @t{find-file-in-path} is true for the same context. -+Set to an array of directories that are used for searching for the -+file to be handled; the default is the command path given by the -+special parameter @t{path}. The shell option @t{PATH_DIRS} is respected; -+if that is set, the appropriate path will be searched even if the -+name of the file to be handled as it appears on the command line contains -+a `@t{/}'. -+The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style -+@t{handler}. -+ -+@kindex find-file-in-path, MIME style -+@item @t{find-file-in-path} -+If set, allows files whose names do not contain absolute paths -+to be searched for in the command path or the path specified by the -+@t{file-path} style. If the file is not found in the path, it is looked -+for locally (whether or not the current directory is in the path); if it is -+not found locally, the handler will abort unless the @t{handle-nonexistent} -+style is set. Files found in the path are tested as described for -+the style @t{execute-as-is}. -+The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style -+@t{handler}. -+ -+@kindex flags, MIME style -+@item @t{flags} -+Defines flags to go with a handler; the context is as for the -+@t{handler} style, and the format is as for the flags in @t{mailcap}. -+ -+@kindex handle-nonexistent, MIME style -+@item @t{handle-nonexistent} -+By default, arguments that don't correspond to files are not passed -+to the MIME handler in order to prevent it from intercepting commands found -+in the path that happen to have suffixes. This style may be set to -+an array of extended glob patterns for arguments that will be passed to the -+handler even if they don't exist. If it is not explicitly set it -+defaults to @t{[[:alpha:]]#:/*} which allows URLs to be passed to the MIME -+handler even though they don't exist in that format in the file system. -+The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style -+@t{handler}. -+ -+@kindex handler, MIME style -+@item @t{handler} -+Specifies a handler for a suffix; the suffix is given by the context as -+@t{:mime:.}@var{suffix}@t{:}, and the format of the handler is exactly -+that in @t{mailcap}. Note in particular the `@t{.}' and trailing colon -+to distinguish this use of the context. This overrides any handler -+specified by the @t{mailcap} files. If the handler requires a terminal, -+the @t{flags} style should be set to include the word @t{needsterminal}, -+or if the output is to be displayed through a pager (but not if the -+handler is itself a pager), it should include @t{copiousoutput}. -+ -+@kindex mailcap, MIME style -+@item @t{mailcap} -+A list of files in the format of @t{~/.mailcap} and -+@t{/etc/mailcap} to be read during setup, replacing the default list -+which consists of those two files. The context is @t{:mime:}. -+A @t{+} in the list will be replaced by the default files. -+ -+@kindex mailcap-priorities, MIME style -+@item @t{mailcap-priorities} -+This style is used to resolve multiple mailcap entries for the same MIME -+type. It consists of an array of the following elements, in descending -+order of priority; later entries will be used if earlier entries are -+unable to resolve the entries being compared. If none of the tests -+resolve the entries, the first entry encountered is retained. -+ -+@noindent -+@table @asis -+@item @t{files} -+The order of files (entries in the @t{mailcap} style) read. Earlier -+files are preferred. (Note this does not resolve entries in the same file.) -+ -+@item @t{priority} -+The priority flag from the mailcap entry. The priority is an integer -+from 0 to 9 with the default value being 5. -+ -+@item @t{flags} -+The test given by the @t{mailcap-prio-flags} option is used to resolve -+entries. -+ -+@item @t{place} -+Later entries are preferred; as the entries are strictly ordered, this -+test always succeeds. -+ -+@end table -+ -+@noindent -+Note that as this style is handled during initialisation, the context -+is always @t{:mime:}, with no discrimination by suffix. -+ -+@kindex mailcap-prio-flags, MIME style -+@item @t{mailcap-prio-flags} -+This style is used when the keyword @t{flags} is encountered in the -+list of tests specified by the @t{mailcap-priorities} style. -+It should be set to a list of patterns, each of which is tested against -+the flags specified in the mailcap entry (in other words, the sets of -+assignments found with some entries in the mailcap file). Earlier -+patterns in the list are preferred to later ones, and matched patterns -+are preferred to unmatched ones. -+ -+@kindex mime-types, MIME style -+@item @t{mime-types} -+A list of files in the format of @t{~/.mime.types} and -+@t{/etc/mime.types} to be read during setup, replacing the default list -+which consists of those two files. The context is @t{:mime:}. -+A @t{+} in the list will be replaced by the default files. -+ -+@kindex never-background, MIME style -+@item @t{never-background} -+If this boolean style is set, the handler for the given context is -+always run in the foreground, even if the flags provided in the mailcap -+entry suggest it need not be (for example, it doesn't require a -+terminal). -+ -+@kindex pager, MIME style -+@item @t{pager} -+If set, will be used instead of @t{$PAGER} or @t{more} to handle -+suffixes where the @t{copiousoutput} flag is set. The context is -+as for @t{handler}, i.e. @t{:mime:.}@var{suffix}@t{:} for handling -+a file with the given @var{suffix}. -+ -+@end table -+ -+@noindent -+Examples: -+ -+@noindent -+@example -+zstyle ':mime:*' mailcap ~/.mailcap /usr/local/etc/mailcap -+zstyle ':mime:.txt:' handler less %s -+zstyle ':mime:.txt:' flags needsterminal -+@end example -+ -+@noindent -+When @t{zsh-mime-setup} is subsequently run, it will look for -+@t{mailcap} entries in the two files given. Files of suffix @t{.txt} -+will be handled by running `@t{less} @var{file.txt}'. The flag -+@t{needsterminal} is set to show that this program must run attached to a -+terminal. -+ -+@noindent -+As there are several steps to dispatching a command, the following -+should be checked if attempting to execute a file by extension -+@t{.}@var{ext} does not have the expected effect. -+ -+@noindent -+The command `@t{alias -s} @var{ext}' should show -+`@t{ps=zsh-mime-handler}'. If it shows something else, another suffix -+alias was already installed and was not overwritten. If it shows -+nothing, no handler was installed: this is most likely because no -+handler was found in the @t{.mime.types} and @t{mailcap} combination for -+@t{.ext} files. In that case, appropriate handling should be added to -+@t{~/.mime.types} and @t{mailcap}. -+ -+@noindent -+If the extension is handled by @t{zsh-mime-handler} but the file is -+not opened correctly, either the handler defined for the type is -+incorrect, or the flags associated with it are in appropriate. Running -+@t{zsh-mime-setup -l} will show the handler and, if there are any, the -+flags. A @t{%s} in the handler is replaced by the file (suitably quoted -+if necessary). Check that the handler program listed lists and can -+be run in the way shown. Also check that the flags @t{needsterminal} or -+@t{copiousoutput} are set if the handler needs to be run under a -+terminal; the second flag is used if the output should be sent to a pager. -+An example of a suitable @t{mailcap} entry for such a program is: -+ -+@noindent -+@example -+text/html; /usr/bin/lynx '%s'; needsterminal -+@end example -+ -+@noindent -+Running `@t{zsh-mime-handler -l} @var{command line}' prints the command -+line that would be executed, simplified to remove the effect of any -+flags, and quoted so that the output can be run as a complete zsh -+command line. This is used by the completion system to decide how to -+complete after a file handled by @t{zsh-mime-setup}. -+ -+@findex pick-web-browser -+@item @t{pick-web-browser} -+This function is separate from the two MIME functions described above -+and can be assigned directly to a suffix: -+ -+@noindent -+@example -+autoload -U pick-web-browser -+alias -s html=pick-web-browser -+@end example -+ -+@noindent -+It is provided as an intelligent front end to dispatch a web browser. -+It may be run as either a function or a shell script. The status -+255 is returned if no browser could be started. -+ -+@noindent -+Various styles are available to customize the choice of browsers: -+ -+@noindent -+@table @asis -+@item @t{browser-style} -+The value of the style is an array giving preferences in decreasing order -+for the type of browser to use. The values of elements may be -+ -+@noindent -+@table @asis -+@item @t{running} -+Use a GUI browser that is already running when an X Window display is -+available. The browsers listed in the @t{x-browsers} style are tried -+in order until one is found; if it is, the file will be displayed in -+that browser, so the user may need to check whether it has appeared. -+If no running browser is found, one is not started. Browsers other than -+Firefox, Opera and Konqueror are assumed to understand the Mozilla -+syntax for opening a URL remotely. -+ -+@item @t{x} -+Start a new GUI browser when an X Window display is available. Search for -+the availability of one of the browsers listed in the @t{x-browsers} style -+and start the first one that is found. No check is made for an already -+running browser. -+ -+@item @t{tty} -+Start a terminal-based browser. Search for the availability of one -+of the browsers listed in the @t{tty-browsers} style and start the -+first one that is found. -+ -+@end table -+ -+@noindent -+If the style is not set the default @t{running x tty} is used. -+ -+@item @t{x-browsers} -+An array in decreasing order -+of preference of browsers to use when running under the X Window System. -+The array consists of the command name under which to start the -+browser. They are looked up in the context @t{:mime:} (which may -+be extended in future, so appending `@t{*}' is recommended). For -+example, -+ -+@noindent -+@example -+zstyle ':mime:*' x-browsers opera konqueror firefox -+@end example -+ -+@noindent -+specifies that @t{pick-web-browser} should first look for a running -+instance of Opera, Konqueror or Firefox, in that order, and if it -+fails to find any should attempt to start Opera. The default is -+@t{firefox mozilla netscape opera konqueror}. -+ -+@item @t{tty-browsers} -+An array similar to @t{x-browsers}, except that it gives browsers to -+use use when no X Window display is available. The default is -+@t{elinks links lynx}. -+ -+@item @t{command} -+If it is set this style is used to pick the command -+used to open a page for a browser. The context is -+@t{:mime:browser:new:$browser:} to start a new browser or -+@t{:mime:browser:running:$browser:} to open a URL in a browser already -+running on the current X display, where @t{$browser} is the value matched -+in the @t{x-browsers} or @t{tty-browsers} style. The escape sequence -+@t{%b} in the style's value will be replaced by the browser, while @t{%u} -+will be replaced by the URL. If the style is not set, the default for all -+new instances is equivalent to @t{%b %u} and the defaults for using running -+browsers are equivalent to the values @t{kfmclient openURL %u} for -+Konqueror, @t{firefox -new-tab %u} for Firefox, @t{opera -newpage %u} -+for Opera, and @t{%b -remote "openUrl(%u)"} for all others. -+ -+@end table -+ -+@end table -+ -+@noindent -+@node Mathematical Functions, User Configuration Functions, MIME Functions, User Contributions -+ -+@section Mathematical Functions -+@noindent -+ -+@noindent -+@table @asis -+@findex zcalc -+@item @t{zcalc} [ @var{expression} ... ] -+A reasonably powerful calculator based on zsh's arithmetic evaluation -+facility. The syntax is similar to that of formulae in most programming -+languages; see -+@ref{Arithmetic Evaluation} for details. The mathematical -+library @t{zsh/mathfunc} will be loaded if it is available; see -+@ref{The zsh/mathfunc Module}. The mathematical functions -+correspond to the raw system libraries, so trigonometric functions are -+evaluated using radians, and so on. -+ -+@noindent -+Each line typed is evaluated as an expression. The prompt shows a number, -+which corresponds to a positional parameter where the result of that -+calculation is stored. For example, the result of the calculation on the -+line preceded by `@t{4> }' is available as @t{$4}. The last value -+calculated is available as @t{ans}. Full command line editing, including -+the history of previous calculations, is available; the history is saved in -+the file @t{~/.zcalc_history}. To exit, enter a blank line or type `@t{:q}' -+on its own (`@t{q}' is allowed for historical compatibility). -+ -+@noindent -+If arguments are given to @t{zcalc} on start up, they are used to prime the -+first few positional parameters. A visual indication of this is given when -+the calculator starts. -+ -+@noindent -+The constants @t{PI} (3.14159...) and @t{E} (2.71828...) are provided. -+Parameter assignment is possible, but note that all parameters will be put -+into the global namespace. -+ -+@noindent -+The output base can be initialised by passing the option `@t{-#}@var{base}', -+for example `@t{zcalc -#16}' (the `@t{#}' may have to be quoted, depending -+on the globbing options set). -+ -+@noindent -+The prompt is configurable via the parameter @t{ZCALCPROMPT}, which -+undergoes standard prompt expansion. The index of the current entry is -+stored locally in the first element of the array @t{psvar}, which can be -+referred to in @t{ZCALCPROMPT} as `@t{%1v}'. The default prompt is -+`@t{%1v> }'. -+ -+@noindent -+A few special commands are available; these are introduced by a colon. -+For backward compatibility, the colon may be omitted for certain -+commands. Completion is available if @t{compinit} has been run. -+ -+@noindent -+The output precision may be specified within zcalc by special commands -+familiar from many calculators. -+@table @asis -+@item @t{:norm} -+The default output format. It corresponds to the printf @t{%g} -+specification. Typically this shows six decimal digits. -+ -+@item @t{:sci} @var{digits} -+Scientific notation, corresponding to the printf @t{%g} output format with -+the precision given by @var{digits}. This produces either fixed point or -+exponential notation depending on the value output. -+ -+@item @t{:fix} @var{digits} -+Fixed point notation, corresponding to the printf @t{%f} output format with -+the precision given by @var{digits}. -+ -+@item @t{:eng} @var{digits} -+Exponential notation, corresponding to the printf @t{%E} output format with -+the precision given by @var{digits}. -+ -+@item @t{:raw} -+Raw output: this is the default form of the output from a math -+evaluation. This may show more precision than the number actually -+possesses. -+ -+@end table -+ -+@noindent -+Other special commands: -+@table @asis -+@item @t{:!}@var{line...} -+Execute @var{line...} as a normal shell command line. Note that it -+is executed in the context of the function, i.e. with local variables. -+Space is optional after @t{:!}. -+ -+@item @t{:local} @var{arg} ... -+Declare variables local to the function. Note that certain variables -+are used by the function for its own purposes. Other variables -+may be used, too, but they will be taken from or put into the global -+scope. -+ -+@item @t{:function} @var{name} [ @var{body} ] -+Define a mathematical function or (with no @var{body}) delete it. -+The function is defined using @t{zmathfuncdef}, see below. -+ -+@noindent -+Note that @t{zcalc} takes care of all quoting. Hence for example: -+ -+@noindent -+@example -+function cube $1 * $1 * $1 -+@end example -+ -+@noindent -+defines a function to cube the sole argument. -+ -+@item @t{[#}@var{base}@t{]} -+This is not a special command, rather part of normal arithmetic -+syntax; however, when this form appears on a line by itself the default -+output radix is set to @var{base}. Use, for example, `@t{[#16]}' to display -+hexadecimal output preceded by an indication of the base, or `@t{[##16]}' -+just to display the raw number in the given base. Bases themselves are -+always specified in decimal. `@t{[#]}' restores the normal output format. -+Note that setting an output base suppresses floating point output; use -+`@t{[#]}' to return to normal operation. -+ -+@end table -+ -+@noindent -+See the comments in the function for a few extra tips. -+ -+@findex zmathfuncdef -+@item @t{zmathfuncdef} [ @var{mathfunc} [ @var{body} ] ] -+A convenient front end to @t{functions -M}. -+ -+@noindent -+With two arguments, define a mathematical function named @var{mathfunc} -+which can be used in any form of arithmetic evaluation. @var{body} -+is a mathematical expression to implement the function. It may -+contain references to position parameters @t{$1}, @t{$2}, ... -+to refer to mandatory parameters and @t{$@{1:-}@var{defvalue}@t{@}} ... -+to refer to optional parameters. Note that the forms must be -+strictly adhered to for the function to calculate the correct number -+of arguments. The implementation is held in a shell function named -+@t{zsh_math_func_}@var{mathfunc}; usually the user will not need -+to refer to the shell function directly. Any existing function -+of the same name is silently replaced. -+ -+@noindent -+With one argument, remove the mathematical function @var{mathfunc} -+as well as the shell function implementation. -+ -+@noindent -+With no arguments, list all @var{mathfunc} functions in a form -+suitable for restoring the definition. -+The functions have not necessarily been defined by @t{zmathfuncdef}. -+ -+@end table -+ -+@noindent -+@node User Configuration Functions, Other Functions, Mathematical Functions, User Contributions -+ -+@section User Configuration Functions -+@noindent -+ -+@noindent -+The @t{zsh/newuser} module comes with a function to aid in configuring -+shell options for new users. If the module is installed, this function can -+also be run by hand. It is available even if the module's default -+behaviour, namely running the function for a new user logging in without -+startup files, is inhibited. -+ -+@noindent -+@table @asis -+@item @t{zsh-newuser-install} [ @t{-f} ] -+The function presents the user with various options for customizing -+their initialization scripts. Currently only @t{~/.zshrc} is handled. -+@t{$ZDOTDIR/.zshrc} is used instead if the parameter @t{ZDOTDIR} is -+set; this provides a way for the user to configure a file without -+altering an existing @t{.zshrc}. -+ -+@noindent -+By default the function exits immediately if it finds any of the files -+@t{.zshenv}, @t{.zprofile}, @t{.zshrc}, or @t{.zlogin} in the appropriate -+directory. The option @t{-f} is required in order to force the function -+to continue. Note this may happen even if @t{.zshrc} itself does not -+exist. -+ -+@noindent -+As currently configured, the function will exit immediately if the -+user has root privileges; this behaviour cannot be overridden. -+ -+@noindent -+Once activated, the function's behaviour is supposed to be -+self-explanatory. Menus are present allowing the user to alter -+the value of options and parameters. Suggestions for improvements are -+always welcome. -+ -+@noindent -+When the script exits, the user is given the opportunity to save the new -+file or not; changes are not irreversible until this point. However, -+the script is careful to restrict changes to the file only to a group -+marked by the lines `@t{# Lines configured by zsh-newuser-install}' and -+`@t{# End of lines configured by zsh-newuser-install}'. In addition, -+the old version of @t{.zshrc} is saved to a file with the suffix -+@t{.zni} appended. -+ -+@noindent -+If the function edits an existing @t{.zshrc}, it is up to the user -+to ensure that the changes made will take effect. For example, if -+control usually returns early from the existing @t{.zshrc} the lines -+will not be executed; or a later initialization file may override -+options or parameters, and so on. The function itself does not attempt to -+detect any such conflicts. -+ -+@end table -+ -+@noindent -+@node Other Functions, , User Configuration Functions, User Contributions -+ -+@section Other Functions -+@noindent -+ -+@noindent -+There are a large number of helpful functions in the @t{Functions/Misc} -+directory of the zsh distribution. Most are very simple and do not -+require documentation here, but a few are worthy of special mention. -+ -+@noindent -+ -+@subsection Descriptions -+@noindent -+ -+@noindent -+@table @asis -+@findex colors -+@item @t{colors} -+This function initializes several associative arrays to map color names to -+(and from) the ANSI standard eight-color terminal codes. These are used -+by the prompt theme system (@ref{Prompt Themes}). You seldom should need to run -+@t{colors} more than once. -+ -+@noindent -+The eight base colors are: black, red, green, yellow, blue, magenta, cyan, -+and white. Each of these has codes for foreground and background. In -+addition there are eight intensity attributes: bold, faint, standout, -+underline, blink, reverse, and conceal. Finally, there are six codes used -+to negate attributes: none (reset all attributes to the defaults), normal -+(neither bold nor faint), no-standout, no-underline, no-blink, and -+no-reverse. -+ -+@noindent -+Some terminals do not support all combinations of colors and intensities. -+ -+@noindent -+The associative arrays are: -+ -+@noindent -+@table @asis -+@item color -+@itemx colour -+Map all the color names to their integer codes, and integer codes to the -+color names. The eight base names map to the foreground color codes, as -+do names prefixed with `@t{fg-}', such as `@t{fg-red}'. Names prefixed -+with `@t{bg-}', such as `@t{bg-blue}', refer to the background codes. The -+reverse mapping from code to color yields base name for foreground codes -+and the @t{bg-} form for backgrounds. -+ -+@noindent -+Although it is a misnomer to call them `colors', these arrays also map the -+other fourteen attributes from names to codes and codes to names. -+ -+@item fg -+@itemx fg_bold -+@itemx fg_no_bold -+Map the eight basic color names to ANSI terminal escape sequences that set -+the corresponding foreground text properties. The @t{fg} sequences change -+the color without changing the eight intensity attributes. -+ -+@item bg -+@itemx bg_bold -+@itemx bg_no_bold -+Map the eight basic color names to ANSI terminal escape sequences that set -+the corresponding background properties. The @t{bg} sequences change the -+color without changing the eight intensity attributes. -+ -+@end table -+ -+@noindent -+In addition, the scalar parameters @t{reset_color} and @t{bold_color} are -+set to the ANSI terminal escapes that turn off all attributes and turn on -+bold intensity, respectively. -+ -+@findex fned -+@item @t{fned} @var{name} -+Same as @t{zed -f}. This function does not appear in the zsh -+distribution, but can be created by linking @t{zed} to the name @t{fned} -+in some directory in your @t{fpath}. -+ -+@findex is-at-least -+@item @t{is-at-least} @var{needed} [ @var{present} ] -+Perform a greater-than-or-equal-to comparison of two strings having the -+format of a zsh version number; that is, a string of numbers and text with -+segments separated by dots or dashes. If the @var{present} string is not -+provided, @t{$ZSH_VERSION} is used. Segments are paired left-to-right in -+the two strings with leading non-number parts ignored. If one string has -+fewer segments than the other, the missing segments are considered zero. -+ -+@noindent -+This is useful in startup files to set options and other state that are -+not available in all versions of zsh. -+ -+@noindent -+@example -+is-at-least 3.1.6-15 && setopt NO_GLOBAL_RCS -+is-at-least 3.1.0 && setopt HIST_REDUCE_BLANKS -+is-at-least 2.6-17 || print "You can't use is-at-least here." -+@end example -+ -+@findex nslookup -+@item @t{nslookup} [ @var{arg} ... ] -+This wrapper function for the @t{nslookup} command requires the -+@t{zsh/zpty} module (see -+@ref{The zsh/zpty Module}). It behaves exactly like the standard @t{nslookup} -+except that it provides customizable prompts (including a right-side -+prompt) and completion of nslookup commands, host names, etc. (if you use -+the function-based completion system). Completion styles may be set with -+the context prefix `@t{:completion:nslookup}'. -+ -+@noindent -+See also the @t{pager}, @t{prompt} and @t{rprompt} styles below. -+ -+@findex regexp-replace -+@item @t{regexp-replace} @var{var} @var{regexp} @var{replace} -+Use regular expressions to perform a global search and replace operation -+on a variable. If the option @t{RE_MATCH_PCRE} is not set, POSIX -+extended regular expressions are used, else Perl-compatible regular -+expressions (this requires the shell to be linked against the @t{pcre} -+library). -+ -+@noindent -+@var{var} is the name of the variable containing the string to be matched. -+The variable will be modified directly by the function. The -+variables @t{MATCH}, @t{MBEGIN}, @t{MEND}, @t{match}, @t{mbegin}, @t{mend} -+should be avoided as these are used by the regular expression code. -+ -+@noindent -+@var{regexp} is the regular expression to match against the string. -+ -+@noindent -+@var{replace} is the replacement text. This can contain parameter, command -+and arithmetic expressions which will be replaced: in particular, a -+reference to @t{$MATCH} will be replaced by the text matched by the pattern. -+ -+@noindent -+The return status is 0 if at least one match was performed, else 1. -+ -+@findex run-help -+@item @t{run-help} @var{cmd} -+This function is designed to be invoked by the @t{run-help} ZLE widget, -+in place of the default alias. See `Accessing On-Line Help' -+(@ref{Utilities}) for setup instructions. -+ -+@noindent -+In the discussion which follows, if @var{cmd} is a file system path, it is -+first reduced to its rightmost component (the file name). -+ -+@noindent -+Help is first sought by looking for a file named @var{cmd} in the directory -+named by the @t{HELPDIR} parameter. If no file is found, an assistant -+function, alias, or command named @t{run-help-@var{cmd}} is sought. If -+found, the assistant is executed with the rest of the current command line -+(everything after the command name @var{cmd}) as its arguments. When -+neither file nor assistant is found, the external command -+`@t{man} @var{cmd}' is run. -+ -+@noindent -+An example assistant for the "ssh" command: -+ -+@noindent -+@example -+run-help-ssh() @{ -+ emulate -LR zsh -+ local -a args -+ # Delete the "-l username" option -+ zparseopts -D -E -a args l: -+ # Delete other options, leaving: host command -+ args=($@{@@:#-*@}) -+ if [[ $@{#args@} -lt 2 ]]; then -+ man ssh -+ else -+ run-help $args[2] -+ fi -+@} -+@end example -+ -+@noindent -+Several of these assistants are provided in the @t{Functions/Misc} -+directory. These must be autoloaded, or placed as executable scripts in -+your search path, in order to be found and used by @t{run-help}. -+ -+@noindent -+@table @asis -+@findex run-help-git -+@findex run-help-svk -+@findex run-help-svn -+@item @t{run-help-git} -+@itemx @t{run-help-svk} -+@itemx @t{run-help-svn} -+Assistant functions for the @t{git}, @t{svk}, and @t{svn} commands. -+ -+@end table -+ -+@item @t{tetris} -+Zsh was once accused of not being as complete as Emacs, -+because it lacked a Tetris game. This function was written to -+refute this vicious slander. -+ -+@noindent -+This function must be used as a ZLE widget: -+ -+@noindent -+@example -+autoload -U tetris -+zle -N tetris -+bindkey @var{keys} tetris -+@end example -+ -+@noindent -+To start a game, execute the widget by typing the @var{keys}. Whatever command -+line you were editing disappears temporarily, and your keymap is also -+temporarily replaced by the Tetris control keys. The previous editor state -+is restored when you quit the game (by pressing `@t{q}') or when you lose. -+ -+@noindent -+If you quit in the middle of a game, the next invocation of the @t{tetris} -+widget will continue where you left off. If you lost, it will start a new -+game. -+ -+@findex zargs -+@item @t{zargs} [ @var{option} ... @t{-}@t{-} ] [ @var{input} ... ] [ @t{-}@t{-} @var{command} [ @var{arg} ... ] ] -+This function works like GNU xargs, except that instead of reading lines -+of arguments from the standard input, it takes them from the command line. -+This is useful because zsh, especially with recursive glob operators, -+often can construct a command line for a shell function that is longer -+than can be accepted by an external command. -+ -+@noindent -+The @var{option} list represents options of the @t{zargs} command itself, -+which are the same as those of @t{xargs}. The @var{input} list is the -+collection of strings (often file names) that become the arguments of the -+@t{command}, analogous to the standard input of @t{xargs}. Finally, the -+@var{arg} list consists of those arguments (usually options) that are -+passed to the @var{command} each time it runs. The @var{arg} list precedes -+the elements from the @t{input} list in each run. If no @var{command} is -+provided, then no @var{arg} list may be provided, and in that event the -+default command is `@t{print}' with arguments `@t{-r -}@t{-}'. -+ -+@noindent -+For example, to get a long @t{ls} listing of all plain files in the -+current directory or its subdirectories: -+ -+@noindent -+@example -+autoload -U zargs -+zargs -- **/*(.) -- ls -l -+@end example -+ -+@noindent -+Note that `@t{-}@t{-}' is used both to mark the end of the @var{option} -+list and to mark the end of the @var{input} list, so it must appear twice -+whenever the @var{input} list may be empty. If there is guaranteed to be -+at least one @var{input} and the first @var{input} does not begin with a -+`@t{-}', then the first `@t{-}@t{-}' may be omitted. -+ -+@noindent -+In the event that the string `@t{-}@t{-}' is or may be an @var{input}, the -+@t{-e} option may be used to change the end-of-inputs marker. Note that -+this does @emph{not} change the end-of-options marker. For example, to use -+`@t{..}' as the marker: -+ -+@noindent -+@example -+zargs -e.. -- **/*(.) .. ls -l -+@end example -+ -+@noindent -+This is a good choice in that example because no plain file can be named -+`@t{..}', but the best end-marker depends on the circumstances. -+ -+@noindent -+For details of the other @t{zargs} options, see man page xargs(1) or run -+@t{zargs} with the @t{-}@t{-help} option. -+ -+@findex zed -+@item @t{zed} [ @t{-f} ] @var{name} -+@itemx @t{zed -b} -+This function uses the ZLE editor to edit a file or function. -+ -+@noindent -+Only one @var{name} argument is allowed. -+If the @t{-f} option is given, the name is taken to be that of -+a function; if the function is marked for autoloading, @t{zed} searches -+for it in the @t{fpath} and loads it. Note that functions edited this way -+are installed into the current shell, but @emph{not} written back to the -+autoload file. -+ -+@noindent -+Without @t{-f}, @var{name} is the path name of the file to edit, which need -+not exist; it is created on write, if necessary. -+ -+@noindent -+While editing, the function sets the main keymap to @t{zed} and the -+vi command keymap to @t{zed-vicmd}. These will be copied from the existing -+@t{main} and @t{vicmd} keymaps if they do not exist the first time @t{zed} -+is run. They can be used to provide special key bindings used only in zed. -+ -+@noindent -+If it creates the keymap, @t{zed} rebinds the return key to insert a line -+break and `@t{^X^W}' to accept the edit in the @t{zed} keymap, and binds -+`@t{ZZ}' to accept the edit in the @t{zed-vicmd} keymap. -+ -+@noindent -+The bindings alone can be installed by running `@t{zed -b}'. This is -+suitable for putting into a startup file. Note that, if rerun, -+this will overwrite the existing @t{zed} and @t{zed-vicmd} keymaps. -+ -+@noindent -+Completion is available, and styles may be set with the context prefix -+`@t{:completion:zed}'. -+ -+@noindent -+A zle widget @t{zed-set-file-name} is available. This can be called by -+name from within zed using `@t{\ex zed-set-file-name}' (note, however, that -+because of zed's rebindings you will have to type @t{^j} at the end instead -+of the return key), or can be bound to a key in either of the @t{zed} or -+@t{zed-vicmd} keymaps after `@t{zed -b}' has been run. When the widget is -+called, it prompts for a new name for the file being edited. When zed -+exits the file will be written under that name and the original file will -+be left alone. The widget has no effect with `@t{zed -f}'. -+ -+@noindent -+While @t{zed-set-file-name} is running, zed uses the keymap -+@t{zed-normal-keymap}, which is linked from the main keymap in effect -+at the time zed initialised its bindings. (This is to make the return key -+operate normally.) The result is that if the main keymap has been changed, -+the widget won't notice. This is not a concern for most users. -+ -+@findex zcp -+@findex zln -+@item @t{zcp} [ @t{-finqQvwW} ] @var{srcpat} @var{dest} -+@itemx @t{zln} [ @t{-finqQsvwW} ] @var{srcpat} @var{dest} -+Same as @t{zmv -C} and @t{zmv -L}, respectively. These functions do not -+appear in the zsh distribution, but can be created by linking @t{zmv} to -+the names @t{zcp} and @t{zln} in some directory in your @t{fpath}. -+ -+@item @t{zkbd} -+See `Keyboard Definition' -+(@ref{Utilities}). -+ -+@findex zmv -+@item @t{zmv} [ @t{-finqQsvwW} ] [ -C | -L | -M | -p @var{program} ] [ -o @var{optstring} ] @var{srcpat} @var{dest} -+Move (usually, rename) files matching the pattern @var{srcpat} to -+corresponding files having names of the form given by @var{dest}, where -+@var{srcpat} contains parentheses surrounding patterns which will be -+replaced in turn by $1, $2, ... in @var{dest}. For example, -+ -+@noindent -+@example -+zmv '(*).lis' '$1.txt' -+@end example -+ -+@noindent -+renames `@t{foo.lis}' to `@t{foo.txt}', `@t{my.old.stuff.lis}' to -+`@t{my.old.stuff.txt}', and so on. -+ -+@noindent -+The pattern is always treated as an @t{EXTENDED_GLOB} pattern. Any file -+whose name is not changed by the substitution is simply ignored. Any -+error (a substitution resulted in an empty string, two substitutions gave -+the same result, the destination was an existing regular file and @t{-f} -+was not given) causes the entire function to abort without doing anything. -+ -+@noindent -+Options: -+ -+@noindent -+@table @asis -+@item @t{-f} -+Force overwriting of destination files. Not currently -+passed down to the @t{mv}/@t{cp}/@t{ln} command due to vagaries of -+implementations (but you can use @t{-o-f} to do that). -+@item @t{-i} -+Interactive: show each line to be executed and ask the user -+whether to execute it. `Y' or `y' will execute it, anything else will -+skip it. Note that you just need to type one character. -+@item @t{-n} -+No execution: print what would happen, but don't do it. -+@item @t{-q} -+Turn bare glob qualifiers off: now assumed by default, so -+this has no effect. -+@item @t{-Q} -+Force bare glob qualifiers on. Don't turn this on unless -+you are actually using glob qualifiers in a pattern. -+@item @t{-s} -+Symbolic, passed down to @t{ln}; only works with @t{-L}. -+@item @t{-v} -+Verbose: print each command as it's being executed. -+@item @t{-w} -+Pick out wildcard parts of the pattern, as described above, -+and implicitly add parentheses for referring to them. -+@item @t{-W} -+Just like @t{-w}, with the addition of turning wildcards in -+the replacement pattern into sequential $@{1@} .. $@{N@} references. -+@item @t{-C} -+@itemx @t{-L} -+@itemx @t{-M} -+Force @t{cp}, @t{ln} or @t{mv}, respectively, regardless of -+the name of the function. -+@item @t{-p} @var{program} -+Call @var{program} instead of @t{cp}, @t{ln} or -+@t{mv}. Whatever it does, it should at least understand the form -+@example -+@var{program} @t{-}@t{-} @var{oldname} @var{newname} -+@end example -+where @var{oldname} and @var{newname} are filenames generated by @t{zmv}. -+@item @t{-o} @var{optstring} -+The @var{optstring} is split into words and -+passed down verbatim to the @t{cp}, @t{ln} or @t{mv} command called to -+perform the work. It should probably begin with a `@t{-}'. -+@end table -+ -+@noindent -+Further examples: -+ -+@noindent -+@example -+zmv -v '(* *)' '$@{1// /_@}' -+@end example -+ -+@noindent -+For any file in the current directory with at least one space in the name, -+replace every space by an underscore and display the commands executed. -+ -+@noindent -+For more complete examples and other implementation details, see the -+@t{zmv} source file, usually located in one of the directories named in -+your @t{fpath}, or in @t{Functions/Misc/zmv} in the zsh distribution. -+ -+@item @t{zrecompile} -+See `Recompiling Functions' -+(@ref{Utilities}). -+ -+@findex zstyle+ -+@item @t{zstyle+} @var{context} @var{style} @var{value} [ + @var{subcontext} @var{style} @var{value} ... ] -+This makes defining styles a bit simpler by using a single `@t{+}' as a -+special token that allows you to append a context name to the previously -+used context name. Like this: -+ -+@noindent -+@example -+zstyle+ ':foo:bar' style1 value1 \ -+ +':baz' style2 value2 \ -+ +':frob' style3 value3 -+@end example -+ -+@noindent -+This defines `style1' with `value1' for the context @t{:foo:bar} as usual, -+but it also defines `style2' with `value2' for the context -+@t{:foo:bar:baz} and `style3' with `value3' for @t{:foo:bar:frob}. Any -+@var{subcontext} may be the empty string to re-use the first context -+unchanged. -+ -+@end table -+ -+@noindent -+ -+@subsection Styles -+@noindent -+ -+@noindent -+@table @asis -+@kindex insert-tab, completion style -+@item @t{insert-tab} -+The @t{zed} function @emph{sets} this style in context `@t{:completion:zed:*}' -+to turn off completion when @t{TAB} is typed at the beginning of a line. -+You may override this by setting your own value for this context and style. -+ -+@kindex pager, nslookup style -+@item @t{pager} -+The @t{nslookup} function looks up this style in the context -+`@t{:nslookup}' to determine the program used to display output that does -+not fit on a single screen. -+ -+@kindex prompt, nslookup style -+@kindex rprompt, nslookup style -+@item @t{prompt} -+@itemx @t{rprompt} -+The @t{nslookup} function looks up this style in the context -+`@t{:nslookup}' to set the prompt and the right-side prompt, respectively. -+The usual expansions for the @t{PS1} and @t{RPS1} parameters may be used -+(see -+@ref{Prompt Expansion}). -+ -+@end table -+@c (avoiding a yodl bug) -+@c (avoiding a yodl bug) -+@c (avoiding a yodl bug) -+@c Yodl file: Zsh/index.yo -+@node Concept Index, Variables Index, Top, Top -+@page -+@unnumbered Concept Index -+ -+@printindex cp -+ -+@noindent -+@node Variables Index, Options Index, Concept Index, Top -+@page -+@unnumbered Variables Index -+ -+@printindex vr -+ -+@noindent -+@node Options Index, Functions Index, Variables Index, Top -+@page -+@unnumbered Options Index -+ -+@printindex pg -+ -+@noindent -+@node Functions Index, Editor Functions Index, Options Index, Top -+@page -+@unnumbered Functions Index -+ -+@printindex fn -+ -+@noindent -+@node Editor Functions Index, Style and Tag Index, Functions Index, Top -+@page -+@unnumbered Editor Functions Index -+ -+@printindex tp -+ -+@noindent -+@node Style and Tag Index, , Editor Functions Index, Top -+@page -+@unnumbered Style and Tag Index -+ -+@printindex ky -+@c (avoiding a yodl bug) -+ -+@contents -+@bye ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshcontrib.1 -@@ -0,0 +1,4358 @@ -+.TH "ZSHCONTRIB" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshcontrib \- user contributions to zsh -+.\" Yodl file: Zsh/contrib.yo -+.SH "DESCRIPTION" -+.PP -+The Zsh source distribution includes a number of items contributed by the -+user community\&. These are not inherently a part of the shell, and some -+may not be available in every zsh installation\&. The most significant of -+these are documented here\&. For documentation on other contributed items -+such as shell functions, look for comments in the function source files\&. -+.PP -+.PP -+.SH "UTILITIES" -+.PP -+.SS "Accessing On\-Line Help" -+.PP -+The key sequence \fBESC h\fP is normally bound by ZLE to execute the -+\fBrun\-help\fP widget (see -+\fIzshzle\fP(1))\&. This invokes the \fBrun\-help\fP command with the command word from the -+current input line as its argument\&. By default, \fBrun\-help\fP is an alias -+for the \fBman\fP command, so this often fails when the command word is a -+shell builtin or a user\-defined function\&. By redefining the \fBrun\-help\fP -+alias, one can improve the on\-line help provided by the shell\&. -+.PP -+The \fBhelpfiles\fP utility, found in the \fBUtil\fP directory of the -+distribution, is a Perl program that can be used to process the zsh manual -+to produce a separate help file for each shell builtin and for many other -+shell features as well\&. The autoloadable \fBrun\-help\fP function, found in -+\fBFunctions/Misc\fP, searches for these helpfiles and performs several -+other tests to produce the most complete help possible for the command\&. -+.PP -+There may already be a directory of help files on your system; look in -+\fB/usr/share/zsh\fP or \fB/usr/local/share/zsh\fP and subdirectories below -+those, or ask your system administrator\&. -+.PP -+To create your own help files with \fBhelpfiles\fP, choose or create a -+directory where the individual command help files will reside\&. For -+example, you might choose \fB~/zsh_help\fP\&. If you unpacked the zsh -+distribution in your home directory, you would use the commands: -+.PP -+.RS -+.nf -+\fBmkdir ~/zsh_help -+cd ~/zsh_help -+man zshall | colcrt \- | \e -+perl ~/zsh\-4\&.3\&.11\-dev\-2/Util/helpfiles\fP -+.fi -+.RE -+.PP -+Next, to use the \fBrun\-help\fP function, you need to add lines something -+like the following to your \fB\&.zshrc\fP or equivalent startup file: -+.PP -+.RS -+.nf -+\fBunalias run\-help -+autoload run\-help -+HELPDIR=~/zsh_help\fP -+.fi -+.RE -+.PP -+The \fBHELPDIR\fP parameter tells \fBrun\-help\fP where to look for the help -+files\&. If your system already has a help file directory installed, set -+\fBHELPDIR\fP to the path of that directory instead\&. -+.PP -+Note that in order for `\fBautoload run\-help\fP\&' to work, the \fBrun\-help\fP -+file must be in one of the directories named in your \fBfpath\fP array (see -+\fIzshparam\fP(1))\&. This should already be the case if you have a standard zsh -+installation; if it is not, copy \fBFunctions/Misc/run\-help\fP to an -+appropriate directory\&. -+.PP -+.SS "Recompiling Functions" -+.PP -+If you frequently edit your zsh functions, or periodically update your zsh -+installation to track the latest developments, you may find that function -+digests compiled with the \fBzcompile\fP builtin are frequently out of date -+with respect to the function source files\&. This is not usually a problem, -+because zsh always looks for the newest file when loading a function, but -+it may cause slower shell startup and function loading\&. Also, if a digest -+file is explicitly used as an element of \fBfpath\fP, zsh won\&'t check whether -+any of its source files has changed\&. -+.PP -+The \fBzrecompile\fP autoloadable function, found in \fBFunctions/Misc\fP, can -+be used to keep function digests up to date\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBzrecompile\fP [ \fB\-qt\fP ] [ \fIname\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzrecompile\fP [ \fB\-qt\fP ] \fB\-p\fP \fIargs\fP [ \fB\-\fP\fB\-\fP \fIargs\fP \&.\&.\&. ] -+This tries to find \fB*\&.zwc\fP files and automatically re\-compile them if at -+least one of the original files is newer than the compiled file\&. This -+works only if the names stored in the compiled files are full paths or are -+relative to the directory that contains the \fB\&.zwc\fP file\&. -+.RS -+.PP -+In the first form, each \fIname\fP is the name of a compiled file or a -+directory containing \fB*\&.zwc\fP files that should be checked\&. If no -+arguments are given, the directories and \fB*\&.zwc\fP files in \fBfpath\fP are -+used\&. -+.PP -+When \fB\-t\fP is given, no compilation is performed, but a return status of -+zero (true) is set if there are files that need to be re\-compiled and -+non\-zero (false) otherwise\&. The \fB\-q\fP option quiets the chatty output -+that describes what \fBzrecompile\fP is doing\&. -+.PP -+Without the \fB\-t\fP option, the return status is zero if all files that -+needed re\-compilation could be compiled and non\-zero if compilation for at -+least one of the files failed\&. -+.PP -+If the \fB\-p\fP option is given, the \fIargs\fP are interpreted as one -+or more sets of arguments for \fBzcompile\fP, separated by `\fB\-\fP\fB\-\fP\&'\&. -+For example: -+.PP -+.RS -+.nf -+\fBzrecompile \-p \e -+ \-R ~/\&.zshrc \-\- \e -+ \-M ~/\&.zcompdump \-\- \e -+ ~/zsh/comp\&.zwc ~/zsh/Completion/*/_*\fP -+.fi -+.RE -+.PP -+This compiles \fB~/\&.zshrc\fP into \fB~/\&.zshrc\&.zwc\fP if that doesn\&'t exist or -+if it is older than \fB~/\&.zshrc\fP\&. The compiled file will be marked for -+reading instead of mapping\&. The same is done for \fB~/\&.zcompdump\fP and -+\fB~/\&.zcompdump\&.zwc\fP, but this compiled file is marked for mapping\&. The -+last line re\-creates the file \fB~/zsh/comp\&.zwc\fP if any of the files -+matching the given pattern is newer than it\&. -+.PP -+Without the \fB\-p\fP option, \fBzrecompile\fP does not create function digests -+that do not already exist, nor does it add new functions to the digest\&. -+.RE -+.RE -+.PP -+The following shell loop is an example of a method for creating function -+digests for all functions in your \fBfpath\fP, assuming that you have write -+permission to the directories: -+.PP -+.RS -+.nf -+\fBfor ((i=1; i <= $#fpath; ++i)); do -+ dir=$fpath[i] -+ zwc=${dir:t}\&.zwc -+ if [[ $dir == (\&.|\&.\&.) || $dir == (\&.|\&.\&.)/* ]]; then -+ continue -+ fi -+ files=($dir/*(N\-\&.)) -+ if [[ \-w $dir:h && \-n $files ]]; then -+ files=(${${(M)files%/*/*}#/}) -+ if ( cd $dir:h && -+ zrecompile \-p \-U \-z $zwc $files ); then -+ fpath[i]=$fpath[i]\&.zwc -+ fi -+ fi -+done\fP -+.fi -+.RE -+.PP -+The \fB\-U\fP and \fB\-z\fP options are appropriate for functions in the default -+zsh installation \fBfpath\fP; you may need to use different options for your -+personal function directories\&. -+.PP -+Once the digests have been created and your \fBfpath\fP modified to refer to -+them, you can keep them up to date by running \fBzrecompile\fP with no -+arguments\&. -+.PP -+.SS "Keyboard Definition" -+.PP -+The large number of possible combinations of keyboards, workstations, -+terminals, emulators, and window systems makes it impossible for zsh to -+have built\-in key bindings for every situation\&. The \fBzkbd\fP utility, -+found in Functions/Misc, can help you quickly create key bindings for your -+configuration\&. -+.PP -+Run \fBzkbd\fP either as an autoloaded function, or as a shell script: -+.PP -+.RS -+.nf -+\fBzsh \-f ~/zsh\-4\&.3\&.11\-dev\-2/Functions/Misc/zkbd\fP -+.fi -+.RE -+.PP -+When you run \fBzkbd\fP, it first asks you to enter your terminal type; if -+the default it offers is correct, just press return\&. It then asks you to -+press a number of different keys to determine characteristics of your -+keyboard and terminal; \fBzkbd\fP warns you if it finds anything out of the -+ordinary, such as a Delete key that sends neither \fB^H\fP nor \fB^?\fP\&. -+.PP -+The keystrokes read by \fBzkbd\fP are recorded as a definition for an -+associative array named \fBkey\fP, written to a file in the subdirectory -+\fB\&.zkbd\fP within either your \fBHOME\fP or \fBZDOTDIR\fP directory\&. The name -+of the file is composed from the \fBTERM\fP, \fBVENDOR\fP and \fBOSTYPE\fP -+parameters, joined by hyphens\&. -+.PP -+You may read this file into your \fB\&.zshrc\fP or another startup file with -+the `\fBsource\fP\&' or `\fB\&.\fP' commands, then reference the \fBkey\fP parameter -+in bindkey commands, like this: -+.PP -+.RS -+.nf -+\fBsource ${ZDOTDIR:\-$HOME}/\&.zkbd/$TERM\-$VENDOR\-$OSTYPE -+[[ \-n ${key[Left]} ]] && bindkey "${key[Left]}" backward\-char -+[[ \-n ${key[Right]} ]] && bindkey "${key[Right]}" forward\-char -+# etc\&.\fP -+.fi -+.RE -+.PP -+Note that in order for `\fBautoload zkbd\fP\&' to work, the \fBzkdb\fP file must -+be in one of the directories named in your \fBfpath\fP array (see -+\fIzshparam\fP(1))\&. This should already be the case if you have a standard zsh -+installation; if it is not, copy \fBFunctions/Misc/zkbd\fP to an -+appropriate directory\&. -+.PP -+.SS "Dumping Shell State" -+.PP -+Occasionally you may encounter what appears to be a bug in the shell, -+particularly if you are using a beta version of zsh or a development -+release\&. Usually it is sufficient to send a description of the -+problem to one of the zsh mailing lists (see -+\fIzsh\fP(1)), but sometimes one of the zsh developers will need to recreate your -+environment in order to track the problem down\&. -+.PP -+The script named \fBreporter\fP, found in the \fBUtil\fP directory of the -+distribution, is provided for this purpose\&. (It is also possible to -+\fBautoload reporter\fP, but \fBreporter\fP is not installed in \fBfpath\fP -+by default\&.) This script outputs a detailed dump of the shell state, -+in the form of another script that can be read with `\fBzsh \-f\fP\&' to -+recreate that state\&. -+.PP -+To use \fBreporter\fP, read the script into your shell with the `\fB\&.\fP\&' -+command and redirect the output into a file: -+.PP -+.RS -+.nf -+\fB\&. ~/zsh\-4\&.3\&.11\-dev\-2/Util/reporter > zsh\&.report\fP -+.fi -+.RE -+.PP -+You should check the \fBzsh\&.report\fP file for any sensitive information -+such as passwords and delete them by hand before sending the script to the -+developers\&. Also, as the output can be voluminous, it\&'s best to wait for -+the developers to ask for this information before sending it\&. -+.PP -+You can also use \fBreporter\fP to dump only a subset of the shell state\&. -+This is sometimes useful for creating startup files for the first time\&. -+Most of the output from reporter is far more detailed than usually is -+necessary for a startup file, but the \fBaliases\fP, \fBoptions\fP, and -+\fBzstyles\fP states may be useful because they include only changes from -+the defaults\&. The \fBbindings\fP state may be useful if you have created -+any of your own keymaps, because \fBreporter\fP arranges to dump the keymap -+creation commands as well as the bindings for every keymap\&. -+.PP -+As is usual with automated tools, if you create a startup file with -+\fBreporter\fP, you should edit the results to remove unnecessary commands\&. -+Note that if you\&'re using the new completion system, you should \fInot\fP -+dump the \fBfunctions\fP state to your startup files with \fBreporter\fP; use -+the \fBcompdump\fP function instead (see -+\fIzshcompsys\fP(1))\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBreporter\fP [ \fIstate\fP \&.\&.\&. ] -+Print to standard output the indicated subset of the current shell state\&. -+The \fIstate\fP arguments may be one or more of: -+.RS -+.PP -+.PD 0 -+.TP -+\fBall\fP -+Output everything listed below\&. -+.TP -+\fBaliases\fP -+Output alias definitions\&. -+.TP -+\fBbindings\fP -+Output ZLE key maps and bindings\&. -+.TP -+\fBcompletion\fP -+Output old\-style \fBcompctl\fP commands\&. -+New completion is covered by \fBfunctions\fP and \fBzstyles\fP\&. -+.TP -+\fBfunctions\fP -+Output autoloads and function definitions\&. -+.TP -+\fBlimits\fP -+Output \fBlimit\fP commands\&. -+.TP -+\fBoptions\fP -+Output \fBsetopt\fP commands\&. -+.TP -+\fBstyles\fP -+Same as \fBzstyles\fP\&. -+.TP -+\fBvariables\fP -+Output shell parameter assignments, plus \fBexport\fP -+commands for any environment variables\&. -+.TP -+\fBzstyles\fP -+Output \fBzstyle\fP commands\&. -+.PD -+.PP -+If the \fIstate\fP is omitted, \fBall\fP is assumed\&. -+.RE -+.PP -+With the exception of `\fBall\fP\&', every \fIstate\fP can be abbreviated by -+any prefix, even a single letter; thus \fBa\fP is the same as \fBaliases\fP, -+\fBz\fP is the same as \fBzstyles\fP, etc\&. -+.RE -+.PP -+.SS "Manipulating Hook Functions" -+.PP -+.PD 0 -+.TP -+.PD -+\fBadd\-zsh\-hook\fP [\-dD] \fIhook\fP \fIfunction\fP -+Several functions are special to the shell, as described in the section -+SPECIAL FUNCTIONS, see \fIzshmisc\fP(1), -+in that they are automatic called at a specific point during shell execution\&. -+Each has an associated array consisting of names of functions to be -+called at the same point; these are so\-called `hook functions\&'\&. -+The shell function \fBadd\-zsh\-hook\fP provides a simple way of adding or -+removing functions from the array\&. -+.RS -+.PP -+\fIhook\fP is one of \fBchpwd\fP, \fBperiodic\fP, \fBprecmd\fP, \fBpreexec\fP, -+\fBzshaddhistory\fP, \fBzshexit\fP, or \fBzsh_directory_name\fP, -+the special functions in question\&. Note that \fBzsh_directory_name\fP -+is called in a different way from the other functions, but may -+still be manipulated as a hook\&. -+.PP -+\fIfunction\fP is name of an ordinary shell function\&. If no options -+are given this will be added to the array of functions to be executed -+in the given context\&. -+.PP -+If the option \fB\-d\fP is given, the \fIfunction\fP is removed from -+the array of functions to be executed\&. -+.PP -+If the option \fB\-D\fP is given, the \fIfunction\fP is treated as a pattern -+and any matching names of functions are removed from the array of -+functions to be executed\&. -+.PP -+The options \fB\-U\fP, \fB\-z\fP and \fB\-k\fP are passed as arguments to -+\fBautoload\fP for \fIfunction\fP\&. For functions contributed with zsh, the -+options \fB\-Uz\fP are appropriate\&. -+.RE -+.RE -+.PP -+.SH "REMEMBERING RECENT DIRECTORIES" -+.PP -+The function \fBcdr\fP allows you to change the working directory to a -+previous working directory from a list maintained automatically\&. It is -+similar in concept to the directory stack controlled by the \fBpushd\fP, -+\fBpopd\fP and \fBdirs\fP builtins, but is more configurable, and as it stores -+all entries in files it is maintained across sessions and (by default) -+between terminal emulators in the current session\&. (The \fBpushd\fP -+directory stack is not actually modified or used by \fBcdr\fP unless you -+configure it to do so as described in the configuration section below\&.) -+.PP -+.SS "Installation" -+.PP -+The system works by means of a hook function that is called every time the -+directory changes\&. To install the system, autoload the required functions -+and use the \fBadd\-zsh\-hook\fP function described above: -+.PP -+.RS -+.nf -+\fBautoload \-Uz chpwd_recent_dirs cdr add\-zsh\-hook -+add\-zsh\-hook chpwd chpwd_recent_dirs\fP -+.fi -+.RE -+.PP -+Now every time you change directly interactively, no matter which -+command you use, the directory to which you change will be remembered -+in most\-recent\-first order\&. -+.PP -+.SS "Use" -+.PP -+All direct user interaction is via the \fBcdr\fP function\&. -+.PP -+The argument to cdr is a number \fIN\fP corresponding to the \fIN\fPth most -+recently changed\-to directory\&. 1 is the immediately preceding directory; -+the current directory is remembered but is not offered as a destination\&. -+Note that if you have multiple windows open 1 may refer to a directory -+changed to in another window; you can avoid this by having per\-terminal -+files for storing directory as described for the -+\fBrecent\-dirs\-file\fP style below\&. -+.PP -+If you set the \fBrecent\-dirs\-default\fP style described below \fBcdr\fP -+will behave the same as \fBcd\fP if given a non\-numeric argument, or more -+than one argument\&. The recent directory list is updated just the same -+however you change directory\&. -+.PP -+If the argument is omitted, 1 is assumed\&. This is similar to \fBpushd\fP\&'s -+behaviour of swapping the two most recent directories on the stack\&. -+.PP -+Completion for the argument to \fBcdr\fP is available if compinit has been -+run; menu selection is recommended, using: -+.PP -+.RS -+.nf -+\fBzstyle \&':completion:*:*:cdr:*:*' menu selection\fP -+.fi -+.RE -+.PP -+to allow you to cycle through recent directories; the order is preserved, -+so the first choice is the most recent directory before the current one\&. -+The verbose style is also recommended to ensure the directory is shown; this -+style is on by default so no action is required unless you have changed it\&. -+.PP -+.SS "Options" -+.PP -+The behaviour of \fBcdr\fP may be modified by the following options\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-l\fP -+lists the numbers and the corresponding directories in -+abbreviated form (i\&.e\&. with \fB~\fP substitution reapplied), one per line\&. -+The directories here are not quoted (this would only be an issue if a -+directory name contained a newline)\&. This is used by the completion -+system\&. -+.TP -+\fB\-r\fP -+sets the variable \fBreply\fP to the current set of directories\&. Nothing -+is printed and the directory is not changed\&. -+.TP -+\fB\-e\fP -+allows you to edit the list of directories, one per line\&. The -+list can be edited to any extent you like; no sanity checking is -+performed\&. Completion is available\&. No quoting is necessary (except for -+newlines, where I have in any case no sympathy); directories are in -+unabbreviated from and contain an absolute path, i\&.e\&. they start with \fB/\fP\&. -+Usually the first entry should be left as the current directory\&. -+.PP -+.SS "Configuration" -+.PP -+Configuration is by means of the styles mechanism that should be familiar -+from completion; if not, see the description of the \fBzstyle\fP command in -+see \fIzshmodules\fP(1)\&. The context for setting styles -+should be \fB\&':chpwd:*'\fP in case the meaning of the context is extended in -+future, for example: -+.PP -+.RS -+.nf -+\fBzstyle \&':chpwd:*' recent\-dirs\-max 0\fP -+.fi -+.RE -+.PP -+sets the value of the \fBrecent\-dirs\-max\fP style to 0\&. In practice the -+style name is specific enough that a context of \&'*' should be fine\&. -+.PP -+An exception is \fBrecent\-dirs\-insert\fP, which is used exclusively by the -+completion system and so has the usual completion system context -+(\fB\&':completion:*'\fP if nothing more specific is needed), though again -+\fB\&'*'\fP should be fine in practice\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBrecent\-dirs\-default\fP -+If true, and the command is expecting a recent directory index, and -+either there is more than one argument or the argument is not an -+integer, then fall through to "cd"\&. This allows the lazy to use only -+one command for directory changing\&. Completion recognises this, too; -+see recent\-dirs\-insert for how to control completion when this option -+is in use\&. -+.TP -+\fBrecent\-dirs\-file\fP -+The file where the list of directories is saved\&. The default -+is \fB${ZDOTDIR:\-$HOME}/\&.chpwd\-recent\-dirs\fP, i\&.e\&. this is in your -+home directory unless you have set the variable \fBZDOTDIR\fP to point -+somewhere else\&. Directory names are saved in \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP quoted -+form, so each line in the file can be supplied directly to the shell as an -+argument\&. -+.RS -+.PP -+The value of this style may be an array\&. In this case, the first -+file in the list will always be used for saving directories while any -+other files are left untouched\&. When reading the recent directory -+list, if there are fewer than the maximum number of entries in the -+first file, the contents of later files in the array will be appended -+with duplicates removed from the list shown\&. The contents of the two -+files are not sorted together, i\&.e\&. all the entries in the first file -+are shown first\&. The special value \fB+\fP can appear in the list to -+indicate the default file should be read at that point\&. This allows -+effects like the following: -+.PP -+.RS -+.nf -+\fBzstyle \&':chpwd:*' recent\-dirs\-file \e -+~/\&.chpwd\-recent\-dirs\-${TTY##*/} +\fP -+.fi -+.RE -+.PP -+Recent directories are read from a file numbered according to -+the terminal\&. If there are insufficient entries the list -+is supplemented from the default file\&. -+.PP -+It is possible to use \fBzstyle \-e\fP to make the directory configurable -+at run time: -+.PP -+.RS -+.nf -+\fBzstyle \-e \&':chpwd:*' recent\-dirs\-file pick\-recent\-dirs\-file -+pick\-recent\-dirs\-file() { -+ if [[ $PWD = ~/text/writing(|/*) ]]; then -+ reply=(~/\&.chpwd\-recent\-dirs\-writing) -+ else -+ reply=(+) -+ fi -+}\fP -+.fi -+.RE -+.PP -+In this example, if the current directory is \fB~/text/writing\fP or a -+directory under it, then use a special file for saving recent -+directories, else use the default\&. -+.RE -+.TP -+\fBrecent\-dirs\-insert\fP -+Used by completion\&. If \fBrecent\-dirs\-default\fP is true, then setting -+this to \fBtrue\fP causes the actual directory, rather than its index, to -+be inserted on the command line; this has the same effect as using -+the corresponding index, but makes the history clearer and the line -+easier to edit\&. With this setting, if part of an argument was -+already typed, normal directory completion rather than recent -+directory completion is done; this is because recent directory -+completion is expected to be done by cycling through entries menu -+fashion\&. -+.RS -+.PP -+If the value of the style is \fBalways\fP, then only recent directories will -+be completed; in that case, use the \fBcd\fP command when you want to -+complete other directories\&. -+.PP -+If the value is \fBfallback\fP, recent directories will be tried first, then -+normal directory completion is performed if recent directory completion -+failed to find a match\&. -+.PP -+Finally, if the value is \fBboth\fP then both sets of completions are -+presented; the usual tag mechanism can be used to distinguish results, with -+recent directories tagged as \fBrecent\-dirs\fP\&. Note that the recent -+directories inserted are abbreviated with directory names where appropriate\&. -+.RE -+.TP -+\fBrecent\-dirs\-max\fP -+The maximum number of directories to save to the file\&. If -+this is zero or negative there is no maximum\&. The default is 20\&. -+Note this includes the current directory, which isn\&'t offered, -+so the highest number of directories you will be offered -+is one less than the maximum\&. -+.TP -+\fBrecent\-dirs\-prune\fP -+This style is an array determining what directories should (or should -+not) be added to the recent list\&. Elements of the array can include: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBparent\fP -+Prune parents (more accurately, ancestors) from the recent list\&. -+If present, changing directly down by any number of directories -+causes the current directory to be overwritten\&. For example, -+changing from ~pws to ~pws/some/other/dir causes ~pws not to be -+left on the recent directory stack\&. This only applies to direct -+changes to descendant directories; earlier directories on the -+list are not pruned\&. For example, changing from ~pws/yet/another -+to ~pws/some/other/dir does not cause ~pws to be pruned\&. -+.TP -+\fBpattern:\fIpattern\fP\fP -+Gives a zsh pattern for directories that should not be -+added to the recent list (if not already there)\&. This element -+can be repeated to add different patterns\&. For example, -+\fB\&'pattern:/tmp(|/*)'\fP stops \fB/tmp\fP or its descendants -+from being added\&. The \fBEXTENDED_GLOB\fP option is always turned on -+for these patterns\&. -+.RE -+.TP -+\fBrecent\-dirs\-pushd\fP -+If set to true, \fBcdr\fP will use \fBpushd\fP instead of \fBcd\fP to change the -+directory, so the directory is saved on the directory stack\&. As the -+directory stack is completely separate from the list of files saved -+by the mechanism used in this file there is no obvious reason to do -+this\&. -+.PP -+.SS "Use with dynamic directory naming" -+.PP -+It is possible to refer to recent directories using the dynamic directory -+name syntax by using the supplied function \fBzsh_directory_name_cdr\fP -+a hook: -+.PP -+.RS -+.nf -+\fBautoload \-Uz add\-zsh\-hook -+add\-zsh\-hook \-Uz zsh_directory_name zsh_directory_name_cdr\fP -+.fi -+.RE -+.PP -+When this is done, \fB~[1]\fP will refer to the most recent -+directory other than $PWD, and so on\&. Completion after \fB~[\fP\fI\&.\&.\&.\fP -+also works\&. -+.PP -+.SS "Details of directory handling" -+.PP -+This section is for the curious or confused; most users will not -+need to know this information\&. -+.PP -+Recent directories are saved to a file immediately and hence are -+preserved across sessions\&. Note currently no file locking is applied: -+the list is updated immediately on interactive commands and nowhere else -+(unlike history), and it is assumed you are only going to change -+directory in one window at once\&. This is not safe on shared accounts, -+but in any case the system has limited utility when someone else is -+changing to a different set of directories behind your back\&. -+.PP -+To make this a little safer, only directory changes instituted from the -+command line, either directly or indirectly through shell function calls -+(but not through subshells, evals, traps, completion functions and the -+like) are saved\&. Shell functions should use \fBcd \-q\fP or \fBpushd \-q\fP to -+avoid side effects if the change to the directory is to be invisible at the -+command line\&. See the contents of the function \fBchpwd_recent_dirs\fP for -+more details\&. -+.PP -+.SH "GATHERING INFORMATION FROM VERSION CONTROL SYSTEMS" -+.PP -+In a lot of cases, it is nice to automatically retrieve information from -+version control systems (VCSs), such as subversion, CVS or git, to be able -+to provide it to the user; possibly in the user\&'s prompt\&. So that you can -+instantly tell which branch you are currently on, for example\&. -+.PP -+In order to do that, you may use the \fBvcs_info\fP function\&. -+.PP -+The following VCSs are supported, showing the abbreviated name by which -+they are referred to within the system: -+.PD 0 -+.TP -+Bazaar (\fBbzr\fP) -+http://bazaar\-vcs\&.org/ -+.TP -+Codeville (\fBcdv\fP) -+http://codeville\&.org/ -+.TP -+Concurrent Versioning System (\fBcvs\fP) -+http://www\&.nongnu\&.org/cvs/ -+.TP -+Darcs (\fBdarcs\fP) -+http://darcs\&.net/ -+.TP -+Fossil (\fBfossil\fP) -+http://fossil\-scm\&.org/ -+.TP -+Git (\fBgit\fP) -+http://git\-scm\&.com/ -+.TP -+GNU arch (\fBtla\fP) -+http://www\&.gnu\&.org/software/gnu\-arch/ -+.TP -+Mercurial (\fBhg\fP) -+http://mercurial\&.selenic\&.com/ -+.TP -+Monotone (\fBmtn\fP) -+http://monotone\&.ca/ -+.TP -+Perforce (\fBp4\fP) -+http://www\&.perforce\&.com/ -+.TP -+Subversion (\fBsvn\fP) -+http://subversion\&.tigris\&.org/ -+.TP -+SVK (\fBsvk\fP) -+http://svk\&.bestpractical\&.com/ -+.PD -+.PP -+There is also support for the patch management system \fBquilt\fP -+(http://savannah\&.nongnu\&.org/projects/quilt)\&. See \fBQuilt Support\fP -+below for details\&. -+.PP -+To load \fIvcs_info\fP: -+.PP -+.RS -+.nf -+\fBautoload \-Uz vcs_info\fP -+.fi -+.RE -+.PP -+It can be used in any existing prompt, because it does not require any -+\fB$psvar\fP entries to be left available\&. -+.PP -+.SS "Quickstart" -+.PP -+To get this feature working quickly (including colors), you can do the -+following (assuming, you loaded \fIvcs_info\fP properly \- see above): -+.PP -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' actionformats '%F{5}(%f%s%F{5})%F{3}\-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -+zstyle \&':vcs_info:*' formats '%F{5}(%f%s%F{5})%F{3}\-%F{5}[%F{2}%b%F{5}]%f ' -+zstyle \&':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' -+precmd () { vcs_info } -+PS1=\&'%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# '\fP -+.fi -+.RE -+.PP -+Obviously, the last two lines are there for demonstration\&. You need to -+call \fIvcs_info\fP from your \fIprecmd\fP function\&. Once that is done you need -+a \fBsingle quoted\fP \fI\&'${vcs_info_msg_0_}'\fP in your prompt\&. -+.PP -+To be able to use \fI\&'${vcs_info_msg_0_}'\fP directly in your prompt like -+this, you will need to have the \fBPROMPT_SUBST\fP option enabled\&. -+.PP -+Now call the \fBvcs_info_printsys\fP utility from the command line: -+.PP -+.RS -+.nf -+\fB% vcs_info_printsys -+## list of supported version control backends: -+## disabled systems are prefixed by a hash sign (#) -+bzr -+cdv -+cvs -+darcs -+fossil -+git -+hg -+mtn -+p4 -+svk -+svn -+tla -+## flavours (cannot be used in the enable or disable styles; they -+## are enabled and disabled with their master [git\-svn \-> git]) -+## they *can* be used in contexts: \&':vcs_info:git\-svn:*'\&. -+git\-p4 -+git\-svn -+hg\-git -+hg\-hgsubversion -+hg\-hgsvn\fP -+.fi -+.RE -+.PP -+You may not want all of these because there is no point in running the -+code to detect systems you do not use\&. So there is a way to disable -+some backends altogether: -+.PP -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' disable bzr cdv darcs mtn svk tla\fP -+.fi -+.RE -+.PP -+You may also pick a few from that list and enable only those: -+.PP -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' enable git cvs svn\fP -+.fi -+.RE -+.PP -+If you rerun \fBvcs_info_printsys\fP after one of these commands, you will -+see the backends listed in the \fIdisable\fP style (or backends not in the -+\fIenable\fP style \- if you used that) marked as disabled by a hash sign\&. -+That means the detection of these systems is skipped \fBcompletely\fP\&. No -+wasted time there\&. -+.PP -+.SS "Configuration" -+.PP -+The \fIvcs_info\fP feature can be configured via \fIzstyle\fP\&. -+.PP -+First, the context in which we are working: -+.RS -+.nf -+\fB:vcs_info:::\fP -+.fi -+.RE -+.PP -+.PD 0 -+.TP -+.PD -+\fB\fP -+is one of: git, git\-svn, git\-p4, hg, hg\-git, hg\-hgsubversion, hg\-hgsvn, -+darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil\&. When hooks are -+active the hooks name is added after a `+\&'\&. (See \fBHooks in vcs_info\fP -+below\&.) -+.TP -+\fB\fP -+is a freely configurable string, assignable by -+the user as the first argument to \fIvcs_info\fP (see its description -+below)\&. -+.TP -+\fB\fP -+is the name of a repository in which you want a -+style to match\&. So, if you want a setting specific to \fI/usr/src/zsh\fP, -+with that being a CVS checkout, you can set \fB\fP to -+\fIzsh\fP to make it so\&. -+.PP -+There are three special values for \fB\fP: The first is named -+\fI\-init\-\fP, that is in effect as long as there was no decision what VCS -+backend to use\&. The second is \fI\-preinit\-\fP; it is used \fBbefore\fP -+\fIvcs_info\fP is run, when initializing the data exporting variables\&. The -+third special value is \fIformats\fP and is used by the \fBvcs_info_lastmsg\fP -+for looking up its styles\&. -+.PP -+The initial value of \fB\fP is \fI\-all\-\fP and it is replaced -+with the actual name, as soon as it is known\&. Only use this part of the -+context for defining the \fIformats\fP, \fIactionformats\fP or -+\fIbranchformat\fP styles, as it is guaranteed that \fB\fP is -+set up correctly for these only\&. For all other styles, just use \fB\&'*'\fP -+instead\&. -+.PP -+There are two pre\-defined values for \fB\fP: -+.PD 0 -+.TP -+\fBdefault\fP -+the one used if none is specified -+.TP -+\fBcommand\fP -+used by vcs_info_lastmsg to lookup its styles -+.PD -+.PP -+You can of course use \fB\&':vcs_info:*'\fP to match all VCSs in all -+user\-contexts at once\&. -+.PP -+This is a description of all styles that are looked up\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBformats\fP -+A list of formats, used when actionformats is not used -+(which is most of the time)\&. -+.TP -+\fBactionformats\fP -+A list of formats, used if there is a special -+action going on in your current repository; like an interactive rebase or -+a merge conflict\&. -+.TP -+\fBbranchformat\fP -+Some backends replace \fI%b\fP in the formats and -+actionformats styles above, not only by a branch name but also by a -+revision number\&. This style lets you modify how that string should look\&. -+.TP -+\fBnvcsformats\fP -+These "formats" are exported when we didn\&'t detect a version control system -+for the current directory or \fIvcs_info\fP was disabled\&. This is useful if -+you want \fIvcs_info\fP to completely take over the generation of your -+prompt\&. You would do something like \fBPS1=\&'${vcs_info_msg_0_}'\fP to -+accomplish that\&. -+.TP -+\fBhgrevformat\fP -+\fBhg\fP uses both a hash and a revision number to reference a specific -+changeset in a repository\&. With this style you can format the revision -+string (see \fIbranchformat\fP) to include either or both\&. It\&'s only -+useful when \fIget\-revision\fP is true\&. -+.TP -+\fBmax\-exports\fP -+Defines the maximum number of -+\fIvcs_info_msg_*_\fP variables \fIvcs_info\fP will export\&. -+.TP -+\fBenable\fP -+A list of backends you want to use\&. Checked in the \fI\-init\-\fP context\&. If -+this list contains an item called \fBNONE\fP no backend is used at all and -+\fIvcs_info\fP will do nothing\&. If this list contains \fBALL\fP \fIvcs_info\fP -+will use all known backends\&. Only with \fBALL\fP in \fBenable\fP will the -+\fBdisable\fP style have any effect\&. \fBALL\fP and \fBNONE\fP are case insensitive\&. -+.TP -+\fBdisable\fP -+A list of VCSs you don\&'t want \fIvcs_info\fP to test for -+repositories (checked in the \fI\-init\-\fP context, too)\&. Only used if -+\fBenable\fP contains \fBALL\fP\&. -+.TP -+\fBdisable\-patterns\fP -+A list of patterns that are checked against \fB$PWD\fP\&. If a pattern -+matches, \fIvcs_info\fP will be disabled\&. This style is checked in the -+\fI:vcs_info:\-init\-:*:\-all\-\fP context\&. -+.RS -+.PP -+Say, \fB~/\&.zsh\fP is a directory under version control, in which you do -+not want \fIvcs_info\fP to be active, do: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' disable\-patterns "$HOME/\&.zsh(|/*)"\fP -+.fi -+.RE -+.RE -+.TP -+\fBuse\-quilt\fP -+If enabled, the \fBquilt\fP support code is active in `addon\&' mode\&. -+See \fBQuilt Support\fP for details\&. -+.TP -+\fBquilt\-standalone\fP -+If enabled, `standalone\&' mode detection is attempted if no VCS is active -+in a given directory\&. See \fBQuilt Support\fP for details\&. -+.TP -+\fBquilt\-patch\-dir\fP -+Overwrite the value of the \fI$QUILT_PATCHES\fP environment variable\&. See -+\fBQuilt Support\fP for details\&. -+.TP -+\fBquiltcommand\fP -+When \fBquilt\fP itself is called in quilt support the value of this style -+is used as the command name\&. -+.TP -+\fBcheck\-for\-changes\fP -+If enabled, this style causes the \fB%c\fP and \fB%u\fP format escapes to show -+when the working directory has uncommitted changes\&. The strings displayed by -+these escapes can be controlled via the \fIstagedstr\fP and \fIunstagedstr\fP -+styles\&. The only backends that currently support this option are \fBgit\fP and -+\fBhg\fP (\fBhg\fP only supports unstaged)\&. -+.RS -+.PP -+Note, the actions taken if this style is enabled are potentially expensive -+(read: they may be slow, depending on how big the current repository is)\&. -+Therefore, it is disabled by default\&. -+.RE -+.TP -+\fBstagedstr\fP -+This string will be used in the \fB%c\fP escape if there are staged changes in -+the repository\&. -+.TP -+\fBunstagedstr\fP -+This string will be used in the \fB%u\fP escape if there are unstaged changes -+in the repository\&. -+.TP -+\fBcommand\fP -+This style causes \fIvcs_info\fP to use the supplied string as the command -+to use as the VCS\&'s binary\&. Note, that setting this in ':vcs_info:*' is -+not a good idea\&. -+.RS -+.PP -+If the value of this style is empty (which is the default), the used binary -+name is the name of the backend in use (e\&.g\&. \fIsvn\fP is used in an \fIsvn\fP -+repository)\&. -+.PP -+The \fIrepo\-root\-name\fP part in the context is always the default \fB\-all\-\fP -+when this style is looked up\&. -+.PP -+For example, this style can be used to use binaries from non\-default -+installation directories\&. Assume, \fIgit\fP is installed in /usr/bin but -+your sysadmin installed a newer version in /usr/bin/local\&. Instead of -+changing the order of your \fB$PATH\fP parameter, you can do this: -+.RS -+.nf -+\fBzstyle \&':vcs_info:git:*:\-all\-' command /usr/local/bin/git\fP -+.fi -+.RE -+.RE -+.TP -+\fBuse\-server\fP -+This is used by the Perforce backend (\fBp4\fP) to decide if it should -+contact the Perforce server to find out if a directory is managed -+by Perforce\&. This is the only reliable way of doing this, but runs -+the risk of a delay if the server name cannot be found\&. If the -+server (more specifically, the \fIhost\fP\fB:\fP\fIport\fP pair describing the -+server) cannot be contacted, its name is put into the associative array -+\fBvcs_info_p4_dead_servers\fP and is not contacted again during the session -+until it is removed by hand\&. If you do not set this style, the \fBp4\fP -+backend is only usable if you have set the environment variable -+\fBP4CONFIG\fP to a file name and have corresponding files in the root -+directories of each Perforce client\&. See comments in the function -+\fBVCS_INFO_detect_p4\fP for more detail\&. -+.TP -+\fBuse\-simple\fP -+If there are two different ways of gathering -+information, you can select the simpler one by setting this style to true; -+the default is to use the not\-that\-simple code, which is potentially a lot -+slower but might be more accurate in all possible cases\&. This style is -+used by the \fBbzr\fP and \fBhg\fP backends\&. In the case of \fBhg\fP it will invoke -+the external hexdump program to parse the binary dirstate cache file; this -+method will not return the local revision number\&. -+.TP -+\fBget\-revision\fP -+If set to true, vcs_info goes the extra mile to figure out the revision of -+a repository\&'s work tree (currently for the \fBgit\fP and \fBhg\fP backends, -+where this kind of information is not always vital)\&. For \fBgit\fP, the -+hash value of the currently checked out commit is available via the \fB%i\fP -+expansion\&. With \fBhg\fP, the local revision number and the corresponding -+global hash are available via \fB%i\fP\&. -+.TP -+\fBget\-mq\fP -+If set to true, the \fBhg\fP backend will look for a Mercurial Queue (\fBmq\fP) -+patch directory\&. Information will be available via the `\fB%m\fP\&' replacement\&. -+.TP -+\fBget\-bookmarks\fP -+If set to true, the \fBhg\fP backend will try to get a list of current -+bookmarks\&. They will be available via the `\fB%m\fP\&' replacement\&. -+.TP -+\fBuse\-prompt\-escapes\fP -+Determines if we assume that the assembled -+string from \fIvcs_info\fP includes prompt escapes\&. (Used by -+\fBvcs_info_lastmsg\fP\&.) -+.TP -+\fBdebug\fP -+Enable debugging output to track possible problems\&. Currently this style -+is only used by \fIvcs_info\fP\&'s hooks system\&. -+.TP -+\fBhooks\fP -+A list style that defines hook\-function names\&. See \fBHooks in vcs_info\fP -+below for details\&. -+.PP -+The default values for these styles in all contexts are: -+.PP -+.PD 0 -+.TP -+\fBformats\fP -+" (%s)\-[%b]%u%c\-" -+.TP -+\fBactionformats\fP -+" (%s)\-[%b|%a]%u%c\-" -+.TP -+\fBbranchformat\fP -+"%b:%r" (for bzr, svn, svk and hg) -+.TP -+\fBnvcsformats\fP -+"" -+.TP -+\fBhgrevformat\fP -+"%r:%h" -+.TP -+\fBmax\-exports\fP -+2 -+.TP -+\fBenable\fP -+ALL -+.TP -+\fBdisable\fP -+(empty list) -+.TP -+\fBdisable\-patterns\fP -+(empty list) -+.TP -+\fBcheck\-for\-changes\fP -+false -+.TP -+\fBstagedstr\fP -+(string: "S") -+.TP -+\fBunstagedstr\fP -+(string: "U") -+.TP -+\fBcommand\fP -+(empty string) -+.TP -+\fBuse\-server\fP -+false -+.TP -+\fBuse\-simple\fP -+false -+.TP -+\fBget\-revision\fP -+false -+.TP -+\fBget\-mq\fP -+true -+.TP -+\fBget\-bookmarks\fP -+false -+.TP -+\fBuse\-prompt\-escapes\fP -+true -+.TP -+\fBdebug\fP -+false -+.TP -+\fBhooks\fP -+(empty list) -+.TP -+\fBuse\-quilt\fP -+false -+.TP -+\fBquilt\-standalone\fP -+false -+.TP -+\fBquilt\-patch\-dir\fP -+empty \- use \fI$QUILT_PATCHES\fP -+.TP -+\fBquiltcommand\fP -+quilt -+.PD -+.PP -+In normal \fBformats\fP and \fBactionformats\fP the following replacements are -+done: -+.PP -+.PD 0 -+.TP -+\fB%s\fP -+The VCS in use (git, hg, svn, etc\&.)\&. -+.TP -+\fB%b\fP -+Information about the current branch\&. -+.TP -+\fB%a\fP -+An identifier that describes the action\&. Only makes sense in -+\fIactionformats\fP\&. -+.TP -+\fB%i\fP -+The current revision number or identifier\&. For \fBhg\fP -+the \fIhgrevformat\fP style may be used to customize the output\&. -+.TP -+\fB%c\fP -+The string from the \fIstagedstr\fP style if there are staged -+changes in the repository\&. -+.TP -+\fB%u\fP -+The string from the \fIunstagedstr\fP style if there are -+unstaged changes in the repository\&. -+.TP -+\fB%R\fP -+The base directory of the repository\&. -+.TP -+\fB%r\fP -+The repository name\&. If \fB%R\fP is \fI/foo/bar/repoXY\fP, \fB%r\fP -+is \fIrepoXY\fP\&. -+.TP -+\fB%S\fP -+A subdirectory within a repository\&. If \fB$PWD\fP is -+\fI/foo/bar/repoXY/beer/tasty\fP, \fB%S\fP is \fIbeer/tasty\fP\&. -+.TP -+\fB%m\fP -+A "misc" replacement\&. It is at the discretion of the backend to -+decide what this replacement expands to\&. It is currently used by the \fBhg\fP -+and \fBgit\fP backends to display patch information from the \fBmq\fP and -+\fBstgit\fP extensions\&. -+.PD -+.PP -+In \fBbranchformat\fP these replacements are done: -+.PP -+.PD 0 -+.TP -+\fB%b\fP -+The branch name\&. -+.TP -+\fB%r\fP -+The current revision number or the \fIhgrevformat\fP style for -+\fBhg\fP\&. -+.PD -+.PP -+In \fBhgrevformat\fP these replacements are done: -+.PP -+.PD 0 -+.TP -+\fB%r\fP -+The current local revision number\&. -+.TP -+\fB%h\fP -+The current 40\-character changeset ID hash identifier\&. -+.PD -+.PP -+In \fBpatch\-format\fP and \fBnopatch\-format\fP these replacements are done: -+.PP -+.PD 0 -+.TP -+\fB%p\fP -+The name of the top\-most applied patch\&. -+.TP -+\fB%u\fP -+The number of unapplied patches\&. -+.TP -+\fB%n\fP -+The number of applied patches\&. -+.TP -+\fB%c\fP -+The number of unapplied patches\&. -+.TP -+\fB%g\fP -+The names of active \fBmq\fP guards (\fBhg\fP backend)\&. -+.TP -+\fB%G\fP -+The number of active \fBmq\fP guards (\fBhg\fP backend)\&. -+.PD -+.PP -+Not all VCS backends have to support all replacements\&. For \fBnvcsformats\fP -+no replacements are performed at all, it is just a string\&. -+.PP -+.SS "Oddities" -+.PP -+If you want to use the \fB%b\fP (bold off) prompt expansion in \fIformats\fP, -+which expands \fB%b\fP itself, use \fB%%b\fP\&. That will cause the \fIvcs_info\fP -+expansion to replace \fB%%b\fP with \fB%b\fP, so that zsh\&'s prompt expansion -+mechanism can handle it\&. Similarly, to hand down \fB%b\fP from -+\fIbranchformat\fP, use \fB%%%%b\fP\&. Sorry for this inconvenience, but it -+cannot be easily avoided\&. Luckily we do not clash with a lot of prompt -+expansions and this only needs to be done for those\&. -+.PP -+.SS "Quilt Support" -+.PP -+\fBQuilt\fP is not a version control system, therefore this is not implemented -+as a backend\&. It can help keeping track of a series of patches\&. People use it -+to keep a set of changes they want to use on top of software packages (which -+is tightly integrated into the package build process \- the Debian project -+does this for a large number of packages)\&. Quilt can also help individual -+developers keep track of their own patches on top of real version control -+systems\&. -+.PP -+The \fIvcs_info\fP integration tries to support both ways of using quilt by -+having two slightly different modes of operation: `addon\&' mode and -+`standalone\&' mode)\&. -+.PP -+For `addon\&' mode to become active \fIvcs_info\fP must have already detected a -+real version control system controlling the directory\&. If that is the case, -+a directory that holds quilt\&'s patches needs to be found\&. That directory is -+configurable via the \fI`QUILT_PATCHES\&'\fP environment variable\&. If that -+variable exists its value is used, otherwise the value \fB`patches\&'\fP is -+assumed\&. The value from \fI$QUILT_PATCHES\fP can be overwritten using the -+\fB`quilt\-patches\&'\fP style\&. (Note: you can use \fIvcs_info\fP to keep the value -+of \fI$QUILT_PATCHES\fP correct all the time via the \fBpost\-quilt\fP hook)\&. -+.PP -+When the directory in question is found, quilt is assumed to be active\&. To -+gather more information, \fIvcs_info\fP looks for a directory called `\&.pc\&'; -+Quilt uses that directory to track its current state\&. If this directory does -+not exist we know that quilt has not done anything to the working directory -+(read: no patches have been applied yet)\&. -+.PP -+If patches are applied, \fIvcs_info\fP will try to find out which\&. If you want -+to know which patches of a series are not yet applied, you need to activate -+the \fBget\-unapplied\fP style in the appropriate context\&. -+.PP -+\fIvcs_info\fP allows for very detailed control over how the gathered -+information is presented (see the below sections, \fBStyles\fP and \fBHooks in -+vcs_info\fP), all of which are documented below\&. Note there are a number of -+other patch tracking systems that work on top of a certain version control -+system (like \fBstgit\fP for \fBgit\fP, or \fBmq\fP for \fBhg\fP); the configuration -+for systems like that are generally configured the same way as the \fBquilt\fP -+support\&. -+.PP -+If the \fBquilt\fP support is working in `addon\&' mode, the produced string is -+available as a simple format replacement (\fI%Q\fP to be precise), which can -+be used in \fBformats\fP and \fBactionformats\fP; see below for details)\&. -+.PP -+If, on the other hand, the support code is working in `standalone\&' mode, -+\fIvcs_info\fP will pretend as if \fBquilt\fP were an actual version control -+system\&. That means that the version control system identifier (which -+otherwise would be something like `svn\&' or `cvs') will be set to -+`\fB\-quilt\-\fP\&'\&. This has implications on the used style context where this -+identifier is the second element\&. \fIvcs_info\fP will have filled in a proper -+value for the "repository\&'s" root directory and the string containing the -+information about quilt\&'s state will be available as the `misc' replacement -+(and \fI%Q\fP for compatibility with `addon\&' mode\&. -+.PP -+What is left to discuss is how `standalone\&' mode is detected\&. The detection -+itself is a series of searches for directories\&. You can have this detection -+enabled all the time in every directory that is not otherwise under version -+control\&. If you know there is only a limited set of trees where you would -+like \fIvcs_info\fP to try and look for Quilt in `standalone\&' mode to minimise -+the amount of searching on every call to \fIvcs_info\fP, there are a number of -+ways to do that: -+.PP -+Essentially, `standalone\&' mode detection is controlled by a style called -+`\fBquilt\-standalone\fP\&'\&. It is a string style and its value can have different -+effects\&. The simplest values are: `\fBalways\fP\&' to run detection every time -+\fIvcs_info\fP is run, and `\fBnever\fP\&' to turn the detection off entirely\&. -+.PP -+If the value of \fBquilt\-standalone\fP is something else, it is interpreted -+differently\&. If the value is the name of a scalar variable the value of that -+variable is checked and that value is used in the same `always\&'/`never' way -+as described above\&. -+.PP -+If the value of \fBquilt\-standalone\fP is an array, the elements of that array -+are used as directory names under which you want the detection to be active\&. -+.PP -+If \fBquilt\-standalone\fP is an associative array, the keys are taken as -+directory names under which you want the detection to be active, but only if -+the corresponding value is the string `\fBtrue\fP\&'\&. -+.PP -+Last, but not least, if the value of \fBquilt\-standalone\fP is the name of a -+function, the function is called without arguments and the return value -+decides whether detection should be active\&. A `0\&' return value is true; a -+non\-zero return value is interpreted as false\&. -+.PP -+Note, if there is both a function and a variable by the name of -+\fBquilt\-standalone\fP, the function will take precedence\&. -+.PP -+.SS "Function Descriptions (Public API)" -+.PP -+.PD 0 -+.TP -+.PD -+\fBvcs_info\fP [\fIuser\-context\fP] -+The main function, that runs all backends and assembles all data into -+\fI${vcs_info_msg_*_}\fP\&. This is the function you want to call from -+\fBprecmd\fP if you want to include up\-to\-date information in your prompt (see -+\fBVariable description\fP below)\&. If an argument is given, that string will be -+used instead of \fBdefault\fP in the \fBuser\-context\fP field of the style -+context\&. -+.TP -+\fBvcs_info_hookadd\fP -+Statically registers a number of functions to a given hook\&. The hook needs -+to be given as the first argument; what follows is a list of hook\-function -+names to register to the hook\&. The `\fB+vi\-\fP\&' prefix needs to be left out -+here\&. See \fBHooks in vcs_info\fP below for details\&. -+.TP -+\fBvcs_info_hookdel\fP -+Remove hook\-functions from a given hook\&. The hook needs to be given as the -+first non\-option argument; what follows is a list of hook\-function -+names to un\-register from the hook\&. If `\fB\-a\fP\&' is used as the first -+argument, \fBall\fP occurances of the functions are unregistered\&. Otherwise -+only the last occurance is removed (if a function was registered to a hook -+more than once) \&. The `\fB+vi\-\fP\&' prefix needs to be left out here\&. See -+\fBHooks in vcs_info\fP below for details\&. -+.TP -+\fBvcs_info_lastmsg\fP -+Outputs the last \fI${vcs_info_msg_*_}\fP value\&. -+Takes into account the value of the \fBuse\-prompt\-escapes\fP style in -+\fI\&':vcs_info:formats:command:\-all\-'\fP\&. It also only prints \fBmax\-exports\fP -+values\&. -+.TP -+\fBvcs_info_printsys\fP [\fIuser\-context\fP] -+Prints a list of all -+supported version control systems\&. Useful to find out possible contexts -+(and which of them are enabled) or values for the \fIdisable\fP style\&. -+.TP -+\fBvcs_info_setsys\fP -+Initializes \fIvcs_info\fP\&'s internal list of -+available backends\&. With this function, you can add support for new VCSs -+without restarting the shell\&. -+.PP -+All functions named VCS_INFO_* are for internal use only\&. -+.PP -+.SS "Variable Description" -+.PP -+.PD 0 -+.TP -+.PD -+\fB${vcs_info_msg_N_}\fP (Note the trailing underscore) -+Where \fIN\fP is an integer, e\&.g\&., \fIvcs_info_msg_0_\fP\&. These variables -+are the storage for the informational message the last \fIvcs_info\fP call -+has assembled\&. These are strongly connected to the \fBformats\fP, -+\fBactionformats\fP and \fBnvcsformats\fP styles described above\&. Those styles -+are lists\&. The first member of that list gets expanded into -+\fI${vcs_info_msg_0_}\fP, the second into \fI${vcs_info_msg_1_}\fP -+and the Nth into \fI${vcs_info_msg_N\-1_}\fP\&. These parameters are -+exported into the environment\&. (See the \fBmax\-exports\fP style above\&.) -+.PP -+All variables named VCS_INFO_* are for internal use only\&. -+.PP -+.SS "Hooks in vcs_info" -+.PP -+Hooks are places in \fIvcs_info\fP where you can run your own code\&. That -+code can communicate with the code that called it and through that, -+change the system\&'s behaviour\&. -+.PP -+For configuration, hooks change the style context: -+.RS -+.nf -+\fB:vcs_info:+::\fP -+.fi -+.RE -+.PP -+To register functions to a hook, you need to list them in the \fBhooks\fP -+style in the appropriate context\&. -+.PP -+Example: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*+foo:*' hooks bar baz\fP -+.fi -+.RE -+.PP -+This registers functions to the hook `foo\&' for all backends\&. In order to -+avoid namespace problems, all registered function names are prepended by -+a `+vi\-\&', so the actual functions called for the `foo' hook are -+`\fB+vi\-bar\fP\&' and `\fB+vi\-baz\fP'\&. -+.PP -+If you would like to register a function to a hook regardless of the -+current context, you may use the \fIvcs_info_hookadd\fP function\&. To remove -+a function that was added like that, the \fIvcs_info_hookdel\fP function -+can be used\&. -+.PP -+If something seems weird, you can enable the `debug\&' boolean style in -+the proper context and the hook\-calling code will print what it tried -+to execute and whether the function in question existed\&. -+.PP -+When you register more than one function to a hook, all functions are -+executed one after another until one function returns non\-zero or until -+all functions have been called\&. Context\-sensitive hook functions are -+executed \fBbefore\fP statically registered ones (the ones added by -+\fIvcs_info_hookadd\fP)\&. -+.PP -+You may pass data between functions via an associative array, \fBuser_data\fP\&. -+For example: -+.RS -+.nf -+\fB -++vi\-git\-myfirsthook(){ -+ user_data[myval]=$myval -+} -++vi\-git\-mysecondhook(){ -+ # do something with ${user_data[myval]} -+}\fP -+.fi -+.RE -+.PP -+There are a number of variables that are special in hook contexts: -+.PP -+.PD 0 -+.TP -+.PD -+\fBret\fP -+The return value that the hooks system will return to the caller\&. The -+default is an integer `zero\&'\&. If and how a changed \fBret\fP value changes -+the execution of the caller depends on the specific hook\&. See the hook -+documentation below for details\&. -+.TP -+\fBhook_com\fP -+An associated array which is used for bidirectional communication from -+the caller to hook functions\&. The used keys depend on the specific hook\&. -+.TP -+\fBcontext\fP -+The active context of the hook\&. Functions that wish to change this -+variable should make it local scope first\&. -+.TP -+\fBvcs\fP -+The current VCS after it was detected\&. The same values as in the -+enable/disable style are used\&. Available in all hooks except \fBstart\-up\fP\&. -+.PP -+Finally, the full list of currently available hooks: -+.PP -+.PD 0 -+.TP -+.PD -+\fBstart\-up\fP -+Called after starting \fIvcs_info\fP but before the VCS in this directory is -+determined\&. It can be used to deactivate \fIvcs_info\fP temporarily if -+necessary\&. When \fBret\fP is set to \fI1\fP, \fIvcs_info\fP aborts and does -+nothing; when set to \fI2\fP, \fIvcs_info\fP sets up everything as if no -+version control were active and exits\&. -+.TP -+\fBpre\-get\-data\fP -+Same as \fBstart\-up\fP but after the VCS was detected\&. -+.TP -+\fBgen\-hg\-bookmark\-string\fP -+Called in the Mercurial backend when a bookmark string is generated; the -+\fBget\-revision\fP and \fBget\-bookmarks\fP styles must be true\&. -+.RS -+.PP -+This hook gets the names of the Mercurial bookmarks that -+\fIvcs_info\fP collected from `hg\&'\&. -+.PP -+When setting \fBret\fP to non\-zero, the string in -+\fB${hook_com[hg\-bookmark\-string]}\fP will be used in the \fI%m\fP escape in -+\fBformats\fP and \fBactionformats\fP and will be availabe in the global -+\fIbackend_misc\fP array as \fB${backend_misc[bookmarks]}\fP\&. -+.RE -+.TP -+\fBgen\-applied\-string\fP -+Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backends -+and in \fBquilt\fP support when the \fIapplied\-string\fP is generated; the -+\fBuse\-quilt\fP zstyle must be true for \fBquilt\fP (the \fBmq\fP and \fBstgit\fP -+backends are active by default)\&. -+.RS -+.PP -+This hook gets the names of all applied patches which \fIvcs_info\fP collected -+so far in the opposite order, which means that the first argument is the -+top\-most patch and so forth\&. -+.PP -+When setting \fBret\fP to non\-zero, the string in -+\fB${hook_com[applied\-string]}\fP will be used in the \fI%m\fP escape in -+\fBformats\fP and \fBactionformats\fP; it will be available in the global -+\fIbackend_misc\fP array as \fB$backend_misc[patches]}\fP; and it will be -+available as \fI%p\fP in the \fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. -+.RE -+.TP -+\fBgen\-unapplied\-string\fP -+Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backend -+and in \fBquilt\fP support when the \fIunapplied\-string\fP is generated; the -+\fBget\-unapplied\fP style must be true\&. -+.RS -+.PP -+This hook gets the names of all unapplied patches which \fIvcs_info\fP -+collected so far in the opposite order, which mean that the first argument is -+the patch next\-in\-line to be applied and so forth\&. -+.PP -+When setting \fBret\fP to non\-zero, the string in -+\fB${hook_com[unapplied\-string]}\fP will be available as \fI%u\fP in the -+\fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. -+.RE -+.TP -+\fBgen\-mqguards\-string\fP -+Called in the \fBhg\fP backend when \fBguards\-string\fP is generated; the -+\fBget\-mq\fP style must be true (default)\&. -+.RS -+.PP -+This hook gets the names of any active \fBmq\fP guards\&. -+.PP -+When setting \fBret\fP to non\-zero, the string in -+\fB${hook_com[guards\-string]}\fP will be used in the \fI%g\fP escape in the -+\fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. -+.RE -+.TP -+\fBno\-vcs\fP -+This hooks is called when no version control system was detected\&. -+.RS -+.PP -+The `hook_com\&' parameter is not used\&. -+.RE -+.TP -+\fBpost\-quilt\fP -+Called after the \fBquilt\fP support is done\&. The following information -+is passed as arguments to the hook: 1\&. the quilt\-support mode (`addon\&' or -+`standalone\&'); 2\&. the directory that contains the patch series; 3\&. the -+directory that holds quilt\&'s status information (the `\&.pc' directory) or -+the string \fB"\-nopc\-"\fP if that directory wasn\&'t found\&. -+.RS -+.PP -+The `hook_com\&' parameter is not used\&. -+.RE -+.TP -+\fBset\-branch\-format\fP -+Called before `\fBbranchformat\fP\&' is set\&. The only argument to the -+hook is the format that is configured at this point\&. -+.RS -+.PP -+The `\fBhook_com\fP\&' keys considered are `\fBbranch\fP' and `\fBrevision\fP'\&. -+They are set to the values figured out so far by \fIvcs_info\fP and any -+change will be used directly when the actual replacement is done\&. -+.PP -+If \fBret\fP is set to to non\-zero, the string in -+\fB${hook_com[branch\-replace]}\fP will be used unchanged as the -+`\fB%b\fP\&' replacement in the variables set by \fIvcs_info\fP\&. -+.RE -+.TP -+\fBset\-hgrev\-format\fP -+Called before a `\fBhgrevformat\fP\&' is set\&. The only argument to the -+hook is the format that is configured at this point\&. -+.RS -+.PP -+The `\fBhook_com\fP\&' keys considered are `\fBhash\fP' and `\fBlocalrev\fP'\&. -+They are set to the values figured out so far by \fIvcs_info\fP and any -+change will be used directly when the actual replacement is done\&. -+.PP -+If \fBret\fP is set to to non\-zero, the string in -+\fB${hook_com[rev\-replace]}\fP will be used unchanged as the -+`\fB%i\fP\&' replacement in the variables set by \fIvcs_info\fP\&. -+.RE -+.TP -+\fBset\-message\fP -+Called each time before a `\fBvcs_info_msg_N_\fP\&' message is set\&. -+It takes two arguments; the first being the `N\&' in the message -+variable name, the second is the currently configured \fBformats\fP or -+\fBactionformats\fP\&. -+.RS -+.PP -+There are a number of `\fBhook_com\fP\&' keys, that are used here: -+`\fBaction\fP\&', `\fBbranch\fP', `\fBbase\fP', `\fBbase\-name\fP', `\fBsubdir\fP', -+`\fBstaged\fP\&', `\fBunstaged\fP', `\fBrevision\fP', `\fBmisc\fP', `\fBvcs\fP' -+and one `\fBmiscN\fP\&' entry for each backend\-specific data field (\fBN\fP -+starting at zero)\&. They are set to the values figured out so far by -+\fIvcs_info\fP and any change will be used directly when the actual -+replacement is done\&. -+.PP -+Since this hook is triggered multiple times (once for each configured -+\fBformats\fP or \fBactionformats\fP), each of the `\fBhook_com\fP\&' keys mentioned -+above (except for the \fBmiscN\fP entries) has an `\fB_orig\fP\&' counterpart, -+so even if you changed a value to your liking you can still get the -+original value in the next run\&. Changing the `\fB_orig\fP\&' values is -+probably not a good idea\&. -+.PP -+If \fBret\fP is set to to non\-zero, the string in -+\fB${hook_com[message]}\fP will be used unchanged as the message by -+\fIvcs_info\fP\&. -+.RE -+.RE -+.PP -+If all of this sounds rather confusing, take a look at the \fBExamples\fP -+section below and also in the Misc/vcs_info\-examples file in the Zsh source\&. -+They contain some explanatory code\&. -+.PP -+.SS "Examples" -+.PP -+Don\&'t use \fIvcs_info\fP at all (even though it's in your prompt): -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' enable NONE\fP -+.fi -+.RE -+.PP -+Disable the backends for \fBbzr\fP and \fBsvk\fP: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' disable bzr svk\fP -+.fi -+.RE -+.PP -+Disable everything \fIbut\fP \fBbzr\fP and \fBsvk\fP: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*' enable bzr svk\fP -+.fi -+.RE -+.PP -+Provide a special formats for \fBgit\fP: -+.RS -+.nf -+\fBzstyle \&':vcs_info:git:*' formats ' GIT, BABY! [%b]' -+zstyle \&':vcs_info:git:*' actionformats ' GIT ACTION! [%b|%a]'\fP -+.fi -+.RE -+.PP -+All \fB%x\fP expansion in all sorts of formats ("formats", "actionformats", -+branchformat, you name it) are done using the `\fBzformat\fP\&' builtin from -+the `\fBzsh/zutil\fP\&' module\&. That means you can do everything with these -+\fB%x\fP items what zformat supports\&. In particular, if you want something -+that is really long to have a fixed width, like a hash in a mercurial -+branchformat, you can do this: \fB%12\&.12i\fP\&. That\&'ll shrink the 40 character -+hash to its 12 leading characters\&. The form is actually -+`\fB%\fP\fImin\fP\fB\&.\fP\fImax\fP\fBx\fP\&'\&. More is possible\&. -+See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1) for details\&. -+.PP -+Use the quicker \fBbzr\fP backend -+.RS -+.nf -+\fBzstyle \&':vcs_info:bzr:*' use\-simple true\fP -+.fi -+.RE -+.PP -+If you do use \fBuse\-simple\fP, please report if it does `the\-right\-thing[tm]\&'\&. -+.PP -+Display the revision number in yellow for \fBbzr\fP and \fBsvn\fP: -+.RS -+.nf -+\fBzstyle \&':vcs_info:(svn|bzr):*' branchformat '%b%{'${fg[yellow]}'%}:%r'\fP -+.fi -+.RE -+.PP -+If you want colors, make sure you enclose the color codes in \fB%{\&.\&.\&.%}\fP -+if you want to use the string provided by \fIvcs_info\fP in prompts\&. -+.PP -+Here is how to print the VCS information as a command (not in a prompt): -+.RS -+.nf -+\fBalias vcsi=\&'vcs_info command; vcs_info_lastmsg'\fP -+.fi -+.RE -+.PP -+This way, you can even define different formats for output via -+\fBvcs_info_lastmsg\fP in the \&':vcs_info:*:command:*' namespace\&. -+.PP -+Now as promised, some code that uses hooks: -+say, you\&'d like to replace the string `svn' by `subversion' in -+\fIvcs_info\fP\&'s \fB%s\fP \fBformats\fP replacement\&. -+.PP -+First, we will tell \fIvcs_info\fP to call a function when populating -+the message variables with the gathered information: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*+set\-message:*' hooks svn2subversion\fP -+.fi -+.RE -+.PP -+Nothing happens\&. Which is reasonable, since we didn\&'t define the actual -+function yet\&. To see what the hooks subsystem is trying to do, enable the -+`\fBdebug\fP\&' style: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*+*:*' debug true\fP -+.fi -+.RE -+.PP -+That should give you an idea what is going on\&. Specifically, the function -+that we are looking for is `\fB+vi\-svn2subversion\fP\&'\&. Note, the `\fB+vi\-\fP' -+prefix\&. So, everything is in order, just as documented\&. When you are done -+checking out the debugging output, disable it again: -+.RS -+.nf -+\fBzstyle \&':vcs_info:*+*:*' debug false\fP -+.fi -+.RE -+.PP -+Now, let\&'s define the function: -+.RS -+.nf -+\fB -+function +vi\-svn2subversion() { -+ [[ ${hook_com[vcs_orig]} == svn ]] && hook_com[vcs]=subversion -+}\fP -+.fi -+.RE -+.PP -+Simple enough\&. And it could have even been simpler, if only we had -+registered our function in a less generic context\&. If we do it only in -+the `\fBsvn\fP\&' backend's context, we don't need to test which the active -+backend is: -+.RS -+.nf -+\fBzstyle \&':vcs_info:svn+set\-message:*' hooks svn2subversion\fP -+.fi -+.RE -+.RS -+.nf -+\fB -+function +vi\-svn2subversion() { -+ hook_com[vcs]=subversion -+}\fP -+.fi -+.RE -+.PP -+And finally a little more elaborate example, that uses a hook to create -+a customised bookmark string for the \fBhg\fP backend\&. -+.PP -+Again, we start off by registering a function: -+.RS -+.nf -+\fBzstyle \&':vcs_info:hg+gen\-hg\-bookmark\-string:*' hooks hgbookmarks\fP -+.fi -+.RE -+.PP -+And then we define the `\fB+vi\-hgbookmarks\fP function: -+.RS -+.nf -+\fB -+function +vi\-hgbookmarks() { -+ # The default is to connect all bookmark names by -+ # commas\&. This mixes things up a little\&. -+ # Imagine, there\&'s one type of bookmarks that is -+ # special to you\&. Say, because it\&'s *your* work\&. -+ # Those bookmarks look always like this: "sh/*" -+ # (because your initials are sh, for example)\&. -+ # This makes the bookmarks string use only those -+ # bookmarks\&. If there\&'s more than one, it -+ # concatenates them using commas\&. -+ local s i -+ # The bookmarks returned by `hg\&' are available in -+ # the functions positional parameters\&. -+ (( $# == 0 )) && return 0 -+ for i in "$@"; do -+ if [[ $i == sh/* ]]; then -+ [[ \-n $s ]] && s=$s, -+ s=${s}$i -+ fi -+ done -+ # Now, the communication with the code that calls -+ # the hook functions is done via the hook_com[] -+ # hash\&. The key, at which the `gen\-hg\-bookmark\-string\&' -+ # hook looks at is `hg\-bookmark\-string\&'\&. So: -+ hook_com[hg\-bookmark\-string]=$s -+ # And to signal, that we want to use the sting we -+ # just generated, set the special variable `ret\&' to -+ # something other than the default zero: -+ ret=1 -+ return 0 -+} -+\fP -+.fi -+.RE -+.PP -+Some longer examples and code snippets which might be useful are available in -+the examples file located at Misc/vcs_info\-examples in the Zsh source -+directory\&. -+.PP -+This concludes our guided tour through zsh\&'s \fIvcs_info\fP\&. -+.PP -+.SH "PROMPT THEMES" -+.PP -+.SS "Installation" -+.PP -+You should make sure all the functions from the \fBFunctions/Prompts\fP -+directory of the source distribution are available; they all begin with -+the string `\fBprompt_\fP\&' except for the special function`\fBpromptinit\fP'\&. -+You also need the `\fBcolors\fP\&' function from \fBFunctions/Misc\fP\&. All of -+these functions may already have been installed on your system; if not, -+you will need to find them and copy them\&. The directory should appear as -+one of the elements of the \fBfpath\fP array (this should already be the -+case if they were installed), and at least the function \fBpromptinit\fP -+should be autoloaded; it will autoload the rest\&. Finally, to initialize -+the use of the system you need to call the \fBpromptinit\fP function\&. The -+following code in your \fB\&.zshrc\fP will arrange for this; assume the -+functions are stored in the directory \fB~/myfns\fP: -+.PP -+.RS -+.nf -+\fBfpath=(~/myfns $fpath) -+autoload \-U promptinit -+promptinit\fP -+.fi -+.RE -+.PP -+.SS "Theme Selection" -+.PP -+Use the \fBprompt\fP command to select your preferred theme\&. This command -+may be added to your \fB\&.zshrc\fP following the call to \fBpromptinit\fP in -+order to start zsh with a theme already selected\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBprompt\fP [ \fB\-c\fP | \fB\-l\fP ] -+.TP -+.PD 0 -+\fBprompt\fP [ \fB\-p\fP | \fB\-h\fP ] [ \fItheme\fP \&.\&.\&. ] -+.TP -+.PD -+\fBprompt\fP [ \fB\-s\fP ] \fItheme\fP [ \fIarg\fP \&.\&.\&. ] -+Set or examine the prompt theme\&. With no options and a \fItheme\fP -+argument, the theme with that name is set as the current theme\&. The -+available themes are determined at run time; use the \fB\-l\fP option to see -+a list\&. The special \fItheme\fP `\fBrandom\fP\&' selects at random one of the -+available themes and sets your prompt to that\&. -+.RS -+.PP -+In some cases the \fItheme\fP may be modified by one or more arguments, -+which should be given after the theme name\&. See the help for each theme -+for descriptions of these arguments\&. -+.PP -+Options are: -+.PP -+.PD 0 -+.TP -+\fB\-c\fP -+Show the currently selected theme and its parameters, if any\&. -+.TP -+\fB\-l\fP -+List all available prompt themes\&. -+.TP -+\fB\-p\fP -+Preview the theme named by \fItheme\fP, or all themes if no -+\fItheme\fP is given\&. -+.TP -+\fB\-h\fP -+Show help for the theme named by \fItheme\fP, or for the -+\fBprompt\fP function if no \fItheme\fP is given\&. -+.TP -+\fB\-s\fP -+Set \fItheme\fP as the current theme and save state\&. -+.PD -+.RE -+.TP -+\fBprompt_\fP\fItheme\fP\fB_setup\fP -+Each available \fItheme\fP has a setup function which is called by the -+\fBprompt\fP function to install that theme\&. This function may define -+other functions as necessary to maintain the prompt, including functions -+used to preview the prompt or provide help for its use\&. You should not -+normally call a theme\&'s setup function directly\&. -+.PP -+.SH "ZLE FUNCTIONS" -+.PP -+.SS "Widgets" -+.PP -+These functions all implement user\-defined ZLE widgets (see -+\fIzshzle\fP(1)) which can be bound to keystrokes in interactive shells\&. To use them, -+your \fB\&.zshrc\fP should contain lines of the form -+.PP -+.RS -+.nf -+\fBautoload \fIfunction\fP -+zle \-N \fIfunction\fP\fP -+.fi -+.RE -+.PP -+followed by an appropriate \fBbindkey\fP command to associate the function -+with a key sequence\&. Suggested bindings are described below\&. -+.PP -+.PD 0 -+.TP -+.PD -+bash\-style word functions -+If you are looking for functions to implement moving over and editing -+words in the manner of bash, where only alphanumeric characters are -+considered word characters, you can use the functions described in -+the next section\&. The following is sufficient: -+.RS -+.PP -+.RS -+.nf -+\fBautoload \-U select\-word\-style -+select\-word\-style bash\fP -+.fi -+.RE -+.PP -+.RE -+.TP -+.PD 0 -+\fBforward\-word\-match\fP, \fBbackward\-word\-match\fP -+.TP -+.PD 0 -+\fBkill\-word\-match\fP, \fBbackward\-kill\-word\-match\fP -+.TP -+.PD 0 -+\fBtranspose\-words\-match\fP, \fBcapitalize\-word\-match\fP -+.TP -+.PD 0 -+\fBup\-case\-word\-match\fP, \fBdown\-case\-word\-match\fP -+.TP -+.PD -+\fBselect\-word\-style\fP, \fBmatch\-word\-context\fP, \fBmatch\-words\-by\-style\fP -+The eight `\fB\-match\fP\&' functions are drop\-in replacements for the -+builtin widgets without the suffix\&. By default they behave in a similar -+way\&. However, by the use of styles and the function \fBselect\-word\-style\fP, -+the way words are matched can be altered\&. -+.RS -+.PP -+The simplest way of configuring the functions is to use -+\fBselect\-word\-style\fP, which can either be called as a normal function with -+the appropriate argument, or invoked as a user\-defined widget that will -+prompt for the first character of the word style to be used\&. The first -+time it is invoked, the eight \fB\-match\fP functions will automatically -+replace the builtin versions, so they do not need to be loaded explicitly\&. -+.PP -+The word styles available are as follows\&. Only the first character -+is examined\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBbash\fP -+Word characters are alphanumeric characters only\&. -+.TP -+\fBnormal\fP -+As in normal shell operation: word characters are alphanumeric characters -+plus any characters present in the string given by the parameter -+\fB$WORDCHARS\fP\&. -+.TP -+\fBshell\fP -+Words are complete shell command arguments, possibly including complete -+quoted strings, or any tokens special to the shell\&. -+.TP -+\fBwhitespace\fP -+Words are any set of characters delimited by whitespace\&. -+.TP -+\fBdefault\fP -+Restore the default settings; this is usually the same as `\fBnormal\fP\&'\&. -+.PP -+All but `\fBdefault\fP\&' can be input as an upper case character, which has -+the same effect but with subword matching turned on\&. In this case, words -+with upper case characters are treated specially: each separate run of -+upper case characters, or an upper case character followed by any number of -+other characters, is considered a word\&. The style \fBsubword\-range\fP -+can supply an alternative character range to the default `\fB[:upper:]\fP\&'; -+the value of the style is treated as the contents of a `\fB[\fP\fI\&.\&.\&.\fP\fB]\fP\&' -+pattern (note that the outer brackets should not be supplied, only -+those surrounding named ranges)\&. -+.PP -+More control can be obtained using the \fBzstyle\fP command, as described in -+\fIzshmodules\fP(1)\&. Each style is looked up in the -+context \fB:zle:\fP\fIwidget\fP where \fIwidget\fP is the name of the -+user\-defined widget, not the name of the function implementing it, so in -+the case of the definitions supplied by \fBselect\-word\-style\fP the -+appropriate contexts are \fB:zle:forward\-word\fP, and so on\&. The function -+\fBselect\-word\-style\fP itself always defines styles for the context -+`\fB:zle:*\fP\&' which can be overridden by more specific (longer) patterns as -+well as explicit contexts\&. -+.PP -+The style \fBword\-style\fP specifies the rules to use\&. This may have the -+following values\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBnormal\fP -+Use the standard shell rules, i\&.e\&. alphanumerics and \fB$WORDCHARS\fP, unless -+overridden by the styles \fBword\-chars\fP or \fBword\-class\fP\&. -+.TP -+\fBspecified\fP -+Similar to \fBnormal\fP, but \fIonly\fP the specified characters, and not also -+alphanumerics, are considered word characters\&. -+.TP -+\fBunspecified\fP -+The negation of specified\&. The given characters are those which will -+\fInot\fP be considered part of a word\&. -+.TP -+\fBshell\fP -+Words are obtained by using the syntactic rules for generating shell -+command arguments\&. In addition, special tokens which are never command -+arguments such as `\fB()\fP\&' are also treated as words\&. -+.TP -+\fBwhitespace\fP -+Words are whitespace\-delimited strings of characters\&. -+.PP -+The first three of those rules usually use \fB$WORDCHARS\fP, but the value -+in the parameter can be overridden by the style \fBword\-chars\fP, which works -+in exactly the same way as \fB$WORDCHARS\fP\&. In addition, the style -+\fBword\-class\fP uses character class syntax to group characters and takes -+precedence over \fBword\-chars\fP if both are set\&. The \fBword\-class\fP style -+does not include the surrounding brackets of the character class; for -+example, `\fB\-:[:alnum:]\fP\&' is a valid \fBword\-class\fP to include all -+alphanumerics plus the characters `\fB\-\fP\&' and `\fB:\fP'\&. Be careful -+including `\fB]\fP\&', `\fB^\fP' and `\fB\-\fP' as these are special inside -+character classes\&. -+.PP -+\fBword\-style\fP may also have `\fB\-subword\fP\&' appended to its value to -+turn on subword matching, as described above\&. -+.PP -+The style \fBskip\-chars\fP is mostly useful for -+\fBtranspose\-words\fP and similar functions\&. If set, it gives a count of -+characters starting at the cursor position which will not be considered -+part of the word and are treated as space, regardless of what they actually -+are\&. For example, if -+.PP -+.RS -+.nf -+\fBzstyle \&':zle:transpose\-words' skip\-chars 1\fP -+.fi -+.RE -+.PP -+has been set, and \fBtranspose\-words\-match\fP is called with the cursor on -+the \fIX\fP of \fBfoo\fP\fIX\fP\fBbar\fP, where \fIX\fP can be any character, then -+the resulting expression is \fBbar\fP\fIX\fP\fBfoo\fP\&. -+.PP -+Finer grained control can be obtained by setting the style \fBword\-context\fP -+to an array of pairs of entries\&. Each pair of entries consists of a -+\fIpattern\fP and a \fIsubcontext\fP\&. The shell argument the cursor is on is -+matched against each \fIpattern\fP in turn until one matches; if it does, -+the context is extended by a colon and the corresponding \fIsubcontext\fP\&. -+Note that the test is made against the original word on the line, with no -+stripping of quotes\&. Special handling is done between words: the current -+context is examined and if it contains the string \fBback\fP, the word before -+the cursor is considered, else the word after cursor is considered\&. Some -+examples are given below\&. -+.PP -+Here are some examples of use of the styles, actually taken from the -+simplified interface in \fBselect\-word\-style\fP: -+.PP -+.RS -+.nf -+\fBzstyle \&':zle:*' word\-style standard -+zstyle \&':zle:*' word\-chars ''\fP -+.fi -+.RE -+.PP -+Implements bash\-style word handling for all widgets, i\&.e\&. only -+alphanumerics are word characters; equivalent to setting -+the parameter \fBWORDCHARS\fP empty for the given context\&. -+.PP -+.RS -+.nf -+\fBstyle \&':zle:*kill*' word\-style space\fP -+.fi -+.RE -+.PP -+Uses space\-delimited words for widgets with the word `kill\&' in the name\&. -+Neither of the styles \fBword\-chars\fP nor \fBword\-class\fP is used in this case\&. -+.PP -+Here are some examples of use of the \fBword\-context\fP style to extend -+the context\&. -+.PP -+.RS -+.nf -+\fBzstyle \&':zle:*' word\-context "*/*" file "[[:space:]]" whitespace -+zstyle \&':zle:transpose\-words:whitespace' word\-style shell -+zstyle \&':zle:transpose\-words:filename' word\-style normal -+zstyle \&':zle:transpose\-words:filename' word\-chars ''\fP -+.fi -+.RE -+.PP -+This provides two different ways of using \fBtranspose\-words\fP depending on -+whether the cursor is on whitespace between words or on a filename, here -+any word containing a \fB/\fP\&. On whitespace, complete arguments as defined -+by standard shell rules will be transposed\&. In a filename, only -+alphanumerics will be transposed\&. Elsewhere, words will be transposed -+using the default style for \fB:zle:transpose\-words\fP\&. -+.PP -+The word matching and all the handling of \fBzstyle\fP settings is actually -+implemented by the function \fBmatch\-words\-by\-style\fP\&. This can be used to -+create new user\-defined widgets\&. The calling function should set the local -+parameter \fBcurcontext\fP to \fB:zle:\fP\fIwidget\fP, create the local -+parameter \fBmatched_words\fP and call \fBmatch\-words\-by\-style\fP with no -+arguments\&. On return, \fBmatched_words\fP will be set to an array with the -+elements: (1) the start of the line (2) the word before the cursor (3) any -+non\-word characters between that word and the cursor (4) any non\-word -+character at the cursor position plus any remaining non\-word characters -+before the next word, including all characters specified by the -+\fBskip\-chars\fP style, (5) the word at or following the cursor (6) any -+non\-word characters following that word (7) the remainder of the line\&. Any -+of the elements may be an empty string; the calling function should test -+for this to decide whether it can perform its function\&. -+.PP -+It is possible to pass options with arguments to \fBmatch\-words\-by\-style\fP -+to override the use of styles\&. The options are: -+.PD 0 -+.TP -+\fB\-w\fP -+\fIword\-style\fP -+.TP -+\fB\-s\fP -+\fIskip\-chars\fP -+.TP -+\fB\-c\fP -+\fIword\-class\fP -+.TP -+\fB\-C\fP -+\fIword\-chars\fP -+.TP -+\fB\-r\fP -+\fIsubword\-range\fP -+.PD -+.PP -+For example, \fBmatch\-words\-by\-style \-w shell \-c 0\fP may be used to -+extract the command argument around the cursor\&. -+.PP -+The \fBword\-context\fP style is implemented by the function -+\fBmatch\-word\-context\fP\&. This should not usually need to be called -+directly\&. -+.RE -+.TP -+\fBcopy\-earlier\-word\fP -+This widget works like a combination of \fBinsert\-last\-word\fP and -+\fBcopy\-prev\-shell\-word\fP\&. Repeated invocations of the widget retrieve -+earlier words on the relevant history line\&. With a numeric argument -+\fIN\fP, insert the \fIN\fPth word from the history line; \fIN\fP may be -+negative to count from the end of the line\&. -+.RS -+.PP -+If \fBinsert\-last\-word\fP has been used to retrieve the last word on a -+previous history line, repeated invocations will replace that word with -+earlier words from the same line\&. -+.PP -+Otherwise, the widget applies to words on the line currently being edited\&. -+The \fBwidget\fP style can be set to the name of another widget that should -+be called to retrieve words\&. This widget must accept the same three -+arguments as \fBinsert\-last\-word\fP\&. -+.RE -+.TP -+\fBcycle\-completion\-positions\fP -+After inserting an unambiguous string into the command line, the new -+function based completion system may know about multiple places in -+this string where characters are missing or differ from at least one -+of the possible matches\&. It will then place the cursor on the -+position it considers to be the most interesting one, i\&.e\&. the one -+where one can disambiguate between as many matches as possible with as -+little typing as possible\&. -+.RS -+.PP -+This widget allows the cursor to be easily moved to the other interesting -+spots\&. It can be invoked repeatedly to cycle between all positions -+reported by the completion system\&. -+.RE -+.TP -+\fBdelete\-whole\-word\-match\fP -+This is another function which works like the \fB\-match\fP functions -+described immediately above, i\&.e\&. using styles to decide the word -+boundaries\&. However, it is not a replacement for any existing function\&. -+.RS -+.PP -+The basic behaviour is to delete the word around the cursor\&. There is no -+numeric prefix handling; only the single word around the cursor is -+considered\&. If the widget contains the string \fBkill\fP, the removed text -+will be placed in the cutbuffer for future yanking\&. This can be obtained -+by defining \fBkill\-whole\-word\-match\fP as follows: -+.PP -+.RS -+.nf -+\fBzle \-N kill\-whole\-word\-match delete\-whole\-word\-match\fP -+.fi -+.RE -+.PP -+and then binding the widget \fBkill\-whole\-word\-match\fP\&. -+.RE -+.TP -+\fBup\-line\-or\-beginning\-search\fP, \fBdown\-line\-or\-beginning\-search\fP -+These widgets are similar to the builtin functions \fBup\-line\-or\-search\fP -+and \fBdown\-line\-or\-search\fP: if in a multiline buffer they move up or -+down within the buffer, otherwise they search for a history line matching -+the start of the current line\&. In this case, however, they search for -+a line which matches the current line up to the current cursor position, in -+the manner of \fBhistory\-beginning\-search\-backward\fP and \fB\-forward\fP, rather -+than the first word on the line\&. -+.TP -+\fBedit\-command\-line\fP -+Edit the command line using your visual editor, as in \fBksh\fP\&. -+.RS -+.PP -+.RS -+.nf -+\fBbindkey \-M vicmd v edit\-command\-line\fP -+.fi -+.RE -+.RE -+.TP -+\fBhistory\-search\-end\fP -+This function implements the widgets -+\fBhistory\-beginning\-search\-backward\-end\fP and -+\fBhistory\-beginning\-search\-forward\-end\fP\&. These commands work by first -+calling the corresponding builtin widget (see -+`History Control\&' in \fIzshzle\fP(1)) and then moving the cursor to the end of the line\&. The original cursor -+position is remembered and restored before calling the builtin widget a -+second time, so that the same search is repeated to look farther through -+the history\&. -+.RS -+.PP -+Although you \fBautoload\fP only one function, the commands to use it are -+slightly different because it implements two widgets\&. -+.PP -+.RS -+.nf -+\fBzle \-N history\-beginning\-search\-backward\-end \e -+ history\-search\-end -+zle \-N history\-beginning\-search\-forward\-end \e -+ history\-search\-end -+bindkey \&'\ee^P' history\-beginning\-search\-backward\-end -+bindkey \&'\ee^N' history\-beginning\-search\-forward\-end\fP -+.fi -+.RE -+.RE -+.TP -+\fBhistory\-beginning\-search\-menu\fP -+This function implements yet another form of history searching\&. The -+text before the cursor is used to select lines from the history, -+as for \fBhistory\-beginning\-search\-backward\fP except that all matches are -+shown in a numbered menu\&. Typing the appropriate digits inserts the -+full history line\&. Note that leading zeroes must be typed (they are only -+shown when necessary for removing ambiguity)\&. The entire history is -+searched; there is no distinction between forwards and backwards\&. -+.RS -+.PP -+With a prefix argument, the search is not anchored to the start of -+the line; the string typed by the use may appear anywhere in the line -+in the history\&. -+.PP -+If the widget name contains `\fB\-end\fP\&' the cursor is moved to the end of -+the line inserted\&. If the widget name contains `\fB\-space\fP\&' any space -+in the text typed is treated as a wildcard and can match anything (hence -+a leading space is equivalent to giving a prefix argument)\&. Both -+forms can be combined, for example: -+.PP -+.RS -+.nf -+\fBzle \-N history\-beginning\-search\-menu\-space\-end \e -+ history\-beginning\-search\-menu\fP -+.fi -+.RE -+.RE -+.TP -+\fBhistory\-pattern\-search\fP -+The function \fBhistory\-pattern\-search\fP implements widgets which prompt -+for a pattern with which to search the history backwards or forwards\&. The -+pattern is in the usual zsh format, however the first character may be -+\fB^\fP to anchor the search to the start of the line, and the last character -+may be \fB$\fP to anchor the search to the end of the line\&. If the -+search was not anchored to the end of the line the cursor is positioned -+just after the pattern found\&. -+.RS -+.PP -+The commands to create bindable widgets are similar to those in the -+example immediately above: -+.PP -+.RS -+.nf -+\fBautoload \-U history\-pattern\-search -+zle \-N history\-pattern\-search\-backward history\-pattern\-search -+zle \-N history\-pattern\-search\-forward history\-pattern\-search\fP -+.fi -+.RE -+.RE -+.TP -+\fBincarg\fP -+Typing the keystrokes for this widget with the cursor placed on or to the -+left of an integer causes that integer to be incremented by one\&. With a -+numeric prefix argument, the number is incremented by the amount of the -+argument (decremented if the prefix argument is negative)\&. The shell -+parameter \fBincarg\fP may be set to change the default increment to -+something other than one\&. -+.RS -+.PP -+.RS -+.nf -+\fBbindkey \&'^X+' incarg\fP -+.fi -+.RE -+.RE -+.TP -+\fBincremental\-complete\-word\fP -+This allows incremental completion of a word\&. After starting this -+command, a list of completion choices can be shown after every character -+you type, which you can delete with \fB^H\fP or \fBDEL\fP\&. Pressing return -+accepts the completion so far and returns you to normal editing (that is, -+the command line is \fInot\fP immediately executed)\&. You can hit \fBTAB\fP to -+do normal completion, \fB^G\fP to abort back to the state when you started, -+and \fB^D\fP to list the matches\&. -+.RS -+.PP -+This works only with the new function based completion system\&. -+.PP -+.RS -+.nf -+\fBbindkey \&'^Xi' incremental\-complete\-word\fP -+.fi -+.RE -+.RE -+.TP -+\fBinsert\-composed\-char\fP -+This function allows you to compose characters that don\&'t appear on the -+keyboard to be inserted into the command line\&. The command is followed by -+two keys corresponding to ASCII characters (there is no prompt)\&. For -+accented characters, the two keys are a base character followed by a code -+for the accent, while for other special characters the two characters -+together form a mnemonic for the character to be inserted\&. The -+two\-character codes are a subset of those given by RFC 1345 (see for -+example \fBhttp://www\&.faqs\&.org/rfcs/rfc1345\&.html\fP)\&. -+.RS -+.PP -+The function may optionally be followed by up to two characters which -+replace one or both of the characters read from the keyboard; if both -+characters are supplied, no input is read\&. For example, -+\fBinsert\-composed\-char a:\fP can be used within a widget to insert an a with -+umlaut into the command line\&. This has the advantages over use of a -+literal character that it is more portable\&. -+.PP -+For best results zsh should have been built with support for multibyte -+characters (configured with \fB\-\-enable\-multibyte\fP); however, the function -+works for the limited range of characters available in single\-byte -+character sets such as ISO\-8859\-1\&. -+.PP -+The character is converted into the local representation and -+inserted into the command line at the cursor position\&. -+(The conversion is done within the shell, using whatever facilities -+the C library provides\&.) With a numeric argument, the character and its -+code are previewed in the status line -+.PP -+The function may be run outside zle in which case it prints the character -+(together with a newline) to standard output\&. Input is still read from -+keystrokes\&. -+.PP -+See \fBinsert\-unicode\-char\fP for an alternative way of inserting Unicode -+characters using their hexadecimal character number\&. -+.PP -+The set of accented characters is reasonably complete up to Unicode -+character U+0180, the set of special characters less so\&. However, it it -+is very sporadic from that point\&. Adding new characters is easy, -+however; see the function \fBdefine\-composed\-chars\fP\&. Please send any -+additions to \fBzsh\-workers@zsh\&.org\fP\&. -+.PP -+The codes for the second character when used to accent the first are as -+follows\&. Note that not every character can take every accent\&. -+.PD 0 -+.TP -+\fB!\fP -+Grave\&. -+.TP -+\fB\&'\fP -+Acute\&. -+.TP -+\fB>\fP -+Circumflex\&. -+.TP -+\fB?\fP -+Tilde\&. (This is not \fB~\fP as RFC 1345 does not assume that -+character is present on the keyboard\&.) -+.TP -+\fB\-\fP -+Macron\&. (A horizontal bar over the base character\&.) -+.TP -+\fB(\fP -+Breve\&. (A shallow dish shape over the base character\&.) -+.TP -+\fB\&.\fP -+Dot above the base character, or in the case of \fBi\fP no dot, -+or in the case of \fBL\fP and \fBl\fP a centered dot\&. -+.TP -+\fB:\fP -+Diaeresis (Umlaut)\&. -+.TP -+\fBc\fP -+Cedilla\&. -+.TP -+\fB_\fP -+Underline, however there are currently no underlined characters\&. -+.TP -+\fB/\fP -+Stroke through the base character\&. -+.TP -+\fB"\fP -+Double acute (only supported on a few letters)\&. -+.TP -+\fB;\fP -+Ogonek\&. (A little forward facing hook at the bottom right -+of the character\&.) -+.TP -+\fB<\fP -+Caron\&. (A little v over the letter\&.) -+.TP -+\fB0\fP -+Circle over the base character\&. -+.TP -+\fB2\fP -+Hook over the base character\&. -+.TP -+\fB9\fP -+Horn over the base character\&. -+.PD -+.PP -+The most common characters from the Arabic, Cyrillic, Greek and Hebrew -+alphabets are available; consult RFC 1345 for the appropriate sequences\&. -+In addition, a set of two letter codes not in RFC 1345 are available for -+the double\-width characters corresponding to ASCII characters from \fB!\fP -+to \fB~\fP (0x21 to 0x7e) by preceding the character with \fB^\fP, for -+example \fB^A\fP for a double\-width \fBA\fP\&. -+.PP -+The following other two\-character sequences are understood\&. -+.PP -+.PD 0 -+.TP -+.PD -+ASCII characters -+These are already present on most keyboards: -+.PD 0 -+.TP -+\fB<(\fP -+Left square bracket -+.TP -+\fB//\fP -+Backslash (solidus) -+.TP -+\fB)>\fP -+Right square bracket -+.TP -+\fB(!\fP -+Left brace (curly bracket) -+.TP -+\fB!!\fP -+Vertical bar (pipe symbol) -+.TP -+\fB!)\fP -+Right brace (curly bracket) -+.TP -+\fB\&'?\fP -+Tilde -+.PD -+.TP -+Special letters -+Characters found in various variants of the Latin alphabet: -+.PD 0 -+.TP -+\fBss\fP -+Eszett (scharfes S) -+.TP -+\fBD\-\fP, \fBd\-\fP -+Eth -+.TP -+\fBTH\fP, \fBth\fP -+Thorn -+.TP -+\fBkk\fP -+Kra -+.TP -+\fB\&'n\fP -+\&'n -+.TP -+\fBNG\fP, \fBng\fP -+Ng -+.TP -+\fBOI\fP, \fBoi\fP -+Oi -+.TP -+\fByr\fP -+yr -+.TP -+\fBED\fP -+ezh -+.PD -+.TP -+Currency symbols -+.PD 0 -+.TP -+\fBCt\fP -+Cent -+.TP -+\fBPd\fP -+Pound sterling (also lira and others) -+.TP -+\fBCu\fP -+Currency -+.TP -+\fBYe\fP -+Yen -+.TP -+\fBEu\fP -+Euro (N\&.B\&. not in RFC 1345) -+.PD -+.TP -+Punctuation characters -+References to "right" quotes indicate the shape (like a 9 rather than 6) -+rather than their grammatical use\&. (For example, a "right" low double -+quote is used to open quotations in German\&.) -+.PD 0 -+.TP -+\fB!I\fP -+Inverted exclamation mark -+.TP -+\fBBB\fP -+Broken vertical bar -+.TP -+\fBSE\fP -+Section -+.TP -+\fBCo\fP -+Copyright -+.TP -+\fB\-a\fP -+Spanish feminine ordinal indicator -+.TP -+\fB<<\fP -+Left guillemet -+.TP -+\fB\-\fP\fB\-\fP -+Soft hyphen -+.TP -+\fBRg\fP -+Registered trade mark -+.TP -+\fBPI\fP -+Pilcrow (paragraph) -+.TP -+\fB\-o\fP -+Spanish masculine ordinal indicator -+.TP -+\fB>>\fP -+Right guillemet -+.TP -+\fB?I\fP -+Inverted question mark -+.TP -+\fB\-1\fP -+Hyphen -+.TP -+\fB\-N\fP -+En dash -+.TP -+\fB\-M\fP -+Em dash -+.TP -+\fB\-3\fP -+Horizontal bar -+.TP -+\fB:3\fP -+Vertical ellipsis -+.TP -+\fB\&.3\fP -+Horizontal midline ellipsis -+.TP -+\fB!2\fP -+Double vertical line -+.TP -+\fB=2\fP -+Double low line -+.TP -+\fB\&'6\fP -+Left single quote -+.TP -+\fB\&'9\fP -+Right single quote -+.TP -+\fB\&.9\fP -+"Right" low quote -+.TP -+\fB9\&'\fP -+Reversed "right" quote -+.TP -+\fB"6\fP -+Left double quote -+.TP -+\fB"9\fP -+Right double quote -+.TP -+\fB:9\fP -+"Right" low double quote -+.TP -+\fB9"\fP -+Reversed "right" double quote -+.TP -+\fB/\-\fP -+Dagger -+.TP -+\fB/=\fP -+Double dagger -+.PD -+.TP -+Mathematical symbols -+.PD 0 -+.TP -+\fBDG\fP -+Degree -+.TP -+\fB\-2\fP, \fB+\-\fP, \fB\-+\fP -+\- sign, +/\- sign, \-/+ sign -+.TP -+\fB2S\fP -+Superscript 2 -+.TP -+\fB3S\fP -+Superscript 3 -+.TP -+\fB1S\fP -+Superscript 1 -+.TP -+\fBMy\fP -+Micro -+.TP -+\fB\&.M\fP -+Middle dot -+.TP -+\fB14\fP -+Quarter -+.TP -+\fB12\fP -+Half -+.TP -+\fB34\fP -+Three quarters -+.TP -+\fB*X\fP -+Multiplication -+.TP -+\fB\-:\fP -+Division -+.TP -+\fB%0\fP -+Per mille -+.TP -+\fBFA\fP, \fBTE\fP, \fB/0\fP -+For all, there exists, empty set -+.TP -+\fBdP\fP, \fBDE\fP, \fBNB\fP -+Partial derivative, delta (increment), del -+(nabla) -+.TP -+\fB(\-\fP, \fB\-)\fP -+Element of, contains -+.TP -+\fB*P\fP, \fB+Z\fP -+Product, sum -+.TP -+\fB*\-\fP, \fBOb\fP, \fBSb\fP -+Asterisk, ring, bullet -+.TP -+\fBRT\fP, \fB0(\fP, \fB00\fP -+Root sign, proportional to, infinity -+.PD -+.TP -+Other symbols -+.PD 0 -+.TP -+\fBcS\fP, \fBcH\fP, \fBcD\fP, \fBcC\fP -+Card suits: spades, hearts, diamonds, -+clubs -+.TP -+\fBMd\fP, \fBM8\fP, \fBM2\fP, \fBMb\fP, \fBMx\fP, \fBMX\fP -+Musical notation: -+crotchet (quarter note), quaver (eighth note), semiquavers (sixteenth -+notes), flag sign, natural sign, sharp sign -+.TP -+\fBFm\fP, \fBMl\fP -+Female, male -+.PD -+.TP -+Accents on their own -+.PD 0 -+.TP -+\fB\&'>\fP -+Circumflex (same as caret, \fB^\fP) -+.TP -+\fB\&'!\fP -+Grave (same as backtick, \fB`\fP) -+.TP -+\fB\&',\fP -+Cedilla -+.TP -+\fB\&':\fP -+Diaeresis (Umlaut) -+.TP -+\fB\&'m\fP -+Macron -+.TP -+\fB\&''\fP -+Acute -+.PD -+.RE -+.TP -+\fBinsert\-files\fP -+This function allows you type a file pattern, and see the results of the -+expansion at each step\&. When you hit return, all expansions are inserted -+into the command line\&. -+.RS -+.PP -+.RS -+.nf -+\fBbindkey \&'^Xf' insert\-files\fP -+.fi -+.RE -+.RE -+.TP -+\fBinsert\-unicode\-char\fP -+When first executed, the user inputs a set of hexadecimal digits\&. -+This is terminated with another call to \fBinsert\-unicode\-char\fP\&. -+The digits are then turned into the corresponding Unicode character\&. -+For example, if the widget is bound to \fB^XU\fP, the character sequence -+`\fB^XU 4 c ^XU\fP\&' inserts \fBL\fP (Unicode U+004c)\&. -+.RS -+.PP -+See \fBinsert\-composed\-char\fP for a way of inserting characters -+using a two\-character mnemonic\&. -+.RE -+.TP -+.PD 0 -+\fBnarrow\-to\-region [ \-p\fP \fIpre\fP \fB] [ \-P\fP \fIpost\fP \fB]\fP -+.TP -+.PD 0 -+ \fB[ \-S\fP \fIstatepm\fP \fB| \-R\fP \fIstatepm\fP \fB] [ \-n ] [\fP \fIstart\fP \fIend\fP \fB]\fP) -+.TP -+.PD -+\fBnarrow\-to\-region\-invisible\fP -+Narrow the editable portion of the buffer to the region between the cursor -+and the mark, which may be in either order\&. The region may not be empty\&. -+.RS -+.PP -+\fBnarrow\-to\-region\fP may be used as a widget or called as a function from a -+user\-defined widget; by default, the text outside the editable area remains -+visible\&. A \fBrecursive\-edit\fP is performed and the original widening -+status is then restored\&. Various options and arguments are available when -+it is called as a function\&. -+.PP -+The options \fB\-p\fP \fIpretext\fP and \fB\-P\fP \fIposttext\fP may be -+used to replace the text before and after the display for the duration of -+the function; either or both may be an empty string\&. -+.PP -+If the option \fB\-n\fP is also given, \fIpretext\fP or \fIposttext\fP will only -+be inserted if there is text before or after the region respectively which -+will be made invisible\&. -+.PP -+Two numeric arguments may be given which will be used instead of the cursor -+and mark positions\&. -+.PP -+The option \fB\-S\fP \fIstatepm\fP is used to narrow according to the other -+options while saving the original state in the parameter with name -+\fIstatepm\fP, while the option \fB\-R\fP \fIstatepm\fP is used to restore the -+state from the parameter; note in both cases the \fIname\fP of the parameter -+is required\&. In the second case, other options and arguments are -+irrelevant\&. When this method is used, no \fBrecursive\-edit\fP is performed; -+the calling widget should call this function with the option \fB\-S\fP, -+perform its own editing on the command line or pass control to the user -+via `\fBzle recursive\-edit\fP\&', then call this function with the option -+\fB\-R\fP\&. The argument \fIstatepm\fP must be a suitable name for an ordinary -+parameter, except that parameters beginning with the prefix \fB_ntr_\fP are -+reserved for use within \fBnarrow\-to\-region\fP\&. Typically the parameter will -+be local to the calling function\&. -+.PP -+\fBnarrow\-to\-region\-invisible\fP is a simple widget which calls -+\fBnarrow\-to\-region\fP with arguments which replace any text outside the -+region with `\fB\&.\&.\&.\fP\&'\&. -+.PP -+The display is restored (and the widget returns) upon any zle command -+which would usually cause the line to be accepted or aborted\&. Hence an -+additional such command is required to accept or abort the current line\&. -+.PP -+The return status of both widgets is zero if the line was accepted, else -+non\-zero\&. -+.PP -+Here is a trivial example of a widget using this feature\&. -+.RS -+.nf -+\fBlocal state -+narrow\-to\-region \-p $\&'Editing restricted region\en' \e -+ \-P \&'' \-S state -+zle recursive\-edit -+narrow\-to\-region \-R state\fP -+.fi -+.RE -+.RE -+.TP -+\fBpredict\-on\fP -+This set of functions implements predictive typing using history search\&. -+After \fBpredict\-on\fP, typing characters causes the editor to look backward -+in the history for the first line beginning with what you have typed so -+far\&. After \fBpredict\-off\fP, editing returns to normal for the line found\&. -+In fact, you often don\&'t even need to use \fBpredict\-off\fP, because if the -+line doesn\&'t match something in the history, adding a key performs -+standard completion, and then inserts itself if no completions were found\&. -+However, editing in the middle of a line is liable to confuse prediction; -+see the \fBtoggle\fP style below\&. -+.RS -+.PP -+With the function based completion system (which is needed for this), you -+should be able to type \fBTAB\fP at almost any point to advance the cursor -+to the next ``interesting\&'' character position (usually the end of the -+current word, but sometimes somewhere in the middle of the word)\&. And of -+course as soon as the entire line is what you want, you can accept with -+return, without needing to move the cursor to the end first\&. -+.PP -+The first time \fBpredict\-on\fP is used, it creates several additional -+widget functions: -+.PP -+.PD 0 -+.TP -+\fBdelete\-backward\-and\-predict\fP -+Replaces the \fBbackward\-delete\-char\fP -+widget\&. You do not need to bind this yourself\&. -+.TP -+\fBinsert\-and\-predict\fP -+Implements predictive typing by replacing the -+\fBself\-insert\fP widget\&. You do not need to bind this yourself\&. -+.TP -+\fBpredict\-off\fP -+Turns off predictive typing\&. -+.PD -+.PP -+Although you \fBautoload\fP only the \fBpredict\-on\fP function, it is -+necessary to create a keybinding for \fBpredict\-off\fP as well\&. -+.PP -+.RS -+.nf -+\fBzle \-N predict\-on -+zle \-N predict\-off -+bindkey \&'^X^Z' predict\-on -+bindkey \&'^Z' predict\-off\fP -+.fi -+.RE -+.RE -+.TP -+\fBread\-from\-minibuffer\fP -+This is most useful when called as a function from inside a widget, but will -+work correctly as a widget in its own right\&. It prompts for a value -+below the current command line; a value may be input using all of the -+standard zle operations (and not merely the restricted set available -+when executing, for example, \fBexecute\-named\-cmd\fP)\&. The value is then -+returned to the calling function in the parameter \fB$REPLY\fP and the -+editing buffer restored to its previous state\&. If the read was aborted -+by a keyboard break (typically \fB^G\fP), the function returns status 1 -+and \fB$REPLY\fP is not set\&. -+.RS -+.PP -+If one argument is supplied to the function it is taken as a prompt, -+otherwise `\fB? \fP\&' is used\&. If two arguments are supplied, they are the -+prompt and the initial value of \fB$LBUFFER\fP, and if a third argument is -+given it is the initial value of \fB$RBUFFER\fP\&. This provides a default -+value and starting cursor placement\&. Upon return the entire buffer is the -+value of \fB$REPLY\fP\&. -+.PP -+One option is available: `\fB\-k\fP \fInum\fP\&' specifies that \fInum\fP -+characters are to be read instead of a whole line\&. The line editor is not -+invoked recursively in this case, so depending on the terminal settings -+the input may not be visible, and only the input keys are placed in -+\fB$REPLY\fP, not the entire buffer\&. Note that unlike the \fBread\fP builtin -+\fInum\fP must be given; there is no default\&. -+.PP -+The name is a slight misnomer, as in fact the shell\&'s own minibuffer is -+not used\&. Hence it is still possible to call \fBexecuted\-named\-cmd\fP and -+similar functions while reading a value\&. -+.RE -+.TP -+.PD 0 -+\fBreplace\-string\fP, \fBreplace\-pattern\fP -+.TP -+.PD -+\fBreplace\-string\-again\fP, \fBreplace\-pattern\-again\fP -+The function \fBreplace\-string\fP implements three widgets\&. -+If defined under the same name as the function, it prompts for two -+strings; the first (source) string will be replaced by the second -+everywhere it occurs in the line editing buffer\&. -+.RS -+.PP -+If the widget name contains the word `\fBpattern\fP\&', for example by -+defining the widget using the command `\fBzle \-N replace\-pattern -+replace\-string\fP\&', then the matching is performed using zsh patterns\&. All -+zsh extended globbing patterns can be used in the source string; note -+that unlike filename generation the pattern does not need to match an -+entire word, nor do glob qualifiers have any effect\&. In addition, the -+replacement string can contain parameter or command substitutions\&. -+Furthermore, a `\fB&\fP\&' in the replacement string will be replaced with -+the matched source string, and a backquoted digit `\fB\e\fP\fIN\fP\&' will be -+replaced by the \fIN\fPth parenthesised expression matched\&. The form -+`\fB\e{\fP\fIN\fP\fB}\fP\&' may be used to protect the digit from following -+digits\&. -+.PP -+If the widget instead contains the word `\fBregex\fP\&' (or `\fBregexp\fP'), -+then the matching is performed using regular expressions, respecting -+the setting of the option \fBRE_MATCH_PCRE\fP (see the description of the -+function \fBregexp\-replace\fP below)\&. The special replacement facilities -+described above for pattern matching are available\&. -+.PP -+By default the previous source or replacement string will not be offered -+for editing\&. However, this feature can be activated by setting the style -+\fBedit\-previous\fP in the context \fB:zle:\fP\fIwidget\fP (for example, -+\fB:zle:replace\-string\fP) to \fBtrue\fP\&. In addition, a positive -+numeric argument forces the previous values to be offered, a negative or -+zero argument forces them not to be\&. -+.PP -+The function \fBreplace\-string\-again\fP can be used to repeat the previous -+replacement; no prompting is done\&. As with \fBreplace\-string\fP, if the name -+of the widget contains the word `\fBpattern\fP\&' or `\fBregex\fP', pattern or -+regular expression matching is performed, else a literal string -+replacement\&. Note that the previous source and replacement text are the -+same whether pattern, regular expression or string matching is used\&. -+.PP -+For example, starting from the line: -+.PP -+.RS -+.nf -+\fBprint This line contains fan and fond\fP -+.fi -+.RE -+.PP -+and invoking \fBreplace\-pattern\fP with the source string -+`\fBf(?)n\fP\&' and -+the replacement string `\fBc\e1r\fP\&' produces the not very useful line: -+.PP -+.RS -+.nf -+\fBprint This line contains car and cord\fP -+.fi -+.RE -+.PP -+The range of the replacement string can be limited by using the -+\fBnarrow\-to\-region\-invisible\fP widget\&. One limitation of the current -+version is that \fBundo\fP will cycle through changes to the replacement -+and source strings before undoing the replacement itself\&. -+.RE -+.TP -+\fBsend\-invisible\fP -+This is similar to read\-from\-minibuffer in that it may be called as a -+function from a widget or as a widget of its own, and interactively reads -+input from the keyboard\&. However, the input being typed is concealed and -+a string of asterisks (`\fB*\fP\&') is shown instead\&. The value is saved in -+the paramter \fB$INVISIBLE\fP to which a reference is inserted into the -+editing buffer at the restored cursor position\&. If the read was aborted -+by a keyboard break (typically \fB^G\fP) or another escape from editing such -+as \fBpush\-line\fP, \fB$INVISIBLE\fP is set to empty and the original buffer -+is restored unchanged\&. -+.RS -+.PP -+If one argument is supplied to the function it is taken as a prompt, -+otherwise `\fBNon\-echoed text: \fP\&' is used (as in emacs)\&. If a second and -+third argument are supplied they are used to begin and end the reference -+to \fB$INVISIBLE\fP that is inserted into the buffer\&. The default is to -+open with \fB${\fP, then \fBINVISIBLE\fP, and close with \fB}\fP, but many -+other effects are possible\&. -+.RE -+.TP -+\fBsmart\-insert\-last\-word\fP -+This function may replace the \fBinsert\-last\-word\fP widget, like so: -+.RS -+.PP -+.RS -+.nf -+\fBzle \-N insert\-last\-word smart\-insert\-last\-word\fP -+.fi -+.RE -+.PP -+With a numeric prefix, or when passed command line arguments in a call -+from another widget, it behaves like \fBinsert\-last\-word\fP, except that -+words in comments are ignored when \fBINTERACTIVE_COMMENTS\fP is set\&. -+.PP -+Otherwise, the rightmost ``interesting\&'' word from the previous command is -+found and inserted\&. The default definition of ``interesting\&'' is that the -+word contains at least one alphabetic character, slash, or backslash\&. -+This definition may be overridden by use of the \fBmatch\fP style\&. The -+context used to look up the style is the widget name, so usually the -+context is \fB:insert\-last\-word\fP\&. However, you can bind this function to -+different widgets to use different patterns: -+.PP -+.RS -+.nf -+\fBzle \-N insert\-last\-assignment smart\-insert\-last\-word -+zstyle :insert\-last\-assignment match \&'[[:alpha:]][][[:alnum:]]#=*' -+bindkey \&'\ee=' insert\-last\-assignment\fP -+.fi -+.RE -+.PP -+If no interesting word is found and the \fBauto\-previous\fP style is set to -+a true value, the search continues upward through the history\&. When -+\fBauto\-previous\fP is unset or false (the default), the widget must be -+invoked repeatedly in order to search earlier history lines\&. -+.RE -+.TP -+\fBtranspose\-lines\fP -+Only useful with a multi\-line editing buffer; the lines here are -+lines within the current on\-screen buffer, not history lines\&. -+The effect is similar to the function of the same name in Emacs\&. -+.RS -+.PP -+Transpose the current line with the previous line and move the cursor -+to the start of the next line\&. Repeating this (which can be done by -+providing a positive numeric prefix argument) has the effect of moving -+the line above the cursor down by a number of lines\&. -+.PP -+With a negative numeric prefix argument, requires two lines above the -+cursor\&. These two lines are transposed and the cursor moved to the -+start of the previous line\&. Using a numeric prefix less than \-1 -+has the effect of moving the line above the cursor up by minus that -+number of lines\&. -+.RE -+.TP -+\fBwhich\-command\fP -+This function is a drop\-in replacement for the builtin widget -+\fBwhich\-command\fP\&. It has enhanced behaviour, in that it correctly -+detects whether or not the command word needs to be expanded as an -+alias; if so, it continues tracing the command word from the expanded -+alias until it reaches the command that will be executed\&. -+.RS -+.PP -+The style \fBwhence\fP is available in the context \fB:zle:$WIDGET\fP; this -+may be set to an array to give the command and options that will be used to -+investigate the command word found\&. The default is \fBwhence \-c\fP\&. -+.RE -+.RE -+.PP -+.SS "Utility Functions" -+.PP -+These functions are useful in constructing widgets\&. They -+should be loaded with `\fBautoload \-U\fP \fIfunction\fP\&' and called -+as indicated from user\-defined widgets\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBsplit\-shell\-arguments\fP -+This function splits the line currently being edited into shell arguments -+and whitespace\&. The result is stored in the array \fBreply\fP\&. The array -+contains all the parts of the line in order, starting with any whitespace -+before the first argument, and finishing with any whitespace after the last -+argument\&. Hence (so long as the option \fBKSH_ARRAYS\fP is not set) -+whitespace is given by odd indices in the array and arguments by -+even indices\&. Note that no stripping of quotes is done; joining together -+all the elements of \fBreply\fP in order is guaranteed to produce the -+original line\&. -+.RS -+.PP -+The parameter \fBREPLY\fP is set to the index of the word in \fBreply\fP which -+contains the character after the cursor, where the first element has index -+1\&. The parameter \fBREPLY2\fP is set to the index of the character under the -+cursor in that word, where the first character has index 1\&. -+.PP -+Hence \fBreply\fP, \fBREPLY\fP and \fBREPLY2\fP should all be made local to -+the enclosing function\&. -+.PP -+See the function \fBmodify\-current\-argument\fP, described below, for -+an example of how to call this function\&. -+.RE -+.TP -+\fBmodify\-current\-argument\fP \fIexpr\-using\-\fP\fB$ARG\fP -+This function provides a simple method of allowing user\-defined widgets -+to modify the command line argument under the cursor (or immediately to the -+left of the cursor if the cursor is between arguments)\&. The argument -+should be an expression which when evaluated operates on the shell -+parameter \fBARG\fP, which will have been set to the command line argument -+under the cursor\&. The expression should be suitably quoted to prevent -+it being evaluated too early\&. -+.RS -+.PP -+For example, a user\-defined widget containing the following code -+converts the characters in the argument under the cursor into all upper -+case: -+.PP -+.RS -+.nf -+\fBmodify\-current\-argument \&'${(U)ARG}'\fP -+.fi -+.RE -+.PP -+The following strips any quoting from the current word (whether backslashes -+or one of the styles of quotes), and replaces it with single quoting -+throughout: -+.PP -+.RS -+.nf -+\fBmodify\-current\-argument \&'${(qq)${(Q)ARG}}'\fP -+.fi -+.RE -+.RE -+.RE -+.PP -+.SS "Styles" -+.PP -+The behavior of several of the above widgets can be controlled by the use -+of the \fBzstyle\fP mechanism\&. In particular, widgets that interact with -+the completion system pass along their context to any completions that -+they invoke\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBbreak\-keys\fP -+This style is used by the \fBincremental\-complete\-word\fP widget\&. Its value -+should be a pattern, and all keys matching this pattern will cause the -+widget to stop incremental completion without the key having any further -+effect\&. Like all styles used directly by -+\fBincremental\-complete\-word\fP, this style is looked up using the -+context `\fB:incremental\fP\&'\&. -+.TP -+\fBcompleter\fP -+The \fBincremental\-complete\-word\fP and \fBinsert\-and\-predict\fP widgets set -+up their top\-level context name before calling completion\&. This allows -+one to define different sets of completer functions for normal completion -+and for these widgets\&. For example, to use completion, approximation and -+correction for normal completion, completion and correction for -+incremental completion and only completion for prediction one could use: -+.RS -+.PP -+.RS -+.nf -+\fBzstyle \&':completion:*' completer \e -+ _complete _correct _approximate -+zstyle \&':completion:incremental:*' completer \e -+ _complete _correct -+zstyle \&':completion:predict:*' completer \e -+ _complete\fP -+.fi -+.RE -+.PP -+It is a good idea to restrict the completers used in prediction, because -+they may be automatically invoked as you type\&. The \fB_list\fP and -+\fB_menu\fP completers should never be used with prediction\&. The -+\fB_approximate\fP, \fB_correct\fP, \fB_expand\fP, and \fB_match\fP completers may -+be used, but be aware that they may change characters anywhere in the word -+behind the cursor, so you need to watch carefully that the result is what -+you intended\&. -+.RE -+.TP -+\fBcursor\fP -+The \fBinsert\-and\-predict\fP widget uses this style, in the context -+`\fB:predict\fP\&', to decide where to place the cursor after completion has -+been tried\&. Values are: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBcomplete\fP -+The cursor is left where it was when completion finished, but only if -+it is after a character equal to the one just inserted by the user\&. If -+it is after another character, this value is the same as `\fBkey\fP\&'\&. -+.TP -+\fBkey\fP -+The cursor is left -+after the \fIn\fPth occurrence of the character just inserted, where -+\fIn\fP is the number of times that character appeared in the word -+before completion was attempted\&. In short, this has the effect of -+leaving the cursor after the character just typed even if the -+completion code found out that no other characters need to be inserted -+at that position\&. -+.PP -+Any other value for this style unconditionally leaves the cursor at the -+position where the completion code left it\&. -+.RE -+.TP -+\fBlist\fP -+When using the \fBincremental\-complete\-word\fP widget, this style says -+if the matches should be listed on every key press (if they fit on the -+screen)\&. Use the context prefix `\fB:completion:incremental\fP\&'\&. -+.RS -+.PP -+The \fBinsert\-and\-predict\fP widget uses this style to decide if the -+completion should be shown even if there is only one possible completion\&. -+This is done if the value of this style is the string \fBalways\fP\&. In this -+case the context is `\fB:predict\fP\&' (\fInot\fP `\fB:completion:predict\fP')\&. -+.RE -+.TP -+\fBmatch\fP -+This style is used by \fBsmart\-insert\-last\-word\fP to provide a pattern -+(using full \fBEXTENDED_GLOB\fP syntax) that matches an interesting word\&. -+The context is the name of the widget to which \fBsmart\-insert\-last\-word\fP -+is bound (see above)\&. The default behavior of \fBsmart\-insert\-last\-word\fP -+is equivalent to: -+.RS -+.PP -+.RS -+.nf -+\fBzstyle :insert\-last\-word match \&'*[[:alpha:]/\e\e]*'\fP -+.fi -+.RE -+.PP -+However, you might want to include words that contain spaces: -+.PP -+.RS -+.nf -+\fBzstyle :insert\-last\-word match \&'*[[:alpha:][:space:]/\e\e]*'\fP -+.fi -+.RE -+.PP -+Or include numbers as long as the word is at least two characters long: -+.PP -+.RS -+.nf -+\fBzstyle :insert\-last\-word match \&'*([[:digit:]]?|[[:alpha:]/\e\e])*'\fP -+.fi -+.RE -+.PP -+The above example causes redirections like "2>" to be included\&. -+.RE -+.TP -+\fBprompt\fP -+The \fBincremental\-complete\-word\fP widget shows the value of this -+style in the status line during incremental completion\&. The string -+value may contain any of the following substrings in the manner of -+the \fBPS1\fP and other prompt parameters: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB%c\fP -+Replaced by the name of the completer function that generated the -+matches (without the leading underscore)\&. -+.TP -+\fB%l\fP -+When the \fBlist\fP style is set, -+replaced by `\fB\&.\&.\&.\fP\&' if the list of matches is too long to fit on the -+screen and with an empty string otherwise\&. If the \fBlist\fP style is -+`false\&' or not set, `\fB%l\fP' is always removed\&. -+.TP -+\fB%n\fP -+Replaced by the number of matches generated\&. -+.TP -+\fB%s\fP -+Replaced by `\fB\-no match\-\fP\&', `\fB\-no prefix\-\fP', or an empty string -+if there is no completion matching the word on the line, if the -+matches have no common prefix different from the word on the line, or -+if there is such a common prefix, respectively\&. -+.TP -+\fB%u\fP -+Replaced by the unambiguous part of all matches, if there -+is any, and if it is different from the word on the line\&. -+.PP -+Like `\fBbreak\-keys\fP\&', this uses the `\fB:incremental\fP' context\&. -+.RE -+.TP -+\fBstop\-keys\fP -+This style is used by the \fBincremental\-complete\-word\fP widget\&. Its value -+is treated similarly to the one for the \fBbreak\-keys\fP style (and uses -+the same context: `\fB:incremental\fP\&')\&. However, in -+this case all keys matching the pattern given as its value will stop -+incremental completion and will then execute their usual function\&. -+.TP -+\fBtoggle\fP -+This boolean style is used by \fBpredict\-on\fP and its related widgets in -+the context `\fB:predict\fP\&'\&. If set to one of the standard `true' values, -+predictive typing is automatically toggled off in situations where it is -+unlikely to be useful, such as when editing a multi\-line buffer or after -+moving into the middle of a line and then deleting a character\&. The -+default is to leave prediction turned on until an explicit call to -+\fBpredict\-off\fP\&. -+.TP -+\fBverbose\fP -+This boolean style is used by \fBpredict\-on\fP and its related widgets in -+the context `\fB:predict\fP\&'\&. If set to one of the standard `true' values, -+these widgets display a message below the prompt when the predictive state -+is toggled\&. This is most useful in combination with the \fBtoggle\fP style\&. -+The default does not display these messages\&. -+.TP -+\fBwidget\fP -+This style is similar to the \fBcommand\fP style: For widget functions that -+use \fBzle\fP to call other widgets, this style can sometimes be used to -+override the widget which is called\&. The context for this style is the -+name of the calling widget (\fInot\fP the name of the calling function, -+because one function may be bound to multiple widget names)\&. -+.RS -+.PP -+.RS -+.nf -+\fBzstyle :copy\-earlier\-word widget smart\-insert\-last\-word\fP -+.fi -+.RE -+.PP -+Check the documentation for the calling widget or function to determine -+whether the \fBwidget\fP style is used\&. -+.RE -+.RE -+.PP -+.SH "EXCEPTION HANDLING" -+.PP -+Two functions are provided to enable zsh to provide exception handling in a -+form that should be familiar from other languages\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBthrow\fP \fIexception\fP -+The function \fBthrow\fP throws the named \fIexception\fP\&. The name is -+an arbitrary string and is only used by the \fBthrow\fP and \fBcatch\fP -+functions\&. An exception is for the most part treated the same as a -+shell error, i\&.e\&. an unhandled exception will cause the shell to abort all -+processing in a function or script and to return to the top level in an -+interactive shell\&. -+.TP -+\fBcatch\fP \fIexception\-pattern\fP -+The function \fBcatch\fP returns status zero if an exception was thrown and -+the pattern \fIexception\-pattern\fP matches its name\&. Otherwise it -+returns status 1\&. \fIexception\-pattern\fP is a standard -+shell pattern, respecting the current setting of the \fBEXTENDED_GLOB\fP -+option\&. An alias \fBcatch\fP is also defined to prevent the argument to the -+function from matching filenames, so patterns may be used unquoted\&. Note -+that as exceptions are not fundamentally different from other shell errors -+it is possible to catch shell errors by using an empty string as the -+exception name\&. The shell variable \fBCAUGHT\fP is set by \fBcatch\fP to the -+name of the exception caught\&. It is possible to rethrow an exception by -+calling the \fBthrow\fP function again once an exception has been caught\&. -+.PP -+The functions are designed to be used together with the \fBalways\fP construct -+described in -+\fIzshmisc\fP(1)\&. This is important as only this -+construct provides the required support for exceptions\&. A typical example -+is as follows\&. -+.PP -+.RS -+.nf -+\fB{ -+ # "try" block -+ # \&.\&.\&. nested code here calls "throw MyExcept" -+} always { -+ # "always" block -+ if catch MyExcept; then -+ print "Caught exception MyExcept" -+ elif catch \&''; then -+ print "Caught a shell error\&. Propagating\&.\&.\&." -+ throw \&'' -+ fi -+ # Other exceptions are not handled but may be caught further -+ # up the call stack\&. -+}\fP -+.fi -+.RE -+.PP -+If all exceptions should be caught, the following idiom might be -+preferable\&. -+.PP -+.RS -+.nf -+\fB{ -+ # \&.\&.\&. nested code here throws an exception -+} always { -+ if catch *; then -+ case $CAUGHT in -+ (MyExcept) -+ print "Caught my own exception" -+ ;; -+ (*) -+ print "Caught some other exception" -+ ;; -+ esac -+ fi -+}\fP -+.fi -+.RE -+.PP -+In common with exception handling in other languages, the exception may be -+thrown by code deeply nested inside the `try\&' block\&. However, note that it -+must be thrown inside the current shell, not in a subshell forked for a -+pipeline, parenthesised current\-shell construct, or some form of -+command or process substitution\&. -+.PP -+The system internally uses the shell variable \fBEXCEPTION\fP to record the -+name of the exception between throwing and catching\&. One drawback of this -+scheme is that if the exception is not handled the variable \fBEXCEPTION\fP -+remains set and may be incorrectly recognised as the name of an exception -+if a shell error subsequently occurs\&. Adding \fBunset EXCEPTION\fP at the -+start of the outermost layer of any code that uses exception handling will -+eliminate this problem\&. -+.PP -+.SH "MIME FUNCTIONS" -+.PP -+Three functions are available to provide handling of files recognised by -+extension, for example to dispatch a file \fBtext\&.ps\fP when executed as a -+command to an appropriate viewer\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBzsh\-mime\-setup\fP [ \fB\-fv\fP ] [ \fB\-l\fP [ \fIsuffix \&.\&.\&.\fP ] ] -+.TP -+.PD -+\fBzsh\-mime\-handler [\-l] \fIcommand arguments \&.\&.\&.\fP\fP -+These two functions use the files \fB~/\&.mime\&.types\fP and \fB/etc/mime\&.types\fP, -+which associate types and extensions, as well as \fB~/\&.mailcap\fP and -+\fB/etc/mailcap\fP files, which associate types and the programs that -+handle them\&. These are provided on many systems with the Multimedia -+Internet Mail Extensions\&. -+.RS -+.PP -+To enable the system, the function \fBzsh\-mime\-setup\fP should be -+autoloaded and run\&. This allows files with extensions to be treated -+as executable; such files be completed by the function completion system\&. -+The function \fBzsh\-mime\-handler\fP should not need to be called by the -+user\&. -+.PP -+The system works by setting up suffix aliases with `\fBalias \-s\fP\&'\&. -+Suffix aliases already installed by the user will not be overwritten\&. -+.PP -+For suffixes defined in lower case, upper case variants will also -+automatically be handled (e\&.g\&. \fBPDF\fP is automatically handled if -+handling for the suffix \fBpdf\fP is defined), but not vice versa\&. -+.PP -+Repeated calls to \fBzsh\-mime\-setup\fP do not override the existing -+mapping between suffixes and executable files unless the option \fB\-f\fP -+is given\&. Note, however, that this does not override existing suffix -+aliases assigned to handlers other than \fBzsh\-mime\-handler\fP\&. -+.PP -+Calling \fBzsh\-mime\-setup\fP with the option \fB\-l\fP lists the existing -+mappings without altering them\&. Suffixes to list (which may contain -+pattern characters that should be quoted from immediate interpretation -+on the command line) may be given as additional arguments, otherwise -+all suffixes are listed\&. -+.PP -+Calling \fBzsh\-mime\-setup\fP with the option -+\fB\-v\fP causes verbose output to be shown during the setup operation\&. -+.PP -+The system respects the \fBmailcap\fP flags \fBneedsterminal\fP and -+\fBcopiousoutput\fP, see \fImailcap\fP(4)\&. -+.PP -+The functions use the following styles, which are defined with the -+\fBzstyle\fP builtin command (see \fIzshmodules\fP(1))\&. They should be defined -+before \fBzsh\-mime\-setup\fP is run\&. The contexts used all -+start with \fB:mime:\fP, with additional components in some cases\&. -+It is recommended that a trailing \fB*\fP (suitably quoted) be appended -+to style patterns in case the system is extended in future\&. Some -+examples are given below\&. -+.PD 0 -+.TP -+.PD -+\fBcurrent\-shell\fP -+If this boolean style is true, the mailcap handler for the context in -+question is run using the \fBeval\fP builtin instead of by starting a new -+\fBsh\fP process\&. This is more efficient, but may not work in the occasional -+cases where the mailcap handler uses strict POSIX syntax\&. -+.TP -+\fBexecute\-as\-is\fP -+This style gives a list of patterns to be matched against files -+passed for execution with a handler program\&. If the file matches -+the pattern, the entire command line is executed in its current form, -+with no handler\&. This is useful for files which might have suffixes -+but nonetheless be executable in their own right\&. If the style -+is not set, the pattern \fB*(*) *(/)\fP is used; -+hence executable files are executed directly and not passed to a -+handler, and the option \fBAUTO_CD\fP may be used to change to directories -+that happen to have MIME suffixes\&. -+.TP -+\fBfile\-path\fP -+Used if the style \fBfind\-file\-in\-path\fP is true for the same context\&. -+Set to an array of directories that are used for searching for the -+file to be handled; the default is the command path given by the -+special parameter \fBpath\fP\&. The shell option \fBPATH_DIRS\fP is respected; -+if that is set, the appropriate path will be searched even if the -+name of the file to be handled as it appears on the command line contains -+a `\fB/\fP\&'\&. -+The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style -+\fBhandler\fP\&. -+.TP -+\fBfind\-file\-in\-path\fP -+If set, allows files whose names do not contain absolute paths -+to be searched for in the command path or the path specified by the -+\fBfile\-path\fP style\&. If the file is not found in the path, it is looked -+for locally (whether or not the current directory is in the path); if it is -+not found locally, the handler will abort unless the \fBhandle\-nonexistent\fP -+style is set\&. Files found in the path are tested as described for -+the style \fBexecute\-as\-is\fP\&. -+The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style -+\fBhandler\fP\&. -+.TP -+\fBflags\fP -+Defines flags to go with a handler; the context is as for the -+\fBhandler\fP style, and the format is as for the flags in \fBmailcap\fP\&. -+.TP -+\fBhandle\-nonexistent\fP -+By default, arguments that don\&'t correspond to files are not passed -+to the MIME handler in order to prevent it from intercepting commands found -+in the path that happen to have suffixes\&. This style may be set to -+an array of extended glob patterns for arguments that will be passed to the -+handler even if they don\&'t exist\&. If it is not explicitly set it -+defaults to \fB[[:alpha:]]#:/*\fP which allows URLs to be passed to the MIME -+handler even though they don\&'t exist in that format in the file system\&. -+The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style -+\fBhandler\fP\&. -+.TP -+\fBhandler\fP -+Specifies a handler for a suffix; the suffix is given by the context as -+\fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, and the format of the handler is exactly -+that in \fBmailcap\fP\&. Note in particular the `\fB\&.\fP\&' and trailing colon -+to distinguish this use of the context\&. This overrides any handler -+specified by the \fBmailcap\fP files\&. If the handler requires a terminal, -+the \fBflags\fP style should be set to include the word \fBneedsterminal\fP, -+or if the output is to be displayed through a pager (but not if the -+handler is itself a pager), it should include \fBcopiousoutput\fP\&. -+.TP -+\fBmailcap\fP -+A list of files in the format of \fB~/\&.mailcap\fP and -+\fB/etc/mailcap\fP to be read during setup, replacing the default list -+which consists of those two files\&. The context is \fB:mime:\fP\&. -+A \fB+\fP in the list will be replaced by the default files\&. -+.TP -+\fBmailcap\-priorities\fP -+This style is used to resolve multiple mailcap entries for the same MIME -+type\&. It consists of an array of the following elements, in descending -+order of priority; later entries will be used if earlier entries are -+unable to resolve the entries being compared\&. If none of the tests -+resolve the entries, the first entry encountered is retained\&. -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBfiles\fP -+The order of files (entries in the \fBmailcap\fP style) read\&. Earlier -+files are preferred\&. (Note this does not resolve entries in the same file\&.) -+.TP -+\fBpriority\fP -+The priority flag from the mailcap entry\&. The priority is an integer -+from 0 to 9 with the default value being 5\&. -+.TP -+\fBflags\fP -+The test given by the \fBmailcap\-prio\-flags\fP option is used to resolve -+entries\&. -+.TP -+\fBplace\fP -+Later entries are preferred; as the entries are strictly ordered, this -+test always succeeds\&. -+.PP -+Note that as this style is handled during initialisation, the context -+is always \fB:mime:\fP, with no discrimination by suffix\&. -+.RE -+.TP -+\fBmailcap\-prio\-flags\fP -+This style is used when the keyword \fBflags\fP is encountered in the -+list of tests specified by the \fBmailcap\-priorities\fP style\&. -+It should be set to a list of patterns, each of which is tested against -+the flags specified in the mailcap entry (in other words, the sets of -+assignments found with some entries in the mailcap file)\&. Earlier -+patterns in the list are preferred to later ones, and matched patterns -+are preferred to unmatched ones\&. -+.TP -+\fBmime\-types\fP -+A list of files in the format of \fB~/\&.mime\&.types\fP and -+\fB/etc/mime\&.types\fP to be read during setup, replacing the default list -+which consists of those two files\&. The context is \fB:mime:\fP\&. -+A \fB+\fP in the list will be replaced by the default files\&. -+.TP -+\fBnever\-background\fP -+If this boolean style is set, the handler for the given context is -+always run in the foreground, even if the flags provided in the mailcap -+entry suggest it need not be (for example, it doesn\&'t require a -+terminal)\&. -+.TP -+\fBpager\fP -+If set, will be used instead of \fB$PAGER\fP or \fBmore\fP to handle -+suffixes where the \fBcopiousoutput\fP flag is set\&. The context is -+as for \fBhandler\fP, i\&.e\&. \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP for handling -+a file with the given \fIsuffix\fP\&. -+.PP -+Examples: -+.PP -+.RS -+.nf -+\fBzstyle \&':mime:*' mailcap ~/\&.mailcap /usr/local/etc/mailcap -+zstyle \&':mime:\&.txt:' handler less %s -+zstyle \&':mime:\&.txt:' flags needsterminal\fP -+.fi -+.RE -+.PP -+When \fBzsh\-mime\-setup\fP is subsequently run, it will look for -+\fBmailcap\fP entries in the two files given\&. Files of suffix \fB\&.txt\fP -+will be handled by running `\fBless\fP \fIfile\&.txt\fP\&'\&. The flag -+\fBneedsterminal\fP is set to show that this program must run attached to a -+terminal\&. -+.PP -+As there are several steps to dispatching a command, the following -+should be checked if attempting to execute a file by extension -+\fB\&.\fP\fIext\fP does not have the expected effect\&. -+.PP -+The command `\fBalias \-s\fP \fIext\fP\&' should show -+`\fBps=zsh\-mime\-handler\fP\&'\&. If it shows something else, another suffix -+alias was already installed and was not overwritten\&. If it shows -+nothing, no handler was installed: this is most likely because no -+handler was found in the \fB\&.mime\&.types\fP and \fBmailcap\fP combination for -+\fB\&.ext\fP files\&. In that case, appropriate handling should be added to -+\fB~/\&.mime\&.types\fP and \fBmailcap\fP\&. -+.PP -+If the extension is handled by \fBzsh\-mime\-handler\fP but the file is -+not opened correctly, either the handler defined for the type is -+incorrect, or the flags associated with it are in appropriate\&. Running -+\fBzsh\-mime\-setup \-l\fP will show the handler and, if there are any, the -+flags\&. A \fB%s\fP in the handler is replaced by the file (suitably quoted -+if necessary)\&. Check that the handler program listed lists and can -+be run in the way shown\&. Also check that the flags \fBneedsterminal\fP or -+\fBcopiousoutput\fP are set if the handler needs to be run under a -+terminal; the second flag is used if the output should be sent to a pager\&. -+An example of a suitable \fBmailcap\fP entry for such a program is: -+.PP -+.RS -+.nf -+\fBtext/html; /usr/bin/lynx \&'%s'; needsterminal\fP -+.fi -+.RE -+.PP -+Running `\fBzsh\-mime\-handler \-l\fP \fIcommand line\fP\&' prints the command -+line that would be executed, simplified to remove the effect of any -+flags, and quoted so that the output can be run as a complete zsh -+command line\&. This is used by the completion system to decide how to -+complete after a file handled by \fBzsh\-mime\-setup\fP\&. -+.RE -+.TP -+\fBpick\-web\-browser\fP -+This function is separate from the two MIME functions described above -+and can be assigned directly to a suffix: -+.RS -+.PP -+.RS -+.nf -+\fBautoload \-U pick\-web\-browser -+alias \-s html=pick\-web\-browser\fP -+.fi -+.RE -+.PP -+It is provided as an intelligent front end to dispatch a web browser\&. -+It may be run as either a function or a shell script\&. The status -+255 is returned if no browser could be started\&. -+.PP -+Various styles are available to customize the choice of browsers: -+.PP -+.PD 0 -+.TP -+.PD -+\fBbrowser\-style\fP -+The value of the style is an array giving preferences in decreasing order -+for the type of browser to use\&. The values of elements may be -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBrunning\fP -+Use a GUI browser that is already running when an X Window display is -+available\&. The browsers listed in the \fBx\-browsers\fP style are tried -+in order until one is found; if it is, the file will be displayed in -+that browser, so the user may need to check whether it has appeared\&. -+If no running browser is found, one is not started\&. Browsers other than -+Firefox, Opera and Konqueror are assumed to understand the Mozilla -+syntax for opening a URL remotely\&. -+.TP -+\fBx\fP -+Start a new GUI browser when an X Window display is available\&. Search for -+the availability of one of the browsers listed in the \fBx\-browsers\fP style -+and start the first one that is found\&. No check is made for an already -+running browser\&. -+.TP -+\fBtty\fP -+Start a terminal\-based browser\&. Search for the availability of one -+of the browsers listed in the \fBtty\-browsers\fP style and start the -+first one that is found\&. -+.PP -+If the style is not set the default \fBrunning x tty\fP is used\&. -+.RE -+.TP -+\fBx\-browsers\fP -+An array in decreasing order -+of preference of browsers to use when running under the X Window System\&. -+The array consists of the command name under which to start the -+browser\&. They are looked up in the context \fB:mime:\fP (which may -+be extended in future, so appending `\fB*\fP\&' is recommended)\&. For -+example, -+.RS -+.PP -+.RS -+.nf -+\fBzstyle \&':mime:*' x\-browsers opera konqueror firefox\fP -+.fi -+.RE -+.PP -+specifies that \fBpick\-web\-browser\fP should first look for a running -+instance of Opera, Konqueror or Firefox, in that order, and if it -+fails to find any should attempt to start Opera\&. The default is -+\fBfirefox mozilla netscape opera konqueror\fP\&. -+.RE -+.TP -+\fBtty\-browsers\fP -+An array similar to \fBx\-browsers\fP, except that it gives browsers to -+use use when no X Window display is available\&. The default is -+\fBelinks links lynx\fP\&. -+.TP -+\fBcommand\fP -+If it is set this style is used to pick the command -+used to open a page for a browser\&. The context is -+\fB:mime:browser:new:$browser:\fP to start a new browser or -+\fB:mime:browser:running:$browser:\fP to open a URL in a browser already -+running on the current X display, where \fB$browser\fP is the value matched -+in the \fBx\-browsers\fP or \fBtty\-browsers\fP style\&. The escape sequence -+\fB%b\fP in the style\&'s value will be replaced by the browser, while \fB%u\fP -+will be replaced by the URL\&. If the style is not set, the default for all -+new instances is equivalent to \fB%b %u\fP and the defaults for using running -+browsers are equivalent to the values \fBkfmclient openURL %u\fP for -+Konqueror, \fBfirefox \-new\-tab %u\fP for Firefox, \fBopera \-newpage %u\fP -+for Opera, and \fB%b \-remote "openUrl(%u)"\fP for all others\&. -+.RE -+.RE -+.PP -+.SH "MATHEMATICAL FUNCTIONS" -+.PP -+.PD 0 -+.TP -+.PD -+\fBzcalc\fP [ \fIexpression\fP \&.\&.\&. ] -+A reasonably powerful calculator based on zsh\&'s arithmetic evaluation -+facility\&. The syntax is similar to that of formulae in most programming -+languages; see -+the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) for details\&. The mathematical -+library \fBzsh/mathfunc\fP will be loaded if it is available; see -+the section `The zsh/mathfunc Module\&' in \fIzshmodules\fP(1)\&. The mathematical functions -+correspond to the raw system libraries, so trigonometric functions are -+evaluated using radians, and so on\&. -+.RS -+.PP -+Each line typed is evaluated as an expression\&. The prompt shows a number, -+which corresponds to a positional parameter where the result of that -+calculation is stored\&. For example, the result of the calculation on the -+line preceded by `\fB4> \fP\&' is available as \fB$4\fP\&. The last value -+calculated is available as \fBans\fP\&. Full command line editing, including -+the history of previous calculations, is available; the history is saved in -+the file \fB~/\&.zcalc_history\fP\&. To exit, enter a blank line or type `\fB:q\fP\&' -+on its own (`\fBq\fP\&' is allowed for historical compatibility)\&. -+.PP -+If arguments are given to \fBzcalc\fP on start up, they are used to prime the -+first few positional parameters\&. A visual indication of this is given when -+the calculator starts\&. -+.PP -+The constants \fBPI\fP (3\&.14159\&.\&.\&.) and \fBE\fP (2\&.71828\&.\&.\&.) are provided\&. -+Parameter assignment is possible, but note that all parameters will be put -+into the global namespace\&. -+.PP -+The output base can be initialised by passing the option `\fB\-#\fP\fIbase\fP\&', -+for example `\fBzcalc \-#16\fP\&' (the `\fB#\fP' may have to be quoted, depending -+on the globbing options set)\&. -+.PP -+The prompt is configurable via the parameter \fBZCALCPROMPT\fP, which -+undergoes standard prompt expansion\&. The index of the current entry is -+stored locally in the first element of the array \fBpsvar\fP, which can be -+referred to in \fBZCALCPROMPT\fP as `\fB%1v\fP\&'\&. The default prompt is -+`\fB%1v> \fP\&'\&. -+.PP -+A few special commands are available; these are introduced by a colon\&. -+For backward compatibility, the colon may be omitted for certain -+commands\&. Completion is available if \fBcompinit\fP has been run\&. -+.PP -+The output precision may be specified within zcalc by special commands -+familiar from many calculators\&. -+.PD 0 -+.TP -+.PD -+\fB:norm\fP -+The default output format\&. It corresponds to the printf \fB%g\fP -+specification\&. Typically this shows six decimal digits\&. -+.TP -+\fB:sci\fP \fIdigits\fP -+Scientific notation, corresponding to the printf \fB%g\fP output format with -+the precision given by \fIdigits\fP\&. This produces either fixed point or -+exponential notation depending on the value output\&. -+.TP -+\fB:fix\fP \fIdigits\fP -+Fixed point notation, corresponding to the printf \fB%f\fP output format with -+the precision given by \fIdigits\fP\&. -+.TP -+\fB:eng\fP \fIdigits\fP -+Exponential notation, corresponding to the printf \fB%E\fP output format with -+the precision given by \fIdigits\fP\&. -+.TP -+\fB:raw\fP -+Raw output: this is the default form of the output from a math -+evaluation\&. This may show more precision than the number actually -+possesses\&. -+.PP -+Other special commands: -+.PD 0 -+.TP -+.PD -+\fB:!\fP\fIline\&.\&.\&.\fP -+Execute \fIline\&.\&.\&.\fP as a normal shell command line\&. Note that it -+is executed in the context of the function, i\&.e\&. with local variables\&. -+Space is optional after \fB:!\fP\&. -+.TP -+\fB:local\fP \fIarg\fP \&.\&.\&. -+Declare variables local to the function\&. Note that certain variables -+are used by the function for its own purposes\&. Other variables -+may be used, too, but they will be taken from or put into the global -+scope\&. -+.TP -+\fB:function\fP \fIname\fP [ \fIbody\fP ] -+Define a mathematical function or (with no \fIbody\fP) delete it\&. -+The function is defined using \fBzmathfuncdef\fP, see below\&. -+.RS -+.PP -+Note that \fBzcalc\fP takes care of all quoting\&. Hence for example: -+.PP -+.RS -+.nf -+\fBfunction cube $1 * $1 * $1\fP -+.fi -+.RE -+.PP -+defines a function to cube the sole argument\&. -+.RE -+.TP -+\fB[#\fP\fIbase\fP\fB]\fP -+This is not a special command, rather part of normal arithmetic -+syntax; however, when this form appears on a line by itself the default -+output radix is set to \fIbase\fP\&. Use, for example, `\fB[#16]\fP\&' to display -+hexadecimal output preceded by an indication of the base, or `\fB[##16]\fP\&' -+just to display the raw number in the given base\&. Bases themselves are -+always specified in decimal\&. `\fB[#]\fP\&' restores the normal output format\&. -+Note that setting an output base suppresses floating point output; use -+`\fB[#]\fP\&' to return to normal operation\&. -+.PP -+See the comments in the function for a few extra tips\&. -+.RE -+.TP -+\fBzmathfuncdef\fP [ \fImathfunc\fP [ \fIbody\fP ] ] -+A convenient front end to \fBfunctions \-M\fP\&. -+.RS -+.PP -+With two arguments, define a mathematical function named \fImathfunc\fP -+which can be used in any form of arithmetic evaluation\&. \fIbody\fP -+is a mathematical expression to implement the function\&. It may -+contain references to position parameters \fB$1\fP, \fB$2\fP, \&.\&.\&. -+to refer to mandatory parameters and \fB${1:\-\fP\fIdefvalue\fP\fB}\fP \&.\&.\&. -+to refer to optional parameters\&. Note that the forms must be -+strictly adhered to for the function to calculate the correct number -+of arguments\&. The implementation is held in a shell function named -+\fBzsh_math_func_\fP\fImathfunc\fP; usually the user will not need -+to refer to the shell function directly\&. Any existing function -+of the same name is silently replaced\&. -+.PP -+With one argument, remove the mathematical function \fImathfunc\fP -+as well as the shell function implementation\&. -+.PP -+With no arguments, list all \fImathfunc\fP functions in a form -+suitable for restoring the definition\&. -+The functions have not necessarily been defined by \fBzmathfuncdef\fP\&. -+.RE -+.RE -+.PP -+.SH "USER CONFIGURATION FUNCTIONS" -+.PP -+The \fBzsh/newuser\fP module comes with a function to aid in configuring -+shell options for new users\&. If the module is installed, this function can -+also be run by hand\&. It is available even if the module\&'s default -+behaviour, namely running the function for a new user logging in without -+startup files, is inhibited\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBzsh\-newuser\-install\fP [ \fB\-f\fP ] -+The function presents the user with various options for customizing -+their initialization scripts\&. Currently only \fB~/\&.zshrc\fP is handled\&. -+\fB$ZDOTDIR/\&.zshrc\fP is used instead if the parameter \fBZDOTDIR\fP is -+set; this provides a way for the user to configure a file without -+altering an existing \fB\&.zshrc\fP\&. -+.RS -+.PP -+By default the function exits immediately if it finds any of the files -+\fB\&.zshenv\fP, \fB\&.zprofile\fP, \fB\&.zshrc\fP, or \fB\&.zlogin\fP in the appropriate -+directory\&. The option \fB\-f\fP is required in order to force the function -+to continue\&. Note this may happen even if \fB\&.zshrc\fP itself does not -+exist\&. -+.PP -+As currently configured, the function will exit immediately if the -+user has root privileges; this behaviour cannot be overridden\&. -+.PP -+Once activated, the function\&'s behaviour is supposed to be -+self\-explanatory\&. Menus are present allowing the user to alter -+the value of options and parameters\&. Suggestions for improvements are -+always welcome\&. -+.PP -+When the script exits, the user is given the opportunity to save the new -+file or not; changes are not irreversible until this point\&. However, -+the script is careful to restrict changes to the file only to a group -+marked by the lines `\fB# Lines configured by zsh\-newuser\-install\fP\&' and -+`\fB# End of lines configured by zsh\-newuser\-install\fP\&'\&. In addition, -+the old version of \fB\&.zshrc\fP is saved to a file with the suffix -+\fB\&.zni\fP appended\&. -+.PP -+If the function edits an existing \fB\&.zshrc\fP, it is up to the user -+to ensure that the changes made will take effect\&. For example, if -+control usually returns early from the existing \fB\&.zshrc\fP the lines -+will not be executed; or a later initialization file may override -+options or parameters, and so on\&. The function itself does not attempt to -+detect any such conflicts\&. -+.RE -+.RE -+.PP -+.SH "OTHER FUNCTIONS" -+.PP -+There are a large number of helpful functions in the \fBFunctions/Misc\fP -+directory of the zsh distribution\&. Most are very simple and do not -+require documentation here, but a few are worthy of special mention\&. -+.PP -+.SS "Descriptions" -+.PP -+.PD 0 -+.TP -+.PD -+\fBcolors\fP -+This function initializes several associative arrays to map color names to -+(and from) the ANSI standard eight\-color terminal codes\&. These are used -+by the prompt theme system (see above)\&. You seldom should need to run -+\fBcolors\fP more than once\&. -+.RS -+.PP -+The eight base colors are: black, red, green, yellow, blue, magenta, cyan, -+and white\&. Each of these has codes for foreground and background\&. In -+addition there are eight intensity attributes: bold, faint, standout, -+underline, blink, reverse, and conceal\&. Finally, there are six codes used -+to negate attributes: none (reset all attributes to the defaults), normal -+(neither bold nor faint), no\-standout, no\-underline, no\-blink, and -+no\-reverse\&. -+.PP -+Some terminals do not support all combinations of colors and intensities\&. -+.PP -+The associative arrays are: -+.PP -+.PD 0 -+.TP -+.PD 0 -+color -+.TP -+.PD -+colour -+Map all the color names to their integer codes, and integer codes to the -+color names\&. The eight base names map to the foreground color codes, as -+do names prefixed with `\fBfg\-\fP\&', such as `\fBfg\-red\fP'\&. Names prefixed -+with `\fBbg\-\fP\&', such as `\fBbg\-blue\fP', refer to the background codes\&. The -+reverse mapping from code to color yields base name for foreground codes -+and the \fBbg\-\fP form for backgrounds\&. -+.RS -+.PP -+Although it is a misnomer to call them `colors\&', these arrays also map the -+other fourteen attributes from names to codes and codes to names\&. -+.RE -+.TP -+.PD 0 -+fg -+.TP -+.PD 0 -+fg_bold -+.TP -+.PD -+fg_no_bold -+Map the eight basic color names to ANSI terminal escape sequences that set -+the corresponding foreground text properties\&. The \fBfg\fP sequences change -+the color without changing the eight intensity attributes\&. -+.TP -+.PD 0 -+bg -+.TP -+.PD 0 -+bg_bold -+.TP -+.PD -+bg_no_bold -+Map the eight basic color names to ANSI terminal escape sequences that set -+the corresponding background properties\&. The \fBbg\fP sequences change the -+color without changing the eight intensity attributes\&. -+.PP -+In addition, the scalar parameters \fBreset_color\fP and \fBbold_color\fP are -+set to the ANSI terminal escapes that turn off all attributes and turn on -+bold intensity, respectively\&. -+.RE -+.TP -+\fBfned\fP \fIname\fP -+Same as \fBzed \-f\fP\&. This function does not appear in the zsh -+distribution, but can be created by linking \fBzed\fP to the name \fBfned\fP -+in some directory in your \fBfpath\fP\&. -+.TP -+\fBis\-at\-least\fP \fIneeded\fP [ \fIpresent\fP ] -+Perform a greater\-than\-or\-equal\-to comparison of two strings having the -+format of a zsh version number; that is, a string of numbers and text with -+segments separated by dots or dashes\&. If the \fIpresent\fP string is not -+provided, \fB$ZSH_VERSION\fP is used\&. Segments are paired left\-to\-right in -+the two strings with leading non\-number parts ignored\&. If one string has -+fewer segments than the other, the missing segments are considered zero\&. -+.RS -+.PP -+This is useful in startup files to set options and other state that are -+not available in all versions of zsh\&. -+.PP -+.RS -+.nf -+\fBis\-at\-least 3\&.1\&.6\-15 && setopt NO_GLOBAL_RCS -+is\-at\-least 3\&.1\&.0 && setopt HIST_REDUCE_BLANKS -+is\-at\-least 2\&.6\-17 || print "You can\&'t use is\-at\-least here\&."\fP -+.fi -+.RE -+.RE -+.TP -+\fBnslookup\fP [ \fIarg\fP \&.\&.\&. ] -+This wrapper function for the \fBnslookup\fP command requires the -+\fBzsh/zpty\fP module (see -+\fIzshmodules\fP(1))\&. It behaves exactly like the standard \fBnslookup\fP -+except that it provides customizable prompts (including a right\-side -+prompt) and completion of nslookup commands, host names, etc\&. (if you use -+the function\-based completion system)\&. Completion styles may be set with -+the context prefix `\fB:completion:nslookup\fP\&'\&. -+.RS -+.PP -+See also the \fBpager\fP, \fBprompt\fP and \fBrprompt\fP styles below\&. -+.RE -+.TP -+\fBregexp\-replace\fP \fIvar\fP \fIregexp\fP \fIreplace\fP -+Use regular expressions to perform a global search and replace operation -+on a variable\&. If the option \fBRE_MATCH_PCRE\fP is not set, POSIX -+extended regular expressions are used, else Perl\-compatible regular -+expressions (this requires the shell to be linked against the \fBpcre\fP -+library)\&. -+.RS -+.PP -+\fIvar\fP is the name of the variable containing the string to be matched\&. -+The variable will be modified directly by the function\&. The -+variables \fBMATCH\fP, \fBMBEGIN\fP, \fBMEND\fP, \fBmatch\fP, \fBmbegin\fP, \fBmend\fP -+should be avoided as these are used by the regular expression code\&. -+.PP -+\fIregexp\fP is the regular expression to match against the string\&. -+.PP -+\fIreplace\fP is the replacement text\&. This can contain parameter, command -+and arithmetic expressions which will be replaced: in particular, a -+reference to \fB$MATCH\fP will be replaced by the text matched by the pattern\&. -+.PP -+The return status is 0 if at least one match was performed, else 1\&. -+.RE -+.TP -+\fBrun\-help\fP \fIcmd\fP -+This function is designed to be invoked by the \fBrun\-help\fP ZLE widget, -+in place of the default alias\&. See `Accessing On\-Line Help\&' -+above for setup instructions\&. -+.RS -+.PP -+In the discussion which follows, if \fIcmd\fP is a file system path, it is -+first reduced to its rightmost component (the file name)\&. -+.PP -+Help is first sought by looking for a file named \fIcmd\fP in the directory -+named by the \fBHELPDIR\fP parameter\&. If no file is found, an assistant -+function, alias, or command named \fBrun\-help\-\fIcmd\fP\fP is sought\&. If -+found, the assistant is executed with the rest of the current command line -+(everything after the command name \fIcmd\fP) as its arguments\&. When -+neither file nor assistant is found, the external command -+`\fBman\fP \fIcmd\fP\&' is run\&. -+.PP -+An example assistant for the "ssh" command: -+.PP -+.RS -+.nf -+\fBrun\-help\-ssh() { -+ emulate \-LR zsh -+ local \-a args -+ # Delete the "\-l username" option -+ zparseopts \-D \-E \-a args l: -+ # Delete other options, leaving: host command -+ args=(${@:#\-*}) -+ if [[ ${#args} \-lt 2 ]]; then -+ man ssh -+ else -+ run\-help $args[2] -+ fi -+}\fP -+.fi -+.RE -+.PP -+Several of these assistants are provided in the \fBFunctions/Misc\fP -+directory\&. These must be autoloaded, or placed as executable scripts in -+your search path, in order to be found and used by \fBrun\-help\fP\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBrun\-help\-git\fP -+.TP -+.PD 0 -+\fBrun\-help\-svk\fP -+.TP -+.PD -+\fBrun\-help\-svn\fP -+Assistant functions for the \fBgit\fP, \fBsvk\fP, and \fBsvn\fP commands\&. -+.RE -+.TP -+\fBtetris\fP -+Zsh was once accused of not being as complete as Emacs, -+because it lacked a Tetris game\&. This function was written to -+refute this vicious slander\&. -+.RS -+.PP -+This function must be used as a ZLE widget: -+.PP -+.RS -+.nf -+\fBautoload \-U tetris -+zle \-N tetris -+bindkey \fIkeys\fP tetris\fP -+.fi -+.RE -+.PP -+To start a game, execute the widget by typing the \fIkeys\fP\&. Whatever command -+line you were editing disappears temporarily, and your keymap is also -+temporarily replaced by the Tetris control keys\&. The previous editor state -+is restored when you quit the game (by pressing `\fBq\fP\&') or when you lose\&. -+.PP -+If you quit in the middle of a game, the next invocation of the \fBtetris\fP -+widget will continue where you left off\&. If you lost, it will start a new -+game\&. -+.RE -+.TP -+\fBzargs\fP [ \fIoption\fP \&.\&.\&. \fB\-\fP\fB\-\fP ] [ \fIinput\fP \&.\&.\&. ] [ \fB\-\fP\fB\-\fP \fIcommand\fP [ \fIarg\fP \&.\&.\&. ] ] -+This function works like GNU xargs, except that instead of reading lines -+of arguments from the standard input, it takes them from the command line\&. -+This is useful because zsh, especially with recursive glob operators, -+often can construct a command line for a shell function that is longer -+than can be accepted by an external command\&. -+.RS -+.PP -+The \fIoption\fP list represents options of the \fBzargs\fP command itself, -+which are the same as those of \fBxargs\fP\&. The \fIinput\fP list is the -+collection of strings (often file names) that become the arguments of the -+\fBcommand\fP, analogous to the standard input of \fBxargs\fP\&. Finally, the -+\fIarg\fP list consists of those arguments (usually options) that are -+passed to the \fIcommand\fP each time it runs\&. The \fIarg\fP list precedes -+the elements from the \fBinput\fP list in each run\&. If no \fIcommand\fP is -+provided, then no \fIarg\fP list may be provided, and in that event the -+default command is `\fBprint\fP\&' with arguments `\fB\-r \-\fP\fB\-\fP'\&. -+.PP -+For example, to get a long \fBls\fP listing of all plain files in the -+current directory or its subdirectories: -+.PP -+.RS -+.nf -+\fBautoload \-U zargs -+zargs \-\- **/*(\&.) \-\- ls \-l\fP -+.fi -+.RE -+.PP -+Note that `\fB\-\fP\fB\-\fP\&' is used both to mark the end of the \fIoption\fP -+list and to mark the end of the \fIinput\fP list, so it must appear twice -+whenever the \fIinput\fP list may be empty\&. If there is guaranteed to be -+at least one \fIinput\fP and the first \fIinput\fP does not begin with a -+`\fB\-\fP\&', then the first `\fB\-\fP\fB\-\fP' may be omitted\&. -+.PP -+In the event that the string `\fB\-\fP\fB\-\fP\&' is or may be an \fIinput\fP, the -+\fB\-e\fP option may be used to change the end\-of\-inputs marker\&. Note that -+this does \fInot\fP change the end\-of\-options marker\&. For example, to use -+`\fB\&.\&.\fP\&' as the marker: -+.PP -+.RS -+.nf -+\fBzargs \-e\&.\&. \-\- **/*(\&.) \&.\&. ls \-l\fP -+.fi -+.RE -+.PP -+This is a good choice in that example because no plain file can be named -+`\fB\&.\&.\fP\&', but the best end\-marker depends on the circumstances\&. -+.PP -+For details of the other \fBzargs\fP options, see \fIxargs\fP(1) or run -+\fBzargs\fP with the \fB\-\fP\fB\-help\fP option\&. -+.RE -+.TP -+.PD 0 -+\fBzed\fP [ \fB\-f\fP ] \fIname\fP -+.TP -+.PD -+\fBzed \-b\fP -+This function uses the ZLE editor to edit a file or function\&. -+.RS -+.PP -+Only one \fIname\fP argument is allowed\&. -+If the \fB\-f\fP option is given, the name is taken to be that of -+a function; if the function is marked for autoloading, \fBzed\fP searches -+for it in the \fBfpath\fP and loads it\&. Note that functions edited this way -+are installed into the current shell, but \fInot\fP written back to the -+autoload file\&. -+.PP -+Without \fB\-f\fP, \fIname\fP is the path name of the file to edit, which need -+not exist; it is created on write, if necessary\&. -+.PP -+While editing, the function sets the main keymap to \fBzed\fP and the -+vi command keymap to \fBzed\-vicmd\fP\&. These will be copied from the existing -+\fBmain\fP and \fBvicmd\fP keymaps if they do not exist the first time \fBzed\fP -+is run\&. They can be used to provide special key bindings used only in zed\&. -+.PP -+If it creates the keymap, \fBzed\fP rebinds the return key to insert a line -+break and `\fB^X^W\fP\&' to accept the edit in the \fBzed\fP keymap, and binds -+`\fBZZ\fP\&' to accept the edit in the \fBzed\-vicmd\fP keymap\&. -+.PP -+The bindings alone can be installed by running `\fBzed \-b\fP\&'\&. This is -+suitable for putting into a startup file\&. Note that, if rerun, -+this will overwrite the existing \fBzed\fP and \fBzed\-vicmd\fP keymaps\&. -+.PP -+Completion is available, and styles may be set with the context prefix -+`\fB:completion:zed\fP\&'\&. -+.PP -+A zle widget \fBzed\-set\-file\-name\fP is available\&. This can be called by -+name from within zed using `\fB\eex zed\-set\-file\-name\fP\&' (note, however, that -+because of zed\&'s rebindings you will have to type \fB^j\fP at the end instead -+of the return key), or can be bound to a key in either of the \fBzed\fP or -+\fBzed\-vicmd\fP keymaps after `\fBzed \-b\fP\&' has been run\&. When the widget is -+called, it prompts for a new name for the file being edited\&. When zed -+exits the file will be written under that name and the original file will -+be left alone\&. The widget has no effect with `\fBzed \-f\fP\&'\&. -+.PP -+While \fBzed\-set\-file\-name\fP is running, zed uses the keymap -+\fBzed\-normal\-keymap\fP, which is linked from the main keymap in effect -+at the time zed initialised its bindings\&. (This is to make the return key -+operate normally\&.) The result is that if the main keymap has been changed, -+the widget won\&'t notice\&. This is not a concern for most users\&. -+.RE -+.TP -+.PD 0 -+\fBzcp\fP [ \fB\-finqQvwW\fP ] \fIsrcpat\fP \fIdest\fP -+.TP -+.PD -+\fBzln\fP [ \fB\-finqQsvwW\fP ] \fIsrcpat\fP \fIdest\fP -+Same as \fBzmv \-C\fP and \fBzmv \-L\fP, respectively\&. These functions do not -+appear in the zsh distribution, but can be created by linking \fBzmv\fP to -+the names \fBzcp\fP and \fBzln\fP in some directory in your \fBfpath\fP\&. -+.TP -+\fBzkbd\fP -+See `Keyboard Definition\&' -+above\&. -+.TP -+\fBzmv\fP [ \fB\-finqQsvwW\fP ] [ \-C | \-L | \-M | \-p \fIprogram\fP ] [ \-o \fIoptstring\fP ] \fIsrcpat\fP \fIdest\fP -+Move (usually, rename) files matching the pattern \fIsrcpat\fP to -+corresponding files having names of the form given by \fIdest\fP, where -+\fIsrcpat\fP contains parentheses surrounding patterns which will be -+replaced in turn by $1, $2, \&.\&.\&. in \fIdest\fP\&. For example, -+.RS -+.PP -+.RS -+.nf -+\fBzmv \&'(*)\&.lis' '$1\&.txt'\fP -+.fi -+.RE -+.PP -+renames `\fBfoo\&.lis\fP\&' to `\fBfoo\&.txt\fP', `\fBmy\&.old\&.stuff\&.lis\fP' to -+`\fBmy\&.old\&.stuff\&.txt\fP\&', and so on\&. -+.PP -+The pattern is always treated as an \fBEXTENDED_GLOB\fP pattern\&. Any file -+whose name is not changed by the substitution is simply ignored\&. Any -+error (a substitution resulted in an empty string, two substitutions gave -+the same result, the destination was an existing regular file and \fB\-f\fP -+was not given) causes the entire function to abort without doing anything\&. -+.PP -+Options: -+.PP -+.PD 0 -+.TP -+\fB\-f\fP -+Force overwriting of destination files\&. Not currently -+passed down to the \fBmv\fP/\fBcp\fP/\fBln\fP command due to vagaries of -+implementations (but you can use \fB\-o\-f\fP to do that)\&. -+.TP -+\fB\-i\fP -+Interactive: show each line to be executed and ask the user -+whether to execute it\&. `Y\&' or `y' will execute it, anything else will -+skip it\&. Note that you just need to type one character\&. -+.TP -+\fB\-n\fP -+No execution: print what would happen, but don\&'t do it\&. -+.TP -+\fB\-q\fP -+Turn bare glob qualifiers off: now assumed by default, so -+this has no effect\&. -+.TP -+\fB\-Q\fP -+Force bare glob qualifiers on\&. Don\&'t turn this on unless -+you are actually using glob qualifiers in a pattern\&. -+.TP -+\fB\-s\fP -+Symbolic, passed down to \fBln\fP; only works with \fB\-L\fP\&. -+.TP -+\fB\-v\fP -+Verbose: print each command as it\&'s being executed\&. -+.TP -+\fB\-w\fP -+Pick out wildcard parts of the pattern, as described above, -+and implicitly add parentheses for referring to them\&. -+.TP -+\fB\-W\fP -+Just like \fB\-w\fP, with the addition of turning wildcards in -+the replacement pattern into sequential ${1} \&.\&. ${N} references\&. -+.TP -+\fB\-C\fP -+.TP -+\fB\-L\fP -+.TP -+\fB\-M\fP -+Force \fBcp\fP, \fBln\fP or \fBmv\fP, respectively, regardless of -+the name of the function\&. -+.TP -+\fB\-p\fP \fIprogram\fP -+Call \fIprogram\fP instead of \fBcp\fP, \fBln\fP or -+\fBmv\fP\&. Whatever it does, it should at least understand the form -+`\fIprogram\fP \fB\-\fP\fB\-\fP \fIoldname\fP \fInewname\fP\&' -+where \fIoldname\fP and \fInewname\fP are filenames generated by \fBzmv\fP\&. -+.TP -+\fB\-o\fP \fIoptstring\fP -+The \fIoptstring\fP is split into words and -+passed down verbatim to the \fBcp\fP, \fBln\fP or \fBmv\fP command called to -+perform the work\&. It should probably begin with a `\fB\-\fP\&'\&. -+.PD -+.PP -+Further examples: -+.PP -+.RS -+.nf -+\fBzmv \-v \&'(* *)' '${1// /_}'\fP -+.fi -+.RE -+.PP -+For any file in the current directory with at least one space in the name, -+replace every space by an underscore and display the commands executed\&. -+.PP -+For more complete examples and other implementation details, see the -+\fBzmv\fP source file, usually located in one of the directories named in -+your \fBfpath\fP, or in \fBFunctions/Misc/zmv\fP in the zsh distribution\&. -+.RE -+.TP -+\fBzrecompile\fP -+See `Recompiling Functions\&' -+above\&. -+.TP -+\fBzstyle+\fP \fIcontext\fP \fIstyle\fP \fIvalue\fP [ + \fIsubcontext\fP \fIstyle\fP \fIvalue\fP \&.\&.\&. ] -+This makes defining styles a bit simpler by using a single `\fB+\fP\&' as a -+special token that allows you to append a context name to the previously -+used context name\&. Like this: -+.RS -+.PP -+.RS -+.nf -+\fBzstyle+ \&':foo:bar' style1 value1 \e -+ +\&':baz' style2 value2 \e -+ +\&':frob' style3 value3\fP -+.fi -+.RE -+.PP -+This defines `style1\&' with `value1' for the context \fB:foo:bar\fP as usual, -+but it also defines `style2\&' with `value2' for the context -+\fB:foo:bar:baz\fP and `style3\&' with `value3' for \fB:foo:bar:frob\fP\&. Any -+\fIsubcontext\fP may be the empty string to re\-use the first context -+unchanged\&. -+.RE -+.RE -+.PP -+.SS "Styles" -+.PP -+.PD 0 -+.TP -+.PD -+\fBinsert\-tab\fP -+The \fBzed\fP function \fIsets\fP this style in context `\fB:completion:zed:*\fP\&' -+to turn off completion when \fBTAB\fP is typed at the beginning of a line\&. -+You may override this by setting your own value for this context and style\&. -+.TP -+\fBpager\fP -+The \fBnslookup\fP function looks up this style in the context -+`\fB:nslookup\fP\&' to determine the program used to display output that does -+not fit on a single screen\&. -+.TP -+.PD 0 -+\fBprompt\fP -+.TP -+.PD -+\fBrprompt\fP -+The \fBnslookup\fP function looks up this style in the context -+`\fB:nslookup\fP\&' to set the prompt and the right\-side prompt, respectively\&. -+The usual expansions for the \fBPS1\fP and \fBRPS1\fP parameters may be used -+(see -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshbuiltins.1 -@@ -0,0 +1,2505 @@ -+.TH "ZSHBUILTINS" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshbuiltins \- zsh built\-in commands -+.\" Yodl file: Zsh/builtins.yo -+.SH "SHELL BUILTIN COMMANDS" -+.PD 0 -+.TP -+.PD -+\fB\-\fP \fIsimple command\fP -+See the section `Precommand Modifiers\&'\&. -+.TP -+\fB\&.\fP \fIfile\fP [ \fIarg\fP \&.\&.\&. ] -+Read commands from \fIfile\fP and execute them in the current shell -+environment\&. -+.RS -+.PP -+If \fIfile\fP does not contain a slash, or if \fBPATH_DIRS\fP is set, -+the shell looks in the components of \fB$path\fP to find the directory -+containing \fIfile\fP\&. Files in the current directory are not read -+unless `\fB\&.\fP\&' appears somewhere in \fB$path\fP\&. If a file named -+`\fIfile\fP\fB\&.zwc\fP\&' is found, is newer than \fIfile\fP, and is the -+compiled form (created with the \fBzcompile\fP builtin) of \fIfile\fP, -+then commands are read from that file instead of \fIfile\fP\&. -+.PP -+If any arguments \fIarg\fP are given, -+they become the positional parameters; the old positional -+parameters are restored when the \fIfile\fP is done executing\&. -+If \fIfile\fP was not found the return status is 127; if \fIfile\fP was found -+but contained a syntax error the return status is 126; else the return -+status is the exit status of the last command executed\&. -+.RE -+.TP -+\fB:\fP [ \fIarg\fP \&.\&.\&. ] -+This command does nothing, although normal argument expansions is performed -+which may have effects on shell parameters\&. A zero exit status is returned\&. -+.TP -+\fBalias\fP [ {\fB+|\fB\-\fP\fP}\fBgmrsL\fP ] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] -+For each \fIname\fP with a corresponding \fIvalue\fP, define an alias -+with that value\&. A trailing space in \fIvalue\fP causes the next word -+to be checked for alias expansion\&. If the \fB\-g\fP flag is present, -+define a global alias; global aliases are expanded even if they do not -+occur in command position\&. -+.RS -+.PP -+If the \fB\-s\fP flags is present, define a suffix alias: if the command -+word on a command line is in the form `\fItext\fP\fB\&.\fP\fIname\fP\&', where -+\fItext\fP is any non\-empty string, it is replaced by the text -+`\fIvalue\fP \fItext\fP\fB\&.\fP\fIname\fP\&'\&. Note that \fIname\fP is treated as -+a literal string, not a pattern\&. A trailing space in \fIvalue\fP is not -+special in this case\&. For example, -+.PP -+.RS -+.nf -+\fBalias \-s ps=gv\fP -+.fi -+.RE -+.PP -+will cause the command `\fB*\&.ps\fP\&' to be expanded to `\fBgv *\&.ps\fP'\&. As -+alias expansion is carried out earlier than globbing, the `\fB*\&.ps\fP\&' will -+then be expanded\&. Suffix aliases constitute a different name space from -+other aliases (so in the above example it is still possible -+to create an alias for the command \fBps\fP) and the two sets are never -+listed together\&. -+.PP -+For each \fIname\fP with no \fIvalue\fP, -+print the value of \fIname\fP, if any\&. With no arguments, print all -+currently defined aliases other than suffix aliases\&. If the \fB\-m\fP flag -+is given the arguments 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 one of -+the \fB\-g\fP, \fB\-r\fP or \fB\-s\fP flags is present, restrict the printing to -+global, regular or suffix aliases, respectively; a regular alias is one -+which is neither a global nor a suffix alias\&. Using `\fB+\fP\&' -+instead of `\fB\-\fP\&', or ending the option list with a single -+`\fB+\fP\&', prevents the values of the aliases from being printed\&. -+.PP -+If the \fB\-L\fP flag is present, then print each -+alias in a manner suitable for putting in a startup script\&. The exit -+status is nonzero if a \fIname\fP (with no \fIvalue\fP) is given for -+which no alias has been defined\&. -+.PP -+For more on aliases, include common problems, -+see the section ALIASING in \fIzshmisc\fP(1)\&. -+.RE -+.TP -+\fBautoload\fP [ {\fB+\fP|\fB\-\fP}\fBUXktz\fP ] [ \fB\-w\fP ] [ \fIname\fP \&.\&.\&. ] -+Equivalent to \fBfunctions \-u\fP, with the exception of \fB\-X\fP/\fB+X\fP and -+\fB\-w\fP\&. -+.RS -+.PP -+The flag \fB\-X\fP may be used only inside a shell function, and may not be -+followed by a \fIname\fP\&. 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\&. -+.PP -+The flag \fB+X\fP attempts to load each \fIname\fP as an autoloaded function, -+but does \fInot\fP execute it\&. The exit status is zero (success) if the -+function was not previously defined \fIand\fP a definition for it was found\&. -+This does \fInot\fP 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\&. If ksh\-style autoloading is -+enabled, the function created will contain the contents of the file -+plus a call to the function itself appended to it, thus giving normal -+ksh autoloading behaviour on the first call to the function\&. -+.PP -+With the \fB\-w\fP flag, the \fIname\fPs are taken as names of files compiled -+with the \fBzcompile\fP builtin, and all functions defined in them are -+marked for autoloading\&. -+.PP -+The flags \fB\-z\fP and \fB\-k\fP mark the function to be autoloaded in -+native or ksh emulation, as if the option \fBKSH_AUTOLOAD\fP were -+unset or were set, respectively\&. The flags override the setting of -+the option at the time the function is loaded\&. -+.RE -+.TP -+.PD 0 -+\fBbg\fP [ \fIjob\fP \&.\&.\&. ] -+.TP -+.PD -+\fIjob\fP \&.\&.\&. \fB&\fP -+Put each specified \fIjob\fP in the background, -+or the current job if none is specified\&. -+.TP -+\fBbindkey\fP -+See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. -+.TP -+\fBbreak\fP [ \fIn\fP ] -+Exit from an enclosing \fBfor\fP, \fBwhile\fP, -+\fBuntil\fP, \fBselect\fP or \fBrepeat\fP loop\&. If \fIn\fP -+is specified, then break \fIn\fP levels instead of just one\&. -+.TP -+\fBbuiltin\fP \fIname\fP [ \fIargs\fP \&.\&.\&. ] -+Executes the builtin \fIname\fP, with the given \fIargs\fP\&. -+.TP -+\fBbye\fP -+Same as \fBexit\fP\&. -+.TP -+\fBcap\fP -+See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+.PD 0 -+\fBcd\fP [ \fB\-qsLP\fP ] [ \fIarg\fP ] -+.TP -+.PD 0 -+\fBcd\fP [ \fB\-qsLP\fP ] \fIold\fP \fInew\fP -+.TP -+.PD -+\fBcd\fP [ \fB\-qsLP\fP ] {\fB+\fP|\fB\-\fP}\fIn\fP -+Change the current directory\&. In the first form, change the -+current directory to \fIarg\fP, or to the value of \fB$HOME\fP if -+\fIarg\fP is not specified\&. If \fIarg\fP is `\fB\-\fP\&', change to the -+previous directory\&. -+.RS -+.PP -+Otherwise, if \fIarg\fP begins with a slash, attempt to change to the -+directory given by \fIarg\fP\&. -+.PP -+If \fIarg\fP does not begin with a slash, the behaviour depends on whether -+the current directory `\fB\&.\fP\&' occurs in the list of directories contained -+in the shell parameter \fBcdpath\fP\&. If it does not, first attempt to change -+to the directory \fIarg\fP under the current directory, and if that fails -+but \fBcdpath\fP is set and contains at least one element attempt to change -+to the directory \fIarg\fP under each component of \fBcdpath\fP in turn until -+successful\&. If `\fB\&.\fP\&' occurs in \fBcdpath\fP, then \fBcdpath\fP is searched -+strictly in order so that `\fB\&.\fP\&' is only tried at the appropriate point\&. -+.PP -+The order of testing \fBcdpath\fP is modified if the option \fBPOSIX_CD\fP -+is set, as described in the documentation for the option\&. -+.PP -+If no directory is found, the option \fBCDABLE_VARS\fP is set, and a -+parameter named \fIarg\fP 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\&. -+.PP -+The second form of \fBcd\fP substitutes the string \fInew\fP -+for the string \fIold\fP in the name of the current directory, -+and tries to change to this new directory\&. -+.PP -+The third form of \fBcd\fP extracts an entry from the directory -+stack, and changes to that directory\&. An argument of the form -+`\fB+\fP\fIn\fP\&' identifies a stack entry by counting from the left -+of the list shown by the \fBdirs\fP command, starting with zero\&. -+An argument of the form `\fB\-\fP\fIn\fP\&' counts from the right\&. -+If the \fBPUSHD_MINUS\fP option is set, the meanings of `\fB+\fP\&' -+and `\fB\-\fP\&' in this context are swapped\&. -+.PP -+If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP -+and the functions in the array \fBchpwd_functions\fP are not called\&. -+This is useful for calls to \fBcd\fP that do not change the environment -+seen by an interactive user\&. -+.PP -+If the \fB\-s\fP option is specified, \fBcd\fP refuses to change the current -+directory if the given pathname contains symlinks\&. If the \fB\-P\fP option -+is given or the \fBCHASE_LINKS\fP option is set, symbolic links are resolved -+to their true values\&. If the \fB\-L\fP option is given symbolic links are -+retained in the directory (and not resolved) regardless of the state of -+the \fBCHASE_LINKS\fP option\&. -+.RE -+.TP -+\fBchdir\fP -+Same as \fBcd\fP\&. -+.TP -+\fBclone\fP -+See the section `The zsh/clone Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcommand\fP [ \fB\-pvV\fP ] \fIsimple command\fP -+The simple command argument is taken as an external command instead of -+a function or builtin and is executed\&. If the \fBPOSIX_BUILTINS\fP option -+is set, builtins will also be executed but certain special properties -+of them are suppressed\&. The \fB\-p\fP flag causes a default path to be -+searched instead of that in \fB$path\fP\&. With the \fB\-v\fP flag, \fBcommand\fP -+is similar to \fBwhence\fP and with \fB\-V\fP, it is equivalent to \fBwhence -+\-v\fP\&. -+.RS -+.PP -+See also the section `Precommand Modifiers\&'\&. -+.RE -+.TP -+\fBcomparguments\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompcall\fP -+See the section `The zsh/compctl Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompctl\fP -+See the section `The zsh/compctl Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompdescribe\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompfiles\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompgroups\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompquote\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcomptags\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcomptry\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcompvalues\fP -+See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBcontinue\fP [ \fIn\fP ] -+Resume the next iteration of the enclosing -+\fBfor\fP, \fBwhile\fP, \fBuntil\fP, \fBselect\fP or -+\fBrepeat\fP loop\&. If \fIn\fP is specified, break out of -+\fIn\fP\-1 loops and resume at the \fIn\fPth enclosing loop\&. -+.TP -+\fBdeclare\fP -+Same as \fBtypeset\fP\&. -+.TP -+.PD 0 -+\fBdirs\fP [ \fB\-c\fP ] [ \fIarg\fP \&.\&.\&. ] -+.TP -+.PD -+\fBdirs\fP [ \fB\-lpv\fP ] -+With no arguments, print the contents of the directory stack\&. -+Directories are added to this stack with the \fBpushd\fP command, -+and removed with the \fBcd\fP or \fBpopd\fP commands\&. -+If arguments are specified, load them onto the directory stack, -+replacing anything that was there, and push the current directory -+onto the stack\&. -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-c\fP -+clear the directory stack\&. -+.TP -+\fB\-l\fP -+print directory names in full instead of using of using \fB~\fP expressions\&. -+.TP -+\fB\-p\fP -+print directory entries one per line\&. -+.TP -+\fB\-v\fP -+number the directories in the stack when printing\&. -+.PP -+.RE -+.TP -+\fBdisable\fP [ \fB\-afmrs\fP ] \fIname\fP \&.\&.\&. -+Temporarily disable the \fIname\fPd hash table elements\&. The default -+is to disable builtin commands\&. This allows you to use an external -+command with the same name as a builtin command\&. The \fB\-a\fP option -+causes \fBdisable\fP to act on regular or global aliases\&. The \fB\-s\fP -+option causes \fBdisable\fP to act on suffix aliases\&. The \fB\-f\fP option causes -+\fBdisable\fP to act on shell functions\&. The \fB\-r\fP options causes -+\fBdisable\fP to act on reserved words\&. Without arguments all disabled -+hash table elements from the corresponding hash table are printed\&. -+With the \fB\-m\fP 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 \fBenable\fP -+command\&. -+.TP -+.PD 0 -+\fBdisown\fP [ \fIjob\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fIjob\fP \&.\&.\&. \fB&|\fP -+.TP -+.PD -+\fIjob\fP \&.\&.\&. \fB&!\fP -+Remove the specified \fIjob\fPs from the job table; the shell will -+no longer report their status, and will not complain if you -+try to exit an interactive shell with them running or stopped\&. -+If no \fIjob\fP is specified, disown the current job\&. -+.RS -+.PP -+If the \fIjob\fPs are currently stopped and the \fBAUTO_CONTINUE\fP option -+is not set, a warning is printed containing information about how to -+make them running after they have been disowned\&. If one of the latter -+two forms is used, the \fIjob\fPs will automatically be made running, -+independent of the setting of the \fBAUTO_CONTINUE\fP option\&. -+.RE -+.TP -+\fBecho\fP [ \fB\-neE\fP ] [ \fIarg\fP \&.\&.\&. ] -+Write each \fIarg\fP on the standard output, with a space separating -+each one\&. -+If the \fB\-n\fP flag is not present, print a newline at the end\&. -+\fBecho\fP recognizes the following escape sequences: -+.RS -+.PP -+.PD 0 -+.TP -+\fB\ea\fP -+bell character -+.TP -+\fB\eb\fP -+backspace -+.TP -+\fB\ec\fP -+suppress final newline -+.TP -+\fB\ee\fP -+escape -+.TP -+\fB\ef\fP -+form feed -+.TP -+\fB\en\fP -+linefeed (newline) -+.TP -+\fB\er\fP -+carriage return -+.TP -+\fB\et\fP -+horizontal tab -+.TP -+\fB\ev\fP -+vertical tab -+.TP -+\fB\e\e\fP -+backslash -+.TP -+\fB\e0\fP\fINNN\fP -+character code in octal -+.TP -+\fB\ex\fP\fINN\fP -+character code in hexadecimal -+.TP -+\fB\eu\fP\fINNNN\fP -+unicode character code in hexadecimal -+.TP -+\fB\eU\fP\fINNNNNNNN\fP -+unicode character code in hexadecimal -+.PD -+.PP -+The \fB\-E\fP flag, or the \fBBSD_ECHO\fP option, can be used to disable -+these escape sequences\&. In the latter case, \fB\-e\fP flag can be used to -+enable them\&. -+.RE -+.TP -+\fBechotc\fP -+See the section `The zsh/termcap Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBechoti\fP -+See the section `The zsh/terminfo Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBemulate\fP [ \fB\-LR\fP ] [ {\fBzsh\fP|\fBsh\fP|\fBksh\fP|\fBcsh\fP} [ \fB\-c\fP \fBarg\fP ] ] -+Without any argument print current emulation mode\&. -+.RS -+.PP -+With single argument set up zsh options to emulate the specified shell -+as much as possible\&. -+\fBcsh\fP will never be fully emulated\&. -+If the argument is not one of the shells listed above, \fBzsh\fP -+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 -+the section `Compatibility\&' in \fIzshmisc\fP(1) -+\&. -+.PP -+If the \fB\-R\fP option is given, all options -+are reset to their default value corresponding to the specified emulation -+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 \fB\-L\fP option is given, -+the options \fBLOCAL_OPTIONS\fP and \fBLOCAL_TRAPS\fP will be set as -+well, causing the effects of the \fBemulate\fP command and any \fBsetopt\fP and -+\fBtrap\fP commands to be local to the immediately surrounding shell -+function, if any; normally these options are turned off in all emulation -+modes except \fBksh\fP\&. The \fB\-L\fP and \fB\-c\fP are mutually exclusive\&. -+.PP -+If \fB\-c\fP \fBarg\fP is given, evaluate \fBarg\fP while the requested -+emulation is temporarily in effect\&. The emulation and all options will -+be restored to their original values before \fBemulate\fP returns\&. The -+\fB\-R\fP flag may be used\&. -+.PP -+Use of \fB\-c\fP enables `sticky\&' emulation mode for functions defined -+within the evaluated expression: the emulation mode is associated -+thereafter with the function so that whenever the function is executed -+the emulation (respecting the \fB\-R\fP flag, if present) and all -+options are set before entry to the function, and restored after exit\&. -+If the function is called when the sticky emulation is already in -+effect, either within an `\fBemulate\fP \fIshell\fP \fB\-c\fP\&' expression or -+within another function with the same sticky emulation, entry and exit -+from the function do not cause options to be altered (except due to -+standard processing such as the \fBLOCAL_OPTIONS\fP option)\&. -+.PP -+For example: -+.PP -+.RS -+.nf -+\fBemulate sh \-c \&'fni() { setopt cshnullglob; } -+fno() { fni; }\&' -+fno -+\fP -+.fi -+.RE -+.PP -+The two functions \fBfni\fP and \fBfno\fP are defined with sticky \fBsh\fP -+emulation\&. \fBfno\fP is then executed, causing options associated -+with emulations to be set to their values in \fBsh\fP\&. \fBfni\fP then -+calls \fBfno\fP; because \fBfno\fP is also marked for sticky \fBsh\fP -+emulation, no option changes take place on entry to or exit from it\&. -+Hence the option \fBcshnullglob\fP, turned off by \fBsh\fP emulation, will -+be turned on within \fBfni\fP and remain on on return to \fBfno\fP\&. On exit -+from \fBfno\fP, the emulation mode and all options will be restored to the -+state they were in before entry to the temporary emulation\&. -+.PP -+The documentation above is typically sufficient for the intended -+purpose of executing code designed for other shells in a suitable -+environment\&. More detailed rules follow\&. -+.PD 0 -+.TP -+1\&. -+The sticky emulation environment provided by `\fBemulate\fP -+\fIshell\fP \fB\-c\fP\&' is identical to that provided by entry to -+a function marked for sticky emulation as a consequence of being -+defined in such an environment\&. Hence, for example, the sticky -+emulation is inherited by subfunctions defined within functions -+with sticky emulation\&. -+.TP -+2\&. -+No change of options takes place on entry to or exit from -+functions that are not marked for sticky emulation, other than those -+that would normally take place, even if those functions are called -+within sticky emulation\&. -+.TP -+3\&. -+No special handling is provided for functions marked for -+\fBautoload\fP nor for functions present in wordcode created by -+the \fBzcompile\fP command\&. -+.TP -+4\&. -+The presence or absence of the \fB\-R\fP flag to \fBemulate\fP -+corresponds to different sticky emulation modes, so for example -+`\fBemulate sh \-c\fP\&', `\fBemulate \-R sh \-c\fP' and `\fBemulate csh \-c\fP' -+are treated as three distinct sticky emulations\&. -+.PD -+.RE -+.TP -+\fBenable\fP [ \fB\-afmrs\fP ] \fIname\fP \&.\&.\&. -+Enable the \fIname\fPd hash table elements, presumably disabled -+earlier with \fBdisable\fP\&. The default is to enable builtin commands\&. -+The \fB\-a\fP option causes \fBenable\fP to act on regular or global aliases\&. -+The \fB\-s\fP option causes \fBenable\fP to act on suffix aliases\&. -+The \fB\-f\fP option causes \fBenable\fP to act on shell functions\&. The \fB\-r\fP -+option causes \fBenable\fP to act on reserved words\&. Without arguments -+all enabled hash table elements from the corresponding hash table are -+printed\&. With the \fB\-m\fP flag the arguments are taken as patterns -+(should be quoted) and all hash table elements from the corresponding -+hash table matching these patterns are enabled\&. Enabled objects can be -+disabled with the \fBdisable\fP builtin command\&. -+.TP -+\fBeval\fP [ \fIarg\fP \&.\&.\&. ] -+Read the arguments as input to the shell and execute the resulting -+command(s) in the current shell process\&. The return status is -+the same as if the commands had been executed directly by the shell; -+if there are no \fIargs\fP or they contain no commands (i\&.e\&. are -+an empty string or whitespace) the return status is zero\&. -+.TP -+\fBexec\fP [ \fB\-cl\fP ] [ \fB\-a\fP \fIargv0\fP ] \fIsimple command\fP -+Replace the current shell with an external command rather than forking\&. -+With \fB\-c\fP clear the environment; with \fB\-l\fP prepend \fB\-\fP to the -+\fBargv[0]\fP string of the command executed (to simulate a login shell); -+with \fB\-a\fP \fIargv0\fP set the \fBargv[0]\fP string of the command -+executed\&. See the section `Precommand Modifiers\&'\&. -+.TP -+\fBexit\fP [ \fIn\fP ] -+Exit the shell with the exit status specified by \fIn\fP; if none -+is specified, use the exit status from the last command executed\&. -+An EOF condition will also cause the shell to exit, unless -+the \fBIGNORE_EOF\fP option is set\&. -+.TP -+\fBexport\fP [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] -+The specified \fIname\fPs are marked for automatic export -+to the environment of subsequently executed commands\&. -+Equivalent to \fBtypeset \-gx\fP\&. -+If a parameter specified does not -+already exist, it is created in the global scope\&. -+.TP -+\fBfalse\fP [ \fIarg\fP \&.\&.\&. ] -+Do nothing and return an exit status of 1\&. -+.TP -+.PD 0 -+\fBfc\fP [ \fB\-e\fP \fIename\fP ] [ \fB\-m\fP \fImatch\fP ] [ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] -+.TP -+.PD 0 -+\fBfc\fP \fB\-l\fP [ \fB\-nrdfEiD\fP ] [ \fB\-t\fP \fItimefmt\fP ] [ \fB\-m\fP \fImatch\fP ] -+.TP -+.PD 0 -+ [ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] -+.TP -+.PD 0 -+\fBfc\fP \fB\-p\fP [ \fB\-a\fP ] [ \fIfilename\fP [ \fIhistsize\fP [ \fIsavehistsize\fP ] ] ] -+.TP -+.PD 0 -+\fBfc\fP \fB\-P\fP -+.TP -+.PD -+\fBfc\fP \fB\-ARWI\fP [ \fIfilename\fP ] -+Select a range of commands from \fIfirst\fP to \fIlast\fP from the -+history list\&. -+The arguments \fIfirst\fP and \fIlast\fP may be specified as a -+number or as a string\&. A negative number is used as an offset -+to the current history event number\&. -+A string specifies the most recent event beginning with the given string\&. -+All substitutions \fIold\fP\fB=\fP\fInew\fP, if any, are then performed -+on the commands\&. -+.RS -+.PP -+If the \fB\-l\fP flag is given, the resulting commands are listed on -+standard output\&. -+If the \fB\-m\fP flag is also given the first argument is taken as a -+pattern (should be quoted) and only the history events matching this -+pattern will be shown\&. -+Otherwise the editor program \fIename\fP is invoked on a file containing -+these history events\&. If \fIename\fP is not given, the value -+of the parameter \fBFCEDIT\fP is used; if that is not set the value of the -+parameter \fBEDITOR\fP is used; if that is not set a builtin default, usually -+`\fBvi\fP\&' is used\&. If \fIename\fP is `\fB\-\fP', -+no editor is invoked\&. When editing is complete, the edited -+command is executed\&. -+.PP -+If \fIfirst\fP is not specified, it will be set to \-1 (the most recent -+event), or to \-16 if the \fB\-l\fP flag is given\&. -+If \fIlast\fP is not specified, it will be set to \fIfirst\fP, -+or to \-1 if the \fB\-l\fP flag is given\&. -+.PP -+The flag \fB\-r\fP reverses the order of the commands and the -+flag \fB\-n\fP suppresses command numbers when listing\&. -+.PP -+Also when listing, -+.PD 0 -+.TP -+\fB\-d\fP -+prints timestamps for each command -+.TP -+\fB\-f\fP -+prints full time\-date stamps in the US -+`\fIMM\fP\fB/\fP\fIDD\fP\fB/\fP\fIYY\fP \fIhh\fP:\fImm\fP\&' format -+.TP -+\fB\-E\fP -+prints full time\-date stamps in the European -+`\fIdd\fP\fB\&.\fP\fImm\fP\fB\&.\fP\fIyyyy\fP \fIhh\fP:\fImm\fP\&' format -+.TP -+\fB\-i\fP -+prints full time\-date stamps in ISO8601 -+`\fIyyyy\fP\fB\-\fP\fImm\fP\fB\-\fP\fIdd\fP \fIhh\fP:\fImm\fP\&' format -+.TP -+\fB\-t\fP \fIfmt\fP -+prints time and date stamps in the given format; -+\fIfmt\fP is formatted with the strftime function with the zsh extensions -+described for the \fB%D{\fP\fIstring\fP\fB}\fP prompt format in -+the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. The resulting formatted string must be -+no more than 256 characters or will not be printed\&. -+.PP -+.TP -+\fB\-D\fP -+prints elapsed times; may be combined with one of the -+options above\&. -+.PD -+.PP -+.PP -+`\fBfc \-p\fP\&' pushes the current history list onto a stack and switches to a -+new history list\&. If the \fB\-a\fP option is also specified, this history list -+will be automatically popped when the current function scope is exited, which -+is a much better solution than creating a trap function to call `\fBfc \-P\fP\&' -+manually\&. If no arguments are specified, the history list is left empty, -+\fB$HISTFILE\fP is unset, and \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are set to their -+default values\&. If one argument is given, \fB$HISTFILE\fP is set to that -+filename, \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are left unchanged, and the history -+file is read in (if it exists) to initialize the new list\&. If a second -+argument is specified, \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are instead set to the -+single specified numeric value\&. Finally, if a third argument is specified, -+\fB$SAVEHIST\fP is set to a separate value from \fB$HISTSIZE\fP\&. You are free to -+change these environment values for the new history list however you desire -+in order to manipulate the new history list\&. -+.PP -+`\fBfc \-P\fP\&' pops the history list back to an older list saved by `\fBfc \-p\fP'\&. -+The current list is saved to its \fB$HISTFILE\fP before it is destroyed -+(assuming that \fB$HISTFILE\fP and \fB$SAVEHIST\fP are set appropriately, of -+course)\&. The values of \fB$HISTFILE\fP, \fB$HISTSIZE\fP, and \fB$SAVEHIST\fP are -+restored to the values they had when `\fBfc \-p\fP\&' was called\&. Note that this -+restoration can conflict with making these variables "local", so your best -+bet is to avoid local declarations for these variables in functions that use -+`\fBfc \-p\fP\&'\&. The one other guaranteed\-safe combination is declaring these -+variables to be local at the top of your function and using the automatic -+option (\fB\-a\fP) with `\fBfc \-p\fP\&'\&. Finally, note that it is legal to manually -+pop a push marked for automatic popping if you need to do so before the -+function exits\&. -+.PP -+`\fBfc \-R\fP\&' reads the history from the given file, -+`\fBfc \-W\fP\&' writes the history out to the given file, -+and `\fBfc \-A\fP\&' appends the history out to the given file\&. -+If no filename is specified, the \fB$HISTFILE\fP is assumed\&. -+If the \fB\-I\fP option is added to \fB\-R\fP, only those events that are -+not already contained within the internal history list are added\&. -+If the \fB\-I\fP option is added to \fB\-A\fP or \fB\-W\fP, 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 \fB$SAVEHIST\fP -+entries\&. -+.RE -+.TP -+.PD 0 -+\fBfg\fP [ \fIjob\fP \&.\&.\&. ] -+.TP -+.PD -+\fIjob\fP \&.\&.\&. -+Bring each specified \fIjob\fP in turn to the foreground\&. -+If no \fIjob\fP is specified, resume the current job\&. -+.TP -+\fBfloat\fP [ {\fB+\fP|\fB\-\fP}\fBEFHghlprtux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] -+Equivalent to \fBtypeset \-E\fP, except that options irrelevant to floating -+point numbers are not permitted\&. -+.TP -+.PD 0 -+\fBfunctions\fP [ {\fB+\fP|\fB\-\fP}\fBUXkmtuz\fP ] [ \fIname\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fBfunctions \-M\fP \fImathfn\fP [ \fImin\fP [ \fImax\fP [ \fIshellfn\fP ] ] ] -+.TP -+.PD 0 -+\fBfunctions \-M\fP [ \fB\-m\fP \fIpattern\fP \&.\&.\&. ] -+.TP -+.PD -+\fBfunctions +M\fP [ \fB\-m\fP ] \fImathfn\fP -+Equivalent to \fBtypeset \-f\fP, with the exception of the \fB\-M\fP option\&. -+Use of the \fB\-M\fP option may not be combined with any of the options -+handled by \fBtypeset \-f\fP\&. -+.RS -+.PP -+\fBfunctions \-M\fP \fImathfn\fP defines \fImathfn\fP as the name of -+a mathematical function recognised in all forms of arithmetical expressions; -+see -+the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1)\&. By default \fImathfn\fP may take -+any number of comma\-separated arguments\&. If \fImin\fP is given, -+it must have exactly \fImin\fP args; if \fImin\fP and \fImax\fP are -+both given, it must have at least \fImin\fP and and at most \fImax\fP -+args\&. \fImax\fP may be \-1 to indicate that there is no upper limit\&. -+.PP -+By default the function is implemented by a shell function of the same -+name; if \fIshellfn\fP is specified it gives the name of the corresponding -+shell function while \fImathfn\fP remains the name used in arithmetical -+expressions\&. The name of the function in \fB$0\fP is \fImathfn\fP (not -+\fIshellfn\fP as would usually be the case), provided the option -+\fBFUNCTION_ARGZERO\fP is in effect\&. The positional parameters in the shell -+function correspond to the arguments of the mathematical function call\&. -+The result of the last arithmetical expression evaluated -+inside the shell function (even if it is a form that normally only returns -+a status) gives the result of the mathematical function\&. -+.PP -+\fBfunctions \-M\fP with no arguments lists all such user\-defined functions in -+the same form as a definition\&. With the additional option \fB\-m\fP and -+a list of arguments, all functions whose \fImathfn\fP matches one of -+the pattern arguments are listed\&. -+.PP -+\fBfunction +M\fP removes the list of mathematical functions; with the -+additional option \fB\-m\fP the arguments are treated as patterns and -+all functions whose \fBmathfn\fP matches the pattern are removed\&. Note -+that the shell function implementing the behaviour is not removed -+(regardless of whether its name coincides with \fBmathfn\fP)\&. -+.PP -+For example, the following prints the cube of 3: -+.PP -+.RS -+.nf -+\fBzmath_cube() { (( $1 * $1 * $1 )) } -+functions \-M cube 1 1 zmath_cube -+print $(( cube(3) ))\fP -+.fi -+.RE -+.RE -+.TP -+\fBgetcap\fP -+See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBgetln\fP [ \fB\-AclneE\fP ] \fIname\fP \&.\&.\&. -+Read the top value from the buffer stack and put it in -+the shell parameter \fBname\fP\&. Equivalent to -+\fBread \-zr\fP\&. -+.TP -+\fBgetopts\fP \fIoptstring\fP \fIname\fP [ \fIarg\fP \&.\&.\&. ] -+Checks the \fIarg\fPs for legal options\&. If the \fIarg\fPs are omitted, -+use the positional parameters\&. A valid option argument -+begins with a `\fB+\fP\&' or a `\fB\-\fP'\&. An argument not beginning with -+a `\fB+\fP\&' or a `\fB\-\fP', or the argument `\fB\-\fP\fB\-\fP', ends the options\&. -+Note that a single `\fB\-\fP\&' is not considered a valid option argument\&. -+\fIoptstring\fP contains the letters that \fBgetopts\fP -+recognizes\&. If a letter is followed by a `\fB:\fP\&', that option -+requires an argument\&. The options can be -+separated from the argument by blanks\&. -+.RS -+.PP -+Each time it is invoked, \fBgetopts\fP places the option letter it finds -+in the shell parameter \fIname\fP, prepended with a `\fB+\fP\&' when -+\fIarg\fP begins with a `\fB+\fP\&'\&. The index of the next \fIarg\fP -+is stored in \fBOPTIND\fP\&. The option argument, if any, -+is stored in \fBOPTARG\fP\&. -+.PP -+The first option to be examined may be changed by explicitly assigning -+to \fBOPTIND\fP\&. \fBOPTIND\fP has an initial value of \fB1\fP, and is -+normally reset to \fB1\fP upon exit from a shell function\&. \fBOPTARG\fP -+is not reset and retains its value from the most recent call to -+\fBgetopts\fP\&. If either of \fBOPTIND\fP or \fBOPTARG\fP is explicitly -+unset, it remains unset, and the index or option argument is not -+stored\&. The option itself is still stored in \fIname\fP in this case\&. -+.PP -+A leading `\fB:\fP\&' in \fIoptstring\fP causes \fBgetopts\fP to store the -+letter of any invalid option in \fBOPTARG\fP, and to set \fIname\fP to -+`\fB?\fP\&' for an unknown option and to `\fB:\fP' when a required argument is -+missing\&. Otherwise, \fBgetopts\fP sets \fIname\fP to `\fB?\fP\&' and prints -+an error message when an option is invalid\&. The exit status is -+nonzero when there are no more options\&. -+.RE -+.TP -+\fBhash\fP [ \fB\-Ldfmrv\fP ] [ \fIname\fP[\fB=\fP\fIvalue\fP] ] \&.\&.\&. -+\fBhash\fP can be used to directly modify the contents of the command -+hash table, and the named directory hash table\&. Normally one would -+modify these tables by modifying one\&'s \fBPATH\fP -+(for the command hash table) or by creating appropriate shell parameters -+(for the named directory hash table)\&. -+The choice of hash table to work on is determined by the \fB\-d\fP option; -+without the option the command hash table is used, and with the option the -+named directory hash table is used\&. -+.RS -+.PP -+Given no arguments, and neither the \fB\-r\fP or \fB\-f\fP options, -+the selected hash table will be listed in full\&. -+.PP -+The \fB\-r\fP option causes the selected hash table to be emptied\&. -+It will be subsequently rebuilt in the normal fashion\&. -+The \fB\-f\fP option causes the selected hash table to be fully -+rebuilt immediately\&. For the command hash table this hashes -+all the absolute directories in the \fBPATH\fP, -+and for the named directory hash table this adds all users\&' home directories\&. -+These two options cannot be used with any arguments\&. -+.PP -+The \fB\-m\fP option causes the arguments to be taken as patterns -+(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\&. -+.PP -+For each \fIname\fP with a corresponding \fIvalue\fP, put `\fIname\fP\&' in -+the selected hash table, associating it with the pathname `\fIvalue\fP\&'\&. -+In the command hash table, this means that -+whenever `\fIname\fP\&' is used as a command argument, the shell will try -+to execute the file given by `\fIvalue\fP\&'\&. -+In the named directory hash table, this means -+that `\fIvalue\fP\&' may be referred to as `\fB~\fP\fIname\fP'\&. -+.PP -+For each \fIname\fP with no -+corresponding \fIvalue\fP, attempt to add \fIname\fP to the hash table, -+checking what the appropriate \fBvalue\fP is in the normal manner for -+that hash table\&. If an appropriate \fBvalue\fP can\&'t be found, then -+the hash table will be unchanged\&. -+.PP -+The \fB\-v\fP option causes hash table entries to be listed as they are -+added by explicit specification\&. If has no effect if used with \fB\-f\fP\&. -+.PP -+If the \fB\-L\fP flag is present, then each hash table entry is printed in -+the form of a call to hash\&. -+.RE -+.TP -+\fBhistory\fP -+Same as \fBfc \-l\fP\&. -+.TP -+\fBinteger\fP [ {\fB+\fP|\fB\-\fP}\fBHghilprtux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] -+Equivalent to \fBtypeset \-i\fP, except that options irrelevant to -+integers are not permitted\&. -+.TP -+.PD 0 -+\fBjobs\fP [ \fB\-dlprs\fP ] [ \fIjob\fP \&.\&.\&. ] -+.TP -+.PD -+\fBjobs \-Z\fP \fIstring\fP -+Lists information about each given job, or all jobs -+if \fIjob\fP is omitted\&. The \fB\-l\fP flag lists process -+IDs, and the \fB\-p\fP flag lists process groups\&. -+If the \fB\-r\fP flag is specified only running jobs will be listed -+and if the \fB\-s\fP flag is given only stopped jobs are shown\&. -+If the \fB\-d\fP flag is given, the directory from which the job was -+started (which may not be the current directory of the job) will also -+be shown\&. -+.RS -+.PP -+The \fB\-Z\fP option replaces the shell\&'s argument and environment space with -+the given string, truncated if necessary to fit\&. This will normally be -+visible in \fBps\fP (\fIps\fP(1)) listings\&. This feature is typically -+used by daemons, to indicate their state\&. -+.RE -+.TP -+.PD 0 -+\fBkill\fP [ \fB\-s\fP \fIsignal_name\fP | \fB\-n\fP \fIsignal_number\fP | \fB\-\fP\fIsig\fP ] \fIjob\fP \&.\&.\&. -+.TP -+.PD -+\fBkill\fP \fB\-l\fP [ \fIsig\fP \&.\&.\&. ] -+Sends either \fBSIGTERM\fP or the specified signal to the given -+jobs or processes\&. -+Signals are given by number or by names, with or without the `\fBSIG\fP\&' -+prefix\&. -+If the signal being sent is not `\fBKILL\fP\&' or `\fBCONT\fP', then the job -+will be sent a `\fBCONT\fP\&' signal if it is stopped\&. -+The argument \fIjob\fP can be the process ID of a job -+not in the job list\&. -+In the second form, \fBkill \-l\fP, if \fIsig\fP is not -+specified the signal names are listed\&. Otherwise, for each -+\fIsig\fP that is a name, the corresponding signal number is -+listed\&. For each \fIsig\fP that is a signal number or a number -+representing the exit status of a process which was terminated or -+stopped by a signal the name of the signal is printed\&. -+.RS -+.PP -+On some systems, alternative signal names are allowed for a few signals\&. -+Typical examples are \fBSIGCHLD\fP and \fBSIGCLD\fP or \fBSIGPOLL\fP and -+\fBSIGIO\fP, assuming they correspond to the same signal number\&. \fBkill -+\-l\fP will only list the preferred form, however \fBkill \-l\fP \fIalt\fP will -+show if the alternative form corresponds to a signal number\&. For example, -+under Linux \fBkill \-l IO\fP and \fBkill \-l POLL\fP both output 29, hence -+\fBkill \-IO\fP and \fBkill \-POLL\fP have the same effect\&. -+.PP -+Many systems will allow process IDs to be negative to kill a process -+group or zero to kill the current process group\&. -+.RE -+.TP -+\fBlet\fP \fIarg\fP \&.\&.\&. -+Evaluate each \fIarg\fP as an arithmetic expression\&. -+See -+the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) -+for a description of arithmetic expressions\&. The exit status is 0 if the -+value of the last expression is nonzero, 1 if it is zero, and 2 if -+an error occurred\&. -+.TP -+\fBlimit\fP [ \fB\-hs\fP ] [ \fIresource\fP [ \fIlimit\fP ] ] \&.\&.\&. -+Set or display resource limits\&. Unless the \fB\-s\fP flag is given, -+the limit applies only the children of the shell\&. If \fB\-s\fP is -+given without other arguments, the resource limits of the current -+shell is set to the previously set resource limits of the children\&. -+.RS -+.PP -+If \fIlimit\fP is not specified, print the current limit placed -+on \fIresource\fP, otherwise -+set the limit to the specified value\&. If the \fB\-h\fP flag -+is given, use hard limits instead of soft limits\&. -+If no \fIresource\fP is given, print all limits\&. -+.PP -+When looping over multiple resources, the shell will abort immediately if -+it detects a badly formed argument\&. However, if it fails to set a limit -+for some other reason it will continue trying to set the remaining limits\&. -+.PP -+\fIresource\fP can be one of: -+.PP -+.PD 0 -+.TP -+\fBaddressspace\fP -+Maximum amount of address space used\&. -+.TP -+\fBaiomemorylocked\fP -+Maximum amount of memory locked in RAM for AIO operations\&. -+.TP -+\fBaiooperations\fP -+Maximum number of AIO operations\&. -+.TP -+\fBcachedthreads\fP -+Maximum number of cached threads\&. -+.TP -+\fBcoredumpsize\fP -+Maximum size of a core dump\&. -+.TP -+\fBcputime\fP -+Maximum CPU seconds per process\&. -+.TP -+\fBdatasize\fP -+Maximum data size (including stack) for each process\&. -+.TP -+\fBdescriptors\fP -+Maximum value for a file descriptor\&. -+.TP -+\fBfilesize\fP -+Largest single file allowed\&. -+.TP -+\fBmaxproc\fP -+Maximum number of processes\&. -+.TP -+\fBmaxpthreads\fP -+Maximum number of threads per process\&. -+.TP -+\fBmemorylocked\fP -+Maximum amount of memory locked in RAM\&. -+.TP -+\fBmemoryuse\fP -+Maximum resident set size\&. -+.TP -+\fBmsgqueue\fP -+Maximum number of bytes in POSIX message queues\&. -+.TP -+\fBresident\fP -+Maximum resident set size\&. -+.TP -+\fBsigpending\fP -+Maximum number of pending signals\&. -+.TP -+\fBsockbufsize\fP -+Maximum size of all socket buffers\&. -+.TP -+\fBstacksize\fP -+Maximum stack size for each process\&. -+.TP -+\fBvmemorysize\fP -+Maximum amount of virtual memory\&. -+.PD -+.PP -+Which of these resource limits are available depends on the system\&. -+\fIresource\fP can be abbreviated to any unambiguous prefix\&. It -+can also be an integer, which corresponds to the integer defined -+for the resource by the operating system\&. -+.PP -+If argument corresponds to a number which is out of the range of the -+resources configured into the shell, the shell will try to read or write -+the limit anyway, and will report an error if this fails\&. As the shell -+does not store such resources internally, an attempt to set the limit will -+fail unless the \fB\-s\fP option is present\&. -+.PP -+\fIlimit\fP is a number, with an optional scaling factor, as follows: -+.PP -+.PD 0 -+.TP -+\fIn\fP\fBh\fP -+hours -+.TP -+\fIn\fP\fBk\fP -+kilobytes (default) -+.TP -+\fIn\fP\fBm\fP -+megabytes or minutes -+.TP -+[\fImm\fP\fB:\fP]\fIss\fP -+minutes and seconds -+.PD -+.PP -+The \fBlimit\fP command is not made available by default when the -+shell starts in a mode emulating another shell\&. It can be made available -+with the command `\fBzmodload \-F zsh/rlimits b:limit\fP\&'\&. -+.RE -+.TP -+\fBlocal\fP [ {\fB+\fP|\fB\-\fP}\fBAEFHUahlprtux\fP ] [ \fB\-LRZi\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] ] \&.\&.\&. -+Same as \fBtypeset\fP, except that the options \fB\-g\fP, and -+\fB\-f\fP are not permitted\&. In this case the \fB\-x\fP option does not force -+the use of \fB\-g\fP, i\&.e\&. exported variables will be local to functions\&. -+.TP -+\fBlog\fP -+List all users currently logged in who are affected by -+the current setting of the \fBwatch\fP parameter\&. -+.TP -+\fBlogout\fP [ \fIn\fP ] -+Same as \fBexit\fP, except that it only works in a login shell\&. -+.TP -+\fBnoglob\fP \fIsimple command\fP -+See the section `Precommand Modifiers\&'\&. -+.TP -+\fBpopd\fP [ [\-q] {\fB+\fP|\fB\-\fP}\fIn\fP ] -+Remove an entry from the directory stack, and perform a \fBcd\fP to -+the new top directory\&. With no argument, the current top entry is -+removed\&. An argument of the form `\fB+\fP\fIn\fP\&' identifies a stack -+entry by counting from the left of the list shown by the \fBdirs\fP command, -+starting with zero\&. An argument of the form \fB\-n\fP counts from the right\&. -+If the \fBPUSHD_MINUS\fP option is set, the meanings of `\fB+\fP\&' and -+`\fB\-\fP\&' in this context are swapped\&. -+.RS -+.PP -+If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP -+and the functions in the array \fB$chpwd_functions\fP are not called, -+and the new directory stack is not printed\&. This is useful for calls to -+\fBpopd\fP that do not change the environment seen by an interactive user\&. -+.RE -+.TP -+.PD 0 -+\fBprint\fP [ \fB\-abcDilmnNoOpPrsz\fP ] [ \fB\-u\fP \fIn\fP ] [ \fB\-f\fP \fIformat\fP ] [ \fB\-C\fP \fIcols\fP ] -+.TP -+.PD -+ [ \fB\-R\fP [ \fB\-en\fP ]] [ \fIarg\fP \&.\&.\&. ] -+With the `\fB\-f\fP\&' option the arguments are printed as described by \fBprintf\fP\&. -+With no flags or with the flag `\fB\-\fP\&', the arguments are printed on -+the standard output as described by \fBecho\fP, with the following differences: -+the escape sequence `\fB\eM\-\fP\fIx\fP\&' metafies the character -+\fIx\fP (sets the highest bit), -+`\fB\eC\-\fP\fIx\fP\&' produces a control character (`\fB\eC\-@\fP' and `\fB\eC\-?\fP' give the -+characters NUL and delete), and `\fB\eE\fP\&' is a synonym for `\fB\ee\fP'\&. -+Finally, if not in an escape -+sequence, `\fB\e\fP\&' escapes the following character and is not printed\&. -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-a\fP -+Print arguments with the column incrementing first\&. Only useful with the -+\fB\-c\fP and \fB\-C\fP options\&. -+.TP -+\fB\-b\fP -+Recognize all the escape sequences defined for the \fBbindkey\fP command, -+see -+\fIzshzle\fP(1)\&. -+.TP -+\fB\-c\fP -+Print the arguments in columns\&. Unless \fB\-a\fP is also given, arguments are -+printed with the row incrementing first\&. -+.TP -+\fB\-C\fP \fIcols\fP -+Print the arguments in \fIcols\fP columns\&. Unless \fB\-a\fP is also given, -+arguments are printed with the row incrementing first\&. -+.TP -+\fB\-D\fP -+Treat the arguments as directory names, replacing prefixes with \fB~\fP -+expressions, as appropriate\&. -+.TP -+\fB\-i\fP -+If given together with \fB\-o\fP or \fB\-O\fP, sorting is performed -+case\-independently\&. -+.TP -+\fB\-l\fP -+Print the arguments separated by newlines instead of spaces\&. -+.TP -+\fB\-m\fP -+Take the first argument as a pattern (should be quoted), and remove -+it from the argument list together with subsequent arguments that -+do not match this pattern\&. -+.TP -+\fB\-n\fP -+Do not add a newline to the output\&. -+.TP -+\fB\-N\fP -+Print the arguments separated and terminated by nulls\&. -+.TP -+\fB\-o\fP -+Print the arguments sorted in ascending order\&. -+.TP -+\fB\-O\fP -+Print the arguments sorted in descending order\&. -+.TP -+\fB\-p\fP -+Print the arguments to the input of the coprocess\&. -+.TP -+\fB\-P\fP -+Perform prompt expansion (see -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. -+.TP -+\fB\-r\fP -+Ignore the escape conventions of \fBecho\fP\&. -+.TP -+\fB\-R\fP -+Emulate the BSD \fBecho\fP command, which does not process escape sequences -+unless the \fB\-e\fP flag is given\&. The \fB\-n\fP flag suppresses the trailing -+newline\&. Only the \fB\-e\fP and \fB\-n\fP flags are recognized after -+\fB\-R\fP; all other arguments and options are printed\&. -+.TP -+\fB\-s\fP -+Place the results in the history list instead of on the standard output\&. -+.TP -+\fB\-u\fP \fIn\fP -+Print the arguments to file descriptor \fIn\fP\&. -+.TP -+\fB\-z\fP -+Push the arguments onto the editing buffer stack, separated by spaces\&. -+.PP -+If any of `\fB\-m\fP\&', `\fB\-o\fP' or `\fB\-O\fP' are used in combination with -+`\fB\-f\fP\&' and there are no arguments (after the removal process in the -+case of `\fB\-m\fP\&') then nothing is printed\&. -+.RE -+.TP -+\fBprintf\fP \fIformat\fP [ \fIarg\fP \&.\&.\&. ] -+Print the arguments according to the format specification\&. Formatting -+rules are the same as used in C\&. The same escape sequences as for \fBecho\fP -+are recognised in the format\&. All C conversion specifications ending in -+one of csdiouxXeEfgGn are handled\&. In addition to this, `\fB%b\fP\&' can be -+used instead of `\fB%s\fP\&' to cause escape sequences in the argument to be -+recognised and `\fB%q\fP\&' can be used to quote the argument in such a way -+that allows it to be reused as shell input\&. With the numeric format -+specifiers, if the corresponding argument starts with a quote character, -+the numeric value of the following character is used as the number to -+print otherwise the argument is evaluated as an arithmetic expression\&. See -+the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) -+for a description of arithmetic -+expressions\&. With `\fB%n\fP\&', the corresponding argument is taken as an -+identifier which is created as an integer parameter\&. -+.RS -+.PP -+Normally, conversion specifications are applied to each argument in order -+but they can explicitly specify the \fIn\fPth argument is to be used by -+replacing `\fB%\fP\&' by `\fB%\fP\fIn\fP\fB$\fP' and `\fB*\fP' by `\fB*\fP\fIn\fP\fB$\fP'\&. -+It is recommended that you do not mix references of this explicit style -+with the normal style and the handling of such mixed styles may be subject -+to future change\&. -+.PP -+If arguments remain unused after formatting, the format string is reused -+until all arguments have been consumed\&. With the \fBprint\fP builtin, this -+can be suppressed by using the \fB\-r\fP option\&. If more arguments are -+required by the format than have been specified, the behaviour is as if -+zero or an empty string had been specified as the argument\&. -+.RE -+.TP -+.PD 0 -+\fBpushd\fP [ \fB\-qsLP\fP ] [ \fIarg\fP ] -+.TP -+.PD 0 -+\fBpushd\fP [ \fB\-qsLP\fP ] \fIold\fP \fInew\fP -+.TP -+.PD -+\fBpushd\fP [ \fB\-qsLP\fP ] {\fB+\fP|\fB\-\fP}\fIn\fP -+Change the current directory, and push the old current directory -+onto the directory stack\&. In the first form, change the -+current directory to \fIarg\fP\&. -+If \fIarg\fP is not specified, change to the second directory -+on the stack (that is, exchange the top two entries), or -+change to \fB$HOME\fP if the \fBPUSHD_TO_HOME\fP -+option is set or if there is only one entry on the stack\&. -+Otherwise, \fIarg\fP is interpreted as it would be by \fBcd\fP\&. -+The meaning of \fIold\fP and \fInew\fP in the second form is also -+the same as for \fBcd\fP\&. -+.RS -+.PP -+The third form of \fBpushd\fP changes directory by rotating the -+directory list\&. An argument of the form `\fB+\fP\fIn\fP\&' identifies a stack -+entry by counting from the left of the list shown by the \fBdirs\fP -+command, starting with zero\&. An argument of the form `\fB\-\fP\fIn\fP\&' counts -+from the right\&. If the \fBPUSHD_MINUS\fP option is set, the meanings -+of `\fB+\fP\&' and `\fB\-\fP' in this context are swapped\&. -+.PP -+If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP -+and the functions in the array \fB$chpwd_functions\fP are not called, -+and the new directory stack is not printed\&. This is useful for calls to -+\fBpushd\fP that do not change the environment seen by an interactive user\&. -+.PP -+If the option \fB\-q\fP is not specified and the shell option \fBPUSHD_SILENT\fP -+is not set, the directory stack will be printed after a \fBpushd\fP is -+performed\&. -+.PP -+The options \fB\-s\fP, \fB\-L\fP and \fB\-P\fP have the same meanings as for the -+\fBcd\fP builtin\&. -+.RE -+.TP -+\fBpushln\fP [ \fIarg\fP \&.\&.\&. ] -+Equivalent to \fBprint \-nz\fP\&. -+.TP -+\fBpwd\fP [ \fB\-rLP\fP ] -+Print the absolute pathname of the current working directory\&. -+If the \fB\-r\fP or the \fB\-P\fP flag is specified, or the \fBCHASE_LINKS\fP -+option is set and the \fB\-L\fP flag is not given, the printed path will not -+contain symbolic links\&. -+.TP -+\fBr\fP -+Same as \fBfc \-e \-\fP\&. -+.TP -+.PD 0 -+\fBread\fP [ \fB\-rszpqAclneE\fP ] [ \fB\-t\fP [ \fInum\fP ] ] [ \fB\-k\fP [ \fInum\fP ] ] [ \fB\-d\fP \fIdelim\fP ] -+.TP -+.PD -+ [ \fB\-u\fP \fIn\fP ] [ \fIname\fP[\fB?\fP\fIprompt\fP] ] [ \fIname\fP \&.\&.\&. ] -+Read one line and break it into fields using the characters -+in \fB$IFS\fP as separators, except as noted below\&. -+The first field is assigned to the first \fIname\fP, the second field -+to the second \fIname\fP, etc\&., with leftover -+fields assigned to the last \fIname\fP\&. -+If \fIname\fP is omitted then -+\fBREPLY\fP is used for scalars and \fBreply\fP for arrays\&. -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-r\fP -+Raw mode: a `\fB\e\fP\&' at the end of a line does not signify line -+continuation and backslashes in the line don\&'t quote the following -+character and are not removed\&. -+.TP -+\fB\-s\fP -+Don\&'t echo back characters if reading from the terminal\&. Currently does -+not work with the \fB\-q\fP option\&. -+.TP -+\fB\-q\fP -+Read only one character from the terminal and set \fIname\fP to -+`\fBy\fP\&' if this character was `\fBy\fP' or `\fBY\fP' and to `\fBn\fP' otherwise\&. -+With this flag set the return status is zero only if the character was -+`\fBy\fP\&' or `\fBY\fP'\&. This option may be used with a timeout; if -+the read times out, or encounters end of file, status 2 is returned\&. -+Input is read from the terminal unless one of \fB\-u\fP -+or \fB\-p\fP is present\&. This option may also be used within zle widgets\&. -+.TP -+\fB\-k\fP [ \fInum\fP ] -+Read only one (or \fInum\fP) characters\&. All are assigned to the first -+\fIname\fP, without word splitting\&. This flag is ignored when \fB\-q\fP is -+present\&. Input is read from the terminal unless one of \fB\-u\fP or \fB\-p\fP -+is present\&. This option may also be used within zle widgets\&. -+.RS -+.PP -+Note that despite the mnemonic `key\&' this option does read full -+characters, which may consist of multiple bytes if the option -+\fBMULTIBYTE\fP is set\&. -+.RE -+.TP -+\fB\-z\fP -+Read one entry from the editor buffer stack and assign it to the first -+\fIname\fP, without word splitting\&. Text is pushed onto the stack with -+`\fBprint \-z\fP\&' or with \fBpush\-line\fP from the line editor (see -+\fIzshzle\fP(1))\&. This flag is ignored when the \fB\-k\fP or \fB\-q\fP flags are present\&. -+.TP -+.PD 0 -+\fB\-e\fP -+.TP -+.PD -+\fB\-E\fP -+The input read is printed (echoed) to the standard output\&. If the \fB\-e\fP -+flag is used, no input is assigned to the parameters\&. -+.TP -+\fB\-A\fP -+The first \fIname\fP is taken as the name of an array and all words are -+assigned to it\&. -+.TP -+.PD 0 -+\fB\-c\fP -+.TP -+.PD -+\fB\-l\fP -+These flags are allowed only if called inside a -+function used for completion (specified with the \fB\-K\fP flag to -+\fBcompctl\fP)\&. If the \fB\-c\fP flag is given, the words of the -+current command are read\&. If the \fB\-l\fP flag is given, the whole -+line is assigned as a scalar\&. If both flags are present, \fB\-l\fP -+is used and \fB\-c\fP is ignored\&. -+.TP -+\fB\-n\fP -+Together with \fB\-c\fP, the number of the word the cursor is on is -+read\&. With \fB\-l\fP, the index of the character the cursor is on is -+read\&. Note that the command name is word number 1, not word 0, -+and that when the cursor is at the end of the line, its character -+index is the length of the line plus one\&. -+.TP -+\fB\-u\fP \fIn\fP -+Input is read from file descriptor \fIn\fP\&. -+.TP -+\fB\-p\fP -+Input is read from the coprocess\&. -+.TP -+\fB\-d\fP \fIdelim\fP -+Input is terminated by the first character of \fIdelim\fP instead of -+by newline\&. -+.TP -+\fB\-t\fP [ \fInum\fP ] -+Test if input is available before attempting to read\&. If \fInum\fP -+is present, it must begin with a digit and will be evaluated -+to give a number of seconds, which may be a floating point number; -+in this case the read times out if input is not available within this -+time\&. If \fInum\fP is not present, it is taken to be zero, so that -+\fBread\fP returns immediately if no input is available\&. -+If no input is available, return status 1 and do not set any variables\&. -+ -+This option is not available when reading from the editor buffer with -+\fB\-z\fP, when called from within completion with \fB\-c\fP or \fB\-l\fP, with -+\fB\-q\fP which clears the input queue before reading, or within zle where -+other mechanisms should be used to test for input\&. -+ -+Note that read does not attempt to alter the input processing mode\&. The -+default mode is canonical input, in which an entire line is read at a time, -+so usually `\fBread \-t\fP\&' will not read anything until an entire line has -+been typed\&. However, when reading from the terminal with \fB\-k\fP -+input is processed one key at a time; in this case, only availability of -+the first character is tested, so that e\&.g\&. `\fBread \-t \-k 2\fP\&' can still -+block on the second character\&. Use two instances of `\fBread \-t \-k\fP\&' if -+this is not what is wanted\&. -+.PP -+If the first argument contains a `\fB?\fP\&', the remainder of this -+word is used as a \fIprompt\fP on standard error when the shell -+is interactive\&. -+.PP -+The value (exit status) of \fBread\fP is 1 when an end\-of\-file is -+encountered, or when \fB\-c\fP or \fB\-l\fP is present and the command is -+not called from a \fBcompctl\fP function, or as described for \fB\-q\fP\&. -+Otherwise the value is 0\&. -+.PP -+The behavior of some combinations of the \fB\-k\fP, \fB\-p\fP, \fB\-q\fP, \fB\-u\fP -+and \fB\-z\fP flags is undefined\&. Presently \fB\-q\fP cancels all the others, -+\fB\-p\fP cancels \fB\-u\fP, \fB\-k\fP cancels \fB\-z\fP, and otherwise \fB\-z\fP -+cancels both \fB\-p\fP and \fB\-u\fP\&. -+.PP -+The \fB\-c\fP or \fB\-l\fP flags cancel any and all of \fB\-kpquz\fP\&. -+.RE -+.TP -+\fBreadonly\fP -+Same as \fBtypeset \-r\fP\&. -+.TP -+\fBrehash\fP -+Same as \fBhash \-r\fP\&. -+.TP -+\fBreturn\fP [ \fIn\fP ] -+Causes a shell function or `\fB\&.\fP\&' script to return to -+the invoking script with the return status specified by \fIn\fP\&. If \fIn\fP -+is omitted, the return status is that of the last command -+executed\&. -+.RS -+.PP -+If \fBreturn\fP was executed from a trap in a \fBTRAP\fP\fINAL\fP function, -+the effect is different for zero and non\-zero return status\&. With zero -+status (or after an implicit return at the end of the trap), the shell -+will return to whatever it was previously processing; with a non\-zero -+status, the shell will behave as interrupted except that the return -+status of the trap is retained\&. Note that the numeric value of the signal -+which caused the trap is passed as the first argument, so the statement -+`\fBreturn $((128+$1))\fP\&' will return the same status as if the signal -+had not been trapped\&. -+.RE -+.TP -+\fBsched\fP -+See the section `The zsh/sched Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBset\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP [ \fIoption_name\fP ] ] \&.\&.\&. [ {\fB+\fP|\fB\-\fP}\fBA\fP [ \fIname\fP ] ] [ \fIarg\fP \&.\&.\&. ] -+Set the options for the shell and/or set the positional parameters, or -+declare and set an array\&. If the \fB\-s\fP option is given, it causes the -+specified arguments to be sorted before assigning them to the positional -+parameters (or to the array \fIname\fP if \fB\-A\fP is used)\&. With \fB+s\fP -+sort arguments in descending order\&. For the meaning of the other flags, see -+\fIzshoptions\fP(1)\&. Flags may be specified by name using the \fB\-o\fP option\&. If no option -+name is supplied with \fB\-o\fP, the current option states are printed: see -+the description of \fBsetopt\fP below for more information on the format\&. -+With \fB+o\fP they are printed in a form that can be used as input -+to the shell\&. -+.RS -+.PP -+If the \fB\-A\fP flag is specified, \fIname\fP is set to an array containing -+the given \fIarg\fPs; if no \fIname\fP is specified, all arrays are printed -+together with their values\&. -+.PP -+If \fB+A\fP is used and \fIname\fP is an array, the -+given arguments will replace the initial elements of that array; if no -+\fIname\fP is specified, all arrays are printed without their values\&. -+.PP -+The behaviour of arguments after \fB\-A\fP \fIname\fP or \fB+A\fP \fIname\fP -+depends on whether the option \fBKSH_ARRAYS\fP is set\&. If it is not set, all -+arguments following \fIname\fP are treated as values for the array, -+regardless of their form\&. If the option is set, normal option processing -+continues at that point; only regular arguments are treated as values for -+the array\&. This means that -+.PP -+.RS -+.nf -+\fBset \-A array \-x \-\- foo\fP -+.fi -+.RE -+.PP -+sets \fBarray\fP to `\fB\-x \-\fP\fB\- foo\fP\&' if \fBKSH_ARRAYS\fP is not set, but sets -+the array to \fBfoo\fP and turns on the option `\fB\-x\fP\&' if it is set\&. -+.PP -+If the \fB\-A\fP flag is not present, but there are arguments beyond the -+options, the positional parameters are set\&. If the option list (if any) -+is terminated by `\fB\-\fP\fB\-\fP\&', and there are no further arguments, the -+positional parameters will be unset\&. -+.PP -+If no arguments and no `\fB\-\fP\fB\-\fP\&' are given, then the names and values of -+all parameters are printed on the standard output\&. If the only argument is -+`\fB+\fP\&', the names of all parameters are printed\&. -+.PP -+For historical reasons, `\fBset \-\fP\&' is treated as `\fBset +xv\fP' -+and `\fBset \-\fP \fIargs\fP\&' as `\fBset +xv \-\-\fP \fIargs\fP' when in -+any other emulation mode than zsh\&'s native mode\&. -+.RE -+.TP -+\fBsetcap\fP -+See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBsetopt\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP \fIoption_name\fP ] [ \fIname\fP \&.\&.\&. ] -+Set the options for the shell\&. All options specified either -+with flags or by name are set\&. -+.RS -+.PP -+If no arguments are supplied, the names of all options currently set are -+printed\&. The form is chosen so as to minimize the differences from the -+default options for the current emulation (the default emulation being -+native \fBzsh\fP, shown as \fB\fP in -+\fIzshoptions\fP(1))\&. -+Options that are on by default for the emulation are -+shown with the prefix \fBno\fP only if they are off, while other options are -+shown without the prefix \fBno\fP and only if they are on\&. In addition to -+options changed from the default state by the user, any options activated -+automatically by the shell (for example, \fBSHIN_STDIN\fP or \fBINTERACTIVE\fP) -+will be shown in the list\&. The format is further modified by the option -+\fBKSH_OPTION_PRINT\fP, however the rationale for choosing options with -+or without the \fBno\fP prefix remains the same in this case\&. -+.PP -+If the \fB\-m\fP flag is given the arguments are taken as patterns -+(which should be quoted to protect them from filename expansion), and all -+options with names matching these patterns are set\&. -+.RE -+.TP -+\fBshift\fP [ \fIn\fP ] [ \fIname\fP \&.\&.\&. ] -+The positional parameters \fB${\fP\fIn\fP+1\fB}\fP \&.\&.\&. are renamed -+to \fB$1\fP \&.\&.\&., where \fIn\fP is an arithmetic expression that -+defaults to 1\&. -+If any \fIname\fPs are given then the arrays with these names are -+shifted instead of the positional parameters\&. -+.TP -+\fBsource\fP \fIfile\fP [ \fIarg\fP \&.\&.\&. ] -+Same as `\fB\&.\fP\&', except that the current directory is always searched and -+is always searched first, before directories in \fB$path\fP\&. -+.TP -+\fBstat\fP -+See the section `The zsh/stat Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBsuspend\fP [ \fB\-f\fP ] -+Suspend the execution of the shell (send it a \fBSIGTSTP\fP) -+until it receives a \fBSIGCONT\fP\&. -+Unless the \fB\-f\fP option is given, this will refuse to suspend a login shell\&. -+.TP -+.PD 0 -+\fBtest\fP [ \fIarg\fP \&.\&.\&. ] -+.TP -+.PD -+\fB[\fP [ \fIarg\fP \&.\&.\&. ] \fB]\fP -+Like the system version of \fBtest\fP\&. Added for compatibility; -+use conditional expressions instead (see the section `Conditional Expressions\&')\&. -+The main differences between the conditional expression syntax and the -+\fBtest\fP and \fB[\fP builtins are: these commands are not handled -+syntactically, so for example an empty variable expansion may cause an -+argument to be omitted; syntax errors cause status 2 to be returned instead -+of a shell error; and arithmetic operators expect integer arguments rather -+than arithmetic expressions\&. -+.RS -+.PP -+The command attempts to implement POSIX and its extensions where these -+are specified\&. Unfortunately there are intrinsic ambiguities in -+the syntax; in particular there is no distinction between test operators -+and strings that resemble them\&. The standard attempts to resolve these -+for small numbers of arguments (up to four); for five or more arguments -+compatibility cannot be relied on\&. Users are urged wherever possible to -+use the `\fB[[\fP\&' test syntax which does not have these ambiguities\&. -+.RE -+.TP -+\fBtimes\fP -+Print the accumulated user and system times for the shell -+and for processes run from the shell\&. -+.TP -+\fBtrap\fP [ \fIarg\fP ] [ \fIsig\fP \&.\&.\&. ] -+\fIarg\fP 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 any of the signals specified by one or more \fIsig\fP args\&. -+Each \fIsig\fP can be given as a number, -+or as the name of a signal either with or without the string \fBSIG\fP -+in front (e\&.g\&. 1, HUP, and SIGHUP are all the same signal)\&. -+.RS -+.PP -+If \fIarg\fP is `\fB\-\fP\&', then the specified signals are reset to their -+defaults, or, if no \fIsig\fP args are present, all traps are reset\&. -+.PP -+If \fIarg\fP is an empty string, then the specified signals -+are ignored by the shell (and by the commands it invokes)\&. -+.PP -+If \fIarg\fP is omitted but one or more \fIsig\fP args are provided (i\&.e\&. -+the first argument is a valid signal number or name), the effect is the -+same as if \fIarg\fP had been specified as `\fB\-\fP\&'\&. -+.PP -+The \fBtrap\fP command with no arguments prints a list of commands -+associated with each signal\&. -+.PP -+If \fIsig\fP is \fBZERR\fP then \fIarg\fP will be executed -+after each command with a nonzero exit status\&. \fBERR\fP is an alias -+for \fBZERR\fP on systems that have no \fBSIGERR\fP signal (this is the -+usual case)\&. -+.PP -+If \fIsig\fP is \fBDEBUG\fP then \fIarg\fP will be executed -+before each command if the option \fBDEBUG_BEFORE_CMD\fP is set -+(as it is by default), else after each command\&. Here, a `command\&' is -+what is described as a `sublist\&' in the shell grammar, see -+the section SIMPLE COMMANDS & PIPELINES in \fIzshmisc\fP(1)\&. -+If \fBDEBUG_BEFORE_CMD\fP is set various additional features are available\&. -+First, it is possible to skip the next command by setting the option -+\fBERR_EXIT\fP; see the description of the \fBERR_EXIT\fP option in -+\fIzshoptions\fP(1)\&. Also, the shell parameter -+\fBZSH_DEBUG_CMD\fP is set to the string corresponding to the command -+to be executed following the trap\&. Note that this string is reconstructed -+from the internal format and may not be formatted the same way as the -+original text\&. The parameter is unset after the trap is executed\&. -+.PP -+If \fIsig\fP is \fB0\fP or \fBEXIT\fP -+and the \fBtrap\fP statement is executed inside the body of a function, -+then the command \fIarg\fP is executed after the function completes\&. -+The value of \fB$?\fP at the start of execution is the exit status of the -+shell or the return status of the function exiting\&. -+If \fIsig\fP is \fB0\fP or \fBEXIT\fP -+and the \fBtrap\fP statement is not executed inside the body of a function, -+then the command \fIarg\fP is executed when the shell terminates; the -+trap runs before any \fBzshexit\fP hook functions\&. -+.PP -+\fBZERR\fP, \fBDEBUG\fP, and \fBEXIT\fP traps are not executed inside other -+traps\&. \fBZERR\fP and \fBDEBUG\fP traps are kept within subshells, while -+other traps are reset\&. -+.PP -+Note that traps defined with the \fBtrap\fP builtin are slightly different -+from those defined as `\fBTRAP\fP\fINAL\fP () { \&.\&.\&. }\&', 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, -+.PP -+.RS -+.nf -+\fBtrap \&'print $LINENO' DEBUG\fP -+.fi -+.RE -+.PP -+will print the line number of a command executed after it has run, while -+.PP -+.RS -+.nf -+\fBTRAPDEBUG() { print $LINENO; }\fP -+.fi -+.RE -+.PP -+will always print the number zero\&. -+.PP -+Alternative signal names are allowed as described under \fBkill\fP above\&. -+Defining a trap under either name causes any trap under an alternative -+name to be removed\&. However, it is recommended that for consistency -+users stick exclusively to one name or another\&. -+.RE -+.TP -+\fBtrue\fP [ \fIarg\fP \&.\&.\&. ] -+Do nothing and return an exit status of 0\&. -+.TP -+\fBttyctl\fP \fB\-fu\fP -+The \fB\-f\fP option freezes the tty, and \fB\-u\fP unfreezes it\&. -+When the tty is frozen, no changes made to the tty settings by -+external programs will be honored by the shell, except for changes in the -+size of the screen; the shell will -+simply reset the settings to their previous values as soon as each -+command exits or is suspended\&. Thus, \fBstty\fP and similar programs have -+no effect when the tty is frozen\&. Without options it reports whether the -+terminal is frozen or not\&. -+.TP -+\fBtype\fP [ \fB\-wfpams\fP ] \fIname\fP \&.\&.\&. -+Equivalent to \fBwhence \-v\fP\&. -+.TP -+.PD 0 -+\fBtypeset\fP [ {\fB+\fP|\fB\-\fP}\fBAEFHUafghklprtuxmz\fP ] [ \fB\-LRZi\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] -+.TP -+.PD -+\fBtypeset\fP \-T [ {\fB+|\fB\-\fP\fP}\fBUrux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] \fISCALAR\fP[\fB=\fP\fIvalue\fP] \fIarray\fP \fB[\fP \fIsep\fP \fB]\fP -+Set or display attributes and values for shell parameters\&. -+.RS -+.PP -+A parameter is created for each \fIname\fP that does not already refer -+to one\&. When inside a function, a new parameter is created for every -+\fIname\fP (even those that already exist), and is unset again when the -+function completes\&. See -+`Local Parameters\&' in \fIzshparam\fP(1)\&. The same rules apply to special shell parameters, which -+retain their special attributes when made local\&. -+.PP -+For each \fIname\fP\fB=\fP\fIvalue\fP assignment, the parameter -+\fIname\fP is set to \fIvalue\fP\&. Note that arrays currently cannot be -+assigned in \fBtypeset\fP expressions, only scalars and integers\&. Unless -+the option \fBKSH_TYPESET\fP is set, normal expansion rules apply to -+assignment arguments, so \fIvalue\fP may be split into separate words; if -+the option is set, assignments which can be recognised when expansion is -+performed are treated as single words\&. For example the command -+\fBtypeset vbl=$(echo one two)\fP is treated as having one argument if -+\fBKSH_TYPESET\fP is set, but otherwise is treated as having the two arguments -+\fBvbl=one\fP and \fBtwo\fP\&. -+.PP -+If the shell option \fBTYPESET_SILENT\fP is not set, for each remaining -+\fIname\fP that refers to a parameter that is set, the name and value of the -+parameter are printed in the form of an assignment\&. Nothing is printed for -+newly\-created parameters, or when any attribute flags listed below are -+given along with the \fIname\fP\&. Using `\fB+\fP\&' instead of minus to -+introduce an attribute turns it off\&. -+.PP -+If the \fB\-p\fP option is given, parameters and values are printed in the -+form of a typeset command and an assignment (which will be printed -+separately for arrays and associative arrays), regardless of other flags -+and options\&. Note that the \fB\-h\fP flag on parameters is respected; no -+value will be shown for these parameters\&. -+.PP -+If the \fB\-T\fP option is given, two or three arguments must be present (an -+exception is that zero arguments are allowed to show the list of parameters -+created in this fashion)\&. The first two are the name of a scalar and an -+array parameter (in that order) that will be tied together in the manner of -+\fB$PATH\fP and \fB$path\fP\&. The optional third argument is a single\-character -+separator which will be used to join the elements of the array to form the -+scalar; if absent, a colon is used, as with \fB$PATH\fP\&. Only the first -+character of the separator is significant; any remaining characters are -+ignored\&. Only the scalar parameter may be assigned 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 -+of them with another \fBtypeset\fP command; \fB+T\fP does not work, assigning -+an array to \fISCALAR\fP is an error, and assigning a scalar to \fIarray\fP -+sets it to be a single\-element array\&. Note that both `\fBtypeset \-xT \&.\&.\&.\fP\&' -+and `\fBexport \-T \&.\&.\&.\fP\&' work, but only the scalar will be marked for -+export\&. Setting the value using the scalar version causes a split on all -+separators (which cannot be quoted)\&. -+.PP -+The \fB\-g\fP (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 \fB+g\fP -+have any effect except in combination with \fB\-m\fP (see below)\&. -+.PP -+If no \fIname\fP 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 `\fB+\fP\&' -+rather than `\fB\-\fP\&' to introduce the flag suppresses printing of the values -+of parameters when there is no parameter name\&. Also, if the last option -+is the word `\fB+\fP\&', then names are printed but values are not\&. -+.PP -+If the \fB\-m\fP flag is given the \fIname\fP arguments are taken as patterns -+(which should be quoted)\&. With no attribute flags, all parameters (or -+functions with the \fB\-f\fP flag) with matching names are printed (the shell -+option \fBTYPESET_SILENT\fP is not used in this case)\&. Note that \fB\-m\fP is -+ignored if no patterns are given\&. If the \fB+g\fP flag is combined with -+\fB\-m\fP, a new local parameter is created for every matching parameter that -+is not already local\&. Otherwise \fB\-m\fP applies all other flags or -+assignments to the existing parameters\&. Except when assignments are made -+with \fIname\fP\fB=\fP\fIvalue\fP, using \fB+m\fP forces the matching parameters -+to be printed, even inside a function\&. -+.PP -+If no attribute flags are given and either no \fB\-m\fP flag is present or -+the \fB+m\fP form was used, each parameter name printed is preceded by a -+list of the attributes of that parameter (\fBarray\fP, \fBassociation\fP, -+\fBexported\fP, \fBinteger\fP, \fBreadonly\fP)\&. If \fB+m\fP is used with attribute -+flags, and all those flags are introduced with \fB+\fP, the matching -+parameter names are printed but their values are not\&. -+.PP -+Attribute flags that transform the final value (\fB\-L\fP, \fB\-R\fP, \fB\-Z\fP, -+\fB\-l\fP, \fBu\fP) are only applied to the expanded value at the point -+of a parameter expansion expression using `\fB$\fP\&'\&. They are not applied -+when a parameter is retrieved internally by the shell for any purpose\&. -+.PP -+The following attribute flags may be specified: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-A\fP -+The names refer to associative array parameters; see -+`Array Parameters\&' in \fIzshparam\fP(1)\&. -+.TP -+\fB\-L\fP -+Left justify and remove leading blanks from \fIvalue\fP\&. -+If \fIn\fP is nonzero, it defines the width of the field\&. -+If \fIn\fP is zero, the width is determined by the width of the value of -+the first assignment\&. In the case of numeric parameters, the length of the -+complete value assigned to the parameter is used to determine the width, -+not the value that would be output\&. -+.RS -+.PP -+The width is the count of characters, which may be multibyte characters -+if the \fBMULTIBYTE\fP option is in effect\&. Note that the screen -+width of the character is not taken into account; if this is required, -+use padding with parameter expansion flags -+\fB${(ml\fP\fI\&.\&.\&.\fP\fB)\fP\fI\&.\&.\&.\fP\fB}\fP as described in -+`Parameter Expansion Flags\&' in -+\fIzshexpn\fP(1)\&. -+.PP -+When the parameter is expanded, it is filled on the right with -+blanks or truncated if necessary to fit the field\&. -+Note truncation can lead to unexpected results with numeric parameters\&. -+Leading zeros are removed if the \fB\-Z\fP flag is also set\&. -+.RE -+.TP -+\fB\-R\fP -+Similar to \fB\-L\fP, except that right justification is used; -+when the parameter is expanded, the field is left filled with -+blanks or truncated from the end\&. May not be combined with the \fB\-Z\fP -+flag\&. -+.TP -+\fB\-U\fP -+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 \fBPATH\fP or \fBFIGNORE\fP, etc\&. -+This flag has a different meaning when used with \fB\-f\fP; see below\&. -+.TP -+\fB\-Z\fP -+Specially handled if set along with the \fB\-L\fP flag\&. -+Otherwise, similar to \fB\-R\fP, except that leading zeros are used for -+padding instead of blanks if the first non\-blank character is a digit\&. -+Numeric parameters are specially handled: they are always eligible -+for padding with zeroes, and the zeroes are inserted at an appropriate -+place in the output\&. -+.TP -+\fB\-a\fP -+The names refer to array parameters\&. An array parameter may be -+created this way, but it may not be assigned to in the \fBtypeset\fP -+statement\&. When displaying, both normal and associative arrays are -+shown\&. -+.TP -+\fB\-f\fP -+The names refer to functions rather than parameters\&. No assignments -+can be made, and the only other valid flags are \fB\-t\fP, \fB\-k\fP, \fB\-u\fP, -+\fB\-U\fP and \fB\-z\fP\&. The flag \fB\-t\fP turns on execution tracing for this -+function\&. The \fB\-u\fP and \fB\-U\fP flags cause the function to be -+marked for autoloading; \fB\-U\fP also causes alias expansion to be -+suppressed when the function is loaded\&. The \fBfpath\fP parameter -+will be searched to find the function definition when the function -+is first referenced; see the section `Functions\&'\&. The \fB\-k\fP and \fB\-z\fP flags -+make the function be loaded using ksh\-style or zsh\-style autoloading -+respectively\&. If neither is given, the setting of the KSH_AUTOLOAD option -+determines how the function is loaded\&. -+.TP -+\fB\-h\fP -+Hide: only useful for special parameters (those marked `\&' in the table in -+\fIzshparam\fP(1)), 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 `\fBtypeset \-h -+PATH\fP\&', a function containing `\fBtypeset PATH\fP' will create an ordinary -+local parameter without the usual behaviour of \fBPATH\fP\&. Alternatively, -+the local parameter may itself be given this attribute; hence inside a -+function `\fBtypeset \-h PATH\fP\&' creates an ordinary local parameter and the -+special \fBPATH\fP parameter is not altered in any way\&. It is also possible -+to create a local parameter using `\fBtypeset +h \fP\fIspecial\fP\&', where the -+local copy of \fIspecial\fP will retain its special properties regardless of -+having the \fB\-h\fP attribute\&. Global special parameters loaded from shell -+modules (currently those in \fBzsh/mapfile\fP and \fBzsh/parameter\fP) are -+automatically given the \fB\-h\fP attribute to avoid name clashes\&. -+.TP -+\fB\-H\fP -+Hide value: specifies that \fBtypeset\fP will not display the value of the -+parameter when listing parameters; the display for such parameters is -+always as if the `\fB+\fP\&' flag had been given\&. Use of the parameter is -+in other respects normal, and the option does not apply if the parameter is -+specified by name, or by pattern with the \fB\-m\fP option\&. This is on by -+default for the parameters in the \fBzsh/parameter\fP and \fBzsh/mapfile\fP -+modules\&. Note, however, that unlike the \fB\-h\fP flag this is also useful -+for non\-special parameters\&. -+.TP -+\fB\-i\fP -+Use an internal integer representation\&. If \fIn\fP is nonzero it -+defines the output arithmetic base, otherwise it is determined by the -+first assignment\&. Bases from 2 to 36 inclusive are allowed\&. -+.TP -+\fB\-E\fP -+Use an internal double\-precision floating point representation\&. On output -+the variable will be converted to scientific notation\&. If \fIn\fP is -+nonzero it defines the number of significant figures to display; the -+default is ten\&. -+.TP -+\fB\-F\fP -+Use an internal double\-precision floating point representation\&. On output -+the variable will be converted to fixed\-point decimal notation\&. If \fIn\fP -+is nonzero it defines the number of digits to display after the decimal -+point; the default is ten\&. -+.TP -+\fB\-l\fP -+Convert the result to lower case whenever the parameter is expanded\&. -+The value is \fInot\fP converted when assigned\&. -+.TP -+\fB\-r\fP -+The given \fIname\fPs are marked readonly\&. Note that if \fIname\fP is a -+special parameter, the readonly attribute can be turned on, but cannot then -+be turned off\&. -+.TP -+\fB\-t\fP -+Tags the named parameters\&. Tags have no special meaning to the shell\&. -+This flag has a different meaning when used with \fB\-f\fP; see above\&. -+.TP -+\fB\-u\fP -+Convert the result to upper case whenever the parameter is expanded\&. -+The value is \fInot\fP converted when assigned\&. -+This flag has a different meaning when used with \fB\-f\fP; see above\&. -+.TP -+\fB\-x\fP -+Mark for automatic export to the environment of subsequently -+executed commands\&. If the option \fBGLOBAL_EXPORT\fP is set, this implies -+the option \fB\-g\fP, unless \fB+g\fP is also explicitly given; in other words -+the parameter is not made local to the enclosing function\&. This is for -+compatibility with previous versions of zsh\&. -+.RE -+.TP -+\fBulimit\fP [ [ \fB\-SHacdfilmnpqstvx\fP | \fB\-N\fP \fIresource\fP [ \fIlimit\fP ] \&.\&.\&. ] -+Set or display resource limits of the shell and the processes started by -+the shell\&. The value of \fIlimit\fP can be a number in the unit specified -+below or one of the values `\fBunlimited\fP\&', which removes the limit on the -+resource, or `\fBhard\fP\&', which uses the current value of the hard limit on -+the resource\&. -+.RS -+.PP -+By default, only soft limits are manipulated\&. If the \fB\-H\fP flag -+is given use hard limits instead of soft limits\&. If the \fB\-S\fP flag is given -+together with the \fB\-H\fP flag set both hard and soft limits\&. -+.PP -+If no options are used, the file size limit (\fB\-f\fP) is assumed\&. -+.PP -+If \fIlimit\fP is omitted the current value of the specified resources are -+printed\&. When more than one resource value is printed, the limit name and -+unit is printed before each value\&. -+.PP -+When looping over multiple resources, the shell will abort immediately if -+it detects a badly formed argument\&. However, if it fails to set a limit -+for some other reason it will continue trying to set the remaining limits\&. -+.PP -+.PD 0 -+.TP -+\fB\-a\fP -+Lists all of the current resource limits\&. -+.TP -+\fB\-c\fP -+512\-byte blocks on the size of core dumps\&. -+.TP -+\fB\-d\fP -+K\-bytes on the size of the data segment\&. -+.TP -+\fB\-f\fP -+512\-byte blocks on the size of files written\&. -+.TP -+\fB\-i\fP -+The number of pending signals\&. -+.TP -+\fB\-l\fP -+K\-bytes on the size of locked\-in memory\&. -+.TP -+\fB\-m\fP -+K\-bytes on the size of physical memory\&. -+.TP -+\fB\-n\fP -+open file descriptors\&. -+.TP -+\fB\-q\fP -+Bytes in POSIX message queues\&. -+.TP -+\fB\-s\fP -+K\-bytes on the size of the stack\&. -+.TP -+\fB\-t\fP -+CPU seconds to be used\&. -+.TP -+\fB\-u\fP -+processes available to the user\&. -+.TP -+\fB\-v\fP -+K\-bytes on the size of virtual memory\&. On some systems this -+refers to the limit called `address space\&'\&. -+.TP -+\fB\-x\fP -+The number of locks on files\&. -+.PD -+.PP -+A resource may also be specified by integer in the form `\fB\-N\fP -+\fIresource\fP\&', where \fIresource\fP corresponds to the integer defined for -+the resource by the operating system\&. This may be used to set the limits -+for resources known to the shell which do not correspond to option letters\&. -+Such limits will be shown by number in the output of `\fBulimit \-a\fP\&'\&. -+.PP -+The number may alternatively be out of the range of limits compiled into -+the shell\&. The shell will try to read or write the limit anyway, and -+will report an error if this fails\&. -+.RE -+.TP -+\fBumask\fP [ \fB\-S\fP ] [ \fImask\fP ] -+The umask is set to \fImask\fP\&. \fImask\fP can be either -+an octal number or a symbolic value as described in \fIchmod\fP(1)\&. -+If \fImask\fP is omitted, the current value is printed\&. The \fB\-S\fP -+option causes the mask to be printed as a symbolic value\&. Otherwise, -+the mask is printed as an octal number\&. Note that in -+the symbolic form the permissions you specify are those which are to be -+allowed (not denied) to the users specified\&. -+.TP -+\fBunalias\fP -+Same as \fBunhash \-a\fP\&. -+.TP -+\fBunfunction\fP -+Same as \fBunhash \-f\fP\&. -+.TP -+\fBunhash\fP [ \fB\-adfms\fP ] \fIname\fP \&.\&.\&. -+Remove the element named \fIname\fP from an internal hash table\&. The -+default is remove elements from the command hash table\&. The \fB\-a\fP -+option causes \fBunhash\fP to remove regular or global aliases; note -+when removing a global aliases that the argument must be quoted to prevent -+it from being expanded before being passed to the command\&. -+The \fB\-s\fP option causes \fBunhash\fP to remove suffix aliases\&. -+The \fB\-f\fP option causes -+\fBunhash\fP to remove shell functions\&. The \fB\-d\fP options causes -+\fBunhash\fP to remove named directories\&. If the \fB\-m\fP flag is given -+the arguments are taken as patterns (should be quoted) and all elements -+of the corresponding hash table with matching names will be removed\&. -+.TP -+\fBunlimit\fP [ \fB\-hs\fP ] \fIresource\fP \&.\&.\&. -+The resource limit for each \fIresource\fP is set to the hard limit\&. -+If the \fB\-h\fP flag is given and the shell has appropriate privileges, -+the hard resource limit for each \fIresource\fP is removed\&. -+The resources of the shell process are only changed if the \fB\-s\fP -+flag is given\&. -+.RS -+.PP -+The \fBunlimit\fP command is not made available by default when the -+shell starts in a mode emulating another shell\&. It can be made available -+with the command `\fBzmodload \-F zsh/rlimits b:unlimit\fP\&'\&. -+.RE -+.TP -+\fBunset\fP [ \fB\-fmv\fP ] \fIname\fP \&.\&.\&. -+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\&. -+.RS -+.PP -+Individual elements of associative array parameters may be unset by using -+subscript syntax on \fIname\fP, which should be quoted (or the entire command -+prefixed with \fBnoglob\fP) to protect the subscript from filename generation\&. -+.PP -+If the \fB\-m\fP 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\&. -+.PP -+The \fB\-v\fP flag specifies that \fIname\fP refers to parameters\&. This is the -+default behaviour\&. -+.PP -+\fBunset \-f\fP is equivalent to \fBunfunction\fP\&. -+.RE -+.TP -+\fBunsetopt\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP \fIoption_name\fP ] [ \fIname\fP \&.\&.\&. ] -+Unset the options for the shell\&. All options specified either -+with flags or by name are unset\&. If no arguments are supplied, -+the names of all options currently unset are printed\&. -+If the \fB\-m\fP 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\&. -+.TP -+\fBvared\fP -+See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. -+.TP -+\fBwait\fP [ \fIjob\fP \&.\&.\&. ] -+Wait for the specified jobs or processes\&. If \fIjob\fP is not given -+then all currently active child processes are waited for\&. -+Each \fIjob\fP can be either a job specification or the process ID -+of a job in the job table\&. -+The exit status from this command is that of the job waited for\&. -+.TP -+\fBwhence\fP [ \fB\-vcwfpams\fP ] \fIname\fP \&.\&.\&. -+For each name, indicate how it would be interpreted if used as a -+command name\&. -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-v\fP -+Produce a more verbose report\&. -+.TP -+\fB\-c\fP -+Print the results in a \fBcsh\fP\-like format\&. -+This takes precedence over \fB\-v\fP\&. -+.TP -+\fB\-w\fP -+For each \fIname\fP, print `\fIname\fP\fB:\fP \fIword\fP\&' where \fIword\fP -+is one of \fBalias\fP, \fBbuiltin\fP, \fBcommand\fP, \fBfunction\fP, -+\fBhashed\fP, \fBreserved\fP or \fBnone\fP, according as \fIname\fP -+corresponds to an alias, a built\-in command, an external command, a -+shell function, a command defined with the \fBhash\fP builtin, a -+reserved word, or is not recognised\&. This takes precedence over -+\fB\-v\fP and \fB\-c\fP\&. -+.TP -+\fB\-f\fP -+Causes the contents of a shell function to be -+displayed, which would otherwise not happen unless the \fB\-c\fP -+flag were used\&. -+.TP -+\fB\-p\fP -+Do a path search for \fIname\fP -+even if it is an alias, reserved word, shell function or builtin\&. -+.TP -+\fB\-a\fP -+Do a search for all occurrences of \fIname\fP -+throughout the command path\&. -+Normally only the first occurrence is printed\&. -+.TP -+\fB\-m\fP -+The arguments are taken as patterns (should be -+quoted), and the information is displayed for each command matching one -+of these patterns\&. -+.TP -+\fB\-s\fP -+If a pathname contains symlinks, print the symlink\-free pathname as well\&. -+.RE -+.TP -+\fBwhere\fP [ \fB\-wpms\fP ] \fIname\fP \&.\&.\&. -+Equivalent to \fBwhence \-ca\fP\&. -+.TP -+\fBwhich\fP [ \fB\-wpams\fP ] \fIname\fP \&.\&.\&. -+Equivalent to \fBwhence \-c\fP\&. -+.TP -+.PD 0 -+\fBzcompile\fP [ \fB\-U\fP ] [ \fB\-z\fP | \fB\-k\fP ] [ \fB\-R\fP | \fB\-M\fP ] \fIfile\fP [ \fIname\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fBzcompile\fP \fB\-ca\fP [ \fB\-m\fP ] [ \fB\-R\fP | \fB\-M\fP ] \fIfile\fP [ \fIname\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzcompile \-t\fP \fIfile\fP [ \fIname\fP \&.\&.\&. ] -+This builtin command can be used to compile functions or scripts, -+storing 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\&. -+.RS -+.PP -+The first form (without the \fB\-c\fP, \fB\-a\fP or \fB\-t\fP options) creates a -+compiled file\&. If only the \fIfile\fP argument is given, the -+output file has the name `\fIfile\fP\fB\&.zwc\fP\&' and will be placed in -+the same directory as the \fIfile\fP\&. The shell will load the compiled -+file instead of the normal function file when the function -+is autoloaded; see -+the section `Autoloading Functions\&' in \fIzshmisc\fP(1) -+for a description of how autoloaded functions are searched\&. The -+extension \fB\&.zwc\fP stands for `zsh word code\&'\&. -+.PP -+If there is at least one \fIname\fP argument, all the named files -+are compiled into the output \fIfile\fP given as the first argument\&. If -+\fIfile\fP does not end in \fB\&.zwc\fP, this extension is automatically -+appended\&. Files containing multiple compiled functions are called `digest\&' -+files, and are intended to be used as elements of the \fBFPATH\fP/\fBfpath\fP -+special array\&. -+.PP -+The second form, with the \fB\-c\fP or \fB\-a\fP options, writes the compiled -+definitions for all the named functions into \fIfile\fP\&. For \fB\-c\fP, 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 \fB\-a\fP option, in which case the \fBfpath\fP -+is searched and the contents of the definition files for those -+functions, if found, are compiled into \fIfile\fP\&. If both \fB\-c\fP and -+\fB\-a\fP 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 \fB\-c\fP or \fB\-a\fP option will be autoloaded as if the -+\fBKSH_AUTOLOAD\fP option were unset\&. -+.PP -+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 -+`\fBzcompile \-c\fP\&' does not include the additional functions defined in -+the file, and any other initialization code in the file is lost\&. Using -+`\fBzcompile \-a\fP\&' captures all this extra information\&. -+.PP -+If the \fB\-m\fP option is combined with \fB\-c\fP or \fB\-a\fP, -+the \fIname\fPs are used as patterns and all functions whose names -+match one of these patterns will be written\&. If no \fIname\fP is given, -+the definitions of all functions currently defined or marked as -+autoloaded will be written\&. -+.PP -+The third form, with the \fB\-t\fP option, examines an existing -+compiled file\&. Without further arguments, the names of the original -+files compiled into it are listed\&. The first line of output shows -+the version of the shell which compiled the file and how the file -+will be used (i\&.e\&. by reading it directly or by mapping it into memory)\&. -+With arguments, nothing is output and the return status is set to zero if -+definitions for \fIall\fP \fIname\fPs were found in the compiled -+file, and non\-zero if the definition for at least one \fIname\fP was not -+found\&. -+.PP -+Other options: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-U\fP -+Aliases are not expanded when compiling the \fIname\fPd files\&. -+.TP -+\fB\-R\fP -+When the compiled file is read, its contents are copied into the -+shell\&'s memory, rather than memory\-mapped (see \fB\-M\fP)\&. This -+happens automatically on systems that do not support memory mapping\&. -+.RS -+.PP -+When compiling scripts instead of autoloadable functions, it is -+often desirable to use this option; otherwise the whole file, including the -+code to define functions which have already been defined, will -+remain mapped, consequently wasting memory\&. -+.RE -+.TP -+\fB\-M\fP -+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 \fB\-R\fP nor -+\fB\-M\fP is given, the \fBzcompile\fP builtin decides what to do based -+on the size of the compiled file\&. -+.TP -+.PD 0 -+\fB\-k\fP -+.TP -+.PD -+\fB\-z\fP -+These options are used when the compiled file contains functions which -+are to be autoloaded\&. If \fB\-z\fP is given, the -+function will be autoloaded as if the \fBKSH_AUTOLOAD\fP option is -+\fInot\fP set, even if it is set at the time the compiled file is -+read, while if the \fB\-k\fP is given, the function will be loaded as if -+\fBKSH_AUTOLOAD\fP \fIis\fP set\&. These options also take precedence over -+any \fB\-k\fP or \fB\-z\fP options specified to the \fBautoload\fP builtin\&. If -+neither of these options is given, the function will be loaded as -+determined by the setting of the \fBKSH_AUTOLOAD\fP option at the time -+the compiled file is read\&. -+ -+These options may also appear as many times as necessary between the listed -+\fIname\fPs to specify the loading style of all following functions, up to -+the next \fB\-k\fP or \fB\-z\fP\&. -+ -+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)\&. -+.RE -+.TP -+\fBzformat\fP -+See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzftp\fP -+See the section `The zsh/zftp Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzle\fP -+See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. -+.TP -+.PD 0 -+\fBzmodload\fP [ \fB\-dL\fP ] [ \&.\&.\&. ] -+.TP -+.PD 0 -+\fBzmodload \-F\fP [ \fB\-lLme\fP \fB\-P\fP \fBparam\fP ] \fImodule\fP [\fB+\-\fP]\fIfeature\&.\&.\&.\fP -+.TP -+.PD 0 -+\fBzmodload \-e\fP [ \fB\-A\fP ] [ \&.\&.\&. ] -+.TP -+.PD 0 -+\fBzmodload\fP [ \fB\-a\fP [ \fB\-bcpf\fP [ \fB\-I\fP ] ] ] [ \fB\-iL\fP ] \&.\&.\&. -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-u\fP [ \fB\-abcdpf\fP [ \fB\-I\fP ] ] [ \fB\-iL\fP ] \&.\&.\&. -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-A\fP [ \fB\-L\fP ] [ \fImodalias\fP[\fB=\fP\fImodule\fP] \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-R\fP \fImodalias\fP \&.\&.\&. -+Performs operations relating to zsh\&'s loadable modules\&. -+Loading of modules while the shell is running (`dynamical loading\&') is not -+available on all operating systems, or on all installations on a particular -+operating system, although the \fBzmodload\fP command itself is always -+available and can be used to manipulate modules built into versions of the -+shell executable without dynamical loading\&. -+.RS -+.PP -+Without arguments the names of all currently loaded binary modules are -+printed\&. The \fB\-L\fP option causes this list to be in the form of a -+series of \fBzmodload\fP commands\&. Forms with arguments are: -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBzmodload\fP [ \fB\-i\fP ] \fIname\fP \&.\&.\&. -+.TP -+.PD -+\fBzmodload\fP \fB\-u\fP [ \fB\-i\fP ] \fIname\fP \&.\&.\&. -+In the simplest case, \fBzmodload\fP loads a binary module\&. The module must -+be in a file with a name consisting of the specified \fIname\fP followed by -+a standard suffix, usually `\fB\&.so\fP\&' (`\fB\&.sl\fP' on HPUX)\&. -+If the module to be loaded is already loaded the duplicate module is -+ignored\&. If \fBzmodload\fP detects an inconsistency, such as an -+invalid module name or circular dependency list, the current code block is -+aborted\&. Hence `\fBzmodload\fP \fImodule\fP \fB2>/dev/null\fP\&' is sufficient -+to test whether a module is available\&. -+If it is available, the module is loaded if necessary, while if it -+is not available, non\-zero status is silently returned\&. The option -+\fB\-i\fP is accepted for compatibility but has no effect\&. -+.RS -+.PP -+The \fIname\fPd module is searched for in the same way a command is, using -+\fB$module_path\fP instead of \fB$path\fP\&. However, the path search is -+performed even when the module name contains a `\fB/\fP\&', which it usually does\&. -+There is no way to prevent the path search\&. -+.PP -+If the module supports features (see below), \fBzmodload\fP tries to -+enable all features when loading a module\&. If the module was successfully -+loaded but not all features could be enabled, \fBzmodload\fP returns status 2\&. -+.PP -+With \fB\-u\fP, \fBzmodload\fP unloads modules\&. The same \fIname\fP -+must be given that was given when the module was loaded, but it is not -+necessary for the module to exist in the file system\&. -+The \fB\-i\fP option suppresses the error if the module is already -+unloaded (or was never loaded)\&. -+.PP -+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\&. -+.RE -+.TP -+\fBzmodload \-F\fP [ \fB\-almLe\fP \fB\-P\fP \fBparam\fP ] \fImodule\fP [\fB+\-\fP]\fIfeature\&.\&.\&.\fP -+\fBzmodload \-F\fP allows more selective control over the features provided -+by modules\&. With no options apart from \fB\-F\fP, the module named -+\fImodule\fP is loaded, if it was not already loaded, and the list of -+\fIfeature\fPs is set to the required state\&. If no -+\fIfeature\fPs are specified, the module is loaded, if it was not already -+loaded, but the state of features is unchanged\&. Each feature -+may be preceded by a \fB+\fP to turn the feature on, or \fB\-\fP to turn it -+off; the \fB+\fP is assumed if neither character is present\&. -+Any feature not explicitly mentioned is left in its current state; -+if the module was not previously loaded this means any such features will -+remain disabled\&. The return status is zero if all features were -+set, 1 if the module failed to load, and 2 if some features could -+not be set (for example, a parameter couldn\&'t be added because there -+was a different parameter of the same name) but the module was loaded\&. -+.RS -+.PP -+The standard features are builtins, conditions, parameters and math -+functions; these are indicated by the prefix `\fBb:\fP\&', `\fBc:\fP' -+(`\fBC:\fP\&' for an infix condition), `\fBp:\fP' and `\fBf:\fP', respectively, -+followed by the name that the corresponding feature would have in the -+shell\&. For example, `\fBb:strftime\fP\&' indicates a builtin named -+\fBstrftime\fP and \fBp:EPOCHSECONDS\fP indicates a parameter named -+\fBEPOCHSECONDS\fP\&. The module may provide other (`abstract\&') features of -+its own as indicated by its documentation; these have no prefix\&. -+.PP -+With \fB\-l\fP or \fB\-L\fP, features provided by the module are listed\&. With -+\fB\-l\fP alone, a list of features together with their states is shown, one -+feature per line\&. With \fB\-L\fP alone, a \fBzmodload \-F\fP command that would -+cause enabled features of the module to be turned on is shown\&. With -+\fB\-lL\fP, a \fBzmodload \-F\fP command that would cause all the features to be -+set to their current state is shown\&. If one of these combinations is given -+the option \fB\-P\fP \fIparam\fP then the parameter \fBparam\fP is set to an -+array of features, either features together with their state or (if -+\fB\-L\fP alone is given) enabled features\&. -+.PP -+With the option \fB\-L\fP the module name may be omitted; then a list -+of all enabled features for all modules providing features is printed -+in the form of \fBzmodload \-F\fP commands\&. If \fB\-l\fP is also given, -+the state of both enabled and disabled features is output in that form\&. -+.PP -+A set of features may be provided together with \fB\-l\fP or \fB\-L\fP and a -+module name; in that case only the state of those features is -+considered\&. Each feature may be preceded by \fB+\fP or \fB\-\fP but the -+character has no effect\&. If no set of features is provided, all -+features are considered\&. -+.PP -+With \fB\-e\fP, the command first tests that the module is loaded; -+if it is not, status 1 is returned\&. If the module is loaded, -+the list of features given as an argument is examined\&. Any feature -+given with no prefix is simply tested to see if the module provides it; -+any feature given with a prefix \fB+\fP or \fB\-\fP is tested to -+see if is provided and in the given state\&. If the tests on all features -+in the list succeed, status 0 is returned, else status 1\&. -+.PP -+With \fB\-m\fP, each entry in the given list of features is taken -+as a pattern to be matched against the list of features provided -+by the module\&. An initial \fB+\fP or \fB\-\fP must be given explicitly\&. -+This may not be combined with the \fB\-a\fP option as autoloads must -+be specified explicitly\&. -+.PP -+With \fB\-a\fP, the given list of features is marked for autoload from -+the specified module, which may not yet be loaded\&. An optional \fB+\fP -+may appear before the feature name\&. If the feature is prefixed with -+\fB\-\fP, any existing autoload is removed\&. The options \fB\-l\fP and \fB\-L\fP -+may be used to list autoloads\&. Autoloading is specific to individual -+features; when the module is loaded only the requested feature is -+enabled\&. Autoload requests are preserved if the module is -+subsequently unloaded until an explicit `\fBzmodload \-Fa\fP \fImodule\fP -+\fB\-\fP\fIfeature\fP\&' is issued\&. It is not an error to request an autoload -+for a feature of a module that is already loaded\&. -+.PP -+When the module is loaded each autoload is checked against the features -+actually provided by the module; if the feature is not provided the -+autoload request is deleted\&. A warning message is output; if the -+module is being loaded to provide a different feature, and that autoload -+is successful, there is no effect on the status of the current command\&. -+If the module is already loaded at the time when \fBzmodload \-Fa\fP is -+run, an error message is printed and status 1 returned\&. -+.PP -+\fBzmodload \-Fa\fP can be used with the \fB\-l\fP, \fB\-L\fP, \fB\-e\fP and -+\fB\-P\fP options for listing and testing the existence of autoloadable -+features\&. In this case \fB\-l\fP is ignored if \fB\-L\fP is specified\&. -+\fBzmodload \-FaL\fP with no module name lists autoloads for all modules\&. -+.PP -+Note that only standard features as described above can be autoloaded; -+other features require the module to be loaded before enabling\&. -+.RE -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-d\fP [ \fB\-L\fP ] [ \fIname\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-d\fP \fIname\fP \fIdep\fP \&.\&.\&. -+.TP -+.PD -+\fBzmodload\fP \fB\-ud\fP \fIname\fP [ \fIdep\fP \&.\&.\&. ] -+The \fB\-d\fP 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\&. -+.RS -+.PP -+With \fB\-d\fP and one argument, all dependencies for that module are listed\&. -+With \fB\-d\fP and no arguments, all module dependencies are listed\&. This -+listing is by default in a Makefile\-like format\&. The \fB\-L\fP option -+changes this format to a list of \fBzmodload \-d\fP commands\&. -+.PP -+If \fB\-d\fP and \fB\-u\fP are both used, dependencies are removed\&. If only one -+argument is given, all dependencies for that module are removed\&. -+.RE -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ab\fP [ \fB\-L\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ab\fP [ \fB\-i\fP ] \fIname\fP [ \fIbuiltin\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-ub\fP [ \fB\-i\fP ] \fIbuiltin\fP \&.\&.\&. -+The \fB\-ab\fP option defines autoloaded builtins\&. It defines the specified -+\fIbuiltin\fPs\&. When any of those builtins is called, the module specified -+in the first argument is loaded and all its features are enabled (for -+selective control of features use `\fBzmodload \-F \-a\fP\&' as described -+above)\&. If only the \fIname\fP is given, one builtin is defined, with -+the same name as the module\&. \fB\-i\fP suppresses the error if the builtin -+is already defined or autoloaded, but not if another builtin of the -+same name is already defined\&. -+.RS -+.PP -+With \fB\-ab\fP and no arguments, all autoloaded builtins are listed, with the -+module name (if different) shown in parentheses after the builtin name\&. -+The \fB\-L\fP option changes this format to a list of \fBzmodload \-a\fP -+commands\&. -+.PP -+If \fB\-b\fP is used together with the \fB\-u\fP option, it removes builtins -+previously defined with \fB\-ab\fP\&. This is only possible if the builtin is -+not yet loaded\&. \fB\-i\fP suppresses the error if the builtin is already -+removed (or never existed)\&. -+.PP -+Autoload requests are retained if the module is subsequently unloaded -+until an explicit `\fBzmodload \-ub\fP \fIbuiltin\fP\&' is issued\&. -+.RE -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ac\fP [ \fB\-IL\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ac\fP [ \fB\-iI\fP ] \fIname\fP [ \fIcond\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-uc\fP [ \fB\-iI\fP ] \fIcond\fP \&.\&.\&. -+The \fB\-ac\fP option is used to define autoloaded condition codes\&. The -+\fIcond\fP strings give the names of the conditions defined by the -+module\&. The optional \fB\-I\fP option is used to define infix condition -+names\&. Without this option prefix condition names are defined\&. -+.RS -+.PP -+If given no condition names, all defined names are listed (as a series of -+\fBzmodload\fP commands if the \fB\-L\fP option is given)\&. -+.PP -+The \fB\-uc\fP option removes definitions for autoloaded conditions\&. -+.RE -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ap\fP [ \fB\-L\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-ap\fP [ \fB\-i\fP ] \fIname\fP [ \fIparameter\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-up\fP [ \fB\-i\fP ] \fIparameter\fP \&.\&.\&. -+The \fB\-p\fP option is like the \fB\-b\fP and \fB\-c\fP options, but makes -+\fBzmodload\fP work on autoloaded parameters instead\&. -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-af\fP [ \fB\-L\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-af\fP [ \fB\-i\fP ] \fIname\fP [ \fIfunction\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-uf\fP [ \fB\-i\fP ] \fIfunction\fP \&.\&.\&. -+The \fB\-f\fP option is like the \fB\-b\fP, \fB\-p\fP, and \fB\-c\fP options, but -+makes \fBzmodload\fP work on autoloaded math functions instead\&. -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-a\fP [ \fB\-L\fP ] -+.TP -+.PD 0 -+\fBzmodload\fP \fB\-a\fP [ \fB\-i\fP ] \fIname\fP [ \fIbuiltin\fP \&.\&.\&. ] -+.TP -+.PD -+\fBzmodload\fP \fB\-ua\fP [ \fB\-i\fP ] \fIbuiltin\fP \&.\&.\&. -+Equivalent to \fB\-ab\fP and \fB\-ub\fP\&. -+.TP -+\fBzmodload \-e\fP [ \fB\-A\fP ] [ \fIstring\fP \&.\&.\&. ] -+The \fB\-e\fP option without arguments lists all loaded modules; if the \fB\-A\fP -+option is also given, module aliases corresponding to loaded modules are -+also shown\&. If arguments are provided, nothing is printed; -+the return status is set to zero if all \fIstring\fPs given as arguments -+are names of loaded modules and to one if at least on \fIstring\fP is not -+the name of a loaded module\&. This can be used to test for the -+availability of things implemented by modules\&. In this case, any -+aliases are automatically resolved and the \fB\-A\fP flag is not used\&. -+.TP -+\fBzmodload\fP \fB\-A\fP [ \fB\-L\fP ] [ \fImodalias\fP[\fB=\fP\fImodule\fP] \&.\&.\&. ] -+For each argument, if both \fImodalias\fP and \fImodule\fP are given, -+define \fImodalias\fP to be an alias for the module \fImodule\fP\&. -+If the module \fImodalias\fP is ever subsequently requested, either via a -+call to \fBzmodload\fP or implicitly, the shell will attempt to load -+\fImodule\fP instead\&. If \fImodule\fP is not given, show the definition of -+\fImodalias\fP\&. If no arguments are given, list all defined module aliases\&. -+When listing, if the \fB\-L\fP flag was also given, list the definition as a -+\fBzmodload\fP command to recreate the alias\&. -+.RS -+.PP -+The existence of aliases for modules is completely independent of whether -+the name resolved is actually loaded as a module: while the alias exists, -+loading and unloading the module under any alias has exactly the same -+effect as using the resolved name, and does not affect the connection -+between the alias and the resolved name which can be removed either by -+\fBzmodload \-R\fP or by redefining the alias\&. Chains of aliases (i\&.e\&. where -+the first resolved name is itself an alias) are valid so long as these are -+not circular\&. As the aliases take the same format as module names, they -+may include path separators: in this case, there is no requirement for any -+part of the path named to exist as the alias will be resolved first\&. For -+example, `\fBany/old/alias\fP\&' is always a valid alias\&. -+.PP -+Dependencies added to aliased modules are actually added to the resolved -+module; these remain if the alias is removed\&. It is valid to create an -+alias whose name is one of the standard shell modules and which resolves to -+a different module\&. However, if a module has dependencies, it -+will not be possible to use the module name as an alias as the module will -+already be marked as a loadable module in its own right\&. -+.PP -+Apart from the above, aliases can be used in the \fBzmodload\fP command -+anywhere module names are required\&. However, aliases will not be -+shown in lists of loaded modules with a bare `\fBzmodload\fP\&'\&. -+.RE -+.TP -+\fBzmodload\fP \fB\-R\fP \fImodalias\fP \&.\&.\&. -+For each \fImodalias\fP argument that was previously defined as a module -+alias via \fBzmodload \-A\fP, delete the alias\&. If any was not defined, an -+error is caused and the remainder of the line is ignored\&. -+.PP -+Note that \fBzsh\fP 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\&. -+.RE -+.TP -+\fBzparseopts\fP -+See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzprof\fP -+See the section `The zsh/zprof Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzpty\fP -+See the section `The zsh/zpty Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzregexparse\fP -+See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzsocket\fP -+See the section `The zsh/net/socket Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBzstyle\fP -+See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. -+.TP -+\fBztcp\fP -+See the section `The zsh/net/tcp Module\&' in \fIzshmodules\fP(1)\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshexpn.1 -@@ -0,0 +1,2662 @@ -+.TH "ZSHEXPN" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshexpn \- zsh expansion and substitution -+.\" Yodl file: Zsh/expn.yo -+.SH "DESCRIPTION" -+The following types of expansions are performed in the indicated order in -+five steps: -+.PP -+.PD 0 -+.TP -+.PD -+\fIHistory Expansion\fP -+This is performed only in interactive shells\&. -+.TP -+\fIAlias Expansion\fP -+Aliases are expanded immediately before the command line is parsed as -+explained -+under Aliasing in \fIzshmisc\fP(1)\&. -+.TP -+.PD 0 -+\fIProcess Substitution\fP -+.TP -+.PD 0 -+\fIParameter Expansion\fP -+.TP -+.PD 0 -+\fICommand Substitution\fP -+.TP -+.PD 0 -+\fIArithmetic Expansion\fP -+.TP -+.PD -+\fIBrace Expansion\fP -+These five are performed in one step in left\-to\-right fashion\&. After -+these expansions, all unquoted occurrences of the characters `\fB\e\fP\&', -+`\fB\&'\fP' and `\fB"\fP' are removed\&. -+.TP -+\fIFilename Expansion\fP -+If the \fBSH_FILE_EXPANSION\fP option is set, the order of expansion is -+modified for compatibility with \fBsh\fP and \fBksh\fP\&. In that case -+\fIfilename expansion\fP is performed immediately after \fIalias expansion\fP, -+preceding the set of five expansions mentioned above\&. -+.TP -+\fIFilename Generation\fP -+This expansion, commonly referred to as \fBglobbing\fP, is always done last\&. -+.PP -+The following sections explain the types of expansion in detail\&. -+.PP -+.SH "HISTORY EXPANSION" -+History expansion allows you to use words from previous command -+lines in the command line you are typing\&. This simplifies spelling -+corrections and the repetition of complicated commands or arguments\&. -+Immediately before execution, each command is saved in the history list, -+the size of which is controlled by the \fBHISTSIZE\fP parameter\&. The one -+most recent command is always retained in any case\&. Each saved command in -+the history list is called a history \fIevent\fP and is assigned a number, -+beginning with 1 (one) when the shell starts up\&. The history number that -+you may see in your prompt (see -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)) is the number that is to be assigned to the \fInext\fP command\&. -+.PP -+.SS "Overview" -+A history expansion begins with the first character of the \fBhistchars\fP -+parameter, which is `\fB!\fP\&' by default, and may occur anywhere on the -+command line; history expansions do not nest\&. The `\fB!\fP\&' can be escaped -+with `\fB\e\fP\&' or can be enclosed between a pair of single quotes (\fB''\fP) -+to suppress its special meaning\&. Double quotes will \fInot\fP work for -+this\&. Following this history character is an optional event designator -+(see the section `Event Designators\&') and then an optional word -+designator (the section `Word Designators\&'); if neither of these designators is -+present, no history expansion occurs\&. -+.PP -+Input lines containing history expansions are echoed after being expanded, -+but before any other expansions take place and before the command is -+executed\&. It is this expanded form that is recorded as the history event -+for later references\&. -+.PP -+By default, a history reference with no event designator refers to the -+same event as any preceding history reference on that command line; if it -+is the only history reference in a command, it refers to the previous -+command\&. -+However, if the option \fBCSH_JUNKIE_HISTORY\fP is set, then every history -+reference with no event specification \fIalways\fP refers to the previous -+command\&. -+.PP -+For example, `\fB!\fP\&' is the event designator for the previous command, so -+`\fB!!:1\fP\&' always refers to the first word of the previous command, and -+`\fB!!$\fP\&' always refers to the last word of the previous command\&. With -+\fBCSH_JUNKIE_HISTORY\fP set, then `\fB!:1\fP\&' and `\fB!$\fP' function in the -+same manner as `\fB!!:1\fP\&' and `\fB!!$\fP', respectively\&. Conversely, if -+\fBCSH_JUNKIE_HISTORY\fP is unset, then `\fB!:1\fP\&' and `\fB!$\fP' refer to the -+first and last words, respectively, of the same event referenced by the -+nearest other history reference preceding them on the current command -+line, or to the previous command if there is no preceding reference\&. -+.PP -+The character sequence `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\&' (where `\fB^\fP' is -+actually the second character of the \fBhistchars\fP parameter) -+repeats the last command, replacing the string \fIfoo\fP with \fIbar\fP\&. -+More precisely, the sequence `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^\fP\&' is -+synonymous with `\fB!!:s\fP\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^\fP\&', hence other -+modifiers (see the section `Modifiers\&') may follow the final `\fB^\fP'\&. -+In particular, `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^:G\fP\&' performs a global -+substitution\&. -+.PP -+If the shell encounters the character sequence `\fB!"\fP\&' -+in the input, the history mechanism is temporarily disabled until -+the current list (see -+\fIzshmisc\fP(1)) is fully parsed\&. The `\fB!"\fP\&' is removed from the input, and any -+subsequent `\fB!\fP\&' characters have no special significance\&. -+.PP -+A less convenient but more comprehensible form of command history support -+is provided by the \fBfc\fP builtin\&. -+.SS "Event Designators" -+An event designator is a reference to a command\-line entry in the history -+list\&. In the list below, remember that the initial \fB`!\&'\fP in each item -+may be changed to another character by setting the \fBhistchars\fP -+parameter\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB!\fP -+Start a history expansion, except when followed by a blank, newline, -+`\fB=\fP\&' or `\fB(\fP'\&. If followed immediately by a word designator -+(see the section `Word Designators\&'), this forms a history reference -+with no event designator (see the section `Overview\&')\&. -+.TP -+\fB!!\fP -+Refer to the previous command\&. -+By itself, this expansion -+repeats the previous command\&. -+.TP -+\fB!\fP\fIn\fP -+Refer to command\-line \fIn\fP\&. -+.TP -+\fB!\-\fP\fIn\fP -+Refer to the current command\-line minus \fIn\fP\&. -+.TP -+\fB!\fP\fIstr\fP -+Refer to the most recent command starting with \fIstr\fP\&. -+.TP -+\fB!?\fP\fIstr\fP[\fB?\fP] -+Refer to the most recent command containing \fIstr\fP\&. The trailing -+`\fB?\fP\&' is necessary if this reference is to be followed by a modifier or -+followed by any text that is not to be considered part of \fIstr\fP\&. -+.TP -+\fB!#\fP -+Refer to the current command line typed in so far\&. The line is -+treated as if it were complete up to and including the word before the -+one with the `\fB!#\fP\&' reference\&. -+.TP -+\fB!{\fP\&.\&.\&.\fB}\fP -+Insulate a history reference from adjacent characters (if necessary)\&. -+.SS "Word Designators" -+A word designator indicates which word or words of a given command line are -+to be included in a history reference\&. A `\fB:\fP\&' usually -+separates the event specification from the word designator\&. -+It may be omitted only if the word designator begins with a -+`\fB^\fP\&', `\fB$\fP', `\fB*\fP', `\fB\-\fP' or `\fB%\fP'\&. -+Word designators include: -+.PP -+.PD 0 -+.TP -+\fB0\fP -+The first input word (command)\&. -+.TP -+\fIn\fP -+The \fIn\fPth argument\&. -+.TP -+\fB^\fP -+The first argument\&. That is, \fB1\fP\&. -+.TP -+\fB$\fP -+The last argument\&. -+.TP -+\fB%\fP -+The word matched by (the most recent) \fB?\fP\fIstr\fP search\&. -+.TP -+\fIx\fP\fB\-\fP\fIy\fP -+A range of words; \fIx\fP defaults to \fB0\fP\&. -+.TP -+\fB*\fP -+All the arguments, or a null value if there are none\&. -+.TP -+\fIx\fP\fB*\fP -+Abbreviates `\fIx\fP\fB\-$\fP\&'\&. -+.TP -+\fIx\fP\fB\-\fP -+Like `\fIx\fP\fB*\fP\&' but omitting word \fB$\fP\&. -+.PD -+.PP -+Note that a `\fB%\fP\&' word designator works only when used in one of -+`\fB!%\fP\&', `\fB!:%\fP' or `\fB!?\fP\fIstr\fP\fB?:%\fP', and only when used after a -+\fB!?\fP expansion (possibly in an earlier command)\&. Anything else results -+in an error, although the error may not be the most obvious one\&. -+.SS "Modifiers" -+After the optional word designator, you can add -+a sequence of one or more of the following modifiers, -+each preceded by a `\fB:\fP\&'\&. These modifiers also work on the result -+of \fIfilename generation\fP and \fIparameter expansion\fP, except where -+noted\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBa\fP -+Turn a file name into an absolute path: prepends the current directory, -+if necessary, and resolves any use of `\fB\&.\&.\fP\&' and `\fB\&.\fP' in the path\&. -+Note that the transformation takes place even if the file or any -+intervening directories do not exist\&. -+.TP -+\fBA\fP -+As `\fBa\fP\&', but also resolve use of symbolic links where possible\&. -+Note that resolution of `\fB\&.\&.\fP\&' occurs \fIbefore\fP resolution of symbolic -+links\&. This call is equivalent to \fBa\fP unless your system has the -+\fBrealpath\fP system call (modern systems do)\&. -+.TP -+\fBc\fP -+Resolve a command name into an absolute path by searching the command -+path given by the \fBPATH\fP variable\&. This does not work for commands -+containing directory parts\&. Note also that this does not usually work as -+a glob qualifier unless a file of the same name is found in the -+current directory\&. -+.TP -+\fBe\fP -+Remove all but the extension\&. -+.TP -+\fBh\fP -+Remove a trailing pathname component, leaving the head\&. This works -+like `\fBdirname\fP\&'\&. -+.TP -+\fBl\fP -+Convert the words to all lowercase\&. -+.TP -+\fBp\fP -+Print the new command but do not execute it\&. Only works with history -+expansion\&. -+.TP -+\fBq\fP -+Quote the substituted words, escaping further substitutions\&. Works -+with history expansion and parameter expansion, though for parameters -+it is only useful if the resulting text is to be re\-evaluated such as -+by \fBeval\fP\&. -+.TP -+\fBQ\fP -+Remove one level of quotes from the substituted words\&. -+.TP -+\fBr\fP -+Remove a filename extension of the form `\fB\&.\fP\fIxxx\fP\&', leaving -+the root name\&. -+.TP -+\fBs/\fP\fIl\fP\fB/\fP\fIr\fP[\fB/\fP] -+Substitute \fIr\fP for \fIl\fP as described below\&. -+The substitution is done only for the -+first string that matches \fIl\fP\&. For arrays and for filename -+generation, this applies to each word of the expanded text\&. See -+below for further notes on substitutions\&. -+.RS -+.PP -+The forms `\fBgs/\fP\fIl\fP\fB/\fP\fIr\fP\&' and `\fBs/\fP\fIl\fP\fB/\fP\fIr\fP\fB/:G\fP' -+perform global substitution, i\&.e\&. substitute every occurrence of \fIr\fP -+for \fIl\fP\&. Note that the \fBg\fP or \fB:G\fP must appear in exactly the -+position shown\&. -+.PP -+See further notes on this form of substitution below\&. -+.RE -+.TP -+\fB&\fP -+Repeat the previous \fBs\fP substitution\&. Like \fBs\fP, may be preceded -+immediately by a \fBg\fP\&. In parameter expansion the \fB&\fP must appear -+inside braces, and in filename generation it must be quoted with a -+backslash\&. -+.TP -+\fBt\fP -+Remove all leading pathname components, leaving the tail\&. This works -+like `\fBbasename\fP\&'\&. -+.TP -+\fBu\fP -+Convert the words to all uppercase\&. -+.TP -+\fBx\fP -+Like \fBq\fP, but break into words at whitespace\&. Does not work with -+parameter expansion\&. -+.PP -+The \fBs/\fP\fIl\fP\fB/\fP\fIr\fP\fB/\fP substitution works as follows\&. By -+default the left\-hand side of substitutions are not patterns, but -+character strings\&. Any character can be used as the delimiter in place -+of `\fB/\fP\&'\&. A backslash quotes the delimiter character\&. The character -+`\fB&\fP\&', in the right\-hand\-side \fIr\fP, is replaced by the text from the -+left\-hand\-side \fIl\fP\&. The `\fB&\fP\&' can be quoted with a backslash\&. A -+null \fIl\fP uses the previous string either from the previous \fIl\fP or -+from the contextual scan string \fIs\fP from `\fB!?\fP\fIs\fP\&'\&. You can -+omit the rightmost delimiter if a newline immediately follows \fIr\fP; -+the rightmost `\fB?\fP\&' in a context scan can similarly be omitted\&. Note -+the same record of the last \fIl\fP and \fIr\fP is maintained across all -+forms of expansion\&. -+.PP -+Note that if a `\fB&\fP\&' is used within glob qualifers an extra backslash -+is needed as a \fB&\fP is a special character in this case\&. -+.PP -+If the option \fBHIST_SUBST_PATTERN\fP is set, \fIl\fP is treated as -+a pattern of the usual form described in -+the section FILENAME GENERATION below\&. This can be used in -+all the places where modifiers are available; note, however, that -+in globbing qualifiers parameter substitution has already taken place, -+so parameters in the replacement string should be quoted to ensure -+they are replaced at the correct time\&. -+Note also that complicated patterns used in globbing qualifiers may -+need the extended glob qualifier notation -+\fB(#q:s/\fP\fI\&.\&.\&.\fP\fB/\fP\fI\&.\&.\&.\fP\fB/)\fP in order for the -+shell to recognize the expression as a glob qualifier\&. Further, -+note that bad patterns in the substitution are not subject to -+the \fBNO_BAD_PATTERN\fP option so will cause an error\&. -+.PP -+When \fBHIST_SUBST_PATTERN\fP is set, \fIl\fP may start with a \fB#\fP -+to indicate that the pattern must match at the start of the string -+to be substituted, and a \fB%\fP may appear at the start or after an \fB#\fP -+to indicate that the pattern must match at the end of the string -+to be substituted\&. The \fB%\fP or \fB#\fP may be quoted with two -+backslashes\&. -+.PP -+For example, the following piece of filename generation code -+with the \fBEXTENDED_GLOB\fP option: -+.PP -+.RS -+.nf -+\fBprint *\&.c(#q:s/#%(#b)s(*)\&.c/\&'S${match[1]}\&.C'/)\fP -+.fi -+.RE -+.PP -+takes the expansion of \fB*\&.c\fP and applies the glob qualifiers in the -+\fB(#q\fP\fI\&.\&.\&.\fP\fB)\fP expression, which consists of a substitution -+modifier anchored to the start and end of each word (\fB#%\fP)\&. This -+turns on backreferences (\fB(#b)\fP), so that the parenthesised -+subexpression is available in the replacement string as \fB${match[1]}\fP\&. -+The replacement string is quoted so that the parameter is not substituted -+before the start of filename generation\&. -+.PP -+The following \fBf\fP, \fBF\fP, \fBw\fP and \fBW\fP modifiers work only with -+parameter expansion and filename generation\&. They are listed here to -+provide a single point of reference for all modifiers\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBf\fP -+Repeats the immediately (without a colon) following modifier until the -+resulting word doesn\&'t change any more\&. -+.TP -+\fBF:\fP\fIexpr\fP\fB:\fP -+Like \fBf\fP, but repeats only \fIn\fP times if the expression -+\fIexpr\fP evaluates to \fIn\fP\&. Any character can be used instead of -+the `\fB:\fP\&'; if `\fB(\fP', `\fB[\fP', or `\fB{\fP' -+is used as the opening delimiter, -+the closing delimiter should be \&'\fB)\fP', `\fB]\fP', or `\fB}\fP', -+respectively\&. -+.TP -+\fBw\fP -+Makes the immediately following modifier work on each word in the -+string\&. -+.TP -+\fBW:\fP\fIsep\fP\fB:\fP -+Like \fBw\fP but words are considered to be the parts of the string -+that are separated by \fIsep\fP\&. Any character can be used instead of -+the `\fB:\fP\&'; opening parentheses are handled specially, see above\&. -+.SH "PROCESS SUBSTITUTION" -+Each part of a command argument that takes the form -+`\fB<(\fP\fIlist\fP\fB)\fP\&', -+`\fB>(\fP\fIlist\fP\fB)\fP\&' or -+`\fB=(\fP\fIlist\fP\fB)\fP\&' -+is subject to process substitution\&. The expression may be preceded -+or followed by other strings except that, to prevent clashes with -+commonly occurring strings and patterns, the last -+form must occur at the start of a command argument, and the forms -+are only expanded when first parsing command or assignment arguments\&. -+Process substitutions may be used following redirection operators; in this -+case, the substitution must appear with no trailing string\&. -+.PP -+In the case of the \fB<\fP or \fB>\fP forms, the shell runs the commands in -+\fIlist\fP as a subprocess of the job executing the shell command line\&. -+If the system supports the \fB/dev/fd\fP -+mechanism, the command argument is the name of the device file -+corresponding to a file descriptor; otherwise, if the system supports named -+pipes (FIFOs), the command argument will be a named pipe\&. If the form with -+\fB>\fP is selected then writing on this special file will provide input for -+\fIlist\fP\&. If \fB<\fP is used, then the file passed as an argument will -+be connected to the output of the \fIlist\fP process\&. For example, -+.PP -+.RS -+.nf -+\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB) | -+tee >(\fP\fIprocess1\fP\fB) >(\fP\fIprocess2\fP\fB) >/dev/null\fP\fP -+.fi -+.RE -+.PP -+cuts fields 1 and 3 from the files \fIfile1\fP and \fIfile2\fP respectively, -+pastes the results together, and sends it to the processes -+\fIprocess1\fP and \fIprocess2\fP\&. -+.PP -+If \fB=(\fP\fI\&.\&.\&.\fP\fB)\fP is used instead of -+\fB<(\fP\fI\&.\&.\&.\fP\fB)\fP, -+then the file passed as an argument will be the name -+of a temporary file containing the output of the \fIlist\fP -+process\&. This may be used instead of the \fB<\fP -+form for a program that expects to lseek (see \fIlseek\fP(2)) -+on the input file\&. -+.PP -+There is an optimisation for substitutions of the form -+\fB=(<<<\fP\fIarg\fP\fB)\fP, where \fIarg\fP is a single\-word argument -+to the here\-string redirection \fB<<<\fP\&. This form produces a file name -+containing the value of \fIarg\fP after any substitutions have been -+performed\&. This is handled entirely within the current shell\&. This is -+effectively the reverse of the special form \fB$(<\fP\fIarg\fP\fB)\fP -+which treats \fIarg\fP as a file name and replaces it with the file\&'s -+contents\&. -+.PP -+The \fB=\fP form is useful as both the \fB/dev/fd\fP and the named pipe -+implementation of \fB<(\fP\fI\&.\&.\&.\fP\fB)\fP have drawbacks\&. In -+the former case, some programmes may automatically close the file -+descriptor in question before examining the file on the command line, -+particularly if this is necessary for security reasons such as when the -+programme is running setuid\&. In the second case, if the -+programme does not actually open the file, the subshell attempting to read -+from or write to the pipe will (in a typical implementation, different -+operating systems may have different behaviour) block for ever and have to -+be killed explicitly\&. In both cases, the shell actually supplies the -+information using a pipe, so that programmes that expect to lseek -+(see \fIlseek\fP(2)) on the file will not work\&. -+.PP -+Also note that the previous example can be more compactly and -+efficiently written (provided the \fBMULTIOS\fP option is set) as: -+.PP -+.RS -+.nf -+\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB)\fP \e -+\fB> >(\fP\fIprocess1\fP\fB) > >(\fP\fIprocess2\fP\fB)\fP\fP -+.fi -+.RE -+.PP -+The shell uses pipes instead of FIFOs to implement the latter -+two process substitutions in the above example\&. -+.PP -+There is an additional problem with \fB>(\fP\fIprocess\fP\fB)\fP; when -+this is attached to an external command, the parent shell does not wait -+for \fIprocess\fP to finish and hence an immediately following command -+cannot rely on the results being complete\&. The problem and solution are -+the same as described in the section \fIMULTIOS\fP in -+\fIzshmisc\fP(1)\&. Hence in a simplified -+version of the example above: -+.PP -+.RS -+.nf -+\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB)\fP \fB> >(\fP\fIprocess\fP\fB)\fP\fP -+.fi -+.RE -+.PP -+(note that no \fBMULTIOS\fP are involved), \fIprocess\fP will be run -+asynchronously as far as the parent shell is concerned\&. The workaround is: -+.PP -+.RS -+.nf -+\fB\fB{ paste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB) }\fP \fB> >(\fP\fIprocess\fP\fB)\fP\fP -+.fi -+.RE -+.PP -+The extra processes here are -+spawned from the parent shell which will wait for their completion\&. -+.PP -+.SH "PARAMETER EXPANSION" -+The character `\fB$\fP\&' is used to introduce parameter expansions\&. -+See -+\fIzshparam\fP(1) -+for a description of parameters, including arrays, associative arrays, -+and subscript notation to access individual array elements\&. -+.PP -+Note in particular the fact that words of unquoted parameters are not -+automatically split on whitespace unless the option \fBSH_WORD_SPLIT\fP is -+set; see references to this option below for more details\&. This is an -+important difference from other shells\&. -+.PP -+In the expansions discussed below that require a pattern, the form of -+the pattern is the same as that used for filename generation; -+see the section `Filename Generation\&'\&. Note that these patterns, along with -+the replacement text of any substitutions, are themselves subject to -+parameter expansion, command substitution, and arithmetic expansion\&. -+In addition to the following operations, the colon modifiers described in -+the section `Modifiers\&' in the section `History Expansion' can be -+applied: for example, \fB${i:s/foo/bar/}\fP performs string -+substitution on the expansion of parameter \fB$i\fP\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB${\fP\fIname\fP\fB}\fP -+The value, if any, of the parameter \fIname\fP is substituted\&. -+The braces are required if the expansion is to be followed by -+a letter, digit, or underscore that is not to be interpreted -+as part of \fIname\fP\&. In addition, more complicated forms of substitution -+usually require the braces to be present; exceptions, which only apply if -+the option \fBKSH_ARRAYS\fP is not set, are a single subscript or any colon -+modifiers appearing after the name, or any of the characters `\fB^\fP\&', -+`\fB=\fP\&', `\fB~\fP', `\fB#\fP' or `\fB+\fP' appearing before the name, all of -+which work with or without braces\&. -+.RS -+.PP -+If \fIname\fP is an array parameter, and the \fBKSH_ARRAYS\fP option is not -+set, then the value of each -+element of \fIname\fP is substituted, one element per word\&. Otherwise, the -+expansion results in one word only; with \fBKSH_ARRAYS\fP, this is the first -+element of an array\&. No field splitting is done on the result unless the -+\fBSH_WORD_SPLIT\fP option is set\&. -+See also the flags \fB=\fP and \fBs:\fP\fIstring\fP\fB:\fP\&. -+.RE -+.TP -+\fB${+\fP\fIname\fP\fB}\fP -+If \fIname\fP is the name of a set parameter `\fB1\fP\&' is substituted, -+otherwise `\fB0\fP\&' is substituted\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB\-\fP\fIword\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB:\-\fP\fIword\fP\fB}\fP -+If \fIname\fP is set, or in the second form is non\-null, then substitute -+its value; otherwise substitute \fIword\fP\&. In the second form \fIname\fP -+may be omitted, in which case \fIword\fP is always substituted\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB+\fP\fIword\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB:+\fP\fIword\fP\fB}\fP -+If \fIname\fP is set, or in the second form is non\-null, then substitute -+\fIword\fP; otherwise substitute nothing\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB=\fP\fIword\fP\fB}\fP -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB:=\fP\fIword\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB::=\fP\fIword\fP\fB}\fP -+In the first form, if \fIname\fP is unset then set it to \fIword\fP; in the -+second form, if \fIname\fP is unset or null then set it to \fIword\fP; and -+in the third form, unconditionally set \fIname\fP to \fIword\fP\&. In all -+forms, the value of the parameter is then substituted\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB?\fP\fIword\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB:?\fP\fIword\fP\fB}\fP -+In the first form, if \fIname\fP is set, or in the second form if \fIname\fP -+is both set and non\-null, then substitute its value; otherwise, print -+\fIword\fP and exit from the shell\&. Interactive shells instead return to -+the prompt\&. If \fIword\fP is omitted, then a standard message is printed\&. -+.PP -+In any of the above expressions that test a variable and substitute an -+alternate \fIword\fP, note that you can use standard shell quoting in the -+\fIword\fP value to selectively override the splitting done by the -+\fBSH_WORD_SPLIT\fP option and the \fB=\fP flag, but not splitting by the -+\fBs:\fP\fIstring\fP\fB:\fP flag\&. -+.PP -+In the following expressions, when \fIname\fP is an array and -+the substitution is not quoted, or if the `\fB(@)\fP\&' flag or the -+\fIname\fP\fB[@]\fP syntax is used, matching and replacement is -+performed on each array element separately\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB##\fP\fIpattern\fP\fB}\fP -+If the \fIpattern\fP matches the beginning of the value of -+\fIname\fP, then substitute the value of \fIname\fP with -+the matched portion deleted; otherwise, just -+substitute the value of \fIname\fP\&. In the first -+form, the smallest matching pattern is preferred; -+in the second form, the largest matching pattern is -+preferred\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB%\fP\fIpattern\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB%%\fP\fIpattern\fP\fB}\fP -+If the \fIpattern\fP matches the end of the value of -+\fIname\fP, then substitute the value of \fIname\fP with -+the matched portion deleted; otherwise, just -+substitute the value of \fIname\fP\&. In the first -+form, the smallest matching pattern is preferred; -+in the second form, the largest matching pattern is -+preferred\&. -+.TP -+\fB${\fP\fIname\fP\fB:#\fP\fIpattern\fP\fB}\fP -+If the \fIpattern\fP matches the value of \fIname\fP, then substitute -+the empty string; otherwise, just substitute the value of \fIname\fP\&. -+If \fIname\fP is an array -+the matching array elements are removed (use the `\fB(M)\fP\&' flag to -+remove the non\-matched elements)\&. -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB:\fP\fIoffset\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP\fB}\fP -+This syntax gives effects similar to parameter subscripting -+in the form \fB$\fP\fIname\fP\fB{\fP\fIstart\fP\fB,\fP\fIend\fP\fB}\fP, but is -+compatible with other shells; note that both \fIoffset\fP and \fIlength\fP -+are interpreted differently from the components of a subscript\&. -+.RS -+.PP -+If \fIoffset\fP is non\-negative, then if the variable \fIname\fP is a -+scalar substitute the contents starting \fIoffset\fP characters from the -+first character of the string, and if \fIname\fP is an array substitute -+elements starting \fIoffset\fP elements from the first element\&. If -+\fIlength\fP is given, substitute that many characters or elements, -+otherwise the entire rest of the scalar or array\&. -+.PP -+A positive \fIoffset\fP is always treated as the offset of a character or -+element in \fIname\fP from the first character or element of the array -+(this is different from native zsh subscript notation)\&. Hence 0 -+refers to the first character or element regardless of the setting of -+the option \fBKSH_ARRAYS\fP\&. -+.PP -+A negative offset counts backwards from the end of the scalar or array, -+so that \-1 corresponds to the last character or element, and so on\&. -+.PP -+\fIlength\fP is always treated directly as a length and hence may not be -+negative\&. The option \fBMULTIBYTE\fP is obeyed, i\&.e\&. the offset and length -+count multibyte characters where appropriate\&. -+.PP -+\fIoffset\fP and \fIlength\fP undergo the same set of shell substitutions -+as for scalar assignment; in addition, they are then subject to arithmetic -+evaluation\&. Hence, for example -+.PP -+.RS -+.nf -+\fBprint ${foo:3} -+print ${foo: 1 + 2} -+print ${foo:$(( 1 + 2))} -+print ${foo:$(echo 1 + 2)}\fP -+.fi -+.RE -+.PP -+all have the same effect, extracting the string starting at the fourth -+character of \fB$foo\fP if the substution would otherwise return a scalar, -+or the array starting at the fourth element if \fB$foo\fP would return an -+array\&. Note that with the option \fBKSH_ARRAYS\fP \fB$foo\fP always returns -+a scalar (regardless of the use of the offset syntax) and a form -+such as \fB$foo[*]:3\fP is required to extract elements of an array named -+\fBfoo\fP\&. -+.PP -+If \fIoffset\fP is negative, the \fB\-\fP may not appear immediately -+after the \fB:\fP as this indicates the -+\fB${\fP\fIname\fP\fB:\-\fP\fIword\fP\fB}\fP form of substitution\&. Instead, a space -+may be inserted before the \fB\-\fP\&. Furthermore, neither \fIoffset\fP nor -+\fIlength\fP may begin with an alphabetic character or \fB&\fP as these are -+used to indicate history\-style modifiers\&. To substitute a value from a -+variable, the recommended approach is to proceed it with a \fB$\fP as this -+signifies the intention (parameter substitution can easily be rendered -+unreadable); however, as arithmetic substitution is performed, the -+expression \fB${var: offs}\fP does work, retrieving the offset from -+\fB$offs\fP\&. -+.PP -+For further compatibility with other shells there is a special case -+for array offset 0\&. This usually accesses to the -+first element of the array\&. However, if the substitution refers the -+positional parameter array, e\&.g\&. \fB$@\fP or \fB$*\fP, then offset 0 -+instead refers to \fB$0\fP, offset 1 refers to \fB$1\fP, and so on\&. In -+other words, the positional parameter array is effectively extended by -+prepending \fB$0\fP\&. Hence \fB${*:0:1}\fP substitutes \fB$0\fP and -+\fB${*:1:1}\fP substitutes \fB$1\fP\&. -+.RE -+.TP -+.PD 0 -+\fB${\fP\fIname\fP\fB/\fP\fIpattern\fP\fB/\fP\fIrepl\fP\fB}\fP -+.TP -+.PD -+\fB${\fP\fIname\fP\fB//\fP\fIpattern\fP\fB/\fP\fIrepl\fP\fB}\fP -+Replace the longest possible match of \fIpattern\fP in the expansion of -+parameter \fIname\fP by string \fIrepl\fP\&. The first form -+replaces just the first occurrence, the second form all occurrences\&. -+Both \fIpattern\fP and \fIrepl\fP are subject to double\-quoted substitution, -+so that expressions like \fB${name/$opat/$npat}\fP will work, but note the -+usual rule that pattern characters in \fB$opat\fP are not treated specially -+unless either the option \fBGLOB_SUBST\fP is set, or \fB$opat\fP is instead -+substituted as \fB${~opat}\fP\&. -+.RS -+.PP -+The \fIpattern\fP may begin with a `\fB#\fP\&', in which case the -+\fIpattern\fP must match at the start of the string, or `\fB%\fP\&', in -+which case it must match at the end of the string, or `\fB#%\fP\&' in which -+case the \fIpattern\fP must match the entire string\&. The \fIrepl\fP may -+be an empty string, in which case the final `\fB/\fP\&' may also be omitted\&. -+To quote the final `\fB/\fP\&' in other cases it should be preceded by a -+single backslash; this is not necessary if the -+`\fB/\fP\&' occurs inside a substituted parameter\&. Note also that the `\fB#\fP', -+`\fB%\fP\&' and `\fB#%\fP are not active if they occur inside a substituted -+parameter, even at the start\&. -+.PP -+The first `\fB/\fP\&' may be preceded by a `\fB:\fP', in which case the match -+will only succeed if it matches the entire word\&. Note also the -+effect of the \fBI\fP and \fBS\fP parameter expansion flags below; however, -+the flags \fBM\fP, \fBR\fP, \fBB\fP, \fBE\fP and \fBN\fP are not useful\&. -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBfoo="twinkle twinkle little star" sub="t*e" rep="spy" -+print ${foo//${~sub}/$rep} -+print ${(S)foo//${~sub}/$rep}\fP -+.fi -+.RE -+.PP -+Here, the `\fB~\fP\&' ensures that the text of \fB$sub\fP is treated as a -+pattern rather than a plain string\&. In the first case, the longest -+match for \fBt*e\fP is substituted and the result is `\fBspy star\fP\&', -+while in the second case, the shortest matches are taken and the -+result is `\fBspy spy lispy star\fP\&'\&. -+.RE -+.TP -+\fB${#\fP\fIspec\fP\fB}\fP -+If \fIspec\fP is one of the above substitutions, substitute -+the length in characters of the result instead of -+the result itself\&. If \fIspec\fP is an array expression, -+substitute the number of elements of the result\&. -+Note that `\fB^\fP\&', `\fB=\fP', and `\fB~\fP', below, must appear -+to the left of `\fB#\fP\&' when these forms are combined\&. -+.TP -+\fB${^\fP\fIspec\fP\fB}\fP -+Turn on the \fBRC_EXPAND_PARAM\fP option for the -+evaluation of \fIspec\fP; if the `\fB^\fP\&' is doubled, turn it off\&. -+When this option is set, array expansions of the form -+\fIfoo\fP\fB${\fP\fIxx\fP\fB}\fP\fIbar\fP, -+where the parameter \fIxx\fP -+is set to \fB(\fP\fIa b c\fP\fB)\fP, are substituted with -+`\fIfooabar foobbar foocbar\fP\&' instead of the default -+`\fIfooa b cbar\fP\&'\&. Note that an empty array will therefore cause -+all arguments to be removed\&. -+.RS -+.PP -+Internally, each such expansion is converted into the -+equivalent list for brace expansion\&. E\&.g\&., \fB${^var}\fP becomes -+\fB{$var[1],$var[2],\fP\&.\&.\&.\fB}\fP, and is processed as described in -+the section `Brace Expansion\&' below\&. -+If word splitting is also in effect the -+\fB$var[\fP\fIN\fP\fB]\fP may themselves be split into different list -+elements\&. -+.RE -+.TP -+\fB${=\fP\fIspec\fP\fB}\fP -+Perform word splitting using the rules for \fBSH_WORD_SPLIT\fP during the -+evaluation of \fIspec\fP, but regardless of whether the parameter appears in -+double quotes; if the `\fB=\fP\&' is doubled, turn it off\&. -+This forces parameter expansions to be split into -+separate words before substitution, using \fBIFS\fP as a delimiter\&. -+This is done by default in most other shells\&. -+.RS -+.PP -+Note that splitting is applied to \fIword\fP in the assignment forms -+of \fIspec\fP \fIbefore\fP the assignment to \fIname\fP is performed\&. -+This affects the result of array assignments with the \fBA\fP flag\&. -+.RE -+.TP -+\fB${~\fP\fIspec\fP\fB}\fP -+Turn on the \fBGLOB_SUBST\fP option for the evaluation of -+\fIspec\fP; if the `\fB~\fP\&' is doubled, turn it off\&. When this option is -+set, the string resulting from the expansion will be interpreted as a -+pattern anywhere that is possible, such as in filename expansion and -+filename generation and pattern\-matching contexts like the right -+hand side of the `\fB=\fP\&' and `\fB!=\fP' operators in conditions\&. -+.RS -+.PP -+In nested substitutions, note that the effect of the \fB~\fP applies to the -+result of the current level of substitution\&. A surrounding pattern -+operation on the result may cancel it\&. Hence, for example, if the -+parameter \fBfoo\fP is set to \fB*\fP, \fB${~foo//\e*/*\&.c}\fP is substituted by -+the pattern \fB*\&.c\fP, which may be expanded by filename generation, but -+\fB${${~foo}//\e*/*\&.c}\fP substitutes to the string \fB*\&.c\fP, which will not -+be further expanded\&. -+.RE -+.RE -+.PP -+If a \fB${\fP\&.\&.\&.\fB}\fP type parameter expression or a -+\fB$(\fP\&.\&.\&.\fB)\fP type command substitution is used in place of -+\fIname\fP above, it is expanded first and the result is used as if -+it were the value of \fIname\fP\&. Thus it is -+possible to perform nested operations: \fB${${foo#head}%tail}\fP -+substitutes the value of \fB$foo\fP with both `\fBhead\fP\&' and `\fBtail\fP' -+deleted\&. The form with \fB$(\fP\&.\&.\&.\fB)\fP is often useful in -+combination with the flags described next; see the examples below\&. -+Each \fIname\fP or nested \fB${\fP\&.\&.\&.\fB}\fP in a parameter expansion may -+also be followed by a subscript expression as described in -+\fIArray Parameters\fP in \fIzshparam\fP(1)\&. -+.PP -+Note that double quotes may appear around nested expressions, in which -+case only the part inside is treated as quoted; for example, -+\fB${(f)"$(foo)"}\fP quotes the result of \fB$(foo)\fP, but the flag `\fB(f)\fP\&' -+(see below) is applied using the rules for unquoted expansions\&. Note -+further that quotes are themselves nested in this context; for example, in -+\fB"${(@f)"$(foo)"}"\fP, there are two sets of quotes, one surrounding the -+whole expression, the other (redundant) surrounding the \fB$(foo)\fP as -+before\&. -+.PP -+.SS "Parameter Expansion Flags" -+If the opening brace is directly followed by an opening parenthesis, -+the string up to the matching closing parenthesis will be taken as a -+list of flags\&. In cases where repeating a flag is meaningful, the -+repetitions need not be consecutive; for example, `(\fBq%q%q\fP)\&' -+means the same thing as the more readable `(\fB%%qqq\fP)\&'\&. The -+following flags are supported: -+.PP -+.PD 0 -+.TP -+.PD -+\fB#\fP -+Evaluate the resulting words as numeric expressions and output the -+characters corresponding to the resulting integer\&. Note that this form is -+entirely distinct from use of the \fB#\fP without parentheses\&. -+.RS -+.PP -+If the \fBMULTIBYTE\fP option is set and the number is greater than 127 -+(i\&.e\&. not an ASCII character) it is treated as a Unicode character\&. -+.RE -+.TP -+\fB%\fP -+Expand all \fB%\fP escapes in the resulting words in the same way as in -+prompts (see -+EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. If this flag is given twice, -+full prompt expansion is done on the resulting words, depending on the -+setting of the \fBPROMPT_PERCENT\fP, \fBPROMPT_SUBST\fP and \fBPROMPT_BANG\fP -+options\&. -+.TP -+\fB@\fP -+In double quotes, array elements are put into separate words\&. -+E\&.g\&., `\fB"${(@)foo}"\fP\&' is equivalent to `\fB"${foo[@]}"\fP' and -+`\fB"${(@)foo[1,2]}"\fP\&' is the same as `\fB"$foo[1]" "$foo[2]"\fP'\&. -+This is distinct from \fIfield splitting\fP by the the \fBf\fP, \fBs\fP -+or \fBz\fP flags, which still applies within each array element\&. -+.TP -+\fBA\fP -+Create an array parameter with `\fB${\fP\&.\&.\&.\fB=\fP\&.\&.\&.\fB}\fP\&', -+`\fB${\fP\&.\&.\&.\fB:=\fP\&.\&.\&.\fB}\fP\&' or `\fB${\fP\&.\&.\&.\fB::=\fP\&.\&.\&.\fB}\fP'\&. -+If this flag is repeated (as in `\fBAA\fP\&'), create an associative -+array parameter\&. Assignment is made before sorting or padding\&. -+The \fIname\fP part may be a subscripted range for ordinary -+arrays; the \fIword\fP part \fImust\fP be converted to an array, for -+example by using `\fB${(AA)=\fP\fIname\fP\fB=\fP\&.\&.\&.\fB}\fP\&' to activate -+field splitting, when creating an associative array\&. -+.TP -+\fBa\fP -+Sort in array index order; when combined with `\fBO\fP\&' sort in reverse -+array index order\&. Note that `\fBa\fP\&' is therefore equivalent to the -+default but `\fBOa\fP\&' is useful for obtaining an array's elements in reverse -+order\&. -+.TP -+\fBc\fP -+With \fB${#\fP\fIname\fP\fB}\fP, count the total number of characters in an array, -+as if the elements were concatenated with spaces between them\&. -+.TP -+\fBC\fP -+Capitalize the resulting words\&. `Words\&' in this case refers to sequences -+of alphanumeric characters separated by non\-alphanumerics, \fInot\fP to words -+that result from field splitting\&. -+.TP -+\fBD\fP -+Assume the string or array elements contain directories and attempt -+to substitute the leading part of these by names\&. The remainder of -+the path (the whole of it if the leading part was not subsituted) -+is then quoted so that the whole string can be used as a shell -+argument\&. This is the reverse of `\fB~\fP\&' substitution: see -+the section FILENAME EXPANSION below\&. -+.TP -+\fBe\fP -+Perform \fIparameter expansion\fP, \fIcommand substitution\fP and -+\fIarithmetic expansion\fP on the result\&. Such expansions can be -+nested but too deep recursion may have unpredictable effects\&. -+.TP -+\fBf\fP -+Split the result of the expansion at newlines\&. This is a shorthand -+for `\fBps:\en:\fP\&'\&. -+.TP -+\fBF\fP -+Join the words of arrays together using newline as a separator\&. -+This is a shorthand for `\fBpj:\en:\fP\&'\&. -+.TP -+\fBi\fP -+Sort case\-insensitively\&. May be combined with `\fBn\fP\&' or `\fBO\fP'\&. -+.TP -+\fBk\fP -+If \fIname\fP refers to an associative array, substitute the \fIkeys\fP -+(element names) rather than the values of the elements\&. Used with -+subscripts (including ordinary arrays), force indices or keys to be -+substituted even if the subscript form refers to values\&. However, -+this flag may not be combined with subscript ranges\&. -+.TP -+\fBL\fP -+Convert all letters in the result to lower case\&. -+.TP -+\fBn\fP -+Sort decimal integers numerically; if the first differing -+characters of two test strings are not digits, sorting -+is lexical\&. Integers with more initial zeroes -+are sorted before those with fewer or none\&. Hence the array `\fBfoo1 foo02 -+foo2 foo3 foo20 foo23\fP\&' is sorted into the order shown\&. -+May be combined with `\fBi\fP\&' or `\fBO\fP'\&. -+.TP -+\fBo\fP -+Sort the resulting words in ascending order; if this appears on its -+own the sorting is lexical and case\-sensitive (unless the locale -+renders it case\-insensitive)\&. Sorting in ascending order is the -+default for other forms of sorting, so this is ignored if combined -+with `\fBa\fP\&', `\fBi\fP' or `\fBn\fP'\&. -+.TP -+\fBO\fP -+Sort the resulting words in descending order; `\fBO\fP\&' without `\fBa\fP', -+`\fBi\fP\&' or `\fBn\fP' sorts in reverse lexical order\&. May be combined -+with `\fBa\fP\&', `\fBi\fP' or `\fBn\fP' to reverse the order of sorting\&. -+.TP -+\fBP\fP -+This forces the value of the parameter \fIname\fP to be interpreted as a -+further parameter name, whose value will be used where appropriate\&. -+Note that flags set with one of the \fBtypeset\fP family of commands -+(in particular case transformations) are not applied to the value of -+\fIname\fP used in this fashion\&. -+.RS -+.PP -+If used with a nested parameter or command substitution, the result of that -+will be taken as a parameter name in the same way\&. For example, if you -+have `\fBfoo=bar\fP\&' and `\fBbar=baz\fP', the strings \fB${(P)foo}\fP, -+\fB${(P)${foo}}\fP, and \fB${(P)$(echo bar)}\fP will be expanded to `\fBbaz\fP\&'\&. -+.RE -+.TP -+\fBq\fP -+Quote characters that are special to the shell in the resulting words with -+backslashes; unprintable or invalid characters are quoted using the -+\fB$\&'\e\fP\fINNN\fP\fB'\fP form, with separate quotes for each octet\&. -+.RS -+.PP -+If this flag is given twice, the resulting words are quoted in single -+quotes and if it is given three times, the words are quoted in double -+quotes; in these forms no special handling of unprintable or invalid -+characters is attempted\&. If the flag is given four times, the words are -+quoted in single quotes preceded by a \fB$\fP\&. Note that in all three of -+these forms quoting is done unconditionally, even if this does not change -+the way the resulting string would be interpreted by the shell\&. -+.PP -+If a \fBq\-\fP is given (only a single \fBq\fP may appear), a minimal -+form of single quoting is used that only quotes the string if needed to -+protect special characters\&. Typically this form gives the most readable -+output\&. -+.RE -+.TP -+\fBQ\fP -+Remove one level of quotes from the resulting words\&. -+.TP -+\fBt\fP -+Use a string describing the type of the parameter where the value -+of the parameter would usually appear\&. This string consists of keywords -+separated by hyphens (`\fB\-\fP\&')\&. The first keyword in the string describes -+the main type, it can be one of `\fBscalar\fP\&', `\fBarray\fP', `\fBinteger\fP', -+`\fBfloat\fP\&' or `\fBassociation\fP'\&. The other keywords describe the type in -+more detail: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fBlocal\fP -+for local parameters -+.TP -+\fBleft\fP -+for left justified parameters -+.TP -+\fBright_blanks\fP -+for right justified parameters with leading blanks -+.TP -+\fBright_zeros\fP -+for right justified parameters with leading zeros -+.TP -+\fBlower\fP -+for parameters whose value is converted to all lower case when it is -+expanded -+.TP -+\fBupper\fP -+for parameters whose value is converted to all upper case when it is -+expanded -+.TP -+\fBreadonly\fP -+for readonly parameters -+.TP -+\fBtag\fP -+for tagged parameters -+.TP -+\fBexport\fP -+for exported parameters -+.TP -+\fBunique\fP -+for arrays which keep only the first occurrence of duplicated values -+.TP -+\fBhide\fP -+for parameters with the `hide\&' flag -+.TP -+\fBspecial\fP -+for special parameters defined by the shell -+.RE -+.TP -+\fBu\fP -+Expand only the first occurrence of each unique word\&. -+.TP -+\fBU\fP -+Convert all letters in the result to upper case\&. -+.TP -+\fBv\fP -+Used with \fBk\fP, substitute (as two consecutive words) both the key -+and the value of each associative array element\&. Used with subscripts, -+force values to be substituted even if the subscript form refers to -+indices or keys\&. -+.TP -+\fBV\fP -+Make any special characters in the resulting words visible\&. -+.TP -+\fBw\fP -+With \fB${#\fP\fIname\fP\fB}\fP, count words in arrays or strings; the \fBs\fP -+flag may be used to set a word delimiter\&. -+.TP -+\fBW\fP -+Similar to \fBw\fP with the difference that empty words between -+repeated delimiters are also counted\&. -+.TP -+\fBX\fP -+With this flag, parsing errors occurring with the \fBQ\fP, \fBe\fP and \fB#\fP -+flags or the pattern matching forms such as -+`\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP\&' are reported\&. Without the flag, -+errors are silently ignored\&. -+.TP -+\fBz\fP -+Split the result of the expansion into words using shell parsing to -+find the words, i\&.e\&. taking into account any quoting in the value\&. -+Comments are not treated specially but as ordinary strings, similar -+to interactive shells with the \fBINTERACTIVE_COMMENTS\fP option unset\&. -+.RS -+.PP -+Note that this is done very late, as for the `\fB(s)\fP\&' flag\&. So to -+access single words in the result, one has to use nested expansions as -+in `\fB${${(z)foo}[2]}\fP\&'\&. Likewise, to remove the quotes in the -+resulting words one would do: `\fB${(Q)${(z)foo}}\fP\&'\&. -+.RE -+.TP -+\fB0\fP -+Split the result of the expansion on null bytes\&. This is a shorthand -+for `\fBps:\e0:\fP\&'\&. -+.PP -+The following flags (except \fBp\fP) are followed by one or more arguments -+as shown\&. Any character, or the matching pairs `\fB(\fP\&.\&.\&.\fB)\fP\&', -+`\fB{\fP\&.\&.\&.\fB}\fP\&', `\fB[\fP\&.\&.\&.\fB]\fP', or `\fB<\fP\&.\&.\&.\fB>\fP', may be used in place -+of a colon as delimiters, but note that when a flag takes more than one -+argument, a matched pair of delimiters must surround each argument\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBp\fP -+Recognize the same escape sequences as the \fBprint\fP builtin -+in string arguments to any of the flags described below that -+follow this argument\&. -+.TP -+\fB~\fP -+Force string arguments to any of the flags below that follow within -+the parentheses to be treated as patterns\&. Compare with a \fB~\fP -+outside parentheses, which forces the entire substituted string to -+be treated as a pattern\&. Hence, for example, -+.RS -+.nf -+\fB[[ "?" = ${(~j\&.|\&.)array} ]]\fP -+.fi -+.RE -+with the \fBEXTENDED_GLOB\fP option set succeeds if and only if \fB$array\fP -+contains the string `\fB?\fP\&' as an element\&. The argument may be -+repeated to toggle the behaviour; its effect only lasts to the -+end of the parenthesised group\&. -+.TP -+\fBj:\fP\fIstring\fP\fB:\fP -+Join the words of arrays together using \fIstring\fP as a separator\&. -+Note that this occurs before field splitting by the \fBs:\fP\fIstring\fP\fB:\fP -+flag or the \fBSH_WORD_SPLIT\fP option\&. -+.TP -+\fBl:\fP\fIexpr\fP\fB::\fP\fIstring1\fP\fB::\fP\fIstring2\fP\fB:\fP -+Pad the resulting words on the left\&. Each word will be truncated if -+required and placed in a field \fIexpr\fP characters wide\&. -+.RS -+.PP -+The arguments \fB:\fP\fIstring1\fP\fB:\fP and \fB:\fP\fIstring2\fP\fB:\fP are -+optional; neither, the first, or both may be given\&. Note that the same -+pairs of delimiters must be used for each of the three arguments\&. The -+space to the left will be filled with \fIstring1\fP (concatenated as -+often as needed) or spaces if \fIstring1\fP is not given\&. If both -+\fIstring1\fP and \fIstring2\fP are given, \fBstring2\fP is inserted once -+directly to the left of each word, truncated if necessary, before -+\fIstring1\fP is used to produce any remaining padding\&. -+.PP -+If the \fBMULTIBYTE\fP option is in effect, the flag \fBm\fP may also -+be given, in which case widths will be used for the calculation of -+padding; otherwise individual multibyte characters are treated as occupying -+one unit of width\&. -+.PP -+If the \fBMULTIBYTE\fP option is not in effect, each byte in the string is -+treated as occupying one unit of width\&. -+.PP -+Control characters are always assumed to be one unit wide; this allows the -+mechanism to be used for generating repetitions of control characters\&. -+.RE -+.TP -+\fBm\fP -+Only useful together with one of the flags \fBl\fP or \fBr\fP or with the -+\fB#\fP length operator when the \fBMULTIBYTE\fP option -+is in effect\&. Use the character width reported by the system in -+calculating how much of the string it occupies or the overall -+length of the string\&. Most printable characters have a width of one -+unit, however certain Asian character sets and certain special effects -+use wider characters; combining characters have zero width\&. -+Non\-printable characters are arbitrarily counted as zero width; how they -+would actually be displayed will vary\&. -+.RS -+.PP -+If the \fBm\fP is repeated, the character either counts zero (if it has -+zero width), else one\&. For printable character strings this has the -+effect of counting the number of glyphs (visibly separate characters), -+except for the case where combining characters themselves have non\-zero -+width (true in certain alphabets)\&. -+.RE -+.TP -+\fBr:\fP\fIexpr\fP\fB::\fP\fIstring1\fP\fB::\fP\fIstring2\fP\fB:\fP -+As \fBl\fP, but pad the words on the right and insert \fIstring2\fP -+immediately to the right of the string to be padded\&. -+.RS -+.PP -+Left and right padding may be used together\&. In this case the strategy -+is to apply left padding to the first half width of each of the resulting -+words, and right padding to the second half\&. If the string to be -+padded has odd width the extra padding is applied on the left\&. -+.RE -+.TP -+\fBs:\fP\fIstring\fP\fB:\fP -+Force field splitting at the -+separator \fIstring\fP\&. Note that a \fIstring\fP of two or more -+characters means that all of them must match in sequence; this differs from -+the treatment of two or more characters in the \fBIFS\fP parameter\&. -+See also the \fB=\fP flag and the \fBSH_WORD_SPLIT\fP option\&. -+.RS -+.PP -+For historical reasons, the usual behaviour that empty array elements -+are retained inside double quotes is disabled for arrays generated -+by splitting; hence the following: -+.PP -+.RS -+.nf -+\fBline="one::three" -+print \-l "${(s\&.:\&.)line}"\fP -+.fi -+.RE -+.PP -+produces two lines of output for \fBone\fP and \fBthree\fP and elides the -+empty field\&. To override this behaviour, supply the "(@)" flag as well, -+i\&.e\&. \fB"${(@s\&.:\&.)line}"\fP\&. -+.RE -+.TP -+\fBZ:\fP\fIopts\fP\fB:\fP -+As \fBz\fP but takes a combination of option letters between a following -+pair of delimiter characters\&. \fB(Z+c+)\fP -+causes comments to be parsed as a string and retained; any field in the -+resulting array beginning with an unquoted comment character is a -+comment\&. \fB(Z+C+)\fP causes comments to be parsed -+and removed\&. The rule for comments is standard: anything between a word -+starting with the third character of \fB$HISTCHARS\fP, default \fB#\fP, up to -+the next newline is a comment\&. \fB(Z+n+)\fP causes -+unquoted newlines to be treated as ordinary whitespace, else they are -+treated as if they are shell code delimiters and converted to -+semicolons\&. -+.TP -+\fB_:\fP\fIflags\fP\fB:\fP -+The underscore (\fB_\fP) flag is reserved for future use\&. As of this -+revision of zsh, there are no valid \fIflags\fP; anything following an -+underscore, other than an empty pair of delimiters, is treated as an -+error, and the flag itself has no effect\&. -+.PP -+The following flags are meaningful with the \fB${\fP\&.\&.\&.\fB#\fP\&.\&.\&.\fB}\fP or -+\fB${\fP\&.\&.\&.\fB%\fP\&.\&.\&.\fB}\fP forms\&. The \fBS\fP and \fBI\fP flags may also be -+used with the \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP forms\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBS\fP -+Search substrings as well as beginnings or ends; with \fB#\fP start -+from the beginning and with \fB%\fP start from the end of the string\&. -+With substitution via \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP or -+\fB${\fP\&.\&.\&.\fB//\fP\&.\&.\&.\fB}\fP, specifies non\-greedy matching, i\&.e\&. that the -+shortest instead of the longest match should be replaced\&. -+.TP -+\fBI:\fP\fIexpr\fP\fB:\fP -+Search the \fIexpr\fPth match (where \fIexpr\fP evaluates to a number)\&. -+This only applies when searching for substrings, either with the \fBS\fP -+flag, or with \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP (only the \fIexpr\fPth match is -+substituted) or \fB${\fP\&.\&.\&.\fB//\fP\&.\&.\&.\fB}\fP (all matches from the -+\fIexpr\fPth on are substituted)\&. The default is to take the first match\&. -+.RS -+.PP -+The \fIexpr\fPth match is counted such that there is either one or zero -+matches from each starting position in the string, although for global -+substitution matches overlapping previous replacements are ignored\&. With -+the \fB${\fP\&.\&.\&.\fB%\fP\&.\&.\&.\fB}\fP and \fB${\fP\&.\&.\&.\fB%%\fP\&.\&.\&.\fB}\fP forms, the starting -+position for the match moves backwards from the end as the index increases, -+while with the other forms it moves forward from the start\&. -+.PP -+Hence with the string -+.RS -+.nf -+\fBwhich switch is the right switch for Ipswich?\fP -+.fi -+.RE -+substitutions of the form -+\fB${\fP(\fBSI:\fP\fIN\fP\fB:\fP)\fBstring#w*ch}\fP as \fIN\fP increases -+from 1 will match and remove `\fBwhich\fP\&', `\fBwitch\fP', `\fBwitch\fP' and -+`\fBwich\fP\&'; the form using `\fB##\fP' will match and remove `\fBwhich switch -+is the right switch for Ipswich\fP\&', `\fBwitch is the right switch for -+Ipswich\fP\&', `\fBwitch for Ipswich\fP' and `\fBwich\fP'\&. The form using `\fB%\fP' -+will remove the same matches as for `\fB#\fP\&', but in reverse order, and the -+form using `\fB%%\fP\&' will remove the same matches as for `\fB##\fP' in reverse -+order\&. -+.RE -+.TP -+\fBB\fP -+Include the index of the beginning of the match in the result\&. -+.TP -+\fBE\fP -+Include the index of the end of the match in the result\&. -+.TP -+\fBM\fP -+Include the matched portion in the result\&. -+.TP -+\fBN\fP -+Include the length of the match in the result\&. -+.TP -+\fBR\fP -+Include the unmatched portion in the result (the \fIR\fPest)\&. -+.PP -+.SS "Rules" -+.PP -+Here is a summary of the rules for substitution; this assumes that braces -+are present around the substitution, i\&.e\&. \fB${\&.\&.\&.}\fP\&. Some particular -+examples are given below\&. Note that the Zsh Development Group accepts -+\fIno responsibility\fP for any brain damage which may occur during the -+reading of the following rules\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB1\&.\fP \fINested Substitution\fP -+If multiple nested \fB${\&.\&.\&.}\fP forms are present, substitution is -+performed from the inside outwards\&. At each level, the substitution takes -+account of whether the current value is a scalar or an array, whether the -+whole substitution is in double quotes, and what flags are supplied to the -+current level of substitution, just as if the nested substitution were the -+outermost\&. The flags are not propagated up to enclosing -+substitutions; the nested substitution will return either a scalar or an -+array as determined by the flags, possibly adjusted for quoting\&. All the -+following steps take place where applicable at all levels of substitution\&. -+Note that, unless the `\fB(P)\fP\&' flag is present, the flags and any subscripts -+apply directly to the value of the nested substitution; for example, the -+expansion \fB${${foo}}\fP behaves exactly the same as \fB${foo}\fP\&. -+.RS -+.PP -+At each nested level of substitution, the substituted words undergo all -+forms of single\-word substitution (i\&.e\&. not filename generation), including -+command substitution, arithmetic expansion and filename expansion -+(i\&.e\&. leading \fB~\fP and \fB=\fP)\&. Thus, for example, \fB${${:\-=cat}:h}\fP -+expands to the directory where the \fBcat\fP program resides\&. (Explanation: -+the internal substitution has no parameter but a default value \fB=cat\fP, -+which is expanded by filename expansion to a full path; the outer -+substitution then applies the modifier \fB:h\fP and takes the directory part -+of the path\&.) -+.RE -+.TP -+\fB2\&.\fP \fIInternal Parameter Flags\fP -+Any parameter flags set by one of the \fBtypeset\fP family of commands, -+in particular the \fBL\fP, \fBR\fP, \fBZ\fP, \fBu\fP and \fBl\fP flags for padding -+and capitalization, are applied directly to the parameter value\&. -+.TP -+\fB3\&.\fP \fIParameter Subscripting\fP -+If the value is a raw parameter reference with a subscript, such as -+\fB${\fP\fIvar\fP\fB[3]}\fP, the effect of subscripting is applied directly to -+the parameter\&. Subscripts are evaluated left to right; subsequent -+subscripts apply to the scalar or array value yielded by the previous -+subscript\&. Thus if \fBvar\fP is an array, \fB${var[1][2]}\fP is the second -+character of the first word, but \fB${var[2,4][2]}\fP is the entire third -+word (the second word of the range of words two through four of the -+original array)\&. Any number of subscripts may appear\&. -+.TP -+\fB4\&.\fP \fIParameter Name Replacement\fP -+The effect of any \fB(P)\fP flag, which treats the value so far as a -+parameter name and replaces it with the corresponding value, is applied\&. -+.TP -+\fB5\&.\fP \fIDouble\-Quoted Joining\fP -+If the value after this process is an array, and the substitution -+appears in double quotes, and no \fB(@)\fP flag is present at the current -+level, the words of the value are joined with the first character of the -+parameter \fB$IFS\fP, by default a space, between each word (single word -+arrays are not modified)\&. If the \fB(j)\fP flag is present, that is used for -+joining instead of \fB$IFS\fP\&. -+.TP -+\fB6\&.\fP \fINested Subscripting\fP -+Any remaining subscripts (i\&.e\&. of a nested substitution) are evaluated at -+this point, based on whether the value is an array or a scalar\&. As with -+\fB3\&.\fP, multiple subscripts can appear\&. Note that \fB${foo[2,4][2]}\fP is -+thus equivalent to \fB${${foo[2,4]}[2]}\fP and also to -+\fB"${${(@)foo[2,4]}[2]}"\fP (the nested substitution returns an array in -+both cases), but not to \fB"${${foo[2,4]}[2]}"\fP (the nested substitution -+returns a scalar because of the quotes)\&. -+.TP -+\fB7\&.\fP \fIModifiers\fP -+Any modifiers, as specified by a trailing `\fB#\fP\&', `\fB%\fP', `\fB/\fP' -+(possibly doubled) or by a set of modifiers of the form \fB:\&.\&.\&.\fP (see -+the section `Modifiers\&' in the section `History Expansion'), are applied to the words -+of the value at this level\&. -+.TP -+\fB8\&.\fP \fICharacter evaluation\fP -+Any \fB(#)\fP flag is applied, evaluating the result so far numerically -+as a character\&. -+.TP -+\fB9\&.\fP \fILength\fP -+Any initial \fB#\fP modifier, i\&.e\&. in the form \fB${#\fP\fIvar\fP\fB}\fP, is -+used to evaluate the length of the expression so far\&. -+.TP -+\fB10\&.\fP \fIForced Joining\fP -+If the `\fB(j)\fP\&' flag is present, or no `\fB(j)\fP' flag is present but -+the string is to be split as given by rules \fB16\&.\fP or \fB17\&.\fP, and joining -+did not take place at step \fB5\&.\fP, any words in the value are joined -+together using the given string or the first character of \fB$IFS\fP if none\&. -+Note that the `\fB(F)\fP\&' flag implicitly supplies a string for joining in this -+manner\&. -+.TP -+\fB11\&.\fP \fICase modification\fP -+Any case modification from one of the flags \fB(L)\fP, \fB(U)\fP or \fB(C)\fP -+is applied\&. -+.TP -+\fB12\&.\fP \fIPrompt evaluation\fP -+Any prompt\-style formatting from the \fB(%)\fP family of flags is applied\&. -+.TP -+\fB13\&.\fP \fIQuote application\fP -+Any quoting or unquoting using \fB(q)\fP and \fB(Q)\fP and related flags -+is applied\&. -+.TP -+\fB14\&.\fP \fIDirectory naming\fP -+Any directory name substitution using \fB(D)\fP flag is applied\&. -+.TP -+\fB15\&.\fP \fIVisibility enhancment\fP -+Any modifications to make characters visible using the \fB(V)\fP flag -+are applied\&. -+.TP -+\fB16\&.\fP \fIForced Splitting\fP -+If one of the `\fB(s)\fP\&', `\fB(f)\fP' or `\fB(z)\fP' flags are present, or the `\fB=\fP' -+specifier was present (e\&.g\&. \fB${=\fP\fIvar\fP\fB}\fP), the word is split on -+occurrences of the specified string, or (for \fB=\fP with neither of the two -+flags present) any of the characters in \fB$IFS\fP\&. -+.TP -+\fB17\&.\fP \fIShell Word Splitting\fP -+If no `\fB(s)\fP\&', `\fB(f)\fP' or `\fB=\fP' was given, but the word is not -+quoted and the option \fBSH_WORD_SPLIT\fP is set, the word is split on -+occurrences of any of the characters in \fB$IFS\fP\&. Note this step, too, -+takes place at all levels of a nested substitution\&. -+.TP -+\fB18\&.\fP \fIUniqueness\fP -+If the result is an array and the `\fB(u)\fP\&' flag was present, duplicate -+elements are removed from the array\&. -+.TP -+\fB19\&.\fP \fIOrdering\fP -+If the result is still an array and one of the `\fB(o)\fP\&' or `\fB(O)\fP' flags -+was present, the array is reordered\&. -+.TP -+\fB20\&.\fP \fIRe\-Evaluation\fP -+Any `\fB(e)\fP\&' flag is applied to the value, forcing it to be re\-examined -+for new parameter substitutions, but also for command and arithmetic -+substitutions\&. -+.TP -+\fB21\&.\fP \fIPadding\fP -+Any padding of the value by the `\fB(l\&.\fP\fIfill\fP\fB\&.)\fP\&' or -+`\fB(r\&.\fP\fIfill\fP\fB\&.)\fP\&' flags is applied\&. -+.TP -+\fB22\&.\fP \fISemantic Joining\fP -+In contexts where expansion semantics requires a single word to -+result, all words are rejoined with the first character of \fBIFS\fP -+between\&. So in `\fB${(P\fP\fB)${(f\fP\fB)lines}}\fP\&' -+the value of \fB${lines}\fP is split at newlines, but then must be -+joined again before the \fBP\fP flag can be applied\&. -+.RS -+.PP -+If a single word is not required, this rule is skipped\&. -+.RE -+.TP -+\fB23\&.\fP \fIEmpty argument removal\fP -+If the substitution does not appear in double quotes, any resulting -+zero\-length argument, whether from a scalar or an element of an array, -+is elided from the list of arguments inserted into the command line\&. -+.RS -+.PP -+Strictly speaking, the removal happens later as the same happens with -+other forms of substitution; the point to note here is simply that -+it occurs after any of the above parameter operations\&. -+.RE -+.RE -+.PP -+.SS "Examples" -+The flag \fBf\fP is useful to split a double\-quoted substitution line by -+line\&. For example, \fB${(f)"$(<\fP\fIfile\fP\fB)"}\fP -+substitutes the contents of \fIfile\fP divided so that each line is -+an element of the resulting array\&. Compare this with the effect of -+\fB$\fP\fB(<\fP\fIfile\fP\fB)\fP alone, which divides the file -+up by words, or the same inside double quotes, which makes the entire -+content of the file a single string\&. -+.PP -+The following illustrates the rules for nested parameter expansions\&. -+Suppose that \fB$foo\fP contains the array \fB(bar baz\fP\fB)\fP: -+.PP -+.PD 0 -+.TP -+.PD -+\fB"${(@)${foo}[1]}"\fP -+This produces the result \fBb\fP\&. First, the inner substitution -+\fB"${foo}"\fP, which has no array (\fB@\fP) flag, produces a single word -+result \fB"bar baz"\fP\&. The outer substitution \fB"${(@)\&.\&.\&.[1]}"\fP detects -+that this is a scalar, so that (despite the `\fB(@)\fP\&' flag) the subscript -+picks the first character\&. -+.TP -+\fB"${${(@)foo}[1]}"\fP -+This produces the result `\fBbar\fP\&'\&. In this case, the inner substitution -+\fB"${(@)foo}"\fP produces the array `\fB(bar baz\fP\fB)\fP\&'\&. The outer -+substitution \fB"${\&.\&.\&.[1]}"\fP detects that this is an array and picks the -+first word\&. This is similar to the simple case \fB"${foo[1]}"\fP\&. -+.PP -+As an example of the rules for word splitting and joining, suppose \fB$foo\fP -+contains the array `\fB(ax1 bx1\fP\fB)\fP\&'\&. Then -+.PP -+.PD 0 -+.TP -+.PD -+\fB${(s/x/)foo}\fP -+produces the words `\fBa\fP\&', `\fB1 b\fP' and `\fB1\fP'\&. -+.TP -+\fB${(j/x/s/x/)foo}\fP -+produces `\fBa\fP\&', `\fB1\fP', `\fBb\fP' and `\fB1\fP'\&. -+.TP -+\fB${(s/x/)foo%%1*}\fP -+produces `\fBa\fP\&' and `\fB b\fP' (note the extra space)\&. As substitution -+occurs before either joining or splitting, the operation first generates -+the modified array \fB(ax bx\fP\fB)\fP, which is joined to give -+\fB"ax bx"\fP, and then split to give `\fBa\fP\&', `\fB b\fP' and `'\&. The final -+empty string will then be elided, as it is not in double quotes\&. -+.PP -+.SH "COMMAND SUBSTITUTION" -+A command enclosed in parentheses preceded by a dollar sign, like -+`\fB$(\fP\&.\&.\&.\fB)\fP\&', or quoted with grave -+accents, like `\fB`\fP\&.\&.\&.\fB`\fP\&', is replaced with its standard output, with -+any trailing newlines deleted\&. -+If the substitution is not enclosed in double quotes, the -+output is broken into words using the \fBIFS\fP parameter\&. -+The substitution `\fB$(cat\fP \fIfoo\fP\fB)\fP\&' may be replaced -+by the equivalent but faster `\fB$(<\fP\fIfoo\fP\fB)\fP\&'\&. -+In either case, if the option \fBGLOB_SUBST\fP is set, -+the output is eligible for filename generation\&. -+.SH "ARITHMETIC EXPANSION" -+A string of the form `\fB$[\fP\fIexp\fP\fB]\fP\&' or -+`\fB$((\fP\fIexp\fP\fB))\fP\&' is substituted -+with the value of the arithmetic expression \fIexp\fP\&. \fIexp\fP is -+subjected to \fIparameter expansion\fP, \fIcommand substitution\fP -+and \fIarithmetic expansion\fP before it is evaluated\&. -+See the section `Arithmetic Evaluation\&'\&. -+.SH "BRACE EXPANSION" -+A string of the form -+`\fIfoo\fP\fB{\fP\fIxx\fP\fB,\fP\fIyy\fP\fB,\fP\fIzz\fP\fB}\fP\fIbar\fP\&' -+is expanded to the individual words -+`\fIfooxxbar\fP\&', `\fIfooyybar\fP' and `\fIfoozzbar\fP'\&. -+Left\-to\-right order is preserved\&. This construct -+may be nested\&. Commas may be quoted in order to -+include them literally in a word\&. -+.PP -+An expression of the form `\fB{\fP\fIn1\fP\fB\&.\&.\fP\fIn2\fP\fB}\fP\&', -+where \fIn1\fP and \fIn2\fP are integers, -+is expanded to every number between -+\fIn1\fP and \fIn2\fP inclusive\&. If either number begins with a -+zero, all the resulting numbers will be padded with leading zeroes to -+that minimum width, but for negative numbers the \fB\-\fP character is also -+included in the width\&. If the numbers are in decreasing order the -+resulting sequence will also be in decreasing order\&. -+.PP -+An expression of the form `\fB{\fP\fIn1\fP\fB\&.\&.\fP\fIn2\fP\fB\&.\&.\fP\fIn3\fP\fB}\fP\&', -+where \fIn1\fP, \fIn2\fP, and \fIn3\fP are integers, -+is expanded as above, but only every \fIn3\fPth number starting from \fIn1\fP -+is output\&. If \fIn3\fP is negative the numbers are output in reverse order, -+this is slightly different from simply swapping \fIn1\fP and \fIn2\fP in the case -+that the step \fIn3\fP doesn\&'t evenly divide the range\&. Zero padding can be -+specified in any of the three numbers, specifying it in the third can be useful -+to pad for example `\fB{\-99\&.\&.100\&.\&.01}\fP\&' which is not possible to specify by putting a -+0 on either of the first two numbers (i\&.e\&. pad to two characters)\&. -+.PP -+If a brace expression matches none of the above forms, it is left -+unchanged, unless the option \fBBRACE_CCL\fP (an abbreviation for `brace -+character class\&') is set\&. -+In that case, it is expanded to a list of the individual -+characters between the braces sorted into the order of the characters -+in the ASCII character set (multibyte characters are not currently -+handled)\&. The syntax is similar to a -+\fB[\fP\&.\&.\&.\fB]\fP expression in filename generation: -+`\fB\-\fP\&' is treated specially to denote a range of characters, but `\fB^\fP' or -+`\fB!\fP\&' as the first character is treated normally\&. For example, -+`\fB{abcdef0\-9}\fP\&' expands to 16 words \fB0 1 2 3 4 5 6 7 8 9 a b c d e f\fP\&. -+.PP -+Note that brace expansion is not part of filename generation (globbing); an -+expression such as \fB*/{foo,bar}\fP is split into two separate words -+\fB*/foo\fP and \fB*/bar\fP before filename generation takes place\&. In -+particular, note that this is liable to produce a `no match\&' error if -+\fIeither\fP of the two expressions does not match; this is to be contrasted -+with \fB*/(foo|bar)\fP, which is treated as a single pattern but otherwise -+has similar effects\&. -+.PP -+To combine brace expansion with array expansion, see the -+\fB${^\fP\fIspec\fP\fB}\fP form described -+in the section Parameter Expansion -+above\&. -+.PP -+.SH "FILENAME EXPANSION" -+Each word is checked to see if it begins with an unquoted `\fB~\fP\&'\&. -+If it does, then the word up to a `\fB/\fP\&', -+or the end of the word if there is no `\fB/\fP\&', -+is checked to see if it can be substituted in one of the ways -+described here\&. If so, then the `\fB~\fP\&' and the checked portion are -+replaced with the appropriate substitute value\&. -+.PP -+A `\fB~\fP\&' by itself is replaced by the value of \fB$HOME\fP\&. -+A `\fB~\fP\&' followed by a `\fB+\fP' or a `\fB\-\fP' is replaced by current -+or previous working directory, respectively\&. -+.PP -+A `\fB~\fP\&' followed by a number is replaced by the directory at that -+position in the directory stack\&. -+`\fB~0\fP\&' is equivalent to `\fB~+\fP', -+and `\fB~1\fP\&' is the top of the stack\&. -+`\fB~+\fP\&' followed by a number is replaced by the directory at that -+position in the directory stack\&. -+`\fB~+0\fP\&' is equivalent to `\fB~+\fP', -+and `\fB~+1\fP\&' is the top of the stack\&. -+`\fB~\-\fP\&' followed by a number is replaced by the directory that -+many positions from the bottom of the stack\&. -+`\fB~\-0\fP\&' is the bottom of the stack\&. -+The \fBPUSHD_MINUS\fP -+option exchanges the effects of `\fB~+\fP\&' and `\fB~\-\fP' where they are -+followed by a number\&. -+.PP -+.SS "Dynamic named directories" -+.PP -+If the function \fBzsh_directory_name\fP exists, or the shell variable -+\fBzsh_directory_name_functions\fP exists and contains an array of -+function names, then the functions are used to implement dynamic -+directory naming\&. The functions are tried in order until one returns -+status zero, so it is important that functions test whether they can -+handle the case in question and return an appropriate status\&. -+.PP -+A `\fB~\fP\&' followed by a string \fInamstr\fP in unquoted square brackets is -+treated specially as a dynamic directory name\&. Note that the first -+unquoted closing square bracket always terminates \fInamstr\fP\&. The shell -+function is passed two arguments: the string \fBn\fP (for name) and -+\fInamstr\fP\&. It should either set the array \fBreply\fP to a single element -+which is the directory corresponding to the name and return status zero -+(executing an assignment as the last statement is usually sufficient), or -+it should return status non\-zero\&. In the former case the element of reply -+is used as the directory; in the latter case the substitution is deemed to -+have failed\&. If all functions fail and the option \fBNOMATCH\fP is set, -+an error results\&. -+.PP -+The functions defined as above are also used to see if a directory can -+be turned into a name, for example when printing the directory stack or -+when expanding \fB%~\fP in prompts\&. In this case each function is passed two -+arguments: the string \fBd\fP (for directory) and the candidate for dynamic -+naming\&. The function should either return non\-zero status, if the -+directory cannot be named by the function, or it should set the array reply -+to consist of two elements: the first is the dynamic name for the directory -+(as would appear within `\fB~[\fP\fI\&.\&.\&.\fP\fB]\fP\&'), and the second is the -+prefix length of the directory to be replaced\&. For example, if the trial -+directory is \fB/home/myname/src/zsh\fP and the dynamic name for -+\fB/home/myname/src\fP (which has 16 characters) is \fBs\fP, then the function -+sets -+.PP -+.RS -+.nf -+\fBreply=(s 16)\fP -+.fi -+.RE -+.PP -+The directory name so returned is compared with possible static names for -+parts of the directory path, as described below; it is used if the prefix -+length matched (16 in the example) is longer than that matched by any -+static name\&. -+.PP -+It is not a requirement that a function implements both -+\fBn\fP and \fBd\fP calls; for example, it might be appropriate for certain -+dynamic forms of expansion not to be contracted to names\&. In that case -+any call with the first argument \fBd\fP should cause a non\-zero status to -+be returned\&. -+.PP -+The completion system calls `\fBzsh_directory_name c\fP\&' followed by -+equivalent calls to elements of the array -+\fBzsh_directory_name_functions\fP, if it exists, in order to -+complete dynamic names for directories\&. The code for this should be -+as for any other completion function as described in -+\fIzshcompsys\fP(1)\&. -+.PP -+As a working example, here is a function that expands any dynamic names -+beginning with the string \fBp:\fP to directories below -+\fB/home/pws/perforce\fP\&. In this simple case a static name for the -+directory would be just as effective\&. -+.PP -+.RS -+.nf -+\fBzsh_directory_name() { -+ emulate \-L zsh -+ setopt extendedglob -+ local \-a match mbegin mend -+ if [[ $1 = d ]]; then -+ # turn the directory into a name -+ if [[ $2 = (#b)(/home/pws/perforce/)([^/]##)* ]]; then -+ typeset \-ga reply -+ reply=(p:$match[2] $(( ${#match[1]} + ${#match[2]} )) ) -+ else -+ return 1 -+ fi -+ elif [[ $1 = n ]]; then -+ # turn the name into a directory -+ [[ $2 != (#b)p:(?*) ]] && return 1 -+ typeset \-ga reply -+ reply=(/home/pws/perforce/$match[1]) -+ elif [[ $1 = c ]]; then -+ # complete names -+ local expl -+ local \-a dirs -+ dirs=(/home/pws/perforce/*(/:t)) -+ dirs=(p:${^dirs}) -+ _wanted dynamic\-dirs expl \&'dynamic directory' compadd \-S\e] \-a dirs -+ return -+ else -+ return 1 -+ fi -+ return 0 -+}\fP -+.fi -+.RE -+.PP -+.SS "Static named directories" -+A `\fB~\fP\&' followed by anything not already covered consisting -+of any number of alphanumeric characters or underscore (`\fB_\fP\&'), -+hyphen (`\fB\-\fP\&'), or dot (`\fB\&.\fP') is looked up as a -+named directory, and replaced by the value of that named directory if found\&. -+Named directories are typically home directories for users on the system\&. -+They may also be defined if the text after the `\fB~\fP\&' is the name -+of a string shell parameter whose value begins with a `\fB/\fP\&'\&. -+Note that trailing slashes will be removed from the path to the directory -+(though the original parameter is not modified)\&. -+.PP -+It is also possible to define directory names using the \fB\-d\fP option to the -+\fBhash\fP builtin\&. -+.PP -+In certain circumstances (in prompts, for instance), when the shell -+prints a path, the path is checked to see if it has a named -+directory as its prefix\&. If so, then the prefix portion -+is replaced with a `\fB~\fP\&' followed by the name of the directory\&. -+The shortest way of referring to the directory is used, -+with ties broken in favour of using a named directory, -+except when the directory is \fB/\fP itself\&. The parameters \fB$PWD\fP and -+\fB$OLDPWD\fP are never abbreviated in this fashion\&. -+.PP -+.SS "`=\&' expansion" -+.PP -+If a word begins with an unquoted `\fB=\fP\&' -+and the \fBEQUALS\fP option is set, -+the remainder of the word is taken as the -+name of a command\&. If a command -+exists by that name, the word is replaced -+by the full pathname of the command\&. -+.PP -+.SS "Notes" -+.PP -+Filename expansion is performed on the right hand side of a parameter -+assignment, including those appearing after commands of the -+\fBtypeset\fP family\&. In this case, the right hand side will be treated -+as a colon\-separated list in the manner of the \fBPATH\fP parameter, -+so that a `\fB~\fP\&' or an `\fB=\fP' following a `\fB:\fP' is eligible for expansion\&. -+All such behaviour can be -+disabled by quoting the `\fB~\fP\&', the `\fB=\fP', or the whole expression (but not -+simply the colon); the \fBEQUALS\fP option is also respected\&. -+.PP -+If the option \fBMAGIC_EQUAL_SUBST\fP is set, any unquoted shell -+argument in the form `\fIidentifier\fP\fB=\fP\fIexpression\fP\&' becomes eligible -+for file expansion as described in the previous paragraph\&. Quoting the -+first `\fB=\fP\&' also inhibits this\&. -+.PP -+.SH "FILENAME GENERATION" -+If a word contains an unquoted instance of one of the characters -+`\fB*\fP\&', `\fB(\fP', `\fB|\fP', `\fB<\fP', `\fB[\fP', or `\fB?\fP', it is regarded -+as a pattern for filename generation, unless the \fBGLOB\fP option is unset\&. -+If the \fBEXTENDED_GLOB\fP option is set, -+the `\fB^\fP\&' and `\fB#\fP' characters also denote a pattern; otherwise -+they are not treated specially by the shell\&. -+.PP -+The word is replaced with a list of sorted filenames that match -+the pattern\&. If no matching pattern is found, the shell gives -+an error message, unless the \fBNULL_GLOB\fP option is set, -+in which case the word is deleted; or unless the \fBNOMATCH\fP -+option is unset, in which case the word is left unchanged\&. -+.PP -+In filename generation, -+the character `\fB/\fP\&' must be matched explicitly; -+also, a `\fB\&.\fP\&' must be matched -+explicitly at the beginning of a pattern or after a `\fB/\fP\&', unless the -+\fBGLOB_DOTS\fP option is set\&. -+No filename generation pattern -+matches the files `\fB\&.\fP\&' or `\fB\&.\&.\fP'\&. In other instances of pattern -+matching, the `\fB/\fP\&' and `\fB\&.\fP' are not treated specially\&. -+.SS "Glob Operators" -+.PD 0 -+.TP -+.PD -+\fB*\fP -+Matches any string, including the null string\&. -+.TP -+\fB?\fP -+Matches any character\&. -+.TP -+\fB[\fP\&.\&.\&.\fB]\fP -+Matches any of the enclosed characters\&. Ranges of characters -+can be specified by separating two characters by a `\fB\-\fP\&'\&. -+A `\fB\-\fP\&' or `\fB]\fP' may be matched by including it as the -+first character in the list\&. -+There are also several named classes of characters, in the form -+`\fB[:\fP\fIname\fP\fB:]\fP\&' with the following meanings\&. -+The first set use the macros provided by -+the operating system to test for the given character combinations, -+including any modifications due to local language settings, see -+\fIctype\fP(3): -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB[:alnum:]\fP -+The character is alphanumeric -+.TP -+\fB[:alpha:]\fP -+The character is alphabetic -+.TP -+\fB[:ascii:]\fP -+The character is 7\-bit, i\&.e\&. is a single\-byte character without -+the top bit set\&. -+.TP -+\fB[:blank:]\fP -+The character is either space or tab -+.TP -+\fB[:cntrl:]\fP -+The character is a control character -+.TP -+\fB[:digit:]\fP -+The character is a decimal digit -+.TP -+\fB[:graph:]\fP -+The character is a printable character other than whitespace -+.TP -+\fB[:lower:]\fP -+The character is a lowercase letter -+.TP -+\fB[:print:]\fP -+The character is printable -+.TP -+\fB[:punct:]\fP -+The character is printable but neither alphanumeric nor whitespace -+.TP -+\fB[:space:]\fP -+The character is whitespace -+.TP -+\fB[:upper:]\fP -+The character is an uppercase letter -+.TP -+\fB[:xdigit:]\fP -+The character is a hexadecimal digit -+.PP -+Another set of named classes is handled internally by the shell and -+is not sensitive to the locale: -+.PP -+.PD 0 -+.TP -+.PD -+\fB[:IDENT:]\fP -+The character is allowed to form part of a shell identifier, such -+as a parameter name -+.TP -+\fB[:IFS:]\fP -+The character is used as an input field separator, i\&.e\&. is contained in the -+\fBIFS\fP parameter -+.TP -+\fB[:IFSSPACE:]\fP -+The character is an IFS white space character; see the documentation -+for \fBIFS\fP in -+the \fIzshparam\fP(1) manual page\&. -+.TP -+\fB[:WORD:]\fP -+The character is treated as part of a word; this test is sensitive -+to the value of the \fBWORDCHARS\fP parameter -+.PP -+Note that the square brackets are additional -+to those enclosing the whole set of characters, so to test for a -+single alphanumeric character you need `\fB[[:alnum:]]\fP\&'\&. Named -+character sets can be used alongside other types, -+e\&.g\&. `\fB[[:alpha:]0\-9]\fP\&'\&. -+.RE -+.TP -+.PD 0 -+\fB[^\fP\&.\&.\&.\fB]\fP -+.TP -+.PD -+\fB[!\fP\&.\&.\&.\fB]\fP -+Like \fB[\fP\&.\&.\&.\fB]\fP, except that it matches any character which is -+not in the given set\&. -+.TP -+\fB<\fP[\fIx\fP]\fB\-\fP[\fIy\fP]\fB>\fP -+Matches any number in the range \fIx\fP to \fIy\fP, inclusive\&. -+Either of the numbers may be omitted to make the range open\-ended; -+hence `\fB<\->\fP\&' matches any number\&. To match individual digits, the -+\fB[\fP\&.\&.\&.\fB]\fP form is more efficient\&. -+.RS -+.PP -+Be careful when using other wildcards adjacent to patterns of this form; -+for example, \fB<0\-9>*\fP will actually match any number whatsoever at the -+start of the string, since the `\fB<0\-9>\fP\&' will match the first digit, and -+the `\fB*\fP\&' will match any others\&. This is a trap for the unwary, but is -+in fact an inevitable consequence of the rule that the longest possible -+match always succeeds\&. Expressions such as `\fB<0\-9>[^[:digit:]]*\fP\&' can be -+used instead\&. -+.RE -+.TP -+\fB(\fP\&.\&.\&.\fB)\fP -+Matches the enclosed pattern\&. This is used for grouping\&. -+If the \fBKSH_GLOB\fP option is set, then a -+`\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP' immediately preceding -+the `\fB(\fP\&' is treated specially, as detailed below\&. The option -+\fBSH_GLOB\fP prevents bare parentheses from being used in this way, though -+the \fBKSH_GLOB\fP option is still available\&. -+.RS -+.PP -+Note that grouping cannot extend over multiple directories: it is an error -+to have a `\fB/\fP\&' within a group (this only applies for patterns used in -+filename generation)\&. There is one exception: a group of the form -+\fB(\fP\fIpat\fP\fB/)#\fP appearing as a complete path segment can -+match a sequence of directories\&. For example, \fBfoo/(a*/)#bar\fP matches -+\fBfoo/bar\fP, \fBfoo/any/bar\fP, \fBfoo/any/anyother/bar\fP, and so on\&. -+.RE -+.TP -+\fIx\fP\fB|\fP\fIy\fP -+Matches either \fIx\fP or \fIy\fP\&. -+This operator has lower precedence than any other\&. -+The `\fB|\fP\&' character -+must be within parentheses, to avoid interpretation as a pipeline\&. -+.TP -+\fB^\fP\fIx\fP -+(Requires \fBEXTENDED_GLOB\fP to be set\&.) -+Matches anything except the pattern \fIx\fP\&. -+This has a higher precedence than `\fB/\fP\&', so `\fB^foo/bar\fP' -+will search directories in `\fB\&.\fP\&' except `\fB\&./foo\fP' -+for a file named `\fBbar\fP\&'\&. -+.TP -+\fIx\fP\fB~\fP\fIy\fP -+(Requires \fBEXTENDED_GLOB\fP to be set\&.) -+Match anything that matches the pattern \fIx\fP but does not match \fIy\fP\&. -+This has lower precedence than any operator except `\fB|\fP\&', so -+`\fB*/*~foo/bar\fP\&' will search for all files in all directories in `\fB\&.\fP' -+and then exclude `\fBfoo/bar\fP\&' if there was such a match\&. -+Multiple patterns can be excluded by -+`\fIfoo\fP\fB~\fP\fIbar\fP\fB~\fP\fIbaz\fP\&'\&. -+In the exclusion pattern (\fIy\fP), `\fB/\fP\&' and `\fB\&.\fP' are not treated -+specially the way they usually are in globbing\&. -+.TP -+\fIx\fP\fB#\fP -+(Requires \fBEXTENDED_GLOB\fP to be set\&.) -+Matches zero or more occurrences of the pattern \fIx\fP\&. -+This operator has high precedence; `\fB12#\fP\&' is equivalent to `\fB1(2#)\fP', -+rather than `\fB(12)#\fP\&'\&. It is an error for an unquoted `\fB#\fP' to follow -+something which cannot be repeated; this includes an empty string, a -+pattern already followed by `\fB##\fP\&', or parentheses when part of a -+\fBKSH_GLOB\fP pattern (for example, `\fB!(\fP\fIfoo\fP\fB)#\fP\&' is -+invalid and must be replaced by -+`\fB*(!(\fP\fIfoo\fP\fB))\fP\&')\&. -+.TP -+\fIx\fP\fB##\fP -+(Requires \fBEXTENDED_GLOB\fP to be set\&.) -+Matches one or more occurrences of the pattern \fIx\fP\&. -+This operator has high precedence; `\fB12##\fP\&' is equivalent to `\fB1(2##)\fP', -+rather than `\fB(12)##\fP\&'\&. No more than two active `\fB#\fP' characters may -+appear together\&. (Note the potential clash with glob qualifiers in the -+form `\fB1(2##)\fP\&' which should therefore be avoided\&.) -+.SS "ksh\-like Glob Operators" -+If the \fBKSH_GLOB\fP option is set, the effects of parentheses can be -+modified by a preceding `\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP'\&. -+This character need not be unquoted to have special effects, -+but the `\fB(\fP\&' must be\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fB@(\fP\&.\&.\&.\fB)\fP -+Match the pattern in the parentheses\&. (Like `\fB(\fP\&.\&.\&.\fB)\fP\&'\&.) -+.TP -+\fB*(\fP\&.\&.\&.\fB)\fP -+Match any number of occurrences\&. (Like `\fB(\fP\&.\&.\&.\fB)#\fP\&'\&.) -+.TP -+\fB+(\fP\&.\&.\&.\fB)\fP -+Match at least one occurrence\&. (Like `\fB(\fP\&.\&.\&.\fB)##\fP\&'\&.) -+.TP -+\fB?(\fP\&.\&.\&.\fB)\fP -+Match zero or one occurrence\&. (Like `\fB(|\fP\&.\&.\&.\fB)\fP\&'\&.) -+.TP -+\fB!(\fP\&.\&.\&.\fB)\fP -+Match anything but the expression in parentheses\&. -+(Like `\fB(^(\fP\&.\&.\&.\fB))\fP\&'\&.) -+.SS "Precedence" -+The precedence of the operators given above is (highest) `\fB^\fP\&', `\fB/\fP', -+`\fB~\fP\&', `\fB|\fP' (lowest); the -+remaining operators are simply treated from left to right as part of a -+string, with `\fB#\fP\&' and `\fB##\fP' applying to the shortest possible -+preceding unit (i\&.e\&. a character, `\fB?\fP\&', `\fB[\fP\&.\&.\&.\fB]\fP', -+`\fB<\fP\&.\&.\&.\fB>\fP\&', or a parenthesised expression)\&. As mentioned -+above, a `\fB/\fP\&' used as a directory separator may not appear inside -+parentheses, while a `\fB|\fP\&' must do so; in patterns used in other contexts -+than filename generation (for example, in \fBcase\fP statements and tests -+within `\fB[[\fP\&.\&.\&.\fB]]\fP\&'), a `\fB/\fP' is not special; and `\fB/\fP' is also -+not special after a `\fB~\fP\&' appearing outside parentheses in a filename -+pattern\&. -+.SS "Globbing Flags" -+There are various flags which affect any text to their right up to the -+end of the enclosing group or to the end of the pattern; they require -+the \fBEXTENDED_GLOB\fP option\&. All take the form -+\fB(#\fP\fIX\fP\fB)\fP where \fIX\fP may have one of the following -+forms: -+.PP -+.PD 0 -+.TP -+.PD -+\fBi\fP -+Case insensitive: upper or lower case characters in the pattern match -+upper or lower case characters\&. -+.TP -+\fBl\fP -+Lower case characters in the pattern match upper or lower case -+characters; upper case characters in the pattern still only match -+upper case characters\&. -+.TP -+\fBI\fP -+Case sensitive: locally negates the effect of \fBi\fP or \fBl\fP from -+that point on\&. -+.TP -+\fBb\fP -+Activate backreferences for parenthesised groups in the pattern; -+this does not work in filename generation\&. When a pattern with a set of -+active parentheses is matched, the strings matched by the groups are -+stored in the array \fB$match\fP, the indices of the beginning of the matched -+parentheses in the array \fB$mbegin\fP, and the indices of the end in the array -+\fB$mend\fP, with the first element of each array corresponding to the first -+parenthesised group, and so on\&. These arrays are not otherwise special to -+the shell\&. The indices use the same convention as does parameter -+substitution, so that elements of \fB$mend\fP and \fB$mbegin\fP may be used in -+subscripts; the \fBKSH_ARRAYS\fP option is respected\&. Sets of globbing flags -+are not considered parenthesised groups; only the first nine active -+parentheses can be referenced\&. -+.RS -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBfoo="a string with a message" -+if [[ $foo = (a|an)\&' '(#b)(*)' '* ]]; then -+ print ${foo[$mbegin[1],$mend[1]]} -+fi\fP -+.fi -+.RE -+.PP -+prints `\fBstring with a\fP\&'\&. Note that the first parenthesis is before the -+\fB(#b)\fP and does not create a backreference\&. -+.PP -+Backreferences work with all forms of pattern matching other than filename -+generation, but note that when performing matches on an entire array, such -+as \fB${\fP\fIarray\fP\fB#\fP\fIpattern\fP\fB}\fP, or a global substitution, such -+as \fB${\fP\fIparam\fP\fB//\fP\fIpat\fP\fB/\fP\fIrepl\fP\fB}\fP, only the data for the -+last match remains available\&. In the case of global replacements this may -+still be useful\&. See the example for the \fBm\fP flag below\&. -+.PP -+The numbering of backreferences strictly follows the order of the opening -+parentheses from left to right in the pattern string, although sets of -+parentheses may be nested\&. There are special rules for parentheses followed -+by `\fB#\fP\&' or `\fB##\fP'\&. Only the last match of the parenthesis is -+remembered: for example, in `\fB[[ abab = (#b)([ab])# ]]\fP\&', only the final -+`\fBb\fP\&' is stored in \fBmatch[1]\fP\&. Thus extra parentheses may be necessary -+to match the complete segment: for example, use -+`\fBX((ab|cd)#)Y\fP\&' to match -+a whole string of either `\fBab\fP\&' or `\fBcd\fP' between `\fBX\fP' and `\fBY\fP', -+using the value of \fB$match[1]\fP rather than \fB$match[2]\fP\&. -+.PP -+If the match fails none of the parameters is altered, so in some cases it -+may be necessary to initialise them beforehand\&. If some of the -+backreferences fail to match \-\- which happens if they are in an alternate -+branch which fails to match, or if they are followed by \fB#\fP and matched -+zero times \-\- then the matched string is set to the empty string, and the -+start and end indices are set to \-1\&. -+.PP -+Pattern matching with backreferences is slightly slower than without\&. -+.RE -+.TP -+\fBB\fP -+Deactivate backreferences, negating the effect of the \fBb\fP flag from that -+point on\&. -+.TP -+\fBc\fP\fIN\fP\fB,\fP\fIM\fP -+The flag \fB(#c\fP\fIN\fP\fB,\fP\fIM\fP\fB)\fP can be used anywhere -+that the \fB#\fP or \fB##\fP operators can be used; it cannot be combined -+with other globbing flags and a bad pattern error occurs if it is -+misplaced\&. It is equivalent to the form \fB{\fP\fIN\fP\fB,\fP\fIM\fP\fB}\fP in -+regular expressions\&. The previous character or group is required to -+match between \fIN\fP and \fIM\fP times, inclusive\&. The form -+\fB(#c\fP\fIN\fP\fB)\fP requires exactly \fBN\fP matches; -+\fB(#c,\fP\fIM\fP\fB)\fP is equivalent to specifying \fIN\fP as 0; -+\fB(#c\fP\fIN\fP\fB,)\fP specifies that there is no maximum limit -+on the number of matches\&. -+.TP -+\fBm\fP -+Set references to the match data for the entire string matched; this is -+similar to backreferencing and does not work in filename generation\&. The -+flag must be in effect at the end of the pattern, i\&.e\&. not local to a -+group\&. The parameters \fB$MATCH\fP, \fB$MBEGIN\fP and \fB$MEND\fP will be set to -+the string matched and to the indices of the beginning and end of the -+string, respectively\&. This is most useful in parameter substitutions, as -+otherwise the string matched is obvious\&. -+.RS -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBarr=(veldt jynx grimps waqf zho buck) -+print ${arr//(#m)[aeiou]/${(U)MATCH}}\fP -+.fi -+.RE -+.PP -+forces all the matches (i\&.e\&. all vowels) into uppercase, printing -+`\fBvEldt jynx grImps wAqf zhO bUck\fP\&'\&. -+.PP -+Unlike backreferences, there is no speed penalty for using match -+references, other than the extra substitutions required for the -+replacement strings in cases such as the example shown\&. -+.RE -+.TP -+\fBM\fP -+Deactivate the \fBm\fP flag, hence no references to match data will be -+created\&. -+.TP -+\fBa\fP\fInum\fP -+Approximate matching: \fInum\fP errors are allowed in the string matched by -+the pattern\&. The rules for this are described in the next subsection\&. -+.TP -+\fBs\fP, \fBe\fP -+Unlike the other flags, these have only a local effect, and each must -+appear on its own: `\fB(#s)\fP\&' and `\fB(#e)\fP' are the only valid forms\&. -+The `\fB(#s)\fP\&' flag succeeds only at the start of the test string, and the -+`\fB(#e)\fP\&' flag succeeds only at the end of the test string; they -+correspond to `\fB^\fP\&' and `\fB$\fP' in standard regular expressions\&. They -+are useful for matching path segments in patterns other than those in -+filename generation (where path segments are in any case treated -+separately)\&. For example, `\fB*((#s)|/)test((#e)|/)*\fP\&' matches -+a path segment `\fBtest\fP\&' in any of the following strings: \fBtest\fP, -+\fBtest/at/start\fP, \fBat/end/test\fP, \fBin/test/middle\fP\&. -+.RS -+.PP -+Another use is in parameter substitution; for example -+`\fB${array/(#s)A*Z(#e)}\fP\&' will remove only elements of an -+array which -+match the complete pattern `\fBA*Z\fP\&'\&. There are other ways of performing -+many operations of this type, however the combination of the substitution -+operations `\fB/\fP\&' and `\fB//\fP' with the `\fB(#s)\fP' and `\fB(#e)\fP' flags -+provides a single simple and memorable method\&. -+.PP -+Note that assertions of the form `\fB(^(#s))\fP\&' also work, i\&.e\&. match -+anywhere except at the start of the string, although this actually means -+`anything except a zero\-length portion at the start of the string\&'; you -+need to use `\fB(""~(#s))\fP\&' to match a zero\-length portion of the string -+not at the start\&. -+.RE -+.TP -+\fBq\fP -+A `\fBq\fP\&' and everything up to the closing parenthesis of the globbing -+flags are ignored by the pattern matching code\&. This is intended to -+support the use of glob qualifiers, see below\&. The result is that -+the pattern `\fB(#b)(*)\&.c(#q\&.)\fP\&' can be used both for globbing -+and for -+matching against a string\&. In the former case, the `\fB(#q\&.)\fP\&' will be -+treated as a glob qualifier and the `\fB(#b)\fP\&' will not be useful, while in -+the latter case the `\fB(#b)\fP\&' is useful for backreferences and the -+`\fB(#q\&.)\fP\&' will be ignored\&. Note that colon modifiers in the glob -+qualifiers are also not applied in ordinary pattern matching\&. -+.TP -+\fBu\fP -+Respect the current locale in determining the presence of multibyte -+characters in a pattern, provided the shell was compiled with -+\fBMULTIBYTE_SUPPORT\fP\&. This overrides the \fBMULTIBYTE\fP -+option; the default behaviour is taken from the option\&. Compare \fBU\fP\&. -+(Mnemonic: typically multibyte characters are from Unicode in the UTF\-8 -+encoding, although any extension of ASCII supported by the system -+library may be used\&.) -+.TP -+\fBU\fP -+All characters are considered to be a single byte long\&. The opposite -+of \fBu\fP\&. This overrides the \fBMULTIBYTE\fP option\&. -+.PP -+For example, the test string \fBfooxx\fP can be matched by the pattern -+\fB(#i\fP\fB)FOOXX\fP, but not by \fB(#l\fP\fB)FOOXX\fP, -+\fB(#i\fP\fB)FOO\fP\fB(#I\fP\fB)XX\fP or -+\fB((#i\fP\fB)FOOX\fP\fB)X\fP\&. The string -+\fB(#ia2\fP\fB)readme\fP specifies case\-insensitive matching of -+\fBreadme\fP with up to two errors\&. -+.PP -+When using the ksh syntax for grouping both \fBKSH_GLOB\fP and -+\fBEXTENDED_GLOB\fP must be set and the left parenthesis should be -+preceded by \fB@\fP\&. Note also that the flags do not affect letters -+inside \fB[\&.\&.\&.]\fP groups, in other words \fB(#i\fP\fB)[a\-z]\fP -+still matches only lowercase letters\&. Finally, note that when -+examining whole paths case\-insensitively every directory must be -+searched for all files which match, so that a pattern of the form -+\fB(#i\fP\fB)/foo/bar/\&.\&.\&.\fP is potentially slow\&. -+.PP -+.SS "Approximate Matching" -+When matching approximately, the shell keeps a count of the errors found, -+which cannot exceed the number specified in the -+\fB(#a\fP\fInum\fP\fB)\fP flags\&. Four types of error are recognised: -+.PP -+.PD 0 -+.TP -+.PD -+1\&. -+Different characters, as in \fBfooxbar\fP and \fBfooybar\fP\&. -+.TP -+2\&. -+Transposition of characters, as in \fBbanana\fP and \fBabnana\fP\&. -+.TP -+3\&. -+A character missing in the target string, as with the pattern \fBroad\fP and -+target string \fBrod\fP\&. -+.TP -+4\&. -+An extra character appearing in the target string, as with \fBstove\fP -+and \fBstrove\fP\&. -+.PP -+Thus, the pattern \fB(#a3\fP\fB)abcd\fP matches \fBdcba\fP, with the -+errors occurring by using the first rule twice and the second once, -+grouping the string as \fB[d][cb][a]\fP and \fB[a][bc][d]\fP\&. -+.PP -+Non\-literal parts of the pattern must match exactly, including characters -+in character ranges: hence \fB(#a1\fP\fB)???\fP matches strings of -+length four, by applying rule 4 to an empty part of the pattern, but not -+strings of length two, since all the \fB?\fP must match\&. Other characters -+which must match exactly are initial dots in filenames (unless the -+\fBGLOB_DOTS\fP option is set), and all slashes in filenames, so that -+\fBa/bc\fP is two errors from \fBab/c\fP (the slash cannot be transposed with -+another character)\&. Similarly, errors are counted separately for -+non\-contiguous strings in the pattern, so that \fB(ab|cd\fP\fB)ef\fP -+is two errors from \fBaebf\fP\&. -+.PP -+When using exclusion via the \fB~\fP operator, approximate matching is -+treated entirely separately for the excluded part and must be activated -+separately\&. Thus, \fB(#a1\fP\fB)README~READ_ME\fP matches -+\fBREAD\&.ME\fP but not \fBREAD_ME\fP, as the trailing \fBREAD_ME\fP is matched -+without approximation\&. However, -+\fB(#a1\fP\fB)README~(#a1\fP\fB)READ_ME\fP -+does not match any pattern of the form \fBREAD\fP\fI?\fP\fBME\fP as all -+such forms are now excluded\&. -+.PP -+Apart from exclusions, there is only one overall error count; however, the -+maximum errors allowed may be altered locally, and this can be delimited by -+grouping\&. For example, -+\fB(#a1\fP\fB)cat\fP\fB((#a0\fP\fB)dog\fP\fB)fox\fP -+allows one error in total, which may not occur in the \fBdog\fP section, and -+the pattern -+\fB(#a1\fP\fB)cat\fP\fB(#a0\fP\fB)dog\fP\fB(#a1\fP\fB)fox\fP -+is equivalent\&. Note that the point at which an error is first found is the -+crucial one for establishing whether to use approximation; for example, -+\fB(#a1)abc(#a0)xyz\fP will not match \fBabcdxyz\fP, because the -+error occurs at the `\fBx\fP\&', where approximation is turned off\&. -+.PP -+Entire path segments may be matched approximately, so that -+`\fB(#a1)/foo/d/is/available/at/the/bar\fP\&' allows one error in any path -+segment\&. This is much less efficient than without the \fB(#a1)\fP, however, -+since every directory in the path must be scanned for a possible -+approximate match\&. It is best to place the \fB(#a1)\fP after any path -+segments which are known to be correct\&. -+.PP -+.SS "Recursive Globbing" -+A pathname component of the form `\fB(\fP\fIfoo\fP\fB/)#\fP\&' -+matches a path consisting of zero or more directories -+matching the pattern \fIfoo\fP\&. -+.PP -+As a shorthand, `\fB**/\fP\&' is equivalent to `\fB(*/)#\fP'; note that this -+therefore matches files in the current directory as well as -+subdirectories\&. -+Thus: -+.PP -+.RS -+.nf -+\fBls (*/)#bar\fP -+.fi -+.RE -+.PP -+or -+.PP -+.RS -+.nf -+\fBls **/bar\fP -+.fi -+.RE -+.PP -+does a recursive directory search for files named `\fBbar\fP\&' (potentially -+including the file `\fBbar\fP\&' in the current directory)\&. This form does not -+follow symbolic links; the alternative form `\fB***/\fP\&' does, but is -+otherwise identical\&. Neither of these can be combined with other forms of -+globbing within the same path segment; in that case, the `\fB*\fP\&' -+operators revert to their usual effect\&. -+.SS "Glob Qualifiers" -+Patterns used for filename generation may end in a -+list of qualifiers enclosed in parentheses\&. -+The qualifiers specify which filenames that otherwise match the given pattern -+will be inserted in the argument list\&. -+.PP -+If the option \fBBARE_GLOB_QUAL\fP is set, then a trailing set of parentheses -+containing no `\fB|\fP\&' or `\fB(\fP' characters (or `\fB~\fP' if it is special) -+is taken as a set of -+glob qualifiers\&. A glob subexpression that would normally be taken as glob -+qualifiers, for example `\fB(^x)\fP\&', can be forced to be treated as part of -+the glob pattern by doubling the parentheses, in this case producing -+`\fB((^x))\fP\&'\&. -+.PP -+If the option \fBEXTENDED_GLOB\fP is set, a different syntax for glob -+qualifiers is available, namely `\fB(#qx)\fP\&' where \fBx\fP is any of the same -+glob qualifiers used in the other format\&. The qualifiers must still appear -+at the end of the pattern\&. However, with this syntax multiple glob -+qualifiers may be chained together\&. They are treated as a logical AND of -+the individual sets of flags\&. Also, as the syntax is unambiguous, the -+expression will be treated as glob qualifiers just as long any parentheses -+contained within it are balanced; appearance of `\fB|\fP\&', `\fB(\fP' or -+`\fB~\fP\&' does not negate the effect\&. Note that qualifiers will be -+recognised in this form even if a bare glob qualifier exists at the end of -+the pattern, for example `\fB*(#q*)(\&.)\fP\&' will recognise executable regular -+files if both options are set; however, mixed syntax should probably be -+avoided for the sake of clarity\&. -+.PP -+A qualifier may be any one of the following: -+.PP -+.PD 0 -+.TP -+.PD -+\fB/\fP -+directories -+.TP -+\fBF\fP -+`full\&' (i\&.e\&. non\-empty) directories\&. Note that the -+opposite sense \fB(^F\fP\fB)\fP expands to empty directories -+and all non\-directories\&. Use \fB(/^F\fP\fB)\fP for -+empty directories\&. -+.TP -+\fB\&.\fP -+plain files -+.TP -+\fB@\fP -+symbolic links -+.TP -+\fB=\fP -+sockets -+.TP -+\fBp\fP -+named pipes (FIFOs) -+.TP -+\fB*\fP -+executable plain files (0100) -+.TP -+\fB%\fP -+device files (character or block special) -+.TP -+\fB%b\fP -+block special files -+.TP -+\fB%c\fP -+character special files -+.TP -+\fBr\fP -+owner\-readable files (0400) -+.TP -+\fBw\fP -+owner\-writable files (0200) -+.TP -+\fBx\fP -+owner\-executable files (0100) -+.TP -+\fBA\fP -+group\-readable files (0040) -+.TP -+\fBI\fP -+group\-writable files (0020) -+.TP -+\fBE\fP -+group\-executable files (0010) -+.TP -+\fBR\fP -+world\-readable files (0004) -+.TP -+\fBW\fP -+world\-writable files (0002) -+.TP -+\fBX\fP -+world\-executable files (0001) -+.TP -+\fBs\fP -+setuid files (04000) -+.TP -+\fBS\fP -+setgid files (02000) -+.TP -+\fBt\fP -+files with the sticky bit (01000) -+.TP -+\fBf\fP\fIspec\fP -+files with access rights matching \fIspec\fP\&. This \fIspec\fP may be a -+octal number optionally preceded by a `\fB=\fP\&', a `\fB+\fP', or a -+`\fB\-\fP\&'\&. If none of these characters is given, the behavior is the -+same as for `\fB=\fP\&'\&. The octal number describes the mode bits to be -+expected, if combined with a `\fB=\fP\&', the value given must match the -+file\-modes exactly, with a `\fB+\fP\&', at least the bits in the -+given number must be set in the file\-modes, and with a `\fB\-\fP\&', the -+bits in the number must not be set\&. Giving a `\fB?\fP\&' instead of a -+octal digit anywhere in the number ensures that the corresponding bits -+in the file\-modes are not checked, this is only useful in combination -+with `\fB=\fP\&'\&. -+.RS -+.PP -+If the qualifier `\fBf\fP\&' is followed by any other character anything -+up to the next matching character (`\fB[\fP\&', `\fB{\fP', and `\fB<\fP' match -+`\fB]\fP\&', `\fB}\fP', and `\fB>\fP' respectively, any other character -+matches itself) is taken as a list of comma\-separated -+\fIsub\-spec\fPs\&. Each \fIsub\-spec\fP may be either an octal number as -+described above or a list of any of the characters `\fBu\fP\&', `\fBg\fP', -+`\fBo\fP\&', and `\fBa\fP', followed by a `\fB=\fP', a `\fB+\fP', or a -+`\fB\-\fP\&', followed by a list of any of the characters `\fBr\fP', `\fBw\fP', -+`\fBx\fP\&', `\fBs\fP', and `\fBt\fP', or an octal digit\&. The first list of -+characters specify which access rights are to be checked\&. If a `\fBu\fP\&' -+is given, those for the owner of the file are used, if a `\fBg\fP\&' is -+given, those of the group are checked, a `\fBo\fP\&' means to test those -+of other users, and the `\fBa\fP\&' says to test all three groups\&. The -+`\fB=\fP\&', `\fB+\fP', and `\fB\-\fP' again says how the modes are to be -+checked and have the same meaning as described for the first form -+above\&. The second list of characters finally says which access rights -+are to be expected: `\fBr\fP\&' for read access, `\fBw\fP' for write access, -+`\fBx\fP\&' for the right to execute the file (or to search a directory), -+`\fBs\fP\&' for the setuid and setgid bits, and `\fBt\fP' for the sticky -+bit\&. -+.PP -+Thus, `\fB*(f70?)\fP\&' gives the files for which the owner has read, -+write, and execute permission, and for which other group members have -+no rights, independent of the permissions for other users\&. The pattern -+`\fB*(f\-100)\fP\&' gives all files for which the owner does not have -+execute permission, and `\fB*(f:gu+w,o\-rx:)\fP\&' gives the files for which -+the owner and the other members of the group have at least write -+permission, and for which other users don\&'t have read or execute -+permission\&. -+.RE -+.TP -+.PD 0 -+\fBe\fP\fIstring\fP -+.TP -+.PD -+\fB+\fP\fIcmd\fP -+The \fIstring\fP will be executed as shell code\&. The filename will be -+included in the list if and only if the code returns a zero status (usually -+the status of the last command)\&. -+.RS -+.PP -+In the first form, the first character after the `\fBe\fP\&' -+will be used as a separator and anything up to the next matching separator -+will be taken as the \fIstring\fP; `\fB[\fP\&', `\fB{\fP', and `\fB<\fP' match -+`\fB]\fP\&', `\fB}\fP', and `\fB>\fP', respectively, while any other character -+matches itself\&. Note that expansions must be quoted in the \fIstring\fP -+to prevent them from being expanded before globbing is done\&. -+\fIstring\fP is then executed as shell code\&. The string \fBglobqual\fP -+is appended to the array \fBzsh_eval_context\fP the duration of -+execution\&. -+.PP -+During the execution of \fIstring\fP the filename currently being tested is -+available in the parameter \fBREPLY\fP; the parameter may be altered to -+a string to be inserted into the list instead of the original -+filename\&. In addition, the parameter \fBreply\fP may be set to an array or a -+string, which overrides the value of \fBREPLY\fP\&. If set to an array, the -+latter is inserted into the command line word by word\&. -+.PP -+For example, suppose a directory contains a single file `\fBlonely\fP\&'\&. Then -+the expression `\fB*(e:\&'reply=(${REPLY}{1,2})':)\fP' will cause the words -+`\fBlonely1 lonely2\fP\&' to be inserted into the command line\&. Note the -+quotation marks\&. -+.PP -+The form \fB+\fP\fIcmd\fP has the same effect, but no delimiters appear -+around \fIcmd\fP\&. Instead, \fIcmd\fP is taken as the longest sequence of -+characters following the \fB+\fP that are alphanumeric or underscore\&. -+Typically \fIcmd\fP will be the name of a shell function that contains the -+appropriate test\&. For example, -+.PP -+.RS -+.nf -+\fBnt() { [[ $REPLY \-nt $NTREF ]] } -+NTREF=reffile -+ls \-l *(+nt)\fP -+.fi -+.RE -+.PP -+lists all files in the directory that have been modified more recently than -+\fBreffile\fP\&. -+.RE -+.TP -+\fBd\fP\fIdev\fP -+files on the device \fIdev\fP -+.TP -+\fBl\fP[\fB\-\fP|\fB+\fP]\fIct\fP -+files having a link count less than \fIct\fP (\fB\-\fP), greater than -+\fIct\fP (\fB+\fP), or equal to \fIct\fP -+.TP -+\fBU\fP -+files owned by the effective user ID -+.TP -+\fBG\fP -+files owned by the effective group ID -+.TP -+\fBu\fP\fIid\fP -+files owned by user ID \fIid\fP if that is a number\&. Otherwise, -+\fIid\fP specifies a user name: the -+character after the `\fBu\fP\&' will be taken as a separator and the string -+between it and the next matching separator will be taken as a user name\&. -+The starting separators `\fB[\fP\&', `\fB{\fP', and `\fB<\fP' -+match the final separators `\fB]\fP\&', `\fB}\fP', and `\fB>\fP', respectively; -+any other character matches itself\&. The selected files are those -+owned by this user\&. For example, `\fBu:foo:\fP\&' or `\fBu[foo]\fP' selects -+files owned by user `\fBfoo\fP\&'\&. -+.TP -+\fBg\fP\fIid\fP -+like \fBu\fP\fIid\fP but with group IDs or names -+.TP -+\fBa\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP -+files accessed exactly \fIn\fP days ago\&. Files accessed within the last -+\fIn\fP days are selected using a negative value for \fIn\fP (\fB\-\fP\fIn\fP)\&. -+Files accessed more than \fIn\fP days ago are selected by a positive \fIn\fP -+value (\fB+\fP\fIn\fP)\&. Optional unit specifiers `\fBM\fP\&', `\fBw\fP', -+`\fBh\fP\&', `\fBm\fP' or `\fBs\fP' (e\&.g\&. `\fBah5\fP') cause the check to be -+performed with months (of 30 days), weeks, hours, minutes or seconds -+instead of days, respectively\&. -+.RS -+.PP -+Any fractional part of the difference between the access time and the -+current part in the appropriate units is ignored in the comparison\&. For -+instance, `\fBecho *(ah\-5)\fP\&' would echo files accessed within the last -+five hours, while `\fBecho *(ah+5)\fP\&' would echo files accessed at least -+six hours ago, as times strictly between five and six hours are treated -+as five hours\&. -+.RE -+.TP -+\fBm\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP -+like the file access qualifier, except that it uses the file modification -+time\&. -+.TP -+\fBc\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP -+like the file access qualifier, except that it uses the file inode change -+time\&. -+.TP -+\fBL\fP[\fB+\fP|\fB\-\fP]\fIn\fP -+files less than \fIn\fP bytes (\fB\-\fP), more than \fIn\fP bytes (\fB+\fP), or -+exactly \fIn\fP bytes in length\&. -+.RS -+.PP -+If this flag is directly followed by a `\fBk\fP\&' (`\fBK\fP'), `\fBm\fP' -+(`\fBM\fP\&'), or `\fBp\fP' (`\fBP\fP') (e\&.g\&. `\fBLk\-50\fP') the check is performed -+with kilobytes, megabytes, or blocks (of 512 bytes) instead\&. In this -+case a file is regarded as "exactly" the size if the file size rounded up -+to the next unit is equal to the test size\&. Hence `\fB*(Lm1)\fP\&' -+matches files from 1 byte up to 1 Megabyte inclusive\&. Note also that -+the set of files "less than" the test size only includes files that would -+not match the equality test; hence `\fB*(Lm\-1)\fP\&' only matches -+files of zero size\&. -+.RE -+.TP -+\fB^\fP -+negates all qualifiers following it -+.TP -+\fB\-\fP -+toggles between making the qualifiers work on symbolic links (the -+default) and the files they point to -+.TP -+\fBM\fP -+sets the \fBMARK_DIRS\fP option for the current pattern -+.TP -+\fBT\fP -+appends a trailing qualifier mark to the filenames, analogous to the -+\fBLIST_TYPES\fP option, for the current pattern (overrides \fBM\fP) -+.TP -+\fBN\fP -+sets the \fBNULL_GLOB\fP option for the current pattern -+.TP -+\fBD\fP -+sets the \fBGLOB_DOTS\fP option for the current pattern -+.TP -+\fBn\fP -+sets the \fBNUMERIC_GLOB_SORT\fP option for the current pattern -+.TP -+\fBo\fP\fIc\fP -+specifies how the names of the files should be sorted\&. If \fIc\fP is -+\fBn\fP they are sorted by name (the default); if it is \fBL\fP they -+are sorted depending on the size (length) of the files; if \fBl\fP -+they are sorted by the number of links; if \fBa\fP, \fBm\fP, or \fBc\fP -+they are sorted by the time of the last access, modification, or -+inode change respectively; if \fBd\fP, files in subdirectories appear before -+those in the current directory at each level of the search \-\- this is best -+combined with other criteria, for example `\fBodon\fP\&' to sort on names for -+files within the same directory; if \fBN\fP, no sorting is performed\&. -+Note that \fBa\fP, \fBm\fP, and \fBc\fP compare -+the age against the current time, hence the first name in the list is the -+youngest file\&. Also note that the modifiers \fB^\fP and \fB\-\fP are used, -+so `\fB*(^\-oL)\fP\&' gives a list of all files sorted by file size in descending -+order, following any symbolic links\&. Unless \fBoN\fP is used, multiple order -+specifiers may occur to resolve ties\&. -+.RS -+.PP -+\fBoe\fP and \fBo+\fP are special cases; they are each followed by shell code, -+delimited as for the \fBe\fP glob qualifier and the \fB+\fP glob qualifier -+respectively (see above)\&. The code is executed for each matched file with -+the parameter \fBREPLY\fP set to the name of the file on entry and -+\fBglobsort\fP appended to \fBzsh_eval_context\fP\&. The code -+should modify the parameter \fBREPLY\fP in some fashion\&. On return, the -+value of the parameter is used instead of the file name as the string on -+which to sort\&. Unlike other sort operators, \fBoe\fP and \fBo+\fP may be -+repeated, but note that the maximum number of sort operators of any kind -+that may appear in any glob expression is 12\&. -+.RE -+.TP -+\fBO\fP\fIc\fP -+like `\fBo\fP\&', but sorts in descending order; i\&.e\&. `\fB*(^oc)\fP' is the -+same as `\fB*(Oc)\fP\&' and `\fB*(^Oc)\fP' is the same as `\fB*(oc)\fP'; `\fBOd\fP' -+puts files in the current directory before those in subdirectories at each -+level of the search\&. -+.TP -+\fB[\fP\fIbeg\fP[\fB,\fP\fIend\fP]\fB]\fP -+specifies which of the matched filenames should be included in the -+returned list\&. The syntax is the same as for array -+subscripts\&. \fIbeg\fP and the optional \fIend\fP may be mathematical -+expressions\&. As in parameter subscripting they may be negative to make -+them count from the last match backward\&. E\&.g\&.: `\fB*(\-OL[1,3])\fP\&' -+gives a list of the names of the three largest files\&. -+.TP -+\fBP\fP\fIstring\fP -+The \fIstring\fP will be prepended to each glob match as a separate -+word\&. \fIstring\fP is delimited in the same way as arguments to the -+\fBe\fP glob qualifier described above\&. The qualifier can be repeated; -+the words are prepended separately so that the resulting command -+line contains the words in the same order they were given in the -+list of glob qualifiers\&. -+.RS -+.PP -+A typical use for this is to prepend an option before all occurrences -+of a file name; for example, the pattern `\fB*(P:\-f:)\fP\&' produces the -+command line arguments `\fB\-f\fP \fIfile1\fP \fB\-f\fP \fIfile2\fP \&.\&.\&.\&' -+.RE -+.RE -+.PP -+More than one of these lists can be combined, separated by commas\&. The -+whole list matches if at least one of the sublists matches (they are -+`or\&'ed, the qualifiers in the sublists are `and'ed)\&. Some qualifiers, -+however, affect all matches generated, independent of the sublist in -+which they are given\&. These are the qualifiers `\fBM\fP\&', `\fBT\fP', -+`\fBN\fP\&', `\fBD\fP', `\fBn\fP', `\fBo\fP', `\fBO\fP' and the subscripts given -+in brackets (`\fB[\&.\&.\&.]\fP\&')\&. -+.PP -+If a `\fB:\fP\&' appears in a qualifier list, the remainder of the expression in -+parenthesis is interpreted as a modifier (see the section `Modifiers\&' -+in the section `History Expansion\&')\&. Each modifier must be introduced by a -+separate `\fB:\fP\&'\&. Note also that the result after modification does not -+have to be an existing file\&. The name of any existing file can be followed -+by a modifier of the form `\fB(:\&.\&.)\fP\&' even if no actual filename generation -+is performed, although note that the presence of the parentheses -+causes the entire expression to be subjected to any global pattern matching -+options such as \fBNULL_GLOB\fP\&. Thus: -+.PP -+.RS -+.nf -+\fBls *(\-/)\fP -+.fi -+.RE -+.PP -+lists all directories and symbolic links that point to directories, -+and -+.PP -+.RS -+.nf -+\fBls *(%W)\fP -+.fi -+.RE -+.PP -+lists all world\-writable device files in the current directory, and -+.PP -+.RS -+.nf -+\fBls *(W,X)\fP -+.fi -+.RE -+.PP -+lists all files in the current directory that are -+world\-writable or world\-executable, and -+.PP -+.RS -+.nf -+\fBecho /tmp/foo*(u0^@:t)\fP -+.fi -+.RE -+.PP -+outputs the basename of all root\-owned files beginning with the string -+`\fBfoo\fP\&' in \fB/tmp\fP, ignoring symlinks, and -+.PP -+.RS -+.nf -+\fBls *\&.*~(lex|parse)\&.[ch](^D^l1)\fP -+.fi -+.RE -+.PP -+lists all files having a link count of one whose names contain a dot -+(but not those starting with a dot, since \fBGLOB_DOTS\fP is explicitly -+switched off) except for \fBlex\&.c\fP, \fBlex\&.h\fP, \fBparse\&.c\fP and \fBparse\&.h\fP\&. -+.PP -+.RS -+.nf -+\fBprint b*\&.pro(#q:s/pro/shmo/)(#q\&.:s/builtin/shmiltin/)\fP -+.fi -+.RE -+.PP -+demonstrates how colon modifiers and other qualifiers may be chained -+together\&. The ordinary qualifier `\fB\&.\fP\&' is applied first, then the colon -+modifiers in order from left to right\&. So if \fBEXTENDED_GLOB\fP is set and -+the base pattern matches the regular file \fBbuiltin\&.pro\fP, the shell will -+print `\fBshmiltin\&.shmo\fP\&'\&. ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/zshzle.1 -@@ -0,0 +1,2334 @@ -+.TH "ZSHZLE" "1" "April 19, 2011" "zsh 4\&.3\&.11-dev-2" -+.SH "NAME" -+zshzle \- zsh command line editor -+.\" Yodl file: Zsh/zle.yo -+.SH "DESCRIPTION" -+If the \fBZLE\fP option is set (which it is by default in interactive shells) -+and the shell input is attached to the terminal, the user -+is able to edit command lines\&. -+.PP -+There are two display modes\&. The first, multiline mode, is the -+default\&. It only works if the \fBTERM\fP parameter is set to a valid -+terminal type that can move the cursor up\&. The second, single line -+mode, is used if \fBTERM\fP is invalid or incapable of moving the -+cursor up, or if the \fBSINGLE_LINE_ZLE\fP option is set\&. -+This mode -+is similar to \fBksh\fP, and uses no termcap sequences\&. If \fBTERM\fP is -+"emacs", the \fBZLE\fP option will be unset by default\&. -+.PP -+The parameters \fBBAUD\fP, \fBCOLUMNS\fP, and \fBLINES\fP are also used by the -+line editor\&. -+See \fIParameters Used By The Shell\fP in \fIzshparam\fP(1)\&. -+.PP -+The parameter \fBzle_highlight\fP is also used by the line editor; -+see \fICharacter Highlighting\fP below\&. Highlighting -+of special characters and the region between the cursor and the -+mark (as set with \fBset\-mark\-command\fP in Emacs mode) is enabled -+by default; consult this reference for more information\&. Irascible -+conservatives will wish to know that all highlighting may be disabled by -+the following setting: -+.PP -+.RS -+.nf -+\fBzle_highlight=(none)\fP -+.fi -+.RE -+.PP -+.PP -+.SH "KEYMAPS" -+A keymap in ZLE contains a set of bindings between key sequences -+and ZLE commands\&. The empty key sequence cannot be bound\&. -+.PP -+There can be any number of keymaps at any time, and each keymap has one -+or more names\&. If all of a keymap\&'s names are deleted, it disappears\&. -+\fBbindkey\fP can be used to manipulate keymap names\&. -+.PP -+Initially, there are six keymaps: -+.PP -+.PD 0 -+.TP -+\fBemacs\fP -+EMACS emulation -+.TP -+\fBviins\fP -+vi emulation \- insert mode -+.TP -+\fBvicmd\fP -+vi emulation \- command mode -+.TP -+\fBisearch\fP -+incremental search mode -+.TP -+\fBcommand\fP -+read a command name -+.TP -+\fB\&.safe\fP -+fallback keymap -+.PD -+.PP -+The `\fB\&.safe\fP\&' keymap is special\&. It can never be altered, and the name -+can never be removed\&. However, it can be linked to other names, which can -+be removed\&. In the future other special keymaps may be added; users should -+avoid using names beginning with `\fB\&.\fP\&' for their own keymaps\&. -+.PP -+In addition to these names, either `\fBemacs\fP\&' or `\fBviins\fP' is -+also linked to the name `\fBmain\fP\&'\&. If one of the \fBVISUAL\fP or -+\fBEDITOR\fP environment variables contain the string `\fBvi\fP\&' when the shell -+starts up then it will be `\fBviins\fP\&', otherwise it will be `\fBemacs\fP'\&. -+\fBbindkey\fP\&'s \fB\-e\fP and \fB\-v\fP -+options provide a convenient way to override this default choice\&. -+.PP -+When the editor starts up, it will select the `\fBmain\fP\&' keymap\&. -+If that keymap doesn\&'t exist, it will use `\fB\&.safe\fP' instead\&. -+.PP -+In the `\fB\&.safe\fP\&' keymap, each single key is bound to \fBself\-insert\fP, -+except for ^J (line feed) and ^M (return) which are bound to \fBaccept\-line\fP\&. -+This is deliberately not pleasant to use; if you are using it, it -+means you deleted the main keymap, and you should put it back\&. -+.SS "Reading Commands" -+When ZLE is reading a command from the terminal, it may read a sequence -+that is bound to some command and is also a prefix of a longer bound string\&. -+In this case ZLE will wait a certain time to see if more characters -+are typed, and if not (or they don\&'t match any longer string) it will -+execute the binding\&. This timeout is defined by the \fBKEYTIMEOUT\fP parameter; -+its default is 0\&.4 sec\&. There is no timeout if the prefix string is not -+itself bound to a command\&. -+.PP -+The key timeout is also applied when ZLE is reading the bytes from a -+multibyte character string when it is in the appropriate mode\&. (This -+requires that the shell was compiled with multibyte mode enabled; typically -+also the locale has characters with the UTF\-8 encoding, although any -+multibyte encoding known to the operating system is supported\&.) If the -+second or a subsequent byte is not read within the timeout period, the -+shell acts as if \fB?\fP were typed and resets the input state\&. -+.PP -+As well as ZLE commands, key sequences can be bound to other strings, by using -+`\fBbindkey \-s\fP\&'\&. -+When such a sequence is read, the replacement string is pushed back as input, -+and the command reading process starts again using these fake keystrokes\&. -+This input can itself invoke further replacement strings, but in order to -+detect loops the process will be stopped if there are twenty such replacements -+without a real command being read\&. -+.PP -+A key sequence typed by the user can be turned into a command name for use -+in user\-defined widgets with the \fBread\-command\fP widget, described -+below\&. -+.PP -+.SH "ZLE BUILTINS" -+The ZLE module contains three related builtin commands\&. The \fBbindkey\fP -+command manipulates keymaps and key bindings; the \fBvared\fP command invokes -+ZLE on the value of a shell parameter; and the \fBzle\fP command manipulates -+editing widgets and allows command line access to ZLE commands from within -+shell functions\&. -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-l\fP [ \fB\-L\fP ] [ \fIkeymap\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-d\fP -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-D\fP \fIkeymap\fP \&.\&.\&. -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-A\fP \fIold\-keymap new\-keymap\fP -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ] -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-m\fP -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-r\fP \fIin\-string\fP \&.\&.\&. -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&. -+.TP -+.PD 0 -+\fBbindkey\fP [ \fIoptions\fP ] \fIin\-string command\fP \&.\&.\&. -+.TP -+.PD -+\fBbindkey\fP [ \fIoptions\fP ] [ \fIin\-string\fP ] -+\fBbindkey\fP\&'s options can be divided into three categories: keymap -+selection for the current command, operation selection, and others\&. The -+keymap selection options are: -+.RS -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-e\fP -+Selects keymap `\fBemacs\fP\&' for any operations by the current command, -+and also links `\fBemacs\fP\&' to `\fBmain\fP' so that it is selected by -+default the next time the editor starts\&. -+.TP -+\fB\-v\fP -+Selects keymap `\fBviins\fP\&' for any operations by the current command, -+and also links `\fBviins\fP\&' to `\fBmain\fP' so that it is selected by default -+the next time the editor starts\&. -+.TP -+\fB\-a\fP -+Selects keymap `\fBvicmd\fP\&' for any operations by the current command\&. -+.TP -+\fB\-M\fP \fIkeymap\fP -+The \fIkeymap\fP specifies a keymap name that is selected for any -+operations by the current command\&. -+.PP -+If a keymap selection is required and none of the options above are used, the -+`\fBmain\fP\&' keymap is used\&. Some operations do not permit a keymap to be -+selected, namely: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-l\fP -+List all existing keymap names; if any arguments are given, list just -+those keymaps\&. -+.RS -+.PP -+If the \fB\-L\fP option is also used, list in the form of \fBbindkey\fP -+commands to create or link the keymaps\&. `\fBbindkey \-lL -+main\fP\&' shows which keymap is linked to `\fBmain\fP', if any, and hence if -+the standard emacs or vi emulation is in effect\&. This option does -+not show the \fB\&.safe\fP keymap because it cannot be created in that -+fashion; however, neither is `\fBbindkey \-lL \&.safe\fP\&' reported as an -+error, it simply outputs nothing\&. -+.RE -+.TP -+\fB\-d\fP -+Delete all existing keymaps and reset to the default state\&. -+.TP -+\fB\-D\fP \fIkeymap\fP \&.\&.\&. -+Delete the named \fIkeymap\fPs\&. -+.TP -+\fB\-A\fP \fIold\-keymap new\-keymap\fP -+Make the \fInew\-keymap\fP name an alias for \fIold\-keymap\fP, so that -+both names refer to the same keymap\&. The names have equal standing; -+if either is deleted, the other remains\&. If there is already a keymap -+with the \fInew\-keymap\fP name, it is deleted\&. -+.TP -+\fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ] -+Create a new keymap, named \fInew\-keymap\fP\&. If a keymap already has that -+name, it is deleted\&. If an \fIold\-keymap\fP name is given, the new keymap -+is initialized to be a duplicate of it, otherwise the new keymap will -+be empty\&. -+.PP -+To use a newly created keymap, it should be linked to \fBmain\fP\&. Hence -+the sequence of commands to create and use a new keymap `\fBmymap\fP\&' -+initialized from the \fBemacs\fP keymap (which remains unchanged) is: -+.PP -+.RS -+.nf -+\fBbindkey \-N mymap emacs -+bindkey \-A mymap main\fP -+.fi -+.RE -+.PP -+Note that while `\fBbindkey \-A\fP \fInewmap\fP \fBmain\fP\&' will work when -+\fInewmap\fP is \fBemacs\fP or \fBviins\fP, it will not work for \fBvicmd\fP, as -+switching from vi insert to command mode becomes impossible\&. -+.PP -+The following operations act on the `\fBmain\fP\&' keymap if no keymap -+selection option was given: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-m\fP -+Add the built\-in set of meta\-key bindings to the selected keymap\&. -+Only keys that are unbound or bound to \fBself\-insert\fP are affected\&. -+.TP -+\fB\-r\fP \fIin\-string\fP \&.\&.\&. -+Unbind the specified \fIin\-string\fPs in the selected keymap\&. -+This is exactly equivalent to binding the strings to \fBundefined\-key\fP\&. -+.RS -+.PP -+When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&. -+.PP -+When \fB\-p\fP is also used, the \fIin\-string\fPs specify prefixes\&. Any -+binding that has the given \fIin\-string\fP as a prefix, not including the -+binding for the \fIin\-string\fP itself, if any, will be removed\&. For -+example, -+.PP -+.RS -+.nf -+\fBbindkey \-rpM viins \&'^['\fP -+.fi -+.RE -+.PP -+will remove all bindings in the vi\-insert keymap beginning with an escape -+character (probably cursor keys), but leave the binding for the escape -+character itself (probably \fBvi\-cmd\-mode\fP)\&. This is incompatible with the -+option \fB\-R\fP\&. -+.RE -+.TP -+\fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&. -+Bind each \fIin\-string\fP to each \fIout\-string\fP\&. -+When \fIin\-string\fP is typed, \fIout\-string\fP will be -+pushed back and treated as input to the line editor\&. -+When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&. -+.TP -+\fIin\-string command\fP \&.\&.\&. -+Bind each \fIin\-string\fP to each \fIcommand\fP\&. -+When \fB\-R\fP is used, interpret the \fIin\-string\fPs as ranges\&. -+.TP -+[ \fIin\-string\fP ] -+List key bindings\&. If an \fIin\-string\fP is specified, the binding of -+that string in the selected keymap is displayed\&. Otherwise, all key -+bindings in the selected keymap are displayed\&. (As a special case, -+if the \fB\-e\fP or \fB\-v\fP option is used alone, the keymap is \fInot\fP -+displayed \- the implicit linking of keymaps is the only thing that -+happens\&.) -+.RS -+.PP -+When the option \fB\-p\fP is used, the \fIin\-string\fP must be present\&. -+The listing shows all bindings which have the given key sequence as a -+prefix, not including any bindings for the key sequence itself\&. -+.PP -+When the \fB\-L\fP option is used, the list is in the form of \fBbindkey\fP -+commands to create the key bindings\&. -+.RE -+.RE -+.PP -+When the \fB\-R\fP option is used as noted above, a valid range consists of -+two characters, with an optional `\fB\-\fP\&' between them\&. All characters -+between the two specified, inclusive, are bound as specified\&. -+.PP -+For either \fIin\-string\fP or \fIout\-string\fP, the following -+escape sequences are recognised: -+.PP -+.PD 0 -+.TP -+\fB\ea\fP -+bell character -+.TP -+\fB\eb\fP -+backspace -+.TP -+\fB\ee\fP, \fB\eE\fP -+escape -+.TP -+\fB\ef\fP -+form feed -+.TP -+\fB\en\fP -+linefeed (newline) -+.TP -+\fB\er\fP -+carriage return -+.TP -+\fB\et\fP -+horizontal tab -+.TP -+\fB\ev\fP -+vertical tab -+.TP -+\fB\e\fP\fINNN\fP -+character code in octal -+.TP -+\fB\ex\fP\fINN\fP -+character code in hexadecimal -+.TP -+\fB\eM\fP[\fB\-\fP]\fIX\fP -+character with meta bit set -+.TP -+\fB\eC\fP[\fB\-\fP]\fIX\fP -+control character -+.TP -+\fB^\fP\fIX\fP -+control character -+.PD -+.PP -+In all other cases, `\fB\e\fP\&' escapes the following character\&. Delete is -+written as `\fB^?\fP\&'\&. Note that `\fB\eM^?\fP' and `\fB^\eM?\fP' are not the same, -+and that (unlike emacs), the bindings `\fB\eM\-\fP\fIX\fP\&' and `\fB\ee\fP\fIX\fP' -+are entirely distinct, although they are initialized to the same bindings -+by `\fBbindkey \-m\fP\&'\&. -+.RE -+.TP -+.PD 0 -+\fBvared\fP [ \fB\-Aache\fP ] [ \fB\-p\fP \fIprompt\fP ] [ \fB\-r\fP \fIrprompt\fP ] -+.TP -+.PD 0 -+ [ \fB\-M\fP \fImain\-keymap\fP ] [ \fB\-m\fP \fIvicmd\-keymap\fP ] -+.TP -+.PD -+ [ \fB\-t\fP \fItty\fP ] \fIname\fP -+The value of the parameter \fIname\fP is loaded into the edit -+buffer, and the line editor is invoked\&. When the editor exits, -+\fIname\fP is set to the string value returned by the editor\&. -+When the \fB\-c\fP flag is given, the parameter is created if it doesn\&'t -+already exist\&. The \fB\-a\fP flag may be given with \fB\-c\fP to create -+an array parameter, or the \fB\-A\fP flag to create an associative array\&. -+If the type of an existing parameter does not match the type to be -+created, the parameter is unset and recreated\&. -+.RS -+.PP -+If an array or array slice is being edited, separator characters as defined -+in \fB$IFS\fP will be shown quoted with a backslash, as will backslashes -+themselves\&. Conversely, when the edited text is split into an array, a -+backslash quotes an immediately following separator character or backslash; -+no other special handling of backslashes, or any handling of quotes, is -+performed\&. -+.PP -+Individual elements of existing array or associative array parameters -+may be edited by using subscript syntax on \fIname\fP\&. New elements are -+created automatically, even without \fB\-c\fP\&. -+.PP -+If the \fB\-p\fP flag is given, the following string will be taken as -+the prompt to display at the left\&. If the \fB\-r\fP flag is given, -+the following string gives the prompt to display at the right\&. If the -+\fB\-h\fP flag is specified, the history can be accessed from ZLE\&. If the -+\fB\-e\fP flag is given, typing \fB^D\fP (Control\-D) on an empty line -+causes \fBvared\fP to exit immediately with a non\-zero return value\&. -+.PP -+The \fB\-M\fP option gives a keymap to link to the \fBmain\fP keymap during -+editing, and the \fB\-m\fP option gives a keymap to link to the \fBvicmd\fP -+keymap during editing\&. For vi\-style editing, this allows a pair of keymaps -+to override \fBviins\fP and \fBvicmd\fP\&. For emacs\-style editing, only \fB\-M\fP -+is normally needed but the \fB\-m\fP option may still be used\&. On exit, the -+previous keymaps will be restored\&. -+.PP -+If `\fB\-t\fP \fItty\fP\&' is given, \fItty\fP is the name of a terminal device -+to be used instead of the default \fB/dev/tty\fP\&. If \fItty\fP does not -+refer to a terminal an error is reported\&. -+.RE -+.TP -+.PD 0 -+\fBzle\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ] [ \fIstring\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fBzle\fP \fB\-D\fP \fIwidget\fP \&.\&.\&. -+.TP -+.PD 0 -+\fBzle\fP \fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-N\fP \fIwidget\fP [ \fIfunction\fP ] -+.TP -+.PD 0 -+\fBzle\fP \fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ] -+.TP -+.PD 0 -+\fBzle\fP \fB\-M\fP \fIstring\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-U\fP \fIstring\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-K\fP \fIkeymap\fP -+.TP -+.PD 0 -+\fBzle\fP \fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ] -+.TP -+.PD 0 -+\fBzle\fP \fB\-I\fP -+.TP -+.PD -+\fBzle\fP \fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-Nw ] [ \-K\fP \fIkeymap\fP \fB]\fP \fIargs\fP \&.\&.\&. -+The \fBzle\fP builtin performs a number of different actions concerning -+ZLE\&. -+.RS -+.PP -+With no options and no arguments, only the return status will be -+set\&. It is zero if ZLE is currently active and widgets could be -+invoked using this builtin command and non\-zero otherwise\&. -+Note that even if non\-zero status is returned, zle may still be active as -+part of the completion system; this does not allow direct calls to ZLE -+widgets\&. -+.PP -+Otherwise, which operation it performs depends on its options: -+.PP -+.PD 0 -+.TP -+.PD -+\fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ] -+List all existing user\-defined widgets\&. If the \fB\-L\fP -+option is used, list in the form of \fBzle\fP -+commands to create the widgets\&. -+.RS -+.PP -+When combined with the \fB\-a\fP option, all widget names are listed, -+including the builtin ones\&. In this case the \fB\-L\fP option is ignored\&. -+.PP -+If at least one \fIstring\fP is given, nothing will be printed but the -+return status will be zero if all \fIstring\fPs are names of existing -+widgets (or of user\-defined widgets if the \fB\-a\fP flag is not given) -+and non\-zero if at least one \fIstring\fP is not a name of an defined -+widget\&. -+.RE -+.TP -+\fB\-D\fP \fIwidget\fP \&.\&.\&. -+Delete the named \fIwidget\fPs\&. -+.TP -+\fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP -+Make the \fInew\-widget\fP name an alias for \fIold\-widget\fP, so that -+both names refer to the same widget\&. The names have equal standing; -+if either is deleted, the other remains\&. If there is already a widget -+with the \fInew\-widget\fP name, it is deleted\&. -+.TP -+\fB\-N\fP \fIwidget\fP [ \fIfunction\fP ] -+Create a user\-defined widget\&. If there is already a widget with the -+specified name, it is overwritten\&. When the new -+widget is invoked from within the editor, the specified shell \fIfunction\fP -+is called\&. If no function name is specified, it defaults to -+the same name as the widget\&. For further information, see the section -+\fIWidgets\fP in -+\fIzshzle\fP(1)\&. -+.TP -+\fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP -+Create a user\-defined completion widget named \fIwidget\fP\&. The -+completion widget will behave like the built\-in completion\-widget -+whose name is given as \fIcompletion\-widget\fP\&. To generate the -+completions, the shell function \fIfunction\fP will be called\&. -+For further information, see -+\fIzshcompwid\fP(1)\&. -+.TP -+\fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ] -+Redisplay the command line; this is to be called from within a user\-defined -+widget to allow changes to become visible\&. If a \fIdisplay\-string\fP is -+given and not empty, this is shown in the status line (immediately -+below the line being edited)\&. -+.RS -+.PP -+If the optional \fIstring\fPs are given they are listed below the -+prompt in the same way as completion lists are printed\&. If no -+\fIstring\fPs are given but the \fB\-c\fP option is used such a list is -+cleared\&. -+.PP -+Note that this option is only useful for widgets that do not exit -+immediately after using it because the strings displayed will be erased -+immediately after return from the widget\&. -+.PP -+This command can safely be called outside user defined widgets; if zle is -+active, the display will be refreshed, while if zle is not active, the -+command has no effect\&. In this case there will usually be no other -+arguments\&. -+.PP -+The status is zero if zle was active, else one\&. -+.RE -+.TP -+\fB\-M\fP \fIstring\fP -+As with the \fB\-R\fP option, the \fIstring\fP will be displayed below the -+command line; unlike the \fB\-R\fP option, the string will not be put into -+the status line but will instead be printed normally below the -+prompt\&. This means that the \fIstring\fP will still be displayed after -+the widget returns (until it is overwritten by subsequent commands)\&. -+.TP -+\fB\-U\fP \fIstring\fP -+This pushes the characters in the \fIstring\fP onto the input stack of -+ZLE\&. After the widget currently executed finishes ZLE will behave as -+if the characters in the \fIstring\fP were typed by the user\&. -+.RS -+.PP -+As ZLE uses a stack, if this option is used repeatedly -+the last string pushed onto the stack will be processed first\&. However, -+the characters in each \fIstring\fP will be processed in the order in which -+they appear in the string\&. -+.RE -+.TP -+\fB\-K\fP \fIkeymap\fP -+Selects the keymap named \fIkeymap\fP\&. An error message will be displayed if -+there is no such keymap\&. -+.RS -+.PP -+This keymap selection affects the interpretation of following keystrokes -+within this invocation of ZLE\&. Any following invocation (e\&.g\&., the next -+command line) will start as usual with the `\fBmain\fP\&' keymap selected\&. -+.RE -+.TP -+\fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ] -+Only available if your system supports one of the `poll\&' or `select' system -+calls; most modern systems do\&. -+.RS -+.PP -+Installs \fIhandler\fP (the name of a shell function) to handle input from -+file descriptor \fIfd\fP\&. When zle is attempting to read data, it will -+examine both the terminal and the list of handled \fIfd\fP\&'s\&. If data -+becomes available on a handled \fIfd\fP, zle will call \fIhandler\fP with -+the fd which is ready for reading as the only argument\&. If the handler -+produces output to the terminal, it should call `\fBzle \-I\fP\&' before doing -+so (see below)\&. The handler should not attempt to read from the terminal\&. -+Note that zle makes no attempt to check whether this fd is actually -+readable when installing the handler\&. The user must make their own -+arrangements for handling the file descriptor when zle is not active\&. -+.PP -+Any number of handlers for any number of readable file descriptors may be -+installed\&. Installing a handler for an \fIfd\fP which is already handled -+causes the existing handler to be replaced\&. -+.PP -+If no \fIhandler\fP is given, but an \fIfd\fP is present, any handler for -+that \fIfd\fP is removed\&. If there is none, an error message is printed -+and status 1 is returned\&. -+.PP -+If no arguments are given, or the \fB\-L\fP option is supplied, a list of -+handlers is printed in a form which can be stored for later execution\&. -+.PP -+An \fIfd\fP (but not a \fIhandler\fP) may optionally be given with the \fB\-L\fP -+option; in this case, the function will list the handler if any, else -+silently return status 1\&. -+.PP -+Note that this feature should be used with care\&. Activity on one of the -+\fIfd\fP\&'s which is not properly handled can cause the terminal to become -+unusable\&. -+.PP -+Here is a simple example of using this feature\&. A connection to a remote -+TCP port is created using the ztcp command; see -+the description of the \fBzsh/net/tcp\fP module in \fIzshmodules\fP(1)\&. Then a handler is installed -+which simply prints out any data which arrives on this connection\&. Note -+that `select\&' will indicate that the file descriptor needs handling -+if the remote side has closed the connection; we handle that by testing -+for a failed read\&. -+.RS -+.nf -+\fBif ztcp pwspc 2811; then -+ tcpfd=$REPLY -+ handler() { -+ zle \-I -+ local line -+ if ! read \-r line <&$1; then -+ # select marks this fd if we reach EOF, -+ # so handle this specially\&. -+ print "[Read on fd $1 failed, removing\&.]" >&2 -+ zle \-F $1 -+ return 1 -+ fi -+ print \-r \- $line -+ } -+ zle \-F $tcpfd handler -+fi\fP -+.fi -+.RE -+.RE -+.TP -+\fB\-I\fP -+Unusually, this option is most useful outside ordinary widget functions, -+though it may be used within if normal output to the terminal is required\&. -+It invalidates the current zle display in preparation for output; typically -+this will be from a trap function\&. It has no effect if zle is not -+active\&. When a trap exits, the shell checks to see if the display needs -+restoring, hence the following will print output in such a way as not to -+disturb the line being edited: -+.RS -+.PP -+.RS -+.nf -+\fBTRAPUSR1() { -+ # Invalidate zle display -+ [[ \-o zle ]] && zle \-I -+ # Show output -+ print Hello -+}\fP -+.fi -+.RE -+.PP -+In general, the trap function may need to test whether zle is active before -+using this method (as shown in the example), since the \fBzsh/zle\fP module -+may not even be loaded; if it is not, the command can be skipped\&. -+.PP -+It is possible to call `\fBzle \-I\fP\&' several times before control is -+returned to the editor; the display will only be invalidated the first time -+to minimise disruption\&. -+.PP -+Note that there are normally better ways of manipulating the display from -+within zle widgets; see, for example, `\fBzle \-R\fP\&' above\&. -+.PP -+The returned status is zero if zle was invalidated, even though -+this may have been by a previous call to `\fBzle \-I\fP\&' or by a system -+notification\&. To test if a zle widget may be called at this point, execute -+\fBzle\fP with no arguments and examine the return status\&. -+.RE -+.TP -+\fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-Nw ] [ \-K\fP \fIkeymap\fP \fB]\fP \fIargs\fP \&.\&.\&. -+Invoke the specified widget\&. This can only be done when ZLE is -+active; normally this will be within a user\-defined widget\&. -+.RS -+.PP -+With the options \fB\-n\fP and \fB\-N\fP, the current numerical argument will be -+saved and then restored after the call to \fBwidget\fP; `\fB\-n\fP \fInum\fP\&' -+sets the numerical argument temporarily to \fInum\fP, while `\fB\-N\fP\&' sets it -+to the default, i\&.e\&. as if there were none\&. -+.PP -+With the option \fB\-K\fP, \fIkeymap\fP will be used as the current keymap -+during the execution of the widget\&. The previous keymap will be -+restored when the widget exits\&. -+.PP -+Normally, calling a widget in this way does not set the special -+parameter \fBWIDGET\fP and related parameters, so that the environment -+appears as if the top\-level widget called by the user were still -+active\&. With the option \fB\-w\fP, \fBWIDGET\fP and related parameters are set -+to reflect the widget being executed by the \fBzle\fP call\&. -+.PP -+Any further arguments will be passed to the widget; note that as -+standard argument handling is performed, any general argument list -+should be preceded by \fB\-\fP\fB\-\fP\&. If it is a shell -+function, these are passed down as positional parameters; for builtin -+widgets it is up to the widget in question what it does with them\&. -+Currently arguments are only handled by the incremental\-search commands, -+the \fBhistory\-search\-forward\fP and \fB\-backward\fP and the corresponding -+functions prefixed by \fBvi\-\fP, and by \fBuniversal\-argument\fP\&. No error is -+flagged if the command does not use the arguments, or only uses some of -+them\&. -+.PP -+The return status reflects the success or failure of the operation carried -+out by the widget, or if it is a user\-defined widget the return status of -+the shell function\&. -+.PP -+A non\-zero return status causes the shell to beep when the widget exits, -+unless the \fBBEEP\fP options was unset or the widget was called via the -+\fBzle\fP command\&. Thus if a user defined widget requires an immediate beep, -+it should call the \fBbeep\fP widget directly\&. -+.RE -+.RE -+.RE -+.RE -+.PP -+.SH "WIDGETS" -+All actions in the editor are performed by `widgets\&'\&. A widget's job is -+simply to perform some small action\&. The ZLE commands that key sequences -+in keymaps are bound to are in fact widgets\&. Widgets can be user\-defined -+or built in\&. -+.PP -+The standard widgets built into ZLE are listed in Standard Widgets below\&. -+Other built\-in widgets can be defined by other modules (see -+\fIzshmodules\fP(1))\&. Each built\-in widget has two names: its normal canonical name, and the -+same name preceded by a `\fB\&.\fP\&'\&. The `\fB\&.\fP' name is special: it can't be -+rebound to a different widget\&. This makes the widget available even when -+its usual name has been redefined\&. -+.PP -+User\-defined widgets are defined using `\fBzle \-N\fP\&', and implemented -+as shell functions\&. When the widget is executed, the corresponding -+shell function is executed, and can perform editing (or other) actions\&. -+It is recommended that user\-defined widgets should not have names -+starting with `\fB\&.\fP\&'\&. -+.SH "USER\e\-DEFINED WIDGETS" -+User\-defined widgets, being implemented as shell functions, -+can execute any normal shell command\&. They can also run other widgets -+(whether built\-in or user\-defined) using the \fBzle\fP builtin command\&. -+The standard input of the function is closed to prevent external commands -+from unintentionally blocking ZLE by reading from the terminal, but -+\fBread \-k\fP or \fBread \-q\fP can be used to read characters\&. Finally, -+they can examine and edit the ZLE buffer being edited by -+reading and setting the special parameters described below\&. -+.PP -+These special parameters are always available in widget functions, but -+are not in any way special outside ZLE\&. If they have some normal value -+outside ZLE, that value is temporarily inaccessible, but will return -+when the widget function exits\&. These special parameters in fact have -+local scope, like parameters created in a function using \fBlocal\fP\&. -+.PP -+Inside completion widgets and traps called while ZLE is active, these -+parameters are available read\-only\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBBUFFER\fP (scalar) -+The entire contents of the edit buffer\&. If it is written to, the -+cursor remains at the same offset, unless that would put it outside the -+buffer\&. -+.TP -+\fBBUFFERLINES\fP (integer) -+The number of screen lines needed for the edit buffer currently -+displayed on screen (i\&.e\&. without any changes to the preceding -+parameters done after the last redisplay); read\-only\&. -+.TP -+\fBCONTEXT\fP (scalar) -+The context in which zle was called to read a line; read\-only\&. One of -+the values: -+.PD 0 -+.TP -+.PD -+start -+The start of a command line (at prompt \fBPS1\fP)\&. -+.TP -+cont -+A continuation to a command line (at prompt \fBPS2\fP)\&. -+.TP -+select -+In a \fBselect\fP loop\&. -+.TP -+vared -+Editing a variable in \fBvared\fP\&. -+.RE -+.TP -+\fBCURSOR\fP (integer) -+The offset of the cursor, within the edit buffer\&. This is in the range -+0 to \fB$#BUFFER\fP, and is by definition equal to \fB$#LBUFFER\fP\&. -+Attempts to move the cursor outside the buffer will result in the -+cursor being moved to the appropriate end of the buffer\&. -+.TP -+\fBCUTBUFFER\fP (scalar) -+The last item cut using one of the `\fBkill\-\fP\&' commands; the string -+which the next yank would insert in the line\&. Later entries in -+the kill ring are in the array \fBkillring\fP\&. Note that the -+command `\fBzle copy\-region\-as\-kill\fP \fIstring\fP\&' can be used to -+set the text of the cut buffer from a shell function and cycle the kill -+ring in the same way as interactively killing text\&. -+.TP -+\fBHISTNO\fP (integer) -+The current history number\&. Setting this has the same effect as -+moving up or down in the history to the corresponding history line\&. -+An attempt to set it is ignored if the line is not stored in the -+history\&. Note this is not the same as the parameter \fBHISTCMD\fP, -+which always gives the number of the history line being added to the main -+shell\&'s history\&. \fBHISTNO\fP refers to the line being retrieved within -+zle\&. -+.TP -+\fBKEYMAP\fP (scalar) -+The name of the currently selected keymap; read\-only\&. -+.TP -+\fBKEYS\fP (scalar) -+The keys typed to invoke this widget, as a literal string; read\-only\&. -+.TP -+\fBkillring\fP (array) -+The array of previously killed items, with the most recently killed first\&. -+This gives the items that would be retrieved by a \fByank\-pop\fP in the -+same order\&. Note, however, that the most recently killed item is in -+\fB$CUTBUFFER\fP; \fB$killring\fP shows the array of previous entries\&. -+.RS -+.PP -+The default size for the kill ring is eight, however the length may be -+changed by normal array operations\&. Any empty string in the kill ring is -+ignored by the \fByank\-pop\fP command, hence the size of the array -+effectively sets the maximum length of the kill ring, while the number of -+non\-zero strings gives the current length, both as seen by the user at the -+command line\&. -+.RE -+.TP -+\fBLASTABORTEDSEARCH\fP (scalar) -+The last search string used by an interactive search that was -+aborted by the user (status 3 returned by the search widget)\&. -+.TP -+\fBLASTSEARCH\fP (scalar) -+The last search string used by an interactive search; read\-only\&. -+This is set even if the search failed (status 0, 1 or 2 returned -+by the search widget), but not if it was aborted by the user\&. -+.TP -+\fBLASTWIDGET\fP (scalar) -+The name of the last widget that was executed; read\-only\&. -+.TP -+\fBLBUFFER\fP (scalar) -+The part of the buffer that lies to the left of the cursor position\&. -+If it is assigned to, only that part of the buffer is replaced, and the -+cursor remains between the new \fB$LBUFFER\fP and the old \fB$RBUFFER\fP\&. -+.TP -+\fBMARK\fP (integer) -+Like \fBCURSOR\fP, but for the mark\&. -+.TP -+\fBNUMERIC\fP (integer) -+The numeric argument\&. If no numeric argument was given, this parameter -+is unset\&. When this is set inside a widget function, builtin widgets -+called with the \fBzle\fP builtin command will use the value -+assigned\&. If it is unset inside a widget function, builtin widgets -+called behave as if no numeric argument was given\&. -+.TP -+\fBPENDING\fP (integer) -+The number of bytes pending for input, i\&.e\&. the number of bytes which have -+already been typed and can immediately be read\&. On systems where the shell -+is not able to get this information, this parameter will always have a -+value of zero\&. Read\-only\&. -+.TP -+\fBPREBUFFER\fP (scalar) -+In a multi\-line input at the secondary prompt, this read\-only parameter -+contains the contents of the lines before the one the cursor is -+currently in\&. -+.TP -+\fBPREDISPLAY\fP (scalar) -+Text to be displayed before the start of the editable text buffer\&. This -+does not have to be a complete line; to display a complete line, a newline -+must be appended explicitly\&. The text is reset on each new invocation -+(but not recursive invocation) of zle\&. -+.TP -+\fBPOSTDISPLAY\fP (scalar) -+Text to be displayed after the end of the editable text buffer\&. This -+does not have to be a complete line; to display a complete line, a newline -+must be prepended explicitly\&. The text is reset on each new invocation -+(but not recursive invocation) of zle\&. -+.TP -+\fBRBUFFER\fP (scalar) -+The part of the buffer that lies to the right of the cursor position\&. -+If it is assigned to, only that part of the buffer is replaced, and the -+cursor remains between the old \fB$LBUFFER\fP and the new \fB$RBUFFER\fP\&. -+.TP -+\fBREGION_ACTIVE\fP (integer) -+Indicates if the region is currently active\&. It can be assigned 0 or 1 -+to deactivate and activate the region respectively; -+see \fICharacter Highlighting\fP below\&. -+.TP -+\fBregion_highlight\fP (array) -+Each element of this array may be set to a string that describes -+highlighting for an arbitrary region of the command line that will -+take effect the next time the command line is redisplayed\&. Highlighting -+of the non\-editable parts of the command line in \fBPREDISPLAY\fP -+and \fBPOSTDISPLAY\fP are possible, but note that the \fBP\fP flag -+is needed for character indexing to include \fBPREDISPLAY\fP\&. -+.RS -+.PP -+Each string consists of the following parts: -+.PP -+.PD 0 -+.TP -+Optionally, a `\fBP\fP\&' to signify that the start and end offset that -+follow include any string set by the \fBPREDISPLAY\fP special parameter; -+this is needed if the predisplay string itself is to be highlighted\&. -+Whitespace may follow the `\fBP\fP\&'\&. -+.TP -+A start offset in the same units as \fBCURSOR\fP, terminated by -+whitespace\&. -+.TP -+An end offset in the same units as \fBCURSOR\fP, terminated by -+whitespace\&. -+.TP -+A highlight specification in the same format as -+used for contexts in the parameter \fBzle_highlight\fP, -+see Character Highlighting below; -+for example, \fBstandout\fP or \fBfg=red,bold\fP\&. -+.PD -+.PP -+For example, -+.PP -+.RS -+.nf -+\fBregion_highlight=("P0 20 bold")\fP -+.fi -+.RE -+.PP -+specifies that the first twenty characters of the text including -+any predisplay string should be highlighted in bold\&. -+.PP -+Note that the effect of \fBregion_highlight\fP is not saved and disappears -+as soon as the line is accepted\&. -+.RE -+.TP -+\fBWIDGET\fP (scalar) -+The name of the widget currently being executed; read\-only\&. -+.TP -+\fBWIDGETFUNC\fP (scalar) -+The name of the shell function that implements a widget defined with -+either \fBzle \-N\fP or \fBzle \-C\fP\&. In the former case, this is the second -+argument to the \fBzle \-N\fP command that defined the widget, or -+the first argument if there was no second argument\&. In the latter case -+this is the the third argument to the \fBzle \-C\fP command that defined the -+widget\&. Read\-only\&. -+.TP -+\fBWIDGETSTYLE\fP (scalar) -+Describes the implementation behind the completion widget currently being -+executed; the second argument that followed \fBzle \-C\fP when the widget was -+defined\&. This is the name of a builtin completion widget\&. For widgets -+defined with \fBzle \-N\fP this is set to the empty string\&. Read\-only\&. -+.TP -+\fBZLE_STATE\fP (scalar) -+Contains a set of space\-separated words that describe the current \fBzle\fP -+state\&. -+.RS -+.PP -+Currently, the only state shown is the insert mode as set by the -+\fBoverwrite\-mode\fP or \fBvi\-replace\fP widgets\&. The string contains -+`\fBinsert\fP\&' if characters to be inserted on the command line move existing -+characters to the right, `\fBoverwrite\fP\&' if characters to be inserted -+overwrite existing characters\&. -+.RE -+.RE -+.PP -+.SS "Special Widgets" -+.PP -+There are a few user\-defined widgets which are special to the shell\&. -+If they do not exist, no special action is taken\&. The environment -+provided is identical to that for any other editing widget\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBzle\-isearch\-exit\fP -+Executed at the end of incremental search at the point where the isearch -+prompt is removed from the display\&. See \fBzle\-isearch\-update\fP for -+an example\&. -+.TP -+\fBzle\-isearch\-update\fP -+Executed within incremental search when the display is about to be -+redrawn\&. Additional output below the incremental search prompt can be -+generated by using `\fBzle \-M\fP\&' within the widget\&. For example, -+.RS -+.PP -+.RS -+.nf -+\fBzle\-isearch\-update() { zle \-M "Line $HISTNO"; } -+zle \-N zle\-isearch\-update\fP -+.fi -+.RE -+.PP -+Note the line output by `\fBzle \-M\fP\&' is not deleted on exit from -+incremental search\&. This can be done from a \fBzle\-isearch\-exit\fP -+widget: -+.PP -+.RS -+.nf -+\fBzle\-isearch\-exit() { zle \-M ""; } -+zle \-N zle\-isearch\-exit\fP -+.fi -+.RE -+.RE -+.TP -+\fBzle\-line\-init\fP -+Executed every time the line editor is started to read a new line -+of input\&. The following example puts the line editor into vi command -+mode when it starts up\&. -+.RS -+.PP -+.RS -+.nf -+\fBzle\-line\-init() { zle \-K vicmd; } -+zle \-N zle\-line\-init\fP -+.fi -+.RE -+.PP -+(The command inside the function sets the keymap directly; it is -+equivalent to \fBzle vi\-cmd\-mode\fP\&.) -+.RE -+.TP -+\fBzle\-line\-finish\fP -+This is similar to \fBzle\-line\-init\fP but is executed every time the -+line editor has finished reading a line of input\&. -+.TP -+\fBzle\-history\-line\-set\fP -+Executed when the history line changes\&. -+.TP -+\fBzle\-keymap\-select\fP -+Executed every time the keymap changes, i\&.e\&. the special parameter -+\fBKEYMAP\fP is set to a different value, while the line editor is active\&. -+Initialising the keymap when the line editor starts does not cause the -+widget to be called\&. -+.RS -+.PP -+The value \fB$KEYMAP\fP within the function reflects the new keymap\&. The -+old keymap is passed as the sole argument\&. -+.PP -+This can be used for detecting switches between the vi command -+(\fBvicmd\fP) and insert (usually \fBmain\fP) keymaps\&. -+.RE -+.RE -+.PP -+.SH "STANDARD WIDGETS" -+The following is a list of all the standard widgets, -+and their default bindings in emacs mode, -+vi command mode and vi insert mode -+(the `\fBemacs\fP\&', `\fBvicmd\fP' and `\fBviins\fP' keymaps, respectively)\&. -+.PP -+Note that cursor keys are bound to movement keys in all three keymaps; -+the shell assumes that the cursor keys send the key sequences reported -+by the terminal\-handling library (termcap or terminfo)\&. The key sequences -+shown in the list are those based on the VT100, common on many modern -+terminals, but in fact these are not necessarily bound\&. In the case of the -+\fBviins\fP keymap, the initial escape character of the sequences serves also -+to return to the \fBvicmd\fP keymap: whether this happens is determined by -+the \fBKEYTIMEOUT\fP parameter, see \fIzshparam\fP(1)\&. -+.SS "Movement" -+.PD 0 -+.TP -+.PD -+\fBvi\-backward\-blank\-word\fP (unbound) (B) (unbound) -+Move backward one word, where a word is defined as a series of -+non\-blank characters\&. -+.TP -+\fBbackward\-char\fP (^B ESC\-[D) (unbound) (unbound) -+Move backward one character\&. -+.TP -+\fBvi\-backward\-char\fP (unbound) (^H h ^?) (ESC\-[D) -+Move backward one character, without changing lines\&. -+.TP -+\fBbackward\-word\fP (ESC\-B ESC\-b) (unbound) (unbound) -+Move to the beginning of the previous word\&. -+.TP -+\fBemacs\-backward\-word\fP -+Move to the beginning of the previous word\&. -+.TP -+\fBvi\-backward\-word\fP (unbound) (b) (unbound) -+Move to the beginning of the previous word, vi\-style\&. -+.TP -+\fBbeginning\-of\-line\fP (^A) (unbound) (unbound) -+Move to the beginning of the line\&. If already at the beginning -+of the line, move to the beginning of the previous line, if any\&. -+.TP -+\fBvi\-beginning\-of\-line\fP -+Move to the beginning of the line, without changing lines\&. -+.TP -+\fBend\-of\-line\fP (^E) (unbound) (unbound) -+Move to the end of the line\&. If already at the end -+of the line, move to the end of the next line, if any\&. -+.TP -+\fBvi\-end\-of\-line\fP (unbound) ($) (unbound) -+Move to the end of the line\&. -+If an argument is given to this command, the cursor will be moved to -+the end of the line (argument \- 1) lines down\&. -+.TP -+\fBvi\-forward\-blank\-word\fP (unbound) (W) (unbound) -+Move forward one word, where a word is defined as a series of -+non\-blank characters\&. -+.TP -+\fBvi\-forward\-blank\-word\-end\fP (unbound) (E) (unbound) -+Move to the end of the current word, or, if at the end of the current word, -+to the end of the next word, -+where a word is defined as a series of non\-blank characters\&. -+.TP -+\fBforward\-char\fP (^F ESC\-[C) (unbound) (unbound) -+Move forward one character\&. -+.TP -+\fBvi\-forward\-char\fP (unbound) (space l) (ESC\-[C) -+Move forward one character\&. -+.TP -+\fBvi\-find\-next\-char\fP (^X^F) (f) (unbound) -+Read a character from the keyboard, and move to -+the next occurrence of it in the line\&. -+.TP -+\fBvi\-find\-next\-char\-skip\fP (unbound) (t) (unbound) -+Read a character from the keyboard, and move to -+the position just before the next occurrence of it in the line\&. -+.TP -+\fBvi\-find\-prev\-char\fP (unbound) (F) (unbound) -+Read a character from the keyboard, and move to -+the previous occurrence of it in the line\&. -+.TP -+\fBvi\-find\-prev\-char\-skip\fP (unbound) (T) (unbound) -+Read a character from the keyboard, and move to -+the position just after the previous occurrence of it in the line\&. -+.TP -+\fBvi\-first\-non\-blank\fP (unbound) (^) (unbound) -+Move to the first non\-blank character in the line\&. -+.TP -+\fBvi\-forward\-word\fP (unbound) (w) (unbound) -+Move forward one word, vi\-style\&. -+.TP -+\fBforward\-word\fP (ESC\-F ESC\-f) (unbound) (unbound) -+Move to the beginning of the next word\&. -+The editor\&'s idea of a word is specified with the \fBWORDCHARS\fP -+parameter\&. -+.TP -+\fBemacs\-forward\-word\fP -+Move to the end of the next word\&. -+.TP -+\fBvi\-forward\-word\-end\fP (unbound) (e) (unbound) -+Move to the end of the next word\&. -+.TP -+\fBvi\-goto\-column\fP (ESC\-|) (|) (unbound) -+Move to the column specified by the numeric argument\&. -+.TP -+\fBvi\-goto\-mark\fP (unbound) (`) (unbound) -+Move to the specified mark\&. -+.TP -+\fBvi\-goto\-mark\-line\fP (unbound) (\&') (unbound) -+Move to beginning of the line containing the specified mark\&. -+.TP -+\fBvi\-repeat\-find\fP (unbound) (;) (unbound) -+Repeat the last \fBvi\-find\fP command\&. -+.TP -+\fBvi\-rev\-repeat\-find\fP (unbound) (,) (unbound) -+Repeat the last \fBvi\-find\fP command in the opposite direction\&. -+.SS "History Control" -+.PD 0 -+.TP -+.PD -+\fBbeginning\-of\-buffer\-or\-history\fP (ESC\-<) (unbound) (unbound) -+Move to the beginning of the buffer, or if already there, -+move to the first event in the history list\&. -+.TP -+\fBbeginning\-of\-line\-hist\fP -+Move to the beginning of the line\&. If already at the -+beginning of the buffer, move to the previous history line\&. -+.TP -+\fBbeginning\-of\-history\fP -+Move to the first event in the history list\&. -+.TP -+\fBdown\-line\-or\-history\fP (^N ESC\-[B) (j) (ESC\-[B) -+Move down a line in the buffer, or if already at the bottom line, -+move to the next event in the history list\&. -+.TP -+\fBvi\-down\-line\-or\-history\fP (unbound) (+) (unbound) -+Move down a line in the buffer, or if already at the bottom line, -+move to the next event in the history list\&. -+Then move to the first non\-blank character on the line\&. -+.TP -+\fBdown\-line\-or\-search\fP -+Move down a line in the buffer, or if already at the bottom line, -+search forward in the history for a line beginning with the first -+word in the buffer\&. -+.RS -+.PP -+If called from a function by the \fBzle\fP command with arguments, the first -+argument is taken as the string for which to search, rather than the -+first word in the buffer\&. -+.RE -+.TP -+\fBdown\-history\fP (unbound) (^N) (unbound) -+Move to the next event in the history list\&. -+.TP -+\fBhistory\-beginning\-search\-backward\fP -+Search backward in the history for a line beginning with the current -+line up to the cursor\&. -+This leaves the cursor in its original position\&. -+.TP -+\fBend\-of\-buffer\-or\-history\fP (ESC\->) (unbound) (unbound) -+Move to the end of the buffer, or if already there, -+move to the last event in the history list\&. -+.TP -+\fBend\-of\-line\-hist\fP -+Move to the end of the line\&. If already at the end of -+the buffer, move to the next history line\&. -+.TP -+\fBend\-of\-history\fP -+Move to the last event in the history list\&. -+.TP -+\fBvi\-fetch\-history\fP (unbound) (G) (unbound) -+Fetch the history line specified by the numeric argument\&. -+This defaults to the current history line -+(i\&.e\&. the one that isn\&'t history yet)\&. -+.TP -+\fBhistory\-incremental\-search\-backward\fP (^R ^Xr) (unbound) (unbound) -+Search backward incrementally for a specified string\&. The search is -+case\-insensitive if the search string does not have uppercase letters and no -+numeric argument was given\&. The string may begin with `\fB^\fP\&' to anchor the -+search to the beginning of the line\&. When called from a user\-defined -+function returns the following statuses: 0, if the search succeeded; -+1, if the search failed; 2, if the search term was a bad pattern; -+3, if the search was aborted by the \fBsend\-break\fP command\&. -+.RS -+.PP -+A restricted set of editing functions -+is available in the mini\-buffer\&. Keys are looked up in the special -+\fBisearch\fP keymap, and if not found there in the main keymap (note -+that by default the \fBisearch\fP keymap is empty)\&. -+An interrupt signal, as defined by the stty -+setting, will stop the search and go back to the original line\&. An undefined -+key will have the same effect\&. Note that the following always -+perform the same task within incremental searches and cannot be -+replaced by user defined widgets, nor can the set of functions -+be extended\&. The supported functions are: -+.PP -+.PD 0 -+.TP -+.PD 0 -+\fBaccept\-and\-hold\fP -+.TP -+.PD 0 -+\fBaccept\-and\-infer\-next\-history\fP -+.TP -+.PD 0 -+\fBaccept\-line\fP -+.TP -+.PD -+\fBaccept\-line\-and\-down\-history\fP -+Perform the usual function after exiting incremental search\&. -+The command line displayed is executed\&. -+.TP -+.PD 0 -+\fBbackward\-delete\-char\fP -+.TP -+.PD -+\fBvi\-backward\-delete\-char\fP -+Back up one place in the search history\&. If the search has been -+repeated this does not immediately erase a character in the -+minibuffer\&. -+.TP -+\fBaccept\-search\fP -+Exit incremental search, retaining the command line but performing no -+further action\&. Note that this function is not bound by default -+and has no effect outside incremental search\&. -+.TP -+.PD 0 -+\fBbackward\-delete\-word\fP -+.TP -+.PD 0 -+\fBbackward\-kill\-word\fP -+.TP -+.PD -+\fBvi\-backward\-kill\-word\fP -+Back up one character in the minibuffer; if multiple searches -+have been performed since the character was inserted the search -+history is rewound to the point just before the character was -+entered\&. Hence this has the effect of repeating -+\fBbackward\-delete\-char\fP\&. -+.TP -+\fBclear\-screen\fP -+Clear the screen, remaining in incremental search mode\&. -+.TP -+\fBhistory\-incremental\-search\-backward\fP -+Find the next occurrence of the contents of the mini\-buffer\&. -+.TP -+\fBhistory\-incremental\-search\-forward\fP -+Invert the sense of the search\&. -+.TP -+\fBmagic\-space\fP -+Inserts a non\-magical space\&. -+.TP -+.PD 0 -+\fBquoted\-insert\fP -+.TP -+.PD -+\fBvi\-quoted\-insert\fP -+Quote the character to insert into the minibuffer\&. -+.TP -+\fBredisplay\fP -+Redisplay the command line, remaining in incremental search mode\&. -+.TP -+\fBvi\-cmd\-mode\fP -+Toggle between the `\fBmain\fP\&' and `\fBvicmd\fP' keymaps; -+the `\fBmain\fP\&' keymap (insert mode) will be selected initially\&. -+.TP -+.PD 0 -+\fBvi\-repeat\-search\fP -+.TP -+.PD -+\fBvi\-rev\-repeat\-search\fP -+Repeat the search\&. The direction of the search is indicated in the -+mini\-buffer\&. -+.PP -+Any character that is not bound to one of the above functions, or -+\fBself\-insert\fP or \fBself\-insert\-unmeta\fP, will cause the mode to be -+exited\&. The character is then looked up and executed in the keymap in -+effect at that point\&. -+.PP -+When called from a widget function by the \fBzle\fP command, the incremental -+search commands can take a string argument\&. This will be treated as a -+string of keys, as for arguments to the \fBbindkey\fP command, and used as -+initial input for the command\&. Any characters in the string which are -+unused by the incremental search will be silently ignored\&. For example, -+.PP -+.RS -+.nf -+\fBzle history\-incremental\-search\-backward forceps\fP -+.fi -+.RE -+.PP -+will search backwards for \fBforceps\fP, leaving the minibuffer containing -+the string `\fBforceps\fP\&'\&. -+.RE -+.TP -+\fBhistory\-incremental\-search\-forward\fP (^S ^Xs) (unbound) (unbound) -+Search forward incrementally for a specified string\&. The search is -+case\-insensitive if the search string does not have uppercase letters and no -+numeric argument was given\&. The string may begin with `\fB^\fP\&' to anchor the -+search to the beginning of the line\&. The functions available in the -+mini\-buffer are the same as for \fBhistory\-incremental\-search\-backward\fP\&. -+.TP -+.PD 0 -+\fBhistory\-incremental\-pattern\-search\-backward\fP -+.TP -+.PD -+\fBhistory\-incremental\-pattern\-search\-forward\fP -+These widgets behave similarly to the corresponding widgets with -+no \fB\-pattern\fP, but the search string typed by the user is treated -+as a pattern, respecting the current settings of the various options -+affecting pattern matching\&. See -+FILENAME GENERATION in \fIzshexpn\fP(1) for a description of patterns\&. -+If no numeric argument was given lowercase letters in the search -+string may match uppercase letters in the history\&. The string may begin -+with `\fB^\fP\&' to anchor the search to the beginning of the line\&. -+.RS -+.PP -+The prompt changes to indicate an invalid pattern; this may simply -+indicate the pattern is not yet complete\&. -+.PP -+Note that only non\-overlapping matches are reported, so an expression -+with wildcards may return fewer matches on a line than are visible -+by inspection\&. -+.RE -+.TP -+\fBhistory\-search\-backward\fP (ESC\-P ESC\-p) (unbound) (unbound) -+Search backward in the history for a line beginning with the first -+word in the buffer\&. -+.RS -+.PP -+If called from a function by the \fBzle\fP command with arguments, the first -+argument is taken as the string for which to search, rather than the -+first word in the buffer\&. -+.RE -+.TP -+\fBvi\-history\-search\-backward\fP (unbound) (/) (unbound) -+Search backward in the history for a specified string\&. -+The string may begin with `\fB^\fP\&' to anchor the search to the -+beginning of the line\&. -+.RS -+.PP -+A restricted set of editing functions is available in -+the mini\-buffer\&. An interrupt signal, as defined by the stty setting, will -+stop the search\&. -+The functions available in the mini\-buffer are: -+\fBaccept\-line\fP, -+\fBbackward\-delete\-char\fP, -+\fBvi\-backward\-delete\-char\fP, -+\fBbackward\-kill\-word\fP, -+\fBvi\-backward\-kill\-word\fP, -+\fBclear\-screen\fP, -+\fBredisplay\fP, -+\fBquoted\-insert\fP -+and -+\fBvi\-quoted\-insert\fP\&. -+.PP -+\fBvi\-cmd\-mode\fP is treated the same as accept\-line, and -+\fBmagic\-space\fP is treated as a space\&. -+Any other character that is not bound to self\-insert or -+self\-insert\-unmeta will beep and be ignored\&. If the function is called from vi -+command mode, the bindings of the current insert mode will be used\&. -+.PP -+If called from a function by the \fBzle\fP command with arguments, the first -+argument is taken as the string for which to search, rather than the -+first word in the buffer\&. -+.RE -+.TP -+\fBhistory\-search\-forward\fP (ESC\-N ESC\-n) (unbound) (unbound) -+Search forward in the history for a line beginning with the first -+word in the buffer\&. -+.RS -+.PP -+If called from a function by the \fBzle\fP command with arguments, the first -+argument is taken as the string for which to search, rather than the -+first word in the buffer\&. -+.RE -+.TP -+\fBvi\-history\-search\-forward\fP (unbound) (?) (unbound) -+Search forward in the history for a specified string\&. -+The string may begin with `\fB^\fP\&' to anchor the search to the -+beginning of the line\&. The functions available in the mini\-buffer are the same -+as for \fBvi\-history\-search\-backward\fP\&. Argument handling is also the same -+as for that command\&. -+.TP -+\fBinfer\-next\-history\fP (^X^N) (unbound) (unbound) -+Search in the history list for a line matching the current one and -+fetch the event following it\&. -+.TP -+\fBinsert\-last\-word\fP (ESC\-_ ESC\-\&.) (unbound) (unbound) -+Insert the last word from the previous history event at the -+cursor position\&. If a positive numeric argument is given, -+insert that word from the end of the previous history event\&. -+If the argument is zero or negative insert that word from the -+left (zero inserts the previous command word)\&. Repeating this command -+replaces the word just inserted with the last word from the -+history event prior to the one just used; numeric arguments can be used in -+the same way to pick a word from that event\&. -+.RS -+.PP -+When called from a shell function invoked from a user\-defined widget, the -+command can take one to three arguments\&. The first argument specifies a -+history offset which applies to successive calls to this widget: if it is \-1, -+the default behaviour is used, while if it is 1, successive calls will move -+forwards through the history\&. The value 0 can be used to indicate that the -+history line examined by the previous execution of the command will be -+reexamined\&. Note that negative numbers should be preceded by a -+`\fB\-\fP\fB\-\fP\&' argument to avoid confusing them with options\&. -+.PP -+If two arguments are given, the second specifies the word on the command -+line in normal array index notation (as a more natural alternative to the -+prefix argument)\&. Hence 1 is the first word, and \-1 (the default) is the -+last word\&. -+.PP -+If a third argument is given, its value is ignored, but it is used to -+signify that the history offset is relative to the current history line, -+rather than the one remembered after the previous invocations of -+\fBinsert\-last\-word\fP\&. -+.PP -+For example, the default behaviour of the command corresponds to -+.PP -+.RS -+.nf -+\fBzle insert\-last\-word \-\- \-1 \-1\fP -+.fi -+.RE -+.PP -+while the command -+.PP -+.RS -+.nf -+\fBzle insert\-last\-word \-\- \-1 1 \-\fP -+.fi -+.RE -+.PP -+always copies the first word of the line in the history immediately before -+the line being edited\&. This has the side effect that later invocations of -+the widget will be relative to that line\&. -+.RE -+.TP -+\fBvi\-repeat\-search\fP (unbound) (n) (unbound) -+Repeat the last vi history search\&. -+.TP -+\fBvi\-rev\-repeat\-search\fP (unbound) (N) (unbound) -+Repeat the last vi history search, but in reverse\&. -+.TP -+\fBup\-line\-or\-history\fP (^P ESC\-[A) (k) (ESC\-[A) -+Move up a line in the buffer, or if already at the top line, -+move to the previous event in the history list\&. -+.TP -+\fBvi\-up\-line\-or\-history\fP (unbound) (\-) (unbound) -+Move up a line in the buffer, or if already at the top line, -+move to the previous event in the history list\&. -+Then move to the first non\-blank character on the line\&. -+.TP -+\fBup\-line\-or\-search\fP -+Move up a line in the buffer, or if already at the top line, -+search backward in the history for a line beginning with the -+first word in the buffer\&. -+.RS -+.PP -+If called from a function by the \fBzle\fP command with arguments, the first -+argument is taken as the string for which to search, rather than the -+first word in the buffer\&. -+.RE -+.TP -+\fBup\-history\fP (unbound) (^P) (unbound) -+Move to the previous event in the history list\&. -+.TP -+\fBhistory\-beginning\-search\-forward\fP -+Search forward in the history for a line beginning with the current -+line up to the cursor\&. -+This leaves the cursor in its original position\&. -+.SS "Modifying Text" -+.PD 0 -+.TP -+.PD -+\fBvi\-add\-eol\fP (unbound) (A) (unbound) -+Move to the end of the line and enter insert mode\&. -+.TP -+\fBvi\-add\-next\fP (unbound) (a) (unbound) -+Enter insert mode after the current cursor position, without changing lines\&. -+.TP -+\fBbackward\-delete\-char\fP (^H ^?) (unbound) (unbound) -+Delete the character behind the cursor\&. -+.TP -+\fBvi\-backward\-delete\-char\fP (unbound) (X) (^H) -+Delete the character behind the cursor, without changing lines\&. -+If in insert mode, this won\&'t delete past the point where insert mode was -+last entered\&. -+.TP -+\fBbackward\-delete\-word\fP -+Delete the word behind the cursor\&. -+.TP -+\fBbackward\-kill\-line\fP -+Kill from the beginning of the line to the cursor position\&. -+.TP -+\fBbackward\-kill\-word\fP (^W ESC\-^H ESC\-^?) (unbound) (unbound) -+Kill the word behind the cursor\&. -+.TP -+\fBvi\-backward\-kill\-word\fP (unbound) (unbound) (^W) -+Kill the word behind the cursor, without going past the point where insert -+mode was last entered\&. -+.TP -+\fBcapitalize\-word\fP (ESC\-C ESC\-c) (unbound) (unbound) -+Capitalize the current word and move past it\&. -+.TP -+\fBvi\-change\fP (unbound) (c) (unbound) -+Read a movement command from the keyboard, and kill -+from the cursor position to the endpoint of the movement\&. -+Then enter insert mode\&. -+If the command is \fBvi\-change\fP, change the current line\&. -+.TP -+\fBvi\-change\-eol\fP (unbound) (C) (unbound) -+Kill to the end of the line and enter insert mode\&. -+.TP -+\fBvi\-change\-whole\-line\fP (unbound) (S) (unbound) -+Kill the current line and enter insert mode\&. -+.TP -+\fBcopy\-region\-as\-kill\fP (ESC\-W ESC\-w) (unbound) (unbound) -+Copy the area from the cursor to the mark to the kill buffer\&. -+.RS -+.PP -+If called from a ZLE widget function in the form `\fBzle -+copy\-region\-as\-kill\fP \fIstring\fP\&' then \fIstring\fP will be taken as the -+text to copy to the kill buffer\&. The cursor, the mark and the text on the -+command line are not used in this case\&. -+.RE -+.TP -+\fBcopy\-prev\-word\fP (ESC\-^_) (unbound) (unbound) -+Duplicate the word to the left of the cursor\&. -+.TP -+\fBcopy\-prev\-shell\-word\fP -+Like \fBcopy\-prev\-word\fP, but the word is found by using shell parsing, -+whereas \fBcopy\-prev\-word\fP looks for blanks\&. This makes a difference -+when the word is quoted and contains spaces\&. -+.TP -+\fBvi\-delete\fP (unbound) (d) (unbound) -+Read a movement command from the keyboard, and kill -+from the cursor position to the endpoint of the movement\&. -+If the command is \fBvi\-delete\fP, kill the current line\&. -+.TP -+\fBdelete\-char\fP -+Delete the character under the cursor\&. -+.TP -+\fBvi\-delete\-char\fP (unbound) (x) (unbound) -+Delete the character under the cursor, -+without going past the end of the line\&. -+.TP -+\fBdelete\-word\fP -+Delete the current word\&. -+.TP -+\fBdown\-case\-word\fP (ESC\-L ESC\-l) (unbound) (unbound) -+Convert the current word to all lowercase and move past it\&. -+.TP -+\fBkill\-word\fP (ESC\-D ESC\-d) (unbound) (unbound) -+Kill the current word\&. -+.TP -+\fBgosmacs\-transpose\-chars\fP -+Exchange the two characters behind the cursor\&. -+.TP -+\fBvi\-indent\fP (unbound) (>) (unbound) -+Indent a number of lines\&. -+.TP -+\fBvi\-insert\fP (unbound) (i) (unbound) -+Enter insert mode\&. -+.TP -+\fBvi\-insert\-bol\fP (unbound) (I) (unbound) -+Move to the first non\-blank character on the line and enter insert mode\&. -+.TP -+\fBvi\-join\fP (^X^J) (J) (unbound) -+Join the current line with the next one\&. -+.TP -+\fBkill\-line\fP (^K) (unbound) (unbound) -+Kill from the cursor to the end of the line\&. -+If already on the end of the line, kill the newline character\&. -+.TP -+\fBvi\-kill\-line\fP (unbound) (unbound) (^U) -+Kill from the cursor back to wherever insert mode was last entered\&. -+.TP -+\fBvi\-kill\-eol\fP (unbound) (D) (unbound) -+Kill from the cursor to the end of the line\&. -+.TP -+\fBkill\-region\fP -+Kill from the cursor to the mark\&. -+.TP -+\fBkill\-buffer\fP (^X^K) (unbound) (unbound) -+Kill the entire buffer\&. -+.TP -+\fBkill\-whole\-line\fP (^U) (unbound) (unbound) -+Kill the current line\&. -+.TP -+\fBvi\-match\-bracket\fP (^X^B) (%) (unbound) -+Move to the bracket character (one of \fB{}\fP, \fB()\fP or \fB[]\fP) that -+matches the one under the cursor\&. -+If the cursor is not on a bracket character, move forward without going -+past the end of the line to find one, and then go to the matching bracket\&. -+.TP -+\fBvi\-open\-line\-above\fP (unbound) (O) (unbound) -+Open a line above the cursor and enter insert mode\&. -+.TP -+\fBvi\-open\-line\-below\fP (unbound) (o) (unbound) -+Open a line below the cursor and enter insert mode\&. -+.TP -+\fBvi\-oper\-swap\-case\fP -+Read a movement command from the keyboard, and swap -+the case of all characters -+from the cursor position to the endpoint of the movement\&. -+If the movement command is \fBvi\-oper\-swap\-case\fP, -+swap the case of all characters on the current line\&. -+.TP -+\fBoverwrite\-mode\fP (^X^O) (unbound) (unbound) -+Toggle between overwrite mode and insert mode\&. -+.TP -+\fBvi\-put\-before\fP (unbound) (P) (unbound) -+Insert the contents of the kill buffer before the cursor\&. -+If the kill buffer contains a sequence of lines (as opposed to characters), -+paste it above the current line\&. -+.TP -+\fBvi\-put\-after\fP (unbound) (p) (unbound) -+Insert the contents of the kill buffer after the cursor\&. -+If the kill buffer contains a sequence of lines (as opposed to characters), -+paste it below the current line\&. -+.TP -+\fBquoted\-insert\fP (^V) (unbound) (unbound) -+Insert the next character typed into the buffer literally\&. -+An interrupt character will not be inserted\&. -+.TP -+\fBvi\-quoted\-insert\fP (unbound) (unbound) (^Q ^V) -+Display a `\fB^\fP\&' at the cursor position, and -+insert the next character typed into the buffer literally\&. -+An interrupt character will not be inserted\&. -+.TP -+\fBquote\-line\fP (ESC\-\&') (unbound) (unbound) -+Quote the current line; that is, put a `\fB\&'\fP' character at the -+beginning and the end, and convert all `\fB\&'\fP' characters -+to `\fB\&'\e''\fP'\&. -+.TP -+\fBquote\-region\fP (ESC\-") (unbound) (unbound) -+Quote the region from the cursor to the mark\&. -+.TP -+\fBvi\-replace\fP (unbound) (R) (unbound) -+Enter overwrite mode\&. -+.TP -+\fBvi\-repeat\-change\fP (unbound) (\&.) (unbound) -+Repeat the last vi mode text modification\&. -+If a count was used with the modification, it is remembered\&. -+If a count is given to this command, it overrides the remembered count, -+and is remembered for future uses of this command\&. -+The cut buffer specification is similarly remembered\&. -+.TP -+\fBvi\-replace\-chars\fP (unbound) (r) (unbound) -+Replace the character under the cursor with a character -+read from the keyboard\&. -+.TP -+\fBself\-insert\fP (printable characters) (unbound) (printable characters and some control characters) -+Insert a character into the buffer at the cursor position\&. -+.TP -+\fBself\-insert\-unmeta\fP (ESC\-^I ESC\-^J ESC\-^M) (unbound) (unbound) -+Insert a character into the buffer after stripping the meta bit -+and converting ^M to ^J\&. -+.TP -+\fBvi\-substitute\fP (unbound) (s) (unbound) -+Substitute the next character(s)\&. -+.TP -+\fBvi\-swap\-case\fP (unbound) (~) (unbound) -+Swap the case of the character under the cursor and move past it\&. -+.TP -+\fBtranspose\-chars\fP (^T) (unbound) (unbound) -+Exchange the two characters to the left of the -+cursor if at end of line, else exchange the -+character under the cursor with the character -+to the left\&. -+.TP -+\fBtranspose\-words\fP (ESC\-T ESC\-t) (unbound) (unbound) -+Exchange the current word with the one before it\&. -+.TP -+\fBvi\-unindent\fP (unbound) (<) (unbound) -+Unindent a number of lines\&. -+.TP -+\fBup\-case\-word\fP (ESC\-U ESC\-u) (unbound) (unbound) -+Convert the current word to all caps and move past it\&. -+.TP -+\fByank\fP (^Y) (unbound) (unbound) -+Insert the contents of the kill buffer at the cursor position\&. -+.TP -+\fByank\-pop\fP (ESC\-y) (unbound) (unbound) -+Remove the text just yanked, rotate the kill\-ring (the history of -+previously killed text) and yank the new top\&. Only works following -+\fByank\fP or \fByank\-pop\fP\&. -+.TP -+\fBvi\-yank\fP (unbound) (y) (unbound) -+Read a movement command from the keyboard, and copy the region -+from the cursor position to the endpoint of the movement -+into the kill buffer\&. -+If the command is \fBvi\-yank\fP, copy the current line\&. -+.TP -+\fBvi\-yank\-whole\-line\fP (unbound) (Y) (unbound) -+Copy the current line into the kill buffer\&. -+.TP -+\fBvi\-yank\-eol\fP -+Copy the region from the cursor position to the end of the line -+into the kill buffer\&. -+Arguably, this is what Y should do in vi, but it isn\&'t what it actually does\&. -+.SS "Arguments" -+.PD 0 -+.TP -+.PD -+\fBdigit\-argument\fP (ESC\-0\&.\&.ESC\-9) (1\-9) (unbound) -+Start a new numeric argument, or add to the current one\&. -+See also \fBvi\-digit\-or\-beginning\-of\-line\fP\&. This only works if bound to a -+key sequence ending in a decimal digit\&. -+.RS -+.PP -+Inside a widget function, a call to this function treats the last key of -+the key sequence which called the widget as the digit\&. -+.RE -+.TP -+\fBneg\-argument\fP (ESC\-\-) (unbound) (unbound) -+Changes the sign of the following argument\&. -+.TP -+\fBuniversal\-argument\fP -+Multiply the argument of the next command by 4\&. Alternatively, if -+this command is followed by an integer (positive or negative), use -+that as the argument for the next command\&. Thus digits cannot be -+repeated using this command\&. For example, if this command occurs -+twice, followed immediately by \fBforward\-char\fP, move forward sixteen -+spaces; if instead it is followed by \fB\-2\fP, then \fBforward\-char\fP, -+move backward two spaces\&. -+.RS -+.PP -+Inside a widget function, if passed an argument, i\&.e\&. `\fBzle -+universal\-argument\fP \fInum\fP\&', the numerical argument will be set to -+\fInum\fP; this is equivalent to `\fBNUMERIC=\fP\fInum\fP\&'\&. -+.RE -+.TP -+\fBargument\-base\fP -+Use the existing numeric argument as a numeric base, which must be in the -+range 2 to 36 inclusive\&. Subsequent use of \fBdigit\-argument\fP and -+\fBuniversal\-argument\fP will input a new prefix in the given base\&. -+The usual hexadecimal convention is used: the letter \fBa\fP or \fBA\fP -+corresponds to 10, and so on\&. Arguments in bases requiring digits from 10 -+upwards are more conveniently input with \fBuniversal\-argument\fP, since -+\fBESC\-a\fP etc\&. are not usually bound to \fBdigit\-argument\fP\&. -+.RS -+.PP -+The function can be used with a command argument inside a user\-defined -+widget\&. The following code sets the base to 16 and lets the user input a -+hexadecimal argument until a key out of the digit range is typed: -+.PP -+.RS -+.nf -+\fBzle argument\-base 16 -+zle universal\-argument\fP -+.fi -+.RE -+.RE -+.RE -+.SS "Completion" -+.PD 0 -+.TP -+.PD -+\fBaccept\-and\-menu\-complete\fP -+In a menu completion, insert the current completion into the buffer, -+and advance to the next possible completion\&. -+.TP -+\fBcomplete\-word\fP -+Attempt completion on the current word\&. -+.TP -+\fBdelete\-char\-or\-list\fP (^D) (unbound) (unbound) -+Delete the character under the cursor\&. If the cursor -+is at the end of the line, list possible completions for the -+current word\&. -+.TP -+\fBexpand\-cmd\-path\fP -+Expand the current command to its full pathname\&. -+.TP -+\fBexpand\-or\-complete\fP (TAB) (unbound) (TAB) -+Attempt shell expansion on the current word\&. -+If that fails, -+attempt completion\&. -+.TP -+\fBexpand\-or\-complete\-prefix\fP -+Attempt shell expansion on the current word up to cursor\&. -+.TP -+\fBexpand\-history\fP (ESC\-space ESC\-!) (unbound) (unbound) -+Perform history expansion on the edit buffer\&. -+.TP -+\fBexpand\-word\fP (^X*) (unbound) (unbound) -+Attempt shell expansion on the current word\&. -+.TP -+\fBlist\-choices\fP (ESC\-^D) (^D =) (^D) -+List possible completions for the current word\&. -+.TP -+\fBlist\-expand\fP (^Xg ^XG) (^G) (^G) -+List the expansion of the current word\&. -+.TP -+\fBmagic\-space\fP -+Perform history expansion and insert a space into the -+buffer\&. This is intended to be bound to space\&. -+.TP -+\fBmenu\-complete\fP -+Like \fBcomplete\-word\fP, except that menu completion is used\&. -+See the \fBMENU_COMPLETE\fP option\&. -+.TP -+\fBmenu\-expand\-or\-complete\fP -+Like \fBexpand\-or\-complete\fP, except that menu completion is used\&. -+.TP -+\fBreverse\-menu\-complete\fP -+Perform menu completion, like \fBmenu\-complete\fP, except that if -+a menu completion is already in progress, move to the \fIprevious\fP -+completion rather than the next\&. -+.TP -+\fBend\-of\-list\fP -+When a previous completion displayed a list below the prompt, this -+widget can be used to move the prompt below the list\&. -+.SS "Miscellaneous" -+.PD 0 -+.TP -+.PD -+\fBaccept\-and\-hold\fP (ESC\-A ESC\-a) (unbound) (unbound) -+Push the contents of the buffer on the buffer stack -+and execute it\&. -+.TP -+\fBaccept\-and\-infer\-next\-history\fP -+Execute the contents of the buffer\&. -+Then search the history list for a line matching the current one -+and push the event following onto the buffer stack\&. -+.TP -+\fBaccept\-line\fP (^J ^M) (^J ^M) (^J ^M) -+Finish editing the buffer\&. Normally this causes the buffer to be -+executed as a shell command\&. -+.TP -+\fBaccept\-line\-and\-down\-history\fP (^O) (unbound) (unbound) -+Execute the current line, and push the next history -+event on the the buffer stack\&. -+.TP -+\fBauto\-suffix\-remove\fP -+If the previous action added a suffix (space, slash, etc\&.) to the word on -+the command line, remove it\&. Otherwise do nothing\&. Removing the suffix -+ends any active menu completion or menu selection\&. -+.RS -+.PP -+This widget is intended to be called from user\-defined widgets to enforce -+a desired suffix\-removal behavior\&. -+.RE -+.TP -+\fBauto\-suffix\-retain\fP -+If the previous action added a suffix (space, slash, etc\&.) to the word on -+the command line, force it to be preserved\&. Otherwise do nothing\&. -+Retaining the suffix ends any active menu completion or menu selection\&. -+.RS -+.PP -+This widget is intended to be called from user\-defined widgets to enforce -+a desired suffix\-preservation behavior\&. -+.RE -+.TP -+\fBbeep\fP -+Beep, unless the \fBBEEP\fP option is unset\&. -+.TP -+\fBvi\-cmd\-mode\fP (^X^V) (unbound) (^[) -+Enter command mode; that is, select the `\fBvicmd\fP\&' keymap\&. -+Yes, this is bound by default in emacs mode\&. -+.TP -+\fBvi\-caps\-lock\-panic\fP -+Hang until any lowercase key is pressed\&. -+This is for vi users without the mental capacity to keep -+track of their caps lock key (like the author)\&. -+.TP -+\fBclear\-screen\fP (^L ESC\-^L) (^L) (^L) -+Clear the screen and redraw the prompt\&. -+.TP -+\fBdescribe\-key\-briefly\fP -+Reads a key sequence, then prints the function bound to that sequence\&. -+.TP -+\fBexchange\-point\-and\-mark\fP (^X^X) (unbound) (unbound) -+Exchange the cursor position (point) with the position of the mark\&. -+Unless a negative prefix argument is given, the region between -+point and mark is activated so that it can be highlighted\&. -+If a zero prefix argument is given, the region is activated but -+point and mark are not swapped\&. -+.TP -+\fBexecute\-named\-cmd\fP (ESC\-x) (:) (unbound) -+Read the name of an editor command and -+execute it\&. A restricted set of editing functions is available in the -+mini\-buffer\&. Keys are looked up in the special -+\fBcommand\fP keymap, and if not found there in the main keymap\&. -+An interrupt signal, as defined by the stty setting, will -+abort the function\&. Note that the following always -+perform the same task within the \fBexecuted\-named\-cmd\fP environment and -+cannot be replaced by user defined widgets, nor can the set of functions -+be extended\&. The allowed functions are: -+\fBbackward\-delete\-char\fP, -+\fBvi\-backward\-delete\-char\fP, -+\fBclear\-screen\fP, -+\fBredisplay\fP, -+\fBquoted\-insert\fP, -+\fBvi\-quoted\-insert\fP, -+\fBbackward\-kill\-word\fP, -+\fBvi\-backward\-kill\-word\fP, -+\fBkill\-whole\-line\fP, -+\fBvi\-kill\-line\fP, -+\fBbackward\-kill\-line\fP, -+\fBlist\-choices\fP, -+\fBdelete\-char\-or\-list\fP, -+\fBcomplete\-word\fP, -+\fBaccept\-line\fP, -+\fBexpand\-or\-complete\fP and -+\fBexpand\-or\-complete\-prefix\fP\&. -+.RS -+.PP -+\fBkill\-region\fP kills the last word, -+and vi\-cmd\-mode is treated the same as accept\-line\&. -+The space and tab characters, if not bound to one of -+these functions, will complete the name and then list the -+possibilities if the \fBAUTO_LIST\fP option is set\&. -+Any other character that is not bound to \fBself\-insert\fP or -+\fBself\-insert\-unmeta\fP will beep and be ignored\&. -+The bindings of the current insert mode will be used\&. -+.PP -+Currently this command may not be redefined or called by name\&. -+.RE -+.TP -+\fBexecute\-last\-named\-cmd\fP (ESC\-z) (unbound) (unbound) -+Redo the last function executed with \fBexecute\-named\-cmd\fP\&. -+.RS -+.PP -+Currently this command may not be redefined or called by name\&. -+.RE -+.TP -+\fBget\-line\fP (ESC\-G ESC\-g) (unbound) (unbound) -+Pop the top line off the buffer stack and insert it at the -+cursor position\&. -+.TP -+\fBpound\-insert\fP (unbound) (#) (unbound) -+If there is no # character at the beginning of the buffer, -+add one to the beginning of each line\&. -+If there is one, remove a # from each line that has one\&. -+In either case, accept the current line\&. -+The \fBINTERACTIVE_COMMENTS\fP option must be set -+for this to have any usefulness\&. -+.TP -+\fBvi\-pound\-insert\fP -+If there is no # character at the beginning of the current line, -+add one\&. If there is one, remove it\&. -+The \fBINTERACTIVE_COMMENTS\fP option must be set -+for this to have any usefulness\&. -+.TP -+\fBpush\-input\fP -+Push the entire current multiline construct onto the buffer stack and -+return to the top\-level (\fBPS1\fP) prompt\&. -+If the current parser construct is only a single line, this is exactly -+like \fBpush\-line\fP\&. -+Next time the editor starts up or is popped with \fBget\-line\fP, the -+construct will be popped off the top of the buffer stack and loaded -+into the editing buffer\&. -+.TP -+\fBpush\-line\fP (^Q ESC\-Q ESC\-q) (unbound) (unbound) -+Push the current buffer onto the buffer stack and clear -+the buffer\&. -+Next time the editor starts up, the buffer will be popped -+off the top of the buffer stack and loaded into the editing -+buffer\&. -+.TP -+\fBpush\-line\-or\-edit\fP -+At the top\-level (\fBPS1\fP) prompt, equivalent to \fBpush\-line\fP\&. -+At a secondary (\fBPS2\fP) prompt, move the entire current multiline -+construct into the editor buffer\&. -+The latter is equivalent to \fBpush\-input\fP followed by \fBget\-line\fP\&. -+.TP -+\fBread\-command\fP -+Only useful from a user\-defined widget\&. A keystroke is read just as in -+normal operation, but instead of the command being executed the name -+of the command that would be executed is stored in the shell parameter -+\fBREPLY\fP\&. This can be used as the argument of a future \fBzle\fP -+command\&. If the key sequence is not bound, status 1 is returned; -+typically, however, \fBREPLY\fP is set to \fBundefined\-key\fP to indicate -+a useless key sequence\&. -+.TP -+\fBrecursive\-edit\fP -+Only useful from a user\-defined widget\&. At this point in the function, -+the editor regains control until one of the standard widgets which would -+normally cause zle to exit (typically an \fBaccept\-line\fP caused by -+hitting the return key) is executed\&. Instead, control returns to the -+user\-defined widget\&. The status returned is non\-zero if the return was -+caused by an error, but the function still continues executing and hence -+may tidy up\&. This makes it safe for the user\-defined widget to alter -+the command line or key bindings temporarily\&. -+.RS -+.PP -+The following widget, \fBcaps\-lock\fP, serves as an example\&. -+.RS -+.nf -+\fBself\-insert\-ucase() { -+ LBUFFER+=${(U)KEYS[\-1]} -+} -+.PP -+integer stat -+.PP -+zle \-N self\-insert self\-insert\-ucase -+zle \-A caps\-lock save\-caps\-lock -+zle \-A accept\-line caps\-lock -+.PP -+zle recursive\-edit -+stat=$? -+.PP -+zle \-A \&.self\-insert self\-insert -+zle \-A save\-caps\-lock caps\-lock -+zle \-D save\-caps\-lock -+.PP -+(( stat )) && zle send\-break -+.PP -+return $stat -+\fP -+.fi -+.RE -+This causes typed letters to be inserted capitalised until either -+\fBaccept\-line\fP (i\&.e\&. typically the return key) is typed or the -+\fBcaps\-lock\fP widget is invoked again; the later is handled by saving -+the old definition of \fBcaps\-lock\fP as \fBsave\-caps\-lock\fP and then -+rebinding it to invoke \fBaccept\-line\fP\&. Note that an error from the -+recursive edit is detected as a non\-zero return status and propagated by -+using the \fBsend\-break\fP widget\&. -+.RE -+.TP -+\fBredisplay\fP (unbound) (^R) (^R) -+Redisplays the edit buffer\&. -+.TP -+\fBreset\-prompt\fP (unbound) (unbound) (unbound) -+Force the prompts on both the left and right of the screen to be -+re\-expanded, then redisplay the edit buffer\&. This -+reflects changes both to the prompt variables themselves and changes -+in the expansion of the values (for example, changes in time or -+directory, or changes to the value of variables referred to by the -+prompt)\&. -+.RS -+.PP -+Otherwise, the prompt is only expanded each time zle starts, and -+when the display as been interrupted by output from another part of the -+shell (such as a job notification) which causes the command line to be -+reprinted\&. -+.RE -+.TP -+\fBsend\-break\fP (^G ESC\-^G) (unbound) (unbound) -+Abort the current editor function, e\&.g\&. \fBexecute\-named\-command\fP, or the -+editor itself, e\&.g\&. if you are in \fBvared\fP\&. Otherwise abort the parsing of -+the current line; in this case the aborted line is available in the shell -+variable \fBZLE_LINE_ABORTED\fP\&. -+.TP -+\fBrun\-help\fP (ESC\-H ESC\-h) (unbound) (unbound) -+Push the buffer onto the buffer stack, and execute the -+command `\fBrun\-help\fP \fIcmd\fP\&', where \fIcmd\fP is the current -+command\&. \fBrun\-help\fP is normally aliased to \fBman\fP\&. -+.TP -+\fBvi\-set\-buffer\fP (unbound) (") (unbound) -+Specify a buffer to be used in the following command\&. -+There are 35 buffers that can be specified: -+the 26 `named\&' buffers \fB"a\fP to \fB"z\fP -+and the nine `queued\&' buffers \fB"1\fP to \fB"9\fP\&. The named buffers can also -+be specified as \fB"A\fP to \fB"Z\fP\&. -+.RS -+.PP -+When a buffer is specified for a cut command, the text being cut replaces -+the previous contents of the specified buffer\&. If a named buffer -+is specified using a capital, the newly cut text is appended to the buffer -+instead of overwriting it\&. -+.PP -+If no buffer is specified for a cut command, \fB"1\fP is used, and the -+contents of \fB"1\fP to \fB"8\fP are each shifted along one buffer; the contents of -+\fB"9\fP is lost\&. -+.RE -+.TP -+\fBvi\-set\-mark\fP (unbound) (m) (unbound) -+Set the specified mark at the cursor position\&. -+.TP -+\fBset\-mark\-command\fP (^@) (unbound) (unbound) -+Set the mark at the cursor position\&. If called with a negative -+prefix argument, do not set the mark but deactivate the region so that -+it is no longer highlighted (it is still usable for other purposes)\&. -+Otherwise the region is marked as active\&. -+.TP -+\fBspell\-word\fP (ESC\-$ ESC\-S ESC\-s) (unbound) (unbound) -+Attempt spelling correction on the current word\&. -+.TP -+\fBundefined\-key\fP -+This command is executed when a key sequence that is not bound to any -+command is typed\&. By default it beeps\&. -+.TP -+\fBundo\fP (^_ ^Xu ^X^U) (unbound) (unbound) -+Incrementally undo the last text modification\&. -+.TP -+\fBredo\fP -+Incrementally redo undone text modifications\&. -+.TP -+\fBvi\-undo\-change\fP (unbound) (u) (unbound) -+Undo the last text modification\&. -+If repeated, redo the modification\&. -+.TP -+\fBwhat\-cursor\-position\fP (^X=) (unbound) (unbound) -+Print the character under the cursor, its code as an octal, decimal and -+hexadecimal number, the current cursor position within the buffer and the -+column of the cursor in the current line\&. -+.TP -+\fBwhere\-is\fP -+Read the name of an editor command and and print the listing of key -+sequences that invoke the specified command\&. -+A restricted set of editing functions is available in the -+mini\-buffer\&. Keys are looked up in the special -+\fBcommand\fP keymap, and if not found there in the main keymap\&. -+.TP -+\fBwhich\-command\fP (ESC\-?) (unbound) (unbound) -+Push the buffer onto the buffer stack, and execute the -+command `\fBwhich\-command\fP \fIcmd\fP\&'\&. where \fIcmd\fP is the current -+command\&. \fBwhich\-command\fP is normally aliased to \fIwhence\fP\&. -+.TP -+\fBvi\-digit\-or\-beginning\-of\-line\fP (unbound) (0) (unbound) -+If the last command executed was a digit as part of an argument, -+continue the argument\&. Otherwise, execute vi\-beginning\-of\-line\&. -+.PP -+.SH "CHARACTER HIGHLIGHTING" -+.PP -+The line editor has the ability to highlight characters or regions -+of the line that have a particular significance\&. This is controlled -+by the array parameter \fBzle_highlight\fP, if it has been set by the user\&. -+.PP -+If the parameter contains the single entry \fBnone\fP all highlighting -+is turned off\&. Note the parameter is still expected to be an array\&. -+.PP -+Otherwise each entry of the array should consist of a word indicating a -+context for highlighting, then a colon, then a comma\-separated list of -+the types of highlighting to apply in that context\&. -+.PP -+The contexts available for highlighting are the following: -+.PP -+.PD 0 -+.TP -+.PD -+\fBdefault\fP -+Any text within the command line not affected by any other highlighting\&. -+Text outside the editable area of the command line is not affected\&. -+.TP -+\fBisearch\fP -+When one of the incremental history search widgets is active, the -+area of the command line matched by the search string or pattern\&. -+.TP -+\fBregion\fP -+The region between the cursor (point) and the mark as set with -+\fBset\-mark\-command\fP\&. The region is only highlighted if it is active, -+which is the case if \fBset\-mark\-command\fP or \fBexchange\-point\-and\-mark\fP -+has been called and the line has not been subsequently modified\&. The -+region can be deactivated by calling \fBset\-mark\-command\fP with a -+negative prefix argument, or reactivated by calling -+\fBexchange\-point\-and\-mark\fP with a zero prefix argument\&. Note -+that whether or not the region is active has no effect on its -+use within widgets, it simply determines whether it is highlighted\&. -+.TP -+\fBspecial\fP -+Individual characters that have no direct printable -+representation but are shown in a special manner by the line editor\&. -+These characters are described below\&. -+.TP -+\fBsuffix\fP -+This context is used in completion for characters that are -+marked as suffixes that will be removed if the completion ends -+at that point, the most obvious example being a slash (\fB/\fP) after -+a directory name\&. Note that suffix removal is configurable; the -+circumstances under which the suffix will be removed may differ -+for different completions\&. -+.PP -+\fBzle_highlight\fP may contain additional fields for controlling how -+terminal sequences to change colours are output\&. Each of the following is -+followed by a colon and a string in the same form as for key bindings\&. -+This will not be necessary for the vast majority of terminals as the -+defaults shown in parentheses are widely used\&. -+.PP -+.PD 0 -+.TP -+.PD -+\fBfg_start_code\fP (\fB\ee[3\fP) -+The start of the escape sequence for the foreground colour\&. -+This is followed by an ASCII digit representing the colour\&. -+.TP -+\fBfg_default_code\fP (\fB9\fP) -+The number to use instead of the colour to reset the default foreground -+colour\&. -+.TP -+\fBfg_end_code\fP (\fBm\fP) -+The end of the escape sequence for the foreground colour\&. -+.TP -+\fBbg_start_code\fP (\fB\ee[4\fP) -+The start of the escape sequence for the background colour\&. -+This is followed by an ASCII digit representing the colour\&. -+.TP -+\fBbg_default_code\fP (\fB9\fP) -+The number to use instead of the colour to reset the default -+background colour\&. -+.TP -+\fBbg_end_code\fP (\fBm\fP) -+The end of the escape sequence for the background colour\&. -+.PP -+The available types of highlighting are the following\&. Note that -+not all types of highlighting are available on all terminals: -+.PP -+.PD 0 -+.TP -+.PD -+\fBnone\fP -+No highlighting is applied to the given context\&. It is not useful for -+this to appear with other types of highlighting; it is used to override -+a default\&. -+.TP -+\fBfg=\fP\fIcolour\fP -+The foreground colour should be set to \fIcolour\fP, a decimal integer -+or the name of one of the eight most widely\-supported colours\&. -+.RS -+.PP -+Not all terminals support this and, of those that do, not all provide -+facilities to test the support, hence the user should decide based on the -+terminal type\&. Most terminals support the colours \fBblack\fP, \fBred\fP, -+\fBgreen\fP, \fByellow\fP, \fBblue\fP, \fBmagenta\fP, \fBcyan\fP and \fBwhite\fP, -+which can be set by name\&. In addition\&. \fBdefault\fP may be used to -+set the terminal\&'s default foreground colour\&. Abbreviations are allowed; -+\fBb\fP or \fBbl\fP selects black\&. Some terminals may generate additional -+colours if the \fBbold\fP attribute is also present\&. -+.PP -+On recent terminals and on systems with an up\-to\-date terminal database the -+number of colours supported may be tested by the command `\fBechotc -+Co\fP\&'; if this succeeds, it indicates a limit on the number of colours which -+will be enforced by the line editor\&. The number of colours is in any case -+limited to 256 (i\&.e\&. the range 0 to 255)\&. -+.PP -+Colour is also known as color\&. -+.RE -+.TP -+\fBbg=\fP\fIcolour\fP -+The background colour should be set to \fIcolour\fP\&. -+This works similarly to the foreground colour, except the background is -+not usually affected by the bold attribute\&. -+.TP -+\fBbold\fP -+The characters in the given context are shown in a bold font\&. -+Not all terminals distinguish bold fonts\&. -+.TP -+\fBstandout\fP -+The characters in the given context are shown in the terminal\&'s standout -+mode\&. The actual effect is specific to the terminal; on many terminals it -+is inverse video\&. On some such terminals, where the cursor does not blink -+it appears with standout mode negated, making it less than clear where -+the cursor actually is\&. On such terminals one of the other effects -+may be preferable for highlighting the region and matched search string\&. -+.TP -+\fBunderline\fP -+The characters in the given context are shown underlined\&. Some -+terminals show the foreground in a different colour instead; in this -+case whitespace will not be highlighted\&. -+.PP -+The characters described above as `special\&' are as follows\&. The -+formatting described here is used irrespective of whether the characters -+are highlighted: -+.PP -+.PD 0 -+.TP -+.PD -+ASCII control characters -+Control characters in the ASCII range are shown as -+`\fB^\fP\&' followed by the base character\&. -+.TP -+Unprintable multibyte characters -+This item applies to control characters not in the ASCII range, -+plus other characters as follows\&. If the \fBMULTIBYTE\fP option is in -+effect, multibyte characters not in the ASCII character set that are -+reported as having zero width are treated as combining characters when the -+option \fBCOMBINING_CHARS\fP is on\&. If the option is off, or if a character -+appears where a combining character is not valid, the character -+is treated as unprintable\&. -+.RS -+.PP -+Unprintable multibyte characters are shown as a hexadecimal number between -+angle brackets\&. The number is the code point of the character in the wide -+character set; this may or may not be Unicode, depending on the operating -+system\&. -+.RE -+.TP -+Invalid multibyte characters -+If the \fBMULTIBYTE\fP option is in effect, any sequence of one or more -+bytes that does not form a valid character in the current character -+set is treated as a series of bytes each shown as a special character\&. -+This case can be distinguished from other unprintable characters -+as the bytes are represented as two hexadecimal digits between angle -+brackets, as distinct from the four or eight digits that are used for -+unprintable characters that are nonetheless valid in the current -+character set\&. -+.RS -+.PP -+Not all systems support this: for it to work, the system\&'s representation of -+wide characters must be code values from the Universal Character Set, -+as defined by IS0 10646 (also known as Unicode)\&. -+.RE -+.RE -+.PP -+If \fBzle_highlight\fP is not set or no value applies to a particular -+context, the defaults applied are equivalent to -+.PP -+.RS -+.nf -+\fBzle_highlight=(region:standout special:standout -+suffix:bold isearch:underline)\fP -+.fi -+.RE -+.PP -+i\&.e\&. both the region and special characters are shown in standout mode\&. -+.PP -+Within widgets, arbitrary regions may be highlighted by setting the -+special array parameter \fBregion_highlight\fP; see -+above\&. -+.PP ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/modlist.yo -@@ -0,0 +1,197 @@ -+startitem() -+item(tt(zsh/attr))( -+Builtins for manipulating extended attributes (xattr). -+) -+item(tt(zsh/cap))( -+Builtins for manipulating POSIX.1e (POSIX.6) capability (privilege) sets. -+) -+item(tt(zsh/clone))( -+A builtin that can clone a running shell onto another terminal. -+) -+item(tt(zsh/compctl))( -+The tt(compctl) builtin for controlling completion. -+) -+item(tt(zsh/complete))( -+The basic completion code. -+) -+item(tt(zsh/complist))( -+Completion listing extensions. -+) -+item(tt(zsh/computil))( -+A module with utility builtins needed for the shell function based -+completion system. -+) -+item(tt(zsh/curses))( -+curses windowing commands -+) -+item(tt(zsh/datetime))( -+Some date/time commands and parameters. -+) -+item(tt(zsh/deltochar))( -+A ZLE function duplicating EMACS' tt(zap-to-char). -+) -+item(tt(zsh/example))( -+An example of how to write a module. -+) -+item(tt(zsh/files))( -+Some basic file manipulation commands as builtins. -+) -+item(tt(zsh/mapfile))( -+Access to external files via a special associative array. -+) -+item(tt(zsh/mathfunc))( -+Standard scientific functions for use in mathematical evaluations. -+) -+item(tt(zsh/newuser))( -+Arrange for files for new users to be installed. -+) -+item(tt(zsh/parameter))( -+Access to internal hash tables via special associative arrays. -+) -+item(tt(zsh/pcre))( -+Interface to the PCRE library. -+) -+item(tt(zsh/regex))( -+Interface to the POSIX regex library. -+) -+item(tt(zsh/sched))( -+A builtin that provides a timed execution facility within the shell. -+) -+item(tt(zsh/net/socket))( -+Manipulation of Unix domain sockets -+) -+item(tt(zsh/stat))( -+A builtin command interface to the tt(stat) system call. -+) -+item(tt(zsh/system))( -+A builtin interface to various low-level system features. -+) -+item(tt(zsh/net/tcp))( -+Manipulation of TCP sockets -+) -+item(tt(zsh/termcap))( -+Interface to the termcap database. -+) -+item(tt(zsh/terminfo))( -+Interface to the terminfo database. -+) -+item(tt(zsh/zftp))( -+A builtin FTP client. -+) -+item(tt(zsh/zle))( -+The Zsh Line Editor, including the tt(bindkey) and tt(vared) builtins. -+) -+item(tt(zsh/zleparameter))( -+Access to internals of the Zsh Line Editor via parameters. -+) -+item(tt(zsh/zprof))( -+A module allowing profiling for shell functions. -+) -+item(tt(zsh/zpty))( -+A builtin for starting a command in a pseudo-terminal. -+) -+item(tt(zsh/zselect))( -+Block and return when file descriptors are ready. -+) -+item(tt(zsh/zutil))( -+Some utility builtins, e.g. the one for supporting configuration via -+styles. -+) -+enditem() -+includefile(Zsh/modmenu.yo) -+texinode(The zsh/attr Module)(The zsh/cap Module)()(Zsh Modules) -+sect(The zsh/attr Module) -+includefile(Zsh/mod_attr.yo) -+texinode(The zsh/cap Module)(The zsh/clone Module)(The zsh/attr Module)(Zsh Modules) -+sect(The zsh/cap Module) -+includefile(Zsh/mod_cap.yo) -+texinode(The zsh/clone Module)(The zsh/compctl Module)(The zsh/cap Module)(Zsh Modules) -+sect(The zsh/clone Module) -+includefile(Zsh/mod_clone.yo) -+texinode(The zsh/compctl Module)(The zsh/complete Module)(The zsh/clone Module)(Zsh Modules) -+sect(The zsh/compctl Module) -+includefile(Zsh/mod_compctl.yo) -+texinode(The zsh/complete Module)(The zsh/complist Module)(The zsh/compctl Module)(Zsh Modules) -+sect(The zsh/complete Module) -+includefile(Zsh/mod_complete.yo) -+texinode(The zsh/complist Module)(The zsh/computil Module)(The zsh/complete Module)(Zsh Modules) -+sect(The zsh/complist Module) -+includefile(Zsh/mod_complist.yo) -+texinode(The zsh/computil Module)(The zsh/curses Module)(The zsh/complist Module)(Zsh Modules) -+sect(The zsh/computil Module) -+includefile(Zsh/mod_computil.yo) -+texinode(The zsh/curses Module)(The zsh/datetime Module)(The zsh/computil Module)(Zsh Modules) -+sect(The zsh/curses Module) -+includefile(Zsh/mod_curses.yo) -+texinode(The zsh/datetime Module)(The zsh/deltochar Module)(The zsh/curses Module)(Zsh Modules) -+sect(The zsh/datetime Module) -+includefile(Zsh/mod_datetime.yo) -+texinode(The zsh/deltochar Module)(The zsh/example Module)(The zsh/datetime Module)(Zsh Modules) -+sect(The zsh/deltochar Module) -+includefile(Zsh/mod_deltochar.yo) -+texinode(The zsh/example Module)(The zsh/files Module)(The zsh/deltochar Module)(Zsh Modules) -+sect(The zsh/example Module) -+includefile(Zsh/mod_example.yo) -+texinode(The zsh/files Module)(The zsh/mapfile Module)(The zsh/example Module)(Zsh Modules) -+sect(The zsh/files Module) -+includefile(Zsh/mod_files.yo) -+texinode(The zsh/mapfile Module)(The zsh/mathfunc Module)(The zsh/files Module)(Zsh Modules) -+sect(The zsh/mapfile Module) -+includefile(Zsh/mod_mapfile.yo) -+texinode(The zsh/mathfunc Module)(The zsh/newuser Module)(The zsh/mapfile Module)(Zsh Modules) -+sect(The zsh/mathfunc Module) -+includefile(Zsh/mod_mathfunc.yo) -+texinode(The zsh/newuser Module)(The zsh/parameter Module)(The zsh/mathfunc Module)(Zsh Modules) -+sect(The zsh/newuser Module) -+includefile(Zsh/mod_newuser.yo) -+texinode(The zsh/parameter Module)(The zsh/pcre Module)(The zsh/newuser Module)(Zsh Modules) -+sect(The zsh/parameter Module) -+includefile(Zsh/mod_parameter.yo) -+texinode(The zsh/pcre Module)(The zsh/regex Module)(The zsh/parameter Module)(Zsh Modules) -+sect(The zsh/pcre Module) -+includefile(Zsh/mod_pcre.yo) -+texinode(The zsh/regex Module)(The zsh/sched Module)(The zsh/pcre Module)(Zsh Modules) -+sect(The zsh/regex Module) -+includefile(Zsh/mod_regex.yo) -+texinode(The zsh/sched Module)(The zsh/net/socket Module)(The zsh/regex Module)(Zsh Modules) -+sect(The zsh/sched Module) -+includefile(Zsh/mod_sched.yo) -+texinode(The zsh/net/socket Module)(The zsh/stat Module)(The zsh/sched Module)(Zsh Modules) -+sect(The zsh/net/socket Module) -+includefile(Zsh/mod_socket.yo) -+texinode(The zsh/stat Module)(The zsh/system Module)(The zsh/net/socket Module)(Zsh Modules) -+sect(The zsh/stat Module) -+includefile(Zsh/mod_stat.yo) -+texinode(The zsh/system Module)(The zsh/net/tcp Module)(The zsh/stat Module)(Zsh Modules) -+sect(The zsh/system Module) -+includefile(Zsh/mod_system.yo) -+texinode(The zsh/net/tcp Module)(The zsh/termcap Module)(The zsh/system Module)(Zsh Modules) -+sect(The zsh/net/tcp Module) -+includefile(Zsh/mod_tcp.yo) -+texinode(The zsh/termcap Module)(The zsh/terminfo Module)(The zsh/net/tcp Module)(Zsh Modules) -+sect(The zsh/termcap Module) -+includefile(Zsh/mod_termcap.yo) -+texinode(The zsh/terminfo Module)(The zsh/zftp Module)(The zsh/termcap Module)(Zsh Modules) -+sect(The zsh/terminfo Module) -+includefile(Zsh/mod_terminfo.yo) -+texinode(The zsh/zftp Module)(The zsh/zle Module)(The zsh/terminfo Module)(Zsh Modules) -+sect(The zsh/zftp Module) -+includefile(Zsh/mod_zftp.yo) -+texinode(The zsh/zle Module)(The zsh/zleparameter Module)(The zsh/zftp Module)(Zsh Modules) -+sect(The zsh/zle Module) -+includefile(Zsh/mod_zle.yo) -+texinode(The zsh/zleparameter Module)(The zsh/zprof Module)(The zsh/zle Module)(Zsh Modules) -+sect(The zsh/zleparameter Module) -+includefile(Zsh/mod_zleparameter.yo) -+texinode(The zsh/zprof Module)(The zsh/zpty Module)(The zsh/zleparameter Module)(Zsh Modules) -+sect(The zsh/zprof Module) -+includefile(Zsh/mod_zprof.yo) -+texinode(The zsh/zpty Module)(The zsh/zselect Module)(The zsh/zprof Module)(Zsh Modules) -+sect(The zsh/zpty Module) -+includefile(Zsh/mod_zpty.yo) -+texinode(The zsh/zselect Module)(The zsh/zutil Module)(The zsh/zpty Module)(Zsh Modules) -+sect(The zsh/zselect Module) -+includefile(Zsh/mod_zselect.yo) -+texinode(The zsh/zutil Module)()(The zsh/zselect Module)(Zsh Modules) -+sect(The zsh/zutil Module) -+includefile(Zsh/mod_zutil.yo) ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/modmenu.yo -@@ -0,0 +1,34 @@ -+startmenu() -+menu(The zsh/attr Module) -+menu(The zsh/cap Module) -+menu(The zsh/clone Module) -+menu(The zsh/compctl Module) -+menu(The zsh/complete Module) -+menu(The zsh/complist Module) -+menu(The zsh/computil Module) -+menu(The zsh/curses Module) -+menu(The zsh/datetime Module) -+menu(The zsh/deltochar Module) -+menu(The zsh/example Module) -+menu(The zsh/files Module) -+menu(The zsh/mapfile Module) -+menu(The zsh/mathfunc Module) -+menu(The zsh/newuser Module) -+menu(The zsh/parameter Module) -+menu(The zsh/pcre Module) -+menu(The zsh/regex Module) -+menu(The zsh/sched Module) -+menu(The zsh/net/socket Module) -+menu(The zsh/stat Module) -+menu(The zsh/system Module) -+menu(The zsh/net/tcp Module) -+menu(The zsh/termcap Module) -+menu(The zsh/terminfo Module) -+menu(The zsh/zftp Module) -+menu(The zsh/zle Module) -+menu(The zsh/zleparameter Module) -+menu(The zsh/zprof Module) -+menu(The zsh/zpty Module) -+menu(The zsh/zselect Module) -+menu(The zsh/zutil Module) -+endmenu() ---- /dev/null -+++ zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/manmodmenu.yo -@@ -0,0 +1,32 @@ -+menu(The zsh/attr Module) -+menu(The zsh/cap Module) -+menu(The zsh/clone Module) -+menu(The zsh/compctl Module) -+menu(The zsh/complete Module) -+menu(The zsh/complist Module) -+menu(The zsh/computil Module) -+menu(The zsh/curses Module) -+menu(The zsh/datetime Module) -+menu(The zsh/deltochar Module) -+menu(The zsh/example Module) -+menu(The zsh/files Module) -+menu(The zsh/mapfile Module) -+menu(The zsh/mathfunc Module) -+menu(The zsh/newuser Module) -+menu(The zsh/parameter Module) -+menu(The zsh/pcre Module) -+menu(The zsh/regex Module) -+menu(The zsh/sched Module) -+menu(The zsh/net/socket Module) -+menu(The zsh/stat Module) -+menu(The zsh/system Module) -+menu(The zsh/net/tcp Module) -+menu(The zsh/termcap Module) -+menu(The zsh/terminfo Module) -+menu(The zsh/zftp Module) -+menu(The zsh/zle Module) -+menu(The zsh/zleparameter Module) -+menu(The zsh/zprof Module) -+menu(The zsh/zpty Module) -+menu(The zsh/zselect Module) -+menu(The zsh/zutil Module) diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/patches/ergh zsh-beta-4.3.12-dev-1+20110925/debian/patches/ergh --- zsh-beta-4.3.11-dev-1+20110504/debian/patches/ergh 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/patches/ergh 2011-10-11 02:54:02.000000000 +0000 @@ -0,0 +1,82850 @@ +Description: + TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + zsh-beta (4.3.12-dev-1+20110925-1) unstable; urgency=low + . + * Update to HEAD. +Author: Clint Adams + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: , +Bug: +Bug-Debian: http://bugs.debian.org/ +Bug-Ubuntu: https://launchpad.net/bugs/ +Forwarded: +Reviewed-By: +Last-Update: + +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/configure +@@ -0,0 +1,14159 @@ ++#! /bin/sh ++# Guess values for system-dependent variables and create Makefiles. ++# Generated by GNU Autoconf 2.68. ++# ++# ++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, ++# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software ++# Foundation, Inc. ++# ++# ++# This configure script is free software; the Free Software Foundation ++# gives unlimited permission to copy, distribute and modify it. ++## -------------------- ## ++## M4sh Initialization. ## ++## -------------------- ## ++ ++# Be more Bourne compatible ++DUALCASE=1; export DUALCASE # for MKS sh ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++ emulate sh ++ NULLCMD=: ++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++ setopt NO_GLOB_SUBST ++else ++ case `(set -o) 2>/dev/null` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; ++esac ++fi ++ ++ ++as_nl=' ++' ++export as_nl ++# Printing a long string crashes Solaris 7 /usr/bin/printf. ++as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo ++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo ++# Prefer a ksh shell builtin over an external printf program on Solaris, ++# but without wasting forks for bash or zsh. ++if test -z "$BASH_VERSION$ZSH_VERSION" \ ++ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='print -r --' ++ as_echo_n='print -rn --' ++elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='printf %s\n' ++ as_echo_n='printf %s' ++else ++ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then ++ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' ++ as_echo_n='/usr/ucb/echo -n' ++ else ++ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' ++ as_echo_n_body='eval ++ arg=$1; ++ case $arg in #( ++ *"$as_nl"*) ++ expr "X$arg" : "X\\(.*\\)$as_nl"; ++ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; ++ esac; ++ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ++ ' ++ export as_echo_n_body ++ as_echo_n='sh -c $as_echo_n_body as_echo' ++ fi ++ export as_echo_body ++ as_echo='sh -c $as_echo_body as_echo' ++fi ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ PATH_SEPARATOR=: ++ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { ++ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || ++ PATH_SEPARATOR=';' ++ } ++fi ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. Quoting is ++# there to prevent editors from complaining about space-tab. ++# (If _AS_PATH_WALK were called with IFS unset, it would disable word ++# splitting by setting IFS to empty value.) ++IFS=" "" $as_nl" ++ ++# Find who we are. Look in the path if we contain no directory separator. ++as_myself= ++case $0 in #(( ++ *[\\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++# We did not find ourselves, most probably we were run as `sh COMMAND' ++# in which case we are not to be found in the path. ++if test "x$as_myself" = x; then ++ as_myself=$0 ++fi ++if test ! -f "$as_myself"; then ++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ exit 1 ++fi ++ ++# Unset variables that we do not need and which cause bugs (e.g. in ++# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" ++# suppresses any "Segmentation fault" message there. '((' could ++# trigger a bug in pdksh 5.2.14. ++for as_var in BASH_ENV ENV MAIL MAILPATH ++do eval test x\${$as_var+set} = xset \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# CDPATH. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH ++ ++if test "x$CONFIG_SHELL" = x; then ++ as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : ++ emulate sh ++ NULLCMD=: ++ # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '\${1+\"\$@\"}'='\"\$@\"' ++ setopt NO_GLOB_SUBST ++else ++ case \`(set -o) 2>/dev/null\` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; ++esac ++fi ++" ++ as_required="as_fn_return () { (exit \$1); } ++as_fn_success () { as_fn_return 0; } ++as_fn_failure () { as_fn_return 1; } ++as_fn_ret_success () { return 0; } ++as_fn_ret_failure () { return 1; } ++ ++exitcode=0 ++as_fn_success || { exitcode=1; echo as_fn_success failed.; } ++as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } ++as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } ++as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } ++if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : ++ ++else ++ exitcode=1; echo positional parameters were not saved. ++fi ++test x\$exitcode = x0 || exit 1" ++ as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO ++ as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO ++ eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && ++ test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 ++test \$(( 1 + 1 )) = 2 || exit 1" ++ if (eval "$as_required") 2>/dev/null; then : ++ as_have_required=yes ++else ++ as_have_required=no ++fi ++ if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : ++ ++else ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++as_found=false ++for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ as_found=: ++ case $as_dir in #( ++ /*) ++ for as_base in sh bash ksh sh5; do ++ # Try only shells that exist, to save several forks. ++ as_shell=$as_dir/$as_base ++ if { test -f "$as_shell" || test -f "$as_shell.exe"; } && ++ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ CONFIG_SHELL=$as_shell as_have_required=yes ++ if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : ++ break 2 ++fi ++fi ++ done;; ++ esac ++ as_found=false ++done ++$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && ++ { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : ++ CONFIG_SHELL=$SHELL as_have_required=yes ++fi; } ++IFS=$as_save_IFS ++ ++ ++ if test "x$CONFIG_SHELL" != x; then : ++ # We cannot yet assume a decent shell, so we have to provide a ++ # neutralization value for shells without unset; and this also ++ # works around shells that cannot unset nonexistent variables. ++ # Preserve -v and -x to the replacement shell. ++ BASH_ENV=/dev/null ++ ENV=/dev/null ++ (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV ++ export CONFIG_SHELL ++ case $- in # (((( ++ *v*x* | *x*v* ) as_opts=-vx ;; ++ *v* ) as_opts=-v ;; ++ *x* ) as_opts=-x ;; ++ * ) as_opts= ;; ++ esac ++ exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} ++fi ++ ++ if test x$as_have_required = xno; then : ++ $as_echo "$0: This script requires a shell more modern than all" ++ $as_echo "$0: the shells that I found on your system." ++ if test x${ZSH_VERSION+set} = xset ; then ++ $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" ++ $as_echo "$0: be upgraded to zsh 4.3.4 or later." ++ else ++ $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, ++$0: including any error possibly output before this ++$0: message. Then install a modern shell, or manually run ++$0: the script under such a shell if you do have one." ++ fi ++ exit 1 ++fi ++fi ++fi ++SHELL=${CONFIG_SHELL-/bin/sh} ++export SHELL ++# Unset more variables known to interfere with behavior of common tools. ++CLICOLOR_FORCE= GREP_OPTIONS= ++unset CLICOLOR_FORCE GREP_OPTIONS ++ ++## --------------------- ## ++## M4sh Shell Functions. ## ++## --------------------- ## ++# as_fn_unset VAR ++# --------------- ++# Portably unset VAR. ++as_fn_unset () ++{ ++ { eval $1=; unset $1;} ++} ++as_unset=as_fn_unset ++ ++# as_fn_set_status STATUS ++# ----------------------- ++# Set $? to STATUS, without forking. ++as_fn_set_status () ++{ ++ return $1 ++} # as_fn_set_status ++ ++# as_fn_exit STATUS ++# ----------------- ++# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. ++as_fn_exit () ++{ ++ set +e ++ as_fn_set_status $1 ++ exit $1 ++} # as_fn_exit ++ ++# as_fn_mkdir_p ++# ------------- ++# Create "$as_dir" as a directory, including parents if necessary. ++as_fn_mkdir_p () ++{ ++ ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || eval $as_mkdir_p || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *) as_qdir=$as_dir;; ++ esac ++ as_dirs="'$as_qdir' $as_dirs" ++ as_dir=`$as_dirname -- "$as_dir" || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ test -d "$as_dir" && break ++ done ++ test -z "$as_dirs" || eval "mkdir $as_dirs" ++ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ ++ ++} # as_fn_mkdir_p ++# as_fn_append VAR VALUE ++# ---------------------- ++# Append the text in VALUE to the end of the definition contained in VAR. Take ++# advantage of any shell optimizations that allow amortized linear growth over ++# repeated appends, instead of the typical quadratic growth present in naive ++# implementations. ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++ eval 'as_fn_append () ++ { ++ eval $1+=\$2 ++ }' ++else ++ as_fn_append () ++ { ++ eval $1=\$$1\$2 ++ } ++fi # as_fn_append ++ ++# as_fn_arith ARG... ++# ------------------ ++# Perform arithmetic evaluation on the ARGs, and store the result in the ++# global $as_val. Take advantage of shells that can avoid forks. The arguments ++# must be portable across $(()) and expr. ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++ eval 'as_fn_arith () ++ { ++ as_val=$(( $* )) ++ }' ++else ++ as_fn_arith () ++ { ++ as_val=`expr "$@" || test $? -eq 1` ++ } ++fi # as_fn_arith ++ ++ ++# as_fn_error STATUS ERROR [LINENO LOG_FD] ++# ---------------------------------------- ++# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are ++# provided, also output the error to LOG_FD, referencing LINENO. Then exit the ++# script with STATUS, using 1 if that was 0. ++as_fn_error () ++{ ++ as_status=$1; test $as_status -eq 0 && as_status=1 ++ if test "$4"; then ++ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ fi ++ $as_echo "$as_me: error: $2" >&2 ++ as_fn_exit $as_status ++} # as_fn_error ++ ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi ++ ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits ++ ++ ++ as_lineno_1=$LINENO as_lineno_1a=$LINENO ++ as_lineno_2=$LINENO as_lineno_2a=$LINENO ++ eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && ++ test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { ++ # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) ++ sed -n ' ++ p ++ /[$]LINENO/= ++ ' <$as_myself | ++ sed ' ++ s/[$]LINENO.*/&-/ ++ t lineno ++ b ++ :lineno ++ N ++ :loop ++ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ ++ t loop ++ s/-\n.*// ++ ' >$as_me.lineno && ++ chmod +x "$as_me.lineno" || ++ { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } ++ ++ # Don't try to exec as it changes $[0], causing all sort of problems ++ # (the dirname of $[0] is not the place where we might find the ++ # original and so on. Autoconf is especially sensitive to this). ++ . "./$as_me.lineno" ++ # Exit status is that of the last command. ++ exit ++} ++ ++ECHO_C= ECHO_N= ECHO_T= ++case `echo -n x` in #((((( ++-n*) ++ case `echo 'xy\c'` in ++ *c*) ECHO_T=' ';; # ECHO_T is single tab character. ++ xy) ECHO_C='\c';; ++ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ++ ECHO_T=' ';; ++ esac;; ++*) ++ ECHO_N='-n';; ++esac ++ ++rm -f conf$$ conf$$.exe conf$$.file ++if test -d conf$$.dir; then ++ rm -f conf$$.dir/conf$$.file ++else ++ rm -f conf$$.dir ++ mkdir conf$$.dir 2>/dev/null ++fi ++if (echo >conf$$.file) 2>/dev/null; then ++ if ln -s conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s='ln -s' ++ # ... but there are two gotchas: ++ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. ++ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. ++ # In both cases, we have to default to `cp -p'. ++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || ++ as_ln_s='cp -p' ++ elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++ else ++ as_ln_s='cp -p' ++ fi ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file ++rmdir conf$$.dir 2>/dev/null ++ ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p='mkdir -p "$as_dir"' ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in #( ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++test -n "$DJDIR" || exec 7<&0 &1 ++ ++# Name of the host. ++# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, ++# so uname gets run too. ++ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` ++ ++# ++# Initializations. ++# ++ac_default_prefix=/usr/local ++ac_clean_files= ++ac_config_libobj_dir=. ++LIBOBJS= ++cross_compiling=no ++subdirs= ++MFLAGS= ++MAKEFLAGS= ++ ++# Identity of this package. ++PACKAGE_NAME= ++PACKAGE_TARNAME= ++PACKAGE_VERSION= ++PACKAGE_STRING= ++PACKAGE_BUGREPORT= ++PACKAGE_URL= ++ ++ac_unique_file="Src/zsh.h" ++# Factoring default headers for most tests. ++ac_includes_default="\ ++#include ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_STAT_H ++# include ++#endif ++#ifdef STDC_HEADERS ++# include ++# include ++#else ++# ifdef HAVE_STDLIB_H ++# include ++# endif ++#endif ++#ifdef HAVE_STRING_H ++# if !defined STDC_HEADERS && defined HAVE_MEMORY_H ++# include ++# endif ++# include ++#endif ++#ifdef HAVE_STRINGS_H ++# include ++#endif ++#ifdef HAVE_INTTYPES_H ++# include ++#endif ++#ifdef HAVE_STDINT_H ++# include ++#endif ++#ifdef HAVE_UNISTD_H ++# include ++#endif" ++ ++ac_header_list= ++ac_subst_vars='LTLIBOBJS ++LIBOBJS ++EXTRAZSHOBJS ++MOD_IMPORT_FUNCTION ++MOD_IMPORT_VARIABLE ++MOD_EXPORT ++LINKMODS ++L ++IMPOPT ++EXPOPT ++EXTRA_LDFLAGS ++E ++DLLDFLAGS ++DLCFLAGS ++DLLD ++DL_EXT ++D ++UNINSTLIB ++INSTLIB ++SHORTBOOTNAMES ++RLIMITS_INC_H ++ZSH_TERM_H ++CURSES_KEYS_H ++ZSH_CURSES_H ++ERRNO_H ++SIGNAL_H ++PCRECONF ++ANSI2KNR ++TEXI2HTML ++TEXI2PDF ++PDFETEX ++YODL_OPTIONS ++YODL ++LN ++AWK ++INSTALL_DATA ++INSTALL_SCRIPT ++INSTALL_PROGRAM ++SET_MAKE ++ALLOCA ++U ++EGREP ++GREP ++CPP ++LIBLDFLAGS ++EXELDFLAGS ++OBJEXT ++EXEEXT ++ac_ct_CC ++CPPFLAGS ++LDFLAGS ++CFLAGS ++CC ++sitescriptdir ++scriptdir ++FUNCTIONS_SUBDIRS ++sitefndir ++fndir ++additionalfpath ++zlogout ++zlogin ++zprofile ++zshrc ++zshenv ++tzsh ++host_os ++host_vendor ++host_cpu ++host ++build_os ++build_vendor ++build_cpu ++build ++target_alias ++host_alias ++build_alias ++LIBS ++ECHO_T ++ECHO_N ++ECHO_C ++DEFS ++mandir ++localedir ++libdir ++psdir ++pdfdir ++dvidir ++htmldir ++infodir ++docdir ++oldincludedir ++includedir ++localstatedir ++sharedstatedir ++sysconfdir ++datadir ++datarootdir ++libexecdir ++sbindir ++bindir ++program_transform_name ++prefix ++exec_prefix ++PACKAGE_URL ++PACKAGE_BUGREPORT ++PACKAGE_STRING ++PACKAGE_VERSION ++PACKAGE_TARNAME ++PACKAGE_NAME ++PATH_SEPARATOR ++SHELL' ++ac_subst_files='CLEAN_MK ++CONFIG_MK ++DEFS_MK ++VERSION_MK' ++ac_user_opts=' ++enable_option_checking ++enable_cppflags ++enable_cflags ++enable_ldflags ++enable_libs ++enable_zsh_debug ++enable_zsh_mem ++enable_zsh_mem_debug ++enable_zsh_mem_warning ++enable_zsh_secure_free ++enable_zsh_heap_debug ++enable_zsh_hash_debug ++enable_etcdir ++enable_zshenv ++enable_zshrc ++enable_zprofile ++enable_zlogin ++enable_zlogout ++enable_dynamic ++enable_restricted_r ++enable_locale ++enable_ansi2knr ++enable_fndir ++enable_site_fndir ++enable_function_subdirs ++enable_additional_fpath ++enable_scriptdir ++enable_site_scriptdir ++enable_custom_patchlevel ++enable_maildir_support ++enable_max_function_depth ++enable_readnullcmd ++enable_pcre ++enable_cap ++enable_gdbm ++enable_largefile ++with_term_lib ++with_tcsetpgrp ++enable_multibyte ++enable_libc_musl ++enable_dynamic_nss ++' ++ ac_precious_vars='build_alias ++host_alias ++target_alias ++CC ++CFLAGS ++LDFLAGS ++LIBS ++CPPFLAGS ++CPP' ++ ++ ++# Initialize some variables set by options. ++ac_init_help= ++ac_init_version=false ++ac_unrecognized_opts= ++ac_unrecognized_sep= ++# The variables have the same names as the options, with ++# dashes changed to underlines. ++cache_file=/dev/null ++exec_prefix=NONE ++no_create= ++no_recursion= ++prefix=NONE ++program_prefix=NONE ++program_suffix=NONE ++program_transform_name=s,x,x, ++silent= ++site= ++srcdir= ++verbose= ++x_includes=NONE ++x_libraries=NONE ++ ++# Installation directory options. ++# These are left unexpanded so users can "make install exec_prefix=/foo" ++# and all the variables that are supposed to be based on exec_prefix ++# by default will actually change. ++# Use braces instead of parens because sh, perl, etc. also accept them. ++# (The list follows the same order as the GNU Coding Standards.) ++bindir='${exec_prefix}/bin' ++sbindir='${exec_prefix}/sbin' ++libexecdir='${exec_prefix}/libexec' ++datarootdir='${prefix}/share' ++datadir='${datarootdir}' ++sysconfdir='${prefix}/etc' ++sharedstatedir='${prefix}/com' ++localstatedir='${prefix}/var' ++includedir='${prefix}/include' ++oldincludedir='/usr/include' ++docdir='${datarootdir}/doc/${PACKAGE}' ++infodir='${datarootdir}/info' ++htmldir='${docdir}' ++dvidir='${docdir}' ++pdfdir='${docdir}' ++psdir='${docdir}' ++libdir='${exec_prefix}/lib' ++localedir='${datarootdir}/locale' ++mandir='${datarootdir}/man' ++ ++ac_prev= ++ac_dashdash= ++for ac_option ++do ++ # If the previous option needs an argument, assign it. ++ if test -n "$ac_prev"; then ++ eval $ac_prev=\$ac_option ++ ac_prev= ++ continue ++ fi ++ ++ case $ac_option in ++ *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; ++ *=) ac_optarg= ;; ++ *) ac_optarg=yes ;; ++ esac ++ ++ # Accept the important Cygnus configure options, so we can diagnose typos. ++ ++ case $ac_dashdash$ac_option in ++ --) ++ ac_dashdash=yes ;; ++ ++ -bindir | --bindir | --bindi | --bind | --bin | --bi) ++ ac_prev=bindir ;; ++ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) ++ bindir=$ac_optarg ;; ++ ++ -build | --build | --buil | --bui | --bu) ++ ac_prev=build_alias ;; ++ -build=* | --build=* | --buil=* | --bui=* | --bu=*) ++ build_alias=$ac_optarg ;; ++ ++ -cache-file | --cache-file | --cache-fil | --cache-fi \ ++ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ++ ac_prev=cache_file ;; ++ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ ++ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) ++ cache_file=$ac_optarg ;; ++ ++ --config-cache | -C) ++ cache_file=config.cache ;; ++ ++ -datadir | --datadir | --datadi | --datad) ++ ac_prev=datadir ;; ++ -datadir=* | --datadir=* | --datadi=* | --datad=*) ++ datadir=$ac_optarg ;; ++ ++ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ ++ | --dataroo | --dataro | --datar) ++ ac_prev=datarootdir ;; ++ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ ++ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) ++ datarootdir=$ac_optarg ;; ++ ++ -disable-* | --disable-*) ++ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error $? "invalid feature name: $ac_useropt" ++ ac_useropt_orig=$ac_useropt ++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ case $ac_user_opts in ++ *" ++"enable_$ac_useropt" ++"*) ;; ++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ++ ac_unrecognized_sep=', ';; ++ esac ++ eval enable_$ac_useropt=no ;; ++ ++ -docdir | --docdir | --docdi | --doc | --do) ++ ac_prev=docdir ;; ++ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) ++ docdir=$ac_optarg ;; ++ ++ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ++ ac_prev=dvidir ;; ++ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) ++ dvidir=$ac_optarg ;; ++ ++ -enable-* | --enable-*) ++ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error $? "invalid feature name: $ac_useropt" ++ ac_useropt_orig=$ac_useropt ++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ case $ac_user_opts in ++ *" ++"enable_$ac_useropt" ++"*) ;; ++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ++ ac_unrecognized_sep=', ';; ++ esac ++ eval enable_$ac_useropt=\$ac_optarg ;; ++ ++ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ ++ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ ++ | --exec | --exe | --ex) ++ ac_prev=exec_prefix ;; ++ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ ++ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ ++ | --exec=* | --exe=* | --ex=*) ++ exec_prefix=$ac_optarg ;; ++ ++ -gas | --gas | --ga | --g) ++ # Obsolete; use --with-gas. ++ with_gas=yes ;; ++ ++ -help | --help | --hel | --he | -h) ++ ac_init_help=long ;; ++ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ++ ac_init_help=recursive ;; ++ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ++ ac_init_help=short ;; ++ ++ -host | --host | --hos | --ho) ++ ac_prev=host_alias ;; ++ -host=* | --host=* | --hos=* | --ho=*) ++ host_alias=$ac_optarg ;; ++ ++ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ++ ac_prev=htmldir ;; ++ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ ++ | --ht=*) ++ htmldir=$ac_optarg ;; ++ ++ -includedir | --includedir | --includedi | --included | --include \ ++ | --includ | --inclu | --incl | --inc) ++ ac_prev=includedir ;; ++ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ ++ | --includ=* | --inclu=* | --incl=* | --inc=*) ++ includedir=$ac_optarg ;; ++ ++ -infodir | --infodir | --infodi | --infod | --info | --inf) ++ ac_prev=infodir ;; ++ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) ++ infodir=$ac_optarg ;; ++ ++ -libdir | --libdir | --libdi | --libd) ++ ac_prev=libdir ;; ++ -libdir=* | --libdir=* | --libdi=* | --libd=*) ++ libdir=$ac_optarg ;; ++ ++ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ ++ | --libexe | --libex | --libe) ++ ac_prev=libexecdir ;; ++ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ ++ | --libexe=* | --libex=* | --libe=*) ++ libexecdir=$ac_optarg ;; ++ ++ -localedir | --localedir | --localedi | --localed | --locale) ++ ac_prev=localedir ;; ++ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) ++ localedir=$ac_optarg ;; ++ ++ -localstatedir | --localstatedir | --localstatedi | --localstated \ ++ | --localstate | --localstat | --localsta | --localst | --locals) ++ ac_prev=localstatedir ;; ++ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ ++ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) ++ localstatedir=$ac_optarg ;; ++ ++ -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ++ ac_prev=mandir ;; ++ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) ++ mandir=$ac_optarg ;; ++ ++ -nfp | --nfp | --nf) ++ # Obsolete; use --without-fp. ++ with_fp=no ;; ++ ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ++ | --no-cr | --no-c | -n) ++ no_create=yes ;; ++ ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ++ no_recursion=yes ;; ++ ++ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ ++ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ ++ | --oldin | --oldi | --old | --ol | --o) ++ ac_prev=oldincludedir ;; ++ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ ++ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ ++ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) ++ oldincludedir=$ac_optarg ;; ++ ++ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ++ ac_prev=prefix ;; ++ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ++ prefix=$ac_optarg ;; ++ ++ -program-prefix | --program-prefix | --program-prefi | --program-pref \ ++ | --program-pre | --program-pr | --program-p) ++ ac_prev=program_prefix ;; ++ -program-prefix=* | --program-prefix=* | --program-prefi=* \ ++ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) ++ program_prefix=$ac_optarg ;; ++ ++ -program-suffix | --program-suffix | --program-suffi | --program-suff \ ++ | --program-suf | --program-su | --program-s) ++ ac_prev=program_suffix ;; ++ -program-suffix=* | --program-suffix=* | --program-suffi=* \ ++ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) ++ program_suffix=$ac_optarg ;; ++ ++ -program-transform-name | --program-transform-name \ ++ | --program-transform-nam | --program-transform-na \ ++ | --program-transform-n | --program-transform- \ ++ | --program-transform | --program-transfor \ ++ | --program-transfo | --program-transf \ ++ | --program-trans | --program-tran \ ++ | --progr-tra | --program-tr | --program-t) ++ ac_prev=program_transform_name ;; ++ -program-transform-name=* | --program-transform-name=* \ ++ | --program-transform-nam=* | --program-transform-na=* \ ++ | --program-transform-n=* | --program-transform-=* \ ++ | --program-transform=* | --program-transfor=* \ ++ | --program-transfo=* | --program-transf=* \ ++ | --program-trans=* | --program-tran=* \ ++ | --progr-tra=* | --program-tr=* | --program-t=*) ++ program_transform_name=$ac_optarg ;; ++ ++ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ++ ac_prev=pdfdir ;; ++ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) ++ pdfdir=$ac_optarg ;; ++ ++ -psdir | --psdir | --psdi | --psd | --ps) ++ ac_prev=psdir ;; ++ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) ++ psdir=$ac_optarg ;; ++ ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil) ++ silent=yes ;; ++ ++ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ++ ac_prev=sbindir ;; ++ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ ++ | --sbi=* | --sb=*) ++ sbindir=$ac_optarg ;; ++ ++ -sharedstatedir | --sharedstatedir | --sharedstatedi \ ++ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ ++ | --sharedst | --shareds | --shared | --share | --shar \ ++ | --sha | --sh) ++ ac_prev=sharedstatedir ;; ++ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ ++ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ ++ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ ++ | --sha=* | --sh=*) ++ sharedstatedir=$ac_optarg ;; ++ ++ -site | --site | --sit) ++ ac_prev=site ;; ++ -site=* | --site=* | --sit=*) ++ site=$ac_optarg ;; ++ ++ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ++ ac_prev=srcdir ;; ++ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ++ srcdir=$ac_optarg ;; ++ ++ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ ++ | --syscon | --sysco | --sysc | --sys | --sy) ++ ac_prev=sysconfdir ;; ++ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ ++ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) ++ sysconfdir=$ac_optarg ;; ++ ++ -target | --target | --targe | --targ | --tar | --ta | --t) ++ ac_prev=target_alias ;; ++ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) ++ target_alias=$ac_optarg ;; ++ ++ -v | -verbose | --verbose | --verbos | --verbo | --verb) ++ verbose=yes ;; ++ ++ -version | --version | --versio | --versi | --vers | -V) ++ ac_init_version=: ;; ++ ++ -with-* | --with-*) ++ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error $? "invalid package name: $ac_useropt" ++ ac_useropt_orig=$ac_useropt ++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ case $ac_user_opts in ++ *" ++"with_$ac_useropt" ++"*) ;; ++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ++ ac_unrecognized_sep=', ';; ++ esac ++ eval with_$ac_useropt=\$ac_optarg ;; ++ ++ -without-* | --without-*) ++ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` ++ # Reject names that are not valid shell variable names. ++ expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && ++ as_fn_error $? "invalid package name: $ac_useropt" ++ ac_useropt_orig=$ac_useropt ++ ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` ++ case $ac_user_opts in ++ *" ++"with_$ac_useropt" ++"*) ;; ++ *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ++ ac_unrecognized_sep=', ';; ++ esac ++ eval with_$ac_useropt=no ;; ++ ++ --x) ++ # Obsolete; use --with-x. ++ with_x=yes ;; ++ ++ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ ++ | --x-incl | --x-inc | --x-in | --x-i) ++ ac_prev=x_includes ;; ++ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ ++ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) ++ x_includes=$ac_optarg ;; ++ ++ -x-libraries | --x-libraries | --x-librarie | --x-librari \ ++ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ++ ac_prev=x_libraries ;; ++ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ ++ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) ++ x_libraries=$ac_optarg ;; ++ ++ -*) as_fn_error $? "unrecognized option: \`$ac_option' ++Try \`$0 --help' for more information" ++ ;; ++ ++ *=*) ++ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` ++ # Reject names that are not valid shell variable names. ++ case $ac_envvar in #( ++ '' | [0-9]* | *[!_$as_cr_alnum]* ) ++ as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; ++ esac ++ eval $ac_envvar=\$ac_optarg ++ export $ac_envvar ;; ++ ++ *) ++ # FIXME: should be removed in autoconf 3.0. ++ $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 ++ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && ++ $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 ++ : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ++ ;; ++ ++ esac ++done ++ ++if test -n "$ac_prev"; then ++ ac_option=--`echo $ac_prev | sed 's/_/-/g'` ++ as_fn_error $? "missing argument to $ac_option" ++fi ++ ++if test -n "$ac_unrecognized_opts"; then ++ case $enable_option_checking in ++ no) ;; ++ fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; ++ *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; ++ esac ++fi ++ ++# Check all directory arguments for consistency. ++for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ ++ datadir sysconfdir sharedstatedir localstatedir includedir \ ++ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ ++ libdir localedir mandir ++do ++ eval ac_val=\$$ac_var ++ # Remove trailing slashes. ++ case $ac_val in ++ */ ) ++ ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` ++ eval $ac_var=\$ac_val;; ++ esac ++ # Be sure to have absolute directory names. ++ case $ac_val in ++ [\\/$]* | ?:[\\/]* ) continue;; ++ NONE | '' ) case $ac_var in *prefix ) continue;; esac;; ++ esac ++ as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" ++done ++ ++# There might be people who depend on the old broken behavior: `$host' ++# used to hold the argument of --host etc. ++# FIXME: To remove some day. ++build=$build_alias ++host=$host_alias ++target=$target_alias ++ ++# FIXME: To remove some day. ++if test "x$host_alias" != x; then ++ if test "x$build_alias" = x; then ++ cross_compiling=maybe ++ $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. ++ If a cross compiler is detected then cross compile mode will be used" >&2 ++ elif test "x$build_alias" != "x$host_alias"; then ++ cross_compiling=yes ++ fi ++fi ++ ++ac_tool_prefix= ++test -n "$host_alias" && ac_tool_prefix=$host_alias- ++ ++test "$silent" = yes && exec 6>/dev/null ++ ++ ++ac_pwd=`pwd` && test -n "$ac_pwd" && ++ac_ls_di=`ls -di .` && ++ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || ++ as_fn_error $? "working directory cannot be determined" ++test "X$ac_ls_di" = "X$ac_pwd_ls_di" || ++ as_fn_error $? "pwd does not report name of working directory" ++ ++ ++# Find the source files, if location was not specified. ++if test -z "$srcdir"; then ++ ac_srcdir_defaulted=yes ++ # Try the directory containing this script, then the parent directory. ++ ac_confdir=`$as_dirname -- "$as_myself" || ++$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_myself" : 'X\(//\)[^/]' \| \ ++ X"$as_myself" : 'X\(//\)$' \| \ ++ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$as_myself" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ srcdir=$ac_confdir ++ if test ! -r "$srcdir/$ac_unique_file"; then ++ srcdir=.. ++ fi ++else ++ ac_srcdir_defaulted=no ++fi ++if test ! -r "$srcdir/$ac_unique_file"; then ++ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." ++ as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" ++fi ++ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ++ac_abs_confdir=`( ++ cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" ++ pwd)` ++# When building in place, set srcdir=. ++if test "$ac_abs_confdir" = "$ac_pwd"; then ++ srcdir=. ++fi ++# Remove unnecessary trailing slashes from srcdir. ++# Double slashes in file names in object file debugging info ++# mess up M-x gdb in Emacs. ++case $srcdir in ++*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; ++esac ++for ac_var in $ac_precious_vars; do ++ eval ac_env_${ac_var}_set=\${${ac_var}+set} ++ eval ac_env_${ac_var}_value=\$${ac_var} ++ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} ++ eval ac_cv_env_${ac_var}_value=\$${ac_var} ++done ++ ++# ++# Report the --help message. ++# ++if test "$ac_init_help" = "long"; then ++ # Omit some internal or obsolete options to make the list less imposing. ++ # This message is too long to be a string in the A/UX 3.1 sh. ++ cat <<_ACEOF ++\`configure' configures this package to adapt to many kinds of systems. ++ ++Usage: $0 [OPTION]... [VAR=VALUE]... ++ ++To assign environment variables (e.g., CC, CFLAGS...), specify them as ++VAR=VALUE. See below for descriptions of some of the useful variables. ++ ++Defaults for the options are specified in brackets. ++ ++Configuration: ++ -h, --help display this help and exit ++ --help=short display options specific to this package ++ --help=recursive display the short help of all the included packages ++ -V, --version display version information and exit ++ -q, --quiet, --silent do not print \`checking ...' messages ++ --cache-file=FILE cache test results in FILE [disabled] ++ -C, --config-cache alias for \`--cache-file=config.cache' ++ -n, --no-create do not create output files ++ --srcdir=DIR find the sources in DIR [configure dir or \`..'] ++ ++Installation directories: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [PREFIX] ++ ++By default, \`make install' will install all the files in ++\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify ++an installation prefix other than \`$ac_default_prefix' using \`--prefix', ++for instance \`--prefix=\$HOME'. ++ ++For better control, use the options below. ++ ++Fine tuning of the installation directories: ++ --bindir=DIR user executables [EPREFIX/bin] ++ --sbindir=DIR system admin executables [EPREFIX/sbin] ++ --libexecdir=DIR program executables [EPREFIX/libexec] ++ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] ++ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] ++ --localstatedir=DIR modifiable single-machine data [PREFIX/var] ++ --libdir=DIR object code libraries [EPREFIX/lib] ++ --includedir=DIR C header files [PREFIX/include] ++ --oldincludedir=DIR C header files for non-gcc [/usr/include] ++ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] ++ --datadir=DIR read-only architecture-independent data [DATAROOTDIR] ++ --infodir=DIR info documentation [DATAROOTDIR/info] ++ --localedir=DIR locale-dependent data [DATAROOTDIR/locale] ++ --mandir=DIR man documentation [DATAROOTDIR/man] ++ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] ++ --htmldir=DIR html documentation [DOCDIR] ++ --dvidir=DIR dvi documentation [DOCDIR] ++ --pdfdir=DIR pdf documentation [DOCDIR] ++ --psdir=DIR ps documentation [DOCDIR] ++_ACEOF ++ ++ cat <<\_ACEOF ++ ++Program names: ++ --program-prefix=PREFIX prepend PREFIX to installed program names ++ --program-suffix=SUFFIX append SUFFIX to installed program names ++ --program-transform-name=PROGRAM run sed PROGRAM on installed program names ++ ++System types: ++ --build=BUILD configure for building on BUILD [guessed] ++ --host=HOST cross-compile to build programs to run on HOST [BUILD] ++_ACEOF ++fi ++ ++if test -n "$ac_init_help"; then ++ ++ cat <<\_ACEOF ++ ++Optional Features: ++ --disable-option-checking ignore unrecognized --enable/--with options ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --enable-cppflags=... specify C preprocessor flags ++ --enable-cflags=... specify C compiler flags ++ --enable-ldflags=... specify linker flags ++ --enable-libs=... specify link libraries ++ --enable-zsh-debug compile with debug code and debugger symbols ++ --enable-zsh-mem compile with zsh memory allocation routines ++ --enable-zsh-mem-debug debug zsh memory allocation routines ++ --enable-zsh-mem-warning ++ print warnings for errors in memory allocation ++ --enable-zsh-secure-free ++ turn on error checking for free() ++ --enable-zsh-heap-debug turn on error checking for heap allocation ++ --enable-zsh-hash-debug turn on debugging of internal hash tables ++ --enable-etcdir=DIR the default directory for global zsh scripts ++ --enable-zshenv=FILE the full pathname of the global zshenv script ++ --enable-zshrc=FILE the full pathname of the global zshrc script ++ --enable-zprofile=FILE the full pathname of the global zprofile script ++ --enable-zlogin=FILE the full pathname of the global zlogin script ++ --enable-zlogout=FILE the full pathname of the global zlogout script ++ --disable-dynamic turn off dynamically loaded binary modules ++ --disable-restricted-r turn off r* invocation for restricted shell ++ --disable-locale turn off locale features ++ --enable-ansi2knr translate source to K&R C before compiling ++ --enable-fndir=DIR the directory in which to install functions ++ --enable-site-fndir=DIR same for site functions (not version specific) ++ --enable-function-subdirs ++ install functions in subdirectories ++ --enable-additional-fpath=DIR ++ add directories to default function path ++ --enable-scriptdir=DIR the directory in which to install scripts ++ --enable-site-scriptdir=DIR ++ same for site scripts (not version specific) ++ --enable-custom-patchlevel ++ set a custom ZSH_PATCHLEVEL value ++ --enable-maildir-support ++ enable maildir support in MAIL and MAILPATH ++ --enable-max-function-depth=MAX ++ limit function depth to MAX, default 1000 ++ --enable-readnullcmd=PAGER ++ pager used when READNULLCMD is not set ++ --enable-pcre enable the search for the pcre library (may create ++ run-time library dependencies) ++ --enable-cap enable the search for POSIX capabilities (may ++ require additional headers to be added by hand) ++ --disable-gdbm turn off search for gdbm library ++ --disable-largefile omit support for large files ++ --enable-multibyte support multibyte characters ++ --enable-libc-musl compile with musl as the C library ++ --disable-dynamic-nss do not call functions that will require dynamic NSS ++ modules ++ ++Optional Packages: ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --with-term-lib=LIBS search space-separated LIBS for terminal handling ++ --with-tcsetpgrp assumes that tcsetpgrp() exists and works correctly ++ ++Some influential environment variables: ++ CC C compiler command ++ CFLAGS C compiler flags ++ LDFLAGS linker flags, e.g. -L if you have libraries in a ++ nonstandard directory ++ LIBS libraries to pass to the linker, e.g. -l ++ CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if ++ you have headers in a nonstandard directory ++ CPP C preprocessor ++ ++Use these variables to override the choices made by `configure' or to help ++it to find libraries and programs with nonstandard names/locations. ++ ++Report bugs to the package provider. ++_ACEOF ++ac_status=$? ++fi ++ ++if test "$ac_init_help" = "recursive"; then ++ # If there are subdirs, report their specific --help. ++ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue ++ test -d "$ac_dir" || ++ { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || ++ continue ++ ac_builddir=. ++ ++case "$ac_dir" in ++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; ++*) ++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ # A ".." for each directory in $ac_dir_suffix. ++ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` ++ case $ac_top_builddir_sub in ++ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; ++ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; ++ esac ;; ++esac ++ac_abs_top_builddir=$ac_pwd ++ac_abs_builddir=$ac_pwd$ac_dir_suffix ++# for backward compatibility: ++ac_top_builddir=$ac_top_build_prefix ++ ++case $srcdir in ++ .) # We are building in place. ++ ac_srcdir=. ++ ac_top_srcdir=$ac_top_builddir_sub ++ ac_abs_top_srcdir=$ac_pwd ;; ++ [\\/]* | ?:[\\/]* ) # Absolute name. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ++ ac_abs_top_srcdir=$srcdir ;; ++ *) # Relative name. ++ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_build_prefix$srcdir ++ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; ++esac ++ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ++ ++ cd "$ac_dir" || { ac_status=$?; continue; } ++ # Check for guested configure. ++ if test -f "$ac_srcdir/configure.gnu"; then ++ echo && ++ $SHELL "$ac_srcdir/configure.gnu" --help=recursive ++ elif test -f "$ac_srcdir/configure"; then ++ echo && ++ $SHELL "$ac_srcdir/configure" --help=recursive ++ else ++ $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 ++ fi || ac_status=$? ++ cd "$ac_pwd" || { ac_status=$?; break; } ++ done ++fi ++ ++test -n "$ac_init_help" && exit $ac_status ++if $ac_init_version; then ++ cat <<\_ACEOF ++configure ++generated by GNU Autoconf 2.68 ++ ++Copyright (C) 2010 Free Software Foundation, Inc. ++This configure script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it. ++_ACEOF ++ exit ++fi ++ ++## ------------------------ ## ++## Autoconf initialization. ## ++## ------------------------ ## ++ ++# ac_fn_c_try_compile LINENO ++# -------------------------- ++# Try to compile conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ rm -f conftest.$ac_objext ++ if { { ac_try="$ac_compile" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compile") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest.$ac_objext; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_compile ++ ++# ac_fn_c_try_cpp LINENO ++# ---------------------- ++# Try to preprocess conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_cpp () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_cpp conftest.$ac_ext" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } > conftest.i && { ++ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || ++ test ! -s conftest.err ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_cpp ++ ++# ac_fn_c_check_type LINENO TYPE VAR INCLUDES ++# ------------------------------------------- ++# Tests whether TYPE exists after having included INCLUDES, setting cache ++# variable VAR accordingly. ++ac_fn_c_check_type () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ eval "$3=no" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++if (sizeof ($2)) ++ return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++if (sizeof (($2))) ++ return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++else ++ eval "$3=yes" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_type ++ ++# ac_fn_c_try_run LINENO ++# ---------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes ++# that executables *can* be run. ++ac_fn_c_try_run () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' ++ { { case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: program exited with status $ac_status" >&5 ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=$ac_status ++fi ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_run ++ ++# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists and can be compiled using the include files in ++# INCLUDES, setting the cache variable VAR accordingly. ++ac_fn_c_check_header_compile () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_header_compile ++ ++# ac_fn_c_try_link LINENO ++# ----------------------- ++# Try to link conftest.$ac_ext, and return whether this succeeded. ++ac_fn_c_try_link () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ rm -f conftest.$ac_objext conftest$ac_exeext ++ if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ grep -v '^ *+' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ mv -f conftest.er1 conftest.err ++ fi ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } && { ++ test -z "$ac_c_werror_flag" || ++ test ! -s conftest.err ++ } && test -s conftest$ac_exeext && { ++ test "$cross_compiling" = yes || ++ $as_test_x conftest$ac_exeext ++ }; then : ++ ac_retval=0 ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ ac_retval=1 ++fi ++ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information ++ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would ++ # interfere with the next link command; also delete a directory that is ++ # left behind by Apple's compiler. We do this before executing the actions. ++ rm -rf conftest.dSYM conftest_ipa8_conftest.oo ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ as_fn_set_status $ac_retval ++ ++} # ac_fn_c_try_link ++ ++# ac_fn_c_check_func LINENO FUNC VAR ++# ---------------------------------- ++# Tests whether FUNC exists, setting the cache variable VAR accordingly ++ac_fn_c_check_func () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++/* Define $2 to an innocuous variant, in case declares $2. ++ For example, HP-UX 11i declares gettimeofday. */ ++#define $2 innocuous_$2 ++ ++/* System header to define __stub macros and hopefully few prototypes, ++ which can conflict with char $2 (); below. ++ Prefer to if __STDC__ is defined, since ++ exists even on freestanding compilers. */ ++ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ ++#undef $2 ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char $2 (); ++/* The GNU C library defines this for functions which it implements ++ to always fail with ENOSYS. Some functions are actually named ++ something starting with __ and the normal name is an alias. */ ++#if defined __stub_$2 || defined __stub___$2 ++choke me ++#endif ++ ++int ++main () ++{ ++return $2 (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_func ++ ++# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES ++# ------------------------------------------------------- ++# Tests whether HEADER exists, giving a warning if it cannot be compiled using ++# the include files in INCLUDES and setting the cache variable VAR ++# accordingly. ++ac_fn_c_check_header_mongrel () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ if eval \${$3+:} false; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++else ++ # Is the header compilable? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 ++$as_echo_n "checking $2 usability... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++#include <$2> ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_header_compiler=yes ++else ++ ac_header_compiler=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 ++$as_echo "$ac_header_compiler" >&6; } ++ ++# Is the header present? ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 ++$as_echo_n "checking $2 presence... " >&6; } ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include <$2> ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ac_header_preproc=yes ++else ++ ac_header_preproc=no ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 ++$as_echo "$ac_header_preproc" >&6; } ++ ++# So? What about this header? ++case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( ++ yes:no: ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 ++$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++ ;; ++ no:yes:* ) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 ++$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 ++$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 ++$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 ++$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 ++$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ++ ;; ++esac ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 ++$as_echo_n "checking for $2... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ eval "$3=\$ac_header_compiler" ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++fi ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_header_mongrel ++ ++# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES ++# --------------------------------------------- ++# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR ++# accordingly. ++ac_fn_c_check_decl () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ as_decl_name=`echo $2|sed 's/ *(.*//'` ++ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 ++$as_echo_n "checking whether $as_decl_name is declared... " >&6; } ++if eval \${$3+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$4 ++int ++main () ++{ ++#ifndef $as_decl_name ++#ifdef __cplusplus ++ (void) $as_decl_use; ++#else ++ (void) $as_decl_name; ++#endif ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$3=yes" ++else ++ eval "$3=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$3 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_decl ++ ++# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES ++# ---------------------------------------------------- ++# Tries to find if the field MEMBER exists in type AGGR, after including ++# INCLUDES, setting cache variable VAR accordingly. ++ac_fn_c_check_member () ++{ ++ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 ++$as_echo_n "checking for $2.$3... " >&6; } ++if eval \${$4+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$5 ++int ++main () ++{ ++static $2 ac_aggr; ++if (ac_aggr.$3) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$4=yes" ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$5 ++int ++main () ++{ ++static $2 ac_aggr; ++if (sizeof ac_aggr.$3) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$4=yes" ++else ++ eval "$4=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$4 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno ++ ++} # ac_fn_c_check_member ++cat >config.log <<_ACEOF ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++ ++It was created by $as_me, which was ++generated by GNU Autoconf 2.68. Invocation command line was ++ ++ $ $0 $@ ++ ++_ACEOF ++exec 5>>config.log ++{ ++cat <<_ASUNAME ++## --------- ## ++## Platform. ## ++## --------- ## ++ ++hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` ++uname -m = `(uname -m) 2>/dev/null || echo unknown` ++uname -r = `(uname -r) 2>/dev/null || echo unknown` ++uname -s = `(uname -s) 2>/dev/null || echo unknown` ++uname -v = `(uname -v) 2>/dev/null || echo unknown` ++ ++/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` ++/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` ++ ++/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` ++/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` ++/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` ++/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` ++/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` ++/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` ++/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` ++ ++_ASUNAME ++ ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ $as_echo "PATH: $as_dir" ++ done ++IFS=$as_save_IFS ++ ++} >&5 ++ ++cat >&5 <<_ACEOF ++ ++ ++## ----------- ## ++## Core tests. ## ++## ----------- ## ++ ++_ACEOF ++ ++ ++# Keep a trace of the command line. ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Strip out --silent because we don't want to record it for future runs. ++# Also quote any args containing shell meta-characters. ++# Make two passes to allow for proper duplicate-argument suppression. ++ac_configure_args= ++ac_configure_args0= ++ac_configure_args1= ++ac_must_keep_next=false ++for ac_pass in 1 2 ++do ++ for ac_arg ++ do ++ case $ac_arg in ++ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil) ++ continue ;; ++ *\'*) ++ ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ case $ac_pass in ++ 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; ++ 2) ++ as_fn_append ac_configure_args1 " '$ac_arg'" ++ if test $ac_must_keep_next = true; then ++ ac_must_keep_next=false # Got value, back to normal. ++ else ++ case $ac_arg in ++ *=* | --config-cache | -C | -disable-* | --disable-* \ ++ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ ++ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ ++ | -with-* | --with-* | -without-* | --without-* | --x) ++ case "$ac_configure_args0 " in ++ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; ++ esac ++ ;; ++ -* ) ac_must_keep_next=true ;; ++ esac ++ fi ++ as_fn_append ac_configure_args " '$ac_arg'" ++ ;; ++ esac ++ done ++done ++{ ac_configure_args0=; unset ac_configure_args0;} ++{ ac_configure_args1=; unset ac_configure_args1;} ++ ++# When interrupted or exit'd, cleanup temporary files, and complete ++# config.log. We remove comments because anyway the quotes in there ++# would cause problems or look ugly. ++# WARNING: Use '\'' to represent an apostrophe within the trap. ++# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. ++trap 'exit_status=$? ++ # Save into config.log some information that might help in debugging. ++ { ++ echo ++ ++ $as_echo "## ---------------- ## ++## Cache variables. ## ++## ---------------- ##" ++ echo ++ # The following way of writing the cache mishandles newlines in values, ++( ++ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do ++ eval ac_val=\$$ac_var ++ case $ac_val in #( ++ *${as_nl}*) ++ case $ac_var in #( ++ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ++ esac ++ case $ac_var in #( ++ _ | IFS | as_nl) ;; #( ++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( ++ *) { eval $ac_var=; unset $ac_var;} ;; ++ esac ;; ++ esac ++ done ++ (set) 2>&1 | ++ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( ++ *${as_nl}ac_space=\ *) ++ sed -n \ ++ "s/'\''/'\''\\\\'\'''\''/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ++ ;; #( ++ *) ++ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ++ ;; ++ esac | ++ sort ++) ++ echo ++ ++ $as_echo "## ----------------- ## ++## Output variables. ## ++## ----------------- ##" ++ echo ++ for ac_var in $ac_subst_vars ++ do ++ eval ac_val=\$$ac_var ++ case $ac_val in ++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ esac ++ $as_echo "$ac_var='\''$ac_val'\''" ++ done | sort ++ echo ++ ++ if test -n "$ac_subst_files"; then ++ $as_echo "## ------------------- ## ++## File substitutions. ## ++## ------------------- ##" ++ echo ++ for ac_var in $ac_subst_files ++ do ++ eval ac_val=\$$ac_var ++ case $ac_val in ++ *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; ++ esac ++ $as_echo "$ac_var='\''$ac_val'\''" ++ done | sort ++ echo ++ fi ++ ++ if test -s confdefs.h; then ++ $as_echo "## ----------- ## ++## confdefs.h. ## ++## ----------- ##" ++ echo ++ cat confdefs.h ++ echo ++ fi ++ test "$ac_signal" != 0 && ++ $as_echo "$as_me: caught signal $ac_signal" ++ $as_echo "$as_me: exit $exit_status" ++ } >&5 ++ rm -f core *.core core.conftest.* && ++ rm -f -r conftest* confdefs* conf$$* $ac_clean_files && ++ exit $exit_status ++' 0 ++for ac_signal in 1 2 13 15; do ++ trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal ++done ++ac_signal=0 ++ ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -f -r conftest* confdefs.h ++ ++$as_echo "/* confdefs.h */" > confdefs.h ++ ++# Predefined preprocessor variables. ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_NAME "$PACKAGE_NAME" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_TARNAME "$PACKAGE_TARNAME" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_VERSION "$PACKAGE_VERSION" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_STRING "$PACKAGE_STRING" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" ++_ACEOF ++ ++cat >>confdefs.h <<_ACEOF ++#define PACKAGE_URL "$PACKAGE_URL" ++_ACEOF ++ ++ ++# Let the site file select an alternate cache file if it wants to. ++# Prefer an explicitly selected file to automatically selected ones. ++ac_site_file1=NONE ++ac_site_file2=NONE ++if test -n "$CONFIG_SITE"; then ++ # We do not want a PATH search for config.site. ++ case $CONFIG_SITE in #(( ++ -*) ac_site_file1=./$CONFIG_SITE;; ++ */*) ac_site_file1=$CONFIG_SITE;; ++ *) ac_site_file1=./$CONFIG_SITE;; ++ esac ++elif test "x$prefix" != xNONE; then ++ ac_site_file1=$prefix/share/config.site ++ ac_site_file2=$prefix/etc/config.site ++else ++ ac_site_file1=$ac_default_prefix/share/config.site ++ ac_site_file2=$ac_default_prefix/etc/config.site ++fi ++for ac_site_file in "$ac_site_file1" "$ac_site_file2" ++do ++ test "x$ac_site_file" = xNONE && continue ++ if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 ++$as_echo "$as_me: loading site script $ac_site_file" >&6;} ++ sed 's/^/| /' "$ac_site_file" >&5 ++ . "$ac_site_file" \ ++ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "failed to load site script $ac_site_file ++See \`config.log' for more details" "$LINENO" 5; } ++ fi ++done ++ ++if test -r "$cache_file"; then ++ # Some versions of bash will fail to source /dev/null (special files ++ # actually), so we avoid doing that. DJGPP emulates it as a regular file. ++ if test /dev/null != "$cache_file" && test -f "$cache_file"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 ++$as_echo "$as_me: loading cache $cache_file" >&6;} ++ case $cache_file in ++ [\\/]* | ?:[\\/]* ) . "$cache_file";; ++ *) . "./$cache_file";; ++ esac ++ fi ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 ++$as_echo "$as_me: creating cache $cache_file" >&6;} ++ >$cache_file ++fi ++ ++as_fn_append ac_header_list " stdlib.h" ++as_fn_append ac_header_list " unistd.h" ++as_fn_append ac_header_list " sys/param.h" ++# Check that the precious variables saved in the cache have kept the same ++# value. ++ac_cache_corrupted=false ++for ac_var in $ac_precious_vars; do ++ eval ac_old_set=\$ac_cv_env_${ac_var}_set ++ eval ac_new_set=\$ac_env_${ac_var}_set ++ eval ac_old_val=\$ac_cv_env_${ac_var}_value ++ eval ac_new_val=\$ac_env_${ac_var}_value ++ case $ac_old_set,$ac_new_set in ++ set,) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 ++$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ++ ac_cache_corrupted=: ;; ++ ,set) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 ++$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ++ ac_cache_corrupted=: ;; ++ ,);; ++ *) ++ if test "x$ac_old_val" != "x$ac_new_val"; then ++ # differences in whitespace do not lead to failure. ++ ac_old_val_w=`echo x $ac_old_val` ++ ac_new_val_w=`echo x $ac_new_val` ++ if test "$ac_old_val_w" != "$ac_new_val_w"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 ++$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ++ ac_cache_corrupted=: ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 ++$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} ++ eval $ac_var=\$ac_old_val ++ fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 ++$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 ++$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} ++ fi;; ++ esac ++ # Pass precious variables to config.status. ++ if test "$ac_new_set" = set; then ++ case $ac_new_val in ++ *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; ++ *) ac_arg=$ac_var=$ac_new_val ;; ++ esac ++ case " $ac_configure_args " in ++ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. ++ *) as_fn_append ac_configure_args " '$ac_arg'" ;; ++ esac ++ fi ++done ++if $ac_cache_corrupted; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++ { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 ++$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} ++ as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 ++fi ++## -------------------- ## ++## Main body of script. ## ++## -------------------- ## ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++ ++ac_config_headers="$ac_config_headers config.h" ++ ++ ++. ${srcdir}/Config/version.mk ++echo "configuring for zsh $VERSION" ++ ++ac_aux_dir= ++for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do ++ if test -f "$ac_dir/install-sh"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/install-sh -c" ++ break ++ elif test -f "$ac_dir/install.sh"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/install.sh -c" ++ break ++ elif test -f "$ac_dir/shtool"; then ++ ac_aux_dir=$ac_dir ++ ac_install_sh="$ac_aux_dir/shtool install -c" ++ break ++ fi ++done ++if test -z "$ac_aux_dir"; then ++ as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 ++fi ++ ++# These three variables are undocumented and unsupported, ++# and are intended to be withdrawn in a future Autoconf release. ++# They can cause serious problems if a builder's source tree is in a directory ++# whose full name contains unusual characters. ++ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ++ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ++ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ++ ++ ++# Make sure we can run config.sub. ++$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || ++ as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 ++$as_echo_n "checking build system type... " >&6; } ++if ${ac_cv_build+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_build_alias=$build_alias ++test "x$ac_build_alias" = x && ++ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` ++test "x$ac_build_alias" = x && ++ as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ++ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || ++ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 ++$as_echo "$ac_cv_build" >&6; } ++case $ac_cv_build in ++*-*-*) ;; ++*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; ++esac ++build=$ac_cv_build ++ac_save_IFS=$IFS; IFS='-' ++set x $ac_cv_build ++shift ++build_cpu=$1 ++build_vendor=$2 ++shift; shift ++# Remember, the first character of IFS is used to create $*, ++# except with old shells: ++build_os=$* ++IFS=$ac_save_IFS ++case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 ++$as_echo_n "checking host system type... " >&6; } ++if ${ac_cv_host+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "x$host_alias" = x; then ++ ac_cv_host=$ac_cv_build ++else ++ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || ++ as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 ++$as_echo "$ac_cv_host" >&6; } ++case $ac_cv_host in ++*-*-*) ;; ++*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; ++esac ++host=$ac_cv_host ++ac_save_IFS=$IFS; IFS='-' ++set x $ac_cv_host ++shift ++host_cpu=$1 ++host_vendor=$2 ++shift; shift ++# Remember, the first character of IFS is used to create $*, ++# except with old shells: ++host_os=$* ++IFS=$ac_save_IFS ++case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac ++ ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define MACHTYPE "$host_cpu" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define VENDOR "$host_vendor" ++_ACEOF ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define OSTYPE "$host_os" ++_ACEOF ++ ++ ++test "$program_prefix" != NONE && ++ program_transform_name="s&^&$program_prefix&;$program_transform_name" ++# Use a double $ so make ignores it. ++test "$program_suffix" != NONE && ++ program_transform_name="s&\$&$program_suffix&;$program_transform_name" ++# Double any \ or $. ++# By default was `s,x,x', remove it if useless. ++ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' ++program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` ++ ++ ++# Un-double any \ or $ (doubled by AC_ARG_PROGRAM). ++cat <<\EOF_SED > conftestsed ++s,\\\\,\\,g; s,\$\$,$,g ++EOF_SED ++zsh_transform_name=`echo "${program_transform_name}" | sed -f conftestsed` ++rm -f conftestsed ++tzsh_name=`echo zsh | sed -e "${zsh_transform_name}"` ++# Double any \ or $ in the transformed name that results. ++cat <<\EOF_SED >> conftestsed ++s,\\,\\\\,g; s,\$,$$,g ++EOF_SED ++tzsh=`echo ${tzsh_name} | sed -f conftestsed` ++rm -f conftestsed ++ ++ ++# Check whether --enable-cppflags was given. ++if test "${enable_cppflags+set}" = set; then : ++ enableval=$enable_cppflags; if test "$enableval" = "yes" ++ then CPPFLAGS="$CPPFLAGS" ++ else CPPFLAGS="$enable_cppflags" ++ fi ++fi ++ ++ # Check whether --enable-cflags was given. ++if test "${enable_cflags+set}" = set; then : ++ enableval=$enable_cflags; if test "$enableval" = "yes" ++ then CFLAGS="$CFLAGS" ++ else CFLAGS="$enable_cflags" ++ fi ++fi ++ ++ # Check whether --enable-ldflags was given. ++if test "${enable_ldflags+set}" = set; then : ++ enableval=$enable_ldflags; if test "$enableval" = "yes" ++ then LDFLAGS="$LDFLAGS" ++ else LDFLAGS="$enable_ldflags" ++ fi ++fi ++ ++ # Check whether --enable-libs was given. ++if test "${enable_libs+set}" = set; then : ++ enableval=$enable_libs; if test "$enableval" = "yes" ++ then LIBS="$LIBS" ++ else LIBS="$enable_libs" ++ fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-debug was given. ++if test "${enable_zsh_debug+set}" = set; then : ++ enableval=$enable_zsh_debug; if test x$enableval = xyes; then ++ $as_echo "#define DEBUG 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-mem was given. ++if test "${enable_zsh_mem+set}" = set; then : ++ enableval=$enable_zsh_mem; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_MEM 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-mem-debug was given. ++if test "${enable_zsh_mem_debug+set}" = set; then : ++ enableval=$enable_zsh_mem_debug; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_MEM_DEBUG 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-mem-warning was given. ++if test "${enable_zsh_mem_warning+set}" = set; then : ++ enableval=$enable_zsh_mem_warning; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_MEM_WARNING 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-secure-free was given. ++if test "${enable_zsh_secure_free+set}" = set; then : ++ enableval=$enable_zsh_secure_free; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_SECURE_FREE 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-heap-debug was given. ++if test "${enable_zsh_heap_debug+set}" = set; then : ++ enableval=$enable_zsh_heap_debug; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_HEAP_DEBUG 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-zsh-hash-debug was given. ++if test "${enable_zsh_hash_debug+set}" = set; then : ++ enableval=$enable_zsh_hash_debug; if test x$enableval = xyes; then ++ $as_echo "#define ZSH_HASH_DEBUG 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++# Check whether --enable-etcdir was given. ++if test "${enable_etcdir+set}" = set; then : ++ enableval=$enable_etcdir; etcdir="$enableval" ++else ++ etcdir=/etc ++fi ++ ++ ++# Check whether --enable-zshenv was given. ++if test "${enable_zshenv+set}" = set; then : ++ enableval=$enable_zshenv; zshenv="$enableval" ++else ++ if test "x$etcdir" = xno; then ++ zshenv=no ++else ++ zshenv="$etcdir/zshenv" ++fi ++fi ++ ++ ++if test "x$zshenv" != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define GLOBAL_ZSHENV "$zshenv" ++_ACEOF ++ ++fi ++ ++# Check whether --enable-zshrc was given. ++if test "${enable_zshrc+set}" = set; then : ++ enableval=$enable_zshrc; zshrc="$enableval" ++else ++ if test "x$etcdir" = xno; then ++ zshrc=no ++else ++ zshrc="$etcdir/zshrc" ++fi ++fi ++ ++ ++if test "x$zshrc" != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define GLOBAL_ZSHRC "$zshrc" ++_ACEOF ++ ++fi ++ ++# Check whether --enable-zprofile was given. ++if test "${enable_zprofile+set}" = set; then : ++ enableval=$enable_zprofile; zprofile="$enableval" ++else ++ if test "x$etcdir" = xno; then ++ zprofile=no ++else ++ zprofile="$etcdir/zprofile" ++fi ++fi ++ ++ ++if test "x$zprofile" != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define GLOBAL_ZPROFILE "$zprofile" ++_ACEOF ++ ++fi ++ ++# Check whether --enable-zlogin was given. ++if test "${enable_zlogin+set}" = set; then : ++ enableval=$enable_zlogin; zlogin="$enableval" ++else ++ if test "x$etcdir" = xno; then ++ zlogin=no ++else ++ zlogin="$etcdir/zlogin" ++fi ++fi ++ ++ ++if test "x$zlogin" != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define GLOBAL_ZLOGIN "$zlogin" ++_ACEOF ++ ++fi ++ ++# Check whether --enable-zlogout was given. ++if test "${enable_zlogout+set}" = set; then : ++ enableval=$enable_zlogout; zlogout="$enableval" ++else ++ if test "x$etcdir" = xno; then ++ zlogout=no ++else ++ zlogout="$etcdir/zlogout" ++fi ++fi ++ ++ ++if test "x$zlogout" != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define GLOBAL_ZLOGOUT "$zlogout" ++_ACEOF ++ ++fi ++ ++ ++# Check whether --enable-dynamic was given. ++if test "${enable_dynamic+set}" = set; then : ++ enableval=$enable_dynamic; dynamic="$enableval" ++else ++ dynamic=yes ++fi ++ ++ ++ ++# Check whether --enable-restricted-r was given. ++if test "${enable_restricted_r+set}" = set; then : ++ enableval=$enable_restricted_r; if test x$enableval = xyes; then ++ $as_echo "#define RESTRICTED_R 1" >>confdefs.h ++ ++fi ++else ++ $as_echo "#define RESTRICTED_R 1" >>confdefs.h ++ ++ ++fi ++ ++ ++ ++# Check whether --enable-locale was given. ++if test "${enable_locale+set}" = set; then : ++ enableval=$enable_locale; if test x$enableval = xyes; then ++ $as_echo "#define CONFIG_LOCALE 1" >>confdefs.h ++ ++fi ++else ++ $as_echo "#define CONFIG_LOCALE 1" >>confdefs.h ++ ++ ++fi ++ ++ ++# Check whether --enable-ansi2knr was given. ++if test "${enable_ansi2knr+set}" = set; then : ++ enableval=$enable_ansi2knr; ansi2knr="$enableval" ++else ++ ansi2knr=default ++fi ++ ++ ++# Check whether --enable-fndir was given. ++if test "${enable_fndir+set}" = set; then : ++ enableval=$enable_fndir; if test x$enableval = xyes; then ++ fndir=${datadir}/${tzsh_name}/'${VERSION}'/functions ++else ++ fndir="$enableval" ++fi ++else ++ fndir=${datadir}/${tzsh_name}/'${VERSION}'/functions ++fi ++ ++ ++# Check whether --enable-site-fndir was given. ++if test "${enable_site_fndir+set}" = set; then : ++ enableval=$enable_site_fndir; if test x$enableval = xyes; then ++ sitefndir=${datadir}/${tzsh_name}/site-functions ++else ++ sitefndir="$enableval" ++fi ++else ++ sitefndir=${datadir}/${tzsh_name}/site-functions ++fi ++ ++ ++ ++# Check whether --enable-function-subdirs was given. ++if test "${enable_function_subdirs+set}" = set; then : ++ enableval=$enable_function_subdirs; ++fi ++ ++ ++if test "x${enable_function_subdirs}" != x && ++ test "x${enable_function_subdirs}" != xno; then ++ FUNCTIONS_SUBDIRS=yes ++else ++ FUNCTIONS_SUBDIRS=no ++fi ++ ++# Check whether --enable-additional-fpath was given. ++if test "${enable_additional_fpath+set}" = set; then : ++ enableval=$enable_additional_fpath; if test x$enableval = xyes; then ++ additionalfpath="" ++else ++ additionalfpath="${enableval}" ++fi ++else ++ additionalfpath="" ++fi ++ ++ ++ ++ ++# Check whether --enable-scriptdir was given. ++if test "${enable_scriptdir+set}" = set; then : ++ enableval=$enable_scriptdir; if test x$enableval = xyes; then ++ scriptdir=${datadir}/${tzsh_name}/'${VERSION}'/scripts ++else ++ scriptdir="$enableval" ++fi ++else ++ scriptdir=${datadir}/${tzsh_name}/'${VERSION}'/scripts ++fi ++ ++ ++# Check whether --enable-site-scriptdir was given. ++if test "${enable_site_scriptdir+set}" = set; then : ++ enableval=$enable_site_scriptdir; if test x$enableval = xyes; then ++ sitescriptdir=${datadir}/${tzsh_name}/scripts ++else ++ sitescriptdir="$enableval" ++fi ++else ++ sitescriptdir=${datadir}/${tzsh_name}/scripts ++fi ++ ++ ++ ++if test x$htmldir = x'${docdir}' || test x$htmldir = x; then ++ htmldir='$(datadir)/$(tzsh)/htmldoc' ++fi ++ ++ ++# Check whether --enable-custom-patchlevel was given. ++if test "${enable_custom_patchlevel+set}" = set; then : ++ enableval=$enable_custom_patchlevel; if test x$enableval != x && test x$enableval != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define CUSTOM_PATCHLEVEL "$enableval" ++_ACEOF ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-maildir-support was given. ++if test "${enable_maildir_support+set}" = set; then : ++ enableval=$enable_maildir_support; if test x$enableval = xyes; then ++ $as_echo "#define MAILDIR_SUPPORT 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++ ++# Check whether --enable-max-function-depth was given. ++if test "${enable_max_function_depth+set}" = set; then : ++ enableval=$enable_max_function_depth; if test x$enableval = xyes; then ++ $as_echo "#define MAX_FUNCTION_DEPTH 1000" >>confdefs.h ++ ++elif test x$enableval != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define MAX_FUNCTION_DEPTH $enableval ++_ACEOF ++ ++fi ++else ++ $as_echo "#define MAX_FUNCTION_DEPTH 1000" >>confdefs.h ++ ++ ++fi ++ ++ ++ ++# Check whether --enable-readnullcmd was given. ++if test "${enable_readnullcmd+set}" = set; then : ++ enableval=$enable_readnullcmd; if test x$enableval = xyes; then ++ $as_echo "#define DEFAULT_READNULLCMD \"more\"" >>confdefs.h ++ ++elif test x$enableval != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define DEFAULT_READNULLCMD "$enableval" ++_ACEOF ++ ++fi ++else ++ $as_echo "#define DEFAULT_READNULLCMD \"more\"" >>confdefs.h ++ ++ ++fi ++ ++ ++# Check whether --enable-pcre was given. ++if test "${enable_pcre+set}" = set; then : ++ enableval=$enable_pcre; ++fi ++ ++ ++# Check whether --enable-cap was given. ++if test "${enable_cap+set}" = set; then : ++ enableval=$enable_cap; ++fi ++ ++ ++# Check whether --enable-gdbm was given. ++if test "${enable_gdbm+set}" = set; then : ++ enableval=$enable_gdbm; gdbm="$enableval" ++else ++ gdbm=yes ++fi ++ ++ ++test -z "${CFLAGS+set}" && CFLAGS= auto_cflags=1 ++test -z "${LDFLAGS+set}" && LDFLAGS= auto_ldflags=1 ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. ++set dummy ${ac_tool_prefix}gcc; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}gcc" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++$as_echo "$CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$ac_cv_prog_CC"; then ++ ac_ct_CC=$CC ++ # Extract the first word of "gcc", so it can be a program name with args. ++set dummy gcc; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="gcc" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_CC=$ac_cv_prog_ac_ct_CC ++if test -n "$ac_ct_CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 ++$as_echo "$ac_ct_CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ if test "x$ac_ct_CC" = x; then ++ CC="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ CC=$ac_ct_CC ++ fi ++else ++ CC="$ac_cv_prog_CC" ++fi ++ ++if test -z "$CC"; then ++ if test -n "$ac_tool_prefix"; then ++ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. ++set dummy ${ac_tool_prefix}cc; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="${ac_tool_prefix}cc" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++$as_echo "$CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ fi ++fi ++if test -z "$CC"; then ++ # Extract the first word of "cc", so it can be a program name with args. ++set dummy cc; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++ ac_prog_rejected=no ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++if test $ac_prog_rejected = yes; then ++ # We found a bogon in the path, so make sure we never use it. ++ set dummy $ac_cv_prog_CC ++ shift ++ if test $# != 0; then ++ # We chose a different compiler from the bogus one. ++ # However, it has the same basename, so the bogon will be chosen ++ # first if we set CC to just the basename; use the full file name. ++ shift ++ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" ++ fi ++fi ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++$as_echo "$CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++fi ++if test -z "$CC"; then ++ if test -n "$ac_tool_prefix"; then ++ for ac_prog in cl.exe ++ do ++ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. ++set dummy $ac_tool_prefix$ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$CC"; then ++ ac_cv_prog_CC="$CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_CC="$ac_tool_prefix$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++CC=$ac_cv_prog_CC ++if test -n "$CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 ++$as_echo "$CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$CC" && break ++ done ++fi ++if test -z "$CC"; then ++ ac_ct_CC=$CC ++ for ac_prog in cl.exe ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ac_ct_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ac_ct_CC"; then ++ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ac_ct_CC="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ac_ct_CC=$ac_cv_prog_ac_ct_CC ++if test -n "$ac_ct_CC"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 ++$as_echo "$ac_ct_CC" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$ac_ct_CC" && break ++done ++ ++ if test "x$ac_ct_CC" = x; then ++ CC="" ++ else ++ case $cross_compiling:$ac_tool_warned in ++yes:) ++{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 ++$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ++ac_tool_warned=yes ;; ++esac ++ CC=$ac_ct_CC ++ fi ++fi ++ ++fi ++ ++ ++test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "no acceptable C compiler found in \$PATH ++See \`config.log' for more details" "$LINENO" 5; } ++ ++# Provide some information about the compiler. ++$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 ++set X $ac_compile ++ac_compiler=$2 ++for ac_option in --version -v -V -qversion; do ++ { { ac_try="$ac_compiler $ac_option >&5" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compiler $ac_option >&5") 2>conftest.err ++ ac_status=$? ++ if test -s conftest.err; then ++ sed '10a\ ++... rest of stderr output deleted ... ++ 10q' conftest.err >conftest.er1 ++ cat conftest.er1 >&5 ++ fi ++ rm -f conftest.er1 conftest.err ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++done ++ ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" ++# Try to create an executable without -o first, disregard a.out. ++# It will help us diagnose broken compilers, and finding out an intuition ++# of exeext. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 ++$as_echo_n "checking whether the C compiler works... " >&6; } ++ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` ++ ++# The possible output files: ++ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ++ ++ac_rmfiles= ++for ac_file in $ac_files ++do ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; ++ * ) ac_rmfiles="$ac_rmfiles $ac_file";; ++ esac ++done ++rm -f $ac_rmfiles ++ ++if { { ac_try="$ac_link_default" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link_default") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then : ++ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. ++# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' ++# in a Makefile. We should not override ac_cv_exeext if it was cached, ++# so that the user can short-circuit this test for compilers unknown to ++# Autoconf. ++for ac_file in $ac_files '' ++do ++ test -f "$ac_file" || continue ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ++ ;; ++ [ab].out ) ++ # We found the default executable, but exeext='' is most ++ # certainly right. ++ break;; ++ *.* ) ++ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; ++ then :; else ++ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ fi ++ # We set ac_cv_exeext here because the later test for it is not ++ # safe: cross compilers may not add the suffix if given an `-o' ++ # argument, so we may need to know it at that point already. ++ # Even if this section looks crufty: it has the advantage of ++ # actually working. ++ break;; ++ * ) ++ break;; ++ esac ++done ++test "$ac_cv_exeext" = no && ac_cv_exeext= ++ ++else ++ ac_file='' ++fi ++if test -z "$ac_file"; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++$as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error 77 "C compiler cannot create executables ++See \`config.log' for more details" "$LINENO" 5; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 ++$as_echo_n "checking for C compiler default output file name... " >&6; } ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 ++$as_echo "$ac_file" >&6; } ++ac_exeext=$ac_cv_exeext ++ ++rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ++ac_clean_files=$ac_clean_files_save ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 ++$as_echo_n "checking for suffix of executables... " >&6; } ++if { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then : ++ # If both `conftest.exe' and `conftest' are `present' (well, observable) ++# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will ++# work properly (i.e., refer to `conftest.exe'), while it won't with ++# `rm'. ++for ac_file in conftest.exe conftest conftest.*; do ++ test -f "$ac_file" || continue ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; ++ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` ++ break;; ++ * ) break;; ++ esac ++done ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot compute suffix of executables: cannot compile and link ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++rm -f conftest conftest$ac_cv_exeext ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 ++$as_echo "$ac_cv_exeext" >&6; } ++ ++rm -f conftest.$ac_ext ++EXEEXT=$ac_cv_exeext ++ac_exeext=$EXEEXT ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++FILE *f = fopen ("conftest.out", "w"); ++ return ferror (f) || fclose (f) != 0; ++ ++ ; ++ return 0; ++} ++_ACEOF ++ac_clean_files="$ac_clean_files conftest.out" ++# Check that the compiler produces executables we can run. If not, either ++# the compiler is broken, or we cross compile. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 ++$as_echo_n "checking whether we are cross compiling... " >&6; } ++if test "$cross_compiling" != yes; then ++ { { ac_try="$ac_link" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_link") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; } ++ if { ac_try='./conftest$ac_cv_exeext' ++ { { case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_try") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ cross_compiling=no ++ else ++ if test "$cross_compiling" = maybe; then ++ cross_compiling=yes ++ else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot run C compiled programs. ++If you meant to cross compile, use \`--host'. ++See \`config.log' for more details" "$LINENO" 5; } ++ fi ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 ++$as_echo "$cross_compiling" >&6; } ++ ++rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ++ac_clean_files=$ac_clean_files_save ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 ++$as_echo_n "checking for suffix of object files... " >&6; } ++if ${ac_cv_objext+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.o conftest.obj ++if { { ac_try="$ac_compile" ++case "(($ac_try" in ++ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; ++ *) ac_try_echo=$ac_try;; ++esac ++eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" ++$as_echo "$ac_try_echo"; } >&5 ++ (eval "$ac_compile") 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; then : ++ for ac_file in conftest.o conftest.obj conftest.*; do ++ test -f "$ac_file" || continue; ++ case $ac_file in ++ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; ++ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` ++ break;; ++ esac ++done ++else ++ $as_echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "cannot compute suffix of object files: cannot compile ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++rm -f conftest.$ac_cv_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 ++$as_echo "$ac_cv_objext" >&6; } ++OBJEXT=$ac_cv_objext ++ac_objext=$OBJEXT ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 ++$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } ++if ${ac_cv_c_compiler_gnu+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++#ifndef __GNUC__ ++ choke me ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_compiler_gnu=yes ++else ++ ac_compiler_gnu=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ac_cv_c_compiler_gnu=$ac_compiler_gnu ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 ++$as_echo "$ac_cv_c_compiler_gnu" >&6; } ++if test $ac_compiler_gnu = yes; then ++ GCC=yes ++else ++ GCC= ++fi ++ac_test_CFLAGS=${CFLAGS+set} ++ac_save_CFLAGS=$CFLAGS ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 ++$as_echo_n "checking whether $CC accepts -g... " >&6; } ++if ${ac_cv_prog_cc_g+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_save_c_werror_flag=$ac_c_werror_flag ++ ac_c_werror_flag=yes ++ ac_cv_prog_cc_g=no ++ CFLAGS="-g" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_prog_cc_g=yes ++else ++ CFLAGS="" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ++else ++ ac_c_werror_flag=$ac_save_c_werror_flag ++ CFLAGS="-g" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_prog_cc_g=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_c_werror_flag=$ac_save_c_werror_flag ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 ++$as_echo "$ac_cv_prog_cc_g" >&6; } ++if test "$ac_test_CFLAGS" = set; then ++ CFLAGS=$ac_save_CFLAGS ++elif test $ac_cv_prog_cc_g = yes; then ++ if test "$GCC" = yes; then ++ CFLAGS="-g -O2" ++ else ++ CFLAGS="-g" ++ fi ++else ++ if test "$GCC" = yes; then ++ CFLAGS="-O2" ++ else ++ CFLAGS= ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 ++$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } ++if ${ac_cv_prog_cc_c89+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_cv_prog_cc_c89=no ++ac_save_CC=$CC ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ ++struct buf { int x; }; ++FILE * (*rcsopen) (struct buf *, struct stat *, int); ++static char *e (p, i) ++ char **p; ++ int i; ++{ ++ return p[i]; ++} ++static char *f (char * (*g) (char **, int), char **p, ...) ++{ ++ char *s; ++ va_list v; ++ va_start (v,p); ++ s = g (p, va_arg (v,int)); ++ va_end (v); ++ return s; ++} ++ ++/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has ++ function prototypes and stuff, but not '\xHH' hex character constants. ++ These don't provoke an error unfortunately, instead are silently treated ++ as 'x'. The following induces an error, until -std is added to get ++ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an ++ array size at least. It's necessary to write '\x00'==0 to get something ++ that's true only with -std. */ ++int osf4_cc_array ['\x00' == 0 ? 1 : -1]; ++ ++/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters ++ inside strings and character constants. */ ++#define FOO(x) 'x' ++int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; ++ ++int test (int i, double x); ++struct s1 {int (*f) (int a);}; ++struct s2 {int (*f) (double a);}; ++int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); ++int argc; ++char **argv; ++int ++main () ++{ ++return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ++ ; ++ return 0; ++} ++_ACEOF ++for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ ++ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" ++do ++ CC="$ac_save_CC $ac_arg" ++ if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_prog_cc_c89=$ac_arg ++fi ++rm -f core conftest.err conftest.$ac_objext ++ test "x$ac_cv_prog_cc_c89" != "xno" && break ++done ++rm -f conftest.$ac_ext ++CC=$ac_save_CC ++ ++fi ++# AC_CACHE_VAL ++case "x$ac_cv_prog_cc_c89" in ++ x) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 ++$as_echo "none needed" >&6; } ;; ++ xno) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 ++$as_echo "unsupported" >&6; } ;; ++ *) ++ CC="$CC $ac_cv_prog_cc_c89" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 ++$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; ++esac ++if test "x$ac_cv_prog_cc_c89" != xno; then : ++ ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++ ++ ++if test "$host" = mips-sni-sysv4 && test -n "$GCC"; then ++ : ++else ++ ++# Check whether --enable-largefile was given. ++if test "${enable_largefile+set}" = set; then : ++ enableval=$enable_largefile; ++fi ++ ++if test "$enable_largefile" != no; then ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 ++$as_echo_n "checking for special C compiler options needed for large files... " >&6; } ++if ${ac_cv_sys_largefile_CC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_cv_sys_largefile_CC=no ++ if test "$GCC" != yes; then ++ ac_save_CC=$CC ++ while :; do ++ # IRIX 6.2 and later do not support large files by default, ++ # so use the C compiler's -n32 option if that helps. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++ if ac_fn_c_try_compile "$LINENO"; then : ++ break ++fi ++rm -f core conftest.err conftest.$ac_objext ++ CC="$CC -n32" ++ if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_largefile_CC=' -n32'; break ++fi ++rm -f core conftest.err conftest.$ac_objext ++ break ++ done ++ CC=$ac_save_CC ++ rm -f conftest.$ac_ext ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 ++$as_echo "$ac_cv_sys_largefile_CC" >&6; } ++ if test "$ac_cv_sys_largefile_CC" != no; then ++ CC=$CC$ac_cv_sys_largefile_CC ++ fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 ++$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } ++if ${ac_cv_sys_file_offset_bits+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ while :; do ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_file_offset_bits=no; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#define _FILE_OFFSET_BITS 64 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_file_offset_bits=64; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_file_offset_bits=unknown ++ break ++done ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 ++$as_echo "$ac_cv_sys_file_offset_bits" >&6; } ++case $ac_cv_sys_file_offset_bits in #( ++ no | unknown) ;; ++ *) ++cat >>confdefs.h <<_ACEOF ++#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits ++_ACEOF ++;; ++esac ++rm -rf conftest* ++ if test $ac_cv_sys_file_offset_bits = unknown; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 ++$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } ++if ${ac_cv_sys_large_files+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ while :; do ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_large_files=no; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#define _LARGE_FILES 1 ++#include ++ /* Check that off_t can represent 2**63 - 1 correctly. ++ We can't simply define LARGE_OFF_T to be 9223372036854775807, ++ since some C++ compilers masquerading as C compilers ++ incorrectly reject 9223372036854775807. */ ++#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) ++ int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 ++ && LARGE_OFF_T % 2147483647 == 1) ++ ? 1 : -1]; ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_sys_large_files=1; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ac_cv_sys_large_files=unknown ++ break ++done ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 ++$as_echo "$ac_cv_sys_large_files" >&6; } ++case $ac_cv_sys_large_files in #( ++ no | unknown) ;; ++ *) ++cat >>confdefs.h <<_ACEOF ++#define _LARGE_FILES $ac_cv_sys_large_files ++_ACEOF ++;; ++esac ++rm -rf conftest* ++ fi ++fi ++ ++fi ++ ++if test -n "$auto_cflags" && test ."$ansi2knr" != .yes; then ++ if test "${enable_zsh_debug}" = yes; then ++ if test -n "$GCC"; then ++ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -ggdb" ++ else ++ CFLAGS="$CFLAGS -g" ++ fi ++ else ++ if test -n "$GCC"; then ++ CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -O2" ++ else ++ CFLAGS="$CFLAGS -O" ++ fi ++ fi ++fi ++if test -n "$auto_ldflags"; then ++ case "${enable_zsh_debug}$host_os" in ++ yesaix*|yeshpux*|yesnetbsd*|yesopenbsd*) ;; # "ld -g" is not valid on these systems ++ darwin*) LDFLAGS=-Wl,-x ;; ++ yes*) LDFLAGS=-g ;; ++ *) LDFLAGS=-s ;; ++ esac ++fi ++ ++case "$host_os" in ++ sco*) CFLAGS="-D__sco $CFLAGS" ;; ++esac ++ ++sed=':1 ++ s/ -s / /g ++ t1 ++ s/^ *// ++ s/ *$//' ++ ++case " $LDFLAGS " in ++ *" -s "*) strip_exeldflags=true strip_libldflags=true ++ LDFLAGS=`echo " $LDFLAGS " | sed "$sed"` ;; ++ *) strip_exeldflags=false strip_libldflags=false ;; ++esac ++ ++case " ${EXELDFLAGS+$EXELDFLAGS }" in ++ " ") ;; ++ *" -s "*) strip_exeldflags=true ++ EXELDFLAGS=`echo " $EXELDFLAGS " | sed "$sed"` ;; ++ *) strip_exeldflags=false ;; ++esac ++ ++case " ${LIBLDFLAGS+$LIBLDFLAGS }" in ++ " ") ;; ++ *" -s "*) strip_libldflags=true ++ LIBLDFLAGS=`echo " $LIBLDFLAGS " | sed "$sed"` ;; ++ *) strip_libldflags=false ;; ++esac ++ ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 ++$as_echo_n "checking how to run the C preprocessor... " >&6; } ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++ if ${ac_cv_prog_CPP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Double quotes because CPP needs to be expanded ++ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" ++ do ++ ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ break ++fi ++ ++ done ++ ac_cv_prog_CPP=$CPP ++ ++fi ++ CPP=$ac_cv_prog_CPP ++else ++ ac_cv_prog_CPP=$CPP ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 ++$as_echo "$CPP" >&6; } ++ac_preproc_ok=false ++for ac_c_preproc_warn_flag in '' yes ++do ++ # Use a header file that comes with gcc, so configuring glibc ++ # with a fresh cross-compiler works. ++ # Prefer to if __STDC__ is defined, since ++ # exists even on freestanding compilers. ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. "Syntax error" is here to catch this case. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __STDC__ ++# include ++#else ++# include ++#endif ++ Syntax error ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ ++else ++ # Broken: fails on valid input. ++continue ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++ # OK, works on sane cases. Now check whether nonexistent headers ++ # can be detected and how. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++_ACEOF ++if ac_fn_c_try_cpp "$LINENO"; then : ++ # Broken: success on invalid input. ++continue ++else ++ # Passes both tests. ++ac_preproc_ok=: ++break ++fi ++rm -f conftest.err conftest.i conftest.$ac_ext ++ ++done ++# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. ++rm -f conftest.i conftest.err conftest.$ac_ext ++if $ac_preproc_ok; then : ++ ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error $? "C preprocessor \"$CPP\" fails sanity check ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++ac_ext=c ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ++ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ++ac_compiler_gnu=$ac_cv_c_compiler_gnu ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 ++$as_echo_n "checking for grep that handles long lines and -e... " >&6; } ++if ${ac_cv_path_GREP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -z "$GREP"; then ++ ac_path_GREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in grep ggrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue ++# Check for GNU ac_path_GREP and select it if it is found. ++ # Check for GNU $ac_path_GREP ++case `"$ac_path_GREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'GREP' >> "conftest.nl" ++ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_GREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_GREP="$ac_path_GREP" ++ ac_path_GREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_GREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_GREP"; then ++ as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_GREP=$GREP ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 ++$as_echo "$ac_cv_path_GREP" >&6; } ++ GREP="$ac_cv_path_GREP" ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 ++$as_echo_n "checking for egrep... " >&6; } ++if ${ac_cv_path_EGREP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 ++ then ac_cv_path_EGREP="$GREP -E" ++ else ++ if test -z "$EGREP"; then ++ ac_path_EGREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in egrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue ++# Check for GNU ac_path_EGREP and select it if it is found. ++ # Check for GNU $ac_path_EGREP ++case `"$ac_path_EGREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'EGREP' >> "conftest.nl" ++ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_EGREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_EGREP="$ac_path_EGREP" ++ ac_path_EGREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_EGREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_EGREP"; then ++ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_EGREP=$EGREP ++fi ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 ++$as_echo "$ac_cv_path_EGREP" >&6; } ++ EGREP="$ac_cv_path_EGREP" ++ ++ ++if test $ac_cv_c_compiler_gnu = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 ++$as_echo_n "checking whether $CC needs -traditional... " >&6; } ++if ${ac_cv_prog_gcc_traditional+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_pattern="Autoconf.*'x'" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++Autoconf TIOCGETP ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "$ac_pattern" >/dev/null 2>&1; then : ++ ac_cv_prog_gcc_traditional=yes ++else ++ ac_cv_prog_gcc_traditional=no ++fi ++rm -f conftest* ++ ++ ++ if test $ac_cv_prog_gcc_traditional = no; then ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++Autoconf TCGETA ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "$ac_pattern" >/dev/null 2>&1; then : ++ ac_cv_prog_gcc_traditional=yes ++fi ++rm -f conftest* ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 ++$as_echo "$ac_cv_prog_gcc_traditional" >&6; } ++ if test $ac_cv_prog_gcc_traditional = yes; then ++ CC="$CC -traditional" ++ fi ++fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 ++$as_echo_n "checking for an ANSI C-conforming const... " >&6; } ++if ${ac_cv_c_const+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++/* FIXME: Include the comments suggested by Paul. */ ++#ifndef __cplusplus ++ /* Ultrix mips cc rejects this. */ ++ typedef int charset[2]; ++ const charset cs; ++ /* SunOS 4.1.1 cc rejects this. */ ++ char const *const *pcpcc; ++ char **ppc; ++ /* NEC SVR4.0.2 mips cc rejects this. */ ++ struct point {int x, y;}; ++ static struct point const zero = {0,0}; ++ /* AIX XL C 1.02.0.0 rejects this. ++ It does not let you subtract one const X* pointer from another in ++ an arm of an if-expression whose if-part is not a constant ++ expression */ ++ const char *g = "string"; ++ pcpcc = &g + (g ? g-g : 0); ++ /* HPUX 7.0 cc rejects these. */ ++ ++pcpcc; ++ ppc = (char**) pcpcc; ++ pcpcc = (char const *const *) ppc; ++ { /* SCO 3.2v4 cc rejects this. */ ++ char *t; ++ char const *s = 0 ? (char *) 0 : (char const *) 0; ++ ++ *t++ = 0; ++ if (s) return 0; ++ } ++ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ ++ int x[] = {25, 17}; ++ const int *foo = &x[0]; ++ ++foo; ++ } ++ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ ++ typedef const int *iptr; ++ iptr p = 0; ++ ++p; ++ } ++ { /* AIX XL C 1.02.0.0 rejects this saying ++ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ ++ struct s { int j; const int *ap[3]; }; ++ struct s *b; b->j = 5; ++ } ++ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ ++ const int foo = 10; ++ if (!foo) return 0; ++ } ++ return !cs[0] && !zero.x; ++#endif ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_c_const=yes ++else ++ ac_cv_c_const=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 ++$as_echo "$ac_cv_c_const" >&6; } ++if test $ac_cv_c_const = no; then ++ ++$as_echo "#define const /**/" >>confdefs.h ++ ++fi ++ ++case "$host_os" in ++ darwin[0-9].*) CPP="$CPP -traditional-cpp" ;; ++esac ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${CC-cc} option to accept ANSI C" >&5 ++$as_echo_n "checking for ${CC-cc} option to accept ANSI C... " >&6; } ++if ${fp_cv_prog_cc_stdc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ fp_cv_prog_cc_stdc=no ++ac_save_CFLAGS="$CFLAGS" ++# Don't try gcc -ansi; that turns off useful extensions and ++# breaks some systems' header files. ++# AIX -qlanglvl=ansi ++# Ultrix and OSF/1 -std1 ++# HP-UX -Ae or -Aa -D_HPUX_SOURCE ++# SVR4 -Xc ++# For HP-UX, we try -Ae first; this turns on ANSI but also extensions, ++# as well as defining _HPUX_SOURCE, and we can then use long long. ++# We keep the old version for backward compatibility. ++for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" -Xc ++do ++ CFLAGS="$ac_save_CFLAGS $ac_arg" ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifndef __STDC__ ++choke me ++#endif ++ ++int ++main () ++{ ++int test (int i, double x); ++struct s1 {int (*f) (int a);}; ++struct s2 {int (*f) (double a);}; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ fp_cv_prog_cc_stdc="$ac_arg"; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++done ++CFLAGS="$ac_save_CFLAGS" ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $fp_cv_prog_cc_stdc" >&5 ++$as_echo "$fp_cv_prog_cc_stdc" >&6; } ++case "x$fp_cv_prog_cc_stdc" in ++ x|xno) ;; ++ *) CC="$CC $fp_cv_prog_cc_stdc" ;; ++esac ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use prototypes" >&5 ++$as_echo_n "checking whether to use prototypes... " >&6; } ++if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then ++ msg="(overridden) " ++else ++ msg= ++ if test ."$fp_cv_prog_cc_stdc" = .no; then ++ ansi2knr=yes ++ else ++ ansi2knr=no ++ fi ++fi ++ ++if test "$ansi2knr" = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msg}no" >&5 ++$as_echo "${msg}no" >&6; } ++ U=_ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${msg}yes" >&5 ++$as_echo "${msg}yes" >&6; } ++ $as_echo "#define PROTOTYPES 1" >>confdefs.h ++ ++ U= ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 ++$as_echo_n "checking for ANSI C header files... " >&6; } ++if ${ac_cv_header_stdc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_stdc=yes ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++if test $ac_cv_header_stdc = yes; then ++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "memchr" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "free" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ++ if test "$cross_compiling" = yes; then : ++ : ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#if ((' ' & 0x0FF) == 0x020) ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#else ++# define ISLOWER(c) \ ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) ++#endif ++ ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) ++int ++main () ++{ ++ int i; ++ for (i = 0; i < 256; i++) ++ if (XOR (islower (i), ISLOWER (i)) ++ || toupper (i) != TOUPPER (i)) ++ return 2; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 ++$as_echo "$ac_cv_header_stdc" >&6; } ++if test $ac_cv_header_stdc = yes; then ++ ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h ++ ++fi ++ ++# On IRIX 5.3, sys/types and inttypes.h are conflicting. ++for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ ++ inttypes.h stdint.h unistd.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default ++" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" ++if test "x$ac_cv_type_size_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define size_t unsigned int ++_ACEOF ++ ++fi ++ ++# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works ++# for constant arguments. Useless! ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 ++$as_echo_n "checking for working alloca.h... " >&6; } ++if ${ac_cv_working_alloca_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++char *p = (char *) alloca (2 * sizeof (int)); ++ if (p) return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_working_alloca_h=yes ++else ++ ac_cv_working_alloca_h=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 ++$as_echo "$ac_cv_working_alloca_h" >&6; } ++if test $ac_cv_working_alloca_h = yes; then ++ ++$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 ++$as_echo_n "checking for alloca... " >&6; } ++if ${ac_cv_func_alloca_works+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __GNUC__ ++# define alloca __builtin_alloca ++#else ++# ifdef _MSC_VER ++# include ++# define alloca _alloca ++# else ++# ifdef HAVE_ALLOCA_H ++# include ++# else ++# ifdef _AIX ++ #pragma alloca ++# else ++# ifndef alloca /* predefined by HP cc +Olibcalls */ ++void *alloca (size_t); ++# endif ++# endif ++# endif ++# endif ++#endif ++ ++int ++main () ++{ ++char *p = (char *) alloca (1); ++ if (p) return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_func_alloca_works=yes ++else ++ ac_cv_func_alloca_works=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 ++$as_echo "$ac_cv_func_alloca_works" >&6; } ++ ++if test $ac_cv_func_alloca_works = yes; then ++ ++$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h ++ ++else ++ # The SVR3 libPW and SVR4 libucb both contain incompatible functions ++# that cause trouble. Some versions do not even contain alloca or ++# contain a buggy version. If you still want to use their alloca, ++# use ar to extract alloca.o from them instead of compiling alloca.c. ++ ++ALLOCA=\${LIBOBJDIR}alloca.$ac_objext ++ ++$as_echo "#define C_ALLOCA 1" >>confdefs.h ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 ++$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } ++if ${ac_cv_os_cray+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#if defined CRAY && ! defined CRAY2 ++webecray ++#else ++wenotbecray ++#endif ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "webecray" >/dev/null 2>&1; then : ++ ac_cv_os_cray=yes ++else ++ ac_cv_os_cray=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 ++$as_echo "$ac_cv_os_cray" >&6; } ++if test $ac_cv_os_cray = yes; then ++ for ac_func in _getb67 GETB67 getb67; do ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define CRAY_STACKSEG_END $ac_func ++_ACEOF ++ ++ break ++fi ++ ++ done ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 ++$as_echo_n "checking stack direction for C alloca... " >&6; } ++if ${ac_cv_c_stack_direction+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ ac_cv_c_stack_direction=0 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_includes_default ++int ++find_stack_direction () ++{ ++ static char *addr = 0; ++ auto char dummy; ++ if (addr == 0) ++ { ++ addr = &dummy; ++ return find_stack_direction (); ++ } ++ else ++ return (&dummy > addr) ? 1 : -1; ++} ++ ++int ++main () ++{ ++ return find_stack_direction () < 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ac_cv_c_stack_direction=1 ++else ++ ac_cv_c_stack_direction=-1 ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 ++$as_echo "$ac_cv_c_stack_direction" >&6; } ++cat >>confdefs.h <<_ACEOF ++#define STACK_DIRECTION $ac_cv_c_stack_direction ++_ACEOF ++ ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler supports union initialisation" >&5 ++$as_echo_n "checking if the compiler supports union initialisation... " >&6; } ++if ${zsh_cv_c_have_union_init+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++union{void *p;long l;}u={0}; ++int ++main () ++{ ++u.l=1; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_c_have_union_init=yes ++else ++ zsh_cv_c_have_union_init=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_have_union_init" >&5 ++$as_echo "$zsh_cv_c_have_union_init" >&6; } ++ ++if test x$zsh_cv_c_have_union_init = xyes; then ++ $as_echo "#define HAVE_UNION_INIT 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if signed to unsigned casting is broken" >&5 ++$as_echo_n "checking if signed to unsigned casting is broken... " >&6; } ++if ${zsh_cv_c_broken_signed_to_unsigned_casting+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_c_broken_signed_to_unsigned_casting=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++main(){return((int)(unsigned char)((char) -1) == 255);} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_c_broken_signed_to_unsigned_casting=yes ++else ++ zsh_cv_c_broken_signed_to_unsigned_casting=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_broken_signed_to_unsigned_casting" >&5 ++$as_echo "$zsh_cv_c_broken_signed_to_unsigned_casting" >&6; } ++ ++if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then ++ $as_echo "#define BROKEN_SIGNED_TO_UNSIGNED_CASTING 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the compiler supports variable-length arrays" >&5 ++$as_echo_n "checking if the compiler supports variable-length arrays... " >&6; } ++if ${zsh_cv_c_variable_length_arrays+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++int foo(), n; ++int ++main () ++{ ++int i[foo()], a[n+1]; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_c_variable_length_arrays=yes ++else ++ zsh_cv_c_variable_length_arrays=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_variable_length_arrays" >&5 ++$as_echo "$zsh_cv_c_variable_length_arrays" >&6; } ++ ++if test x$zsh_cv_c_variable_length_arrays = xyes; then ++ $as_echo "#define HAVE_VARIABLE_LENGTH_ARRAYS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 ++$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } ++set x ${MAKE-make} ++ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` ++if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat >conftest.make <<\_ACEOF ++SHELL = /bin/sh ++all: ++ @echo '@@@%%%=$(MAKE)=@@@%%%' ++_ACEOF ++# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. ++case `${MAKE-make} -f conftest.make 2>/dev/null` in ++ *@@@%%%=?*=@@@%%%*) ++ eval ac_cv_prog_make_${ac_make}_set=yes;; ++ *) ++ eval ac_cv_prog_make_${ac_make}_set=no;; ++esac ++rm -f conftest.make ++fi ++if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++ SET_MAKE= ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++ SET_MAKE="MAKE=${MAKE-make}" ++fi ++ # Find a good install program. We prefer a C program (faster), ++# so one script is as good as another. But avoid the broken or ++# incompatible versions: ++# SysV /etc/install, /usr/sbin/install ++# SunOS /usr/etc/install ++# IRIX /sbin/install ++# AIX /bin/install ++# AmigaOS /C/install, which installs bootblocks on floppy discs ++# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag ++# AFS /usr/afsws/bin/install, which mishandles nonexistent args ++# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" ++# OS/2's system install, which has a completely different semantic ++# ./install, which can be erroneously created by make from ./install.sh. ++# Reject install programs that cannot install multiple files. ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 ++$as_echo_n "checking for a BSD-compatible install... " >&6; } ++if test -z "$INSTALL"; then ++if ${ac_cv_path_install+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ # Account for people who put trailing slashes in PATH elements. ++case $as_dir/ in #(( ++ ./ | .// | /[cC]/* | \ ++ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ++ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ ++ /usr/ucb/* ) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then ++ if test $ac_prog = install && ++ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ elif test $ac_prog = install && ++ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then ++ # program-specific install script used by HP pwplus--don't use. ++ : ++ else ++ rm -rf conftest.one conftest.two conftest.dir ++ echo one > conftest.one ++ echo two > conftest.two ++ mkdir conftest.dir ++ if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && ++ test -s conftest.one && test -s conftest.two && ++ test -s conftest.dir/conftest.one && ++ test -s conftest.dir/conftest.two ++ then ++ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" ++ break 3 ++ fi ++ fi ++ fi ++ done ++ done ++ ;; ++esac ++ ++ done ++IFS=$as_save_IFS ++ ++rm -rf conftest.one conftest.two conftest.dir ++ ++fi ++ if test "${ac_cv_path_install+set}" = set; then ++ INSTALL=$ac_cv_path_install ++ else ++ # As a last resort, use the slow shell script. Don't cache a ++ # value for INSTALL within a source directory, because that will ++ # break other packages using the cache if that directory is ++ # removed, or if the value is a relative name. ++ INSTALL=$ac_install_sh ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 ++$as_echo "$INSTALL" >&6; } ++ ++# Use test -z because SunOS4 sh mishandles braces in ${var-val}. ++# It thinks the first close brace ends the variable substitution. ++test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' ++ ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' ++ ++test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ++ for ac_prog in gawk mawk nawk awk ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_AWK+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$AWK"; then ++ ac_cv_prog_AWK="$AWK" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_AWK="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++AWK=$ac_cv_prog_AWK ++if test -n "$AWK"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 ++$as_echo "$AWK" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$AWK" && break ++done ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln works" >&5 ++$as_echo_n "checking whether ln works... " >&6; } ++if ${ac_cv_prog_LN+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ rm -f conftestdata conftestlink ++echo > conftestdata ++if ln conftestdata conftestlink 2>/dev/null ++then ++ rm -f conftestdata conftestlink ++ ac_cv_prog_LN="ln" ++else ++ rm -f conftestdata ++ ac_cv_prog_LN="cp" ++fi ++fi ++LN="$ac_cv_prog_LN" ++if test "$ac_cv_prog_LN" = "ln"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 ++$as_echo "yes" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 ++$as_echo_n "checking for egrep... " >&6; } ++if ${ac_cv_path_EGREP+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 ++ then ac_cv_path_EGREP="$GREP -E" ++ else ++ if test -z "$EGREP"; then ++ ac_path_EGREP_found=false ++ # Loop through the user's path and test for each of PROGNAME-LIST ++ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_prog in egrep; do ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" ++ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue ++# Check for GNU ac_path_EGREP and select it if it is found. ++ # Check for GNU $ac_path_EGREP ++case `"$ac_path_EGREP" --version 2>&1` in ++*GNU*) ++ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; ++*) ++ ac_count=0 ++ $as_echo_n 0123456789 >"conftest.in" ++ while : ++ do ++ cat "conftest.in" "conftest.in" >"conftest.tmp" ++ mv "conftest.tmp" "conftest.in" ++ cp "conftest.in" "conftest.nl" ++ $as_echo 'EGREP' >> "conftest.nl" ++ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break ++ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ++ as_fn_arith $ac_count + 1 && ac_count=$as_val ++ if test $ac_count -gt ${ac_path_EGREP_max-0}; then ++ # Best one so far, save it but keep looking for a better one ++ ac_cv_path_EGREP="$ac_path_EGREP" ++ ac_path_EGREP_max=$ac_count ++ fi ++ # 10*(2^10) chars as input seems more than enough ++ test $ac_count -gt 10 && break ++ done ++ rm -f conftest.in conftest.tmp conftest.nl conftest.out;; ++esac ++ ++ $ac_path_EGREP_found && break 3 ++ done ++ done ++ done ++IFS=$as_save_IFS ++ if test -z "$ac_cv_path_EGREP"; then ++ as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 ++ fi ++else ++ ac_cv_path_EGREP=$EGREP ++fi ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 ++$as_echo "$ac_cv_path_EGREP" >&6; } ++ EGREP="$ac_cv_path_EGREP" ++ ++ for ac_prog in yodl ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_YODL+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$YODL"; then ++ ac_cv_prog_YODL="$YODL" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_YODL="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++YODL=$ac_cv_prog_YODL ++if test -n "$YODL"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YODL" >&5 ++$as_echo "$YODL" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$YODL" && break ++done ++test -n "$YODL" || YODL=": yodl" ++ ++ ++YODL_OPTIONS='' ++if test "x$ac_cv_prog_YODL" = xyodl; then ++ case `yodl --version` in ++ *"version 3."*) YODL_OPTIONS='-L' ;; ++ esac ++fi ++ ++ ++for ac_prog in pdfetex ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_PDFETEX+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$PDFETEX"; then ++ ac_cv_prog_PDFETEX="$PDFETEX" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_PDFETEX="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++PDFETEX=$ac_cv_prog_PDFETEX ++if test -n "$PDFETEX"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PDFETEX" >&5 ++$as_echo "$PDFETEX" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$PDFETEX" && break ++done ++test -n "$PDFETEX" || PDFETEX=": pdfetex" ++ ++for ac_prog in texi2pdf ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_TEXI2PDF+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$TEXI2PDF"; then ++ ac_cv_prog_TEXI2PDF="$TEXI2PDF" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_TEXI2PDF="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++TEXI2PDF=$ac_cv_prog_TEXI2PDF ++if test -n "$TEXI2PDF"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2PDF" >&5 ++$as_echo "$TEXI2PDF" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$TEXI2PDF" && break ++done ++ ++for ac_prog in texi2html ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_TEXI2HTML+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$TEXI2HTML"; then ++ ac_cv_prog_TEXI2HTML="$TEXI2HTML" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_TEXI2HTML="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++TEXI2HTML=$ac_cv_prog_TEXI2HTML ++if test -n "$TEXI2HTML"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TEXI2HTML" >&5 ++$as_echo "$TEXI2HTML" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$TEXI2HTML" && break ++done ++ ++for ac_prog in ansi2knr ++do ++ # Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_ANSI2KNR+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$ANSI2KNR"; then ++ ac_cv_prog_ANSI2KNR="$ANSI2KNR" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_ANSI2KNR="$ac_prog" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++ANSI2KNR=$ac_cv_prog_ANSI2KNR ++if test -n "$ANSI2KNR"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ANSI2KNR" >&5 ++$as_echo "$ANSI2KNR" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++ test -n "$ANSI2KNR" && break ++done ++test -n "$ANSI2KNR" || ANSI2KNR=": ansi2knr" ++ ++ ++if test x"$ansi2knr" = xyes && test x"$ANSI2KNR" = x": ansi2knr"; then ++ echo "----------" ++ echo "configure fatal error:" ++ echo "ansi2knr was specified (--enable-ansi2knr) but the program could not be found." ++ echo "Either remove the configure option if it is not required or build the ansi2knr" ++ echo "program before reconfiguring Zsh. The source code for ansi2knr is also" ++ echo "available in the GPL directory on Zsh distribution sites." ++ exit 1 ++fi ++ ++ac_header_dirent=no ++for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do ++ as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 ++$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } ++if eval \${$as_ac_Header+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include <$ac_hdr> ++ ++int ++main () ++{ ++if ((DIR *) 0) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ eval "$as_ac_Header=yes" ++else ++ eval "$as_ac_Header=no" ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++eval ac_res=\$$as_ac_Header ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 ++$as_echo "$ac_res" >&6; } ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 ++_ACEOF ++ ++ac_header_dirent=$ac_hdr; break ++fi ++ ++done ++# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. ++if test $ac_header_dirent = dirent.h; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 ++$as_echo_n "checking for library containing opendir... " >&6; } ++if ${ac_cv_search_opendir+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char opendir (); ++int ++main () ++{ ++return opendir (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' dir; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_opendir=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_opendir+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_opendir+:} false; then : ++ ++else ++ ac_cv_search_opendir=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 ++$as_echo "$ac_cv_search_opendir" >&6; } ++ac_res=$ac_cv_search_opendir ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 ++$as_echo_n "checking for library containing opendir... " >&6; } ++if ${ac_cv_search_opendir+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char opendir (); ++int ++main () ++{ ++return opendir (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' x; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_opendir=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_opendir+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_opendir+:} false; then : ++ ++else ++ ac_cv_search_opendir=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 ++$as_echo "$ac_cv_search_opendir" >&6; } ++ac_res=$ac_cv_search_opendir ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 ++$as_echo_n "checking for ANSI C header files... " >&6; } ++if ${ac_cv_header_stdc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#include ++#include ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_stdc=yes ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++if test $ac_cv_header_stdc = yes; then ++ # SunOS 4.x string.h does not declare mem*, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "memchr" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "free" >/dev/null 2>&1; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f conftest* ++ ++fi ++ ++if test $ac_cv_header_stdc = yes; then ++ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. ++ if test "$cross_compiling" = yes; then : ++ : ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#if ((' ' & 0x0FF) == 0x020) ++# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') ++# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) ++#else ++# define ISLOWER(c) \ ++ (('a' <= (c) && (c) <= 'i') \ ++ || ('j' <= (c) && (c) <= 'r') \ ++ || ('s' <= (c) && (c) <= 'z')) ++# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) ++#endif ++ ++#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) ++int ++main () ++{ ++ int i; ++ for (i = 0; i < 256; i++) ++ if (XOR (islower (i), ISLOWER (i)) ++ || toupper (i) != TOUPPER (i)) ++ return 2; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ++else ++ ac_cv_header_stdc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 ++$as_echo "$ac_cv_header_stdc" >&6; } ++if test $ac_cv_header_stdc = yes; then ++ ++$as_echo "#define STDC_HEADERS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 ++$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } ++if ${ac_cv_header_time+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#include ++ ++int ++main () ++{ ++if ((struct tm *) 0) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_time=yes ++else ++ ac_cv_header_time=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 ++$as_echo "$ac_cv_header_time" >&6; } ++if test $ac_cv_header_time = yes; then ++ ++$as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5 ++$as_echo_n "checking whether stat file-mode macros are broken... " >&6; } ++if ${ac_cv_header_stat_broken+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++ ++#if defined S_ISBLK && defined S_IFDIR ++extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; ++#endif ++ ++#if defined S_ISBLK && defined S_IFCHR ++extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; ++#endif ++ ++#if defined S_ISLNK && defined S_IFREG ++extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; ++#endif ++ ++#if defined S_ISSOCK && defined S_IFREG ++extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; ++#endif ++ ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_stat_broken=no ++else ++ ac_cv_header_stat_broken=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 ++$as_echo "$ac_cv_header_stat_broken" >&6; } ++if test $ac_cv_header_stat_broken = yes; then ++ ++$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 ++$as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } ++if ${ac_cv_header_sys_wait_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++#ifndef WEXITSTATUS ++# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) ++#endif ++#ifndef WIFEXITED ++# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) ++#endif ++ ++int ++main () ++{ ++ int s; ++ wait (&s); ++ s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_sys_wait_h=yes ++else ++ ac_cv_header_sys_wait_h=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 ++$as_echo "$ac_cv_header_sys_wait_h" >&6; } ++if test $ac_cv_header_sys_wait_h = yes; then ++ ++$as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h ++ ++fi ++ ++ ++oldcflags="$CFLAGS" ++if test x$enable_pcre = xyes; then ++# Extract the first word of "pcre-config", so it can be a program name with args. ++set dummy pcre-config; ac_word=$2 ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 ++$as_echo_n "checking for $ac_word... " >&6; } ++if ${ac_cv_prog_PCRECONF+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -n "$PCRECONF"; then ++ ac_cv_prog_PCRECONF="$PCRECONF" # Let the user override the test. ++else ++as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ for ac_exec_ext in '' $ac_executable_extensions; do ++ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ++ ac_cv_prog_PCRECONF="pcre-config" ++ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 ++ break 2 ++ fi ++done ++ done ++IFS=$as_save_IFS ++ ++fi ++fi ++PCRECONF=$ac_cv_prog_PCRECONF ++if test -n "$PCRECONF"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCRECONF" >&5 ++$as_echo "$PCRECONF" >&6; } ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 ++$as_echo "no" >&6; } ++fi ++ ++ ++if test "x$ac_cv_prog_PCRECONF" = xpcre-config; then ++ CPPFLAGS="$CPPFLAGS `pcre-config --cflags`" ++fi ++fi ++ ++for ac_header in sys/time.h sys/times.h sys/select.h termcap.h termio.h \ ++ termios.h sys/param.h sys/filio.h string.h memory.h \ ++ limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \ ++ locale.h errno.h stdio.h stdarg.h varargs.h stdlib.h \ ++ unistd.h sys/capability.h \ ++ utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ ++ netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \ ++ sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ ++ ncurses/ncurses.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++if test x$dynamic = xyes; then ++ for ac_header in dlfcn.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" ++if test "x$ac_cv_header_dlfcn_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_DLFCN_H 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ for ac_header in dl.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" ++if test "x$ac_cv_header_dl_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_DL_H 1 ++_ACEOF ++ ++fi ++ ++done ++ ++fi ++ ++ ++if test x$ac_cv_header_sys_time_h = xyes && test x$ac_cv_header_sys_select_h = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for conflicts in sys/time.h and sys/select.h" >&5 ++$as_echo_n "checking for conflicts in sys/time.h and sys/select.h... " >&6; } ++if ${zsh_cv_header_time_h_select_h_conflicts+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_time_h_select_h_conflicts=no ++else ++ zsh_cv_header_time_h_select_h_conflicts=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_time_h_select_h_conflicts" >&5 ++$as_echo "$zsh_cv_header_time_h_select_h_conflicts" >&6; } ++ if test x$zsh_cv_header_time_h_select_h_conflicts = xyes; then ++ $as_echo "#define TIME_H_SELECT_H_CONFLICTS 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++if test x$ac_cv_header_termios_h = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in termios.h" >&5 ++$as_echo_n "checking TIOCGWINSZ in termios.h... " >&6; } ++if ${zsh_cv_header_termios_h_tiocgwinsz+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#include ++int ++main () ++{ ++int x = TIOCGWINSZ; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_header_termios_h_tiocgwinsz=yes ++else ++ zsh_cv_header_termios_h_tiocgwinsz=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_termios_h_tiocgwinsz" >&5 ++$as_echo "$zsh_cv_header_termios_h_tiocgwinsz" >&6; } ++else ++ zsh_cv_header_termios_h_tiocgwinsz=no ++fi ++if test x$zsh_cv_header_termios_h_tiocgwinsz = xno; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking TIOCGWINSZ in sys/ioctl.h" >&5 ++$as_echo_n "checking TIOCGWINSZ in sys/ioctl.h... " >&6; } ++if ${zsh_cv_header_sys_ioctl_h_tiocgwinsz+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#include ++int ++main () ++{ ++int x = TIOCGWINSZ; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_header_sys_ioctl_h_tiocgwinsz=yes ++else ++ zsh_cv_header_sys_ioctl_h_tiocgwinsz=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_ioctl_h_tiocgwinsz" >&5 ++$as_echo "$zsh_cv_header_sys_ioctl_h_tiocgwinsz" >&6; } ++ if test x$zsh_cv_header_sys_ioctl_h_tiocgwinsz = xyes; then ++ $as_echo "#define GWINSZ_IN_SYS_IOCTL 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for streams headers including struct winsize" >&5 ++$as_echo_n "checking for streams headers including struct winsize... " >&6; } ++if ${ac_cv_winsize_in_ptem+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++int ++main () ++{ ++struct winsize wsz ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_winsize_in_ptem=yes ++else ++ ac_cv_winsize_in_ptem=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_winsize_in_ptem" >&5 ++$as_echo "$ac_cv_winsize_in_ptem" >&6; } ++if test x$ac_cv_winsize_in_ptem = xyes; then ++ $as_echo "#define WINSIZE_IN_PTEM 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printf in -lc" >&5 ++$as_echo_n "checking for printf in -lc... " >&6; } ++if ${ac_cv_lib_c_printf+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lc $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char printf (); ++int ++main () ++{ ++return printf (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_c_printf=yes ++else ++ ac_cv_lib_c_printf=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_printf" >&5 ++$as_echo "$ac_cv_lib_c_printf" >&6; } ++if test "x$ac_cv_lib_c_printf" = xyes; then : ++ LIBS="$LIBS -lc" ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 ++$as_echo_n "checking for pow in -lm... " >&6; } ++if ${ac_cv_lib_m_pow+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lm $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char pow (); ++int ++main () ++{ ++return pow (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_m_pow=yes ++else ++ ac_cv_lib_m_pow=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 ++$as_echo "$ac_cv_lib_m_pow" >&6; } ++if test "x$ac_cv_lib_m_pow" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBM 1 ++_ACEOF ++ ++ LIBS="-lm $LIBS" ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5 ++$as_echo_n "checking for clock_gettime in -lrt... " >&6; } ++if ${ac_cv_lib_rt_clock_gettime+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lrt $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char clock_gettime (); ++int ++main () ++{ ++return clock_gettime (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_rt_clock_gettime=yes ++else ++ ac_cv_lib_rt_clock_gettime=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5 ++$as_echo "$ac_cv_lib_rt_clock_gettime" >&6; } ++if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBRT 1 ++_ACEOF ++ ++ LIBS="-lrt $LIBS" ++ ++fi ++ ++ ++if test x$ac_cv_header_ncurses_h = xyes || test x$ac_cv_header_ncurses_ncurses_h = xyes || test x$ac_cv_header_ncursesw_ncurses_h = xyes; then ++ ncursesw_test=ncursesw ++ ncurses_test=ncurses ++else ++ ncursesw_test= ++ ncurses_test= ++fi ++ ++ ++# Check whether --with-term-lib was given. ++if test "${with_term_lib+set}" = set; then : ++ withval=$with_term_lib; if test "x$withval" != xno && test "x$withval" != x ; then ++ termcap_curses_order="$withval" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tigetstr" >&5 ++$as_echo_n "checking for library containing tigetstr... " >&6; } ++if ${ac_cv_search_tigetstr+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char tigetstr (); ++int ++main () ++{ ++return tigetstr (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' $termcap_curses_order; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_tigetstr=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_tigetstr+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_tigetstr+:} false; then : ++ ++else ++ ac_cv_search_tigetstr=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tigetstr" >&5 ++$as_echo "$ac_cv_search_tigetstr" >&6; } ++ac_res=$ac_cv_search_tigetstr ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++else ++ termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" ++fi ++else ++ case "$host_os" in ++ solaris*) ++ termcap_curses_order="$ncursesw_test $ncurses_test curses termcap" ;; ++ hpux10.*|hpux11.*) ++ DL_EXT="${DL_EXT=sl}" ++ termcap_curses_order="Hcurses $ncursesw_test $ncurses_test curses termcap" ;; ++ *) ++ termcap_curses_order="$ncursesw_test tinfo termcap $ncurses_test curses" ;; ++esac ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if _XOPEN_SOURCE_EXTENDED should not be defined" >&5 ++$as_echo_n "checking if _XOPEN_SOURCE_EXTENDED should not be defined... " >&6; } ++if ${zsh_cv_no_xopen+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case "$host_os" in ++ *openbsd*|*freebsd5*|*freebsd6.[012]*|*aix*) ++ zsh_cv_no_xopen=yes ++ ;; ++ *) ++ zsh_cv_no_xopen=no ++ ;; ++esac ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_no_xopen" >&5 ++$as_echo "$zsh_cv_no_xopen" >&6; } ++if test x$zsh_cv_no_xopen = xyes; then ++ $as_echo "#define ZSH_NO_XOPEN 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tigetflag" >&5 ++$as_echo_n "checking for library containing tigetflag... " >&6; } ++if ${ac_cv_search_tigetflag+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char tigetflag (); ++int ++main () ++{ ++return tigetflag (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' $termcap_curses_order; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_tigetflag=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_tigetflag+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_tigetflag+:} false; then : ++ ++else ++ ac_cv_search_tigetflag=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tigetflag" >&5 ++$as_echo "$ac_cv_search_tigetflag" >&6; } ++ac_res=$ac_cv_search_tigetflag ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tgetent" >&5 ++$as_echo_n "checking for library containing tgetent... " >&6; } ++if ${ac_cv_search_tgetent+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char tgetent (); ++int ++main () ++{ ++return tgetent (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' $termcap_curses_order; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_tgetent=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_tgetent+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_tgetent+:} false; then : ++ ++else ++ ac_cv_search_tgetent=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tgetent" >&5 ++$as_echo "$ac_cv_search_tgetent" >&6; } ++ac_res=$ac_cv_search_tgetent ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ true ++else ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 ++$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} ++as_fn_error 255 "\"No terminal handling library was found on your system. ++This is probably a library called 'curses' or 'ncurses'. You may ++need to install a package called 'curses-devel' or 'ncurses-devel' on your ++system.\" ++See \`config.log' for more details" "$LINENO" 5; } ++fi ++ ++for ac_header in curses.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default" ++if test "x$ac_cv_header_curses_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_CURSES_H 1 ++_ACEOF ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Solaris 8 curses.h mistake" >&5 ++$as_echo_n "checking for Solaris 8 curses.h mistake... " >&6; } ++if ${ac_cv_header_curses_solaris+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_header_curses_h=yes ++ac_cv_header_curses_solaris=yes ++else ++ ac_cv_header_curses_h=no ++ac_cv_header_curses_solaris=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_curses_solaris" >&5 ++$as_echo "$ac_cv_header_curses_solaris" >&6; } ++if test x$ac_cv_header_curses_solaris = xyes; then ++$as_echo "#define HAVE_CURSES_H 1" >>confdefs.h ++ ++fi ++fi ++ ++done ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need to ignore ncurses" >&5 ++$as_echo_n "checking if we need to ignore ncurses... " >&6; } ++if ${zsh_cv_ignore_ncurses+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case $LIBS in ++ *-lncurses*) ++ zsh_cv_ignore_ncurses=no ++ ;; ++ *) ++ zsh_cv_ignore_ncurses=yes ++ ;; ++esac ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_ignore_ncurses" >&5 ++$as_echo "$zsh_cv_ignore_ncurses" >&6; } ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getpwnam" >&5 ++$as_echo_n "checking for library containing getpwnam... " >&6; } ++if ${ac_cv_search_getpwnam+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char getpwnam (); ++int ++main () ++{ ++return getpwnam (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' nsl; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_getpwnam=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_getpwnam+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_getpwnam+:} false; then : ++ ++else ++ ac_cv_search_getpwnam=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getpwnam" >&5 ++$as_echo "$ac_cv_search_getpwnam" >&6; } ++ac_res=$ac_cv_search_getpwnam ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++ ++if test `echo $host_os | sed 's/^\(unicos\).*/\1/'` = unicos; then ++ LIBS="-lcraylm -lkrb -lnisdb -lnsl -lrpcsvc $LIBS" ++fi ++ ++if test "x$dynamic" = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 ++$as_echo_n "checking for dlopen in -ldl... " >&6; } ++if ${ac_cv_lib_dl_dlopen+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-ldl $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char dlopen (); ++int ++main () ++{ ++return dlopen (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_dl_dlopen=yes ++else ++ ac_cv_lib_dl_dlopen=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 ++$as_echo "$ac_cv_lib_dl_dlopen" >&6; } ++if test "x$ac_cv_lib_dl_dlopen" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBDL 1 ++_ACEOF ++ ++ LIBS="-ldl $LIBS" ++ ++fi ++ ++fi ++ ++if test x$enable_cap = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_get_proc in -lcap" >&5 ++$as_echo_n "checking for cap_get_proc in -lcap... " >&6; } ++if ${ac_cv_lib_cap_cap_get_proc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lcap $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char cap_get_proc (); ++int ++main () ++{ ++return cap_get_proc (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_cap_cap_get_proc=yes ++else ++ ac_cv_lib_cap_cap_get_proc=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_proc" >&5 ++$as_echo "$ac_cv_lib_cap_cap_get_proc" >&6; } ++if test "x$ac_cv_lib_cap_cap_get_proc" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBCAP 1 ++_ACEOF ++ ++ LIBS="-lcap $LIBS" ++ ++fi ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 ++$as_echo_n "checking for socket in -lsocket... " >&6; } ++if ${ac_cv_lib_socket_socket+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lsocket $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char socket (); ++int ++main () ++{ ++return socket (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_socket_socket=yes ++else ++ ac_cv_lib_socket_socket=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 ++$as_echo "$ac_cv_lib_socket_socket" >&6; } ++if test "x$ac_cv_lib_socket_socket" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBSOCKET 1 ++_ACEOF ++ ++ LIBS="-lsocket $LIBS" ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing gethostbyname2" >&5 ++$as_echo_n "checking for library containing gethostbyname2... " >&6; } ++if ${ac_cv_search_gethostbyname2+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char gethostbyname2 (); ++int ++main () ++{ ++return gethostbyname2 (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' bind; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_gethostbyname2=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_gethostbyname2+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_gethostbyname2+:} false; then : ++ ++else ++ ac_cv_search_gethostbyname2=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gethostbyname2" >&5 ++$as_echo "$ac_cv_search_gethostbyname2" >&6; } ++ac_res=$ac_cv_search_gethostbyname2 ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++ ++case $LIBS in ++ *-lbind*) ++ for ac_header in bind/netdb.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "bind/netdb.h" "ac_cv_header_bind_netdb_h" "$ac_includes_default" ++if test "x$ac_cv_header_bind_netdb_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_BIND_NETDB_H 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ;; ++esac ++ ++ ++if test "x$ac_cv_header_iconv_h" = "xyes"; then ++ ac_fn_c_check_func "$LINENO" "iconv" "ac_cv_func_iconv" ++if test "x$ac_cv_func_iconv" = xyes; then : ++ ac_found_iconv=yes ++else ++ ac_found_iconv=no ++fi ++ ++ if test "x$ac_found_iconv" = "xno"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv in -liconv" >&5 ++$as_echo_n "checking for iconv in -liconv... " >&6; } ++if ${ac_cv_lib_iconv_iconv+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-liconv $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char iconv (); ++int ++main () ++{ ++return iconv (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_iconv_iconv=yes ++else ++ ac_cv_lib_iconv_iconv=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_iconv" >&5 ++$as_echo "$ac_cv_lib_iconv_iconv" >&6; } ++if test "x$ac_cv_lib_iconv_iconv" = xyes; then : ++ ac_found_iconv=yes ++fi ++ ++ if test "x$ac_found_iconv" = "xno"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 ++$as_echo_n "checking for libiconv in -liconv... " >&6; } ++if ${ac_cv_lib_iconv_libiconv+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-liconv $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char libiconv (); ++int ++main () ++{ ++return libiconv (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_iconv_libiconv=yes ++else ++ ac_cv_lib_iconv_libiconv=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 ++$as_echo "$ac_cv_lib_iconv_libiconv" >&6; } ++if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : ++ ac_found_iconv=yes ++fi ++ ++ fi ++ if test "x$ac_found_iconv" != "xno"; then ++ LIBS="-liconv $LIBS" ++ fi ++ else ++ ac_fn_c_check_decl "$LINENO" "_libiconv_version" "ac_cv_have_decl__libiconv_version" " #include ++" ++if test "x$ac_cv_have_decl__libiconv_version" = xyes; then : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv in -liconv" >&5 ++$as_echo_n "checking for libiconv in -liconv... " >&6; } ++if ${ac_cv_lib_iconv_libiconv+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-liconv $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char libiconv (); ++int ++main () ++{ ++return libiconv (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_iconv_libiconv=yes ++else ++ ac_cv_lib_iconv_libiconv=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv" >&5 ++$as_echo "$ac_cv_lib_iconv_libiconv" >&6; } ++if test "x$ac_cv_lib_iconv_libiconv" = xyes; then : ++ LIBS="-liconv $LIBS" ++fi ++ ++fi ++ ++ fi ++fi ++ ++if test "x$ac_found_iconv" = xyes; then ++ ++$as_echo "#define HAVE_ICONV 1" >>confdefs.h ++ ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++int myversion = _libiconv_version ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define ICONV_FROM_LIBICONV 1" >>confdefs.h ++ ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++ ++if test "x$ac_found_iconv" = "xyes"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 ++$as_echo_n "checking for iconv declaration... " >&6; } ++if ${ac_cv_iconv_const+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ #include ++int ++main () ++{ ++#ifdef __cplusplus ++ "C" ++ #endif ++ #if defined(__STDC__) || defined(__cplusplus) ++ size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); ++ #else ++ size_t iconv(); ++ #endif ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_iconv_const= ++else ++ ac_cv_iconv_const=const ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_iconv_const" >&5 ++$as_echo "$ac_cv_iconv_const" >&6; } ++ ++cat >>confdefs.h <<_ACEOF ++#define ICONV_CONST $ac_cv_iconv_const ++_ACEOF ++ ++fi ++ ++if test x$enable_pcre = xyes; then ++ LIBS="`pcre-config --libs` $LIBS" ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if an include file defines ospeed" >&5 ++$as_echo_n "checking if an include file defines ospeed... " >&6; } ++if ${zsh_cv_decl_ospeed_include_defines+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#if HAVE_TERMIOS_H ++#include ++#endif ++#if HAVE_TERMCAP_H ++#include ++#endif ++int ++main () ++{ ++ospeed = 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_decl_ospeed_include_defines=yes ++else ++ zsh_cv_decl_ospeed_include_defines=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_ospeed_include_defines" >&5 ++$as_echo "$zsh_cv_decl_ospeed_include_defines" >&6; } ++ ++if test x$zsh_cv_decl_ospeed_include_defines = xno; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if you must define ospeed" >&5 ++$as_echo_n "checking if you must define ospeed... " >&6; } ++if ${zsh_cv_decl_ospeed_must_define+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++extern short ospeed; ospeed = 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_decl_ospeed_must_define=yes ++else ++ zsh_cv_decl_ospeed_must_define=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_ospeed_must_define" >&5 ++$as_echo "$zsh_cv_decl_ospeed_must_define" >&6; } ++fi ++ ++ ++ ++if test x$zsh_cv_decl_ospeed_include_defines = xyes; then ++ $as_echo "#define HAVE_OSPEED 1" >>confdefs.h ++ ++elif test x$zsh_cv_decl_ospeed_must_define = xyes; then ++ $as_echo "#define HAVE_OSPEED 1" >>confdefs.h ++ ++ $as_echo "#define MUST_DEFINE_OSPEED 1" >>confdefs.h ++ ++fi ++ ++if test x$gdbm != xno; then ++ for ac_header in gdbm.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "gdbm.h" "ac_cv_header_gdbm_h" "$ac_includes_default" ++if test "x$ac_cv_header_gdbm_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_GDBM_H 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gdbm_open in -lgdbm" >&5 ++$as_echo_n "checking for gdbm_open in -lgdbm... " >&6; } ++if ${ac_cv_lib_gdbm_gdbm_open+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lgdbm $LIBS" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char gdbm_open (); ++int ++main () ++{ ++return gdbm_open (); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_lib_gdbm_gdbm_open=yes ++else ++ ac_cv_lib_gdbm_gdbm_open=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gdbm_gdbm_open" >&5 ++$as_echo "$ac_cv_lib_gdbm_gdbm_open" >&6; } ++if test "x$ac_cv_lib_gdbm_gdbm_open" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_LIBGDBM 1 ++_ACEOF ++ ++ LIBS="-lgdbm $LIBS" ++ ++fi ++ ++fi ++ ++for ac_header in sys/xattr.h ++do : ++ ac_fn_c_check_header_mongrel "$LINENO" "sys/xattr.h" "ac_cv_header_sys_xattr_h" "$ac_includes_default" ++if test "x$ac_cv_header_sys_xattr_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_SYS_XATTR_H 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 ++$as_echo_n "checking return type of signal handlers... " >&6; } ++if ${ac_cv_type_signal+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++ ++int ++main () ++{ ++return *(signal (0, 0)) (0) == 1; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_type_signal=int ++else ++ ac_cv_type_signal=void ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 ++$as_echo "$ac_cv_type_signal" >&6; } ++ ++cat >>confdefs.h <<_ACEOF ++#define RETSIGTYPE $ac_cv_type_signal ++_ACEOF ++ ++ ++ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" ++if test "x$ac_cv_type_pid_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define pid_t int ++_ACEOF ++ ++fi ++ ++ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" ++if test "x$ac_cv_type_off_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define off_t long int ++_ACEOF ++ ++fi ++ ++ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" ++if test "x$ac_cv_type_ino_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define ino_t unsigned long ++_ACEOF ++ ++fi ++ ++ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" ++if test "x$ac_cv_type_mode_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define mode_t int ++_ACEOF ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 ++$as_echo_n "checking for uid_t in sys/types.h... " >&6; } ++if ${ac_cv_type_uid_t+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ ++_ACEOF ++if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | ++ $EGREP "uid_t" >/dev/null 2>&1; then : ++ ac_cv_type_uid_t=yes ++else ++ ac_cv_type_uid_t=no ++fi ++rm -f conftest* ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 ++$as_echo "$ac_cv_type_uid_t" >&6; } ++if test $ac_cv_type_uid_t = no; then ++ ++$as_echo "#define uid_t int" >>confdefs.h ++ ++ ++$as_echo "#define gid_t int" >>confdefs.h ++ ++fi ++ ++ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" ++if test "x$ac_cv_type_size_t" = xyes; then : ++ ++else ++ ++cat >>confdefs.h <<_ACEOF ++#define size_t unsigned int ++_ACEOF ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if long is 64 bits" >&5 ++$as_echo_n "checking if long is 64 bits... " >&6; } ++if ${zsh_cv_long_is_64_bit+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_long_is_64_bit=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++int main() { return sizeof(long) < 8; } ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_long_is_64_bit=yes ++else ++ zsh_cv_long_is_64_bit=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_long_is_64_bit" >&5 ++$as_echo "$zsh_cv_long_is_64_bit" >&6; } ++ ++ ++ ++ ++ ++ ++ ++if test x$zsh_cv_long_is_64_bit = xyes; then ++ $as_echo "#define LONG_IS_64_BIT 1" >>confdefs.h ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if off_t is 64 bit" >&5 ++$as_echo_n "checking if off_t is 64 bit... " >&6; } ++if ${zsh_cv_off_t_is_64_bit+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_off_t_is_64_bit=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++ ++main() { return sizeof(off_t) < 8; } ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_off_t_is_64_bit=yes ++else ++ zsh_cv_off_t_is_64_bit=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_off_t_is_64_bit" >&5 ++$as_echo "$zsh_cv_off_t_is_64_bit" >&6; } ++ if test x$zsh_cv_off_t_is_64_bit = xyes; then ++ $as_echo "#define OFF_T_IS_64_BIT 1" >>confdefs.h ++ ++ fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if ino_t is 64 bit" >&5 ++$as_echo_n "checking if ino_t is 64 bit... " >&6; } ++if ${zsh_cv_ino_t_is_64_bit+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_ino_t_is_64_bit=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++ ++main() { return sizeof(ino_t) < 8; } ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_ino_t_is_64_bit=yes ++else ++ zsh_cv_ino_t_is_64_bit=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_ino_t_is_64_bit" >&5 ++$as_echo "$zsh_cv_ino_t_is_64_bit" >&6; } ++ if test x$zsh_cv_ino_t_is_64_bit = xyes; then ++ $as_echo "#define INO_T_IS_64_BIT 1" >>confdefs.h ++ ++ fi ++ ++ if test x$enable_largefile != xno -o x$zsh_cv_off_t_is_64_bit = xyes \ ++ -o $zsh_cv_ino_t_is_64_bit = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler has a 64 bit type" >&5 ++$as_echo_n "checking if compiler has a 64 bit type... " >&6; } ++if ${zsh_cv_64_bit_type+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ if test x != x ; then ++ zsh_cv_64_bit_type="long long" ++ else ++ zsh_cv_64_bit_type=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ long long foo = 0; ++ int bar = (int) foo; ++ return sizeof(long long) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_type="long long" ++else ++ zsh_cv_64_bit_type=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ if test "$zsh_cv_64_bit_type" = no; then ++ if test "$cross_compiling" = yes; then : ++ if test x != x ; then ++ zsh_cv_64_bit_type="quad_t" ++ else ++ zsh_cv_64_bit_type=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ quad_t foo = 0; ++ int bar = (int) foo; ++ return sizeof(quad_t) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_type="quad_t" ++else ++ zsh_cv_64_bit_type=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ fi ++ if test "$zsh_cv_64_bit_type" = no; then ++ if test "$cross_compiling" = yes; then : ++ if test x != x ; then ++ zsh_cv_64_bit_type="__int64_t" ++ else ++ zsh_cv_64_bit_type=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ __int64_t foo = 0; ++ int bar = (int) foo; ++ return sizeof(__int64_t) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_type="__int64_t" ++else ++ zsh_cv_64_bit_type=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ fi ++ if test "$zsh_cv_64_bit_type" = no && ++ test "$zsh_cv_off_t_is_64_bit" = yes; then ++ if test "$cross_compiling" = yes; then : ++ if test x != x ; then ++ zsh_cv_64_bit_type="off_t" ++ else ++ zsh_cv_64_bit_type=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ off_t foo = 0; ++ int bar = (int) foo; ++ return sizeof(off_t) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_type="off_t" ++else ++ zsh_cv_64_bit_type=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_64_bit_type" >&5 ++$as_echo "$zsh_cv_64_bit_type" >&6; } ++ if test "$zsh_cv_64_bit_type" != no; then ++ cat >>confdefs.h <<_ACEOF ++#define ZSH_64_BIT_TYPE $zsh_cv_64_bit_type ++_ACEOF ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a corresponding unsigned 64 bit type" >&5 ++$as_echo_n "checking for a corresponding unsigned 64 bit type... " >&6; } ++if ${zsh_cv_64_bit_utype+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ if test xforce != x ; then ++ zsh_cv_64_bit_utype="unsigned $zsh_cv_64_bit_type" ++ else ++ zsh_cv_64_bit_utype=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ unsigned $zsh_cv_64_bit_type foo = 0; ++ int bar = (int) foo; ++ return sizeof(unsigned $zsh_cv_64_bit_type) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_utype="unsigned $zsh_cv_64_bit_type" ++else ++ zsh_cv_64_bit_utype=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ if test "$zsh_cv_64_bit_utype" = no; then ++ if test "$cross_compiling" = yes; then : ++ if test x != x ; then ++ zsh_cv_64_bit_utype="__uint64_t" ++ else ++ zsh_cv_64_bit_utype=no ++ fi ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++#include ++#endif ++ ++main() ++{ ++ __uint64_t foo = 0; ++ int bar = (int) foo; ++ return sizeof(__uint64_t) != 8; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_64_bit_utype="__uint64_t" ++else ++ zsh_cv_64_bit_utype=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ ++ fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_64_bit_utype" >&5 ++$as_echo "$zsh_cv_64_bit_utype" >&6; } ++ if test "$zsh_cv_64_bit_utype" != no; then ++ cat >>confdefs.h <<_ACEOF ++#define ZSH_64_BIT_UTYPE $zsh_cv_64_bit_utype ++_ACEOF ++ ++ fi ++ fi ++ fi ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigset_t" >&5 ++$as_echo_n "checking for sigset_t... " >&6; } ++if ${zsh_cv_type_sigset_t+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#define _POSIX_C_SOURCE 200809L ++#include ++#include ++int ++main () ++{ ++sigset_t tempsigset; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_sigset_t=yes ++else ++ zsh_cv_type_sigset_t=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_sigset_t" >&5 ++$as_echo "$zsh_cv_type_sigset_t" >&6; } ++ ++if test x$zsh_cv_type_sigset_t = xno; then ++ $as_echo "#define sigset_t unsigned int" >>confdefs.h ++ ++fi ++ ++ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_mtim.tv_nsec" "ac_cv_member_struct_stat_st_mtim_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_mtim_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimespec.tv_nsec" "ac_cv_member_struct_stat_st_mtimespec_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_mtimespec_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_mtimensec" "ac_cv_member_struct_stat_st_mtimensec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_mtimensec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_MTIMENSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_ctim.tv_nsec" "ac_cv_member_struct_stat_st_ctim_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_ctim_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimespec.tv_nsec" "ac_cv_member_struct_stat_st_ctimespec_tv_nsec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_ctimespec_tv_nsec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct stat" "st_ctimensec" "ac_cv_member_struct_stat_st_ctimensec" "$ac_includes_default" ++if test "x$ac_cv_member_struct_stat_st_ctimensec" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_CTIMENSEC 1 ++_ACEOF ++ ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timezone" >&5 ++$as_echo_n "checking for struct timezone... " >&6; } ++if ${zsh_cv_type_exists_struct_timezone+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#define _GNU_SOURCE 1 ++#ifdef HAVE_SYS_TIME_H ++# include ++#endif ++ ++int ++main () ++{ ++struct timezone testvar; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_exists_struct_timezone=yes ++else ++ zsh_cv_type_exists_struct_timezone=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_timezone" >&5 ++$as_echo "$zsh_cv_type_exists_struct_timezone" >&6; } ++ ++if test $zsh_cv_type_exists_struct_timezone = yes; then ++ $as_echo "#define HAVE_STRUCT_TIMEZONE 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utmp" >&5 ++$as_echo_n "checking for struct utmp... " >&6; } ++if ${zsh_cv_type_exists_struct_utmp+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMP_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmp testvar; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_exists_struct_utmp=yes ++else ++ zsh_cv_type_exists_struct_utmp=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_utmp" >&5 ++$as_echo "$zsh_cv_type_exists_struct_utmp" >&6; } ++ ++if test $zsh_cv_type_exists_struct_utmp = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMP 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct utmpx" >&5 ++$as_echo_n "checking for struct utmpx... " >&6; } ++if ${zsh_cv_type_exists_struct_utmpx+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMPX_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmpx testvar; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_exists_struct_utmpx=yes ++else ++ zsh_cv_type_exists_struct_utmpx=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_exists_struct_utmpx" >&5 ++$as_echo "$zsh_cv_type_exists_struct_utmpx" >&6; } ++ ++if test $zsh_cv_type_exists_struct_utmpx = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMPX 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host in struct utmp" >&5 ++$as_echo_n "checking for ut_host in struct utmp... " >&6; } ++if ${zsh_cv_struct_member_struct_utmp_ut_host+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMP_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmp testvar; testvar.ut_host; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_utmp_ut_host=yes ++else ++ zsh_cv_struct_member_struct_utmp_ut_host=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmp_ut_host" >&5 ++$as_echo "$zsh_cv_struct_member_struct_utmp_ut_host" >&6; } ++ ++if test $zsh_cv_struct_member_struct_utmp_ut_host = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMP_UT_HOST 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_host in struct utmpx" >&5 ++$as_echo_n "checking for ut_host in struct utmpx... " >&6; } ++if ${zsh_cv_struct_member_struct_utmpx_ut_host+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMPX_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmpx testvar; testvar.ut_host; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_utmpx_ut_host=yes ++else ++ zsh_cv_struct_member_struct_utmpx_ut_host=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_host" >&5 ++$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_host" >&6; } ++ ++if test $zsh_cv_struct_member_struct_utmpx_ut_host = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMPX_UT_HOST 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_xtime in struct utmpx" >&5 ++$as_echo_n "checking for ut_xtime in struct utmpx... " >&6; } ++if ${zsh_cv_struct_member_struct_utmpx_ut_xtime+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMPX_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmpx testvar; testvar.ut_xtime; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_utmpx_ut_xtime=yes ++else ++ zsh_cv_struct_member_struct_utmpx_ut_xtime=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_xtime" >&5 ++$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_xtime" >&6; } ++ ++if test $zsh_cv_struct_member_struct_utmpx_ut_xtime = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMPX_UT_XTIME 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ut_tv in struct utmpx" >&5 ++$as_echo_n "checking for ut_tv in struct utmpx... " >&6; } ++if ${zsh_cv_struct_member_struct_utmpx_ut_tv+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_UTMPX_H ++# include ++#endif ++ ++int ++main () ++{ ++struct utmpx testvar; testvar.ut_tv; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_utmpx_ut_tv=yes ++else ++ zsh_cv_struct_member_struct_utmpx_ut_tv=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_utmpx_ut_tv" >&5 ++$as_echo "$zsh_cv_struct_member_struct_utmpx_ut_tv" >&6; } ++ ++if test $zsh_cv_struct_member_struct_utmpx_ut_tv = yes; then ++ $as_echo "#define HAVE_STRUCT_UTMPX_UT_TV 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino in struct dirent" >&5 ++$as_echo_n "checking for d_ino in struct dirent... " >&6; } ++if ${zsh_cv_struct_member_struct_dirent_d_ino+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_DIRENT_H ++# include ++#endif ++ ++int ++main () ++{ ++struct dirent testvar; testvar.d_ino; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_dirent_d_ino=yes ++else ++ zsh_cv_struct_member_struct_dirent_d_ino=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_dirent_d_ino" >&5 ++$as_echo "$zsh_cv_struct_member_struct_dirent_d_ino" >&6; } ++ ++if test $zsh_cv_struct_member_struct_dirent_d_ino = yes; then ++ $as_echo "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_stat in struct dirent" >&5 ++$as_echo_n "checking for d_stat in struct dirent... " >&6; } ++if ${zsh_cv_struct_member_struct_dirent_d_stat+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_DIRENT_H ++# include ++#endif ++ ++int ++main () ++{ ++struct dirent testvar; testvar.d_stat; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_dirent_d_stat=yes ++else ++ zsh_cv_struct_member_struct_dirent_d_stat=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_dirent_d_stat" >&5 ++$as_echo "$zsh_cv_struct_member_struct_dirent_d_stat" >&6; } ++ ++if test $zsh_cv_struct_member_struct_dirent_d_stat = yes; then ++ $as_echo "#define HAVE_STRUCT_DIRENT_D_STAT 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_ino in struct direct" >&5 ++$as_echo_n "checking for d_ino in struct direct... " >&6; } ++if ${zsh_cv_struct_member_struct_direct_d_ino+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_NDIR_H ++# include ++#endif ++#ifdef HAVE_SYS_DIR_H ++# include ++#endif ++#ifdef HAVE_NDIR_H ++# include ++#endif ++ ++int ++main () ++{ ++struct direct testvar; testvar.d_ino; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_direct_d_ino=yes ++else ++ zsh_cv_struct_member_struct_direct_d_ino=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_direct_d_ino" >&5 ++$as_echo "$zsh_cv_struct_member_struct_direct_d_ino" >&6; } ++ ++if test $zsh_cv_struct_member_struct_direct_d_ino = yes; then ++ $as_echo "#define HAVE_STRUCT_DIRECT_D_INO 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for d_stat in struct direct" >&5 ++$as_echo_n "checking for d_stat in struct direct... " >&6; } ++if ${zsh_cv_struct_member_struct_direct_d_stat+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#ifdef HAVE_SYS_NDIR_H ++# include ++#endif ++#ifdef HAVE_SYS_DIR_H ++# include ++#endif ++#ifdef HAVE_NDIR_H ++# include ++#endif ++ ++int ++main () ++{ ++struct direct testvar; testvar.d_stat; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_direct_d_stat=yes ++else ++ zsh_cv_struct_member_struct_direct_d_stat=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_direct_d_stat" >&5 ++$as_echo "$zsh_cv_struct_member_struct_direct_d_stat" >&6; } ++ ++if test $zsh_cv_struct_member_struct_direct_d_stat = yes; then ++ $as_echo "#define HAVE_STRUCT_DIRECT_D_STAT 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin6_scope_id in struct sockaddr_in6" >&5 ++$as_echo_n "checking for sin6_scope_id in struct sockaddr_in6... " >&6; } ++if ${zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TYPES_H ++# include ++#endif ++#include ++ ++int ++main () ++{ ++struct sockaddr_in6 testvar; testvar.sin6_scope_id; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id=yes ++else ++ zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id" >&5 ++$as_echo "$zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id" >&6; } ++ ++if test $zsh_cv_struct_member_struct_sockaddr_in6_sin6_scope_id = yes; then ++ $as_echo "#define HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID 1" >>confdefs.h ++ ++fi ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we need our own h_errno" >&5 ++$as_echo_n "checking if we need our own h_errno... " >&6; } ++if ${zsh_cv_decl_h_errno_use_local+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++extern int h_errno; h_errno = 0; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_decl_h_errno_use_local=no ++else ++ zsh_cv_decl_h_errno_use_local=yes ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_decl_h_errno_use_local" >&5 ++$as_echo "$zsh_cv_decl_h_errno_use_local" >&6; } ++ ++if test x$zsh_cv_decl_h_errno_use_local = xyes; then ++ $as_echo "#define USE_LOCAL_H_ERRNO 1" >>confdefs.h ++ ++fi ++ ++ ++ ++for ac_func in strftime strptime mktime timelocal \ ++ difftime gettimeofday clock_gettime \ ++ select poll \ ++ readlink faccessx fchdir ftruncate \ ++ fstat lstat lchown fchown fchmod \ ++ fseeko ftello \ ++ mkfifo _mktemp mkstemp \ ++ waitpid wait3 \ ++ sigaction sigblock sighold sigrelse sigsetmask sigprocmask \ ++ killpg setpgid setpgrp tcsetpgrp tcgetattr nice \ ++ gethostname gethostbyname2 getipnodebyname \ ++ inet_aton inet_pton inet_ntop \ ++ getlogin getpwent getpwnam getpwuid getgrgid getgrnam \ ++ initgroups nis_list \ ++ setuid seteuid setreuid setresuid setsid \ ++ memcpy memmove strstr strerror strtoul \ ++ getrlimit getrusage \ ++ setlocale \ ++ uname \ ++ signgam \ ++ putenv getenv setenv unsetenv xw\ ++ brk sbrk \ ++ pathconf sysconf \ ++ tgetent tigetflag tigetnum tigetstr setupterm initscr \ ++ getcchar setcchar waddwstr wget_wch win_wch use_default_colors \ ++ pcre_compile pcre_study pcre_exec \ ++ nl_langinfo \ ++ erand48 open_memstream \ ++ wctomb iconv \ ++ grantpt unlockpt ptsname \ ++ htons ntohs \ ++ regcomp regexec regerror regfree \ ++ gdbm_open getxattr \ ++ realpath canonicalize_file_name \ ++ symlink getcwd ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strcoll" >&5 ++$as_echo_n "checking for working strcoll... " >&6; } ++if ${ac_cv_func_strcoll_works+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ ac_cv_func_strcoll_works=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_includes_default ++int ++main () ++{ ++return (strcoll ("abc", "def") >= 0 || ++ strcoll ("ABC", "DEF") >= 0 || ++ strcoll ("123", "456") >= 0) ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ac_cv_func_strcoll_works=yes ++else ++ ac_cv_func_strcoll_works=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 ++$as_echo "$ac_cv_func_strcoll_works" >&6; } ++if test $ac_cv_func_strcoll_works = yes; then ++ ++$as_echo "#define HAVE_STRCOLL 1" >>confdefs.h ++ ++fi ++ ++ ++if test x$enable_cap = xyes; then ++ for ac_func in cap_get_proc ++do : ++ ac_fn_c_check_func "$LINENO" "cap_get_proc" "ac_cv_func_cap_get_proc" ++if test "x$ac_cv_func_cap_get_proc" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_CAP_GET_PROC 1 ++_ACEOF ++ ++fi ++done ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent accepts NULL" >&5 ++$as_echo_n "checking if tgetent accepts NULL... " >&6; } ++if ${zsh_cv_func_tgetent_accepts_null+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_func_tgetent_accepts_null=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++main() ++{ ++ char buf[4096]; ++ int r1 = tgetent(buf, "vt100"); ++ int r2 = tgetent((char*)0,"vt100"); ++ if (r1 >= 0 && r1 == r2) { ++ char tbuf[1024], *u; ++ u = tbuf; ++ tgetstr("cl", &u); ++ creat("conftest.tgetent", 0640); ++ } ++ exit((r1 != r2) || r2 == -1); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ if test -f conftest.tgetent; then ++ zsh_cv_func_tgetent_accepts_null=yes ++ else ++ zsh_cv_func_tgetent_accepts_null=no ++ fi ++else ++ zsh_cv_func_tgetent_accepts_null=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_tgetent_accepts_null" >&5 ++$as_echo "$zsh_cv_func_tgetent_accepts_null" >&6; } ++if test x$zsh_cv_func_tgetent_accepts_null = xyes; then ++ $as_echo "#define TGETENT_ACCEPTS_NULL 1" >>confdefs.h ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent returns 0 on success" >&5 ++$as_echo_n "checking if tgetent returns 0 on success... " >&6; } ++if ${zsh_cv_func_tgetent_zero_success+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_func_tgetent_zero_success=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++main() ++{ ++ char buf[4096]; ++ int r1 = tgetent(buf, "!@#$%^&*"); ++ int r2 = tgetent(buf, "vt100"); ++ if (r1 < 0 && r2 == 0) { ++ char tbuf[1024], *u; ++ u = tbuf; ++ tgetstr("cl", &u); ++ creat("conftest.tgetent0", 0640); ++ } ++ exit(r1 == r2); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ if test -f conftest.tgetent0; then ++ zsh_cv_func_tgetent_zero_success=yes ++ else ++ zsh_cv_func_tgetent_zero_success=no ++ fi ++else ++ zsh_cv_func_tgetent_zero_success=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_tgetent_zero_success" >&5 ++$as_echo "$zsh_cv_func_tgetent_zero_success" >&6; } ++ ++if test x$zsh_cv_func_tgetent_zero_success = xyes; then ++ $as_echo "#define TGETENT_SUCCESS 0" >>confdefs.h ++ ++else ++ $as_echo "#define TGETENT_SUCCESS 1" >>confdefs.h ++ ++fi ++ ++ ++ ++ ++ for ac_header in $ac_header_list ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default ++" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ ++ ++ ++ ++ ++ ++ ++ ++for ac_func in getpagesize ++do : ++ ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize" ++if test "x$ac_cv_func_getpagesize" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_GETPAGESIZE 1 ++_ACEOF ++ ++fi ++done ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5 ++$as_echo_n "checking for working mmap... " >&6; } ++if ${ac_cv_func_mmap_fixed_mapped+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ ac_cv_func_mmap_fixed_mapped=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_includes_default ++/* malloc might have been renamed as rpl_malloc. */ ++#undef malloc ++ ++/* Thanks to Mike Haertel and Jim Avera for this test. ++ Here is a matrix of mmap possibilities: ++ mmap private not fixed ++ mmap private fixed at somewhere currently unmapped ++ mmap private fixed at somewhere already mapped ++ mmap shared not fixed ++ mmap shared fixed at somewhere currently unmapped ++ mmap shared fixed at somewhere already mapped ++ For private mappings, we should verify that changes cannot be read() ++ back from the file, nor mmap's back from the file at a different ++ address. (There have been systems where private was not correctly ++ implemented like the infamous i386 svr4.0, and systems where the ++ VM page cache was not coherent with the file system buffer cache ++ like early versions of FreeBSD and possibly contemporary NetBSD.) ++ For shared mappings, we should conversely verify that changes get ++ propagated back to all the places they're supposed to be. ++ ++ Grep wants private fixed already mapped. ++ The main things grep needs to know about mmap are: ++ * does it exist and is it safe to write into the mmap'd area ++ * how to use it (BSD variants) */ ++ ++#include ++#include ++ ++#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H ++char *malloc (); ++#endif ++ ++/* This mess was copied from the GNU getpagesize.h. */ ++#ifndef HAVE_GETPAGESIZE ++# ifdef _SC_PAGESIZE ++# define getpagesize() sysconf(_SC_PAGESIZE) ++# else /* no _SC_PAGESIZE */ ++# ifdef HAVE_SYS_PARAM_H ++# include ++# ifdef EXEC_PAGESIZE ++# define getpagesize() EXEC_PAGESIZE ++# else /* no EXEC_PAGESIZE */ ++# ifdef NBPG ++# define getpagesize() NBPG * CLSIZE ++# ifndef CLSIZE ++# define CLSIZE 1 ++# endif /* no CLSIZE */ ++# else /* no NBPG */ ++# ifdef NBPC ++# define getpagesize() NBPC ++# else /* no NBPC */ ++# ifdef PAGESIZE ++# define getpagesize() PAGESIZE ++# endif /* PAGESIZE */ ++# endif /* no NBPC */ ++# endif /* no NBPG */ ++# endif /* no EXEC_PAGESIZE */ ++# else /* no HAVE_SYS_PARAM_H */ ++# define getpagesize() 8192 /* punt totally */ ++# endif /* no HAVE_SYS_PARAM_H */ ++# endif /* no _SC_PAGESIZE */ ++ ++#endif /* no HAVE_GETPAGESIZE */ ++ ++int ++main () ++{ ++ char *data, *data2, *data3; ++ const char *cdata2; ++ int i, pagesize; ++ int fd, fd2; ++ ++ pagesize = getpagesize (); ++ ++ /* First, make a file with some known garbage in it. */ ++ data = (char *) malloc (pagesize); ++ if (!data) ++ return 1; ++ for (i = 0; i < pagesize; ++i) ++ *(data + i) = rand (); ++ umask (0); ++ fd = creat ("conftest.mmap", 0600); ++ if (fd < 0) ++ return 2; ++ if (write (fd, data, pagesize) != pagesize) ++ return 3; ++ close (fd); ++ ++ /* Next, check that the tail of a page is zero-filled. File must have ++ non-zero length, otherwise we risk SIGBUS for entire page. */ ++ fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600); ++ if (fd2 < 0) ++ return 4; ++ cdata2 = ""; ++ if (write (fd2, cdata2, 1) != 1) ++ return 5; ++ data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L); ++ if (data2 == MAP_FAILED) ++ return 6; ++ for (i = 0; i < pagesize; ++i) ++ if (*(data2 + i)) ++ return 7; ++ close (fd2); ++ if (munmap (data2, pagesize)) ++ return 8; ++ ++ /* Next, try to mmap the file at a fixed address which already has ++ something else allocated at it. If we can, also make sure that ++ we see the same garbage. */ ++ fd = open ("conftest.mmap", O_RDWR); ++ if (fd < 0) ++ return 9; ++ if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, ++ MAP_PRIVATE | MAP_FIXED, fd, 0L)) ++ return 10; ++ for (i = 0; i < pagesize; ++i) ++ if (*(data + i) != *(data2 + i)) ++ return 11; ++ ++ /* Finally, make sure that changes to the mapped area do not ++ percolate back to the file as seen by read(). (This is a bug on ++ some variants of i386 svr4.0.) */ ++ for (i = 0; i < pagesize; ++i) ++ *(data2 + i) = *(data2 + i) + 1; ++ data3 = (char *) malloc (pagesize); ++ if (!data3) ++ return 12; ++ if (read (fd, data3, pagesize) != pagesize) ++ return 13; ++ for (i = 0; i < pagesize; ++i) ++ if (*(data + i) != *(data3 + i)) ++ return 14; ++ close (fd); ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ ac_cv_func_mmap_fixed_mapped=yes ++else ++ ac_cv_func_mmap_fixed_mapped=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5 ++$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } ++if test $ac_cv_func_mmap_fixed_mapped = yes; then ++ ++$as_echo "#define HAVE_MMAP 1" >>confdefs.h ++ ++fi ++rm -f conftest.mmap conftest.txt ++ ++if test x$ac_cv_func_mmap_fixed_mapped = xyes; then ++ for ac_func in munmap msync ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++fi ++ ++if test x$ac_cv_func_setpgrp = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getpgrp requires zero arguments" >&5 ++$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; } ++if ${ac_cv_func_getpgrp_void+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ # Use it with a single arg. ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$ac_includes_default ++int ++main () ++{ ++getpgrp (0); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_func_getpgrp_void=no ++else ++ ac_cv_func_getpgrp_void=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_getpgrp_void" >&5 ++$as_echo "$ac_cv_func_getpgrp_void" >&6; } ++if test $ac_cv_func_getpgrp_void = yes; then ++ ++$as_echo "#define GETPGRP_VOID 1" >>confdefs.h ++ ++fi ++ ++else ++ ac_cv_func_getpgrp_void=yes ++ $as_echo "#define GETPGRP_VOID 1" >>confdefs.h ++ ++fi ++ ++if test x$dynamic = xyes; then ++ for ac_func in dlopen dlerror dlsym dlclose load loadquery loadbind unload \ ++ shl_load shl_unload shl_findsym ++do : ++ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++done ++ ++fi ++ ++ ++if test x$ac_cv_func_getxattr = xyes && test x$ac_cv_header_sys_xattr_h = xyes ++then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are Linux-like" >&5 ++$as_echo_n "checking if getxattr etc. are Linux-like... " >&6; } ++if ${zsh_cv_getxattr_linux+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++int ++main () ++{ ++ ++ (void)listxattr("", 0, 0); ++ (void)getxattr("", "", 0, 0); ++ (void)setxattr("", "", "", 0, 0); ++ (void)removexattr("", ""); ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_getxattr_linux=yes ++else ++ zsh_cv_getxattr_linux=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getxattr_linux" >&5 ++$as_echo "$zsh_cv_getxattr_linux" >&6; } ++ ++ if test x$zsh_cv_getxattr_linux != xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are MAC-like" >&5 ++$as_echo_n "checking if getxattr etc. are MAC-like... " >&6; } ++if ${zsh_cv_getxattr_mac+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++#include ++int ++main () ++{ ++(void)listxattr("", 0, 0, 0); ++ (void)getxattr("", "", 0, 0, 0, 0); ++ (void)setxattr("", "", "", 0, 0, 0); ++ (void)removexattr("", "", 0); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_getxattr_mac=yes ++else ++ zsh_cv_getxattr_mac=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getxattr_mac" >&5 ++$as_echo "$zsh_cv_getxattr_mac" >&6; } ++ ++ if test x$zsh_cv_getxattr_mac = xyes; then ++ $as_echo "#define XATTR_EXTRA_ARGS 1" >>confdefs.h ++ ++ fi ++ fi ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if getxattr etc. are usable" >&5 ++$as_echo_n "checking if getxattr etc. are usable... " >&6; } ++if ${zsh_cv_use_xattr+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test x$zsh_cv_getxattr_linux = xyes || test x$zsh_cv_getxattr_mac = xyes ++then ++zsh_cv_use_xattr=yes ++else ++zsh_cv_use_xattr=no ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_use_xattr" >&5 ++$as_echo "$zsh_cv_use_xattr" >&6; } ++ ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what style of signals to use" >&5 ++$as_echo_n "checking what style of signals to use... " >&6; } ++if test x$ac_cv_func_sigaction = xyes && test x$ac_cv_func_sigprocmask = xyes; then ++ signals_style=POSIX_SIGNALS ++ $as_echo "#define POSIX_SIGNALS 1" >>confdefs.h ++ ++elif test x$ac_cv_func_sigblock = xyes && test x$ac_cv_func_sigsetmask = xyes; then ++ signals_style=BSD_SIGNALS ++ $as_echo "#define BSD_SIGNALS 1" >>confdefs.h ++ ++elif test x$ac_cv_func_sighold = xyes && test x$ac_cv_func_sigrelse = xyes; then ++ signals_style=SYSV_SIGNALS ++ $as_echo "#define SYSV_SIGNALS 1" >>confdefs.h ++ ++else ++ signals_style=NO_SIGNAL_BLOCKING ++ $as_echo "#define NO_SIGNAL_BLOCKING 1" >>confdefs.h ++ ++fi ++cat >>confdefs.h <<_ACEOF ++#define $signals_style 1 ++_ACEOF ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $signals_style" >&5 ++$as_echo "$signals_style" >&6; } ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where signal.h is located" >&5 ++$as_echo_n "checking where signal.h is located... " >&6; } ++if ${zsh_cv_path_signal_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ echo "#include " > nametmp.c ++sigfile_list="`$CPP $CPPFLAGS nametmp.c | ++sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ ++ -e 's/^#[ ].*\"\(.*\)\"/\1/p' | ++sed 's/\\\\\\\\/\//g' | ++$AWK '{ if ($1 ~ /sig/) files[$1] = $1 } ++ END { for (var in files) print var }'`" ++rm -f nametmp.c ++if test -z "$sigfile_list"; then ++ sigfile_list="/usr/include/sys/iso/signal_iso.h ++/usr/include/bsd/sys/signal.h ++/usr/include/signum.h ++/usr/include/asm/signum.h ++/usr/include/asm/signal.h ++/usr/include/linux/signal.h ++/usr/include/sys/signal.h ++/usr/include/bits/signum.h ++/dev/null" ++fi ++for SIGNAL_H in $sigfile_list ++do ++ nsigs=`test -f $SIGNAL_H && \ ++ grep '#[ ]*define[ ][ ]*SIG[0-9A-Z]*[ ]*[0-9][0-9]*' $SIGNAL_H | \ ++ wc -l | sed 's/ //g'` ++ test "x$nsigs" != x && test "$nsigs" -ge 7 && break ++done ++if test x$SIGNAL_H = x"/dev/null"; then ++ as_fn_error $? "SIGNAL MACROS NOT FOUND: please report to developers" "$LINENO" 5 ++fi ++zsh_cv_path_signal_h=$SIGNAL_H ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_signal_h" >&5 ++$as_echo "$zsh_cv_path_signal_h" >&6; } ++SIGNAL_H=$zsh_cv_path_signal_h ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where error names are located" >&5 ++$as_echo_n "checking where error names are located... " >&6; } ++if ${zsh_cv_path_errno_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ echo "#include " > nametmp.c ++errfile_list="`$CPP $CPPFLAGS nametmp.c | ++sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ ++ -e 's/^#[ 0-9].*\"\(.*\)\"/\1/p' | ++sed 's/\\\\\\\\/\//g' | ++$AWK '{ if ($1 ~ /err/) files[$1] = $1 } ++ END { for (var in files) print var }'`" ++rm -f nametmp.c ++for ERRNO_TRY_H in $errfile_list /dev/null ++do ++ nerrs=`test -f $ERRNO_TRY_H && \ ++ $EGREP '#[ ]*define[ ][ ]*E[0-9A-Z]*[ ]*(_HURD_ERRNO )?\(?[_A-Z0-9]' $ERRNO_TRY_H | \ ++ wc -l | sed 's/ //g'` ++ if test "x$nerrs" != x && test "$nerrs" -ge 1 ++ then ++ ERRNO_H="$ERRNO_H $ERRNO_TRY_H" ++ fi ++done ++if test x"$ERRNO_H" = x; then ++ as_fn_error $? "ERROR MACROS NOT FOUND: please report to developers" "$LINENO" 5 ++fi ++zsh_cv_path_errno_h="$ERRNO_H" ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_errno_h" >&5 ++$as_echo "$zsh_cv_path_errno_h" >&6; } ++ERRNO_H="$zsh_cv_path_errno_h" ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking location of curses header" >&5 ++$as_echo_n "checking location of curses header... " >&6; } ++if ${zsh_cv_path_curses_header+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test x$zsh_cv_ignore_ncurses = xyes; then ++ if test x$ac_cv_header_curses_h = xyes; then ++ zsh_cv_path_curses_header=curses.h ++ else ++ zsh_cv_path_curses_header=none ++ fi ++elif test x$ac_cv_header_ncursesw_ncurses_h = xyes; then ++ zsh_cv_path_curses_header=ncursesw/ncurses.h ++elif test x$ac_cv_header_ncurses_ncurses_h = xyes; then ++ zsh_cv_path_curses_header=ncurses/ncurses.h ++elif test x$ac_cv_header_ncurses_h = xyes; then ++ zsh_cv_path_curses_header=ncurses.h ++elif test x$ac_cv_header_curses_h = xyes; then ++ zsh_cv_path_curses_header=curses.h ++else ++ zsh_cv_path_curses_header=none ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_curses_header" >&5 ++$as_echo "$zsh_cv_path_curses_header" >&6; } ++ ++if test x$zsh_cv_path_curses_header != xnone; then ++ $as_echo "#define ZSH_HAVE_CURSES_H 1" >>confdefs.h ++ ++ ZSH_CURSES_H=$zsh_cv_path_curses_header ++else ++ ZSH_CURSES_H= ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where curses key definitions are located" >&5 ++$as_echo_n "checking where curses key definitions are located... " >&6; } ++if ${zsh_cv_path_curses_keys_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test x$zsh_cv_path_curses_header = xnone; then ++ echo >nametmp.c ++else ++ echo "#include <$zsh_cv_path_curses_header>" >nametmp.c ++fi ++ ++curses_list="`$CPP $CPPFLAGS nametmp.c | ++sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ ++ -e 's/^#[ 0-9].*\"\(.*\)\"/\1/p' | ++sed 's/\\\\\\\\/\//g' | ++$AWK '{ if ($1 ~ /\.h/) files[$1] = $1 } ++ END { for (var in files) print var }'`" ++rm -f nametmp.c ++for CURSES_TRY_H in $curses_list /dev/null ++do ++ nkeys=`test -f $CURSES_TRY_H && \ ++ $EGREP '#[ ]*define[ ][ ]*KEY_' $CURSES_TRY_H | \ ++ wc -l | sed 's/ //g'` ++ if test "x$nkeys" != x && test "$nkeys" -ge 10 ++ then ++ CURSES_KEYS_H=$CURSES_TRY_H ++ break ++ fi ++done ++zsh_cv_path_curses_keys_h="$CURSES_KEYS_H" ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_curses_keys_h" >&5 ++$as_echo "$zsh_cv_path_curses_keys_h" >&6; } ++CURSES_KEYS_H="$zsh_cv_path_curses_keys_h" ++ ++for ac_header in ncursesw/term.h ++do : ++ ac_fn_c_check_header_compile "$LINENO" "ncursesw/term.h" "ac_cv_header_ncursesw_term_h" "#include ++" ++if test "x$ac_cv_header_ncursesw_term_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_NCURSESW_TERM_H 1 ++_ACEOF ++ true ++else ++ true ++fi ++ ++done ++ ++for ac_header in ncurses/term.h ++do : ++ ac_fn_c_check_header_compile "$LINENO" "ncurses/term.h" "ac_cv_header_ncurses_term_h" "#include ++" ++if test "x$ac_cv_header_ncurses_term_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_NCURSES_TERM_H 1 ++_ACEOF ++ true ++else ++ true ++fi ++ ++done ++ ++for ac_header in term.h ++do : ++ ac_fn_c_check_header_compile "$LINENO" "term.h" "ac_cv_header_term_h" "#include ++" ++if test "x$ac_cv_header_term_h" = xyes; then : ++ cat >>confdefs.h <<_ACEOF ++#define HAVE_TERM_H 1 ++_ACEOF ++ true ++else ++ true ++fi ++ ++done ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where term.h is located" >&5 ++$as_echo_n "checking where term.h is located... " >&6; } ++if ${zsh_cv_path_term_header+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case x$zsh_cv_path_curses_header in ++ xncursesw/*) ++ if test x$ac_cv_header_ncursesw_term_h = xyes; then ++ zsh_cv_path_term_header=ncursesw/term.h ++ fi ++ ;; ++ xncurses/*) ++ if test x$ac_cv_header_ncurses_term_h = xyes; then ++ zsh_cv_path_term_header=ncurses/term.h ++ fi ++ ;; ++esac ++if test x$zsh_cv_path_term_header = x; then ++ if test x$ac_cv_header_term_h = xyes; then ++ zsh_cv_path_term_header=term.h ++ else ++ zsh_cv_path_term_header=none ++ fi ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_term_header" >&5 ++$as_echo "$zsh_cv_path_term_header" >&6; } ++ ++ ++ ++ ++ ++ ++ ++ ++ ++if test x$zsh_cv_path_term_header != xnone; then ++ $as_echo "#define ZSH_HAVE_TERM_H 1" >>confdefs.h ++ ++ ZSH_TERM_H=$zsh_cv_path_term_header ++ if test x$zsh_cv_path_curses_header != xnone; then ++ term_includes="#include <$zsh_cv_path_curses_header> ++#include <$zsh_cv_path_term_header>" ++ else ++ term_includes="#include <$zsh_cv_path_term_header>" ++ fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if boolcodes is available" >&5 ++$as_echo_n "checking if boolcodes is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = boolcodes; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_BOOLCODES 1" >>confdefs.h ++ boolcodes=yes ++else ++ boolcodes=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boolcodes" >&5 ++$as_echo "$boolcodes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numcodes is available" >&5 ++$as_echo_n "checking if numcodes is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = numcodes; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_NUMCODES 1" >>confdefs.h ++ numcodes=yes ++else ++ numcodes=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $numcodes" >&5 ++$as_echo "$numcodes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strcodes is available" >&5 ++$as_echo_n "checking if strcodes is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = strcodes; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_STRCODES 1" >>confdefs.h ++ strcodes=yes ++else ++ strcodes=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $strcodes" >&5 ++$as_echo "$strcodes" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if boolnames is available" >&5 ++$as_echo_n "checking if boolnames is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = boolnames; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_BOOLNAMES 1" >>confdefs.h ++ boolnames=yes ++else ++ boolnames=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $boolnames" >&5 ++$as_echo "$boolnames" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if numnames is available" >&5 ++$as_echo_n "checking if numnames is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = numnames; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_NUMNAMES 1" >>confdefs.h ++ numnames=yes ++else ++ numnames=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $numnames" >&5 ++$as_echo "$numnames" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if strnames is available" >&5 ++$as_echo_n "checking if strnames is available... " >&6; } ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$term_includes ++int ++main () ++{ ++char **test = strnames; puts(*test); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ $as_echo "#define HAVE_STRNAMES 1" >>confdefs.h ++ strnames=yes ++else ++ strnames=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $strnames" >&5 ++$as_echo "$strnames" >&6; } ++else ++ ZSH_TERM_H= ++fi ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where the RLIMIT macros are located" >&5 ++$as_echo_n "checking where the RLIMIT macros are located... " >&6; } ++if ${zsh_cv_path_rlimit_h+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ echo "#include " >restmp.c ++resourcefile_list="`$CPP $CPPFLAGS restmp.c | ++sed -n -e 's/^#line[ ].*\"\(.*\)\"/\1/p' \ ++ -e 's/^#[ ].*\"\(.*\)\"/\1/p' | ++sed 's/\\\\\\\\/\//g' | ++$AWK '{ if ($1 ~ /resource/) files[$1] = $1 } ++ END { for (var in files) print var }'`" ++rm -f restmp.c ++if test -z "$resourcefile_list"; then ++ resourcefile_list="/usr/include/bsd/sys/resource.h ++/usr/include/asm/resource.h ++/usr/include/linux/resource.h ++/usr/include/sys/resource.h ++/usr/include/bits/resource.h ++/usr/include/resourcebits.h" ++fi ++for RESOURCE_H in $resourcefile_list /dev/null; ++do ++ test -f $RESOURCE_H && \ ++ grep '#[ ]*define[ ][ ]*RLIMIT_[A-Z]*[ ]*[0-9A-Z][0-9]*' $RESOURCE_H > /dev/null && \ ++ break ++done ++zsh_cv_path_rlimit_h=$RESOURCE_H ++if test x$RESOURCE_H = x"/dev/null" && test x$ac_cv_func_getrlimit = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: RLIMIT MACROS NOT FOUND: please report to developers" >&5 ++$as_echo "$as_me: WARNING: RLIMIT MACROS NOT FOUND: please report to developers" >&2;} ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_rlimit_h" >&5 ++$as_echo "$zsh_cv_path_rlimit_h" >&6; } ++RLIMITS_INC_H=$zsh_cv_path_rlimit_h ++if test "$RLIMITS_INC_H" = "/dev/null"; then ++ RLIMITS_INC_H='' ++fi ++ ++ ++ ++ ++ ++DEFAULT_RLIM_T=long ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if rlim_t is longer than a long" >&5 ++$as_echo_n "checking if rlim_t is longer than a long... " >&6; } ++if ${zsh_cv_rlim_t_is_longer+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_rlim_t_is_longer=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_rlim_t_is_longer=yes ++else ++ zsh_cv_rlim_t_is_longer=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlim_t_is_longer" >&5 ++$as_echo "$zsh_cv_rlim_t_is_longer" >&6; } ++if test x$zsh_cv_rlim_t_is_longer = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if rlim_t is a quad" >&5 ++$as_echo_n "checking if rlim_t is a quad... " >&6; } ++if ${zsh_cv_rlim_t_is_quad_t+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_rlim_t_is_quad_t=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++#include ++main() { ++ struct rlimit r; ++ char buf[20]; ++ r.rlim_cur = 0; ++ sprintf(buf, "%qd", r.rlim_cur); ++ exit(strcmp(buf, "0")); ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_rlim_t_is_quad_t=yes ++else ++ zsh_cv_rlim_t_is_quad_t=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlim_t_is_quad_t" >&5 ++$as_echo "$zsh_cv_rlim_t_is_quad_t" >&6; } ++ if test x$zsh_cv_rlim_t_is_quad_t = xyes; then ++ $as_echo "#define RLIM_T_IS_QUAD_T 1" >>confdefs.h ++ ++ DEFAULT_RLIM_T=quad_t ++ else ++ $as_echo "#define RLIM_T_IS_LONG_LONG 1" >>confdefs.h ++ ++ DEFAULT_RLIM_T='long long' ++ fi ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the rlim_t is unsigned" >&5 ++$as_echo_n "checking if the rlim_t is unsigned... " >&6; } ++if ${zsh_cv_type_rlim_t_is_unsigned+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_type_rlim_t_is_unsigned=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++ main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_type_rlim_t_is_unsigned=yes ++else ++ zsh_cv_type_rlim_t_is_unsigned=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_rlim_t_is_unsigned" >&5 ++$as_echo "$zsh_cv_type_rlim_t_is_unsigned" >&6; } ++ if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then ++ $as_echo "#define RLIM_T_IS_UNSIGNED 1" >>confdefs.h ++ ++ DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T" ++ fi ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for rlim_t" >&5 ++$as_echo_n "checking for rlim_t... " >&6; } ++if ${zsh_cv_type_rlim_t+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++rlim_t l; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_rlim_t=yes ++else ++ zsh_cv_type_rlim_t=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_rlim_t" >&5 ++$as_echo "$zsh_cv_type_rlim_t" >&6; } ++if test x$zsh_cv_type_rlim_t = xno; then ++ cat >>confdefs.h <<_ACEOF ++#define rlim_t $DEFAULT_RLIM_T ++_ACEOF ++ ++fi ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AIO_MEM" >&5 ++$as_echo_n "checking for limit RLIMIT_AIO_MEM... " >&6; } ++if ${zsh_cv_have_RLIMIT_AIO_MEM+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_AIO_MEM ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_AIO_MEM=yes ++else ++ zsh_cv_have_RLIMIT_AIO_MEM=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AIO_MEM" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_AIO_MEM" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_AIO_MEM = yes; then ++ $as_echo "#define HAVE_RLIMIT_AIO_MEM 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AIO_OPS" >&5 ++$as_echo_n "checking for limit RLIMIT_AIO_OPS... " >&6; } ++if ${zsh_cv_have_RLIMIT_AIO_OPS+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_AIO_OPS ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_AIO_OPS=yes ++else ++ zsh_cv_have_RLIMIT_AIO_OPS=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AIO_OPS" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_AIO_OPS" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_AIO_OPS = yes; then ++ $as_echo "#define HAVE_RLIMIT_AIO_OPS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_AS" >&5 ++$as_echo_n "checking for limit RLIMIT_AS... " >&6; } ++if ${zsh_cv_have_RLIMIT_AS+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_AS ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_AS=yes ++else ++ zsh_cv_have_RLIMIT_AS=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_AS" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_AS" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_AS = yes; then ++ $as_echo "#define HAVE_RLIMIT_AS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_LOCKS" >&5 ++$as_echo_n "checking for limit RLIMIT_LOCKS... " >&6; } ++if ${zsh_cv_have_RLIMIT_LOCKS+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_LOCKS ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_LOCKS=yes ++else ++ zsh_cv_have_RLIMIT_LOCKS=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_LOCKS" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_LOCKS" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_LOCKS = yes; then ++ $as_echo "#define HAVE_RLIMIT_LOCKS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_MEMLOCK" >&5 ++$as_echo_n "checking for limit RLIMIT_MEMLOCK... " >&6; } ++if ${zsh_cv_have_RLIMIT_MEMLOCK+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_MEMLOCK ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_MEMLOCK=yes ++else ++ zsh_cv_have_RLIMIT_MEMLOCK=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_MEMLOCK" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_MEMLOCK" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_MEMLOCK = yes; then ++ $as_echo "#define HAVE_RLIMIT_MEMLOCK 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NPROC" >&5 ++$as_echo_n "checking for limit RLIMIT_NPROC... " >&6; } ++if ${zsh_cv_have_RLIMIT_NPROC+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_NPROC ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_NPROC=yes ++else ++ zsh_cv_have_RLIMIT_NPROC=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NPROC" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_NPROC" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_NPROC = yes; then ++ $as_echo "#define HAVE_RLIMIT_NPROC 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NOFILE" >&5 ++$as_echo_n "checking for limit RLIMIT_NOFILE... " >&6; } ++if ${zsh_cv_have_RLIMIT_NOFILE+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_NOFILE ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_NOFILE=yes ++else ++ zsh_cv_have_RLIMIT_NOFILE=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NOFILE" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_NOFILE" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_NOFILE = yes; then ++ $as_echo "#define HAVE_RLIMIT_NOFILE 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_PTHREAD" >&5 ++$as_echo_n "checking for limit RLIMIT_PTHREAD... " >&6; } ++if ${zsh_cv_have_RLIMIT_PTHREAD+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_PTHREAD ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_PTHREAD=yes ++else ++ zsh_cv_have_RLIMIT_PTHREAD=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_PTHREAD" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_PTHREAD" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_PTHREAD = yes; then ++ $as_echo "#define HAVE_RLIMIT_PTHREAD 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_RSS" >&5 ++$as_echo_n "checking for limit RLIMIT_RSS... " >&6; } ++if ${zsh_cv_have_RLIMIT_RSS+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_RSS ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_RSS=yes ++else ++ zsh_cv_have_RLIMIT_RSS=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_RSS" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_RSS" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_RSS = yes; then ++ $as_echo "#define HAVE_RLIMIT_RSS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_SBSIZE" >&5 ++$as_echo_n "checking for limit RLIMIT_SBSIZE... " >&6; } ++if ${zsh_cv_have_RLIMIT_SBSIZE+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_SBSIZE ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_SBSIZE=yes ++else ++ zsh_cv_have_RLIMIT_SBSIZE=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_SBSIZE" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_SBSIZE" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_SBSIZE = yes; then ++ $as_echo "#define HAVE_RLIMIT_SBSIZE 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_TCACHE" >&5 ++$as_echo_n "checking for limit RLIMIT_TCACHE... " >&6; } ++if ${zsh_cv_have_RLIMIT_TCACHE+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_TCACHE ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_TCACHE=yes ++else ++ zsh_cv_have_RLIMIT_TCACHE=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_TCACHE" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_TCACHE" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_TCACHE = yes; then ++ $as_echo "#define HAVE_RLIMIT_TCACHE 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_VMEM" >&5 ++$as_echo_n "checking for limit RLIMIT_VMEM... " >&6; } ++if ${zsh_cv_have_RLIMIT_VMEM+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_VMEM ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_VMEM=yes ++else ++ zsh_cv_have_RLIMIT_VMEM=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_VMEM" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_VMEM" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_VMEM = yes; then ++ $as_echo "#define HAVE_RLIMIT_VMEM 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_SIGPENDING" >&5 ++$as_echo_n "checking for limit RLIMIT_SIGPENDING... " >&6; } ++if ${zsh_cv_have_RLIMIT_SIGPENDING+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_SIGPENDING ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_SIGPENDING=yes ++else ++ zsh_cv_have_RLIMIT_SIGPENDING=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_SIGPENDING" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_SIGPENDING" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_SIGPENDING = yes; then ++ $as_echo "#define HAVE_RLIMIT_SIGPENDING 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_MSGQUEUE" >&5 ++$as_echo_n "checking for limit RLIMIT_MSGQUEUE... " >&6; } ++if ${zsh_cv_have_RLIMIT_MSGQUEUE+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_MSGQUEUE ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_MSGQUEUE=yes ++else ++ zsh_cv_have_RLIMIT_MSGQUEUE=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_MSGQUEUE" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_MSGQUEUE" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_MSGQUEUE = yes; then ++ $as_echo "#define HAVE_RLIMIT_MSGQUEUE 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NICE" >&5 ++$as_echo_n "checking for limit RLIMIT_NICE... " >&6; } ++if ${zsh_cv_have_RLIMIT_NICE+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_NICE ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_NICE=yes ++else ++ zsh_cv_have_RLIMIT_NICE=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NICE" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_NICE" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_NICE = yes; then ++ $as_echo "#define HAVE_RLIMIT_NICE 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_RTPRIO" >&5 ++$as_echo_n "checking for limit RLIMIT_RTPRIO... " >&6; } ++if ${zsh_cv_have_RLIMIT_RTPRIO+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int ++main () ++{ ++RLIMIT_RTPRIO ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_have_RLIMIT_RTPRIO=yes ++else ++ zsh_cv_have_RLIMIT_RTPRIO=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_RTPRIO" >&5 ++$as_echo "$zsh_cv_have_RLIMIT_RTPRIO" >&6; } ++ ++if test $zsh_cv_have_RLIMIT_RTPRIO = yes; then ++ $as_echo "#define HAVE_RLIMIT_RTPRIO 1" >>confdefs.h ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_RSS are the same" >&5 ++$as_echo_n "checking if RLIMIT_VMEM and RLIMIT_RSS are the same... " >&6; } ++if ${zsh_cv_rlimit_vmem_is_rss+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_rlimit_vmem_is_rss=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int main() ++{ ++int ret = 1; ++#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS) ++if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0; ++#endif ++return ret; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_rlimit_vmem_is_rss=yes ++else ++ zsh_cv_rlimit_vmem_is_rss=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_rss" >&5 ++$as_echo "$zsh_cv_rlimit_vmem_is_rss" >&6; } ++ ++if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then ++ $as_echo "#define RLIMIT_VMEM_IS_RSS 1" >>confdefs.h ++ ++fi ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_AS are the same" >&5 ++$as_echo_n "checking if RLIMIT_VMEM and RLIMIT_AS are the same... " >&6; } ++if ${zsh_cv_rlimit_vmem_is_as+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_rlimit_vmem_is_as=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int main() ++{ ++int ret = 1; ++#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_AS) ++if (RLIMIT_AS == RLIMIT_VMEM) ret = 0; ++#endif ++return ret; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_rlimit_vmem_is_as=yes ++else ++ zsh_cv_rlimit_vmem_is_as=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_as" >&5 ++$as_echo "$zsh_cv_rlimit_vmem_is_as" >&6; } ++ ++if test x$zsh_cv_rlimit_vmem_is_as = xyes; then ++ $as_echo "#define RLIMIT_VMEM_IS_AS 1" >>confdefs.h ++ ++fi ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_RSS and RLIMIT_AS are the same" >&5 ++$as_echo_n "checking if RLIMIT_RSS and RLIMIT_AS are the same... " >&6; } ++if ${zsh_cv_rlimit_rss_is_as+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_rlimit_rss_is_as=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++int main() ++{ ++int ret = 1; ++#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS) ++if (RLIMIT_AS == RLIMIT_RSS) ret = 0; ++#endif ++return ret; ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_rlimit_rss_is_as=yes ++else ++ zsh_cv_rlimit_rss_is_as=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_rss_is_as" >&5 ++$as_echo "$zsh_cv_rlimit_rss_is_as" >&6; } ++ ++if test x$zsh_cv_rlimit_rss_is_as = xyes; then ++ $as_echo "#define RLIMIT_RSS_IS_AS 1" >>confdefs.h ++ ++fi ++ ++ ++if test x$ac_cv_func_getrusage = xyes; then ++ ac_fn_c_check_member "$LINENO" "struct rusage" "ru_maxrss" "ac_cv_member_struct_rusage_ru_maxrss" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_maxrss" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_MAXRSS 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_ixrss" "ac_cv_member_struct_rusage_ru_ixrss" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_ixrss" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_IXRSS 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_idrss" "ac_cv_member_struct_rusage_ru_idrss" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_idrss" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_IDRSS 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_isrss" "ac_cv_member_struct_rusage_ru_isrss" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_isrss" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_ISRSS 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_minflt" "ac_cv_member_struct_rusage_ru_minflt" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_minflt" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_MINFLT 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_majflt" "ac_cv_member_struct_rusage_ru_majflt" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_majflt" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_MAJFLT 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nswap" "ac_cv_member_struct_rusage_ru_nswap" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_nswap" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_NSWAP 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_inblock" "ac_cv_member_struct_rusage_ru_inblock" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_inblock" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_INBLOCK 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_oublock" "ac_cv_member_struct_rusage_ru_oublock" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_oublock" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_OUBLOCK 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_msgsnd" "ac_cv_member_struct_rusage_ru_msgsnd" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_msgsnd" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_MSGSND 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_msgrcv" "ac_cv_member_struct_rusage_ru_msgrcv" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_msgrcv" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_MSGRCV 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nsignals" "ac_cv_member_struct_rusage_ru_nsignals" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_nsignals" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_NSIGNALS 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nvcsw" "ac_cv_member_struct_rusage_ru_nvcsw" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_nvcsw" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_NVCSW 1 ++_ACEOF ++ ++ ++fi ++ac_fn_c_check_member "$LINENO" "struct rusage" "ru_nivcsw" "ac_cv_member_struct_rusage_ru_nivcsw" "#include ++#ifdef HAVE_SYS_TIME_H ++#include ++#endif ++#include ++" ++if test "x$ac_cv_member_struct_rusage_ru_nivcsw" = xyes; then : ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_RUSAGE_RU_NIVCSW 1 ++_ACEOF ++ ++ ++fi ++ ++fi ++ ++ ++if ${zsh_cv_cs_path+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if getconf _CS_PATH >/dev/null 2>&1; then ++ zsh_cv_cs_path=`getconf _CS_PATH` ++elif getconf CS_PATH >/dev/null 2>&1; then ++ zsh_cv_cs_path=`getconf CS_PATH` ++else ++ zsh_cv_cs_path="/bin:/usr/bin" ++fi ++fi ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define DEFAULT_PATH "$zsh_cv_cs_path" ++_ACEOF ++ ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for /dev/fd filesystem" >&5 ++$as_echo_n "checking for /dev/fd filesystem... " >&6; } ++if ${zsh_cv_sys_path_dev_fd+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$host_os" = cygwin; then ++zsh_cv_sys_path_dev_fd=no ++else ++for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do ++ test x`echo ok|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break ++ done ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_path_dev_fd" >&5 ++$as_echo "$zsh_cv_sys_path_dev_fd" >&6; } ++if test x$zsh_cv_sys_path_dev_fd != xno; then ++ cat >>confdefs.h <<_ACEOF ++#define PATH_DEV_FD "$zsh_cv_sys_path_dev_fd" ++_ACEOF ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for RFS superroot directory" >&5 ++$as_echo_n "checking for RFS superroot directory... " >&6; } ++if ${zsh_cv_sys_superroot+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ test -d /../.LOCALROOT && zsh_cv_sys_superroot=yes || zsh_cv_sys_superroot=no ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_superroot" >&5 ++$as_echo "$zsh_cv_sys_superroot" >&6; } ++ ++if test x$zsh_cv_sys_superroot = xyes; then ++ $as_echo "#define HAVE_SUPERROOT 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we should use the native getcwd" >&5 ++$as_echo_n "checking whether we should use the native getcwd... " >&6; } ++if ${zsh_cv_use_getcwd+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ case "${host_cpu}-${host_vendor}-${host_os}" in ++ *QNX*) zsh_cv_use_getcwd=yes ;; ++ *) zsh_cv_use_getcwd=no ;; ++ esac ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_use_getcwd" >&5 ++$as_echo "$zsh_cv_use_getcwd" >&6; } ++ ++if test x$zsh_cv_use_getcwd = xyes; then ++ $as_echo "#define USE_GETCWD 1" >>confdefs.h ++ ++fi ++ ++ ++if test x$ac_cv_func_getcwd = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd calls malloc to allocate memory" >&5 ++$as_echo_n "checking whether getcwd calls malloc to allocate memory... " >&6; } ++if ${zsh_cv_getcwd_malloc+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_getcwd_malloc=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++int main() { ++ char buf[1024], *ptr1, *ptr2; ++ ptr1 = getcwd(buf, 1024); ++ ptr2 = getcwd(NULL, 0); ++ if (ptr1 && ptr2 && !strcmp(ptr1, ptr2)) { ++ return 0; ++ } ++ return 1; ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_getcwd_malloc=yes ++else ++ zsh_cv_getcwd_malloc=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_getcwd_malloc" >&5 ++$as_echo "$zsh_cv_getcwd_malloc" >&6; } ++ if test x$zsh_cv_getcwd_malloc = xyes; then ++ $as_echo "#define GETCWD_CALLS_MALLOC 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++ac_fn_c_check_func "$LINENO" "setproctitle" "ac_cv_func_setproctitle" ++if test "x$ac_cv_func_setproctitle" = xyes; then : ++ $as_echo "#define HAVE_SETPROCTITLE 1" >>confdefs.h ++ ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setproctitle" >&5 ++$as_echo_n "checking for library containing setproctitle... " >&6; } ++if ${ac_cv_search_setproctitle+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char setproctitle (); ++int ++main () ++{ ++return setproctitle (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' util; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_setproctitle=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_setproctitle+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_setproctitle+:} false; then : ++ ++else ++ ac_cv_search_setproctitle=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_setproctitle" >&5 ++$as_echo "$ac_cv_search_setproctitle" >&6; } ++ac_res=$ac_cv_search_setproctitle ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ $as_echo "#define HAVE_SETPROCTITLE 1" >>confdefs.h ++ ++fi ++ ++fi ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIS" >&5 ++$as_echo_n "checking for NIS... " >&6; } ++if ${zsh_cv_sys_nis+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ test -f /usr/bin/ypcat && /usr/bin/ypcat passwd.byname > /dev/null 2>&1 && \ ++zsh_cv_sys_nis=yes || zsh_cv_sys_nis=no ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_nis" >&5 ++$as_echo "$zsh_cv_sys_nis" >&6; } ++if test x$zsh_cv_sys_nis = xyes; then ++ $as_echo "#define HAVE_NIS 1" >>confdefs.h ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yp_all" >&5 ++$as_echo_n "checking for library containing yp_all... " >&6; } ++if ${ac_cv_search_yp_all+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ ac_func_search_save_LIBS=$LIBS ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++/* Override any GCC internal prototype to avoid an error. ++ Use char because int might match the return type of a GCC ++ builtin and then its argument prototype would still apply. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++char yp_all (); ++int ++main () ++{ ++return yp_all (); ++ ; ++ return 0; ++} ++_ACEOF ++for ac_lib in '' nsl; do ++ if test -z "$ac_lib"; then ++ ac_res="none required" ++ else ++ ac_res=-l$ac_lib ++ LIBS="-l$ac_lib $ac_func_search_save_LIBS" ++ fi ++ if ac_fn_c_try_link "$LINENO"; then : ++ ac_cv_search_yp_all=$ac_res ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext ++ if ${ac_cv_search_yp_all+:} false; then : ++ break ++fi ++done ++if ${ac_cv_search_yp_all+:} false; then : ++ ++else ++ ac_cv_search_yp_all=no ++fi ++rm conftest.$ac_ext ++LIBS=$ac_func_search_save_LIBS ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yp_all" >&5 ++$as_echo "$ac_cv_search_yp_all" >&6; } ++ac_res=$ac_cv_search_yp_all ++if test "$ac_res" != no; then : ++ test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" ++ ++fi ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for NIS+" >&5 ++$as_echo_n "checking for NIS+... " >&6; } ++if ${zsh_cv_sys_nis_plus+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ test x$ac_cv_func_nis_list = xyes && test -f /usr/bin/nisls && \ ++ /usr/bin/nisls > /dev/null 2>&1 && \ ++zsh_cv_sys_nis_plus=yes || zsh_cv_sys_nis_plus=no ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_nis_plus" >&5 ++$as_echo "$zsh_cv_sys_nis_plus" >&6; } ++if test x$zsh_cv_sys_nis_plus = xyes; then ++ $as_echo "#define HAVE_NIS_PLUS 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for utmp file" >&5 ++$as_echo_n "checking for utmp file... " >&6; } ++if ${zsh_cv_path_utmp+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do ++ zsh_cv_path_utmp=${dir}/utmp ++ test -f $zsh_cv_path_utmp && break ++ zsh_cv_path_utmp=no ++done ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_utmp" >&5 ++$as_echo "$zsh_cv_path_utmp" >&6; } ++ ++if test $zsh_cv_path_utmp != no; then ++ cat >>confdefs.h <<_ACEOF ++#define PATH_UTMP_FILE "$zsh_cv_path_utmp" ++_ACEOF ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wtmp file" >&5 ++$as_echo_n "checking for wtmp file... " >&6; } ++if ${zsh_cv_path_wtmp+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do ++ zsh_cv_path_wtmp=${dir}/wtmp ++ test -f $zsh_cv_path_wtmp && break ++ zsh_cv_path_wtmp=no ++done ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_wtmp" >&5 ++$as_echo "$zsh_cv_path_wtmp" >&6; } ++ ++if test $zsh_cv_path_wtmp != no; then ++ cat >>confdefs.h <<_ACEOF ++#define PATH_WTMP_FILE "$zsh_cv_path_wtmp" ++_ACEOF ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for utmpx file" >&5 ++$as_echo_n "checking for utmpx file... " >&6; } ++if ${zsh_cv_path_utmpx+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do ++ zsh_cv_path_utmpx=${dir}/utmpx ++ test -f $zsh_cv_path_utmpx && break ++ zsh_cv_path_utmpx=no ++done ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_utmpx" >&5 ++$as_echo "$zsh_cv_path_utmpx" >&6; } ++ ++if test $zsh_cv_path_utmpx != no; then ++ cat >>confdefs.h <<_ACEOF ++#define PATH_UTMPX_FILE "$zsh_cv_path_utmpx" ++_ACEOF ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for wtmpx file" >&5 ++$as_echo_n "checking for wtmpx file... " >&6; } ++if ${zsh_cv_path_wtmpx+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ for dir in /etc /usr/etc /var/adm /usr/adm /var/run /var/log ./conftest; do ++ zsh_cv_path_wtmpx=${dir}/wtmpx ++ test -f $zsh_cv_path_wtmpx && break ++ zsh_cv_path_wtmpx=no ++done ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_path_wtmpx" >&5 ++$as_echo "$zsh_cv_path_wtmpx" >&6; } ++ ++if test $zsh_cv_path_wtmpx != no; then ++ cat >>confdefs.h <<_ACEOF ++#define PATH_WTMPX_FILE "$zsh_cv_path_wtmpx" ++_ACEOF ++ ++fi ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for brk() prototype in " >&5 ++$as_echo_n "checking for brk() prototype in ... " >&6; } ++if ${zsh_cv_header_unistd_h_brk_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++double brk(); ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_unistd_h_brk_proto=no ++else ++ zsh_cv_header_unistd_h_brk_proto=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_brk_proto" >&5 ++$as_echo "$zsh_cv_header_unistd_h_brk_proto" >&6; } ++ ++if test x$zsh_cv_header_unistd_h_brk_proto = xyes; then ++ $as_echo "#define HAVE_BRK_PROTO 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sbrk() prototype in " >&5 ++$as_echo_n "checking for sbrk() prototype in ... " >&6; } ++if ${zsh_cv_header_unistd_h_sbrk_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++double sbrk(); ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_unistd_h_sbrk_proto=no ++else ++ zsh_cv_header_unistd_h_sbrk_proto=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_sbrk_proto" >&5 ++$as_echo "$zsh_cv_header_unistd_h_sbrk_proto" >&6; } ++ ++if test x$zsh_cv_header_unistd_h_sbrk_proto = xyes; then ++ $as_echo "#define HAVE_SBRK_PROTO 1" >>confdefs.h ++ ++fi ++ ++ ++if test "$ac_cv_prog_cc_stdc" != no; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mknod prototype in " >&5 ++$as_echo_n "checking for mknod prototype in ... " >&6; } ++if ${zsh_cv_header_sys_stat_h_mknod_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ int mknod(double x); ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_sys_stat_h_mknod_proto=no ++else ++ zsh_cv_header_sys_stat_h_mknod_proto=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_stat_h_mknod_proto" >&5 ++$as_echo "$zsh_cv_header_sys_stat_h_mknod_proto" >&6; } ++ if test x$zsh_cv_header_sys_stat_h_mknod_proto = xyes; then ++ $as_echo "#define HAVE_MKNOD_PROTO 1" >>confdefs.h ++ ++ fi ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctl prototype in or " >&5 ++$as_echo_n "checking for ioctl prototype in or ... " >&6; } ++if ${zsh_cv_header_unistd_h_termios_h_ioctl_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HAVE_UNISTD_H ++# include ++#endif ++#ifdef HAVE_TERMIOS_H ++# include ++#endif ++double ioctl(); ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_unistd_h_termios_h_ioctl_proto=no ++else ++ zsh_cv_header_unistd_h_termios_h_ioctl_proto=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_unistd_h_termios_h_ioctl_proto" >&5 ++$as_echo "$zsh_cv_header_unistd_h_termios_h_ioctl_proto" >&6; } ++ ++if test x$zsh_cv_header_unistd_h_termios_h_ioctl_proto = xno; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ioctl prototype in " >&5 ++$as_echo_n "checking for ioctl prototype in ... " >&6; } ++if ${zsh_cv_header_sys_ioctl_h_ioctl_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ double ioctl(); ++int ++main () ++{ ++int i; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_sys_ioctl_h_ioctl_proto=no ++else ++ zsh_cv_header_sys_ioctl_h_ioctl_proto=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_sys_ioctl_h_ioctl_proto" >&5 ++$as_echo "$zsh_cv_header_sys_ioctl_h_ioctl_proto" >&6; } ++else ++ zsh_cv_header_sys_ioctl_h_ioctl_proto=no ++fi ++ ++ ++if test x$zsh_cv_header_unistd_h_termios_h_ioctl_proto = xyes || \ ++ test x$zsh_cv_header_sys_ioctl_h_ioctl_proto = xyes; then ++ $as_echo "#define HAVE_IOCTL_PROTO 1" >>confdefs.h ++ ++fi ++ ++if test x$zsh_cv_header_sys_ioctl_h_ioctl_proto = xyes; then ++ $as_echo "#define IOCTL_IN_SYS_IOCTL 1" >>confdefs.h ++ ++fi ++ ++ ++if test x$ac_cv_header_sys_select_h != xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for select() in " >&5 ++$as_echo_n "checking for select() in ... " >&6; } ++if ${zsh_cv_header_socket_h_select_proto+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++int ++main () ++{ ++fd_set fd; ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_header_socket_h_select_proto=yes ++else ++ zsh_cv_header_socket_h_select_proto=no ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_header_socket_h_select_proto" >&5 ++$as_echo "$zsh_cv_header_socket_h_select_proto" >&6; } ++ if test x$zsh_cv_header_socket_h_select_proto = xyes; then ++ $as_echo "#define SELECT_IN_SYS_SOCKET_H 1" >>confdefs.h ++ ++ fi ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if named FIFOs work" >&5 ++$as_echo_n "checking if named FIFOs work... " >&6; } ++if ${zsh_cv_sys_fifo+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$host_os" = cygwin; then ++zsh_cv_sys_fifo=yes ++else ++if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_fifo=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++main() ++{ ++ char c; ++ int fd; ++ int pid, ret; ++ unlink("/tmp/fifo$$"); ++#ifdef HAVE_MKFIFO ++ if(mkfifo("/tmp/fifo$$", 0600) < 0) ++#else ++ if(mknod("/tmp/fifo$$", 0010600, 0) < 0) ++#endif ++ exit(1); ++ pid = fork(); ++ if(pid < 0) ++ exit(1); ++ if(pid) { ++ fd = open("/tmp/fifo$$", O_RDONLY); ++ exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x'); ++ } ++ fd = open("/tmp/fifo$$", O_WRONLY); ++ ret = (fd < 0 || write(fd, "x", 1) < 1); ++ unlink("/tmp/fifo$$"); ++ exit(ret); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_fifo=yes ++else ++ zsh_cv_sys_fifo=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_fifo" >&5 ++$as_echo "$zsh_cv_sys_fifo" >&6; } ++ ++if test x$zsh_cv_sys_fifo = xyes; then ++ $as_echo "#define HAVE_FIFOS 1" >>confdefs.h ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if echo in /bin/sh interprets escape sequences" >&5 ++$as_echo_n "checking if echo in /bin/sh interprets escape sequences... " >&6; } ++if ${zsh_cv_prog_sh_echo_escape+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "`/bin/sh -c \"echo '\\n'\"`" = "\\n"; then ++ zsh_cv_prog_sh_echo_escape=no ++else ++ zsh_cv_prog_sh_echo_escape=yes ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_prog_sh_echo_escape" >&5 ++$as_echo "$zsh_cv_prog_sh_echo_escape" >&6; } ++ ++if test x$zsh_cv_prog_sh_echo_escape = xno; then ++ $as_echo "#define SH_USE_BSD_ECHO 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if link() works" >&5 ++$as_echo_n "checking if link() works... " >&6; } ++if ${zsh_cv_sys_link+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_link=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++main() ++{ ++ int ret; ++ char *tmpfile, *newfile; ++ tmpfile="/tmp/zsh.linktest$$"; ++ newfile="/tmp/zsh.linktest2$$"; ++ unlink(tmpfile); ++ unlink(newfile); ++ if(creat(tmpfile, 0644) < 0) ++ exit(1); ++ ret = link(tmpfile, newfile); ++ unlink(tmpfile); ++ unlink(newfile); ++ exit(ret<0); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_link=yes ++else ++ zsh_cv_sys_link=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_link" >&5 ++$as_echo "$zsh_cv_sys_link" >&6; } ++ ++if test x$zsh_cv_sys_link = xyes; then ++ $as_echo "#define HAVE_LINK 1" >>confdefs.h ++ ++fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if kill(pid, 0) returns ESRCH correctly" >&5 ++$as_echo_n "checking if kill(pid, 0) returns ESRCH correctly... " >&6; } ++if ${zsh_cv_sys_killesrch+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_killesrch=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++#include ++main() ++{ ++ int pid = (getpid() + 10000) & 0xffffff; ++ while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1; ++ exit(errno!=ESRCH); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_killesrch=yes ++else ++ zsh_cv_sys_killesrch=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_killesrch" >&5 ++$as_echo "$zsh_cv_sys_killesrch" >&6; } ++ ++if test x$zsh_cv_sys_killesrch = xno; then ++ $as_echo "#define BROKEN_KILL_ESRCH 1" >>confdefs.h ++ ++fi ++ ++ ++if test x$signals_style = xPOSIX_SIGNALS; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if POSIX sigsuspend() works" >&5 ++$as_echo_n "checking if POSIX sigsuspend() works... " >&6; } ++if ${zsh_cv_sys_sigsuspend+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_sigsuspend=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++int child=0; ++void handler(sig) ++ int sig; ++{if(sig==SIGCHLD) child=1;} ++main() { ++ struct sigaction act; ++ sigset_t set; ++ int pid, ret; ++ act.sa_handler = &handler; ++ sigfillset(&act.sa_mask); ++ act.sa_flags = 0; ++ sigaction(SIGCHLD, &act, 0); ++ sigfillset(&set); ++ sigprocmask(SIG_SETMASK, &set, 0); ++ pid=fork(); ++ if(pid==0) return 0; ++ if(pid>0) { ++ sigemptyset(&set); ++ ret=sigsuspend(&set); ++ exit(child==0); ++ } ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_sigsuspend=yes ++else ++ zsh_cv_sys_sigsuspend=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_sigsuspend" >&5 ++$as_echo "$zsh_cv_sys_sigsuspend" >&6; } ++ if test x$zsh_cv_sys_sigsuspend = xno; then ++ $as_echo "#define BROKEN_POSIX_SIGSUSPEND 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++ ++# Check whether --with-tcsetpgrp was given. ++if test "${with_tcsetpgrp+set}" = set; then : ++ withval=$with_tcsetpgrp; ++case "x$withval" in ++ xyes) zsh_working_tcsetpgrp=yes;; ++ xno) zsh_working_tcsetpgrp=no;; ++ *) as_fn_error $? "please use --with-tcsetpgrp=yes or --with-tcsetpgrp=no" "$LINENO" 5;; ++esac ++else ++ zsh_working_tcsetpgrp=check ++fi ++ ++if test "x$ac_cv_func_tcsetpgrp" = xyes; then ++case "x$zsh_working_tcsetpgrp" in ++ xcheck) ++ trap "" TTOU > /dev/null 2>&1 || : ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcsetpgrp() actually works" >&5 ++$as_echo_n "checking if tcsetpgrp() actually works... " >&6; } ++if ${zsh_cv_sys_tcsetpgrp+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_tcsetpgrp=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#include ++#include ++main() { ++ int fd; ++ int ret; ++ fd=open("/dev/tty", O_RDWR); ++ if (fd < 0) exit(2); ++ ret=tcsetpgrp(fd, tcgetpgrp(fd)); ++ if (ret < 0) exit(1); ++ exit(0); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_tcsetpgrp=yes ++else ++ ++case $? in ++ 1) zsh_cv_sys_tcsetpgrp=no;; ++ 2) zsh_cv_sys_tcsetpgrp=notty;; ++ *) zsh_cv_sys_tcsetpgrp=error;; ++esac ++ ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_tcsetpgrp" >&5 ++$as_echo "$zsh_cv_sys_tcsetpgrp" >&6; } ++ case "x$zsh_cv_sys_tcsetpgrp" in ++ xno) $as_echo "#define BROKEN_TCSETPGRP 1" >>confdefs.h ++;; ++ xyes) :;; ++ xnotty) as_fn_error $? "no controlling tty ++Try running configure with --with-tcsetpgrp or --without-tcsetpgrp" "$LINENO" 5;; ++ *) as_fn_error $? "unexpected return status" "$LINENO" 5;; ++ esac ++ trap - TTOU > /dev/null 2>&1 || : ++ ;; ++ xyes) :;; ++ xno) $as_echo "#define BROKEN_TCSETPGRP 1" >>confdefs.h ++;; ++ *) as_fn_error $? "unexpected value zsh_working_tcsetpgrp=$zsh_working_tcsetpgrp" "$LINENO" 5;; ++esac ++fi ++ ++ ++if test x$ac_cv_func_getpwnam = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if getpwnam() is faked" >&5 ++$as_echo_n "checking if getpwnam() is faked... " >&6; } ++if ${zsh_cv_sys_getpwnam_faked+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_getpwnam_faked=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++main() { ++ struct passwd *pw1, *pw2; ++ char buf[1024], name[1024]; ++ sprintf(buf, "%d:%d", getpid(), rand()); ++ pw1=getpwnam(buf); ++ if (pw1) strcpy(name, pw1->pw_name); ++ sprintf(buf, "%d:%d", rand(), getpid()); ++ pw2=getpwnam(buf); ++ exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name)); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_getpwnam_faked=no ++else ++ zsh_cv_sys_getpwnam_faked=yes ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_getpwnam_faked" >&5 ++$as_echo "$zsh_cv_sys_getpwnam_faked" >&6; } ++ if test x$zsh_cv_sys_getpwnam_faked = xyes; then ++ $as_echo "#define GETPWNAM_FAKED 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++ ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking base type of the third argument to accept" >&5 ++$as_echo_n "checking base type of the third argument to accept... " >&6; } ++if ${zsh_cv_type_socklen_t+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ zsh_cv_type_socklen_t= ++ for zsh_type in socklen_t int "unsigned long" size_t ; do ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#include ++ #include ++int ++main () ++{ ++extern int accept (int, struct sockaddr *, $zsh_type *); ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ zsh_cv_type_socklen_t="$zsh_type"; break ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++ done ++ if test -z "$zsh_cv_type_socklen_t"; then ++ zsh_cv_type_socklen_t=int ++ fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_type_socklen_t" >&5 ++$as_echo "$zsh_cv_type_socklen_t" >&6; } ++ ++cat >>confdefs.h <<_ACEOF ++#define ZSOCKLEN_T $zsh_cv_type_socklen_t ++_ACEOF ++ ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system has /dev/ptmx" >&5 ++$as_echo_n "checking if your system has /dev/ptmx... " >&6; } ++if ${ac_cv_have_dev_ptmx+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test -w /dev/ptmx; then ++ ac_cv_have_dev_ptmx=yes ++else ++ ac_cv_have_dev_ptmx=no ++fi ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_dev_ptmx" >&5 ++$as_echo "$ac_cv_have_dev_ptmx" >&6; } ++ ++ ++if test x$ac_cv_have_dev_ptmx = xyes && \ ++ test x$ac_cv_func_grantpt = xyes && \ ++ test x$ac_cv_func_unlockpt = xyes && \ ++ test x$ac_cv_func_ptsname = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if /dev/ptmx is usable" >&5 ++$as_echo_n "checking if /dev/ptmx is usable... " >&6; } ++if ${ac_cv_use_dev_ptmx+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++#ifdef __linux ++#define _GNU_SOURCE 1 ++#endif ++#include ++int ptsname(); ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_compile "$LINENO"; then : ++ ac_cv_use_dev_ptmx=no ++else ++ ac_cv_use_dev_ptmx=yes ++fi ++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_use_dev_ptmx" >&5 ++$as_echo "$ac_cv_use_dev_ptmx" >&6; } ++ if test x$ac_cv_use_dev_ptmx = xyes; then ++ $as_echo "#define USE_DEV_PTMX 1" >>confdefs.h ++ ++ fi ++fi ++ ++# Check whether --enable-multibyte was given. ++if test "${enable_multibyte+set}" = set; then : ++ enableval=$enable_multibyte; zsh_cv_c_unicode_support=$enableval ++else ++ if ${zsh_cv_c_unicode_support+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for functions supporting multibyte characters" >&5 ++$as_echo "$as_me: checking for functions supporting multibyte characters" >&6;} ++ zfuncs_absent= ++ for zfunc in iswalnum iswcntrl iswdigit iswgraph iswlower iswprint \ ++iswpunct iswspace iswupper iswxdigit mbrlen mbrtowc towupper towlower \ ++wcschr wcscpy wcslen wcsncmp wcsncpy wcrtomb wcwidth wmemchr wmemcmp \ ++wmemcpy wmemmove wmemset; do ++ as_ac_var=`$as_echo "ac_cv_func_$zfunc" | $as_tr_sh` ++ac_fn_c_check_func "$LINENO" "$zfunc" "$as_ac_var" ++if eval test \"x\$"$as_ac_var"\" = x"yes"; then : ++ : ++else ++ zfuncs_absent="$zfuncs_absent $zfunc" ++fi ++ ++ done ++ if test x"$zfuncs_absent" = x; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: all functions found, multibyte support enabled" >&5 ++$as_echo "$as_me: all functions found, multibyte support enabled" >&6;} ++ zsh_cv_c_unicode_support=yes ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: missing functions, multibyte support disabled" >&5 ++$as_echo "$as_me: missing functions, multibyte support disabled" >&6;} ++ zsh_cv_c_unicode_support=no ++ fi ++ ++fi ++ ++ ++fi ++ ++ ++ ++if test x$zsh_cv_c_unicode_support = xyes; then ++ $as_echo "#define MULTIBYTE_SUPPORT 1" >>confdefs.h ++ ++ ++ locale_prog='char *my_locales[] = { ++ "en_US.UTF-8", "en_GB.UTF-8", "en.UTF-8", ' ++ locale_prog="$locale_prog"`locale -a 2>/dev/null | \ ++ sed -e 's/utf8/UTF-8/' | grep UTF-8 | \ ++ while read line; do echo " \"$line\","; done;` ++ locale_prog="$locale_prog 0 }; ++ #define _XOPEN_SOURCE ++ #include ++ #include ++ #include ++ ++ int main() { ++ char **localep; ++ char comb_acute_mb[] = { (char)0xcc, (char)0x81 }; ++ wchar_t wc; ++ ++ for (localep = my_locales; *localep; localep++) ++ if (setlocale(LC_ALL, *localep) && ++ mbtowc(&wc, comb_acute_mb, 2) == 2) ++ break; ++ if (!*localep) ++ return 1; ++ if (wcwidth(wc) == 0) ++ return 1; ++ return 0; ++ } ++ " ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the wcwidth() function is broken" >&5 ++$as_echo_n "checking if the wcwidth() function is broken... " >&6; } ++if ${zsh_cv_c_broken_wcwidth+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_c_broken_wcwidth=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++$locale_prog ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_c_broken_wcwidth=yes ++else ++ zsh_cv_c_broken_wcwidth=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_c_broken_wcwidth" >&5 ++$as_echo "$zsh_cv_c_broken_wcwidth" >&6; } ++ if test x$zsh_cv_c_broken_wcwidth = xyes; then ++ $as_echo "#define BROKEN_WCWIDTH 1" >>confdefs.h ++ ++ fi ++fi ++ ++ ++# Check whether --enable-libc-musl was given. ++if test "${enable_libc_musl+set}" = set; then : ++ enableval=$enable_libc_musl; if test x$enableval = xyes; then ++ $as_echo "#define LIBC_MUSL 1" >>confdefs.h ++ ++fi ++fi ++ ++ ++# Check whether --enable-dynamic-nss was given. ++if test "${enable_dynamic_nss+set}" = set; then : ++ enableval=$enable_dynamic_nss; zsh_cv_c_dynamic_nss=$enableval ++fi ++ ++ ++ ++if test x$zsh_cv_c_dynamic_nss = xno; then ++ $as_echo "#define DISABLE_DYNAMIC_NSS 1" >>confdefs.h ++ ++fi ++ ++ ++L=N ++INSTLIB="install.bin-\$(L)" ++UNINSTLIB="uninstall.bin-\$(L)" ++LINKMODS=NOLINKMODS ++MOD_EXPORT= ++MOD_IMPORT_VARIABLE= ++MOD_IMPORT_FUNCTION= ++aixdynamic=no ++hpuxdynamic=no ++if test "$ac_cv_func_load" = yes && ++ test "$ac_cv_func_unload" = yes && ++ test "$ac_cv_func_loadbind" = yes && ++ test "$ac_cv_func_loadquery" = yes; then ++ if test "x$dynamic" = xyes; then ++ aixdynamic=yes ++ fi ++elif test "$ac_cv_func_dlopen" != yes || ++ test "$ac_cv_func_dlsym" != yes || ++ test "$ac_cv_func_dlerror" != yes; then ++ if test "$ac_cv_func_shl_load" != yes || ++ test "$ac_cv_func_shl_unload" != yes || ++ test "$ac_cv_func_shl_findsym" != yes; then ++ dynamic=no ++ elif test "x$dynamic" = xyes; then ++ hpuxdynamic=yes ++ DL_EXT="${DL_EXT=sl}" ++ $as_echo "#define HPUX10DYNAMIC 1" >>confdefs.h ++ fi ++fi ++ ++test -n "$GCC" && LDARG=-Wl, ++ ++ ++ ++if test "x$aixdynamic" = xyes; then ++ DL_EXT="${DL_EXT=so}" ++ DLLD="${DLLD=$CC}" ++ zsh_cv_func_dlsym_needs_underscore=no ++ if test -n "$GCC"; then ++ DLLDFLAGS=${DLLDFLAGS=-shared} ++ else ++ DLLDFLAGS=${DLLDFLAGS=-bM:SRE} ++ fi ++ DLLDFLAGS=${DLLDFLAGS=} ++ EXTRA_LDFLAGS=${EXTRA_LDFLAGS=} ++ EXPOPT=${LDARG}-bE: ++ IMPOPT=${LDARG}-bI: ++ zsh_cv_sys_dynamic_clash_ok="${zsh_cv_sys_dynamic_clash_ok=yes}" ++ zsh_cv_sys_dynamic_rtld_global="${zsh_cv_sys_dynamic_rtld_global=yes}" ++ zsh_cv_sys_dynamic_execsyms="${zsh_cv_sys_dynamic_execsyms=yes}" ++ zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}" ++ zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}" ++ zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}" ++elif test "$host_os" = cygwin; then ++ DL_EXT="${DL_EXT=dll}" ++##DLLD="${DLLD=dllwrap}" ++ DLLD="${DLLD=$CC}" ++##DLLDFLAGS="${DLLDFLAGS=--export-all-symbols}" ++ DLLDFLAGS=${DLLDFLAGS=-shared -Wl,--export-all-symbols} ++ zsh_cv_func_dlsym_needs_underscore=no ++ DLLDFLAGS=${DLLDFLAGS=} ++ EXTRA_LDFLAGS=${EXTRA_LDFLAGS=} ++ zsh_cv_sys_dynamic_clash_ok="${zsh_cv_sys_dynamic_clash_ok=no}" ++ zsh_cv_sys_dynamic_rtld_global="${zsh_cv_sys_dynamic_rtld_global=yes}" ++ zsh_cv_sys_dynamic_execsyms="${zsh_cv_sys_dynamic_execsyms=no}" ++ zsh_cv_sys_dynamic_strip_exe="${zsh_cv_sys_dynamic_strip_exe=yes}" ++ zsh_cv_sys_dynamic_strip_lib="${zsh_cv_sys_dynamic_strip_lib=yes}" ++ # ++ # THAT SUCKS! and must be changed ++ # ++ zsh_cv_shared_environ="${zsh_cv_shared_environ=yes}" ++ LINKMODS=LINKMODS ++ MOD_EXPORT="__attribute__((__dllexport__))" ++ MOD_IMPORT_VARIABLE="__attribute__((__dllimport__))" ++ MOD_IMPORT_FUNCTION= ++elif test "x$dynamic" = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your system uses ELF binaries" >&5 ++$as_echo_n "checking if your system uses ELF binaries... " >&6; } ++if ${zsh_cv_sys_elf+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_elf=yes ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++/* Test for whether ELF binaries are produced */ ++#include ++#include ++main(argc, argv) ++int argc; ++char *argv[]; ++{ ++ char b[4]; ++ int i = open(argv[0],O_RDONLY); ++ if(i == -1) ++ exit(1); /* fail */ ++ if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F') ++ exit(0); /* succeed (yes, it's ELF) */ ++ else ++ exit(1); /* fail */ ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_elf=yes ++else ++ zsh_cv_sys_elf=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_elf" >&5 ++$as_echo "$zsh_cv_sys_elf" >&6; } ++ ++ # We use [0-9]* in case statements, so need to change quoting ++ ++ ++ DL_EXT="${DL_EXT=so}" ++ if test x$zsh_cv_sys_elf = xyes; then ++ case "$host" in ++ mips-sni-sysv4*) ++ # Forcibly set ld to native compiler to avoid obscure GCC problems ++ DLLD="${DLLD=/usr/ccs/bin/cc}" ++ DLLDARG="${LDARG}" ++ ;; ++ * ) ++ DLLD="${DLLD=$CC}" ++ DLLDARG="${LDARG}" ++ ;; ++ esac ++ else ++ case "$host" in ++ *openbsd*) ++ case "$host_os" in ++ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) ++ DLLD="${DLLD=ld}" ++ ;; ++ *) ++ DLLD="${DLLD=$CC}" ++ ;; ++ esac ++ DLLDARG="${LDARG}" ++ ;; ++ *darwin*) ++ DLLD="${DLLD=$CC}" ++ DLLDARG="" ++ ;; ++ * ) ++ DLLD="${DLLD=ld}" ++ DLLDARG="" ++ ;; ++ esac ++ fi ++ if test -n "$GCC"; then ++ case "$host_os" in ++ hpux*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; ++ darwin*) DLCFLAGS="${DLCFLAGS=-fno-common}" ;; ++ *) DLCFLAGS="${DLCFLAGS=-fPIC}" ;; ++ esac ++ else ++ case "$host_os" in ++ hpux*) ++ DLCFLAGS="${DLCFLAGS=+z}" ++ DLLDFLAGS="${DLLDFLAGS=-b}" ++ ;; ++ sunos*) DLCFLAGS="${DLCFLAGS=-pic}" ;; ++ solaris*|sysv4*|esix*) DLCFLAGS="${DLCFLAGS=-KPIC}" ;; ++ esac ++ fi ++ case "$host_os" in ++ osf*) DLLDFLAGS="${DLLDFLAGS=-shared -expect_unresolved '*'}" ;; ++ *freebsd*|linux*|irix*|gnu*|dragonfly*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; ++ sunos*) DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;; ++ sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;; ++ netbsd*) DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;; ++ aix*) DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;; ++ solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;; ++ darwin*) DLLDFLAGS="${DLLDFLAGS=-bundle -flat_namespace -undefined suppress}" ;; ++ beos*|haiku*) DLLDFLAGS="${DLLDFLAGS=-nostart}" ;; ++ openbsd*) ++ if test x$zsh_cv_sys_elf = xyes; then ++ DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" ++ else ++ case "$host_os" in ++ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) ++ DLLDFLAGS="${DLLDFLAGS=-Bshareable}" ++ ;; ++ *) ++ DLLDFLAGS="${DLLDFLAGS=-shared -fPIC}" ++ ;; ++ esac ++ fi ++ ;; ++ esac ++ case "$host" in ++ *-hpux*) EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" ;; ++ *openbsd*) ++ if test x$zsh_cv_sys_elf = xyes; then ++ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-E}" ++ fi ++ ;; ++ mips-sni-sysv4) ++ # ++ # unfortunately, we have different compilers ++ # that need different flags ++ # ++ if test -n "$GCC"; then ++ sni_cc_version=GCC ++ else ++ sni_cc_version=`$CC -V 2>&1 | head -1` ++ fi ++ case "$sni_cc_version" in ++ *CDS*|GCC ) ++ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-Wl,-Blargedynsym}" ++ ;; ++ * ) ++ EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-LD-Blargedynsym}" ++ ;; ++ esac ++ ;; ++ *-beos*) ++ # gcc on BeOS doesn't like -rdynamic... ++ EXTRA_LDFLAGS="${EXTRA_LDFLAGS= }" ++ # also, dlopen() at least in Zeta respects $LIBRARY_PATH, so needs %A added to it. ++ export LIBRARY_PATH="$LIBRARY_PATH:%A/" ++ ;; ++ *-haiku*) ++ # ++ ;; ++ esac ++ ++ # Done with our shell code, so restore autotools quoting ++ ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can use -rdynamic" >&5 ++$as_echo_n "checking if we can use -rdynamic... " >&6; } ++if ${zsh_cv_rdynamic_available+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ old_LDFLAGS="$LDFLAGS" ++LDFLAGS="$LDFLAGS -rdynamic" ++cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++int ++main () ++{ ++ ++ ; ++ return 0; ++} ++_ACEOF ++if ac_fn_c_try_link "$LINENO"; then : ++ zsh_cv_rdynamic_available=yes ++EXTRA_LDFLAGS="${EXTRA_LDFLAGS=-rdynamic}" ++else ++ zsh_cvs_rdynamic_available=no ++fi ++rm -f core conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LDFLAGS="$old_LDFLAGS" ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rdynamic_available" >&5 ++$as_echo "$zsh_cv_rdynamic_available" >&6; } ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if your dlsym() needs a leading underscore" >&5 ++$as_echo_n "checking if your dlsym() needs a leading underscore... " >&6; } ++if ${zsh_cv_func_dlsym_needs_underscore+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ echo failed >conftestval && cat >conftest.c <&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++ { ac_try='$DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_func_dlsym_needs_underscore=no ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#include ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++ ++extern int fred() ; ++ ++main() ++{ ++ void * handle ; ++ void * symbol ; ++ FILE *f=fopen("conftestval", "w"); ++ if (!f) exit(1); ++ handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ; ++ if (handle == NULL) { ++ fprintf (f, "dlopen failed") ; ++ exit(1); ++ } ++ symbol = dlsym(handle, "fred") ; ++ if (symbol == NULL) { ++ /* try putting a leading underscore */ ++ symbol = dlsym(handle, "_fred") ; ++ if (symbol == NULL) { ++ fprintf (f, "dlsym failed") ; ++ exit(1); ++ } ++ fprintf (f, "yes") ; ++ } ++ else ++ fprintf (f, "no") ; ++ exit(0); ++} ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_func_dlsym_needs_underscore=`cat conftestval` ++else ++ zsh_cv_func_dlsym_needs_underscore=failed ++ dynamic=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_func_dlsym_needs_underscore" >&5 ++$as_echo "$zsh_cv_func_dlsym_needs_underscore" >&6; } ++ if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then ++ $as_echo "#define DLSYM_NEEDS_UNDERSCORE 1" >>confdefs.h ++ ++ elif test "x$zsh_cv_func_dlsym_needs_underscore" != xno; then ++ unset zsh_cv_func_dlsym_needs_underscore ++ fi ++fi ++ ++if test "x$dynamic" = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is available in shared libraries" >&5 ++$as_echo_n "checking if environ is available in shared libraries... " >&6; } ++if ${zsh_cv_shared_environ+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo ' ++void *zsh_getaddr1() ++{ ++#ifdef __CYGWIN__ ++ __attribute__((__dllimport__)) ++#endif ++ extern char ** environ; ++ return &environ; ++}; ++' > conftest1.c ++sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_shared_environ=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle1, *handle2; ++ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); ++ void *sym1, *sym2; ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle2) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); ++ sym1 = zsh_getaddr1(); ++ sym2 = zsh_getaddr2(); ++ if(!sym1 || !sym2) exit(1); ++ if(sym1 != sym2) exit(1); ++ dlclose(handle1); ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ sym1 = zsh_getaddr1(); ++ if(!sym1) exit(1); ++ if(sym1 != sym2) exit(1); ++ exit(0); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_shared_environ=yes ++else ++ zsh_cv_shared_environ=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_shared_environ=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_environ" >&5 ++$as_echo "$zsh_cv_shared_environ" >&6; } ++ ++ test "$zsh_cv_shared_environ" = yes || dynamic=no ++ if test "$ac_cv_func_tgetent" = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tgetent is available in shared libraries" >&5 ++$as_echo_n "checking if tgetent is available in shared libraries... " >&6; } ++if ${zsh_cv_shared_tgetent+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo ' ++void *zsh_getaddr1() ++{ ++#ifdef __CYGWIN__ ++ __attribute__((__dllimport__)) ++#endif ++ extern int tgetent ( ); ++ return tgetent; ++}; ++' > conftest1.c ++sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_shared_tgetent=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle1, *handle2; ++ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); ++ void *sym1, *sym2; ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle2) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); ++ sym1 = zsh_getaddr1(); ++ sym2 = zsh_getaddr2(); ++ if(!sym1 || !sym2) exit(1); ++ if(sym1 != sym2) exit(1); ++ dlclose(handle1); ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ sym1 = zsh_getaddr1(); ++ if(!sym1) exit(1); ++ if(sym1 != sym2) exit(1); ++ exit(0); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_shared_tgetent=yes ++else ++ zsh_cv_shared_tgetent=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_shared_tgetent=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_tgetent" >&5 ++$as_echo "$zsh_cv_shared_tgetent" >&6; } ++ ++ fi ++ if test "$ac_cv_func_tigetstr" = yes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tigetstr is available in shared libraries" >&5 ++$as_echo_n "checking if tigetstr is available in shared libraries... " >&6; } ++if ${zsh_cv_shared_tigetstr+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo ' ++void *zsh_getaddr1() ++{ ++#ifdef __CYGWIN__ ++ __attribute__((__dllimport__)) ++#endif ++ extern int tigetstr ( ); ++ return tigetstr; ++}; ++' > conftest1.c ++sed 's/zsh_getaddr1/zsh_getaddr2/' < conftest1.c > conftest2.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_shared_tigetstr=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle1, *handle2; ++ void *(*zsh_getaddr1)(), *(*zsh_getaddr2)(); ++ void *sym1, *sym2; ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle2) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2"); ++ sym1 = zsh_getaddr1(); ++ sym2 = zsh_getaddr2(); ++ if(!sym1 || !sym2) exit(1); ++ if(sym1 != sym2) exit(1); ++ dlclose(handle1); ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1"); ++ sym1 = zsh_getaddr1(); ++ if(!sym1) exit(1); ++ if(sym1 != sym2) exit(1); ++ exit(0); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_shared_tigetstr=yes ++else ++ zsh_cv_shared_tigetstr=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_shared_tigetstr=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_shared_tigetstr" >&5 ++$as_echo "$zsh_cv_shared_tigetstr" >&6; } ++ ++ fi ++fi ++ ++if test "x$dynamic" = xyes; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if name clashes in shared objects are OK" >&5 ++$as_echo_n "checking if name clashes in shared objects are OK... " >&6; } ++if ${zsh_cv_sys_dynamic_clash_ok+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo 'int fred () { return 42; }' > conftest1.c ++echo 'int fred () { return 69; }' > conftest2.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_dynamic_clash_ok=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++ ++main() ++{ ++ void *handle1, *handle2; ++ int (*fred1)(), (*fred2)(); ++ handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle1) exit(1); ++ handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle2) exit(1); ++ fred1 = (int (*)()) dlsym(handle1, "${us}fred"); ++ fred2 = (int (*)()) dlsym(handle2, "${us}fred"); ++ if(!fred1 || !fred2) exit(1); ++ exit((*fred1)() != 42 || (*fred2)() != 69); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_dynamic_clash_ok=yes ++else ++ zsh_cv_sys_dynamic_clash_ok=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_sys_dynamic_clash_ok=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_clash_ok" >&5 ++$as_echo "$zsh_cv_sys_dynamic_clash_ok" >&6; } ++if test "$zsh_cv_sys_dynamic_clash_ok" = yes; then ++ $as_echo "#define DYNAMIC_NAME_CLASH_OK 1" >>confdefs.h ++ ++fi ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working RTLD_GLOBAL" >&5 ++$as_echo_n "checking for working RTLD_GLOBAL... " >&6; } ++if ${zsh_cv_sys_dynamic_rtld_global+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo 'int fred () { return 42; }' > conftest1.c ++echo 'extern int fred(); int barney () { return fred() + 27; }' > conftest2.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_dynamic_rtld_global=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle; ++ int (*barneysym)(); ++ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle) exit(1); ++ handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle) exit(1); ++ barneysym = (int (*)()) dlsym(handle, "${us}barney"); ++ if(!barneysym) exit(1); ++ exit((*barneysym)() != 69); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_dynamic_rtld_global=yes ++else ++ zsh_cv_sys_dynamic_rtld_global=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_sys_dynamic_rtld_global=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_rtld_global" >&5 ++$as_echo "$zsh_cv_sys_dynamic_rtld_global" >&6; } ++ ++ RTLD_GLOBAL_OK=$zsh_cv_sys_dynamic_rtld_global ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symbols in the executable are available" >&5 ++$as_echo_n "checking whether symbols in the executable are available... " >&6; } ++if ${zsh_cv_sys_dynamic_execsyms+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo 'extern int fred(); int barney () { return fred() + 27; }' > conftest1.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ save_ldflags=$LDFLAGS ++ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS" ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_dynamic_execsyms=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle; ++ int (*barneysym)(); ++ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle) exit(1); ++ barneysym = (int (*)()) dlsym(handle, "${us}barney"); ++ if(!barneysym) exit(1); ++ exit((*barneysym)() != 69); ++} ++ ++int fred () { return 42; } ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_dynamic_execsyms=yes ++else ++ zsh_cv_sys_dynamic_execsyms=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ LDFLAGS=$save_ldflags ++else ++ zsh_cv_sys_dynamic_execsyms=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_execsyms" >&5 ++$as_echo "$zsh_cv_sys_dynamic_execsyms" >&6; } ++ ++ if test "$zsh_cv_sys_dynamic_execsyms" != yes; then ++ L=L ++ fi ++ ++{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether executables can be stripped" >&5 ++$as_echo_n "checking whether executables can be stripped... " >&6; } ++if ${zsh_cv_sys_dynamic_strip_exe+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_sys_dynamic_execsyms" != yes; then ++ zsh_cv_sys_dynamic_strip_exe=yes ++elif ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++ else ++ us= ++ fi ++ echo 'extern int fred(); int barney() { return fred() + 27; }' > conftest1.c ++ { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++ { ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ save_ldflags=$LDFLAGS ++ LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s" ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_dynamic_strip_exe=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle; ++ int (*barneysym)(); ++ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle) exit(1); ++ barneysym = (int (*)()) dlsym(handle, "${us}barney"); ++ if(!barneysym) exit(1); ++ exit((*barneysym)() != 69); ++} ++ ++int fred () { return 42; } ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_dynamic_strip_exe=yes ++else ++ zsh_cv_sys_dynamic_strip_exe=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++ LDFLAGS=$save_ldflags ++else ++ zsh_cv_sys_dynamic_strip_exe=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_strip_exe" >&5 ++$as_echo "$zsh_cv_sys_dynamic_strip_exe" >&6; } ++ ++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether libraries can be stripped" >&5 ++$as_echo_n "checking whether libraries can be stripped... " >&6; } ++if ${zsh_cv_sys_dynamic_strip_lib+:} false; then : ++ $as_echo_n "(cached) " >&6 ++else ++ if test "$zsh_cv_func_dlsym_needs_underscore" = yes; then ++ us=_ ++else ++ us= ++fi ++echo 'int fred () { return 42; }' > conftest1.c ++if { ac_try='$CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; } && ++{ ac_try='$DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&5' ++ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 ++ test $ac_status = 0; }; }; then ++ if test "$cross_compiling" = yes; then : ++ zsh_cv_sys_dynamic_strip_lib=no ++ ++else ++ cat confdefs.h - <<_ACEOF >conftest.$ac_ext ++/* end confdefs.h. */ ++ ++#ifdef HPUX10DYNAMIC ++#include ++#define RTLD_LAZY BIND_DEFERRED ++#define RTLD_GLOBAL DYNAMIC_PATH ++ ++char *zsh_gl_sym_addr ; ++ ++#define dlopen(file,mode) (void *)shl_load((file), (mode), (long) 0) ++#define dlclose(handle) shl_unload((shl_t)(handle)) ++#define dlsym(handle,name) (zsh_gl_sym_addr=0,shl_findsym((shl_t *)&(handle),name,TYPE_UNDEFINED,&zsh_gl_sym_addr), (void *)zsh_gl_sym_addr) ++#define dlerror() 0 ++#else ++#ifdef HAVE_DLFCN_H ++#include ++#else ++#include ++#include ++#include ++#endif ++#endif ++#ifndef RTLD_LAZY ++#define RTLD_LAZY 1 ++#endif ++#ifndef RTLD_GLOBAL ++#define RTLD_GLOBAL 0 ++#endif ++ ++main() ++{ ++ void *handle; ++ int (*fredsym)(); ++ handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); ++ if(!handle) exit(1); ++ fredsym = (int (*)()) dlsym(handle, "${us}fred"); ++ if(!fredsym) exit(1); ++ exit((*fredsym)() != 42); ++} ++ ++_ACEOF ++if ac_fn_c_try_run "$LINENO"; then : ++ zsh_cv_sys_dynamic_strip_lib=yes ++else ++ zsh_cv_sys_dynamic_strip_lib=no ++fi ++rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ ++ conftest.$ac_objext conftest.beam conftest.$ac_ext ++fi ++ ++else ++ zsh_cv_sys_dynamic_strip_lib=no ++fi ++ ++fi ++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_sys_dynamic_strip_lib" >&5 ++$as_echo "$zsh_cv_sys_dynamic_strip_lib" >&6; } ++ ++ if $strip_exeldflags && test "$zsh_cv_sys_dynamic_strip_exe" = yes; then ++ EXELDFLAGS="$EXELDFLAGS -s" ++ fi ++ if $strip_libldflags && test "$zsh_cv_sys_dynamic_strip_lib" = yes; then ++ LIBLDFLAGS="$LIBLDFLAGS -s" ++ fi ++ if test "$host_os" = cygwin; then ++ INSTLIB="install.cygwin-lib" ++ UNINSTLIB="uninstall.cygwin-lib" ++ fi ++else ++ $strip_exeldflags && EXELDFLAGS="$EXELDFLAGS -s" ++ $strip_libldflags && LIBLDFLAGS="$LIBLDFLAGS -s" ++ RTLD_GLOBAL_OK=no ++fi ++ ++ ++if test "x$dynamic" = xyes; then ++ D=D ++ $as_echo "#define DYNAMIC 1" >>confdefs.h ++else ++ D=N ++fi ++ ++ ++if test "x$aixdynamic" = xyes; then ++ E=E ++ $as_echo "#define AIXDYNAMIC 1" >>confdefs.h ++else ++ E=N ++fi ++ ++if test "x$zsh_cv_sys_dynamic_clash_ok" = xyes; then ++ SHORTBOOTNAMES=yes ++else ++ SHORTBOOTNAMES=no ++fi ++ ++ ++ ++if test "$host_os" = cygwin; then ++ EXTRAZSHOBJS="$EXTRAZSHOBJS zsh.res.o" ++fi ++ ++ ++cat >>confdefs.h <<_ACEOF ++#define DL_EXT "$DL_EXT" ++_ACEOF ++ ++# Generate config.modules. We look for *.mdd files in first and second ++# level subdirectories. Any existing line not containing 'auto=y' will be ++# retained, provided the .mdd file itself was found. ++CONFIG_MODULES=./config.modules ++cat < ${CONFIG_MODULES}.sh ++srcdir="$srcdir" ++dynamic="$dynamic" ++CONFIG_MODULES="${CONFIG_MODULES}" ++EOM ++cat <<\EOM >> ${CONFIG_MODULES}.sh ++echo "creating ${CONFIG_MODULES}" ++userlist=" " ++if test -f ${CONFIG_MODULES}; then ++ userlist="`sed -e '/^#/d' -e '/auto=y/d' -e 's/ .*/ /' -e 's/^name=/ /' \ ++ ${CONFIG_MODULES}`" ++ mv ${CONFIG_MODULES} ${CONFIG_MODULES}.old ++else ++ # Save testing for existence each time. ++ echo > ${CONFIG_MODULES}.old ++fi ++(echo "# Edit this file to change the way modules are loaded." ++echo "# The format is strict; do not break lines or add extra spaces." ++echo "# Run \`make prep' if you change anything here after compiling" ++echo "# (there is no need if you change this just after the first time" ++echo "# you run \`configure')." ++echo "#" ++echo "# Values of \`link' are \`static', \`dynamic' or \`no' to compile the" ++echo "# module into the shell, link it in at run time, or not use it at all." ++echo "# In the final case, no attempt will be made to compile it." ++echo "# Use \`static' or \`no' if you do not have dynamic loading." ++echo "#" ++echo "# Values of \`load' are \`yes' or \`no'; if yes, any builtins etc." ++echo "# provided by the module will be autoloaded by the main shell" ++echo "# (so long as \`link' is not set to \`no')." ++echo "#" ++echo "# Values of \`auto' are \`yes' or \`no'. configure sets the value to" ++echo "# \`yes'. If you set it by hand to \`no', the line will be retained" ++echo "# when the file is regenerated in future." ++echo "#" ++echo "# Note that the \`functions' entry extends to the end of the line." ++echo "# It should not be quoted; it is used verbatim to find files to install." ++echo "#" ++echo "# You will need to run \`config.status --recheck' if you add a new" ++echo "# module." ++echo "#" ++echo "# You should not change the values for the pseudo-module zsh/main," ++echo "# which is the main shell (apart from the functions entry)." ++EOM ++for modfile in `cd ${srcdir}; echo */*.mdd */*/*.mdd`; do ++ name= ++ link= ++ load= ++ functions= ++ result= ++ . ${srcdir}/$modfile ++ if test x$name != x && test x"$link" != x; then ++ case "$link" in ++ *\ *) eval "link=\`$link\`" ++ ;; ++ esac ++ case "${load}" in ++ y*) load=" load=yes" ++ ;; ++ *) load=" load=no" ++ ;; ++ esac ++ if test "x$functions" != x; then ++ # N.B. no additional quotes ++ f=" functions=$functions" ++ else ++ f= ++ fi ++ case "$link" in ++ static) result="name=$name modfile=$modfile link=static auto=yes${load}$f" ++ ;; ++ dynamic) if test x$dynamic != xno; then ++ result="name=$name modfile=$modfile link=dynamic\ ++ auto=yes${load}$f" ++ else ++ result="name=$name modfile=$modfile link=no\ ++ auto=yes load=no$f" ++ fi ++ ;; ++ either) if test x$dynamic != xno; then ++ result="name=$name modfile=$modfile link=dynamic\ ++ auto=yes${load}$f" ++ else ++ result="name=$name modfile=$modfile link=static\ ++ auto=yes${load}$f" ++ fi ++ ;; ++ *) result="name=$name modfile=$modfile link=no auto=yes load=no$f" ++ ;; ++ esac ++cat <> ${CONFIG_MODULES}.sh ++case "\$userlist" in ++ *" $name "*) grep "^name=$name " \${CONFIG_MODULES}.old;; ++ *) echo "$result";; ++esac ++EOM ++ fi ++done ++cat <<\EOM >> ${CONFIG_MODULES}.sh ++) >${CONFIG_MODULES} ++rm -f ${CONFIG_MODULES}.old ++EOM ++ ++ ++ ++CLEAN_MK="${srcdir}/Config/clean.mk" ++CONFIG_MK="${srcdir}/Config/config.mk" ++DEFS_MK="Config/defs.mk" ++VERSION_MK="${srcdir}/Config/version.mk" ++ ++ ++ac_config_files="$ac_config_files Config/defs.mk Makefile Doc/Makefile Etc/Makefile Src/Makefile Test/Makefile" ++ ++ac_config_commands="$ac_config_commands config.modules" ++ ++ac_config_commands="$ac_config_commands stamp-h" ++ ++ ++cat >confcache <<\_ACEOF ++# This file is a shell script that caches the results of configure ++# tests run on this system so they can be shared between configure ++# scripts and configure runs, see configure's option --config-cache. ++# It is not useful on other systems. If it contains results you don't ++# want to keep, you may remove or edit it. ++# ++# config.status only pays attention to the cache file if you give it ++# the --recheck option to rerun configure. ++# ++# `ac_cv_env_foo' variables (set or unset) will be overridden when ++# loading this file, other *unset* `ac_cv_foo' will be assigned the ++# following values. ++ ++_ACEOF ++ ++# The following way of writing the cache mishandles newlines in values, ++# but we know of no workaround that is simple, portable, and efficient. ++# So, we kill variables containing newlines. ++# Ultrix sh set writes to stderr and can't be redirected directly, ++# and sets the high bit in the cache file unless we assign to the vars. ++( ++ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do ++ eval ac_val=\$$ac_var ++ case $ac_val in #( ++ *${as_nl}*) ++ case $ac_var in #( ++ *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 ++$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ++ esac ++ case $ac_var in #( ++ _ | IFS | as_nl) ;; #( ++ BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( ++ *) { eval $ac_var=; unset $ac_var;} ;; ++ esac ;; ++ esac ++ done ++ ++ (set) 2>&1 | ++ case $as_nl`(ac_space=' '; set) 2>&1` in #( ++ *${as_nl}ac_space=\ *) ++ # `set' does not quote correctly, so add quotes: double-quote ++ # substitution turns \\\\ into \\, and sed turns \\ into \. ++ sed -n \ ++ "s/'/'\\\\''/g; ++ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ++ ;; #( ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ++ ;; ++ esac | ++ sort ++) | ++ sed ' ++ /^ac_cv_env_/b end ++ t clear ++ :clear ++ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ ++ t end ++ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ ++ :end' >>confcache ++if diff "$cache_file" confcache >/dev/null 2>&1; then :; else ++ if test -w "$cache_file"; then ++ if test "x$cache_file" != "x/dev/null"; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 ++$as_echo "$as_me: updating cache $cache_file" >&6;} ++ if test ! -f "$cache_file" || test -h "$cache_file"; then ++ cat confcache >"$cache_file" ++ else ++ case $cache_file in #( ++ */* | ?:*) ++ mv -f confcache "$cache_file"$$ && ++ mv -f "$cache_file"$$ "$cache_file" ;; #( ++ *) ++ mv -f confcache "$cache_file" ;; ++ esac ++ fi ++ fi ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 ++$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} ++ fi ++fi ++rm -f confcache ++ ++test "x$prefix" = xNONE && prefix=$ac_default_prefix ++# Let make expand exec_prefix. ++test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' ++ ++DEFS=-DHAVE_CONFIG_H ++ ++ac_libobjs= ++ac_ltlibobjs= ++U= ++for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue ++ # 1. Remove the extension, and $U if already installed. ++ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ++ ac_i=`$as_echo "$ac_i" | sed "$ac_script"` ++ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR ++ # will be set to the directory where LIBOBJS objects are built. ++ as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" ++ as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' ++done ++LIBOBJS=$ac_libobjs ++ ++LTLIBOBJS=$ac_ltlibobjs ++ ++ ++ ++: "${CONFIG_STATUS=./config.status}" ++ac_write_fail=0 ++ac_clean_files_save=$ac_clean_files ++ac_clean_files="$ac_clean_files $CONFIG_STATUS" ++{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 ++$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} ++as_write_fail=0 ++cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 ++#! $SHELL ++# Generated by $as_me. ++# Run this file to recreate the current configuration. ++# Compiler output produced by configure, useful for debugging ++# configure, is in config.log if it exists. ++ ++debug=false ++ac_cs_recheck=false ++ac_cs_silent=false ++ ++SHELL=\${CONFIG_SHELL-$SHELL} ++export SHELL ++_ASEOF ++cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ++## -------------------- ## ++## M4sh Initialization. ## ++## -------------------- ## ++ ++# Be more Bourne compatible ++DUALCASE=1; export DUALCASE # for MKS sh ++if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : ++ emulate sh ++ NULLCMD=: ++ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which ++ # is contrary to our usage. Disable this feature. ++ alias -g '${1+"$@"}'='"$@"' ++ setopt NO_GLOB_SUBST ++else ++ case `(set -o) 2>/dev/null` in #( ++ *posix*) : ++ set -o posix ;; #( ++ *) : ++ ;; ++esac ++fi ++ ++ ++as_nl=' ++' ++export as_nl ++# Printing a long string crashes Solaris 7 /usr/bin/printf. ++as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo ++as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo ++# Prefer a ksh shell builtin over an external printf program on Solaris, ++# but without wasting forks for bash or zsh. ++if test -z "$BASH_VERSION$ZSH_VERSION" \ ++ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='print -r --' ++ as_echo_n='print -rn --' ++elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then ++ as_echo='printf %s\n' ++ as_echo_n='printf %s' ++else ++ if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then ++ as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' ++ as_echo_n='/usr/ucb/echo -n' ++ else ++ as_echo_body='eval expr "X$1" : "X\\(.*\\)"' ++ as_echo_n_body='eval ++ arg=$1; ++ case $arg in #( ++ *"$as_nl"*) ++ expr "X$arg" : "X\\(.*\\)$as_nl"; ++ arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; ++ esac; ++ expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ++ ' ++ export as_echo_n_body ++ as_echo_n='sh -c $as_echo_n_body as_echo' ++ fi ++ export as_echo_body ++ as_echo='sh -c $as_echo_body as_echo' ++fi ++ ++# The user is always right. ++if test "${PATH_SEPARATOR+set}" != set; then ++ PATH_SEPARATOR=: ++ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { ++ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || ++ PATH_SEPARATOR=';' ++ } ++fi ++ ++ ++# IFS ++# We need space, tab and new line, in precisely that order. Quoting is ++# there to prevent editors from complaining about space-tab. ++# (If _AS_PATH_WALK were called with IFS unset, it would disable word ++# splitting by setting IFS to empty value.) ++IFS=" "" $as_nl" ++ ++# Find who we are. Look in the path if we contain no directory separator. ++as_myself= ++case $0 in #(( ++ *[\\/]* ) as_myself=$0 ;; ++ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR ++for as_dir in $PATH ++do ++ IFS=$as_save_IFS ++ test -z "$as_dir" && as_dir=. ++ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break ++ done ++IFS=$as_save_IFS ++ ++ ;; ++esac ++# We did not find ourselves, most probably we were run as `sh COMMAND' ++# in which case we are not to be found in the path. ++if test "x$as_myself" = x; then ++ as_myself=$0 ++fi ++if test ! -f "$as_myself"; then ++ $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 ++ exit 1 ++fi ++ ++# Unset variables that we do not need and which cause bugs (e.g. in ++# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" ++# suppresses any "Segmentation fault" message there. '((' could ++# trigger a bug in pdksh 5.2.14. ++for as_var in BASH_ENV ENV MAIL MAILPATH ++do eval test x\${$as_var+set} = xset \ ++ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : ++done ++PS1='$ ' ++PS2='> ' ++PS4='+ ' ++ ++# NLS nuisances. ++LC_ALL=C ++export LC_ALL ++LANGUAGE=C ++export LANGUAGE ++ ++# CDPATH. ++(unset CDPATH) >/dev/null 2>&1 && unset CDPATH ++ ++ ++# as_fn_error STATUS ERROR [LINENO LOG_FD] ++# ---------------------------------------- ++# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are ++# provided, also output the error to LOG_FD, referencing LINENO. Then exit the ++# script with STATUS, using 1 if that was 0. ++as_fn_error () ++{ ++ as_status=$1; test $as_status -eq 0 && as_status=1 ++ if test "$4"; then ++ as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack ++ $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 ++ fi ++ $as_echo "$as_me: error: $2" >&2 ++ as_fn_exit $as_status ++} # as_fn_error ++ ++ ++# as_fn_set_status STATUS ++# ----------------------- ++# Set $? to STATUS, without forking. ++as_fn_set_status () ++{ ++ return $1 ++} # as_fn_set_status ++ ++# as_fn_exit STATUS ++# ----------------- ++# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. ++as_fn_exit () ++{ ++ set +e ++ as_fn_set_status $1 ++ exit $1 ++} # as_fn_exit ++ ++# as_fn_unset VAR ++# --------------- ++# Portably unset VAR. ++as_fn_unset () ++{ ++ { eval $1=; unset $1;} ++} ++as_unset=as_fn_unset ++# as_fn_append VAR VALUE ++# ---------------------- ++# Append the text in VALUE to the end of the definition contained in VAR. Take ++# advantage of any shell optimizations that allow amortized linear growth over ++# repeated appends, instead of the typical quadratic growth present in naive ++# implementations. ++if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : ++ eval 'as_fn_append () ++ { ++ eval $1+=\$2 ++ }' ++else ++ as_fn_append () ++ { ++ eval $1=\$$1\$2 ++ } ++fi # as_fn_append ++ ++# as_fn_arith ARG... ++# ------------------ ++# Perform arithmetic evaluation on the ARGs, and store the result in the ++# global $as_val. Take advantage of shells that can avoid forks. The arguments ++# must be portable across $(()) and expr. ++if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : ++ eval 'as_fn_arith () ++ { ++ as_val=$(( $* )) ++ }' ++else ++ as_fn_arith () ++ { ++ as_val=`expr "$@" || test $? -eq 1` ++ } ++fi # as_fn_arith ++ ++ ++if expr a : '\(a\)' >/dev/null 2>&1 && ++ test "X`expr 00001 : '.*\(...\)'`" = X001; then ++ as_expr=expr ++else ++ as_expr=false ++fi ++ ++if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then ++ as_basename=basename ++else ++ as_basename=false ++fi ++ ++if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then ++ as_dirname=dirname ++else ++ as_dirname=false ++fi ++ ++as_me=`$as_basename -- "$0" || ++$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ ++ X"$0" : 'X\(//\)$' \| \ ++ X"$0" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X/"$0" | ++ sed '/^.*\/\([^/][^/]*\)\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\/\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ ++# Avoid depending upon Character Ranges. ++as_cr_letters='abcdefghijklmnopqrstuvwxyz' ++as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' ++as_cr_Letters=$as_cr_letters$as_cr_LETTERS ++as_cr_digits='0123456789' ++as_cr_alnum=$as_cr_Letters$as_cr_digits ++ ++ECHO_C= ECHO_N= ECHO_T= ++case `echo -n x` in #((((( ++-n*) ++ case `echo 'xy\c'` in ++ *c*) ECHO_T=' ';; # ECHO_T is single tab character. ++ xy) ECHO_C='\c';; ++ *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ++ ECHO_T=' ';; ++ esac;; ++*) ++ ECHO_N='-n';; ++esac ++ ++rm -f conf$$ conf$$.exe conf$$.file ++if test -d conf$$.dir; then ++ rm -f conf$$.dir/conf$$.file ++else ++ rm -f conf$$.dir ++ mkdir conf$$.dir 2>/dev/null ++fi ++if (echo >conf$$.file) 2>/dev/null; then ++ if ln -s conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s='ln -s' ++ # ... but there are two gotchas: ++ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. ++ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. ++ # In both cases, we have to default to `cp -p'. ++ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || ++ as_ln_s='cp -p' ++ elif ln conf$$.file conf$$ 2>/dev/null; then ++ as_ln_s=ln ++ else ++ as_ln_s='cp -p' ++ fi ++else ++ as_ln_s='cp -p' ++fi ++rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file ++rmdir conf$$.dir 2>/dev/null ++ ++ ++# as_fn_mkdir_p ++# ------------- ++# Create "$as_dir" as a directory, including parents if necessary. ++as_fn_mkdir_p () ++{ ++ ++ case $as_dir in #( ++ -*) as_dir=./$as_dir;; ++ esac ++ test -d "$as_dir" || eval $as_mkdir_p || { ++ as_dirs= ++ while :; do ++ case $as_dir in #( ++ *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( ++ *) as_qdir=$as_dir;; ++ esac ++ as_dirs="'$as_qdir' $as_dirs" ++ as_dir=`$as_dirname -- "$as_dir" || ++$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$as_dir" : 'X\(//\)[^/]' \| \ ++ X"$as_dir" : 'X\(//\)$' \| \ ++ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$as_dir" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ test -d "$as_dir" && break ++ done ++ test -z "$as_dirs" || eval "mkdir $as_dirs" ++ } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" ++ ++ ++} # as_fn_mkdir_p ++if mkdir -p . 2>/dev/null; then ++ as_mkdir_p='mkdir -p "$as_dir"' ++else ++ test -d ./-p && rmdir ./-p ++ as_mkdir_p=false ++fi ++ ++if test -x / >/dev/null 2>&1; then ++ as_test_x='test -x' ++else ++ if ls -dL / >/dev/null 2>&1; then ++ as_ls_L_option=L ++ else ++ as_ls_L_option= ++ fi ++ as_test_x=' ++ eval sh -c '\'' ++ if test -d "$1"; then ++ test -d "$1/."; ++ else ++ case $1 in #( ++ -*)set "./$1";; ++ esac; ++ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( ++ ???[sx]*):;;*)false;;esac;fi ++ '\'' sh ++ ' ++fi ++as_executable_p=$as_test_x ++ ++# Sed expression to map a string onto a valid CPP name. ++as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" ++ ++# Sed expression to map a string onto a valid variable name. ++as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" ++ ++ ++exec 6>&1 ++## ----------------------------------- ## ++## Main body of $CONFIG_STATUS script. ## ++## ----------------------------------- ## ++_ASEOF ++test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++# Save the log message, to keep $0 and so on meaningful, and to ++# report actual input values of CONFIG_FILES etc. instead of their ++# values after options handling. ++ac_log=" ++This file was extended by $as_me, which was ++generated by GNU Autoconf 2.68. Invocation command line was ++ ++ CONFIG_FILES = $CONFIG_FILES ++ CONFIG_HEADERS = $CONFIG_HEADERS ++ CONFIG_LINKS = $CONFIG_LINKS ++ CONFIG_COMMANDS = $CONFIG_COMMANDS ++ $ $0 $@ ++ ++on `(hostname || uname -n) 2>/dev/null | sed 1q` ++" ++ ++_ACEOF ++ ++case $ac_config_files in *" ++"*) set x $ac_config_files; shift; ac_config_files=$*;; ++esac ++ ++case $ac_config_headers in *" ++"*) set x $ac_config_headers; shift; ac_config_headers=$*;; ++esac ++ ++ ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++# Files that config.status was made for. ++config_files="$ac_config_files" ++config_headers="$ac_config_headers" ++config_commands="$ac_config_commands" ++ ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++ac_cs_usage="\ ++\`$as_me' instantiates files and other configuration actions ++from templates according to the current configuration. Unless the files ++and actions are specified as TAGs, all are instantiated by default. ++ ++Usage: $0 [OPTION]... [TAG]... ++ ++ -h, --help print this help, then exit ++ -V, --version print version number and configuration settings, then exit ++ --config print configuration, then exit ++ -q, --quiet, --silent ++ do not print progress messages ++ -d, --debug don't remove temporary files ++ --recheck update $as_me by reconfiguring in the same conditions ++ --file=FILE[:TEMPLATE] ++ instantiate the configuration file FILE ++ --header=FILE[:TEMPLATE] ++ instantiate the configuration header FILE ++ ++Configuration files: ++$config_files ++ ++Configuration headers: ++$config_headers ++ ++Configuration commands: ++$config_commands ++ ++Report bugs to the package provider." ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ++ac_cs_version="\\ ++config.status ++configured by $0, generated by GNU Autoconf 2.68, ++ with options \\"\$ac_cs_config\\" ++ ++Copyright (C) 2010 Free Software Foundation, Inc. ++This config.status script is free software; the Free Software Foundation ++gives unlimited permission to copy, distribute and modify it." ++ ++ac_pwd='$ac_pwd' ++srcdir='$srcdir' ++INSTALL='$INSTALL' ++AWK='$AWK' ++test -n "\$AWK" || AWK=awk ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++# The default lists apply if the user does not specify any file. ++ac_need_defaults=: ++while test $# != 0 ++do ++ case $1 in ++ --*=?*) ++ ac_option=`expr "X$1" : 'X\([^=]*\)='` ++ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ++ ac_shift=: ++ ;; ++ --*=) ++ ac_option=`expr "X$1" : 'X\([^=]*\)='` ++ ac_optarg= ++ ac_shift=: ++ ;; ++ *) ++ ac_option=$1 ++ ac_optarg=$2 ++ ac_shift=shift ++ ;; ++ esac ++ ++ case $ac_option in ++ # Handling of the options. ++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ++ ac_cs_recheck=: ;; ++ --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) ++ $as_echo "$ac_cs_version"; exit ;; ++ --config | --confi | --conf | --con | --co | --c ) ++ $as_echo "$ac_cs_config"; exit ;; ++ --debug | --debu | --deb | --de | --d | -d ) ++ debug=: ;; ++ --file | --fil | --fi | --f ) ++ $ac_shift ++ case $ac_optarg in ++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ '') as_fn_error $? "missing file argument" ;; ++ esac ++ as_fn_append CONFIG_FILES " '$ac_optarg'" ++ ac_need_defaults=false;; ++ --header | --heade | --head | --hea ) ++ $ac_shift ++ case $ac_optarg in ++ *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; ++ esac ++ as_fn_append CONFIG_HEADERS " '$ac_optarg'" ++ ac_need_defaults=false;; ++ --he | --h) ++ # Conflict between --help and --header ++ as_fn_error $? "ambiguous option: \`$1' ++Try \`$0 --help' for more information.";; ++ --help | --hel | -h ) ++ $as_echo "$ac_cs_usage"; exit ;; ++ -q | -quiet | --quiet | --quie | --qui | --qu | --q \ ++ | -silent | --silent | --silen | --sile | --sil | --si | --s) ++ ac_cs_silent=: ;; ++ ++ # This is an error. ++ -*) as_fn_error $? "unrecognized option: \`$1' ++Try \`$0 --help' for more information." ;; ++ ++ *) as_fn_append ac_config_targets " $1" ++ ac_need_defaults=false ;; ++ ++ esac ++ shift ++done ++ ++ac_configure_extra_args= ++ ++if $ac_cs_silent; then ++ exec 6>/dev/null ++ ac_configure_extra_args="$ac_configure_extra_args --silent" ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++if \$ac_cs_recheck; then ++ set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion ++ shift ++ \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 ++ CONFIG_SHELL='$SHELL' ++ export CONFIG_SHELL ++ exec "\$@" ++fi ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++exec 5>>config.log ++{ ++ echo ++ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ++## Running $as_me. ## ++_ASBOX ++ $as_echo "$ac_log" ++} >&5 ++ ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++ ++# Handling of arguments. ++for ac_config_target in $ac_config_targets ++do ++ case $ac_config_target in ++ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; ++ "Config/defs.mk") CONFIG_FILES="$CONFIG_FILES Config/defs.mk" ;; ++ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; ++ "Doc/Makefile") CONFIG_FILES="$CONFIG_FILES Doc/Makefile" ;; ++ "Etc/Makefile") CONFIG_FILES="$CONFIG_FILES Etc/Makefile" ;; ++ "Src/Makefile") CONFIG_FILES="$CONFIG_FILES Src/Makefile" ;; ++ "Test/Makefile") CONFIG_FILES="$CONFIG_FILES Test/Makefile" ;; ++ "config.modules") CONFIG_COMMANDS="$CONFIG_COMMANDS config.modules" ;; ++ "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;; ++ ++ *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; ++ esac ++done ++ ++ ++# If the user did not use the arguments to specify the items to instantiate, ++# then the envvar interface is used. Set only those that are not. ++# We use the long form for the default assignment because of an extremely ++# bizarre bug on SunOS 4.1.3. ++if $ac_need_defaults; then ++ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files ++ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers ++ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands ++fi ++ ++# Have a temporary directory for convenience. Make it in the build tree ++# simply because there is no reason against having it here, and in addition, ++# creating and moving files from /tmp can sometimes cause problems. ++# Hook for its removal unless debugging. ++# Note that there is a small window in which the directory will not be cleaned: ++# after its creation but before its name has been assigned to `$tmp'. ++$debug || ++{ ++ tmp= ac_tmp= ++ trap 'exit_status=$? ++ : "${ac_tmp:=$tmp}" ++ { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ++' 0 ++ trap 'as_fn_exit 1' 1 2 13 15 ++} ++# Create a (secure) tmp directory for tmp files. ++ ++{ ++ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && ++ test -d "$tmp" ++} || ++{ ++ tmp=./conf$$-$RANDOM ++ (umask 077 && mkdir "$tmp") ++} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ++ac_tmp=$tmp ++ ++# Set up the scripts for CONFIG_FILES section. ++# No need to generate them if there are no CONFIG_FILES. ++# This happens for instance with `./config.status config.h'. ++if test -n "$CONFIG_FILES"; then ++ ++if $AWK 'BEGIN { getline <"/dev/null" }' /dev/null; then ++ ac_cs_awk_getline=: ++ ac_cs_awk_pipe_init= ++ ac_cs_awk_read_file=' ++ while ((getline aline < (F[key])) > 0) ++ print(aline) ++ close(F[key])' ++ ac_cs_awk_pipe_fini= ++else ++ ac_cs_awk_getline=false ++ ac_cs_awk_pipe_init="print \"cat <<'|#_!!_#|' &&\"" ++ ac_cs_awk_read_file=' ++ print "|#_!!_#|" ++ print "cat " F[key] " &&" ++ '$ac_cs_awk_pipe_init ++ # The final `:' finishes the AND list. ++ ac_cs_awk_pipe_fini='END { print "|#_!!_#|"; print ":" }' ++fi ++ac_cr=`echo X | tr X '\015'` ++# On cygwin, bash can eat \r inside `` if the user requested igncr. ++# But we know of no other shell where ac_cr would be empty at this ++# point, so we can use a bashism as a fallback. ++if test "x$ac_cr" = x; then ++ eval ac_cr=\$\'\\r\' ++fi ++ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` ++if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ++ ac_cs_awk_cr='\\r' ++else ++ ac_cs_awk_cr=$ac_cr ++fi ++ ++echo 'BEGIN {' >"$ac_tmp/subs1.awk" && ++_ACEOF ++ ++# Create commands to substitute file output variables. ++{ ++ echo "cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1" && ++ echo 'cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&' && ++ echo "$ac_subst_files" | sed 's/.*/F["&"]="$&"/' && ++ echo "_ACAWK" && ++ echo "_ACEOF" ++} >conf$$files.sh && ++. ./conf$$files.sh || ++ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++rm -f conf$$files.sh ++ ++{ ++ echo "cat >conf$$subs.awk <<_ACEOF" && ++ echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && ++ echo "_ACEOF" ++} >conf$$subs.sh || ++ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ++ac_delim='%!_!# ' ++for ac_last_try in false false false false false :; do ++ . ./conf$$subs.sh || ++ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ ++ ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` ++ if test $ac_delim_n = $ac_delim_num; then ++ break ++ elif $ac_last_try; then ++ as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++rm -f conf$$subs.sh ++ ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && ++_ACEOF ++sed -n ' ++h ++s/^/S["/; s/!.*/"]=/ ++p ++g ++s/^[^!]*!// ++:repl ++t repl ++s/'"$ac_delim"'$// ++t delim ++:nl ++h ++s/\(.\{148\}\)..*/\1/ ++t more1 ++s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ ++p ++n ++b repl ++:more1 ++s/["\\]/\\&/g; s/^/"/; s/$/"\\/ ++p ++g ++s/.\{148\}// ++t nl ++:delim ++h ++s/\(.\{148\}\)..*/\1/ ++t more2 ++s/["\\]/\\&/g; s/^/"/; s/$/"/ ++p ++b ++:more2 ++s/["\\]/\\&/g; s/^/"/; s/$/"\\/ ++p ++g ++s/.\{148\}// ++t delim ++' >$CONFIG_STATUS || ac_write_fail=1 ++rm -f conf$$subs.awk ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++_ACAWK ++cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && ++ for (key in S) S_is_set[key] = 1 ++ FS = "" ++ \$ac_cs_awk_pipe_init ++} ++{ ++ line = $ 0 ++ nfields = split(line, field, "@") ++ substed = 0 ++ len = length(field[1]) ++ for (i = 2; i < nfields; i++) { ++ key = field[i] ++ keylen = length(key) ++ if (S_is_set[key]) { ++ value = S[key] ++ line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) ++ len += length(value) + length(field[++i]) ++ substed = 1 ++ } else ++ len += 1 + keylen ++ } ++ if (nfields == 3 && !substed) { ++ key = field[2] ++ if (F[key] != "" && line ~ /^[ ]*@.*@[ ]*$/) { ++ \$ac_cs_awk_read_file ++ next ++ } ++ } ++ print line ++} ++\$ac_cs_awk_pipe_fini ++_ACAWK ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then ++ sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" ++else ++ cat ++fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ ++ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 ++_ACEOF ++ ++# VPATH may cause trouble with some makes, so we remove sole $(srcdir), ++# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and ++# trailing colons and then remove the whole line if VPATH becomes empty ++# (actually we leave an empty line to preserve line numbers). ++if test "x$srcdir" = x.; then ++ ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ ++h ++s/// ++s/^/:/ ++s/[ ]*$/:/ ++s/:\$(srcdir):/:/g ++s/:\${srcdir}:/:/g ++s/:@srcdir@:/:/g ++s/^:*// ++s/:*$// ++x ++s/\(=[ ]*\).*/\1/ ++G ++s/\n// ++s/^[^=]*=[ ]*$// ++}' ++fi ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++fi # test -n "$CONFIG_FILES" ++ ++# Set up the scripts for CONFIG_HEADERS section. ++# No need to generate them if there are no CONFIG_HEADERS. ++# This happens for instance with `./config.status Makefile'. ++if test -n "$CONFIG_HEADERS"; then ++cat >"$ac_tmp/defines.awk" <<\_ACAWK || ++BEGIN { ++_ACEOF ++ ++# Transform confdefs.h into an awk script `defines.awk', embedded as ++# here-document in config.status, that substitutes the proper values into ++# config.h.in to produce config.h. ++ ++# Create a delimiter string that does not exist in confdefs.h, to ease ++# handling of long lines. ++ac_delim='%!_!# ' ++for ac_last_try in false false :; do ++ ac_tt=`sed -n "/$ac_delim/p" confdefs.h` ++ if test -z "$ac_tt"; then ++ break ++ elif $ac_last_try; then ++ as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 ++ else ++ ac_delim="$ac_delim!$ac_delim _$ac_delim!! " ++ fi ++done ++ ++# For the awk script, D is an array of macro values keyed by name, ++# likewise P contains macro parameters if any. Preserve backslash ++# newline sequences. ++ ++ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* ++sed -n ' ++s/.\{148\}/&'"$ac_delim"'/g ++t rset ++:rset ++s/^[ ]*#[ ]*define[ ][ ]*/ / ++t def ++d ++:def ++s/\\$// ++t bsnl ++s/["\\]/\\&/g ++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ ++D["\1"]=" \3"/p ++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p ++d ++:bsnl ++s/["\\]/\\&/g ++s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ ++D["\1"]=" \3\\\\\\n"\\/p ++t cont ++s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p ++t cont ++d ++:cont ++n ++s/.\{148\}/&'"$ac_delim"'/g ++t clear ++:clear ++s/\\$// ++t bsnlc ++s/["\\]/\\&/g; s/^/"/; s/$/"/p ++d ++:bsnlc ++s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p ++b cont ++' >$CONFIG_STATUS || ac_write_fail=1 ++ ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ for (key in D) D_is_set[key] = 1 ++ FS = "" ++} ++/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { ++ line = \$ 0 ++ split(line, arg, " ") ++ if (arg[1] == "#") { ++ defundef = arg[2] ++ mac1 = arg[3] ++ } else { ++ defundef = substr(arg[1], 2) ++ mac1 = arg[2] ++ } ++ split(mac1, mac2, "(") #) ++ macro = mac2[1] ++ prefix = substr(line, 1, index(line, defundef) - 1) ++ if (D_is_set[macro]) { ++ # Preserve the white space surrounding the "#". ++ print prefix "define", macro P[macro] D[macro] ++ next ++ } else { ++ # Replace #undef with comments. This is necessary, for example, ++ # in the case of _POSIX_SOURCE, which is predefined and required ++ # on some systems where configure will not decide to define it. ++ if (defundef == "undef") { ++ print "/*", prefix defundef, macro, "*/" ++ next ++ } ++ } ++} ++{ print } ++_ACAWK ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++ as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 ++fi # test -n "$CONFIG_HEADERS" ++ ++ ++eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" ++shift ++for ac_tag ++do ++ case $ac_tag in ++ :[FHLC]) ac_mode=$ac_tag; continue;; ++ esac ++ case $ac_mode$ac_tag in ++ :[FHL]*:*);; ++ :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; ++ :[FH]-) ac_tag=-:-;; ++ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; ++ esac ++ ac_save_IFS=$IFS ++ IFS=: ++ set x $ac_tag ++ IFS=$ac_save_IFS ++ shift ++ ac_file=$1 ++ shift ++ ++ case $ac_mode in ++ :L) ac_source=$1;; ++ :[FH]) ++ ac_file_inputs= ++ for ac_f ++ do ++ case $ac_f in ++ -) ac_f="$ac_tmp/stdin";; ++ *) # Look for the file first in the build tree, then in the source tree ++ # (if the path is not absolute). The absolute path cannot be DOS-style, ++ # because $ac_f cannot contain `:'. ++ test -f "$ac_f" || ++ case $ac_f in ++ [\\/$]*) false;; ++ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; ++ esac || ++ as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; ++ esac ++ case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ++ as_fn_append ac_file_inputs " '$ac_f'" ++ done ++ ++ # Let's still pretend it is `configure' which instantiates (i.e., don't ++ # use $as_me), people would be surprised to read: ++ # /* config.h. Generated by config.status. */ ++ configure_input='Generated from '` ++ $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' ++ `' by configure.' ++ if test x"$ac_file" != x-; then ++ configure_input="$ac_file. $configure_input" ++ { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 ++$as_echo "$as_me: creating $ac_file" >&6;} ++ fi ++ # Neutralize special characters interpreted by sed in replacement strings. ++ case $configure_input in #( ++ *\&* | *\|* | *\\* ) ++ ac_sed_conf_input=`$as_echo "$configure_input" | ++ sed 's/[\\\\&|]/\\\\&/g'`;; #( ++ *) ac_sed_conf_input=$configure_input;; ++ esac ++ ++ case $ac_tag in ++ *:-:* | *:-) cat >"$ac_tmp/stdin" \ ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; ++ esac ++ ;; ++ esac ++ ++ ac_dir=`$as_dirname -- "$ac_file" || ++$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ++ X"$ac_file" : 'X\(//\)[^/]' \| \ ++ X"$ac_file" : 'X\(//\)$' \| \ ++ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || ++$as_echo X"$ac_file" | ++ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)[^/].*/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\/\)$/{ ++ s//\1/ ++ q ++ } ++ /^X\(\/\).*/{ ++ s//\1/ ++ q ++ } ++ s/.*/./; q'` ++ as_dir="$ac_dir"; as_fn_mkdir_p ++ ac_builddir=. ++ ++case "$ac_dir" in ++.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; ++*) ++ ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` ++ # A ".." for each directory in $ac_dir_suffix. ++ ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` ++ case $ac_top_builddir_sub in ++ "") ac_top_builddir_sub=. ac_top_build_prefix= ;; ++ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; ++ esac ;; ++esac ++ac_abs_top_builddir=$ac_pwd ++ac_abs_builddir=$ac_pwd$ac_dir_suffix ++# for backward compatibility: ++ac_top_builddir=$ac_top_build_prefix ++ ++case $srcdir in ++ .) # We are building in place. ++ ac_srcdir=. ++ ac_top_srcdir=$ac_top_builddir_sub ++ ac_abs_top_srcdir=$ac_pwd ;; ++ [\\/]* | ?:[\\/]* ) # Absolute name. ++ ac_srcdir=$srcdir$ac_dir_suffix; ++ ac_top_srcdir=$srcdir ++ ac_abs_top_srcdir=$srcdir ;; ++ *) # Relative name. ++ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ++ ac_top_srcdir=$ac_top_build_prefix$srcdir ++ ac_abs_top_srcdir=$ac_pwd/$srcdir ;; ++esac ++ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix ++ ++ ++ case $ac_mode in ++ :F) ++ # ++ # CONFIG_FILE ++ # ++ ++ case $INSTALL in ++ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; ++ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; ++ esac ++_ACEOF ++ ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++# If the template does not know about datarootdir, expand it. ++# FIXME: This hack should be removed a few years after 2.60. ++ac_datarootdir_hack=; ac_datarootdir_seen= ++ac_sed_dataroot=' ++/datarootdir/ { ++ p ++ q ++} ++/@datadir@/p ++/@docdir@/p ++/@infodir@/p ++/@localedir@/p ++/@mandir@/p' ++case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in ++*datarootdir*) ac_datarootdir_seen=yes;; ++*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 ++$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} ++_ACEOF ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ ac_datarootdir_hack=' ++ s&@datadir@&$datadir&g ++ s&@docdir@&$docdir&g ++ s&@infodir@&$infodir&g ++ s&@localedir@&$localedir&g ++ s&@mandir@&$mandir&g ++ s&\\\${datarootdir}&$datarootdir&g' ;; ++esac ++_ACEOF ++ ++# Neutralize VPATH when `$srcdir' = `.'. ++# Shell code in configure.ac might set extrasub. ++# FIXME: do we really want to maintain this feature? ++cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ++ac_sed_extra="$ac_vpsub ++$extrasub ++_ACEOF ++cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ++:t ++/@[a-zA-Z_][a-zA-Z_0-9]*@/!b ++s|@configure_input@|$ac_sed_conf_input|;t t ++s&@top_builddir@&$ac_top_builddir_sub&;t t ++s&@top_build_prefix@&$ac_top_build_prefix&;t t ++s&@srcdir@&$ac_srcdir&;t t ++s&@abs_srcdir@&$ac_abs_srcdir&;t t ++s&@top_srcdir@&$ac_top_srcdir&;t t ++s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t ++s&@builddir@&$ac_builddir&;t t ++s&@abs_builddir@&$ac_abs_builddir&;t t ++s&@abs_top_builddir@&$ac_abs_top_builddir&;t t ++s&@INSTALL@&$ac_INSTALL&;t t ++$ac_datarootdir_hack ++" ++eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | ++if $ac_cs_awk_getline; then ++ $AWK -f "$ac_tmp/subs.awk" ++else ++ $AWK -f "$ac_tmp/subs.awk" | $SHELL ++fi \ ++ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ ++test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && ++ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && ++ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ ++ "$ac_tmp/out"`; test -z "$ac_out"; } && ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++which seems to be undefined. Please make sure it is defined" >&5 ++$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' ++which seems to be undefined. Please make sure it is defined" >&2;} ++ ++ rm -f "$ac_tmp/stdin" ++ case $ac_file in ++ -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; ++ *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; ++ esac \ ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ ;; ++ :H) ++ # ++ # CONFIG_HEADER ++ # ++ if test x"$ac_file" != x-; then ++ { ++ $as_echo "/* $configure_input */" \ ++ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" ++ } >"$ac_tmp/config.h" \ ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 ++$as_echo "$as_me: $ac_file is unchanged" >&6;} ++ else ++ rm -f "$ac_file" ++ mv "$ac_tmp/config.h" "$ac_file" \ ++ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ++ fi ++ else ++ $as_echo "/* $configure_input */" \ ++ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ ++ || as_fn_error $? "could not create -" "$LINENO" 5 ++ fi ++ ;; ++ ++ :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 ++$as_echo "$as_me: executing $ac_file commands" >&6;} ++ ;; ++ esac ++ ++ ++ case $ac_file$ac_mode in ++ "config.modules":C) . ./config.modules.sh ;; ++ "stamp-h":C) echo >stamp-h ;; ++ ++ esac ++done # for ac_tag ++ ++ ++as_fn_exit 0 ++_ACEOF ++ac_clean_files=$ac_clean_files_save ++ ++test $ac_write_fail = 0 || ++ as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 ++ ++ ++# configure is writing to config.log, and then calls config.status. ++# config.status does its own redirection, appending to config.log. ++# Unfortunately, on DOS this fails, as config.log is still kept open ++# by configure, so config.status won't be able to write to it; its ++# output is simply discarded. So we exec the FD to /dev/null, ++# effectively closing config.log, so it can be properly (re)opened and ++# appended to by config.status. When coming back to configure, we ++# need to make the FD available again. ++if test "$no_create" != yes; then ++ ac_cs_success=: ++ ac_config_status_args= ++ test "$silent" = yes && ++ ac_config_status_args="$ac_config_status_args --quiet" ++ exec 5>/dev/null ++ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false ++ exec 5>>config.log ++ # Use ||, not &&, to avoid exiting from the if with $? = 1, which ++ # would make configure fail if this is the last instruction. ++ $ac_cs_success || as_fn_exit 1 ++fi ++if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then ++ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 ++$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} ++fi ++ ++ ++eval "zshbin1=${bindir}" ++eval "zshbin2=${zshbin1}" ++eval "zshman=${mandir}" ++eval "zshinfo=${infodir}" ++eval "zshfndir=${fndir}" ++ ++echo " ++zsh configuration ++----------------- ++zsh version : ${VERSION} ++host operating system : ${host_cpu}-${host_vendor}-${host_os} ++source code location : ${srcdir} ++compiler : ${CC} ++preprocessor flags : ${CPPFLAGS} ++executable compiler flags : ${CFLAGS}" ++if test "x$dynamic" = xyes; then ++ echo "\ ++module compiler flags : ${CFLAGS} ${DLCFLAGS}" ++fi ++echo "\ ++executable linker flags : ${LDFLAGS} ${EXELDFLAGS} ${EXTRA_LDFLAGS}" ++if test "x$dynamic" = xyes; then ++ echo "\ ++module linker flags : ${LDFLAGS} ${LIBLDFLAGS} ${DLLDFLAGS}" ++fi ++echo "\ ++library flags : ${LIBS} ++installation basename : ${tzsh_name} ++binary install path : ${zshbin2} ++man page install path : ${zshman} ++info install path : ${zshinfo}" ++if test "$zshfndir" != no; then ++ echo "functions install path : ${zshfndir}" ++fi ++if test "x$additionalfpath" != x; then ++ echo "additional fpath entries : ${additionalfpath}" ++fi ++echo "See config.modules for installed modules and functions. ++" ++ ++case x$LIBS in ++ *-lgdbm*) ++ echo "WARNING: zsh will be linked against libgdbm. ++This means the binary is covered by the GNU General Public License. ++This does not affect the source code. ++Run configure with --disable-gdbm if required." ++ ;; ++esac ++ ++exit 0 +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/config.h.in +@@ -0,0 +1,1162 @@ ++/* config.h.in. Generated from configure.ac by autoheader. */ ++ ++/***** begin user configuration section *****/ ++ ++/* Define this to be the location of your password file */ ++#define PASSWD_FILE "/etc/passwd" ++ ++/* Define this to be the name of your NIS/YP password * ++ * map (if applicable) */ ++#define PASSWD_MAP "passwd.byname" ++ ++/* Define to 1 if you want user names to be cached */ ++#define CACHE_USERNAMES 1 ++ ++/* Define to 1 if system supports job control */ ++#define JOB_CONTROL 1 ++ ++/* Define this if you use "suspended" instead of "stopped" */ ++#define USE_SUSPENDED 1 ++ ++/* The default history buffer size in lines */ ++#define DEFAULT_HISTSIZE 30 ++ ++/* The default editor for the fc builtin */ ++#define DEFAULT_FCEDIT "vi" ++ ++/* The default prefix for temporary files */ ++#define DEFAULT_TMPPREFIX "/tmp/zsh" ++ ++/***** end of user configuration section *****/ ++/***** shouldn't have to change anything below here *****/ ++ ++ ++ ++/* Define to 1 if you want to use dynamically loaded modules on AIX. */ ++#undef AIXDYNAMIC ++ ++/* Define to 1 if kill(pid, 0) doesn't return ESRCH, ie BeOS R4.51. */ ++#undef BROKEN_KILL_ESRCH ++ ++/* Define to 1 if sigsuspend() is broken */ ++#undef BROKEN_POSIX_SIGSUSPEND ++ ++/* Define to 1 if compiler incorrectly cast signed to unsigned. */ ++#undef BROKEN_SIGNED_TO_UNSIGNED_CASTING ++ ++/* Define to 1 if tcsetpgrp() doesn't work, ie BeOS R4.51. */ ++#undef BROKEN_TCSETPGRP ++ ++/* Define to 1 if the wcwidth() function is present but broken. */ ++#undef BROKEN_WCWIDTH ++ ++/* Define to 1 if you use BSD style signal handling (and can block signals). ++ */ ++#undef BSD_SIGNALS ++ ++/* Undefine if you don't want local features. By default this is defined. */ ++#undef CONFIG_LOCALE ++ ++/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP ++ systems. This function is required for `alloca.c' support on those systems. ++ */ ++#undef CRAY_STACKSEG_END ++ ++/* Define to a custom value for the ZSH_PATCHLEVEL parameter */ ++#undef CUSTOM_PATCHLEVEL ++ ++/* Define to 1 if using `alloca.c'. */ ++#undef C_ALLOCA ++ ++/* Define to 1 if you want to debug zsh. */ ++#undef DEBUG ++ ++/* The default path; used when running commands with command -p */ ++#undef DEFAULT_PATH ++ ++/* Define default pager used by readnullcmd */ ++#undef DEFAULT_READNULLCMD ++ ++/* Define to 1 if you want to avoid calling functions that will require ++ dynamic NSS modules. */ ++#undef DISABLE_DYNAMIC_NSS ++ ++/* Define to 1 if an underscore has to be prepended to dlsym() argument. */ ++#undef DLSYM_NEEDS_UNDERSCORE ++ ++/* The extension used for dynamically loaded modules. */ ++#undef DL_EXT ++ ++/* Define to 1 if you want to use dynamically loaded modules. */ ++#undef DYNAMIC ++ ++/* Define to 1 if multiple modules defining the same symbol are OK. */ ++#undef DYNAMIC_NAME_CLASH_OK ++ ++/* Define to 1 if getcwd() calls malloc to allocate memory. */ ++#undef GETCWD_CALLS_MALLOC ++ ++/* Define to 1 if the `getpgrp' function requires zero arguments. */ ++#undef GETPGRP_VOID ++ ++/* Define to 1 if getpwnam() is faked, ie BeOS R4.51. */ ++#undef GETPWNAM_FAKED ++ ++/* The global file to source whenever zsh is run as a login shell; if ++ undefined, don't source anything */ ++#undef GLOBAL_ZLOGIN ++ ++/* The global file to source whenever zsh was run as a login shell. This is ++ sourced right before exiting. If undefined, don't source anything. */ ++#undef GLOBAL_ZLOGOUT ++ ++/* The global file to source whenever zsh is run as a login shell, before ++ zshrc is read; if undefined, don't source anything. */ ++#undef GLOBAL_ZPROFILE ++ ++/* The global file to source absolutely first whenever zsh is run; if ++ undefined, don't source anything. */ ++#undef GLOBAL_ZSHENV ++ ++/* The global file to source whenever zsh is run; if undefined, don't source ++ anything */ ++#undef GLOBAL_ZSHRC ++ ++/* Define if TIOCGWINSZ is defined in sys/ioctl.h but not in termios.h. */ ++#undef GWINSZ_IN_SYS_IOCTL ++ ++/* Define to 1 if you have `alloca', as a function or macro. */ ++#undef HAVE_ALLOCA ++ ++/* Define to 1 if you have and it should be used (not on Ultrix). ++ */ ++#undef HAVE_ALLOCA_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_BIND_NETDB_H ++ ++/* Define if you have the termcap boolcodes symbol. */ ++#undef HAVE_BOOLCODES ++ ++/* Define if you have the terminfo boolnames symbol. */ ++#undef HAVE_BOOLNAMES ++ ++/* Define to 1 if you have the `brk' function. */ ++#undef HAVE_BRK ++ ++/* Define to 1 if there is a prototype defined for brk() on your system. */ ++#undef HAVE_BRK_PROTO ++ ++/* Define to 1 if you have the `canonicalize_file_name' function. */ ++#undef HAVE_CANONICALIZE_FILE_NAME ++ ++/* Define to 1 if you have the `cap_get_proc' function. */ ++#undef HAVE_CAP_GET_PROC ++ ++/* Define to 1 if you have the `clock_gettime' function. */ ++#undef HAVE_CLOCK_GETTIME ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_CURSES_H ++ ++/* Define to 1 if you have the `difftime' function. */ ++#undef HAVE_DIFFTIME ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++#undef HAVE_DIRENT_H ++ ++/* Define to 1 if you have the `dlclose' function. */ ++#undef HAVE_DLCLOSE ++ ++/* Define to 1 if you have the `dlerror' function. */ ++#undef HAVE_DLERROR ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_DLFCN_H ++ ++/* Define to 1 if you have the `dlopen' function. */ ++#undef HAVE_DLOPEN ++ ++/* Define to 1 if you have the `dlsym' function. */ ++#undef HAVE_DLSYM ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_DL_H ++ ++/* Define to 1 if you have the `erand48' function. */ ++#undef HAVE_ERAND48 ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ERRNO_H ++ ++/* Define to 1 if you have the `faccessx' function. */ ++#undef HAVE_FACCESSX ++ ++/* Define to 1 if you have the `fchdir' function. */ ++#undef HAVE_FCHDIR ++ ++/* Define to 1 if you have the `fchmod' function. */ ++#undef HAVE_FCHMOD ++ ++/* Define to 1 if you have the `fchown' function. */ ++#undef HAVE_FCHOWN ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_FCNTL_H ++ ++/* Define to 1 if system has working FIFOs. */ ++#undef HAVE_FIFOS ++ ++/* Define to 1 if you have the `fseeko' function. */ ++#undef HAVE_FSEEKO ++ ++/* Define to 1 if you have the `fstat' function. */ ++#undef HAVE_FSTAT ++ ++/* Define to 1 if you have the `ftello' function. */ ++#undef HAVE_FTELLO ++ ++/* Define to 1 if you have the `ftruncate' function. */ ++#undef HAVE_FTRUNCATE ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_GDBM_H ++ ++/* Define to 1 if you have the `gdbm_open' function. */ ++#undef HAVE_GDBM_OPEN ++ ++/* Define to 1 if you have the `getcchar' function. */ ++#undef HAVE_GETCCHAR ++ ++/* Define to 1 if you have the `getcwd' function. */ ++#undef HAVE_GETCWD ++ ++/* Define to 1 if you have the `getenv' function. */ ++#undef HAVE_GETENV ++ ++/* Define to 1 if you have the `getgrgid' function. */ ++#undef HAVE_GETGRGID ++ ++/* Define to 1 if you have the `getgrnam' function. */ ++#undef HAVE_GETGRNAM ++ ++/* Define to 1 if you have the `gethostbyname2' function. */ ++#undef HAVE_GETHOSTBYNAME2 ++ ++/* Define to 1 if you have the `gethostname' function. */ ++#undef HAVE_GETHOSTNAME ++ ++/* Define to 1 if you have the `getipnodebyname' function. */ ++#undef HAVE_GETIPNODEBYNAME ++ ++/* Define to 1 if you have the `getlogin' function. */ ++#undef HAVE_GETLOGIN ++ ++/* Define to 1 if you have the `getpagesize' function. */ ++#undef HAVE_GETPAGESIZE ++ ++/* Define to 1 if you have the `getpwent' function. */ ++#undef HAVE_GETPWENT ++ ++/* Define to 1 if you have the `getpwnam' function. */ ++#undef HAVE_GETPWNAM ++ ++/* Define to 1 if you have the `getpwuid' function. */ ++#undef HAVE_GETPWUID ++ ++/* Define to 1 if you have the `getrlimit' function. */ ++#undef HAVE_GETRLIMIT ++ ++/* Define to 1 if you have the `getrusage' function. */ ++#undef HAVE_GETRUSAGE ++ ++/* Define to 1 if you have the `gettimeofday' function. */ ++#undef HAVE_GETTIMEOFDAY ++ ++/* Define to 1 if you have the `getxattr' function. */ ++#undef HAVE_GETXATTR ++ ++/* Define to 1 if you have the `grantpt' function. */ ++#undef HAVE_GRANTPT ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_GRP_H ++ ++/* Define to 1 if you have the `htons' function. */ ++#undef HAVE_HTONS ++ ++/* Define to 1 if you have the `iconv' function. */ ++#undef HAVE_ICONV ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_ICONV_H ++ ++/* Define to 1 if you have the `inet_aton' function. */ ++#undef HAVE_INET_ATON ++ ++/* Define to 1 if you have the `inet_ntop' function. */ ++#undef HAVE_INET_NTOP ++ ++/* Define to 1 if you have the `inet_pton' function. */ ++#undef HAVE_INET_PTON ++ ++/* Define to 1 if you have the `initgroups' function. */ ++#undef HAVE_INITGROUPS ++ ++/* Define to 1 if you have the `initscr' function. */ ++#undef HAVE_INITSCR ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_INTTYPES_H ++ ++/* Define to 1 if there is a prototype defined for ioctl() on your system. */ ++#undef HAVE_IOCTL_PROTO ++ ++/* Define to 1 if you have the `killpg' function. */ ++#undef HAVE_KILLPG ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_LANGINFO_H ++ ++/* Define to 1 if you have the `lchown' function. */ ++#undef HAVE_LCHOWN ++ ++/* Define to 1 if you have the `cap' library (-lcap). */ ++#undef HAVE_LIBCAP ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_LIBC_H ++ ++/* Define to 1 if you have the `dl' library (-ldl). */ ++#undef HAVE_LIBDL ++ ++/* Define to 1 if you have the `gdbm' library (-lgdbm). */ ++#undef HAVE_LIBGDBM ++ ++/* Define to 1 if you have the `m' library (-lm). */ ++#undef HAVE_LIBM ++ ++/* Define to 1 if you have the `rt' library (-lrt). */ ++#undef HAVE_LIBRT ++ ++/* Define to 1 if you have the `socket' library (-lsocket). */ ++#undef HAVE_LIBSOCKET ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_LIMITS_H ++ ++/* Define to 1 if system has working link(). */ ++#undef HAVE_LINK ++ ++/* Define to 1 if you have the `load' function. */ ++#undef HAVE_LOAD ++ ++/* Define to 1 if you have the `loadbind' function. */ ++#undef HAVE_LOADBIND ++ ++/* Define to 1 if you have the `loadquery' function. */ ++#undef HAVE_LOADQUERY ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_LOCALE_H ++ ++/* Define to 1 if you have the `lstat' function. */ ++#undef HAVE_LSTAT ++ ++/* Define to 1 if you have the `memcpy' function. */ ++#undef HAVE_MEMCPY ++ ++/* Define to 1 if you have the `memmove' function. */ ++#undef HAVE_MEMMOVE ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_MEMORY_H ++ ++/* Define to 1 if you have the `mkfifo' function. */ ++#undef HAVE_MKFIFO ++ ++/* Define to 1 if there is a prototype defined for mknod() on your system. */ ++#undef HAVE_MKNOD_PROTO ++ ++/* Define to 1 if you have the `mkstemp' function. */ ++#undef HAVE_MKSTEMP ++ ++/* Define to 1 if you have the `mktime' function. */ ++#undef HAVE_MKTIME ++ ++/* Define to 1 if you have a working `mmap' system call. */ ++#undef HAVE_MMAP ++ ++/* Define to 1 if you have the `msync' function. */ ++#undef HAVE_MSYNC ++ ++/* Define to 1 if you have the `munmap' function. */ ++#undef HAVE_MUNMAP ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NCURSESW_NCURSES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NCURSESW_TERM_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NCURSES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NCURSES_NCURSES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NCURSES_TERM_H ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. */ ++#undef HAVE_NDIR_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_NETINET_IN_SYSTM_H ++ ++/* Define to 1 if you have the `nice' function. */ ++#undef HAVE_NICE ++ ++/* Define to 1 if you have NIS. */ ++#undef HAVE_NIS ++ ++/* Define to 1 if you have the `nis_list' function. */ ++#undef HAVE_NIS_LIST ++ ++/* Define to 1 if you have NISPLUS. */ ++#undef HAVE_NIS_PLUS ++ ++/* Define to 1 if you have the `nl_langinfo' function. */ ++#undef HAVE_NL_LANGINFO ++ ++/* Define to 1 if you have the `ntohs' function. */ ++#undef HAVE_NTOHS ++ ++/* Define if you have the termcap numcodes symbol. */ ++#undef HAVE_NUMCODES ++ ++/* Define if you have the terminfo numnames symbol. */ ++#undef HAVE_NUMNAMES ++ ++/* Define to 1 if you have the `open_memstream' function. */ ++#undef HAVE_OPEN_MEMSTREAM ++ ++/* Define to 1 if your termcap library has the ospeed variable */ ++#undef HAVE_OSPEED ++ ++/* Define to 1 if you have the `pathconf' function. */ ++#undef HAVE_PATHCONF ++ ++/* Define to 1 if you have the `pcre_compile' function. */ ++#undef HAVE_PCRE_COMPILE ++ ++/* Define to 1 if you have the `pcre_exec' function. */ ++#undef HAVE_PCRE_EXEC ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_PCRE_H ++ ++/* Define to 1 if you have the `pcre_study' function. */ ++#undef HAVE_PCRE_STUDY ++ ++/* Define to 1 if you have the `poll' function. */ ++#undef HAVE_POLL ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_POLL_H ++ ++/* Define to 1 if you have the `ptsname' function. */ ++#undef HAVE_PTSNAME ++ ++/* Define to 1 if you have the `putenv' function. */ ++#undef HAVE_PUTENV ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_PWD_H ++ ++/* Define to 1 if you have the `readlink' function. */ ++#undef HAVE_READLINK ++ ++/* Define to 1 if you have the `realpath' function. */ ++#undef HAVE_REALPATH ++ ++/* Define to 1 if you have the `regcomp' function. */ ++#undef HAVE_REGCOMP ++ ++/* Define to 1 if you have the `regerror' function. */ ++#undef HAVE_REGERROR ++ ++/* Define to 1 if you have the `regexec' function. */ ++#undef HAVE_REGEXEC ++ ++/* Define to 1 if you have the `regfree' function. */ ++#undef HAVE_REGFREE ++ ++/* Define to 1 if RLIMIT_AIO_MEM is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_AIO_MEM ++ ++/* Define to 1 if RLIMIT_AIO_OPS is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_AIO_OPS ++ ++/* Define to 1 if RLIMIT_AS is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_AS ++ ++/* Define to 1 if RLIMIT_LOCKS is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_LOCKS ++ ++/* Define to 1 if RLIMIT_MEMLOCK is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_MEMLOCK ++ ++/* Define to 1 if RLIMIT_MSGQUEUE is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_MSGQUEUE ++ ++/* Define to 1 if RLIMIT_NICE is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_NICE ++ ++/* Define to 1 if RLIMIT_NOFILE is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_NOFILE ++ ++/* Define to 1 if RLIMIT_NPROC is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_NPROC ++ ++/* Define to 1 if RLIMIT_PTHREAD is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_PTHREAD ++ ++/* Define to 1 if RLIMIT_RSS is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_RSS ++ ++/* Define to 1 if RLIMIT_RTPRIO is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_RTPRIO ++ ++/* Define to 1 if RLIMIT_SBSIZE is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_SBSIZE ++ ++/* Define to 1 if RLIMIT_SIGPENDING is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_SIGPENDING ++ ++/* Define to 1 if RLIMIT_TCACHE is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_TCACHE ++ ++/* Define to 1 if RLIMIT_VMEM is present (whether or not as a macro). */ ++#undef HAVE_RLIMIT_VMEM ++ ++/* Define to 1 if you have the `sbrk' function. */ ++#undef HAVE_SBRK ++ ++/* Define to 1 if there is a prototype defined for sbrk() on your system. */ ++#undef HAVE_SBRK_PROTO ++ ++/* Define to 1 if you have the `select' function. */ ++#undef HAVE_SELECT ++ ++/* Define to 1 if you have the `setcchar' function. */ ++#undef HAVE_SETCCHAR ++ ++/* Define to 1 if you have the `setenv' function. */ ++#undef HAVE_SETENV ++ ++/* Define to 1 if you have the `seteuid' function. */ ++#undef HAVE_SETEUID ++ ++/* Define to 1 if you have the `setlocale' function. */ ++#undef HAVE_SETLOCALE ++ ++/* Define to 1 if you have the `setpgid' function. */ ++#undef HAVE_SETPGID ++ ++/* Define to 1 if you have the `setpgrp' function. */ ++#undef HAVE_SETPGRP ++ ++/* Define to 1 if the system supports `setproctitle' to change process name */ ++#undef HAVE_SETPROCTITLE ++ ++/* Define to 1 if you have the `setresuid' function. */ ++#undef HAVE_SETRESUID ++ ++/* Define to 1 if you have the `setreuid' function. */ ++#undef HAVE_SETREUID ++ ++/* Define to 1 if you have the `setsid' function. */ ++#undef HAVE_SETSID ++ ++/* Define to 1 if you have the `setuid' function. */ ++#undef HAVE_SETUID ++ ++/* Define to 1 if you have the `setupterm' function. */ ++#undef HAVE_SETUPTERM ++ ++/* Define to 1 if you have the `shl_findsym' function. */ ++#undef HAVE_SHL_FINDSYM ++ ++/* Define to 1 if you have the `shl_load' function. */ ++#undef HAVE_SHL_LOAD ++ ++/* Define to 1 if you have the `shl_unload' function. */ ++#undef HAVE_SHL_UNLOAD ++ ++/* Define to 1 if you have the `sigaction' function. */ ++#undef HAVE_SIGACTION ++ ++/* Define to 1 if you have the `sigblock' function. */ ++#undef HAVE_SIGBLOCK ++ ++/* Define to 1 if you have the `sighold' function. */ ++#undef HAVE_SIGHOLD ++ ++/* Define to 1 if you have the `signgam' function. */ ++#undef HAVE_SIGNGAM ++ ++/* Define to 1 if you have the `sigprocmask' function. */ ++#undef HAVE_SIGPROCMASK ++ ++/* Define to 1 if you have the `sigrelse' function. */ ++#undef HAVE_SIGRELSE ++ ++/* Define to 1 if you have the `sigsetmask' function. */ ++#undef HAVE_SIGSETMASK ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDARG_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDDEF_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDINT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDIO_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STDLIB_H ++ ++/* Define if you have the termcap strcodes symbol. */ ++#undef HAVE_STRCODES ++ ++/* Define to 1 if you have the `strcoll' function and it is properly defined. ++ */ ++#undef HAVE_STRCOLL ++ ++/* Define to 1 if you have the `strerror' function. */ ++#undef HAVE_STRERROR ++ ++/* Define to 1 if you have the `strftime' function. */ ++#undef HAVE_STRFTIME ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STRINGS_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_STRING_H ++ ++/* Define if you have the terminfo strnames symbol. */ ++#undef HAVE_STRNAMES ++ ++/* Define to 1 if you have the `strptime' function. */ ++#undef HAVE_STRPTIME ++ ++/* Define to 1 if you have the `strstr' function. */ ++#undef HAVE_STRSTR ++ ++/* Define to 1 if you have the `strtoul' function. */ ++#undef HAVE_STRTOUL ++ ++/* Define if your system's struct direct has a member named d_ino. */ ++#undef HAVE_STRUCT_DIRECT_D_INO ++ ++/* Define if your system's struct direct has a member named d_stat. */ ++#undef HAVE_STRUCT_DIRECT_D_STAT ++ ++/* Define if your system's struct dirent has a member named d_ino. */ ++#undef HAVE_STRUCT_DIRENT_D_INO ++ ++/* Define if your system's struct dirent has a member named d_stat. */ ++#undef HAVE_STRUCT_DIRENT_D_STAT ++ ++/* Define to 1 if `ru_idrss' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_IDRSS ++ ++/* Define to 1 if `ru_inblock' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_INBLOCK ++ ++/* Define to 1 if `ru_isrss' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_ISRSS ++ ++/* Define to 1 if `ru_ixrss' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_IXRSS ++ ++/* Define to 1 if `ru_majflt' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_MAJFLT ++ ++/* Define to 1 if `ru_maxrss' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_MAXRSS ++ ++/* Define to 1 if `ru_minflt' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_MINFLT ++ ++/* Define to 1 if `ru_msgrcv' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_MSGRCV ++ ++/* Define to 1 if `ru_msgsnd' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_MSGSND ++ ++/* Define to 1 if `ru_nivcsw' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_NIVCSW ++ ++/* Define to 1 if `ru_nsignals' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_NSIGNALS ++ ++/* Define to 1 if `ru_nswap' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_NSWAP ++ ++/* Define to 1 if `ru_nvcsw' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_NVCSW ++ ++/* Define to 1 if `ru_oublock' is a member of `struct rusage'. */ ++#undef HAVE_STRUCT_RUSAGE_RU_OUBLOCK ++ ++/* Define if your system's struct sockaddr_in6 has a member named ++ sin6_scope_id. */ ++#undef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID ++ ++/* Define to 1 if `st_atimensec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_ATIMENSEC ++ ++/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC ++ ++/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC ++ ++/* Define to 1 if `st_ctimensec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_CTIMENSEC ++ ++/* Define to 1 if `st_ctimespec.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC ++ ++/* Define to 1 if `st_ctim.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC ++ ++/* Define to 1 if `st_mtimensec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_MTIMENSEC ++ ++/* Define to 1 if `st_mtimespec.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC ++ ++/* Define to 1 if `st_mtim.tv_nsec' is a member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC ++ ++/* Define to 1 if struct timezone is defined by a system header */ ++#undef HAVE_STRUCT_TIMEZONE ++ ++/* Define to 1 if struct utmp is defined by a system header */ ++#undef HAVE_STRUCT_UTMP ++ ++/* Define to 1 if struct utmpx is defined by a system header */ ++#undef HAVE_STRUCT_UTMPX ++ ++/* Define if your system's struct utmpx has a member named ut_host. */ ++#undef HAVE_STRUCT_UTMPX_UT_HOST ++ ++/* Define if your system's struct utmpx has a member named ut_tv. */ ++#undef HAVE_STRUCT_UTMPX_UT_TV ++ ++/* Define if your system's struct utmpx has a member named ut_xtime. */ ++#undef HAVE_STRUCT_UTMPX_UT_XTIME ++ ++/* Define if your system's struct utmp has a member named ut_host. */ ++#undef HAVE_STRUCT_UTMP_UT_HOST ++ ++/* Define to 1 if you have RFS superroot directory. */ ++#undef HAVE_SUPERROOT ++ ++/* Define to 1 if you have the `symlink' function. */ ++#undef HAVE_SYMLINK ++ ++/* Define to 1 if you have the `sysconf' function. */ ++#undef HAVE_SYSCONF ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_CAPABILITY_H ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++#undef HAVE_SYS_DIR_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_FILIO_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_MMAN_H ++ ++/* Define to 1 if you have the header file, and it defines `DIR'. ++ */ ++#undef HAVE_SYS_NDIR_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_PARAM_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_RESOURCE_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_SELECT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_STAT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_STROPTS_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_TIMES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_TIME_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_TYPES_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_UTSNAME_H ++ ++/* Define to 1 if you have that is POSIX.1 compatible. */ ++#undef HAVE_SYS_WAIT_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SYS_XATTR_H ++ ++/* Define to 1 if you have the `tcgetattr' function. */ ++#undef HAVE_TCGETATTR ++ ++/* Define to 1 if you have the `tcsetpgrp' function. */ ++#undef HAVE_TCSETPGRP ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_TERMCAP_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_TERMIOS_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_TERMIO_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_TERM_H ++ ++/* Define to 1 if you have the `tgetent' function. */ ++#undef HAVE_TGETENT ++ ++/* Define to 1 if you have the `tigetflag' function. */ ++#undef HAVE_TIGETFLAG ++ ++/* Define to 1 if you have the `tigetnum' function. */ ++#undef HAVE_TIGETNUM ++ ++/* Define to 1 if you have the `tigetstr' function. */ ++#undef HAVE_TIGETSTR ++ ++/* Define to 1 if you have the `timelocal' function. */ ++#undef HAVE_TIMELOCAL ++ ++/* Define to 1 if you have the `uname' function. */ ++#undef HAVE_UNAME ++ ++/* Define to 1 if the compiler can initialise a union. */ ++#undef HAVE_UNION_INIT ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UNISTD_H ++ ++/* Define to 1 if you have the `unload' function. */ ++#undef HAVE_UNLOAD ++ ++/* Define to 1 if you have the `unlockpt' function. */ ++#undef HAVE_UNLOCKPT ++ ++/* Define to 1 if you have the `unsetenv' function. */ ++#undef HAVE_UNSETENV ++ ++/* Define to 1 if you have the `use_default_colors' function. */ ++#undef HAVE_USE_DEFAULT_COLORS ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UTMPX_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_UTMP_H ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_VARARGS_H ++ ++/* Define to 1 if compiler supports variable-length arrays */ ++#undef HAVE_VARIABLE_LENGTH_ARRAYS ++ ++/* Define to 1 if you have the `waddwstr' function. */ ++#undef HAVE_WADDWSTR ++ ++/* Define to 1 if you have the `wait3' function. */ ++#undef HAVE_WAIT3 ++ ++/* Define to 1 if you have the `waitpid' function. */ ++#undef HAVE_WAITPID ++ ++/* Define to 1 if you have the header file. */ ++#undef HAVE_WCHAR_H ++ ++/* Define to 1 if you have the `wctomb' function. */ ++#undef HAVE_WCTOMB ++ ++/* Define to 1 if you have the `wget_wch' function. */ ++#undef HAVE_WGET_WCH ++ ++/* Define to 1 if you have the `win_wch' function. */ ++#undef HAVE_WIN_WCH ++ ++/* Define to 1 if you have the `xw' function. */ ++#undef HAVE_XW ++ ++/* Define to 1 if you have the `_mktemp' function. */ ++#undef HAVE__MKTEMP ++ ++/* Define to 1 if you want to use dynamically loaded modules on HPUX 10. */ ++#undef HPUX10DYNAMIC ++ ++/* Define as const if the declaration of iconv() needs const. */ ++#undef ICONV_CONST ++ ++/* Define to 1 if iconv() is linked from libiconv */ ++#undef ICONV_FROM_LIBICONV ++ ++/* Define to 1 if ino_t is 64 bit (for large file support). */ ++#undef INO_T_IS_64_BIT ++ ++/* Define to 1 if we must include to get a prototype for ++ ioctl(). */ ++#undef IOCTL_IN_SYS_IOCTL ++ ++/* Define to 1 if musl is being used as the C library */ ++#undef LIBC_MUSL ++ ++/* Definitions used when a long is less than eight byte, to try to provide ++ some support for eight byte operations. Note that ZSH_64_BIT_TYPE, ++ OFF_T_IS_64_BIT, INO_T_IS_64_BIT do *not* get defined if long is already 64 ++ bits, since in that case no special handling is required. Define to 1 if ++ long is 64 bits */ ++#undef LONG_IS_64_BIT ++ ++/* Define to be the machine type (microprocessor class or machine model). */ ++#undef MACHTYPE ++ ++/* Define for Maildir support */ ++#undef MAILDIR_SUPPORT ++ ++/* Define for function depth limits */ ++#undef MAX_FUNCTION_DEPTH ++ ++/* Define to 1 if you want support for multibyte character sets. */ ++#undef MULTIBYTE_SUPPORT ++ ++/* Define to 1 if you have ospeed, but it is not defined in termcap.h */ ++#undef MUST_DEFINE_OSPEED ++ ++/* Define to 1 if you have no signal blocking at all (bummer). */ ++#undef NO_SIGNAL_BLOCKING ++ ++/* Define to 1 if off_t is 64 bit (for large file support) */ ++#undef OFF_T_IS_64_BIT ++ ++/* Define to be the name of the operating system. */ ++#undef OSTYPE ++ ++/* Define to the address where bug reports for this package should be sent. */ ++#undef PACKAGE_BUGREPORT ++ ++/* Define to the full name of this package. */ ++#undef PACKAGE_NAME ++ ++/* Define to the full name and version of this package. */ ++#undef PACKAGE_STRING ++ ++/* Define to the one symbol short name of this package. */ ++#undef PACKAGE_TARNAME ++ ++/* Define to the home page for this package. */ ++#undef PACKAGE_URL ++ ++/* Define to the version of this package. */ ++#undef PACKAGE_VERSION ++ ++/* Define to the path of the /dev/fd filesystem. */ ++#undef PATH_DEV_FD ++ ++/* Define to be location of utmpx file. */ ++#undef PATH_UTMPX_FILE ++ ++/* Define to be location of utmp file. */ ++#undef PATH_UTMP_FILE ++ ++/* Define to be location of wtmpx file. */ ++#undef PATH_WTMPX_FILE ++ ++/* Define to be location of wtmp file. */ ++#undef PATH_WTMP_FILE ++ ++/* Define to 1 if you use POSIX style signal handling. */ ++#undef POSIX_SIGNALS ++ ++/* Define to 1 if ANSI function prototypes are usable. */ ++#undef PROTOTYPES ++ ++/* Undefine this if you don't want to get a restricted shell when zsh is ++ exec'd with basename that starts with r. By default this is defined. */ ++#undef RESTRICTED_R ++ ++/* Define as the return type of signal handlers (`int' or `void'). */ ++#undef RETSIGTYPE ++ ++/* Define to 1 if RLIMIT_RSS and RLIMIT_AS both exist and are equal. */ ++#undef RLIMIT_RSS_IS_AS ++ ++/* Define to 1 if RLIMIT_VMEM and RLIMIT_AS both exist and are equal. */ ++#undef RLIMIT_VMEM_IS_AS ++ ++/* Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal. */ ++#undef RLIMIT_VMEM_IS_RSS ++ ++/* Define to 1 if struct rlimit uses long long */ ++#undef RLIM_T_IS_LONG_LONG ++ ++/* Define to 1 if struct rlimit uses quad_t. */ ++#undef RLIM_T_IS_QUAD_T ++ ++/* Define to 1 if struct rlimit uses unsigned. */ ++#undef RLIM_T_IS_UNSIGNED ++ ++/* Define to 1 if select() is defined in , ie BeOS R4.51 */ ++#undef SELECT_IN_SYS_SOCKET_H ++ ++/* Define to 1 if /bin/sh does not interpret \ escape sequences. */ ++#undef SH_USE_BSD_ECHO ++ ++/* If using the C implementation of alloca, define if you know the ++ direction of stack growth for your system; otherwise it will be ++ automatically deduced at runtime. ++ STACK_DIRECTION > 0 => grows toward higher addresses ++ STACK_DIRECTION < 0 => grows toward lower addresses ++ STACK_DIRECTION = 0 => direction of growth unknown */ ++#undef STACK_DIRECTION ++ ++/* Define to 1 if the `S_IS*' macros in do not work properly. */ ++#undef STAT_MACROS_BROKEN ++ ++/* Define to 1 if you have the ANSI C header files. */ ++#undef STDC_HEADERS ++ ++/* Define to 1 if you use SYS style signal handling (and can block signals). ++ */ ++#undef SYSV_SIGNALS ++ ++/* Define to 1 if tgetent() accepts NULL as a buffer. */ ++#undef TGETENT_ACCEPTS_NULL ++ ++/* Define to what tgetent() returns on success (0 on HP-UX X/Open curses). */ ++#undef TGETENT_SUCCESS ++ ++/* Define if sys/time.h and sys/select.h cannot be both included. */ ++#undef TIME_H_SELECT_H_CONFLICTS ++ ++/* Define to 1 if you can safely include both and . */ ++#undef TIME_WITH_SYS_TIME ++ ++/* Define to 1 if all the kit for using /dev/ptmx for ptys is available. */ ++#undef USE_DEV_PTMX ++ ++/* Define to 1 if you need to use the native getcwd. */ ++#undef USE_GETCWD ++ ++/* Define to 1 if h_errno is not defined by the system. */ ++#undef USE_LOCAL_H_ERRNO ++ ++/* Define to be a string corresponding the vendor of the machine. */ ++#undef VENDOR ++ ++/* Define if your should include sys/stream.h and sys/ptem.h. */ ++#undef WINSIZE_IN_PTEM ++ ++/* Define if getxattr() etc. require additional MacOS-style arguments */ ++#undef XATTR_EXTRA_ARGS ++ ++/* Define to a 64 bit integer type if there is one, but long is shorter. */ ++#undef ZSH_64_BIT_TYPE ++ ++/* Define to an unsigned variant of ZSH_64_BIT_TYPE if that is defined. */ ++#undef ZSH_64_BIT_UTYPE ++ ++/* Define to 1 if you want to get debugging information on internal hash ++ tables. This turns on the `hashinfo' builtin. */ ++#undef ZSH_HASH_DEBUG ++ ++/* Define to 1 if some variant of a curses header can be included */ ++#undef ZSH_HAVE_CURSES_H ++ ++/* Define to 1 if some variant of term.h can be included */ ++#undef ZSH_HAVE_TERM_H ++ ++/* Define to 1 if you want to turn on error checking for heap allocation. */ ++#undef ZSH_HEAP_DEBUG ++ ++/* Define to 1 if you want to use zsh's own memory allocation routines */ ++#undef ZSH_MEM ++ ++/* Define to 1 if you want to debug zsh memory allocation routines. */ ++#undef ZSH_MEM_DEBUG ++ ++/* Define to 1 if you want to turn on warnings of memory allocation errors */ ++#undef ZSH_MEM_WARNING ++ ++/* Define if _XOPEN_SOURCE_EXTENDED should not be defined to avoid clashes */ ++#undef ZSH_NO_XOPEN ++ ++/* Define to 1 if you want to turn on memory checking for free(). */ ++#undef ZSH_SECURE_FREE ++ ++/* Define to the base type of the third argument of accept */ ++#undef ZSOCKLEN_T ++ ++/* Number of bits in a file offset, on hosts where this is settable. */ ++#undef _FILE_OFFSET_BITS ++ ++/* Define for large files, on AIX-style hosts. */ ++#undef _LARGE_FILES ++ ++/* Define to empty if `const' does not conform to ANSI C. */ ++#undef const ++ ++/* Define to `int' if doesn't define. */ ++#undef gid_t ++ ++/* Define to `unsigned long' if doesn't define. */ ++#undef ino_t ++ ++/* Define to `int' if does not define. */ ++#undef mode_t ++ ++/* Define to `long int' if does not define. */ ++#undef off_t ++ ++/* Define to `int' if does not define. */ ++#undef pid_t ++ ++/* Define to the type used in struct rlimit. */ ++#undef rlim_t ++ ++/* Define to `unsigned int' if or doesn't define */ ++#undef sigset_t ++ ++/* Define to `unsigned int' if does not define. */ ++#undef size_t ++ ++/* Define to `int' if doesn't define. */ ++#undef uid_t +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/META-FAQ +@@ -0,0 +1,98 @@ ++------------------------ ++META-FAQ for the Z Shell ++------------------------ ++ ++The latest version of this META-FAQ can be found at any of the FTP sites ++listed below. ++SECTHEADAuthor ++Zsh was originally written by Paul Falstad . ++Zsh is now maintained by the members of the zsh-workers mailing ++list . The development is currently ++coordinated by Peter Stephenson . The coordinator ++can be contacted at , but matters relating to ++the code should generally go to the mailing list. ++SECTHEADAvailability ++Zsh is available from the following anonymous FTP sites. These mirror ++sites are kept frequently up to date. The sites marked with (H) may be ++mirroring ftp.cs.elte.hu instead of the primary site. ++ ++ ftp://ftp.zsh.org/pub/ ++ http://www.zsh.org/pub/ ++Australia ++ ftp://ftp.zsh.org/pub/ ++ http://www.zsh.org/pub/ ++Denmark ++ ftp://mirrors.dotsrc.org/zsh/ ++Finland ++ ftp://ftp.funet.fi/pub/unix/shells/zsh/ ++France ++ ftp://nephtys.lip6.fr/pub/unix/shells/zsh/ ++Germany ++ ftp://ftp.fu-berlin.de/pub/unix/shells/zsh/ ++Hungary ++ ftp://ftp.kfki.hu/pub/packages/zsh/ ++Poland ++ ftp://sunsite.icm.edu.pl/pub/unix/shells/zsh/ ++ ++The up-to-date source code is available via anonymous CVS and Git from ++Sourceforge. See http://sourceforge.net/projects/zsh/ for details. ++A summary of instructions for the CVS and Git archives can be found at ++http://zsh.sourceforget.net/. ++ ++SECTHEADMailing Lists ++Zsh has 3 mailing lists: ++ ++ Announcements about releases, major changes in the shell and the ++ monthly posting of the Zsh FAQ. (moderated) ++ ++ User discussions. ++ ++ Hacking, development, bug reports and patches. ++ ++To subscribe or unsubscribe, send mail ++to the associated administrative address for the mailing list. ++ ++ ++ ++ ++ ++ ++ ++ ++ ++YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED. ++All submissions to zsh-announce are automatically forwarded to ++zsh-users. All submissions to zsh-users are automatically ++forwarded to zsh-workers. ++ ++If you have problems subscribing/unsubscribing to any of the mailing ++lists, send mail to . The mailing lists are ++maintained by Karsten Thygesen . ++ ++The mailing lists are archived; the archives can be accessed via the ++administrative addresses listed above. There is also a hypertext ++archive, maintained by Geoff Wing , available at ++http://www.zsh.org/mla/. ++SECTHEADThe Zsh FAQ ++Zsh has a list of Frequently Asked Questions (FAQ), maintained by ++Peter Stephenson . It is regularly posted to the ++newsgroup comp.unix.shell and the zsh-announce mailing list. ++The latest version can be found at any of the Zsh FTP sites, or at ++http://www.zsh.org/FAQ/. The contact address for FAQ-related matters ++is . ++SECTHEADThe Zsh Web Page ++Zsh has a web page which is located at http://www.zsh.org/. This is ++maintained by Karsten Thygesen , of SunSITE Denmark. ++The contact address for web-related matters is . ++SECTHEADThe Zsh Userguide ++A userguide is currently in preparation. It is intended to complement the ++manual, with explanations and hints on issues where the manual can be ++cabbalistic, hierographic, or downright mystifying (for example, the word ++`hierographic' does not exist). It can be viewed in its current state at ++http://zsh.sourceforge.net/Guide/. At the time of writing, chapters ++dealing with startup files and their contents and the new completion system ++were essentially complete. ++SECTHEADThe Zsh Wiki ++A `wiki' website for zsh has been created at http://www.zshwiki.org/. ++This is a site which can be added to and modified directly by users without ++any special permission. You can add your own zsh tips and configurations. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/stamp-h.in +@@ -0,0 +1 @@ ++ +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshcompwid.1 +@@ -0,0 +1,1212 @@ ++.TH "ZSHCOMPWID" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshcompwid \- zsh completion widgets ++.\" Yodl file: Zsh/compwid.yo ++.SH "DESCRIPTION" ++The shell\&'s programmable completion mechanism can be manipulated in two ++ways; here the low\-level features supporting the newer, function\-based ++mechanism are defined\&. A complete set of shell functions based on these ++features is described in ++\fIzshcompsys\fP(1), ++and users with no interest in adding to that system (or, potentially, ++writing their own \-\- see dictionary entry for `hubris\&') should skip ++the current section\&. The older system based on the \fBcompctl\fP builtin ++command is described in ++\fIzshcompctl\fP(1)\&. ++.PP ++Completion widgets are defined by the \fB\-C\fP option to the \fBzle\fP ++builtin command provided by the \fBzsh/zle\fP module (see ++\fIzshzle\fP(1))\&. For example, ++.PP ++.RS ++.nf ++\fBzle \-C complete expand\-or\-complete completer\fP ++.fi ++.RE ++.PP ++defines a widget named `\fBcomplete\fP\&'\&. The second argument is the name ++of any of the builtin widgets that handle completions: ++\fBcomplete\-word\fP, \fBexpand\-or\-complete\fP, ++\fBexpand\-or\-complete\-prefix\fP, \fBmenu\-complete\fP, ++\fBmenu\-expand\-or\-complete\fP, \fBreverse\-menu\-complete\fP, ++\fBlist\-choices\fP, or \fBdelete\-char\-or\-list\fP\&. Note that this will still ++work even if the widget in question has been re\-bound\&. ++.PP ++When this newly defined widget is bound to a key ++using the \fBbindkey\fP builtin command defined in the \fBzsh/zle\fP module ++(see \fIzshzle\fP(1)), typing that key will call the shell function `\fBcompleter\fP\&'\&. This ++function is responsible for generating the possible matches using the ++builtins described below\&. As with other ZLE widgets, the function is ++called with its standard input closed\&. ++.PP ++Once the function returns, the completion code takes over control again ++and treats the matches in the same manner as the specified builtin ++widget, in this case \fBexpand\-or\-complete\fP\&. ++.PP ++.PP ++.SH "COMPLETION SPECIAL PARAMETERS" ++.PP ++The parameters \fBZLE_REMOVE_SUFFIX_CHARS\fP and \fBZLE_SPACE_SUFFIX_CHARS\fP ++are used by the completion mechanism, but are not special\&. ++See \fIParameters Used By The Shell\fP in \fIzshparam\fP(1)\&. ++.PP ++Inside completion widgets, and any functions called from them, some ++parameters have special meaning; outside these functions they are not ++special to the shell in any way\&. These parameters are used to pass ++information between the completion code and the completion widget\&. Some of ++the builtin commands and the condition codes use or change the current ++values of these parameters\&. Any existing values will be hidden during ++execution of completion widgets; except for \fBcompstate\fP, the parameters ++are reset on each function exit (including nested function calls from ++within the completion widget) to the values they had when the function was ++entered\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBCURRENT\fP ++This is the number of the current word, i\&.e\&. the word the cursor is ++currently on in the \fBwords\fP array\&. Note that this value is only ++correct if the \fBksharrays\fP option is not set\&. ++.TP ++\fBIPREFIX\fP ++Initially this will be set to the empty string\&. This parameter functions ++like \fBPREFIX\fP; it contains a string which precedes the one in \fBPREFIX\fP ++and is not considered part of the list of matches\&. Typically, a string is ++transferred from the beginning of \fBPREFIX\fP to the end of \fBIPREFIX\fP, for ++example: ++.RS ++.PP ++.RS ++.nf ++\fBIPREFIX=${PREFIX%%\e=*}= ++PREFIX=${PREFIX#*=}\fP ++.fi ++.RE ++.PP ++causes the part of the prefix up to and including the first equal sign not ++to be treated as part of a matched string\&. This can be done automatically ++by the \fBcompset\fP builtin, see below\&. ++.RE ++.TP ++\fBISUFFIX\fP ++As \fBIPREFIX\fP, but for a suffix that should not be considered part ++of the matches; note that the \fBISUFFIX\fP string follows the \fBSUFFIX\fP ++string\&. ++.TP ++\fBPREFIX\fP ++Initially this will be set to the part of the current word from the ++beginning of the word up to the position of the cursor; it may be altered ++to give a common prefix for all matches\&. ++.TP ++\fBQIPREFIX\fP ++This parameter is read\-only and contains the quoted string up to the ++word being completed\&. E\&.g\&. when completing `\fB"foo\fP\&', this parameter ++contains the double quote\&. If the \fB\-q\fP option of \fBcompset\fP is used ++(see below), and the original string was `\fB"foo bar\fP\&' with the ++cursor on the `\fBbar\fP\&', this parameter contains `\fB"foo \fP'\&. ++.TP ++\fBQISUFFIX\fP ++Like \fBQIPREFIX\fP, but containing the suffix\&. ++.TP ++\fBSUFFIX\fP ++Initially this will be set to the part of the current word from the ++cursor position to the end; it may be altered to give a common suffix for ++all matches\&. It is most useful when the option \fBCOMPLETE_IN_WORD\fP is ++set, as otherwise the whole word on the command line is treated as a ++prefix\&. ++.TP ++\fBcompstate\fP ++This is an associative array with various keys and values that the ++completion code uses to exchange information with the completion widget\&. ++The keys are: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBall_quotes\fP ++The \fB\-q\fP option of the \fBcompset\fP builtin command (see below) ++allows a quoted string to be broken into separate words; if the cursor is ++on one of those words, that word will be completed, possibly invoking ++`\fBcompset \-q\fP\&' recursively\&. With this key it is possible to test the ++types of quoted strings which are currently broken into parts in this ++fashion\&. Its value contains one character for each quoting level\&. The ++characters are a single quote or a double quote for strings quoted with ++these characters, a dollars sign for strings quoted with ++\fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP and a backslash for strings not starting with a ++quote character\&. The first character in the value always corresponds to the ++innermost quoting level\&. ++.TP ++\fBcontext\fP ++This will be set by the completion code to the overall context ++in which completion is attempted\&. Possible values are: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBarray_value\fP ++when completing inside the value of an array parameter assignment; in ++this case the \fBwords\fP array contains the words inside the parentheses\&. ++.TP ++\fBbrace_parameter\fP ++when completing the name of a parameter in a parameter expansion beginning ++with \fB${\fP\&. This context will also be set when completing parameter ++flags following \fB${(\fP; the full command line argument is presented ++and the handler must test the value to be completed to ascertain that ++this is the case\&. ++.TP ++\fBassign_parameter\fP ++when completing the name of a parameter in a parameter assignment\&. ++.TP ++\fBcommand\fP ++when completing for a normal command (either in command position or for ++an argument of the command)\&. ++.TP ++\fBcondition\fP ++when completing inside a `\fB[[\fP\&.\&.\&.\fB]]\fP\&' conditional expression; in ++this case the \fBwords\fP array contains only the words inside the ++conditional expression\&. ++.TP ++\fBmath\fP ++when completing in a mathematical environment such as a ++`\fB((\fP\&.\&.\&.\fB))\fP\&' construct\&. ++.TP ++\fBparameter\fP ++when completing the name of a parameter in a parameter expansion beginning ++with \fB$\fP but not \fB${\fP\&. ++.TP ++\fBredirect\fP ++when completing after a redirection operator\&. ++.TP ++\fBsubscript\fP ++when completing inside a parameter subscript\&. ++.TP ++\fBvalue\fP ++when completing the value of a parameter assignment\&. ++.RE ++.TP ++\fBexact\fP ++Controls the behaviour when the \fBREC_EXACT\fP option is set\&. It will be ++set to \fBaccept\fP if an exact match would be accepted, and will be unset ++otherwise\&. ++.RS ++.PP ++If it was set when at least one match equal to the string on the line ++was generated, the match is accepted\&. ++.RE ++.TP ++\fBexact_string\fP ++The string of an exact match if one was found, otherwise unset\&. ++.TP ++\fBignored\fP ++The number of words that were ignored because they matched one of the ++patterns given with the \fB\-F\fP option to the \fBcompadd\fP builtin ++command\&. ++.TP ++\fBinsert\fP ++This controls the manner in which a match is inserted into the command ++line\&. On entry to the widget function, if it is unset the command line is ++not to be changed; if set to \fBunambiguous\fP, any prefix common to all ++matches is to be inserted; if set to \fBautomenu\-unambiguous\fP, the ++common prefix is to be inserted and the next invocation of the ++completion code may start menu completion (due to the \fBAUTO_MENU\fP ++option being set); if set to \fBmenu\fP or \fBautomenu\fP menu completion ++will be started for the matches currently generated (in the ++latter case this will happen because the \fBAUTO_MENU\fP is set)\&. The ++value may also contain the string `\fBtab\fP\&' when the completion code ++would normally not really do completion, but only insert the TAB ++character\&. ++.RS ++.PP ++On exit it may be set to any of the values above (where setting it to ++the empty string is the same as unsetting it), or to a number, in which ++case the match whose number is given will be inserted into the command line\&. ++Negative numbers count backward from the last match (with `\fB\-1\fP\&' ++selecting the last match) and out\-of\-range values are wrapped ++around, so that a value of zero selects the last match and a value ++one more than the maximum selects the first\&. Unless the value of this ++key ends in a space, the match is inserted as in a menu completion, ++i\&.e\&. without automatically appending a space\&. ++.PP ++Both \fBmenu\fP and \fBautomenu\fP may also specify the number of the ++match to insert, given after a colon\&. For example, `\fBmenu:2\fP\&' says ++to start menu completion, beginning with the second match\&. ++.PP ++Note that a value containing the substring `\fBtab\fP\&' makes the ++matches generated be ignored and only the TAB be inserted\&. ++.PP ++Finally, it may also be set to \fBall\fP, which makes all matches ++generated be inserted into the line\&. ++.RE ++.TP ++\fBinsert_positions\fP ++When the completion system inserts an unambiguous string into the ++line, there may be multiple places where characters are missing or ++where the character inserted differs from at least one match\&. The ++value of this key contains a colon separated list of all these ++positions, as indexes into the command line\&. ++.TP ++\fBlast_prompt\fP ++If this is set to a non\-empty string for every match added, the ++completion code will move the cursor back to the previous prompt after ++the list of completions has been displayed\&. Initially this is set or ++unset according to the \fBALWAYS_LAST_PROMPT\fP option\&. ++.TP ++\fBlist\fP ++This controls whether or how the list of matches will be displayed\&. If it ++is unset or empty they will never be listed; if its value begins with ++\fBlist\fP, they will always be listed; if it begins with \fBautolist\fP ++or \fBambiguous\fP, they will be listed when the \fBAUTO_LIST\fP or ++\fBLIST_AMBIGUOUS\fP options respectively would normally cause them to ++be\&. ++.RS ++.PP ++If the substring \fBforce\fP appears in the value, this makes the ++list be shown even if there is only one match\&. Normally, the list ++would be shown only if there are at least two matches\&. ++.PP ++The value contains the substring \fBpacked\fP if the \fBLIST_PACKED\fP ++option is set\&. If this substring is given for all matches added to a ++group, this group will show the \fBLIST_PACKED\fP behavior\&. The same is ++done for the \fBLIST_ROWS_FIRST\fP option with the substring \fBrows\fP\&. ++.PP ++Finally, if the value contains the string \fBexplanations\fP, only the ++explanation strings, if any, will be listed and if it contains ++\fBmessages\fP, only the messages (added with the \fB\-x\fP option of ++\fBcompadd\fP) will be listed\&. If it contains both \fBexplanations\fP and ++\fBmessages\fP both kinds of explanation strings will be listed\&. It ++will be set appropriately on entry to a completion widget and may be ++changed there\&. ++.RE ++.TP ++\fBlist_lines\fP ++This gives the number of lines that are needed to display the full ++list of completions\&. Note that to calculate the total number of lines ++to display you need to add the number of lines needed for the command ++line to this value, this is available as the value of the \fBBUFFERLINES\fP ++special parameter\&. ++.TP ++\fBlist_max\fP ++Initially this is set to the value of the \fBLISTMAX\fP parameter\&. ++It may be set to any other value; when the widget exits this value ++will be used in the same way as the value of \fBLISTMAX\fP\&. ++.TP ++\fBnmatches\fP ++The number of matches generated and accepted by the completion code so ++far\&. ++.TP ++\fBold_insert\fP ++On entry to the widget this will be set to the number of the match of ++an old list of completions that is currently inserted into the command ++line\&. If no match has been inserted, this is unset\&. ++.RS ++.PP ++As with \fBold_list\fP, the value of this key will only be used if it is the ++string \fBkeep\fP\&. If it was set to this value by the widget and there was an ++old match inserted into the command line, this match will be kept and if ++the value of the \fBinsert\fP key specifies that another match should be ++inserted, this will be inserted after the old one\&. ++.RE ++.TP ++\fBold_list\fP ++This is set to \fByes\fP if there is still a valid list of completions ++from a previous completion at the time the widget is invoked\&. This will ++usually be the case if and only if the previous editing operation was a ++completion widget or one of the builtin completion functions\&. If there is a ++valid list and it is also currently shown on the screen, the value of this ++key is \fBshown\fP\&. ++.RS ++.PP ++After the widget has exited the value of this key is only used if it ++was set to \fBkeep\fP\&. In this case the completion code will continue ++to use this old list\&. If the widget generated new matches, they will ++not be used\&. ++.RE ++.TP ++\fBparameter\fP ++The name of the parameter when completing in a subscript or in the ++value of a parameter assignment\&. ++.TP ++\fBpattern_insert\fP ++Normally this is set to \fBmenu\fP, which specifies that menu completion will ++be used whenever a set of matches was generated using pattern matching\&. If ++it is set to any other non\-empty string by the user and menu completion is ++not selected by other option settings, the code will instead insert any ++common prefix for the generated matches as with normal completion\&. ++.TP ++\fBpattern_match\fP ++Locally controls the behaviour given by the \fBGLOB_COMPLETE\fP option\&. ++Initially it is set to `\fB*\fP\&' if and only if the option is set\&. ++The completion widget may set it to this value, to an empty string ++(which has the same effect as unsetting it), or to any ++other non\-empty string\&. If it is non\-empty, unquoted metacharacters on the ++command line will be treated as patterns; if it is `\fB*\fP\&', then ++additionally a wildcard `\fB*\fP\&' is assumed at the cursor position; if ++it is empty or unset, metacharacters will be treated literally\&. ++.RS ++.PP ++Note that the matcher specifications given to the \fBcompadd\fP builtin ++command are not used if this is set to a non\-empty string\&. ++.RE ++.TP ++\fBquote\fP ++When completing inside quotes, this contains the quotation character ++(i\&.e\&. either a single quote, a double quote, or a backtick)\&. Otherwise it ++is unset\&. ++.TP ++\fBquoting\fP ++When completing inside single quotes, this is set to the string ++\fBsingle\fP; inside double quotes, the string ++\fBdouble\fP; inside backticks, the string \fBbacktick\fP\&. ++Otherwise it is unset\&. ++.TP ++\fBredirect\fP ++The redirection operator when completing in a redirection position, ++i\&.e\&. one of \fB<\fP, \fB>\fP, etc\&. ++.TP ++\fBrestore\fP ++This is set to \fBauto\fP before a function is entered, which forces the ++special parameters mentioned above (\fBwords\fP, \fBCURRENT\fP, \fBPREFIX\fP, ++\fBIPREFIX\fP, \fBSUFFIX\fP, and \fBISUFFIX\fP) to be restored to their ++previous values when the function exits\&. If a function unsets it or ++sets it to any other string, they will not be restored\&. ++.TP ++\fBto_end\fP ++Specifies the occasions on which the cursor is moved to the end of a string ++when a match is inserted\&. On entry to a widget function, it may be ++\fBsingle\fP if this will happen when a single unambiguous match was inserted ++or \fBmatch\fP if it will happen any time a match is inserted (for example, ++by menu completion; this is likely to be the effect of the \fBALWAYS_TO_END\fP ++option)\&. ++.RS ++.PP ++On exit, it may be set to \fBsingle\fP as above\&. It may also be set to ++\fBalways\fP, or to the empty string or unset; in those cases the cursor will ++be moved to the end of the string always or never respectively\&. Any ++other string is treated as \fBmatch\fP\&. ++.RE ++.TP ++\fBunambiguous\fP ++This key is read\-only and will always be set to the common (unambiguous) ++prefix the completion code has generated for all matches added so far\&. ++.TP ++\fBunambiguous_cursor\fP ++This gives the position the cursor would be placed at if the ++common prefix in the \fBunambiguous\fP key were inserted, relative to ++the value of that key\&. The cursor would be placed before the character ++whose index is given by this key\&. ++.TP ++\fBunambiguous_positions\fP ++This contains all positions where characters in the unambiguous string ++are missing or where the character inserted differs from at least one ++of the matches\&. The positions are given as indexes into the string ++given by the value of the \fBunambiguous\fP key\&. ++.TP ++\fBvared\fP ++If completion is called while editing a line using the \fBvared\fP ++builtin, the value of this key is set to the name of the parameter ++given as an argument to \fBvared\fP\&. This key is only set while a \fBvared\fP ++command is active\&. ++.RE ++.TP ++\fBwords\fP ++This array contains the words present on the command line currently being ++edited\&. ++.PP ++.SH "COMPLETION BUILTIN COMMANDS" ++.PD 0 ++.TP ++.PD 0 ++\fBcompadd\fP [ \fB\-akqQfenUld12C\fP ] [ \fB\-F\fP \fIarray\fP ] ++.TP ++.PD 0 ++[ \fB\-P\fP \fIprefix\fP ] [ \fB\-S\fP \fIsuffix\fP ] ++.TP ++.PD 0 ++[ \fB\-p\fP \fIhidden\-prefix\fP ] [ \fB\-s\fP \fIhidden\-suffix\fP ] ++.TP ++.PD 0 ++[ \fB\-i\fP \fIignored\-prefix\fP ] [ \fB\-I\fP \fIignored\-suffix\fP ] ++.TP ++.PD 0 ++[ \fB\-W\fP \fIfile\-prefix\fP ] [ \fB\-d\fP \fIarray\fP ] ++.TP ++.PD 0 ++[ \fB\-J\fP \fIname\fP ] [ \fB\-V\fP \fIname\fP ] [ \fB\-X\fP \fIexplanation\fP ] [ \fB\-x\fP \fImessage\fP ] ++.TP ++.PD 0 ++[ \fB\-r\fP \fIremove\-chars\fP ] [ \fB\-R\fP \fIremove\-func\fP ] ++.TP ++.PD 0 ++[ \fB\-D\fP \fIarray\fP ] [ \fB\-O\fP \fIarray\fP ] [ \fB\-A\fP \fIarray\fP ] ++.TP ++.PD 0 ++[ \fB\-E\fP \fInumber\fP ] ++.TP ++.PD ++[ \fB\-M\fP \fImatch\-spec\fP ] [ \fB\-\fP\fB\-\fP ] [ \fIwords\fP \&.\&.\&. ] ++.RS ++.PP ++This builtin command can be used to add matches directly and control ++all the information the completion code stores with each possible ++match\&. The return status is zero if at least one match was added and ++non\-zero if no matches were added\&. ++.PP ++The completion code breaks the string to complete into seven fields in ++the order: ++.PP ++.RS ++.nf ++\fI\fP ++.fi ++.RE ++.PP ++The first field ++is an ignored prefix taken from the command line, the contents of the ++\fBIPREFIX\fP parameter plus the string given with the \fB\-i\fP ++option\&. With the \fB\-U\fP option, only the string from the \fB\-i\fP ++option is used\&. The field \fI\fP is an optional prefix string ++given with the \fB\-P\fP option\&. The \fI\fP field is a string ++that is considered part of the match but that should not be shown when ++listing completions, given with the \fB\-p\fP option; for example, ++functions that do filename generation might specify ++a common path prefix this way\&. \fI\fP is the part of the match that ++should appear in the list of completions, i\&.e\&. one of the \fIwords\fP given ++at the end of the \fBcompadd\fP command line\&. The suffixes \fI\fP, ++\fI\fP and \fI\fP correspond to the prefixes \fI\fP, ++\fI\fP and \fI\fP and are given by the options \fB\-s\fP, \fB\-S\fP and ++\fB\-I\fP, respectively\&. ++.PP ++The supported flags are: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-P\fP \fIprefix\fP ++This gives a string to be inserted before the given \fIwords\fP\&. The ++string given is not considered as part of the match and any shell ++metacharacters in it will not be quoted when the string is inserted\&. ++.TP ++\fB\-S\fP \fIsuffix\fP ++Like \fB\-P\fP, but gives a string to be inserted after the match\&. ++.TP ++\fB\-p\fP \fIhidden\-prefix\fP ++This gives a string that should be inserted into the command line before the ++match but that should not appear in the list of matches\&. Unless the ++\fB\-U\fP option is given, this string must be matched as part of the string ++on the command line\&. ++.TP ++\fB\-s\fP \fIhidden\-suffix\fP ++Like `\fB\-p\fP\&', but gives a string to insert after the match\&. ++.TP ++\fB\-i\fP \fIignored\-prefix\fP ++This gives a string to insert into the command line just before any ++string given with the `\fB\-P\fP\&' option\&. Without `\fB\-P\fP' the string is ++inserted before the string given with `\fB\-p\fP\&' or directly before the ++match\&. ++.TP ++\fB\-I\fP \fIignored\-suffix\fP ++Like \fB\-i\fP, but gives an ignored suffix\&. ++.TP ++\fB\-a\fP ++With this flag the \fIwords\fP are taken as names of arrays and the ++possible matches are their values\&. If only some elements of the ++arrays are needed, the \fIwords\fP may also contain subscripts, as in ++`\fBfoo[2,\-1]\fP\&'\&. ++.TP ++\fB\-k\fP ++With this flag the \fIwords\fP are taken as names of associative arrays ++and the possible matches are their keys\&. As for \fB\-a\fP, the ++\fIwords\fP may also contain subscripts, as in `\fBfoo[(R)*bar*]\fP\&'\&. ++.TP ++\fB\-d\fP \fIarray\fP ++This adds per\-match display strings\&. The \fIarray\fP should contain one ++element per \fIword\fP given\&. The completion code will then display the ++first element instead of the first \fIword\fP, and so on\&. The ++\fIarray\fP may be given as the name of an array parameter or directly ++as a space\-separated list of words in parentheses\&. ++.RS ++.PP ++If there are fewer display strings than \fIwords\fP, the leftover ++\fIwords\fP will be displayed unchanged and if there are more display ++strings than \fIwords\fP, the leftover display strings will be silently ++ignored\&. ++.RE ++.TP ++\fB\-l\fP ++This option only has an effect if used together with the \fB\-d\fP ++option\&. If it is given, the display strings are listed one per line, ++not arrayed in columns\&. ++.TP ++\fB\-o\fP ++This option only has an effect if used together with the \fB\-d\fP ++option\&. If it is given, the order of the output is determined by the ++match strings; otherwise it is determined by the display strings ++(i\&.e\&. the strings given by the \fB\-d\fP option)\&. ++.TP ++\fB\-J\fP \fIname\fP ++Gives the name of the group of matches the words should be stored in\&. ++.TP ++\fB\-V\fP \fIname\fP ++Like \fB\-J\fP but naming an unsorted group\&. These are in a different name ++space than groups created with the \fB\-J\fP flag\&. ++.TP ++\fB\-1\fP ++If given together with the \fB\-V\fP option, makes ++only consecutive duplicates in the group be removed\&. If combined with ++the \fB\-J\fP option, this has no visible effect\&. Note that groups ++with and without this flag are in different name spaces\&. ++.TP ++\fB\-2\fP ++If given together with the \fB\-J\fP or \fB\-V\fP option, makes all ++duplicates be kept\&. Again, groups with and without this flag are in ++different name spaces\&. ++.TP ++\fB\-X\fP \fIexplanation\fP ++The \fIexplanation\fP string will be printed with the list of matches, ++above the group currently selected\&. ++.TP ++\fB\-x\fP \fImessage\fP ++Like \fB\-X\fP, but the \fImessage\fP will be printed even if there are no ++matches in the group\&. ++.TP ++\fB\-q\fP ++The suffix given with \fB\-S\fP will be automatically removed if ++the next character typed is a blank or does not insert anything, or if ++the suffix consists of only one character and the next character typed ++is the same character\&. ++.TP ++\fB\-r\fP \fIremove\-chars\fP ++This is a more versatile form of the \fB\-q\fP option\&. ++The suffix given with \fB\-S\fP or the slash automatically added after ++completing directories will be automatically removed if ++the next character typed inserts one of the characters given in the ++\fIremove\-chars\fP\&. This string is parsed as a characters class and ++understands the backslash sequences used by the \fBprint\fP command\&. For ++example, `\fB\-r "a\-z\et"\fP\&' removes the suffix if the next character typed ++inserts a lower case character or a TAB, and `\fB\-r "^0\-9"\fP\&' removes the ++suffix if the next character typed inserts anything but a digit\&. One extra ++backslash sequence is understood in this string: `\fB\e\-\fP\&' stands for ++all characters that insert nothing\&. Thus `\fB\-S "=" \-q\fP\&' is the same ++as `\fB\-S "=" \-r "= \et\en\e\-"\fP\&'\&. ++.RS ++.PP ++This option may also be used without the \fB\-S\fP option; then any ++automatically added space will be removed when one of the characters in the ++list is typed\&. ++.RE ++.TP ++\fB\-R\fP \fIremove\-func\fP ++This is another form of the \fB\-r\fP option\&. When a suffix ++has been inserted and the completion accepted, the function ++\fIremove\-func\fP will be called after the next character typed\&. It is ++passed the length of the suffix as an argument and can use the special ++parameters available in ordinary (non\-completion) zle widgets (see ++\fIzshzle\fP(1)) to analyse and modify the command line\&. ++.TP ++\fB\-f\fP ++If this flag is given, all of the matches built from \fIwords\fP are ++marked as being the names of files\&. They are not required to be actual ++filenames, but if they are, and the option \fBLIST_TYPES\fP is set, the ++characters describing the types of the files in the completion lists will ++be shown\&. This also forces a slash to be added when the name of a ++directory is completed\&. ++.TP ++\fB\-e\fP ++This flag can be used to tell the completion code that the matches ++added are parameter names for a parameter expansion\&. This will make ++the \fBAUTO_PARAM_SLASH\fP and \fBAUTO_PARAM_KEYS\fP options be used for ++the matches\&. ++.TP ++\fB\-W\fP \fIfile\-prefix\fP ++This string is a pathname that will be ++prepended to each of the matches formed by the given \fIwords\fP together ++with any prefix specified by the \fB\-p\fP option to form a complete filename ++for testing\&. Hence it is only useful if combined with the \fB\-f\fP flag, as ++the tests will not otherwise be performed\&. ++.TP ++\fB\-F\fP \fIarray\fP ++Specifies an array containing patterns\&. Words matching one of these ++patterns are ignored, i\&.e\&. not considered to be possible matches\&. ++.RS ++.PP ++The \fIarray\fP may be the name of an array parameter or a list of ++literal patterns enclosed in parentheses and quoted, as in `\fB\-F "(*?\&.o ++*?\&.h)"\fP\&'\&. If the name of an array is given, the elements of the array are ++taken as the patterns\&. ++.RE ++.TP ++\fB\-Q\fP ++This flag instructs the completion ++code not to quote any metacharacters in the words when inserting them ++into the command line\&. ++.TP ++\fB\-M\fP \fImatch\-spec\fP ++This gives local match specifications as described below in ++the section `Completion Matching Control\&'\&. This option may be given more than once\&. ++In this case all \fImatch\-spec\fPs given are concatenated with spaces ++between them to form the specification string to use\&. ++Note that they will only be used if the \fB\-U\fP option is not given\&. ++.TP ++\fB\-n\fP ++Specifies that the words added are to be used as possible ++matches, but are not to appear in the completion listing\&. ++.TP ++\fB\-U\fP ++If this flag is given, all words given will be accepted and no matching ++will be done by the completion code\&. Normally this is used in ++functions that do the matching themselves\&. ++.TP ++\fB\-O\fP \fIarray\fP ++If this option is given, the \fIwords\fP are \fInot\fP added to the set of ++possible completions\&. Instead, matching is done as usual and all of the ++\fIwords\fP given as arguments that match the string on the command line ++will be stored in the array parameter whose name is given as \fIarray\fP\&. ++.TP ++\fB\-A\fP \fIarray\fP ++As the \fB\-O\fP option, except that instead of those of the \fIwords\fP which ++match being stored in \fIarray\fP, the strings generated internally by the ++completion code are stored\&. For example, ++with a matching specification of `\fB\-M "L:|no="\fP\&', the string `\fBnof\fP' ++on the command line and the string `\fBfoo\fP\&' as one of the \fIwords\fP, this ++option stores the string `\fBnofoo\fP\&' in the array, whereas the \fB\-O\fP ++option stores the `\fBfoo\fP\&' originally given\&. ++.TP ++\fB\-D\fP \fIarray\fP ++As with \fB\-O\fP, the \fIwords\fP are not added to the set of possible ++completions\&. Instead, the completion code tests whether each \fIword\fP ++in turn matches what is on the line\&. If the \fIn\fPth \fIword\fP does not ++match, the \fIn\fPth element of the \fIarray\fP is removed\&. Elements ++for which the corresponding \fIword\fP is matched are retained\&. ++.TP ++\fB\-C\fP ++This option adds a special match which expands to all other matches ++when inserted into the line, even those that are added after this ++option is used\&. Together with the \fB\-d\fP option it is possible to ++specify a string that should be displayed in the list for this special ++match\&. If no string is given, it will be shown as a string containing ++the strings that would be inserted for the other matches, truncated to ++the width of the screen\&. ++.TP ++\fB\-E\fP ++This option adds \fInumber\fP empty matches after the \fIwords\fP have ++been added\&. An empty match takes up space in completion listings but ++will never be inserted in the line and can\&'t be selected with menu ++completion or menu selection\&. This makes empty matches only useful to ++format completion lists and to make explanatory string be shown in ++completion lists (since empty matches can be given display strings ++with the \fB\-d\fP option)\&. And because all but one empty string would ++otherwise be removed, this option implies the \fB\-V\fP and \fB\-2\fP ++options (even if an explicit \fB\-J\fP option is given)\&. ++.TP ++.PD 0 ++\fB\-\fP ++.TP ++.PD ++\fB\-\fP\fB\-\fP ++This flag ends the list of flags and options\&. All arguments after it ++will be taken as the words to use as matches even if they begin with ++hyphens\&. ++.PP ++Except for the \fB\-M\fP flag, if any of these flags is given more than ++once, the first one (and its argument) will be used\&. ++.RE ++.TP ++.PD 0 ++\fBcompset \-p\fP \fInumber\fP ++.TP ++.PD 0 ++\fBcompset \-P\fP [ \fInumber\fP ] \fIpattern\fP ++.TP ++.PD 0 ++\fBcompset \-s\fP \fInumber\fP ++.TP ++.PD 0 ++\fBcompset \-S\fP [ \fInumber\fP ] \fIpattern\fP ++.TP ++.PD 0 ++\fBcompset \-n\fP \fIbegin\fP [ \fIend\fP ] ++.TP ++.PD 0 ++\fBcompset \-N\fP \fIbeg\-pat\fP [ \fIend\-pat\fP ] ++.TP ++.PD ++\fBcompset \-q\fP ++This command simplifies modification of the special parameters, ++while its return status allows tests on them to be carried out\&. ++.RS ++.PP ++The options are: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-p\fP \fInumber\fP ++If the contents of the \fBPREFIX\fP parameter is longer than \fInumber\fP ++characters, the first \fInumber\fP characters are removed from it and ++appended to the contents of the \fBIPREFIX\fP parameter\&. ++.TP ++\fB\-P\fP [ \fInumber\fP ] \fIpattern\fP ++If the value of the \fBPREFIX\fP parameter begins with anything that ++matches the \fIpattern\fP, the matched portion is removed from ++\fBPREFIX\fP and appended to \fBIPREFIX\fP\&. ++.RS ++.PP ++Without the optional \fInumber\fP, the longest match is taken, but ++if \fInumber\fP is given, anything up to the \fInumber\fPth match is ++moved\&. If the \fInumber\fP is negative, the \fInumber\fPth longest ++match is moved\&. For example, if \fBPREFIX\fP contains the string ++`\fBa=b=c\fP\&', then \fBcompset \-P '*\e='\fP will move the string `\fBa=b=\fP' ++into the \fBIPREFIX\fP parameter, but \fBcompset \-P 1 \&'*\e='\fP will move only ++the string `\fBa=\fP\&'\&. ++.RE ++.TP ++\fB\-s\fP \fInumber\fP ++As \fB\-p\fP, but transfer the last \fInumber\fP characters from the ++value of \fBSUFFIX\fP to the front of the value of \fBISUFFIX\fP\&. ++.TP ++\fB\-S\fP [ \fInumber\fP ] \fIpattern\fP ++As \fB\-P\fP, but match the last portion of \fBSUFFIX\fP and transfer the ++matched portion to the front of the value of \fBISUFFIX\fP\&. ++.TP ++\fB\-n\fP \fIbegin\fP [ \fIend\fP ] ++If the current word position as specified by the parameter \fBCURRENT\fP ++is greater than or equal to \fIbegin\fP, anything up to the ++\fIbegin\fPth word is removed from the \fBwords\fP array and the value ++of the parameter \fBCURRENT\fP is decremented by \fIbegin\fP\&. ++.RS ++.PP ++If the optional \fIend\fP is given, the modification is done only if ++the current word position is also less than or equal to \fIend\fP\&. In ++this case, the words from position \fIend\fP onwards are also removed from ++the \fBwords\fP array\&. ++.PP ++Both \fIbegin\fP and \fIend\fP may be negative to count backwards ++from the last element of the \fBwords\fP array\&. ++.RE ++.TP ++\fB\-N\fP \fIbeg\-pat\fP [ \fIend\-pat\fP ] ++If one of the elements of the \fBwords\fP array before the one at the ++index given by the value of the parameter \fBCURRENT\fP matches the ++pattern \fIbeg\-pat\fP, all elements up to and including the matching one are ++removed from the \fBwords\fP array and the value of \fBCURRENT\fP is changed to ++point to the same word in the changed array\&. ++.RS ++.PP ++If the optional pattern \fIend\-pat\fP is also given, and there is an ++element in the \fBwords\fP array matching this pattern, the parameters ++are modified only if the index of this word is higher than the one ++given by the \fBCURRENT\fP parameter (so that the matching word has ++to be after the cursor)\&. In this case, the words starting with the one ++matching \fBend\-pat\fP are also removed from the \fBwords\fP ++array\&. If \fBwords\fP contains no word matching \fIend\-pat\fP, the ++testing and modification is performed as if it were not given\&. ++.RE ++.TP ++\fB\-q\fP ++The word ++currently being completed is split on spaces into separate words, ++respecting the usual shell quoting conventions\&. The ++resulting words are stored in the \fBwords\fP array, and \fBCURRENT\fP, ++\fBPREFIX\fP, \fBSUFFIX\fP, \fBQIPREFIX\fP, and \fBQISUFFIX\fP are modified to ++reflect the word part that is completed\&. ++.PP ++In all the above cases the return status is zero if the test succeeded ++and the parameters were modified and non\-zero otherwise\&. This allows ++one to use this builtin in tests such as: ++.PP ++.RS ++.nf ++\fBif compset \-P \&'*\e='; then \&.\&.\&.\fP ++.fi ++.RE ++.PP ++This forces anything up to and including the last equal sign to be ++ignored by the completion code\&. ++.RE ++.TP ++\fBcompcall\fP [ \fB\-TD\fP ] ++This allows the use of completions defined with the \fBcompctl\fP builtin ++from within completion widgets\&. The list of matches will be generated as ++if one of the non\-widget completion functions (\fBcomplete\-word\fP, etc\&.) ++had been called, except that only \fBcompctl\fPs given for specific commands ++are used\&. To force the code to try completions defined with the \fB\-T\fP ++option of \fBcompctl\fP and/or the default completion (whether defined by ++\fBcompctl \-D\fP or the builtin default) in the appropriate places, the ++\fB\-T\fP and/or \fB\-D\fP flags can be passed to \fBcompcall\fP\&. ++.RS ++.PP ++The return status can be used to test if a matching \fBcompctl\fP ++definition was found\&. It is non\-zero if a \fBcompctl\fP was found and ++zero otherwise\&. ++.PP ++Note that this builtin is defined by the \fBzsh/compctl\fP module\&. ++.RE ++.RE ++.PP ++.SH "COMPLETION CONDITION CODES" ++.PP ++The following additional condition codes for use within the \fB[[ \&.\&.\&. ]]\fP ++construct are available in completion widgets\&. These work on the special ++parameters\&. All of these tests can also be performed by the \fBcompset\fP ++builtin, but in the case of the condition codes the contents of the special ++parameters are not modified\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-prefix\fP [ \fInumber\fP ] \fIpattern\fP ++true if the test for the \fB\-P\fP option of \fBcompset\fP would succeed\&. ++.TP ++\fB\-suffix\fP [ \fInumber\fP ] \fIpattern\fP ++true if the test for the \fB\-S\fP option of \fBcompset\fP would succeed\&. ++.TP ++\fB\-after\fP \fIbeg\-pat\fP ++true if the test of the \fB\-N\fP option with only the \fIbeg\-pat\fP given ++would succeed\&. ++.TP ++\fB\-between\fP \fIbeg\-pat end\-pat\fP ++true if the test for the \fB\-N\fP option with both patterns would succeed\&. ++.PP ++.SH "COMPLETION MATCHING CONTROL" ++.PP ++It is possible by use of the ++\fB\-M\fP option of the \fBcompadd\fP builtin command to specify how the ++characters in the string to be completed (referred to here as the ++command line) map onto the characters in the list of matches produced by ++the completion code (referred to here as the trial completions)\&. Note ++that this is not used if the command line contains a glob pattern and ++the \fBGLOB_COMPLETE\fP option is set or the \fBpattern_match\fP of the ++\fBcompstate\fP special association is set to a non\-empty string\&. ++.PP ++The \fImatch\-spec\fP given as the argument to the \fB\-M\fP option (see ++`Completion Builtin Commands\&' above) consists of one or more matching descriptions separated by ++whitespace\&. Each description consists of a letter followed by a colon ++and then the patterns describing which character sequences on the line match ++which character sequences in the trial completion\&. Any sequence of ++characters not handled in this fashion must match exactly, as usual\&. ++.PP ++The forms of \fImatch\-spec\fP understood are as follows\&. In each case, the ++form with an upper case initial character retains the string already ++typed on the command line as the final result of completion, while with ++a lower case initial character the string on the command line is changed ++into the corresponding part of the trial completion\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBm:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++.TP ++.PD ++\fBM:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++Here, \fIlpat\fP is a pattern that matches on the command line, ++corresponding to \fItpat\fP which matches in the trial completion\&. ++.TP ++.PD 0 ++\fBl:\fP\fIlanchor\fP\fB|\fP\fIlpat\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBL:\fP\fIlanchor\fP\fB|\fP\fIlpat\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBl:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBL:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBb:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++.TP ++.PD ++\fBB:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++These letters are for patterns that are anchored by another pattern on ++the left side\&. Matching for \fIlpat\fP and \fItpat\fP is as for \fBm\fP and ++\fBM\fP, but the pattern \fIlpat\fP matched on the command line must be ++preceded by the pattern \fIlanchor\fP\&. The \fIlanchor\fP can be blank to ++anchor the match to the start of the command line string; otherwise the ++anchor can occur anywhere, but must match in both the command line and ++trial completion strings\&. ++.RS ++.PP ++If no \fIlpat\fP is given but a \fIranchor\fP is, this matches the gap ++between substrings matched by \fIlanchor\fP and \fIranchor\fP\&. Unlike ++\fIlanchor\fP, the \fIranchor\fP only needs to match the trial ++completion string\&. ++.PP ++The \fBb\fP and \fBB\fP forms are similar to \fBl\fP and \fBL\fP with an empty ++anchor, but need to match only the beginning of the trial completion ++or the word on the command line, respectively\&. ++.RE ++.TP ++.PD 0 ++\fBr:\fP\fIlpat\fP\fB|\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBR:\fP\fIlpat\fP\fB|\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBr:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBR:\fP\fIlanchor\fP\fB||\fP\fIranchor\fP\fB=\fP\fItpat\fP ++.TP ++.PD 0 ++\fBe:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++.TP ++.PD ++\fBE:\fP\fIlpat\fP\fB=\fP\fItpat\fP ++As \fBl\fP, \fBL\fP, \fBb\fP and \fBB\fP, with the difference that the command ++line and trial completion patterns are anchored on the right side\&. ++Here an empty \fIranchor\fP and the \fBe\fP and \fBE\fP forms force the ++match to the end of the trial completion or command line string\&. ++.PP ++Each \fIlpat\fP, \fItpat\fP or \fIanchor\fP is either an empty string or ++consists of a sequence of literal characters (which may be quoted with a ++backslash), question marks, character classes, and correspondence ++classes; ordinary shell patterns are not used\&. Literal characters match ++only themselves, question marks match any character, and character ++classes are formed as for globbing and match any character in the given ++set\&. ++.PP ++Correspondence classes are defined like character classes, but with two ++differences: they are delimited by a pair of braces, and negated classes ++are not allowed, so the characters \fB!\fP and \fB^\fP have no special ++meaning directly after the opening brace\&. They indicate that a range of ++characters on the line match a range of characters in the trial ++completion, but (unlike ordinary character classes) paired according to ++the corresponding position in the sequence\&. For example, to make any ++ASCII lower case letter on the line match the corresponding upper case ++letter in the trial completion, you can use `\fBm:{a\-z}={A\-Z}\fP\&' ++(however, see below for the recommended form for this)\&. More ++than one pair of classes can occur, in which case the first class before ++the \fB=\fP corresponds to the first after it, and so on\&. If one side has ++more such classes than the other side, the superfluous classes behave ++like normal character classes\&. In anchor patterns correspondence classes ++also behave like normal character classes\&. ++.PP ++The standard `\fB[:\fP\fIname\fP\fB:]\fP\&' forms described for standard shell ++patterns, ++see the section FILENAME GENERATION in \fIzshexpn\fP(1), ++may appear in correspondence classes as well as normal character ++classes\&. The only special behaviour in correspondence classes is if ++the form on the left and the form on the right are each one of ++\fB[:upper:]\fP, \fB[:lower:]\fP\&. In these cases the ++character in the word and the character on the line must be the same up ++to a difference in case\&. Hence to make any lower case character on the ++line match the corresponding upper case character in the trial ++completion you can use `\fBm:{[:lower:]}={[:upper:]}\fP\&'\&. Although the ++matching system does not yet handle multibyte characters, this is likely ++to be a future extension, at which point this syntax will handle ++arbitrary alphabets; hence this form, rather than the use of explicit ++ranges, is the recommended form\&. In other cases ++`\fB[:\fP\fIname\fP\fB:]\fP\&' forms are allowed\&. If the two forms on the left ++and right are the same, the characters must match exactly\&. In remaining ++cases, the corresponding tests are applied to both characters, but they ++are not otherwise constrained; any matching character in one set goes ++with any matching character in the other set: this is equivalent to the ++behaviour of ordinary character classes\&. ++.PP ++The pattern \fItpat\fP may also be one or two stars, `\fB*\fP\&' or ++`\fB**\fP\&'\&. This means that the pattern on the command line can match ++any number of characters in the trial completion\&. In this case the ++pattern must be anchored (on either side); in the case of a single ++star, the \fIanchor\fP then determines how much of the trial completion ++is to be included \-\- only the characters up to the next appearance of ++the anchor will be matched\&. With two stars, substrings matched by the ++anchor can be matched, too\&. ++.PP ++Examples: ++.PP ++The keys of the \fBoptions\fP association defined by the \fBparameter\fP ++module are the option names in all\-lower\-case form, without ++underscores, and without the optional \fBno\fP at the beginning even ++though the builtins \fBsetopt\fP and \fBunsetopt\fP understand option names ++with upper case letters, underscores, and the optional \fBno\fP\&. The ++following alters the matching rules so that the prefix \fBno\fP and any ++underscore are ignored when trying to match the trial completions ++generated and upper case letters on the line match the corresponding ++lower case letters in the words: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'L:|[nN][oO]= M:_= M:{[:upper:]}={[:lower:]}' \- \e ++ ${(k)options} \fP ++.fi ++.RE ++.PP ++The first part says that the pattern `\fB[nN][oO]\fP\&' at the beginning ++(the empty anchor before the pipe symbol) of the string on the ++line matches the empty string in the list of words generated by ++completion, so it will be ignored if present\&. The second part does the ++same for an underscore anywhere in the command line string, and the ++third part uses correspondence classes so that any ++upper case letter on the line matches the corresponding lower case ++letter in the word\&. The use of the upper case forms of the ++specification characters (\fBL\fP and \fBM\fP) guarantees that what has ++already been typed on the command line (in particular the prefix ++\fBno\fP) will not be deleted\&. ++.PP ++Note that the use of \fBL\fP in the first part means that it matches ++only when at the beginning of both the command line string and the ++trial completion\&. I\&.e\&., the string `\fB_NO_f\fP\&' would not be ++completed to `\fB_NO_foo\fP\&', nor would `\fBNONO_f\fP' be completed to ++`\fBNONO_foo\fP\&' because of the leading underscore or the second ++`\fBNO\fP\&' on the line which makes the pattern fail even though they are ++otherwise ignored\&. To fix this, one would use `\fBB:[nN][oO]=\fP\&' ++instead of the first part\&. As described above, this matches at the ++beginning of the trial completion, independent of other characters or ++substrings at the beginning of the command line word which are ignored ++by the same or other \fImatch\-spec\fPs\&. ++.PP ++The second example makes completion case insensitive\&. This is just ++the same as in the option example, except here we wish to retain the ++characters in the list of completions: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'m:{[:lower:]}={[:upper:]}' \&.\&.\&. \fP ++.fi ++.RE ++.PP ++This makes lower case letters match their upper case counterparts\&. ++To make upper case letters match the lower case forms as well: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'m:{[:lower:][:upper:]}={[:upper:][:lower:]}' \&.\&.\&. \fP ++.fi ++.RE ++.PP ++A nice example for the use of \fB*\fP patterns is partial word ++completion\&. Sometimes you would like to make strings like `\fBc\&.s\&.u\fP\&' ++complete to strings like `\fBcomp\&.source\&.unix\fP\&', i\&.e\&. the word on the ++command line consists of multiple parts, separated by a dot in this ++example, where each part should be completed separately \-\- note, ++however, that the case where each part of the word, i\&.e\&. `\fBcomp\fP\&', ++`\fBsource\fP\&' and `\fBunix\fP' in this example, is to be completed from ++separate sets of matches ++is a different problem to be solved by the implementation of the ++completion widget\&. The example can be handled by: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'r:|\&.=* r:|=*' \e ++ \- comp\&.sources\&.unix comp\&.sources\&.misc \&.\&.\&.\fP ++.fi ++.RE ++.PP ++The first specification says that \fIlpat\fP is the empty string, while ++\fIanchor\fP is a dot; \fItpat\fP is \fB*\fP, so this can match anything ++except for the `\fB\&.\fP\&' from the anchor in ++the trial completion word\&. So in `\fBc\&.s\&.u\fP\&', the matcher sees `\fBc\fP', ++followed by the empty string, followed by the anchor `\fB\&.\fP\&', and ++likewise for the second dot, and replaces the empty strings before the ++anchors, giving `\fBc\fP[\fBomp\fP]\fB\&.s\fP[\fBources\fP]\fB\&.u\fP[\fBnix\fP]\&', where ++the last part of the completion is just as normal\&. ++.PP ++With the pattern shown above, the string `\fBc\&.u\fP\&' could not be ++completed to `\fBcomp\&.sources\&.unix\fP\&' because the single star means ++that no dot (matched by the anchor) can be skipped\&. By using two stars ++as in `\fBr:|\&.=**\fP\&', however, `\fBc\&.u\fP' could be completed to ++`\fBcomp\&.sources\&.unix\fP\&'\&. This also shows that in some cases, ++especially if the anchor is a real pattern, like a character class, ++the form with two stars may result in more matches than one would like\&. ++.PP ++The second specification is needed to make this work when the cursor is ++in the middle of the string on the command line and the option ++\fBCOMPLETE_IN_WORD\fP is set\&. In this case the completion code would ++normally try to match trial completions that end with the string as ++typed so far, i\&.e\&. it will only insert new characters at the cursor ++position rather than at the end\&. However in our example we would like ++the code to recognise matches which contain extra characters after the ++string on the line (the `\fBnix\fP\&' in the example)\&. Hence we say that the ++empty string at the end of the string on the line matches any characters ++at the end of the trial completion\&. ++.PP ++More generally, the specification ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'r:|[\&.,_\-]=* r:|=*' \&.\&.\&. \fP ++.fi ++.RE ++.PP ++allows one to complete words with abbreviations before any of the ++characters in the square brackets\&. For example, to ++complete \fBveryverylongfile\&.c\fP rather than \fBveryverylongheader\&.h\fP ++with the above in effect, you can just type \fBvery\&.c\fP before attempting ++completion\&. ++.PP ++The specifications with both a left and a right anchor are useful to ++complete partial words whose parts are not separated by some ++special character\&. For example, in some places strings have to be ++completed that are formed `\fBLikeThis\fP\&' (i\&.e\&. the separate parts are ++determined by a leading upper case letter) or maybe one has to ++complete strings with trailing numbers\&. Here one could use the simple ++form with only one anchor as in: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'r:|[[:upper:]0\-9]=* r:|=*' LikeTHIS FooHoo 5foo123 5bar234\fP ++.fi ++.RE ++.PP ++But with this, the string `\fBH\fP\&' would neither complete to `\fBFooHoo\fP' ++nor to `\fBLikeTHIS\fP\&' because in each case there is an upper case ++letter before the `\fBH\fP\&' and that is matched by the anchor\&. Likewise, ++a `\fB2\fP\&' would not be completed\&. In both cases this could be changed ++by using `\fBr:|[[:upper:]0\-9]=**\fP\&', but then `\fBH\fP' completes to both ++`\fBLikeTHIS\fP\&' and `\fBFooHoo\fP' and a `\fB2\fP' matches the other ++strings because characters can be inserted before every upper case ++letter and digit\&. To avoid this one would use: ++.PP ++.RS ++.nf ++\fBcompadd \-M \&'r:[^[:upper:]0\-9]||[[:upper:]0\-9]=** r:|=*' \e ++ LikeTHIS FooHoo foo123 bar234\fP ++.fi ++.RE ++.PP ++By using these two anchors, a `\fBH\fP\&' matches only upper case `\fBH\fP's that ++are immediately preceded by something matching the left anchor ++`\fB[^[:upper:]0\-9]\fP\&'\&. The effect is, of course, that `\fBH\fP' matches only ++the string `\fBFooHoo\fP\&', a `\fB2\fP' matches only `\fBbar234\fP' and so on\&. ++.PP ++When using the completion system (see ++\fIzshcompsys\fP(1)), users can define match specifications that are to be used for ++specific contexts by using the \fBmatcher\fP and \fBmatcher\-list\fP ++styles\&. The values for the latter will be used everywhere\&. ++.PP ++.SH "COMPLETION WIDGET EXAMPLE" ++.PP ++The first step is to define the widget: ++.PP ++.RS ++.nf ++\fBzle \-C complete complete\-word complete\-files\fP ++.fi ++.RE ++.PP ++Then the widget can be bound to a key using the \fBbindkey\fP builtin ++command: ++.PP ++.RS ++.nf ++\fBbindkey \&'^X\et' complete\fP ++.fi ++.RE ++.PP ++After that the shell function \fBcomplete\-files\fP will be invoked ++after typing control\-X and TAB\&. The function should then generate the ++matches, e\&.g\&.: ++.PP ++.RS ++.nf ++\fBcomplete\-files () { compadd \- * }\fP ++.fi ++.RE ++.PP ++This function will complete files in the current directory matching the ++current word\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshmisc.1 +@@ -0,0 +1,2384 @@ ++.TH "ZSHMISC" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshmisc \- everything and then some ++.\" Yodl file: Zsh/grammar.yo ++.SH "SIMPLE COMMANDS & PIPELINES" ++A \fIsimple command\fP is a sequence of optional parameter ++assignments followed by blank\-separated words, ++with optional redirections interspersed\&. ++The first word is the command to be executed, and the remaining ++words, if any, are arguments to the command\&. ++If a command name is given, the parameter assignments modify ++the environment of the command when it is executed\&. ++The value of a simple command is its exit status, ++or 128 plus the signal number if terminated by a signal\&. ++For example, ++.PP ++.RS ++.nf ++\fBecho foo\fP ++.fi ++.RE ++.PP ++is a simple command with arguments\&. ++.PP ++A \fIpipeline\fP is either a simple command, or a sequence of two or more ++simple commands where each command is separated from the next by `\fB|\fP\&' ++or `\fB|&\fP\&'\&. Where commands are separated by `\fB|\fP', the standard ++output of the first command is connected to the ++standard input of the next\&. `\fB|&\fP\&' is shorthand for `\fB2>&1 |\fP', which ++connects both the standard output and the standard error of the ++command to the standard input of the next\&. The value of a pipeline ++is the value of the last command, unless the pipeline is preceded by ++`\fB!\fP\&' in which case the value is the logical inverse of the value of the ++last command\&. ++For example, ++.PP ++.RS ++.nf ++\fBecho foo | sed \&'s/foo/bar/'\fP ++.fi ++.RE ++.PP ++is a pipeline, where the output (`\fBfoo\fP\&' plus a newline) of the first ++command will be passed to the input of the second\&. ++.PP ++If a pipeline is preceded by `\fBcoproc\fP\&', it is executed as a coprocess; ++a two\-way pipe is established between it and the parent shell\&. The ++shell can read from or write to the coprocess by means of the `\fB>&p\fP\&' ++and `\fB<&p\fP\&' redirection operators or with `\fBprint \-p\fP' and `\fBread \-p\fP'\&. ++A pipeline cannot be preceded by both `\fBcoproc\fP\&' and `\fB!\fP'\&. ++If job control is active, the coprocess can be treated in other than input ++and output as an ordinary background job\&. ++.PP ++A \fIsublist\fP is either a single pipeline, or a sequence of two or more ++pipelines separated by `\fB&&\fP\&' or `\fB||\fP'\&. If two pipelines are separated ++by `\fB&&\fP\&', the second pipeline is executed only if the first succeeds ++(returns a zero status)\&. If two pipelines are separated by `\fB||\fP\&', the ++second is executed only if the first fails (returns a nonzero status)\&. ++Both operators have equal precedence and are left associative\&. ++The value of the sublist is the value of the last pipeline executed\&. ++For example, ++.PP ++.RS ++.nf ++\fBdmesg | grep panic && print yes\fP ++.fi ++.RE ++.PP ++is a sublist consisting of two pipelines, the second just a simple command ++which will be executed if and only if the \fBgrep\fP command returns a zero ++status\&. If it does not, the value of the sublist is that return status, else ++it is the status returned by the \fBprint\fP (almost certainly zero)\&. ++.PP ++A \fIlist\fP is a sequence of zero or more sublists, in which each sublist ++is terminated by `\fB;\fP\&', `\fB&\fP', `\fB&|\fP', `\fB&!\fP', or a newline\&. ++This terminator ++may optionally be omitted from the last sublist in the list when the ++list appears as a complex command inside `\fB(\fP\&.\&.\&.\fB)\fP\&' ++or `\fB{\fP\&.\&.\&.\fB}\fP\&'\&. When a ++sublist is terminated by `\fB;\fP\&' or newline, the shell waits for it to ++finish before executing the next sublist\&. If a sublist is terminated ++by a `\fB&\fP\&', `\fB&|\fP', or `\fB&!\fP', ++the shell executes the last pipeline in it in the background, and ++does not wait for it to finish (note the difference from other shells ++which execute the whole sublist in the background)\&. ++A backgrounded pipeline returns a status of zero\&. ++.PP ++More generally, a list can be seen as a set of any shell commands ++whatsoever, including the complex commands below; this is implied wherever ++the word `list\&' appears in later descriptions\&. For example, the commands ++in a shell function form a special sort of list\&. ++.SH "PRECOMMAND MODIFIERS" ++A simple command may be preceded by a \fIprecommand modifier\fP, ++which will alter how the command is interpreted\&. These modifiers are ++shell builtin commands with the exception of \fBnocorrect\fP which is ++a reserved word\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-\fP ++The command is executed with a `\fB\-\fP\&' prepended to its ++\fBargv[0]\fP string\&. ++.TP ++\fBbuiltin\fP ++The command word is taken to be the name of a builtin command, ++rather than a shell function or external command\&. ++.TP ++\fBcommand\fP [ \fB\-pvV\fP ] ++The command word is taken to be the name of an external command, ++rather than a shell function or builtin\&. If the \fBPOSIX_BUILTINS\fP option ++is set, builtins will also be executed but certain special properties ++of them are suppressed\&. The \fB\-p\fP flag causes a default path to be ++searched instead of that in \fB$path\fP\&. With the \fB\-v\fP flag, \fBcommand\fP ++is similar to \fBwhence\fP and with \fB\-V\fP, it is equivalent to \fBwhence ++\-v\fP\&. ++.TP ++\fBexec\fP [ \fB\-cl\fP ] [ \fB\-a\fP \fIargv0\fP ] ++The following command together with any arguments is run in place ++of the current process, rather than as a sub\-process\&. The shell does not ++fork and is replaced\&. The shell does not invoke \fBTRAPEXIT\fP, nor does it ++source \fBzlogout\fP files\&. ++The options are provided for compatibility with other shells\&. ++.RS ++.PP ++The \fB\-c\fP option clears the environment\&. ++.PP ++The \fB\-l\fP option is equivalent to the \fB\-\fP precommand modifier, to ++treat the replacement command as a login shell; the command is executed ++with a \fB\-\fP prepended to its \fBargv[0]\fP string\&. This flag has no effect ++if used together with the \fB\-a\fP option\&. ++.PP ++The \fB\-a\fP option is used to specify explicitly the \fBargv[0]\fP string ++(the name of the command as seen by the process itself) to be used by the ++replacement command and is directly equivalent to setting a value ++for the \fBARGV0\fP environment variable\&. ++.RE ++.TP ++\fBnocorrect\fP ++Spelling correction is not done on any of the words\&. This must appear ++before any other precommand modifier, as it is interpreted immediately, ++before any parsing is done\&. It has no effect in non\-interactive shells\&. ++.TP ++\fBnoglob\fP ++Filename generation (globbing) is not performed on any of ++the words\&. ++.SH "COMPLEX COMMANDS" ++A \fIcomplex command\fP in zsh is one of the following: ++.PP ++.PD 0 ++.TP ++.PD ++\fBif\fP \fIlist\fP \fBthen\fP \fIlist\fP [ \fBelif\fP \fIlist\fP \fBthen\fP \fIlist\fP ] \&.\&.\&. [ \fBelse\fP \fIlist\fP ] \fBfi\fP ++The \fBif\fP \fIlist\fP is executed, and if it returns a zero exit status, ++the \fBthen\fP \fIlist\fP is executed\&. ++Otherwise, the \fBelif\fP \fIlist\fP is executed and if its status is zero, ++the \fBthen\fP \fIlist\fP is executed\&. ++If each \fBelif\fP \fIlist\fP returns nonzero status, the \fBelse\fP \fIlist\fP ++is executed\&. ++.TP ++\fBfor\fP \fIname\fP \&.\&.\&. [ \fBin\fP \fIword\fP \&.\&.\&. ] \fIterm\fP \fBdo\fP \fIlist\fP \fBdone\fP ++where \fIterm\fP is at least one newline or \fB;\fP\&. ++Expand the list of \fIword\fPs, and set the parameter ++\fIname\fP to each of them in turn, executing ++\fIlist\fP each time\&. If the \fBin\fP \fIword\fP is omitted, ++use the positional parameters instead of the \fIword\fPs\&. ++.RS ++.PP ++More than one parameter \fIname\fP can appear before the list of ++\fIword\fPs\&. If \fIN\fP \fIname\fPs are given, then on each execution of the ++loop the next \fBN\fP \fIword\fPs are assigned to the corresponding ++parameters\&. If there are more \fIname\fPs than remaining \fIword\fPs, the ++remaining parameters are each set to the empty string\&. Execution of the ++loop ends when there is no remaining \fIword\fP to assign to the first ++\fIname\fP\&. It is only possible for \fBin\fP to appear as the first \fIname\fP ++in the list, else it will be treated as marking the end of the list\&. ++.RE ++.TP ++\fBfor ((\fP [\fIexpr1\fP] \fB;\fP [\fIexpr2\fP] \fB;\fP [\fIexpr3\fP] \fB)) do\fP \fIlist\fP \fBdone\fP ++The arithmetic expression \fIexpr1\fP is evaluated first (see ++the section `Arithmetic Evaluation\&')\&. The arithmetic expression ++\fIexpr2\fP is repeatedly evaluated until it evaluates to zero and ++when non\-zero, \fIlist\fP is executed and the arithmetic expression ++\fIexpr3\fP evaluated\&. If any expression is omitted, then it behaves ++as if it evaluated to 1\&. ++.TP ++\fBwhile\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP ++Execute the \fBdo\fP \fIlist\fP as long as the \fBwhile\fP \fIlist\fP ++returns a zero exit status\&. ++.TP ++\fBuntil\fP \fIlist\fP \fBdo\fP \fIlist\fP \fBdone\fP ++Execute the \fBdo\fP \fIlist\fP as long as \fBuntil\fP \fIlist\fP ++returns a nonzero exit status\&. ++.TP ++\fBrepeat\fP \fIword\fP \fBdo\fP \fIlist\fP \fBdone\fP ++\fIword\fP is expanded and treated as an arithmetic expression, ++which must evaluate to a number \fIn\fP\&. ++\fIlist\fP is then executed \fIn\fP times\&. ++.RS ++.PP ++The \fBrepeat\fP syntax is disabled by default when the ++shell starts in a mode emulating another shell\&. It can be enabled ++with the command `\fBenable \-r repeat\fP\&' ++.RE ++.TP ++\fBcase\fP \fIword\fP \fBin\fP [ [\fB(\fP] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \&.\&.\&. \fB)\fP \fIlist\fP (\fB;;\fP|\fB;&\fP|\fB;|\fP) ] \&.\&.\&. \fBesac\fP ++Execute the \fIlist\fP associated with the first \fIpattern\fP ++that matches \fIword\fP, if any\&. The form of the patterns ++is the same as that used for filename generation\&. See ++the section `Filename Generation\&'\&. ++.RS ++.PP ++If the \fIlist\fP that is executed is terminated with \fB;&\fP rather than ++\fB;;\fP, the following list is also executed\&. The rule for ++the terminator of the following list \fB;;\fP, \fB;&\fP or \fB;|\fP is ++applied unless the \fBesac\fP is reached\&. ++.PP ++If the \fIlist\fP that is executed is terminated with \fB;|\fP the ++shell continues to scan the \fIpattern\fPs looking for the next match, ++executing the corresponding \fIlist\fP, and applying the rule for ++the corresponding terminator \fB;;\fP, \fB;&\fP or \fB;|\fP\&. ++Note that \fIword\fP is not re\-expanded; all applicable \fIpattern\fPs ++are tested with the same \fIword\fP\&. ++.RE ++.TP ++\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP \&.\&.\&. \fIterm\fP ] \fBdo\fP \fIlist\fP \fBdone\fP ++where \fIterm\fP is one or more newline or \fB;\fP to terminate the \fIword\fPs\&. ++Print the set of \fIword\fPs, each preceded by a number\&. ++If the \fBin\fP \fIword\fP is omitted, use the positional parameters\&. ++The \fBPROMPT3\fP prompt is printed and a line is read from the line editor ++if the shell is interactive and that is active, or else standard input\&. ++If this line consists of the ++number of one of the listed \fIword\fPs, then the parameter \fIname\fP ++is set to the \fIword\fP corresponding to this number\&. ++If this line is empty, the selection list is printed again\&. ++Otherwise, the value of the parameter \fIname\fP is set to null\&. ++The contents of the line read from standard input is saved ++in the parameter \fBREPLY\fP\&. \fIlist\fP is executed ++for each selection until a break or end\-of\-file is encountered\&. ++.TP ++\fB(\fP \fIlist\fP \fB)\fP ++Execute \fIlist\fP in a subshell\&. Traps set by the \fBtrap\fP builtin ++are reset to their default values while executing \fIlist\fP\&. ++.TP ++\fB{\fP \fIlist\fP \fB}\fP ++Execute \fIlist\fP\&. ++.TP ++\fB{\fP \fItry\-list\fP \fB} always {\fP \fIalways\-list\fP \fB}\fP ++First execute \fItry\-list\fP\&. Regardless of errors, or \fBbreak\fP, ++\fBcontinue\fP, or \fBreturn\fP commands encountered within \fItry\-list\fP, ++execute \fIalways\-list\fP\&. Execution then continues from the ++result of the execution of \fItry\-list\fP; in other words, any error, ++or \fBbreak\fP, \fBcontinue\fP, or \fBreturn\fP command is treated in the ++normal way, as if \fIalways\-list\fP were not present\&. The two ++chunks of code are referred to as the `try block\&' and the `always block'\&. ++.RS ++.PP ++Optional newlines or semicolons may appear after the \fBalways\fP; ++note, however, that they may \fInot\fP appear between the preceding ++closing brace and the \fBalways\fP\&. ++.PP ++An `error\&' in this context is a condition such as a syntax error which ++causes the shell to abort execution of the current function, script, or ++list\&. Syntax errors encountered while the shell is parsing the ++code do not cause the \fIalways\-list\fP to be executed\&. For example, ++an erroneously constructed \fBif\fP block in \fBtry\-list\fP would cause the ++shell to abort during parsing, so that \fBalways\-list\fP would not be ++executed, while an erroneous substitution such as \fB${*foo*}\fP would ++cause a run\-time error, after which \fBalways\-list\fP would be executed\&. ++.PP ++An error condition can be tested and reset with the special integer ++variable \fBTRY_BLOCK_ERROR\fP\&. Outside an \fBalways\-list\fP the value is ++irrelevant, but it is initialised to \fB\-1\fP\&. Inside \fBalways\-list\fP, the ++value is 1 if an error occurred in the \fBtry\-list\fP, else 0\&. If ++\fBTRY_BLOCK_ERROR\fP is set to 0 during the \fBalways\-list\fP, the error ++condition caused by the \fBtry\-list\fP is reset, and shell execution ++continues normally after the end of \fBalways\-list\fP\&. Altering the value ++during the \fBtry\-list\fP is not useful (unless this forms part of an ++enclosing \fBalways\fP block)\&. ++.PP ++Regardless of \fBTRY_BLOCK_ERROR\fP, after the end of \fBalways\-list\fP the ++normal shell status \fB$?\fP is the value returned from \fBalways\-list\fP\&. ++This will be non\-zero if there was an error, even if \fBTRY_BLOCK_ERROR\fP ++was set to zero\&. ++.PP ++The following executes the given code, ignoring any errors it causes\&. ++This is an alternative to the usual convention of protecting code by ++executing it in a subshell\&. ++.PP ++.RS ++.nf ++\fB{ ++ # code which may cause an error ++ } always { ++ # This code is executed regardless of the error\&. ++ (( TRY_BLOCK_ERROR = 0 )) ++} ++# The error condition has been reset\&.\fP ++.fi ++.RE ++.PP ++An \fBexit\fP command (or a \fBreturn\fP command executed at the outermost ++function level of a script) encountered in \fBtry\-list\fP does \fInot\fP cause ++the execution of \fIalways\-list\fP\&. Instead, the shell exits immediately ++after any \fBEXIT\fP trap has been executed\&. ++.RE ++.TP ++.PD 0 ++\fBfunction\fP \fIword\fP \&.\&.\&. [ \fB()\fP ] [ \fIterm\fP ] \fB{\fP \fIlist\fP \fB}\fP ++.TP ++.PD 0 ++\fIword\fP \&.\&.\&. \fB()\fP [ \fIterm\fP ] \fB{\fP \fIlist\fP \fB}\fP ++.TP ++.PD ++\fIword\fP \&.\&.\&. \fB()\fP [ \fIterm\fP ] \fIcommand\fP ++where \fIterm\fP is one or more newline or \fB;\fP\&. ++Define a function which is referenced by any one of \fIword\fP\&. ++Normally, only one \fIword\fP is provided; multiple \fIword\fPs ++are usually only useful for setting traps\&. ++The body of the function is the \fIlist\fP between ++the \fB{\fP and \fB}\fP\&. See the section `Functions\&'\&. ++.RS ++.PP ++If the option \fBSH_GLOB\fP is set for compatibility with other shells, then ++whitespace may appear between between the left and right parentheses when ++there is a single \fIword\fP; otherwise, the parentheses will be treated as ++forming a globbing pattern in that case\&. ++.RE ++.TP ++\fBtime\fP [ \fIpipeline\fP ] ++The \fIpipeline\fP is executed, and timing statistics are ++reported on the standard error in the form specified ++by the \fBTIMEFMT\fP parameter\&. ++If \fIpipeline\fP is omitted, print statistics about the ++shell process and its children\&. ++.TP ++\fB[[\fP \fIexp\fP \fB]]\fP ++Evaluates the conditional expression \fIexp\fP ++and return a zero exit status if it is true\&. ++See the section `Conditional Expressions\&' ++for a description of \fIexp\fP\&. ++.SH "ALTERNATE FORMS FOR COMPLEX COMMANDS" ++Many of zsh\&'s complex commands have alternate forms\&. These are ++non\-standard and are likely not to be obvious even to seasoned shell ++programmers; they should not be used anywhere that portability of shell ++code is a concern\&. ++.PP ++The short versions below only work if \fIsublist\fP is of the form `\fB{\fP ++\fIlist\fP \fB}\fP\&' or if the \fBSHORT_LOOPS\fP option is set\&. For the \fBif\fP, ++\fBwhile\fP and \fBuntil\fP commands, in both these cases the test part of the ++loop must also be suitably delimited, such as by `\fB[[ \&.\&.\&. ]]\fP\&' or `\fB(( ++\&.\&.\&. ))\fP\&', else the end of the test will not be recognized\&. For the ++\fBfor\fP, \fBrepeat\fP, \fBcase\fP and \fBselect\fP commands no such special form ++for the arguments is necessary, but the other condition (the special form ++of \fIsublist\fP or use of the \fBSHORT_LOOPS\fP option) still applies\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBif\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP [ \fBelif\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP ] \&.\&.\&. [ \fBelse {\fP \fIlist\fP \fB}\fP ] ++An alternate form of \fBif\fP\&. The rules mean that ++.RS ++.PP ++.RS ++.nf ++\fBif [[ \-o ignorebraces ]] { ++ print yes ++}\fP ++.fi ++.RE ++.PP ++works, but ++.PP ++.RS ++.nf ++\fBif true { # Does not work! ++ print yes ++} ++\fP ++.fi ++.RE ++.PP ++does \fInot\fP, since the test is not suitably delimited\&. ++.RE ++.TP ++\fBif\fP \fIlist\fP \fIsublist\fP ++A short form of the alternate `if\&'\&. The same limitations on the form of ++\fIlist\fP apply as for the previous form\&. ++.TP ++\fBfor\fP \fIname\fP \&.\&.\&. \fB(\fP \fIword\fP \&.\&.\&. \fB)\fP \fIsublist\fP ++A short form of \fBfor\fP\&. ++.TP ++\fBfor\fP \fIname\fP \&.\&.\&. [ \fBin\fP \fIword\fP \&.\&.\&. ] \fIterm\fP \fIsublist\fP ++where \fIterm\fP is at least one newline or \fB;\fP\&. ++Another short form of \fBfor\fP\&. ++.TP ++\fBfor ((\fP [\fIexpr1\fP] \fB;\fP [\fIexpr2\fP] \fB;\fP [\fIexpr3\fP] \fB))\fP \fIsublist\fP ++A short form of the arithmetic \fBfor\fP command\&. ++.TP ++\fBforeach\fP \fIname\fP \&.\&.\&. \fB(\fP \fIword\fP \&.\&.\&. \fB)\fP \fIlist\fP \fBend\fP ++Another form of \fBfor\fP\&. ++.TP ++\fBwhile\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP ++An alternative form of \fBwhile\fP\&. Note the limitations on the form of ++\fIlist\fP mentioned above\&. ++.TP ++\fBuntil\fP \fIlist\fP \fB{\fP \fIlist\fP \fB}\fP ++An alternative form of \fBuntil\fP\&. Note the limitations on the form of ++\fIlist\fP mentioned above\&. ++.TP ++\fBrepeat\fP \fIword\fP \fIsublist\fP ++This is a short form of \fBrepeat\fP\&. ++.TP ++\fBcase\fP \fIword\fP \fB{\fP [ [\fB(\fP] \fIpattern\fP [ \fB|\fP \fIpattern\fP ] \&.\&.\&. \fB)\fP \fIlist\fP (\fB;;\fP|\fB;&\fP|\fB;|\fP) ] \&.\&.\&. \fB}\fP ++An alternative form of \fBcase\fP\&. ++.TP ++\fBselect\fP \fIname\fP [ \fBin\fP \fIword\fP \fIterm\fP ] \fIsublist\fP ++where \fIterm\fP is at least one newline or \fB;\fP\&. ++A short form of \fBselect\fP\&. ++.SH "RESERVED WORDS" ++The following words are recognized as reserved words when used as the first ++word of a command unless quoted or disabled using \fBdisable \-r\fP: ++.PP ++\fBdo done esac then elif else fi for case ++if while function repeat time until ++select coproc nocorrect foreach end ! [[ { }\fP ++.PP ++Additionally, `\fB}\fP\&' is recognized in any position if the \fBIGNORE_BRACES\fP option ++is not set\&. ++.SH "COMMENTS" ++In non\-interactive shells, or in interactive shells with the ++\fBINTERACTIVE_COMMENTS\fP option set, a word beginning ++with the third character of the \fBhistchars\fP parameter ++(`\fB#\fP\&' by default) causes that word and all the following ++characters up to a newline to be ignored\&. ++.SH "ALIASING" ++Every token in the shell input is checked to see if there ++is an alias defined for it\&. ++If so, it is replaced by the text of the alias if it is in command ++position (if it could be the first word of a simple command), ++or if the alias is global\&. ++If the text ends with a space, the next word in the shell input ++is treated as though it were in command position for purposes of alias ++expansion\&. ++An alias is defined using the \fBalias\fP builtin; global aliases ++may be defined using the \fB\-g\fP option to that builtin\&. ++.PP ++Alias expansion is done on the shell input before any other expansion ++except history expansion\&. Therefore, if an alias is defined for the ++word \fBfoo\fP, alias expansion may be avoided by quoting part of the ++word, e\&.g\&. \fB\efoo\fP\&. Any form of quoting works, although there is ++nothing to prevent an alias being defined for the quoted form such as ++\fB\efoo\fP as well\&. For use with completion, which would remove an ++initial backslash followed by a character that isn\&'t special, it may be ++more convenient to quote the word by starting with a single quote, ++i\&.e\&. \fB\&'foo\fP; completion will automatically add the trailing single ++quote\&. ++.PP ++There is a commonly encountered problem with aliases ++illustrated by the following code: ++.PP ++.RS ++.nf ++\fBalias echobar=\&'echo bar'; echobar\fP ++.fi ++.RE ++.PP ++This prints a message that the command \fBechobar\fP could not be found\&. ++This happens because aliases are expanded when the code is read in; ++the entire line is read in one go, so that when \fBechobar\fP is executed it ++is too late to expand the newly defined alias\&. This is often ++a problem in shell scripts, functions, and code executed with `\fBsource\fP\&' ++or `\fB\&.\fP\&'\&. Consequently, use of functions rather than aliases is ++recommended in non\-interactive code\&. ++.PP ++Note also the unhelpful interaction of aliases and function definitions: ++.PP ++.RS ++.nf ++\fBalias func=\&'noglob func' ++func() { ++ echo Do something with $* ++}\fP ++.fi ++.RE ++.PP ++Because aliases are expanded in function defintions, this causes the ++following command to be executed: ++.PP ++.RS ++.nf ++\fBnoglob func() { ++ echo Do something with $* ++}\fP ++.fi ++.RE ++.PP ++which defines \fBnoglob\fP as well as \fBfunc\fP as functions with the ++body given\&. To avoid this, either quote the name \fBfunc\fP or use the ++alternative function definition form `\fBfunction func\fP\&'\&. Ensuring the ++alias is defined after the function works but is problematic if the ++code fragment might be re\-executed\&. ++.PP ++.SH "QUOTING" ++A character may be \fIquoted\fP (that is, made ++to stand for itself) by preceding it with a `\fB\e\fP\&'\&. ++`\fB\e\fP\&' followed by a newline is ignored\&. ++.PP ++A string enclosed between `\fB$\&'\fP' and `\fB'\fP' is ++processed the same way as the string arguments of the ++\fBprint\fP builtin, and the resulting string is considered to be ++entirely quoted\&. A literal `\fB\&'\fP' character can be included in the ++string by using the `\fB\e\&'\fP' escape\&. ++.PP ++All characters enclosed between a pair of single quotes (\fB\&''\fP) that ++is not preceded by a `\fB$\fP\&' are quoted\&. A single quote cannot appear ++within single quotes unless the option \fBRC_QUOTES\fP is set, in which case ++a pair of single quotes are turned into a single quote\&. For example, ++.PP ++.RS ++.nf ++\fBprint \&''''\fP ++.fi ++.RE ++.PP ++outputs nothing apart from a newline if \fBRC_QUOTES\fP is not set, but one ++single quote if it is set\&. ++.PP ++Inside double quotes (\fB""\fP), parameter and ++command substitution occur, and `\fB\e\fP\&' quotes the characters ++`\fB\e\fP\&', `\fB`\fP', `\fB"\fP', and `\fB$\fP'\&. ++.\" Yodl file: Zsh/redirect.yo ++.SH "REDIRECTION" ++If a command is followed by \fB&\fP ++and job control is not active, ++then the default standard input ++for the command is the empty file \fB/dev/null\fP\&. ++Otherwise, the environment for the execution of a command contains the ++file descriptors of the invoking shell as modified by ++input/output specifications\&. ++.PP ++The following may appear anywhere in a simple command ++or may precede or follow a complex command\&. ++Expansion occurs before \fIword\fP or \fIdigit\fP ++is used except as noted below\&. ++If the result of substitution on \fIword\fP ++produces more than one filename, ++redirection occurs for each ++separate filename in turn\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB<\fP \fIword\fP ++Open file \fIword\fP for reading as standard input\&. ++.TP ++\fB<>\fP \fIword\fP ++Open file \fIword\fP for reading and writing as standard input\&. ++If the file does not exist then it is created\&. ++.TP ++\fB>\fP \fIword\fP ++Open file \fIword\fP for writing as standard output\&. ++If the file does not exist then it is created\&. ++If the file exists, and the \fBCLOBBER\fP option is unset, ++this causes an error; ++otherwise, it is truncated to zero length\&. ++.TP ++.PD 0 ++\fB>|\fP \fIword\fP ++.TP ++.PD ++\fB>!\fP \fIword\fP ++Same as \fB>\fP, except that the file is truncated to zero length ++if it exists, even if \fBCLOBBER\fP is unset\&. ++.TP ++\fB>>\fP \fIword\fP ++Open file \fIword\fP for writing in append mode as standard output\&. ++If the file does not exist, and the \fBCLOBBER\fP ++option is unset, this causes an error; ++otherwise, the file is created\&. ++.TP ++.PD 0 ++\fB>>|\fP \fIword\fP ++.TP ++.PD ++\fB>>!\fP \fIword\fP ++Same as \fB>>\fP, except that the file is created if it does not ++exist, even if \fBCLOBBER\fP is unset\&. ++.TP ++\fB<<\fP[\fB\-\fP] \fIword\fP ++The shell input is read up to a line that is the same as ++\fIword\fP, or to an end\-of\-file\&. ++No parameter expansion, command substitution or ++filename generation is performed on \fIword\fP\&. ++The resulting document, called a ++\fIhere\-document\fP, becomes the standard input\&. ++.RS ++.PP ++If any character of \fIword\fP is quoted with ++single or double quotes or a `\fB\e\fP\&', ++no interpretation is placed upon the characters of the document\&. ++Otherwise, parameter and command substitution ++occurs, `\fB\e\fP\&' followed by a newline is removed, ++and `\fB\e\fP\&' must be used to quote the characters ++`\fB\e\fP\&', `\fB$\fP', `\fB`\fP' and the first character of \fIword\fP\&. ++.PP ++Note that \fIword\fP itself does not undergo shell expansion\&. Backquotes ++in \fIword\fP do not have their usual effect; instead they behave ++similarly to double quotes, except that the backquotes themselves are ++passed through unchanged\&. (This information is given for completeness ++and it is not recommended that backquotes be used\&.) Quotes in the form ++\fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP have their standard effect of expanding backslashed ++references to special characters\&. ++.PP ++If \fB<<\-\fP is used, then all leading ++tabs are stripped from \fIword\fP and from the document\&. ++.RE ++.TP ++\fB<<<\fP \fIword\fP ++Perform shell expansion on \fIword\fP and pass the result ++to standard input\&. This is known as a \fIhere\-string\fP\&. ++Compare the use of \fIword\fP in here\-documents above, where \fIword\fP ++does not undergo shell expansion\&. ++.TP ++.PD 0 ++\fB<&\fP \fInumber\fP ++.TP ++.PD ++\fB>&\fP \fInumber\fP ++The standard input/output is duplicated from file descriptor ++\fInumber\fP (see \fIdup2\fP(2))\&. ++.TP ++.PD 0 ++\fB<& \-\fP ++.TP ++.PD ++\fB>& \-\fP ++Close the standard input/output\&. ++.TP ++.PD 0 ++\fB<& p\fP ++.TP ++.PD ++\fB>& p\fP ++The input/output from/to the coprocess is moved to the standard input/output\&. ++.TP ++.PD 0 ++\fB>&\fP \fIword\fP ++.TP ++.PD ++\fB&>\fP \fIword\fP ++(Except where `\fB>&\fP \fIword\fP\&' matches one of the above syntaxes; ++`\fB&>\fP\&' can always be used to avoid this ambiguity\&.) ++Redirects both standard output and standard error (file descriptor 2) ++in the manner of `\fB>\fP \fIword\fP\&'\&. ++Note that this does \fInot\fP have the same effect as `\fB>\fP \fIword\fP \fB2>&1\fP\&' ++in the presence of multios (see the section below)\&. ++.TP ++.PD 0 ++\fB>&|\fP \fIword\fP ++.TP ++.PD 0 ++\fB>&!\fP \fIword\fP ++.TP ++.PD 0 ++\fB&>|\fP \fIword\fP ++.TP ++.PD ++\fB&>!\fP \fIword\fP ++Redirects both standard output and standard error (file descriptor 2) ++in the manner of `\fB>|\fP \fIword\fP\&'\&. ++.TP ++.PD 0 ++\fB>>&\fP \fIword\fP ++.TP ++.PD ++\fB&>>\fP \fIword\fP ++Redirects both standard output and standard error (file descriptor 2) ++in the manner of `\fB>>\fP \fIword\fP\&'\&. ++.TP ++.PD 0 ++\fB>>&|\fP \fIword\fP ++.TP ++.PD 0 ++\fB>>&!\fP \fIword\fP ++.TP ++.PD 0 ++\fB&>>|\fP \fIword\fP ++.TP ++.PD ++\fB&>>!\fP \fIword\fP ++Redirects both standard output and standard error (file descriptor 2) ++in the manner of `\fB>>|\fP \fIword\fP\&'\&. ++.PP ++If one of the above is preceded by a digit, then the file ++descriptor referred to is that specified by the digit ++instead of the default 0 or 1\&. ++The order in which redirections are specified is significant\&. ++The shell evaluates each redirection in terms of the ++(\fIfile descriptor\fP, \fIfile\fP) ++association at the time of evaluation\&. ++For example: ++.PP ++.RS ++.nf ++\&.\&.\&. \fB1>\fP\fIfname\fP \fB2>&1\fP ++.fi ++.RE ++.PP ++first associates file descriptor 1 with file \fIfname\fP\&. ++It then associates file descriptor 2 with the file associated with file ++descriptor 1 (that is, \fIfname\fP)\&. ++If the order of redirections were reversed, ++file descriptor 2 would be associated ++with the terminal (assuming file descriptor 1 had been) ++and then file descriptor 1 would be associated with file \fIfname\fP\&. ++.PP ++The `\fB|&\fP\&' command separator described in ++\fISimple Commands & Pipelines\fP in \fIzshmisc\fP(1) ++is a shorthand for `\fB2>&1 |\fP\&'\&. ++.PP ++The various forms of process substitution, `\fB<(\fP\fIlist\fP\fB)\fP\&', ++and `\fB=(\fP\fIlist\fP())\&' for input and ++`\fB>(\fP\fIlist\fP\fB)\fP\&' for output, are often used together with ++redirection\&. For example, if \fIword\fP in an output redirection is of the ++form `\fB>(\fP\fIlist\fP\fB)\fP\&' then the output is piped to the ++command represented by \fIlist\fP\&. See ++\fIProcess Substitution\fP in \fIzshexpn\fP(1)\&. ++.SH "OPENING FILE DESCRIPTORS USING PARAMETERS" ++.PP ++When the shell is parsing arguments to a command, and the shell option ++\fBIGNORE_BRACES\fP is not set, a different form of redirection is allowed: ++instead of a digit before the operator there is a valid shell identifier ++enclosed in braces\&. The shell will open a new file descriptor that ++is guaranteed to be at least 10 and set the parameter named by the ++identifier to the file descriptor opened\&. No whitespace is allowed ++between the closing brace and the redirection character\&. For example: ++.PP ++.RS ++.nf ++\&.\&.\&. {myfd}>&1 ++.fi ++.RE ++.PP ++This opens a new file descriptor that is a duplicate of file descriptor ++1 and sets the parameter \fBmyfd\fP to the number of the file descriptor, ++which will be at least 10\&. The new file descriptor can be written to using ++the syntax \fB>&$myfd\fP\&. ++.PP ++The syntax \fB{\fP\fIvarid\fP\fB}>&\-\fP, for example \fB{myfd}>&\-\fP, may be used ++to close a file descriptor opened in this fashion\&. Note that the ++parameter given by \fIvarid\fP must previously be set to a file descriptor ++in this case\&. ++.PP ++It is an error to open or close a file descriptor in this fashion when the ++parameter is readonly\&. However, it is not an error to read or write a file ++descriptor using \fB<&$\fP\fIparam\fP or \fB>&$\fP\fIparam\fP if \fIparam\fP is ++readonly\&. ++.PP ++If the option \fBCLOBBER\fP is unset, it is an error to open a file ++descriptor using a parameter that is already set to an open file descriptor ++previously allocated by this mechanism\&. Unsetting the parameter before ++using it for allocating a file descriptor avoids the error\&. ++.PP ++Note that this mechanism merely allocates or closes a file descriptor; it ++does not perform any redirections from or to it\&. It is usually convenient ++to allocate a file descriptor prior to use as an argument to \fBexec\fP\&. ++The syntax does not in any case work when used around complex commands ++such as parenthesised subshells or loops, where the opening brace is ++interpreted as part of a command list to be executed in the current shell\&. ++.PP ++The following shows a typical sequence of allocation, use, and closing of a ++file descriptor: ++.PP ++.RS ++.nf ++\fBinteger myfd ++exec {myfd}>~/logs/mylogfile\&.txt ++print This is a log message\&. >&$myfd ++exec {myfd}>&\-\fP ++.fi ++.RE ++.PP ++Note that the expansion of the variable in the expression \fB>&$myfd\fP ++occurs at the point the redirection is opened\&. This is after the expansion ++of command arguments and after any redirections to the left on the command ++line have been processed\&. ++.SH "MULTIOS" ++If the user tries to open a file descriptor for writing more than once, ++the shell opens the file descriptor as a pipe to a process that copies ++its input to all the specified outputs, similar to \fBtee\fP, ++provided the \fBMULTIOS\fP option is set, as it is by default\&. Thus: ++.PP ++.RS ++.nf ++\fBdate >foo >bar\fP ++.fi ++.RE ++.PP ++writes the date to two files, named `\fBfoo\fP\&' and `\fBbar\fP'\&. ++Note that a pipe is an implicit redirection; thus ++.PP ++.RS ++.nf ++\fBdate >foo | cat\fP ++.fi ++.RE ++.PP ++writes the date to the file `\fBfoo\fP\&', and also pipes it to cat\&. ++.PP ++If the \fBMULTIOS\fP ++option is set, the word after a redirection operator is also subjected ++to filename generation (globbing)\&. Thus ++.PP ++.RS ++.nf ++\fB: > *\fP ++.fi ++.RE ++.PP ++will truncate all files in the current directory, ++assuming there\&'s at least one\&. (Without the \fBMULTIOS\fP ++option, it would create an empty file called `\fB*\fP\&'\&.) ++Similarly, you can do ++.PP ++.RS ++.nf ++\fBecho exit 0 >> *\&.sh\fP ++.fi ++.RE ++.PP ++If the user tries to open a file descriptor for reading more than once, ++the shell opens the file descriptor as a pipe to a process that copies ++all the specified inputs to its output in the order ++specified, similar to \fBcat\fP, ++provided the \fBMULTIOS\fP option is set\&. Thus ++.PP ++.RS ++.nf ++\fBsort &$myfd\fP\&. ++.PP ++Note that a pipe is an implicit redirection; thus ++.PP ++.RS ++.nf ++\fBcat bar | sort bar > baz\fP ++.fi ++.RE ++.PP ++when \fBMULTIOS\fP is unset will truncate bar, and write `\fBfoo\fP\&' into baz\&. ++.PP ++There is a problem when an output multio is attached to an external ++program\&. A simple example shows this: ++.PP ++.RS ++.nf ++\fBcat file >file1 >file2 ++cat file1 file2\fP ++.fi ++.RE ++.PP ++Here, it is possible that the second `\fBcat\fP\&' will not display the full ++contents of \fBfile1\fP and \fBfile2\fP (i\&.e\&. the original contents of ++\fBfile\fP repeated twice)\&. ++.PP ++The reason for this is that the multios are spawned after the \fBcat\fP ++process is forked from the parent shell, so the parent shell does not ++wait for the multios to finish writing data\&. This means the command as ++shown can exit before \fBfile1\fP and \fBfile2\fP are completely written\&. ++As a workaround, it is possible to run the \fBcat\fP process as part of a ++job in the current shell: ++.PP ++.RS ++.nf ++\fB{ cat file } >file >file2\fP ++.fi ++.RE ++.PP ++Here, the \fB{\fP\fI\&.\&.\&.\fP\fB}\fP job will pause to wait for both files to be ++written\&. ++.PP ++.SH "REDIRECTIONS WITH NO COMMAND" ++When a simple command consists of one or more redirection operators ++and zero or more parameter assignments, but no command name, zsh can ++behave in several ways\&. ++.PP ++If the parameter \fBNULLCMD\fP is not set or the option \fBCSH_NULLCMD\fP is ++set, an error is caused\&. This is the \fBcsh\fP behavior and \fBCSH_NULLCMD\fP ++is set by default when emulating \fBcsh\fP\&. ++.PP ++If the option \fBSH_NULLCMD\fP is set, the builtin `\fB:\fP\&' is inserted as a ++command with the given redirections\&. This is the default when emulating ++\fBsh\fP or \fBksh\fP\&. ++.PP ++Otherwise, if the parameter \fBNULLCMD\fP is set, its value will be used as a ++command with the given redirections\&. If both \fBNULLCMD\fP and ++\fBREADNULLCMD\fP are set, then the value of the latter will be used instead ++of that of the former when the redirection is an input\&. The default for ++\fBNULLCMD\fP is `\fBcat\fP\&' and for \fBREADNULLCMD\fP is `\fBmore\fP'\&. Thus ++.PP ++.RS ++.nf ++\fB< file\fP ++.fi ++.RE ++.PP ++shows the contents of \fBfile\fP on standard output, with paging if that is a ++terminal\&. \fBNULLCMD\fP and \fBREADNULLCMD\fP may refer to shell functions\&. ++.PP ++.\" Yodl file: Zsh/exec.yo ++.SH "COMMAND EXECUTION" ++If a command name contains no slashes, the shell attempts to locate ++it\&. If there exists a shell function by that name, the function ++is invoked as described in the section `Functions\&'\&. If there exists ++a shell builtin by that name, the builtin is invoked\&. ++.PP ++Otherwise, the shell searches each element of \fB$path\fP for a ++directory containing an executable file by that name\&. If the ++search is unsuccessful, the shell prints an error message and returns ++a nonzero exit status\&. ++.PP ++If execution fails because the file is not in executable format, ++and the file is not a directory, it is assumed to be a shell ++script\&. \fB/bin/sh\fP is spawned to execute it\&. If the program ++is a file beginning with `\fB#!\fP\&', the remainder of the first line ++specifies an interpreter for the program\&. The shell will ++execute the specified interpreter on operating systems that do ++not handle this executable format in the kernel\&. ++.PP ++If no external command is found but a function \fBcommand_not_found_handler\fP ++exists the shell executes this function with all ++command line arguments\&. The function should return status zero if it ++successfully handled the command, or non\-zero status if it failed\&. ++In the latter case the standard handling is applied: `command not ++found\&' is printed to standard error and the shell exits with status 127\&. ++Note that the handler is executed in a subshell forked to execute ++an external command, hence changes to directories, shell parameters, ++etc\&. have no effect on the main shell\&. ++.\" Yodl file: Zsh/func.yo ++.SH "FUNCTIONS" ++Shell functions are defined with the \fBfunction\fP reserved word or the ++special syntax `\fIfuncname\fP \fB()\fP\&'\&. ++Shell functions are read in and stored internally\&. ++Alias names are resolved when the function is read\&. ++Functions are executed like commands with the arguments ++passed as positional parameters\&. ++(See the section `Command Execution\&'\&.) ++.PP ++Functions execute in the same process as the caller and ++share all files ++and present working directory with the ++caller\&. A trap on \fBEXIT\fP set inside a function ++is executed after the function completes in the environment ++of the caller\&. ++.PP ++The \fBreturn\fP builtin is used to return from function calls\&. ++.PP ++Function identifiers can be listed with the \fBfunctions\fP builtin\&. ++Functions can be undefined with the \fBunfunction\fP builtin\&. ++.SH "AUTOLOADING FUNCTIONS" ++.PP ++A function can be marked as \fIundefined\fP using the \fBautoload\fP builtin ++(or `\fBfunctions \-u\fP\&' or `\fBtypeset \-fu\fP')\&. Such a function has no ++body\&. When the function is first executed, the shell searches for its ++definition using the elements of the \fBfpath\fP variable\&. Thus to define ++functions for autoloading, a typical sequence is: ++.PP ++.RS ++.nf ++\fBfpath=(~/myfuncs $fpath) ++autoload myfunc1 myfunc2 \&.\&.\&.\fP ++.fi ++.RE ++.PP ++The usual alias expansion during reading will be suppressed if the ++\fBautoload\fP builtin or its equivalent is given the option \fB\-U\fP\&. This is ++recommended for the use of functions supplied with the zsh distribution\&. ++Note that for functions precompiled with the \fBzcompile\fP builtin command ++the flag \fB\-U\fP must be provided when the \fB\&.zwc\fP file is created, as the ++corresponding information is compiled into the latter\&. ++.PP ++For each \fIelement\fP in \fBfpath\fP, the shell looks for three possible ++files, the newest of which is used to load the definition for the function: ++.PP ++.PD 0 ++.TP ++.PD ++\fIelement\fP\fB\&.zwc\fP ++A file created with the \fBzcompile\fP builtin command, which is expected to ++contain the definitions for all functions in the directory named ++\fIelement\fP\&. The file is treated in the same manner as a directory ++containing files for functions and is searched for the definition of the ++function\&. If the definition is not found, the search for a definition ++proceeds with the other two possibilities described below\&. ++.RS ++.PP ++If \fIelement\fP already includes a \fB\&.zwc\fP extension (i\&.e\&. the extension ++was explicitly given by the user), \fIelement\fP is searched for the ++definition of the function without comparing its age to that of other ++files; in fact, there does not need to be any directory named \fIelement\fP ++without the suffix\&. Thus including an element such as ++`\fB/usr/local/funcs\&.zwc\fP\&' in \fBfpath\fP will speed up the search for ++functions, with the disadvantage that functions included must be explicitly ++recompiled by hand before the shell notices any changes\&. ++.RE ++.TP ++\fIelement\fP\fB/\fP\fIfunction\fP\fB\&.zwc\fP ++A file created with \fBzcompile\fP, which is expected to contain the ++definition for \fIfunction\fP\&. It may include other function definitions ++as well, but those are neither loaded nor executed; a file found in this ++way is searched \fIonly\fP for the definition of \fIfunction\fP\&. ++.TP ++\fIelement\fP\fB/\fP\fIfunction\fP ++A file of zsh command text, taken to be the definition for \fIfunction\fP\&. ++.PP ++In summary, the order of searching is, first, in the \fIparents of\fP ++directories in \fBfpath\fP for the newer of either a compiled directory or ++a directory in \fBfpath\fP; second, if more than one of these contains a ++definition for the function that is sought, the leftmost in the \fBfpath\fP ++is chosen; and third, within a directory, the newer of either a compiled ++function or an ordinary function definition is used\&. ++.PP ++If the \fBKSH_AUTOLOAD\fP option is set, or the file contains only a ++simple definition of the function, the file\&'s contents will be executed\&. ++This will normally define the function in question, but may also perform ++initialization, which is executed in the context of the function execution, ++and may therefore define local parameters\&. It is an error if the function ++is not defined by loading the file\&. ++.PP ++Otherwise, the function body (with no surrounding `\fIfuncname\fP\fB() ++{\fP\fI\&.\&.\&.\fP\fB}\fP\&') is taken to be the complete contents of the file\&. This ++form allows the file to be used directly as an executable shell script\&. If ++processing of the file results in the function being re\-defined, the ++function itself is not re\-executed\&. To force the shell to perform ++initialization and then call the function defined, the file should contain ++initialization code (which will be executed then discarded) in addition to ++a complete function definition (which will be retained for subsequent calls ++to the function), and a call to the shell function, including any ++arguments, at the end\&. ++.PP ++For example, suppose the autoload file \fBfunc\fP contains ++.PP ++.RS ++.nf ++\fBfunc() { print This is func; } ++print func is initialized ++\fP ++.fi ++.RE ++.PP ++then `\fBfunc; func\fP\&' with \fBKSH_AUTOLOAD\fP set will produce both messages ++on the first call, but only the message `\fBThis is func\fP\&' on the second ++and subsequent calls\&. Without \fBKSH_AUTOLOAD\fP set, it will produce ++the initialization message on the first call, and the other message on the ++second and subsequent calls\&. ++.PP ++It is also possible to create a function that is not marked as autoloaded, ++but which loads its own definition by searching \fBfpath\fP, by using ++`\fBautoload \-X\fP\&' within a shell function\&. For example, the following are ++equivalent: ++.PP ++.RS ++.nf ++\fBmyfunc() { ++ autoload \-X ++} ++myfunc args\&.\&.\&.\fP ++.fi ++.RE ++.PP ++and ++.PP ++.RS ++.nf ++\fBunfunction myfunc # if myfunc was defined ++autoload myfunc ++myfunc args\&.\&.\&.\fP ++.fi ++.RE ++.PP ++In fact, the \fBfunctions\fP command outputs `\fBbuiltin autoload \-X\fP\&' as ++the body of an autoloaded function\&. This is done so that ++.PP ++.RS ++.nf ++\fBeval "$(functions)"\fP ++.fi ++.RE ++.PP ++produces a reasonable result\&. A true autoloaded function can be ++identified by the presence of the comment `\fB# undefined\fP\&' in the body, ++because all comments are discarded from defined functions\&. ++.PP ++To load the definition of an autoloaded function \fBmyfunc\fP without ++executing \fBmyfunc\fP, use: ++.PP ++.RS ++.nf ++\fBautoload +X myfunc\fP ++.fi ++.RE ++.PP ++.SH "ANONYMOUS FUNCTIONS" ++.PP ++If no name is given for a function, it is `anonymous\&' and is handled ++specially\&. Either form of function definition may be used: a `\fB()\fP\&' with ++no preceding name, or a `\fBfunction\fP\&' with an immediately following open ++brace\&. The function is executed immediately at the point of definition and ++is not stored for future use\&. The function name is set to `\fB(anon)\fP\&'\&. ++.PP ++Arguments to the function may be specified as words following the ++closing brace defining the function, hence if there are none no ++arguments (other than \fB$0\fP) are set\&. This is a difference from the ++way other functions are parsed: normal function definitions may be ++followed by certain keywords such as `\fBelse\fP\&' or `\fBfi\fP', which will ++be treated as arguments to anonymous functions, so that a newline or ++semicolon is needed to force keyword interpretation\&. ++.PP ++Note also that the argument list of any enclosing script or function is ++hidden (as would be the case for any other function called at this ++point)\&. ++.PP ++Redirections may be applied to the anonymous function in the same manner as ++to a current\-shell structure enclosed in braces\&. The main use of anonymous ++functions is to provide a scope for local variables\&. This is particularly ++convenient in start\-up files as these do not provide their own local ++variable scope\&. ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBvariable=outside ++function { ++ local variable=inside ++ print "I am $variable with arguments $*" ++} this and that ++print "I am $variable"\fP ++.fi ++.RE ++.PP ++outputs the following: ++.PP ++.RS ++.nf ++\fBI am inside with arguments this and that ++I am outside\fP ++.fi ++.RE ++.PP ++Note that function definitions with arguments that expand to nothing, ++for example `\fBname=; function $name { \fP\fI\&.\&.\&.\fP\fB }\fP\&', are not ++treated as anonymous functions\&. Instead, they are treated as normal ++function definitions where the definition is silently discarded\&. ++.PP ++.SH "SPECIAL FUNCTIONS" ++Certain functions, if defined, have special meaning to the shell\&. ++.PP ++.SS "Hook Functions" ++.PP ++For the functions below, it is possible to define an array that has the ++same name as the function with `\fB_functions\fP\&' appended\&. Any element in ++such an array is taken as the name of a function to execute; it is executed ++in the same context and with the same arguments as the basic function\&. For ++example, if \fB$chpwd_functions\fP is an array containing the values ++`\fBmychpwd\fP\&', `\fBchpwd_save_dirstack\fP', then the shell attempts to ++execute the functions `\fBchpwd\fP\&', `\fBmychpwd\fP' and ++`\fBchpwd_save_dirstack\fP\&', in that order\&. Any function that does not exist ++is silently ignored\&. A function found by this mechanism is referred to ++elsewhere as a `hook function\&'\&. An error in any function causes subsequent ++functions not to be run\&. Note further that an error in a \fBprecmd\fP hook ++causes an immediately following \fBperiodic\fP function not to run (though ++it may run at the next opportunity)\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBchpwd\fP ++Executed whenever the current working directory is changed\&. ++.TP ++\fBperiodic\fP ++If the parameter \fBPERIOD\fP ++is set, this function is executed every \fB$PERIOD\fP ++seconds, just before a prompt\&. Note that if multiple functions ++are defined using the array \fBperiodic_functions\fP only one ++period is applied to the complete set of functions, and the ++scheduled time is not reset if the list of functions is altered\&. ++Hence the set of functions is always called together\&. ++.TP ++\fBprecmd\fP ++Executed before each prompt\&. Note that precommand functions are not ++re\-executed simply because the command line is redrawn, as happens, for ++example, when a notification about an exiting job is displayed\&. ++.TP ++\fBpreexec\fP ++Executed just after a command has been read and is about to be ++executed\&. If the history mechanism is active (and the line was not ++discarded from the history buffer), the string that the user typed is ++passed as the first argument, otherwise it is an empty string\&. The ++actual command that will be executed (including expanded aliases) is ++passed in two different forms: the second argument is a single\-line, ++size\-limited version of the command (with things like function bodies ++elided); the third argument contains the full text that is being ++executed\&. ++.TP ++\fBzshaddhistory\fP ++Executed when a history line has been read interactively, but ++before it is executed\&. The sole argument is the complete history ++line (so that any terminating newline will still be present)\&. ++.RS ++.PP ++If any of the hook functions return a non\-zero value the history ++line will not be saved, although it lingers in the history until the ++next line is executed allow you to reuse or edit it immediately\&. ++.PP ++A hook function may call `\fBfc \-p\fP \fI\&.\&.\&.\fP\&' to switch the history ++context so that the history is saved in a different file from the ++that in the global \fBHISTFILE\fP parameter\&. This is handled specially: ++the history context is automatically restored after the processing ++of the history line is finished\&. ++.PP ++The following example function first adds the history line to the normal ++history with the newline stripped, which is usually the correct behaviour\&. ++Then it switches the history context so that the line will ++be written to a history file in the current directory\&. ++.PP ++.RS ++.nf ++\fBzshaddhistory() { ++ print \-sr \-\- ${1%%$\&'\en'} ++ fc \-p \&.zsh_local_history ++}\fP ++.fi ++.RE ++.RE ++.TP ++\fBzshexit\fP ++Executed at the point where the main shell is about to exit normally\&. ++This is not called by exiting subshells, nor when the \fBexec\fP ++precommand modifier is used before an external command\&. Also, unlike ++\fBTRAPEXIT\fP, it is not called when functions exit\&. ++.PP ++.SS "Trap Functions" ++.PP ++The functions below are treated specially but do not have corresponding ++hook arrays\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBTRAP\fP\fINAL\fP ++If defined and non\-null, ++this function will be executed whenever the shell ++catches a signal \fBSIG\fP\fINAL\fP, where \fINAL\fP is a signal ++name as specified for the \fBkill\fP builtin\&. ++The signal number will be passed as the first parameter to the function\&. ++.RS ++.PP ++If a function of this form is defined and null, ++the shell and processes spawned by it will ignore \fBSIG\fP\fINAL\fP\&. ++.PP ++The return status from the function is handled specially\&. If it is ++zero, the signal is assumed to have been handled, and execution continues ++normally\&. Otherwise, the shell will behave as interrupted except that ++the return status of the trap is retained\&. ++.PP ++Programs terminated by uncaught signals typically return the status 128 ++plus the signal number\&. Hence the following causes the handler for ++\fBSIGINT\fP to print a message, then mimic the usual effect of the signal\&. ++.PP ++.RS ++.nf ++\fBTRAPINT() { ++ print "Caught SIGINT, aborting\&." ++ return $(( 128 + $1 )) ++}\fP ++.fi ++.RE ++.PP ++The functions \fBTRAPZERR\fP, \fBTRAPDEBUG\fP and \fBTRAPEXIT\fP are never ++executed inside other traps\&. ++.RE ++.TP ++\fBTRAPDEBUG\fP ++If the option \fBDEBUG_BEFORE_CMD\fP is set (as it is by default), executed ++before each command; otherwise executed after each command\&. See ++the description of the \fBtrap\fP builtin in ++\fIzshbuiltins\fP(1) for details of additional features provided ++in debug traps\&. ++.TP ++\fBTRAPEXIT\fP ++Executed when the shell exits, ++or when the current function exits if defined inside a function\&. ++The value of \fB$?\fP at the start of execution is the exit status of the ++shell or the return status of the function exiting\&. ++.TP ++\fBTRAPZERR\fP ++Executed whenever a command has a non\-zero exit status\&. However, the ++function is not executed if the command occurred in a sublist followed by ++`\fB&&\fP\&' or `\fB||\fP'; only the final command in a sublist of this type ++causes the trap to be executed\&. The function \fBTRAPERR\fP acts the same as ++\fBTRAPZERR\fP on systems where there is no \fBSIGERR\fP (this is the usual ++case)\&. ++.PP ++The functions beginning `\fBTRAP\fP\&' may alternatively be defined with the ++\fBtrap\fP builtin: this may be preferable for some uses\&. Setting a trap ++with one form removes any trap of the other form for the same signal; ++removing a trap in either form removes all traps for the same signal\&. ++The forms ++.PP ++.RS ++.nf ++\fBTRAPNAL() { ++ # code ++}\fP ++.fi ++.RE ++.PP ++(\&'function traps') and ++.PP ++.RS ++.nf ++\fBtrap \&' ++ # code ++\&' NAL\fP ++.fi ++.RE ++.PP ++(\&'list traps') are equivalent in most ways, the exceptions being the ++following: ++.PP ++.PD 0 ++.TP ++.PD ++\(bu ++Function traps have all the properties of normal functions, ++appearing in the list of functions and being called with their own ++function context rather than the context where the trap was triggered\&. ++.TP ++\(bu ++The return status from function traps is special, whereas a return ++from a list trap causes the surrounding context to return with the given ++status\&. ++.TP ++\(bu ++Function traps are not reset within subshells, in accordance with ++zsh behaviour; list traps are reset, in accordance with POSIX ++behaviour\&. ++.\" Yodl file: Zsh/jobs.yo ++.SH "JOBS" ++If the \fBMONITOR\fP option is set, ++an interactive shell associates a \fIjob\fP with each pipeline\&. ++It keeps a table of current jobs, printed by the \fBjobs\fP ++command, and assigns them small integer numbers\&. ++When a job is started asynchronously with `\fB&\fP\&', ++the shell prints a line to standard error which looks like: ++.PP ++.RS ++.nf ++\fB[1] 1234\fP ++.fi ++.RE ++.PP ++indicating that the job which was started asynchronously was job number ++1 and had one (top\-level) process, whose process ID was 1234\&. ++.PP ++If a job is started with `\fB&|\fP\&' or `\fB&!\fP', ++then that job is immediately disowned\&. After startup, it ++does not have a place in the job table, and is not subject ++to the job control features described here\&. ++.PP ++If you are running a job and wish to do something else you may hit the key ++^Z (control\-Z) which sends a \fBTSTP\fP signal to the current job: this key ++may be redefined by the \fBsusp\fP option of the external \fBstty\fP command\&. ++The shell will then normally indicate that the job has been `suspended\&', ++and print another prompt\&. You can then manipulate the state of this job, ++putting it in the background with the \fBbg\fP command, or run some other ++commands and then eventually bring the job back into the foreground with ++the foreground command \fBfg\fP\&. A ^Z takes effect immediately and ++is like an interrupt in that pending output and unread input are discarded ++when it is typed\&. ++.PP ++A job being run in the background will suspend if it tries to read ++from the terminal\&. ++Background jobs are normally allowed to produce output, ++but this can be disabled by giving the command `\fBstty tostop\fP\&'\&. ++If you set this ++tty option, then background jobs will suspend when they try to produce ++output like they do when they try to read input\&. ++.PP ++When a command is suspended and continued later with the \fBfg\fP or ++\fBwait\fP builtins, zsh restores tty modes that were in effect when it was ++suspended\&. This (intentionally) does not apply if the command is ++continued via `\fBkill \-CONT\fP\&', nor when it is continued with \fBbg\fP\&. ++.PP ++There are several ways to refer to jobs in the shell\&. ++A job can be referred to by the process ID of any process of the job ++or by one of the following: ++.PP ++.PD 0 ++.TP ++\fB%\fP\fInumber\fP ++The job with the given number\&. ++.TP ++\fB%\fP\fIstring\fP ++Any job whose command line begins with \fIstring\fP\&. ++.TP ++\fB%?\fP\fIstring\fP ++Any job whose command line contains \fIstring\fP\&. ++.TP ++\fB%%\fP ++Current job\&. ++.TP ++\fB%+\fP ++Equivalent to `\fB%%\fP\&'\&. ++.TP ++\fB%\-\fP ++Previous job\&. ++.PD ++.PP ++The shell learns immediately whenever a process changes state\&. ++It normally informs you whenever a job becomes blocked so that ++no further progress is possible\&. If the \fBNOTIFY\fP option is not set, ++it waits until just before it prints a prompt before it informs you\&. ++All such notifications are sent directly to the terminal, not to ++the standard output or standard error\&. ++.PP ++When the monitor mode is on, each background job that completes ++triggers any trap set for \fBCHLD\fP\&. ++.PP ++When you try to leave the shell while jobs are running or suspended, you will ++be warned that `You have suspended (running) jobs\&'\&. ++You may use the \fBjobs\fP command to see what they are\&. ++If you do this or immediately try to ++exit again, the shell will not warn you a second time; the suspended ++jobs will be terminated, and the running jobs will be sent ++a \fBSIGHUP\fP signal, if the \fBHUP\fP option is set\&. ++.PP ++To avoid having the shell terminate the running jobs, either ++use the \fBnohup\fP command (see \fInohup\fP(1)) ++or the \fBdisown\fP builtin\&. ++.SH "SIGNALS" ++The \fBINT\fP and \fBQUIT\fP signals for an invoked ++command are ignored if the command is followed by ++`\fB&\fP\&' and the \fBMONITOR\fP option is not active\&. ++The shell itself always ignores the \fBQUIT\fP signal\&. ++Otherwise, signals have the values ++inherited by the shell from its parent ++(but see the \fBTRAP\fP\fINAL\fP special functions in the section `Functions\&')\&. ++.\" Yodl file: Zsh/arith.yo ++.SH "ARITHMETIC EVALUATION" ++The shell can perform integer and floating point arithmetic, either using ++the builtin \fBlet\fP, or via a substitution of the form \fB$((\&.\&.\&.))\fP\&. For ++integers, the shell is usually compiled to use 8\-byte precision where this ++is available, otherwise precision is 4 bytes\&. This can be tested, for ++example, by giving the command `\fBprint \- $(( 12345678901 ))\fP\&'; if the ++number appears unchanged, the precision is at least 8 bytes\&. Floating ++point arithmetic always uses the `double\&' type with whatever corresponding ++precision is provided by the compiler and the library\&. ++.PP ++The \fBlet\fP builtin command takes arithmetic expressions as arguments; each ++is evaluated separately\&. Since many of the arithmetic operators, as well ++as spaces, require quoting, an alternative form is provided: for any ++command which begins with a `\fB((\fP\&', all the characters until a ++matching `\fB))\fP\&' are treated as a quoted expression and ++arithmetic expansion performed as for an argument of \fBlet\fP\&. More ++precisely, `\fB((\fP\fI\&.\&.\&.\fP\fB))\fP\&' is equivalent to ++`\fBlet "\fP\fI\&.\&.\&.\fP\fB"\fP\&'\&. The return status is 0 if the arithmetic value ++of the expression is non\-zero, 1 if it is zero, and 2 if an error occurred\&. ++.PP ++For example, the following statement ++.PP ++.RS ++.nf ++\fB(( val = 2 + 1 ))\fP ++.fi ++.RE ++.PP ++is equivalent to ++.PP ++.RS ++.nf ++\fBlet "val = 2 + 1"\fP ++.fi ++.RE ++.PP ++both assigning the value 3 to the shell variable \fBval\fP and returning a ++zero status\&. ++.PP ++Integers can be in bases other than 10\&. ++A leading `\fB0x\fP\&' or `\fB0X\fP' denotes hexadecimal\&. ++Integers may also be of the form `\fIbase\fP\fB#\fP\fIn\fP\&', ++where \fIbase\fP is a decimal number between two and thirty\-six ++representing the arithmetic base and \fIn\fP ++is a number in that base (for example, `\fB16#ff\fP\&' is 255 in hexadecimal)\&. ++The \fIbase\fP\fB#\fP may also be omitted, in which case ++base 10 is used\&. For backwards compatibility the form ++`\fB[\fP\fIbase\fP\fB]\fP\fIn\fP\&' is also accepted\&. ++.PP ++It is also possible to specify a base to be used for output in the form ++`\fB[#\fP\fIbase\fP\fB]\fP\&', for example `\fB[#16]\fP'\&. This is used when ++outputting arithmetical substitutions or when assigning to scalar ++parameters, but an explicitly defined integer or floating point parameter ++will not be affected\&. If an integer variable is implicitly defined by an ++arithmetic expression, any base specified in this way will be set as the ++variable\&'s output arithmetic base as if the option `\fB\-i\fP \fIbase\fP' to ++the \fBtypeset\fP builtin had been used\&. The expression has no precedence ++and if it occurs more than once in a mathematical expression, the last ++encountered is used\&. For clarity it is recommended that it appear at the ++beginning of an expression\&. As an example: ++.PP ++.RS ++.nf ++\fBtypeset \-i 16 y ++print $(( [#8] x = 32, y = 32 )) ++print $x $y\fP ++.fi ++.RE ++.PP ++outputs first `\fB8#40\fP\&', the rightmost value in the given output base, and ++then `\fB8#40 16#20\fP\&', because \fBy\fP has been explicitly declared to ++have output base 16, while \fBx\fP (assuming it does not already exist) is ++implicitly typed by the arithmetic evaluation, where it acquires the output ++base 8\&. ++.PP ++If the \fBC_BASES\fP option is set, hexadecimal numbers in the standard C ++format, for example \fB0xFF\fP instead of the usual `\fB16#FF\fP\&'\&. If the ++option \fBOCTAL_ZEROES\fP is also set (it is not by default), octal numbers ++will be treated similarly and hence appear as `\fB077\fP\&' instead of ++`\fB8#77\fP\&'\&. This option has no effect on the output of bases other than ++hexadecimal and octal, and these formats are always understood on input\&. ++.PP ++When an output base is specified using the `\fB[#\fP\fIbase\fP\fB]\fP\&' syntax, ++an appropriate base prefix will be output if necessary, so that the value ++output is valid syntax for input\&. If the \fB#\fP is doubled, for example ++`\fB[##16]\fP\&', then no base prefix is output\&. ++.PP ++Floating point constants are recognized by the presence of a decimal point ++or an exponent\&. The decimal point may be the first character of the ++constant, but the exponent character \fBe\fP or \fBE\fP may not, as it will be ++taken for a parameter name\&. ++.PP ++An arithmetic expression uses nearly the same syntax and ++associativity of expressions as in C\&. ++.PP ++In the native mode of operation, the following operators are supported ++(listed in decreasing order of precedence): ++.PP ++.PD 0 ++.TP ++\fB+ \- ! ~ ++ \-\-\fP ++unary plus/minus, logical NOT, complement, {pre,post}{in,de}crement ++.TP ++\fB<< >>\fP ++bitwise shift left, right ++.TP ++\fB&\fP ++bitwise AND ++.TP ++\fB^\fP ++bitwise XOR ++.TP ++\fB|\fP ++bitwise OR ++.TP ++\fB**\fP ++exponentiation ++.TP ++\fB* / %\fP ++multiplication, division, modulus (remainder) ++.TP ++\fB+ \-\fP ++addition, subtraction ++.TP ++\fB< > <= >=\fP ++comparison ++.TP ++\fB== !=\fP ++equality and inequality ++.TP ++\fB&&\fP ++logical AND ++.TP ++\fB|| ^^\fP ++logical OR, XOR ++.TP ++\fB? :\fP ++ternary operator ++.TP ++\fB= += \-= *= /= %= &= ^= |= <<= >>= &&= ||= ^^= **=\fP ++assignment ++.TP ++\fB,\fP ++comma operator ++.PD ++.PP ++The operators `\fB&&\fP\&', `\fB||\fP', `\fB&&=\fP', and `\fB||=\fP' are ++short\-circuiting, and only one of the latter two expressions in a ternary ++operator is evaluated\&. Note the precedence of the bitwise AND, OR, ++and XOR operators\&. ++.PP ++With the option \fBC_PRECEDENCES\fP the precedences (but no other ++properties) of the operators are altered to be the same as those in ++most other languages that support the relevant operators: ++.PP ++.PD 0 ++.TP ++\fB+ \- ! ~ ++ \-\-\fP ++unary plus/minus, logical NOT, complement, {pre,post}{in,de}crement ++.TP ++\fB**\fP ++exponentiation ++.TP ++\fB* / %\fP ++multiplication, division, modulus (remainder) ++.TP ++\fB+ \-\fP ++addition, subtraction ++.TP ++\fB<< >>\fP ++bitwise shift left, right ++.TP ++\fB< > <= >=\fP ++comparison ++.TP ++\fB== !=\fP ++equality and inequality ++.TP ++\fB&\fP ++bitwise AND ++.TP ++\fB^\fP ++bitwise XOR ++.TP ++\fB|\fP ++bitwise OR ++.TP ++\fB&&\fP ++logical AND ++.TP ++\fB^^\fP ++logical XOR ++.TP ++\fB||\fP ++logical OR ++.TP ++\fB? :\fP ++ternary operator ++.TP ++\fB= += \-= *= /= %= &= ^= |= <<= >>= &&= ||= ^^= **=\fP ++assignment ++.TP ++\fB,\fP ++comma operator ++.PD ++.PP ++Note the precedence of exponentiation in both cases is below ++that of unary operators, hence `\fB\-3**2\fP\&' evaluates as `\fB9\fP', not ++\fB\-9\fP\&. Use parentheses where necessary: `\fB\-(3**2)\fP\&'\&. This is ++for compatibility with other shells\&. ++.PP ++Mathematical functions can be called with the syntax ++`\fIfunc\fP\fB(\fP\fIargs\fP\fB)\fP\&', where the function decides ++if the \fIargs\fP is used as a string or a comma\-separated list of ++arithmetic expressions\&. The shell currently defines no mathematical ++functions by default, but the module \fBzsh/mathfunc\fP may be loaded with ++the \fBzmodload\fP builtin to provide standard floating point mathematical ++functions\&. ++.PP ++An expression of the form `\fB##\fP\fIx\fP\&' where \fIx\fP is any character ++sequence such as `\fBa\fP\&', `\fB^A\fP', or `\fB\eM\-\eC\-x\fP' gives the value of ++this character and an expression of the form `\fB#\fP\fIfoo\fP\&' gives the ++value of the first character of the contents of the parameter \fIfoo\fP\&. ++Character values are according to the character set used in the current ++locale; for multibyte character handling the option \fBMULTIBYTE\fP must be ++set\&. Note that this form is different from `\fB$#\fP\fIfoo\fP\&', a standard ++parameter substitution which gives the length of the parameter \fIfoo\fP\&. ++`\fB#\e\fP\&' is accepted instead of `\fB##\fP', but its use is deprecated\&. ++.PP ++Named parameters and subscripted arrays can be referenced by name within an ++arithmetic expression without using the parameter expansion syntax\&. For ++example, ++.PP ++.RS ++.nf ++\fB((val2 = val1 * 2))\fP ++.fi ++.RE ++.PP ++assigns twice the value of \fB$val1\fP to the parameter named \fBval2\fP\&. ++.PP ++An internal integer representation of a named parameter ++can be specified with the \fBinteger\fP builtin\&. ++Arithmetic evaluation is performed on the value of each ++assignment to a named parameter declared integer ++in this manner\&. Assigning a floating point number to an integer results in ++rounding down to the next integer\&. ++.PP ++Likewise, floating point numbers can be declared with the \fBfloat\fP ++builtin; there are two types, differing only in their output format, as ++described for the \fBtypeset\fP builtin\&. The output format can be bypassed ++by using arithmetic substitution instead of the parameter substitution, ++i\&.e\&. `\fB${\fP\fIfloat\fP\fB}\fP\&' uses the defined format, but ++`\fB$((\fP\fIfloat\fP\fB))\fP\&' uses a generic floating point ++format\&. ++.PP ++Promotion of integer to floating point values is performed where ++necessary\&. In addition, if any operator which requires an integer ++(`\fB~\fP\&', `\fB&\fP', `\fB|\fP', `\fB^\fP', `\fB%\fP', `\fB<<\fP', `\fB>>\fP' and their ++equivalents with assignment) is given a floating point argument, it will be ++silently rounded down to the next integer\&. ++.PP ++Scalar variables can hold integer or floating point values at different ++times; there is no memory of the numeric type in this case\&. ++.PP ++If a variable is first assigned in a numeric context without previously ++being declared, it will be implicitly typed as \fBinteger\fP or \fBfloat\fP and ++retain that type either until the type is explicitly changed or until the ++end of the scope\&. This can have unforeseen consequences\&. For example, in ++the loop ++.PP ++.RS ++.nf ++\fBfor (( f = 0; f < 1; f += 0\&.1 )); do ++# use $f ++done\fP ++.fi ++.RE ++.PP ++if \fBf\fP has not already been declared, the first assignment will cause it ++to be created as an integer, and consequently the operation `\fBf += 0\&.1\fP\&' ++will always cause the result to be truncated to zero, so that the loop will ++fail\&. A simple fix would be to turn the initialization into `\fBf = 0\&.0\fP\&'\&. ++It is therefore best to declare numeric variables with explicit types\&. ++.\" Yodl file: Zsh/cond.yo ++.SH "CONDITIONAL EXPRESSIONS" ++A \fIconditional expression\fP is used with the \fB[[\fP ++compound command to test attributes of files and to compare strings\&. ++Each expression can be constructed from one or more ++of the following unary or binary expressions: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-a\fP \fIfile\fP ++true if \fIfile\fP exists\&. ++.TP ++\fB\-b\fP \fIfile\fP ++true if \fIfile\fP exists and is a block special file\&. ++.TP ++\fB\-c\fP \fIfile\fP ++true if \fIfile\fP exists and is a character special file\&. ++.TP ++\fB\-d\fP \fIfile\fP ++true if \fIfile\fP exists and is a directory\&. ++.TP ++\fB\-e\fP \fIfile\fP ++true if \fIfile\fP exists\&. ++.TP ++\fB\-f\fP \fIfile\fP ++true if \fIfile\fP exists and is a regular file\&. ++.TP ++\fB\-g\fP \fIfile\fP ++true if \fIfile\fP exists and has its setgid bit set\&. ++.TP ++\fB\-h\fP \fIfile\fP ++true if \fIfile\fP exists and is a symbolic link\&. ++.TP ++\fB\-k\fP \fIfile\fP ++true if \fIfile\fP exists and has its sticky bit set\&. ++.TP ++\fB\-n\fP \fIstring\fP ++true if length of \fIstring\fP is non\-zero\&. ++.TP ++\fB\-o\fP \fIoption\fP ++true if option named \fIoption\fP is on\&. \fIoption\fP ++may be a single character, in which case it is a single letter option name\&. ++(See the section `Specifying Options\&'\&.) ++.TP ++\fB\-p\fP \fIfile\fP ++true if \fIfile\fP exists and is a FIFO special file (named pipe)\&. ++.TP ++\fB\-r\fP \fIfile\fP ++true if \fIfile\fP exists and is readable by current process\&. ++.TP ++\fB\-s\fP \fIfile\fP ++true if \fIfile\fP exists and has size greater than zero\&. ++.TP ++\fB\-t\fP \fIfd\fP ++true if file descriptor number \fIfd\fP ++is open and associated with a terminal device\&. ++(note: \fIfd\fP is not optional) ++.TP ++\fB\-u\fP \fIfile\fP ++true if \fIfile\fP exists and has its setuid bit set\&. ++.TP ++\fB\-w\fP \fIfile\fP ++true if \fIfile\fP exists and is writable by current process\&. ++.TP ++\fB\-x\fP \fIfile\fP ++true if \fIfile\fP exists and is executable by current process\&. ++If \fIfile\fP exists and is a directory, then the current process ++has permission to search in the directory\&. ++.TP ++\fB\-z\fP \fIstring\fP ++true if length of \fIstring\fP is zero\&. ++.TP ++\fB\-L\fP \fIfile\fP ++true if \fIfile\fP exists and is a symbolic link\&. ++.TP ++\fB\-O\fP \fIfile\fP ++true if \fIfile\fP exists and is owned by the effective user ID of this process\&. ++.TP ++\fB\-G\fP \fIfile\fP ++true if \fIfile\fP exists and its group matches ++the effective group ID of this process\&. ++.TP ++\fB\-S\fP \fIfile\fP ++true if \fIfile\fP exists and is a socket\&. ++.TP ++\fB\-N\fP \fIfile\fP ++true if \fIfile\fP exists and its access time is ++not newer than its modification time\&. ++.TP ++\fIfile1\fP \fB\-nt\fP \fIfile2\fP ++true if \fIfile1\fP exists and is newer than \fIfile2\fP\&. ++.TP ++\fIfile1\fP \fB\-ot\fP \fIfile2\fP ++true if \fIfile1\fP exists and is older than \fIfile2\fP\&. ++.TP ++\fIfile1\fP \fB\-ef\fP \fIfile2\fP ++true if \fIfile1\fP and \fIfile2\fP exist and refer to the same file\&. ++.TP ++.PD 0 ++\fIstring\fP \fB=\fP \fIpattern\fP ++.TP ++.PD ++\fIstring\fP \fB==\fP \fIpattern\fP ++true if \fIstring\fP matches \fIpattern\fP\&. ++The `\fB==\fP\&' form is the preferred one\&. The `\fB=\fP' form is for ++backward compatibility and should be considered obsolete\&. ++.TP ++\fIstring\fP \fB!=\fP \fIpattern\fP ++true if \fIstring\fP does not match \fIpattern\fP\&. ++.TP ++\fIstring\fP \fB=~\fP \fIregexp\fP ++true if \fIstring\fP matches the regular expression ++\fIregexp\fP\&. If the option \fBRE_MATCH_PCRE\fP is set ++\fIregexp\fP is tested as a PCRE regular expression using ++the \fBzsh/pcre\fP module, else it is tested as a POSIX ++extended regular expression using the \fBzsh/regex\fP module\&. ++Upon successful match, some variables will be updated; no variables ++are changed if the matching fails\&. ++.RS ++.PP ++If the option \fBBASH_REMATCH\fP is not set the scalar parameter ++\fBMATCH\fP is set to the substring that matched the pattern and ++the integer parameters \fBMBEGIN\fP and \fBMEND\fP to the index of the start ++and end, respectively, of the match in \fIstring\fP, such that if ++\fIstring\fP is contained in variable \fBvar\fP the expression ++`${var[$MBEGIN,$MEND]}\&' is identical to `$MATCH'\&. The setting ++of the option \fBKSH_ARRAYS\fP is respected\&. Likewise, the array ++\fBmatch\fP is set to the substrings that matched parenthesised ++subexpressions and the arrays \fBmbegin\fP and \fBmend\fP to the indices of ++the start and end positions, respectively, of the substrings within ++\fIstring\fP\&. The arrays are not set if there were no parenthesised ++subexpresssions\&. For example, if the string `\fBa short string\fP\&' is matched ++against the regular expression `\fBs(\&.\&.\&.)t\fP\&', then (assuming the ++option \fBKSH_ARRAYS\fP is not set) \fBMATCH\fP, \fBMBEGIN\fP ++and \fBMEND\fP are `\fBshort\fP\&', 3 and 7, respectively, while \fBmatch\fP, ++\fBmbegin\fP and \fBmend\fP are single entry arrays containing ++the strings `\fBhor\fP\&', `\fB4\fP' and `\fB6\fP, respectively\&. ++.PP ++If the option \fBBASH_REMATCH\fP is set the array ++\fBBASH_REMATCH\fP is set to the substring that matched the pattern ++followed by the substrings that matched parenthesised ++subexpressions within the pattern\&. ++.RE ++.TP ++\fIstring1\fP \fB<\fP \fIstring2\fP ++true if \fIstring1\fP comes before \fIstring2\fP ++based on ASCII value of their characters\&. ++.TP ++\fIstring1\fP \fB>\fP \fIstring2\fP ++true if \fIstring1\fP comes after \fIstring2\fP ++based on ASCII value of their characters\&. ++.TP ++\fIexp1\fP \fB\-eq\fP \fIexp2\fP ++true if \fIexp1\fP is numerically equal to \fIexp2\fP\&. ++.TP ++\fIexp1\fP \fB\-ne\fP \fIexp2\fP ++true if \fIexp1\fP is numerically not equal to \fIexp2\fP\&. ++.TP ++\fIexp1\fP \fB\-lt\fP \fIexp2\fP ++true if \fIexp1\fP is numerically less than \fIexp2\fP\&. ++.TP ++\fIexp1\fP \fB\-gt\fP \fIexp2\fP ++true if \fIexp1\fP is numerically greater than \fIexp2\fP\&. ++.TP ++\fIexp1\fP \fB\-le\fP \fIexp2\fP ++true if \fIexp1\fP is numerically less than or equal to \fIexp2\fP\&. ++.TP ++\fIexp1\fP \fB\-ge\fP \fIexp2\fP ++true if \fIexp1\fP is numerically greater than or equal to \fIexp2\fP\&. ++.TP ++\fB(\fP \fIexp\fP \fB)\fP ++true if \fIexp\fP is true\&. ++.TP ++\fB!\fP \fIexp\fP ++true if \fIexp\fP is false\&. ++.TP ++\fIexp1\fP \fB&&\fP \fIexp2\fP ++true if \fIexp1\fP and \fIexp2\fP are both true\&. ++.TP ++\fIexp1\fP \fB||\fP \fIexp2\fP ++true if either \fIexp1\fP or \fIexp2\fP is true\&. ++.PP ++Normal shell expansion is performed on the \fIfile\fP, \fIstring\fP and ++\fIpattern\fP arguments, but the result of each expansion is constrained to ++be a single word, similar to the effect of double quotes\&. ++File generation is not performed on any form of argument to conditions\&. ++However, pattern metacharacters are active for the \fIpattern\fP arguments; ++the patterns are the same as those used for filename generation, see ++\fIzshexpn\fP(1), but there is no special behaviour ++of `\fB/\fP\&' nor initial dots, and no glob qualifiers are allowed\&. ++.PP ++In each of the above expressions, if ++\fIfile\fP is of the form `\fB/dev/fd/\fP\fIn\fP\&', ++where \fIn\fP is an integer, ++then the test applied to the open file whose ++descriptor number is \fIn\fP, ++even if the underlying system does not support ++the \fB/dev/fd\fP directory\&. ++.PP ++In the forms which do numeric comparison, the expressions \fIexp\fP ++undergo arithmetic expansion as if they were enclosed in \fB$((\&.\&.\&.))\fP\&. ++.PP ++For example, the following: ++.PP ++.RS ++.nf ++\fB[[ ( \-f foo || \-f bar ) && $report = y* ]] && print File exists\&.\fP ++.fi ++.RE ++.PP ++tests if either file \fBfoo\fP or file \fBbar\fP exists, and if so, if the ++value of the parameter \fBreport\fP begins with `\fBy\fP\&'; if the complete ++condition is true, the message `\fBFile exists\&.\fP\&' is printed\&. ++.\" Yodl file: Zsh/prompt.yo ++.SH "EXPANSION OF PROMPT SEQUENCES" ++Prompt sequences undergo a special form of expansion\&. This type of expansion ++is also available using the \fB\-P\fP option to the \fBprint\fP builtin\&. ++.PP ++If the \fBPROMPT_SUBST\fP option is set, the prompt string is first subjected to ++\fIparameter expansion\fP, ++\fIcommand substitution\fP and ++\fIarithmetic expansion\fP\&. ++See ++\fIzshexpn\fP(1)\&. ++ ++Certain escape sequences may be recognised in the prompt string\&. ++.PP ++If the \fBPROMPT_BANG\fP option is set, a `\fB!\fP\&' in the prompt is replaced ++by the current history event number\&. A literal `\fB!\fP\&' may then be ++represented as `\fB!!\fP\&'\&. ++.PP ++If the \fBPROMPT_PERCENT\fP option is set, certain escape sequences that ++start with `\fB%\fP\&' are expanded\&. ++Many escapes are followed by a single character, although some of these ++take an optional integer argument that ++should appear between the `\fB%\fP\&' and the next character of the ++sequence\&. More complicated escape sequences are available to provide ++conditional expansion\&. ++.PP ++.SH "SIMPLE PROMPT ESCAPES" ++.PP ++.SS "Special characters" ++.PD 0 ++.TP ++.PD ++\fB%%\fP ++A `\fB%\fP\&'\&. ++.TP ++\fB%)\fP ++A `\fB)\fP\&'\&. ++.PP ++.SS "Login information" ++.PD 0 ++.TP ++.PD ++\fB%l\fP ++The line (tty) the user is logged in on, without `\fB/dev/\fP\&' prefix\&. ++If the name starts with `\fB/dev/tty\fP\&', that prefix is stripped\&. ++.TP ++\fB%M\fP ++The full machine hostname\&. ++.TP ++\fB%m\fP ++The hostname up to the first `\fB\&.\fP\&'\&. ++An integer may follow the `\fB%\fP\&' to specify ++how many components of the hostname are desired\&. With a negative integer, ++trailing components of the hostname are shown\&. ++.TP ++\fB%n\fP ++\fB$USERNAME\fP\&. ++.TP ++\fB%y\fP ++The line (tty) the user is logged in on, without `\fB/dev/\fP\&' prefix\&. ++This does not treat `\fB/dev/tty\fP\&' names specially\&. ++.PP ++.SS "Shell state" ++.PD 0 ++.TP ++.PD ++\fB%#\fP ++A `\fB#\fP\&' if the shell is running with privileges, a `\fB%\fP' if not\&. ++Equivalent to `\fB%(!\&.#\&.%%)\fP\&'\&. ++The definition of `privileged\&', for these purposes, is that either the ++effective user ID is zero, or, if POSIX\&.1e capabilities are supported, that ++at least one capability is raised in either the Effective or Inheritable ++capability vectors\&. ++.TP ++\fB%?\fP ++The return status of the last command executed just before the prompt\&. ++.TP ++\fB%_\fP ++The status of the parser, i\&.e\&. the shell constructs (like `\fBif\fP\&' and ++`\fBfor\fP\&') that have been started on the command line\&. If given an integer ++number that many strings will be printed; zero or negative or no integer means ++print as many as there are\&. This is most useful in prompts \fBPS2\fP for ++continuation lines and \fBPS4\fP for debugging with the \fBXTRACE\fP option; in ++the latter case it will also work non\-interactively\&. ++.TP ++.PD 0 ++\fB%d\fP ++.TP ++.PD ++\fB/\fP ++Current working directory\&. If an integer follows the `\fB%\fP\&', ++it specifies a number of trailing components of the current working ++directory to show; zero means the whole path\&. A negative integer ++specifies leading components, i\&.e\&. \fB%\-1d\fP specifies the first component\&. ++.TP ++\fB%~\fP ++As \fB%d\fP and \fB%/\fP, but if the current working directory has a named ++directory as its prefix, that part is replaced by a `\fB~\fP\&' followed by ++the name of the directory\&. If it starts with \fB$HOME\fP, that part is ++replaced by a `\fB~\fP\&'\&. ++.TP ++.PD 0 ++\fB%h\fP ++.TP ++.PD ++\fB%!\fP ++Current history event number\&. ++.TP ++\fB%i\fP ++The line number currently being executed in the script, sourced file, or ++shell function given by \fB%N\fP\&. This is most useful for debugging as part ++of \fB$PS4\fP\&. ++.TP ++\fB%I\fP ++The line number currently being executed in the file \fB%x\fP\&. This is ++similar to \fB%i\fP, but the line number is always a line number in the ++file where the code was defined, even if the code is a shell function\&. ++.TP ++\fB%j\fP ++The number of jobs\&. ++.TP ++\fB%L\fP ++The current value of \fB$SHLVL\fP\&. ++.TP ++\fB%N\fP ++The name of the script, sourced file, or shell function that zsh is ++currently executing, whichever was started most recently\&. If there is ++none, this is equivalent to the parameter \fB$0\fP\&. An integer may follow ++the `\fB%\fP\&' to specify a number of trailing path components to show; zero ++means the full path\&. A negative integer specifies leading components\&. ++.TP ++\fB%x\fP ++The name of the file containing the source code currently being ++executed\&. This behaves as \fB%N\fP except that function and eval command ++names are not shown, instead the file where they were defined\&. ++.TP ++.PD 0 ++\fB%c\fP ++.TP ++.PD 0 ++\fB%\&.\fP ++.TP ++.PD ++\fB%C\fP ++Trailing component of the current working directory\&. ++An integer may follow the `\fB%\fP\&' to get more than one component\&. ++Unless `\fB%C\fP\&' is used, tilde contraction is performed first\&. These are ++deprecated as \fB%c\fP and \fB%C\fP are equivalent to \fB%1~\fP and \fB%1/\fP, ++respectively, while explicit positive integers have the same effect as for ++the latter two sequences\&. ++.PP ++.SS "Date and time" ++.PD 0 ++.TP ++.PD ++\fB%D\fP ++The date in \fIyy\fP\fB\-\fP\fImm\fP\fB\-\fP\fIdd\fP format\&. ++.TP ++\fB%T\fP ++Current time of day, in 24\-hour format\&. ++.TP ++.PD 0 ++\fB%t\fP ++.TP ++.PD ++\fB%@\fP ++Current time of day, in 12\-hour, am/pm format\&. ++.TP ++\fB%*\fP ++Current time of day in 24\-hour format, with seconds\&. ++.TP ++\fB%w\fP ++The date in \fIday\fP\fB\-\fP\fIdd\fP format\&. ++.TP ++\fB%W\fP ++The date in \fImm\fP\fB/\fP\fIdd\fP\fB/\fP\fIyy\fP format\&. ++.TP ++\fB%D{\fP\fIstring\fP\fB}\fP ++\fIstring\fP is formatted using the \fBstrftime\fP function\&. ++See \fIstrftime\fP(3) for more details\&. Various zsh ++extensions provide numbers with no leading zero or space ++if the number is a single digit: ++.RS ++.PP ++.PD 0 ++.TP ++\fB%f\fP ++a day of the month ++.TP ++\fB%K\fP ++the hour of the day on the 24\-hour clock ++.TP ++\fB%L\fP ++the hour of the day on the 12\-hour clock ++.PD ++.PP ++The GNU extension that a `\fB\-\fP\&' between the \fB%\fP and the ++format character causes a leading zero or space to be stripped ++is handled directly by the shell for the format characters \fBd\fP, \fBf\fP, ++\fBH\fP, \fBk\fP, \fBl\fP, \fBm\fP, \fBM\fP, \fBS\fP and \fBy\fP; any other format ++characters are provided to \fBstrftime()\fP with any leading `\fB\-\fP\&', ++present, so the handling is system dependent\&. Further GNU ++extensions are not supported at present\&. ++.RE ++.RE ++.PP ++.SS "Visual effects" ++.PD 0 ++.TP ++.PD ++\fB%B\fP (\fB%b\fP) ++Start (stop) boldface mode\&. ++.TP ++\fB%E\fP ++Clear to end of line\&. ++.TP ++\fB%U\fP (\fB%u\fP) ++Start (stop) underline mode\&. ++.TP ++\fB%S\fP (\fB%s\fP) ++Start (stop) standout mode\&. ++.TP ++\fB%F\fP (\fB%f\fP) ++Start (stop) using a different foreground colour, if supported ++by the terminal\&. The colour may be specified two ways: either ++as a numeric argument, as normal, or by a sequence in braces ++following the \fB%F\fP, for example \fB%F{red}\fP\&. In the latter case ++the values allowed are as described for the \fBfg\fP \fBzle_highlight\fP ++attribute; ++see \fICharacter Highlighting\fP in \fIzshzle\fP(1)\&. This means that numeric ++colours are allowed in the second format also\&. ++.TP ++\fB%K\fP (\fB%k\fP) ++Start (stop) using a different bacKground colour\&. The syntax is ++identical to that for \fB%F\fP and \fB%f\fP\&. ++.TP ++\fB%{\fP\&.\&.\&.\fB%}\fP ++Include a string as a literal escape sequence\&. ++The string within the braces should not change the cursor ++position\&. Brace pairs can nest\&. ++.RS ++.PP ++A positive numeric argument between the \fB%\fP and the \fB{\fP is treated as ++described for \fB%G\fP below\&. ++.RE ++.TP ++\fB%G\fP ++Within a \fB%{\fP\&.\&.\&.\fB%}\fP sequence, include a `glitch\&': that is, assume ++that a single character width will be output\&. This is useful when ++outputting characters that otherwise cannot be correctly handled by the ++shell, such as the alternate character set on some terminals\&. ++The characters in question can be included within a \fB%{\fP\&.\&.\&.\fB%}\fP ++sequence together with the appropriate number of \fB%G\fP sequences to ++indicate the correct width\&. An integer between the `\fB%\fP\&' and `\fBG\fP' ++indicates a character width other than one\&. Hence \fB%{\fP\fIseq\fP\fB%2G%}\fP ++outputs \fIseq\fP and assumes it takes up the width of two standard ++characters\&. ++.RS ++.PP ++Multiple uses of \fB%G\fP accumulate in the obvious fashion; the position ++of the \fB%G\fP is unimportant\&. Negative integers are not handled\&. ++.PP ++Note that when prompt truncation is in use it is advisable to divide up ++output into single characters within each \fB%{\fP\&.\&.\&.\fB%}\fP group so that ++the correct truncation point can be found\&. ++.RE ++.RE ++.PP ++.SH "CONDITIONAL SUBSTRINGS IN PROMPTS" ++.PD 0 ++.TP ++.PD ++\fB%v\fP ++The value of the first element of the \fBpsvar\fP array parameter\&. Following ++the `\fB%\fP\&' with an integer gives that element of the array\&. Negative ++integers count from the end of the array\&. ++.TP ++\fB%(\fP\fIx\&.true\-text\&.false\-text\fP\fB)\fP ++Specifies a ternary expression\&. The character following the \fIx\fP is ++arbitrary; the same character is used to separate the text for the ++`true\&' result from that for the `false' result\&. ++This separator may not appear in the \fItrue\-text\fP, except as part of a ++%\-escape ++sequence\&. A `\fB)\fP\&' may appear in the \fIfalse\-text\fP as `\fB%)\fP'\&. ++\fItrue\-text\fP ++and \fIfalse\-text\fP may both contain arbitrarily\-nested escape ++sequences, including further ternary expressions\&. ++.RS ++.PP ++The left parenthesis may be preceded or followed by a positive integer \fIn\fP, ++which defaults to zero\&. A negative integer will be multiplied by \-1\&. ++The test character \fIx\fP may be any of the following: ++.PP ++.PD 0 ++.TP ++\fB!\fP ++True if the shell is running with privileges\&. ++.TP ++\fB#\fP ++True if the effective uid of the current process is \fIn\fP\&. ++.TP ++\fB?\fP ++True if the exit status of the last command was \fIn\fP\&. ++.TP ++\fB_\fP ++True if at least \fIn\fP shell constructs were started\&. ++.TP ++\fBC\fP ++.TP ++\fB/\fP ++True if the current absolute path has at least \fIn\fP elements ++relative to the root directory, hence \fB/\fP is counted as 0 elements\&. ++.TP ++\fBc\fP ++.TP ++\fB\&.\fP ++.TP ++\fB~\fP ++True if the current path, with prefix replacement, has at ++least \fIn\fP elements relative to the root directory, hence \fB/\fP is ++counted as 0 elements\&. ++.TP ++\fBD\fP ++True if the month is equal to \fIn\fP (January = 0)\&. ++.TP ++\fBd\fP ++True if the day of the month is equal to \fIn\fP\&. ++.TP ++\fBg\fP ++True if the effective gid of the current process is \fIn\fP\&. ++.TP ++\fBj\fP ++True if the number of jobs is at least \fIn\fP\&. ++.TP ++\fBL\fP ++True if the \fBSHLVL\fP parameter is at least \fIn\fP\&. ++.TP ++\fBl\fP ++True if at least \fIn\fP characters have already been ++printed on the current line\&. ++.TP ++\fBS\fP ++True if the \fBSECONDS\fP parameter is at least \fIn\fP\&. ++.TP ++\fBT\fP ++True if the time in hours is equal to \fIn\fP\&. ++.TP ++\fBt\fP ++True if the time in minutes is equal to \fIn\fP\&. ++.TP ++\fBv\fP ++True if the array \fBpsvar\fP has at least \fIn\fP elements\&. ++.TP ++\fBV\fP ++True if element \fIn\fP of the array \fBpsvar\fP is set and ++non\-empty\&. ++.TP ++\fBw\fP ++True if the day of the week is equal to \fIn\fP (Sunday = 0)\&. ++.PD ++.RE ++.TP ++.PD 0 ++\fB%<\fP\fIstring\fP\fB<\fP ++.TP ++.PD 0 ++\fB%>\fP\fIstring\fP\fB>\fP ++.TP ++.PD ++\fB%[\fP\fIxstring\fP\fB]\fP ++Specifies truncation behaviour for the remainder of the prompt string\&. ++The third, deprecated, form is equivalent to `\fB%\fP\fIxstringx\fP\&', ++i\&.e\&. \fIx\fP may be `\fB<\fP\&' or `\fB>\fP'\&. ++The numeric argument, which in the third form may appear immediately ++after the `\fB[\fP\&', specifies the maximum permitted length of ++the various strings that can be displayed in the prompt\&. ++The \fIstring\fP will be displayed in ++place of the truncated portion of any string; note this does not ++undergo prompt expansion\&. ++.RS ++.PP ++The forms with `\fB<\fP\&' truncate at the left of the string, ++and the forms with `\fB>\fP\&' truncate at the right of the string\&. ++For example, if the current directory is `\fB/home/pike\fP\&', ++the prompt `\fB%8<\&.\&.<%/\fP\&' will expand to `\fB\&.\&.e/pike\fP'\&. ++In this string, the terminating character (`\fB<\fP\&', `\fB>\fP' or `\fB]\fP'), ++or in fact any character, may be quoted by a preceding `\fB\e\fP\&'; note ++when using \fBprint \-P\fP, however, that this must be doubled as the ++string is also subject to standard \fBprint\fP processing, in addition ++to any backslashes removed by a double quoted string: the worst case ++is therefore `\fBprint \-P "%<\e\e\e\e<<\&.\&.\&."\fP\&'\&. ++.PP ++If the \fIstring\fP is longer than the specified truncation length, ++it will appear in full, completely replacing the truncated string\&. ++.PP ++The part of the prompt string to be truncated runs to the end of the ++string, or to the end of the next enclosing group of the `\fB%(\fP\&' ++construct, or to the next truncation encountered at the same grouping ++level (i\&.e\&. truncations inside a `\fB%(\fP\&' are separate), which ++ever comes first\&. In particular, a truncation with argument zero ++(e\&.g\&. `\fB%<<\fP\&') marks the end of the range of the string to be ++truncated while turning off truncation from there on\&. For example, the ++prompt \&'%10<\&.\&.\&.<%~%<<%# ' will print a truncated representation of the ++current directory, followed by a `\fB%\fP\&' or `\fB#\fP', followed by a ++space\&. Without the `\fB%<<\fP\&', those two characters would be included ++in the string to be truncated\&. ++.RE ++.RE +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshzftpsys.1 +@@ -0,0 +1,667 @@ ++.TH "ZSHZFTPSYS" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshzftpsys \- zftp function front\-end ++.\" Yodl file: Zsh/zftpsys.yo ++.SH "DESCRIPTION" ++.PP ++This describes the set of shell functions supplied with the source ++distribution as an interface to the \fBzftp\fP builtin command, allowing you ++to perform FTP operations from the shell command line or within functions ++or scripts\&. The interface is similar to a traditional FTP client (e\&.g\&. the ++\fBftp\fP command itself, see \fIftp\fP(1)), but as it is entirely done ++within the shell all the familiar completion, editing and globbing features, ++and so on, are present, and macros are particularly simple to write as they ++are just ordinary shell functions\&. ++.PP ++The prerequisite is that the \fBzftp\fP command, as described in ++\fIzshmodules\fP(1) ++, must be available in the ++version of \fBzsh\fP installed at your site\&. If the shell is configured to ++load new commands at run time, it probably is: typing `\fBzmodload zsh/zftp\fP\&' ++will make sure (if that runs silently, it has worked)\&. If this is not the ++case, it is possible \fBzftp\fP was linked into the shell anyway: to test ++this, type `\fBwhich zftp\fP\&' and if \fBzftp\fP is available you will get the ++message `\fBzftp: shell built\-in command\fP\&'\&. ++.PP ++Commands given directly with \fBzftp\fP builtin may be interspersed between ++the functions in this suite; in a few cases, using \fBzftp\fP directly may ++cause some of the status information stored in shell parameters to become ++invalid\&. Note in particular the description of the variables ++\fB$ZFTP_TMOUT\fP, \fB$ZFTP_PREFS\fP and \fB$ZFTP_VERBOSE\fP for \fBzftp\fP\&. ++.PP ++.PP ++.SH "INSTALLATION" ++.PP ++You should make sure all the functions from the \fBFunctions/Zftp\fP ++directory of the source distribution are available; they all begin with the ++two letters `\fBzf\fP\&'\&. They may already have been installed on your system; ++otherwise, you will need to find them and copy them\&. The directory should ++appear as one of the elements of the \fB$fpath\fP array (this should already ++be the case if they were installed), and at least the function \fBzfinit\fP ++should be autoloaded; it will autoload the rest\&. Finally, to initialize ++the use of the system you need to call the \fBzfinit\fP function\&. The ++following code in your \fB\&.zshrc\fP will arrange for this; assume the ++functions are stored in the directory \fB~/myfns\fP: ++.PP ++.RS ++.nf ++\fBfpath=(~/myfns $fpath) ++autoload \-U zfinit ++zfinit\fP ++.fi ++.RE ++.PP ++Note that \fBzfinit\fP assumes you are using the \fBzmodload\fP method to ++load the \fBzftp\fP command\&. If it is already built into the shell, change ++\fBzfinit\fP to \fBzfinit \-n\fP\&. It is helpful (though not essential) if the ++call to \fBzfinit\fP appears after any code to initialize the new completion ++system, else unnecessary \fBcompctl\fP commands will be given\&. ++.PP ++.SH "FUNCTIONS" ++.PP ++The sequence of operations in performing a file transfer is essentially the ++same as that in a standard FTP client\&. Note that, due to a quirk of the ++shell\&'s \fBgetopts\fP builtin, for those functions that handle options you ++must use `\fB\-\fP\fB\-\fP\&' rather than `\fB\-\fP' to ensure the remaining arguments ++are treated literally (a single `\fB\-\fP\&' is treated as an argument)\&. ++.PP ++.SS "Opening a connection" ++.PD 0 ++.TP ++.PD ++\fBzfparams [ \fIhost\fP [ \fIuser\fP [ \fIpassword\fP \&.\&.\&. ] ] ]\fP ++Set or show the parameters for a future \fBzfopen\fP with no arguments\&. If ++no arguments are given, the current parameters are displayed (the password ++will be shown as a line of asterisks)\&. If a host is given, and either the ++\fIuser\fP or \fIpassword\fP is not, they will be prompted for; also, any ++parameter given as `\fB?\fP\&' will be prompted for, and if the `\fB?\fP' is ++followed by a string, that will be used as the prompt\&. As \fBzfopen\fP calls ++\fBzfparams\fP to store the parameters, this usually need not be called ++directly\&. ++.RS ++.PP ++A single argument `\fB\-\fP\&' will delete the stored parameters\&. This will ++also cause the memory of the last directory (and so on) on the other host ++to be deleted\&. ++.RE ++.TP ++\fBzfopen [ \-1 ] [ \fIhost\fP [ \fIuser\fP [ \fIpassword\fP [ \fIaccount\fP ] ] ] ]\fP ++If \fIhost\fP is present, open a connection to that host under username ++\fIuser\fP with password \fIpassword\fP (and, on the rare occasions when it ++is necessary, account \fIaccount\fP)\&. If a necessary parameter is missing or ++given as `\fB?\fP\&' it will be prompted for\&. If \fIhost\fP is not present, use ++a previously stored set of parameters\&. ++.RS ++.PP ++If the command was successful, and the terminal is compatible with ++\fBxterm\fP or is \fBsun\-cmd\fP, a summary will appear in the title bar, ++giving the local \fBhost:directory\fP and the remote \fBhost:directory\fP; ++this is handled by the function \fBzftp_chpwd\fP, described below\&. ++.PP ++Normally, the \fIhost\fP, \fIuser\fP and \fIpassword\fP are internally ++recorded for later re\-opening, either by a \fBzfopen\fP with no arguments, or ++automatically (see below)\&. With the option `\fB\-1\fP\&', no information is ++stored\&. Also, if an open command with arguments failed, the parameters ++will not be retained (and any previous parameters will also be deleted)\&. ++A \fBzfopen\fP on its own, or a \fBzfopen \-1\fP, never alters the stored ++parameters\&. ++.PP ++Both \fBzfopen\fP and \fBzfanon\fP (but not \fBzfparams\fP) understand URLs of ++the form \fBftp://\fP\fIhost\fP/\fIpath\&.\&.\&.\fP as meaning to connect to the ++\fIhost\fP, then change directory to \fIpath\fP (which must be a directory, ++not a file)\&. The `\fBftp://\fP\&' can be omitted; the trailing `\fB/\fP' is enough ++to trigger recognition of the \fIpath\fP\&. Note prefixes other than ++`\fBftp:\fP\&' are not recognized, and that all characters after the first ++slash beyond \fIhost\fP are significant in \fIpath\fP\&. ++.RE ++.TP ++\fBzfanon [ \-1 ] \fIhost\fP\fP ++Open a connection \fIhost\fP for anonymous FTP\&. The username used is ++`\fBanonymous\fP\&'\&. The password (which will be reported the first time) is ++generated as \fIuser\fP\fB@\fP\fIhost\fP; this is then stored in the shell ++parameter \fB$EMAIL_ADDR\fP which can alternatively be set manually to a ++suitable string\&. ++.PP ++.SS "Directory management" ++.PD 0 ++.TP ++.PD 0 ++\fBzfcd [ \fIdir\fP ]\fP ++.TP ++.PD 0 ++\fBzfcd \-\fP ++.TP ++.PD ++\fBzfcd \fIold\fP \fInew\fP\fP ++Change the current directory on the remote server: this is implemented to ++have many of the features of the shell builtin \fBcd\fP\&. ++.RS ++.PP ++In the first form with \fIdir\fP present, change to the directory \fIdir\fP\&. ++The command `\fBzfcd \&.\&.\fP\&' is treated specially, so is guaranteed to work on ++non\-UNIX servers (note this is handled internally by \fBzftp\fP)\&. If \fIdir\fP ++is omitted, has the effect of `\fBzfcd ~\fP\&'\&. ++.PP ++The second form changes to the directory previously current\&. ++.PP ++The third form attempts to change the current directory by replacing the ++first occurrence of the string \fIold\fP with the string \fInew\fP in the ++current directory\&. ++.PP ++Note that in this command, and indeed anywhere a remote filename is ++expected, the string which on the local host corresponds to `\fB~\fP\&' is ++converted back to a `\fB~\fP\&' before being passed to the remote machine\&. ++This is convenient because of the way expansion is performed on the command ++line before \fBzfcd\fP receives a string\&. For example, suppose the command ++is `\fBzfcd ~/foo\fP\&'\&. The shell will expand this to a full path such as ++`\fBzfcd /home/user2/pws/foo\fP\&'\&. At this stage, \fBzfcd\fP recognises the ++initial path as corresponding to `\fB~\fP\&' and will send the directory to ++the remote host as \fB~/foo\fP, so that the `\fB~\fP\&' will be expanded by the ++server to the correct remote host directory\&. Other named directories of ++the form `\fB~name\fP\&' are not treated in this fashion\&. ++.RE ++.TP ++\fBzfhere\fP ++Change directory on the remote server to the one corresponding to the ++current local directory, with special handling of `\fB~\fP\&' as in \fBzfcd\fP\&. ++For example, if the current local directory is \fB~/foo/bar\fP, then ++\fBzfhere\fP performs the effect of `\fBzfcd ~/foo/bar\fP\&'\&. ++.TP ++\fBzfdir [ \-rfd ] [ \- ] [ \fIdir\-options\fP ] [ \fIdir\fP ]\fP ++Produce a long directory listing\&. The arguments \fIdir\-options\fP and ++\fIdir\fP are passed directly to the server and their effect is ++implementation dependent, but specifying a particular remote directory ++\fIdir\fP is usually possible\&. The output is passed through a pager ++given by the environment variable \fB$PAGER\fP, or `\fBmore\fP\&' if that is not ++set\&. ++.RS ++.PP ++The directory is usually cached for re\-use\&. In fact, two caches are ++maintained\&. One is for use when there is no \fIdir\-options\fP or \fIdir\fP, ++i\&.e\&. a full listing of the current remote directory; it is flushed ++when the current remote directory changes\&. The other is ++kept for repeated use of \fBzfdir\fP with the same arguments; for example, ++repeated use of `\fBzfdir /pub/gnu\fP\&' will only require the directory to be ++retrieved on the first call\&. Alternatively, this cache can be re\-viewed with ++the \fB\-r\fP option\&. As relative directories will confuse ++\fBzfdir\fP, the \fB\-f\fP option can be used to force the cache to be flushed ++before the directory is listed\&. The option \fB\-d\fP will delete both ++caches without showing a directory listing; it will also delete the cache ++of file names in the current remote directory, if any\&. ++.RE ++.TP ++\fBzfls\fP [ \fIls\-options\fP ] [ \fIdir\fP ] ++List files on the remote server\&. With no arguments, this will produce a ++simple list of file names for the current remote directory\&. Any arguments ++are passed directly to the server\&. No pager and no caching is used\&. ++.PP ++.SS "Status commands" ++.PD 0 ++.TP ++.PD ++\fBzftype\fP [ \fItype\fP ] ++With no arguments, show the type of data to be transferred, usually ASCII ++or binary\&. With an argument, change the type: the types `\fBA\fP\&' or ++`\fBASCII\fP\&' for ASCII data and `\fBB\fP' or `\fBBINARY\fP', `\fBI\fP' or ++`\fBIMAGE\fP\&' for binary data are understood case\-insensitively\&. ++.TP ++\fBzfstat\fP [ \-v ] ++Show the status of the current or last connection, as well as the status of ++some of \fBzftp\fP\&'s status variables\&. With the \fB\-v\fP option, a more ++verbose listing is produced by querying the server for its version of ++events, too\&. ++.PP ++.SS "Retrieving files" ++The commands for retrieving files all take at least two options\&. \fB\-G\fP ++suppresses remote filename expansion which would otherwise be performed ++(see below for a more detailed description of that)\&. \fB\-t\fP attempts ++to set the modification time of the local file to that of the remote file: ++see the description of the function \fBzfrtime\fP below for more information\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBzfget [ \-Gtc ] \fIfile1\fP \&.\&.\&.\fP ++Retrieve all the listed files \fIfile1\fP \&.\&.\&. one at a time from the remote ++server\&. If a file contains a `\fB/\fP\&', the full name is passed to the ++remote server, but the file is stored locally under the name given by the ++part after the final `\fB/\fP\&'\&. The option \fB\-c\fP (cat) forces all files to ++be sent as a single stream to standard output; in this case the \fB\-t\fP ++option has no effect\&. ++.TP ++\fBzfuget [ \-Gvst ] \fIfile1\fP \&.\&.\&.\fP ++As \fBzfget\fP, but only retrieve files where the version on the remote ++server is newer (has a later modification time), or where the local file ++does not exist\&. If the remote file is older but the files have different ++sizes, or if the sizes are the same but the remote file is newer, the user ++will usually be queried\&. With the option \fB\-s\fP, the command runs silently ++and will always retrieve the file in either of those two cases\&. With the ++option \fB\-v\fP, the command prints more information about the files while it ++is working out whether or not to transfer them\&. ++.TP ++\fBzfcget [ \-Gt ] \fIfile1\fP \&.\&.\&.\fP ++As \fBzfget\fP, but if any of the local files exists, and is shorter than ++the corresponding remote file, the command assumes that it is the result of ++a partially completed transfer and attempts to transfer the rest of the ++file\&. This is useful on a poor connection which keeps failing\&. ++.RS ++.PP ++Note that this requires a commonly implemented, but non\-standard, version ++of the FTP protocol, so is not guaranteed to work on all servers\&. ++.RE ++.TP ++.PD 0 ++\fBzfgcp [ \-Gt ] \fIremote\-file\fP \fIlocal\-file\fP\fP ++.TP ++.PD ++\fBzfgcp [ \-Gt ] \fIrfile1\fP \&.\&.\&. \fIldir\fP\fP ++This retrieves files from the remote server with arguments behaving ++similarly to the \fBcp\fP command\&. ++.RS ++.PP ++In the first form, copy \fIremote\-file\fP from the server to the local file ++\fIlocal\-file\fP\&. ++.PP ++In the second form, copy all the remote files \fIrfile1\fP \&.\&.\&. into the ++local directory \fIldir\fP retaining the same basenames\&. This assumes UNIX ++directory semantics\&. ++.RE ++.RE ++.PP ++.SS "Sending files" ++.PD 0 ++.TP ++.PD ++\fBzfput [ \-r ] \fIfile1\fP \&.\&.\&.\fP ++Send all the \fIfile1\fP \&.\&.\&. given separately to the remote server\&. If a ++filename contains a `\fB/\fP\&', the full filename is used locally to find the ++file, but only the basename is used for the remote file name\&. ++.RS ++.PP ++With the option \fB\-r\fP, if any of the \fIfiles\fP are directories they are ++sent recursively with all their subdirectories, including files beginning ++with `\fB\&.\fP\&'\&. This requires that the remote machine understand UNIX file ++semantics, since `\fB/\fP\&' is used as a directory separator\&. ++.RE ++.TP ++\fBzfuput [ \-vs ] \fIfile1\fP \&.\&.\&.\fP ++As \fBzfput\fP, but only send files which are newer than their local ++equivalents, or if the remote file does not exist\&. The logic is the same ++as for \fBzfuget\fP, but reversed between local and remote files\&. ++.TP ++\fBzfcput \fIfile1\fP \&.\&.\&.\fP ++As \fBzfput\fP, but if any remote file already exists and is shorter than the ++local equivalent, assume it is the result of an incomplete transfer and ++send the rest of the file to append to the existing part\&. As the FTP ++append command is part of the standard set, this is in principle more ++likely to work than \fBzfcget\fP\&. ++.TP ++.PD 0 ++\fBzfpcp \fIlocal\-file\fP \fIremote\-file\fP\fP ++.TP ++.PD ++\fBzfpcp \fIlfile1\fP \&.\&.\&. \fIrdir\fP\fP ++This sends files to the remote server with arguments behaving similarly to ++the \fBcp\fP command\&. ++.RS ++.PP ++With two arguments, copy \fIlocal\-file\fP to the server as ++\fIremote\-file\fP\&. ++.PP ++With more than two arguments, copy all the local files \fIlfile1\fP \&.\&.\&. into ++the existing remote directory \fIrdir\fP retaining the same basenames\&. This ++assumes UNIX directory semantics\&. ++.PP ++A problem arises if you attempt to use \fBzfpcp\fP \fIlfile1\fP \fIrdir\fP, ++i\&.e\&. the second form of copying but with two arguments, as the command has ++no simple way of knowing if \fIrdir\fP corresponds to a directory or a ++filename\&. It attempts to resolve this in various ways\&. First, if the ++\fIrdir\fP argument is `\fB\&.\fP\&' or `\fB\&.\&.\fP' or ends in a slash, it is assumed ++to be a directory\&. Secondly, if the operation of copying to a remote file ++in the first form failed, and the remote server sends back the expected ++failure code 553 and a reply including the string `\fBIs a directory\fP\&', ++then \fBzfpcp\fP will retry using the second form\&. ++.RE ++.RE ++.PP ++.SS "Closing the connection" ++.PD 0 ++.TP ++.PD ++\fBzfclose\fP ++Close the connection\&. ++.PP ++.SS "Session management" ++.PD 0 ++.TP ++.PD ++\fBzfsession\fP [ \fB\-lvod\fP ] [ \fIsessname\fP ] ++Allows you to manage multiple FTP sessions at once\&. By default, ++connections take place in a session called `\fBdefault\fP\&'; by giving the ++command `\fBzfsession\fP \fIsessname\fP\&' you can change to a new or existing ++session with a name of your choice\&. The new session remembers its own ++connection, as well as associated shell parameters, and also the host/user ++parameters set by \fBzfparams\fP\&. Hence you can have different sessions set ++up to connect to different hosts, each remembering the appropriate host, ++user and password\&. ++.RS ++.PP ++With no arguments, \fBzfsession\fP prints the name of the current session; ++with the option \fB\-l\fP it lists all sessions which currently exist, and ++with the option \fB\-v\fP it gives a verbose list showing the host and ++directory for each session, where the current session is marked with an ++asterisk\&. With \fB\-o\fP, it will switch to the most recent previous session\&. ++.PP ++With \fB\-d\fP, the given session (or else the current one) is removed; ++everything to do with it is completely forgotten\&. If it was the only ++session, a new session called `\fBdefault\fP\&' is created and made current\&. ++It is safest not to delete sessions while background commands using ++\fBzftp\fP are active\&. ++.RE ++.TP ++\fBzftransfer\fP \fIsess1\fP\fB:\fP\fIfile1\fP \fIsess2\fP\fB:\fP\fIfile2\fP ++Transfer files between two sessions; no local copy is made\&. The file ++is read from the session \fIsess1\fP as \fIfile1\fP and written to session ++\fIsess2\fP as file \fIfile2\fP; \fIfile1\fP and \fIfile2\fP may be relative to ++the current directories of the session\&. Either \fIsess1\fP or \fIsess2\fP ++may be omitted (though the colon should be retained if there is a ++possibility of a colon appearing in the file name) and defaults to the ++current session; \fIfile2\fP may be omitted or may end with a slash, in ++which case the basename of \fIfile1\fP will be added\&. The sessions ++\fIsess1\fP and \fIsess2\fP must be distinct\&. ++.RS ++.PP ++The operation is performed using pipes, so it is required that the ++connections still be valid in a subshell, which is not the case under ++versions of some operating systems, presumably due to a system bug\&. ++.RE ++.RE ++.PP ++.SS "Bookmarks" ++The two functions \fBzfmark\fP and \fBzfgoto\fP allow you to `bookmark\&' the ++present location (host, user and directory) of the current FTP connection ++for later use\&. The file to be used for storing and retrieving bookmarks is ++given by the parameter \fB$ZFTP_BMFILE\fP; if not set when one of the two ++functions is called, it will be set to the file \fB\&.zfbkmarks\fP in the ++directory where your zsh startup files live (usually \fB~\fP)\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBzfmark [ \fP\fIbookmark\fP\fB ]\fP ++If given an argument, mark the current host, user and directory under the ++name \fIbookmark\fP for later use by \fBzfgoto\fP\&. If there is no connection ++open, use the values for the last connection immediately before it was ++closed; it is an error if there was none\&. Any existing bookmark ++under the same name will be silently replaced\&. ++.RS ++.PP ++If not given an argument, list the existing bookmarks and the points to ++which they refer in the form \fIuser\fP\fB@\fP\fIhost\fP\fB:\fP\fIdirectory\fP; ++this is the format in which they are stored, and the file may be edited ++directly\&. ++.RE ++.TP ++\fBzfgoto [ \-n ] \fP\fIbookmark\fP ++Return to the location given by \fIbookmark\fP, as previously set by ++\fBzfmark\fP\&. If the location has user `\fBftp\fP\&' or `\fBanonymous\fP', open ++the connection with \fBzfanon\fP, so that no password is required\&. If the ++user and host parameters match those stored for the current session, if ++any, those will be used, and again no password is required\&. Otherwise a ++password will be prompted for\&. ++.RS ++.PP ++With the option \fB\-n\fP, the bookmark is taken to be a nickname stored by ++the \fBncftp\fP program in its bookmark file, which is assumed to be ++\fB~/\&.ncftp/bookmarks\fP\&. The function works identically in other ways\&. ++Note that there is no mechanism for adding or modifying \fBncftp\fP bookmarks ++from the zftp functions\&. ++.RE ++.RE ++.PP ++.SS "Other functions" ++Mostly, these functions will not be called directly (apart from ++\fBzfinit\fP), but are described here for completeness\&. You may wish to ++alter \fBzftp_chpwd\fP and \fBzftp_progress\fP, in particular\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBzfinit [ \-n ]\fP ++As described above, this is used to initialize the zftp function system\&. ++The \fB\-n\fP option should be used if the zftp command is already built into ++the shell\&. ++.TP ++\fBzfautocheck [ \-dn ]\fP ++This function is called to implement automatic reopening behaviour, as ++described in more detail below\&. The options must appear in the first ++argument; \fB\-n\fP prevents the command from changing to the old directory, ++while \fB\-d\fP prevents it from setting the variable \fBdo_close\fP, which it ++otherwise does as a flag for automatically closing the connection after a ++transfer\&. The host and directory for the last session are stored in the ++variable \fB$zflastsession\fP, but the internal host/user/password parameters ++must also be correctly set\&. ++.TP ++\fBzfcd_match \fIprefix\fP \fIsuffix\fP\fP ++This performs matching for completion of remote directory names\&. If the ++remote server is UNIX, it will attempt to persuade the server to list the ++remote directory with subdirectories marked, which usually works but is not ++guaranteed\&. On other hosts it simply calls \fBzfget_match\fP and hence ++completes all files, not just directories\&. On some systems, directories ++may not even look like filenames\&. ++.TP ++\fBzfget_match \fIprefix\fP \fIsuffix\fP\fP ++This performs matching for completion of remote filenames\&. It caches files ++for the current directory (only) in the shell parameter \fB$zftp_fcache\fP\&. ++It is in the form to be called by the \fB\-K\fP option of \fBcompctl\fP, but ++also works when called from a widget\-style completion function with ++\fIprefix\fP and \fIsuffix\fP set appropriately\&. ++.TP ++\fBzfrglob \fIvarname\fP\fP ++Perform remote globbing, as describes in more detail below\&. \fIvarname\fP ++is the name of a variable containing the pattern to be expanded; if there ++were any matches, the same variable will be set to the expanded set of ++filenames on return\&. ++.TP ++\fBzfrtime \fIlfile\fP \fIrfile\fP [ \fItime\fP ]\fP ++Set the local file \fIlfile\fP to have the same modification time as the ++remote file \fIrfile\fP, or the explicit time \fItime\fP in FTP format ++\fBCCYYMMDDhhmmSS\fP for the GMT timezone\&. This uses the shell\&'s ++\fBzsh/datetime\fP module to perform the conversion from ++GMT to local time\&. ++.TP ++\fBzftp_chpwd\fP ++This function is called every time a connection is opened, or closed, or ++the remote directory changes\&. This version alters the title bar of an ++\fBxterm\fP\-compatible or \fBsun\-cmd\fP terminal emulator to reflect the ++local and remote hostnames and current directories\&. It works best when ++combined with the function \fBchpwd\fP\&. In particular, a function of ++the form ++.RS ++.PP ++.RS ++.nf ++\fBchpwd() { ++ if [[ \-n $ZFTP_USER ]]; then ++ zftp_chpwd ++ else ++ # usual chpwd e\&.g put host:directory in title bar ++ fi ++}\fP ++.fi ++.RE ++.PP ++fits in well\&. ++.RE ++.TP ++\fBzftp_progress\fP ++This function shows the status of the transfer\&. It will not write anything ++unless the output is going to a terminal; however, if you transfer files in ++the background, you should turn off progress reports by hand using ++`\fBzstyle \&':zftp:*' progress none\fP'\&. Note also that if you alter it, any ++output \fImust\fP be to standard error, as standard output may be a file ++being received\&. The form of the progress meter, or whether it is used at ++all, can be configured without altering the function, as described in the ++next section\&. ++.TP ++\fBzffcache\fP ++This is used to implement caching of files in the current directory for ++each session separately\&. It is used by \fBzfget_match\fP and \fBzfrglob\fP\&. ++.PP ++.SH "MISCELLANEOUS FEATURES" ++.PP ++.SS "Configuration" ++.PP ++Various styles are available using the standard shell style mechanism, ++described in ++\fIzshmodules\fP(1)\&. Briefly, the ++command `\fBzstyle \&':zftp:*'\fP \fIstyle\fP \fIvalue\fP \&.\&.\&.'\&. ++defines the \fIstyle\fP to have value \fIvalue\fP; more than one value may be ++given, although that is not useful in the cases described here\&. These ++values will then be used throughout the zftp function system\&. For more ++precise control, the first argument, which gives a context in which the ++style applies, can be modified to include a particular function, as for ++example `\fB:zftp:zfget\fP\&': the style will then have the given value only ++in the \fBzfget\fP function\&. Values for the same style in different contexts ++may be set; the most specific function will be used, where ++strings are held to be more specific than patterns, and longer patterns and ++shorter patterns\&. Note that only the top level function name, as called by ++the user, is used; calling of lower level functions is transparent to the ++user\&. Hence modifications to the title bar in \fBzftp_chpwd\fP use the ++contexts \fB:zftp:zfopen\fP, \fB:zftp:zfcd\fP, etc\&., depending where it was ++called from\&. The following styles are understood: ++.PP ++.PD 0 ++.TP ++.PD ++\fBprogress\fP ++Controls the way that \fBzftp_progress\fP reports on the progress of a ++transfer\&. If empty, unset, or `\fBnone\fP\&', no progress report is made; if ++`\fBbar\fP\&' a growing bar of inverse video is shown; if `\fBpercent\fP' (or any ++other string, though this may change in future), the percentage of the file ++transferred is shown\&. The bar meter requires that the width of the ++terminal be available via the \fB$COLUMNS\fP parameter (normally this is set ++automatically)\&. If the size of the file being transferred is not ++available, \fBbar\fP and \fBpercent\fP meters will simply show the number of ++bytes transferred so far\&. ++.RS ++.PP ++When \fBzfinit\fP is run, if this style is not defined for the context ++\fB:zftp:*\fP, it will be set to `bar\&'\&. ++.RE ++.TP ++\fBupdate\fP ++Specifies the minimum time interval between updates of the progress meter ++in seconds\&. No update is made unless new data has been received, so the ++actual time interval is limited only by \fB$ZFTP_TIMEOUT\fP\&. ++.RS ++.PP ++As described for \fBprogress\fP, \fBzfinit\fP will force this to default to 1\&. ++.RE ++.TP ++\fBremote\-glob\fP ++If set to `1\&', `yes' or `true', filename generation (globbing) is ++performed on the remote machine instead of by zsh itself; see below\&. ++.TP ++\fBtitlebar\fP ++If set to `1\&', `yes' or `true', \fBzftp_chpwd\fP will put the remote host and ++remote directory into the titlebar of terminal emulators such as xterm or ++sun\-cmd that allow this\&. ++.RS ++.PP ++As described for \fBprogress\fP, \fBzfinit\fP will force this to default to 1\&. ++.RE ++.TP ++\fBchpwd\fP ++If set to `1\&' `yes' or `true', \fBzftp_chpwd\fP will call the function ++\fBchpwd\fP when a connection is closed\&. This is useful if the remote host ++details were put into the terminal title bar by \fBzftp_chpwd\fP and your ++usual \fBchpwd\fP also modifies the title bar\&. ++.RS ++.PP ++When \fBzfinit\fP is run, it will determine whether \fBchpwd\fP exists and if ++so it will set the default value for the style to 1 if none exists ++already\&. ++.RE ++.RE ++.PP ++Note that there is also an associative array \fBzfconfig\fP which contains ++values used by the function system\&. This should not be modified or ++overwritten\&. ++.PP ++.SS "Remote globbing" ++.PP ++The commands for retrieving files usually perform filename generation ++(globbing) on their arguments; this can be turned off by passing the option ++\fB\-G\fP to each of the commands\&. Normally this operates by retrieving a ++complete list of files for the directory in question, then matching these ++locally against the pattern supplied\&. This has the advantage that the full ++range of zsh patterns (respecting the setting of the option ++\fBEXTENDED_GLOB\fP) can be used\&. However, it means that the directory part ++of a filename will not be expanded and must be given exactly\&. If the ++remote server does not support the UNIX directory semantics, directory ++handling is problematic and it is recommended that globbing only be used ++within the current directory\&. The list of files in the current directory, ++if retrieved, will be cached, so that subsequent globs in the same ++directory without an intervening \fBzfcd\fP are much faster\&. ++.PP ++If the \fBremote\-glob\fP style (see above) is set, globbing is instead ++performed on the remote host: the server is asked for a list of matching ++files\&. This is highly dependent on how the server is implemented, though ++typically UNIX servers will provide support for basic glob patterns\&. This ++may in some cases be faster, as it avoids retrieving the entire list of ++directory contents\&. ++.PP ++.SS "Automatic and temporary reopening" ++.PP ++As described for the \fBzfopen\fP command, a subsequent \fBzfopen\fP with no ++parameters will reopen the connection to the last host (this includes ++connections made with the \fBzfanon\fP command)\&. Opened in this fashion, the ++connection starts in the default remote directory and will remain open ++until explicitly closed\&. ++.PP ++Automatic re\-opening is also available\&. If a connection is not currently ++open and a command requiring a connection is given, the last connection is ++implicitly reopened\&. In this case the directory which was current when the ++connection was closed again becomes the current directory (unless, of ++course, the command given changes it)\&. Automatic reopening will also take ++place if the connection was close by the remote server for whatever reason ++(e\&.g\&. a timeout)\&. It is not available if the \fB\-1\fP option to \fBzfopen\fP ++or \fBzfanon\fP was used\&. ++.PP ++Furthermore, if the command issued is a file transfer, the connection will ++be closed after the transfer is finished, hence providing a one\-shot mode ++for transfers\&. This does not apply to directory changing or listing ++commands; for example a \fBzfdir\fP may reopen a connection but will leave it ++open\&. Also, automatic closure will only ever happen in the same command as ++automatic opening, i\&.e a \fBzfdir\fP directly followed by a \fBzfget\fP will ++never close the connection automatically\&. ++.PP ++Information about the previous connection is given by the \fBzfstat\fP ++function\&. So, for example, if that reports: ++.PP ++.RS ++.nf ++\fBSession: default ++Not connected\&. ++Last session: ftp\&.bar\&.com:/pub/textfiles\fP ++.fi ++.RE ++.PP ++then the command \fBzfget file\&.txt\fP will attempt to reopen a connection to ++\fBftp\&.bar\&.com\fP, retrieve the file \fB/pub/textfiles/file\&.txt\fP, and ++immediately close the connection again\&. On the other hand, \fBzfcd \&.\&.\fP ++will open the connection in the directory \fB/pub\fP and leave it open\&. ++.PP ++Note that all the above is local to each session; if you return to a ++previous session, the connection for that session is the one which will be ++reopened\&. ++.PP ++.SS "Completion" ++.PP ++Completion of local and remote files, directories, sessions and bookmarks ++is supported\&. The older, \fBcompctl\fP\-style completion is defined when ++\fBzfinit\fP is called; support for the new widget\-based completion system is ++provided in the function \fBCompletion/Zsh/Command/_zftp\fP, which should be ++installed with the other functions of the completion system and hence ++should automatically be available\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zsh.1 +@@ -0,0 +1,496 @@ ++.TH "ZSH" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zsh \- the Z shell ++.\" Yodl file: Zsh/intro.yo ++.SH "OVERVIEW" ++Because zsh contains many features, the zsh manual has been split into ++a number of sections: ++.PP ++.PD 0 ++.TP ++\fIzsh\fP Zsh overview (this section) ++.TP ++\fIzshroadmap\fP Informal introduction to the manual ++.TP ++\fIzshmisc\fP Anything not fitting into the other sections ++.TP ++\fIzshexpn\fP Zsh command and parameter expansion ++.TP ++\fIzshparam\fP Zsh parameters ++.TP ++\fIzshoptions\fP Zsh options ++.TP ++\fIzshbuiltins\fP Zsh built\-in functions ++.TP ++\fIzshzle\fP Zsh command line editing ++.TP ++\fIzshcompwid\fP Zsh completion widgets ++.TP ++\fIzshcompsys\fP Zsh completion system ++.TP ++\fIzshcompctl\fP Zsh completion control ++.TP ++\fIzshmodules\fP Zsh loadable modules ++.TP ++\fIzshcalsys\fP Zsh built\-in calendar functions ++.TP ++\fIzshtcpsys\fP Zsh built\-in TCP functions ++.TP ++\fIzshzftpsys\fP Zsh built\-in FTP client ++.TP ++\fIzshcontrib\fP Additional zsh functions and utilities ++.TP ++\fIzshall\fP Meta\-man page containing all of the above ++.PD ++.SH "DESCRIPTION" ++Zsh is a UNIX command interpreter (shell) usable as an interactive ++login shell and as a shell script command processor\&. Of the standard shells, ++zsh most closely resembles \fBksh\fP but includes many enhancements\&. Zsh ++has command line editing, builtin spelling correction, programmable ++command completion, shell functions (with autoloading), a history ++mechanism, and a host of other features\&. ++.\" Yodl file: Zsh/metafaq.yo ++.SH "AUTHOR" ++Zsh was originally written by Paul Falstad \fB\fP\&. ++Zsh is now maintained by the members of the zsh\-workers mailing ++list \fB\fP\&. The development is currently ++coordinated by Peter Stephenson \fB\fP\&. The coordinator ++can be contacted at \fB\fP, but matters relating to ++the code should generally go to the mailing list\&. ++.SH "AVAILABILITY" ++Zsh is available from the following anonymous FTP sites\&. These mirror ++sites are kept frequently up to date\&. The sites marked with \fI(H)\fP may be ++mirroring \fBftp\&.cs\&.elte\&.hu\fP instead of the primary site\&. ++.PP ++.PD 0 ++.TP ++.PD ++Primary site ++.nf ++\fBftp://ftp\&.zsh\&.org/pub/\fP ++\fBhttp://www\&.zsh\&.org/pub/\fP ++.fi ++.TP ++Australia ++.nf ++\fBftp://ftp\&.zsh\&.org/pub/\fP ++\fBhttp://www\&.zsh\&.org/pub/\fP ++.fi ++.TP ++Denmark ++.nf ++\fBftp://mirrors\&.dotsrc\&.org/zsh/\fP ++.fi ++.TP ++Finland ++.nf ++\fBftp://ftp\&.funet\&.fi/pub/unix/shells/zsh/\fP ++.fi ++.TP ++France ++.nf ++\fBftp://nephtys\&.lip6\&.fr/pub/unix/shells/zsh/\fP ++.fi ++.TP ++Germany ++.nf ++\fBftp://ftp\&.fu\-berlin\&.de/pub/unix/shells/zsh/\fP ++.fi ++.TP ++Hungary ++.nf ++\fBftp://ftp\&.kfki\&.hu/pub/packages/zsh/\fP ++.fi ++.TP ++Poland ++.nf ++\fBftp://sunsite\&.icm\&.edu\&.pl/pub/unix/shells/zsh/\fP ++.fi ++.PP ++The up\-to\-date source code is available via anonymous CVS and Git from ++Sourceforge\&. See \fBhttp://sourceforge\&.net/projects/zsh/\fP for details\&. ++A summary of instructions for the CVS and Git archives can be found at ++\fBhttp://zsh\&.sourceforget\&.net/\fP\&. ++.PP ++.SH "MAILING LISTS" ++Zsh has 3 mailing lists: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\fP ++Announcements about releases, major changes in the shell and the ++monthly posting of the Zsh FAQ\&. (moderated) ++.TP ++\fB\fP ++User discussions\&. ++.TP ++\fB\fP ++Hacking, development, bug reports and patches\&. ++.PP ++To subscribe or unsubscribe, send mail ++to the associated administrative address for the mailing list\&. ++.PP ++.PD 0 ++.TP ++\fB\fP ++.TP ++\fB\fP ++.TP ++\fB\fP ++.PP ++.TP ++\fB\fP ++.TP ++\fB\fP ++.TP ++\fB\fP ++.PD ++.PP ++YOU ONLY NEED TO JOIN ONE OF THE MAILING LISTS AS THEY ARE NESTED\&. ++All submissions to \fBzsh\-announce\fP are automatically forwarded to ++\fBzsh\-users\fP\&. All submissions to \fBzsh\-users\fP are automatically ++forwarded to \fBzsh\-workers\fP\&. ++.PP ++If you have problems subscribing/unsubscribing to any of the mailing ++lists, send mail to \fB\fP\&. The mailing lists are ++maintained by Karsten Thygesen \fB\fP\&. ++.PP ++The mailing lists are archived; the archives can be accessed via the ++administrative addresses listed above\&. There is also a hypertext ++archive, maintained by Geoff Wing \fB\fP, available at ++\fBhttp://www\&.zsh\&.org/mla/\fP\&. ++.SH "THE ZSH FAQ" ++Zsh has a list of Frequently Asked Questions (FAQ), maintained by ++Peter Stephenson \fB\fP\&. It is regularly posted to the ++newsgroup \fBcomp\&.unix\&.shell\fP and the \fBzsh\-announce\fP mailing list\&. ++The latest version can be found at any of the Zsh FTP sites, or at ++\fBhttp://www\&.zsh\&.org/FAQ/\fP\&. The contact address for FAQ\-related matters ++is \fB\fP\&. ++.SH "THE ZSH WEB PAGE" ++Zsh has a web page which is located at \fBhttp://www\&.zsh\&.org/\fP\&. This is ++maintained by Karsten Thygesen \fB\fP, of SunSITE Denmark\&. ++The contact address for web\-related matters is \fB\fP\&. ++.SH "THE ZSH USERGUIDE" ++A userguide is currently in preparation\&. It is intended to complement the ++manual, with explanations and hints on issues where the manual can be ++cabbalistic, hierographic, or downright mystifying (for example, the word ++`hierographic\&' does not exist)\&. It can be viewed in its current state at ++\fBhttp://zsh\&.sourceforge\&.net/Guide/\fP\&. At the time of writing, chapters ++dealing with startup files and their contents and the new completion system ++were essentially complete\&. ++.SH "THE ZSH WIKI" ++A `wiki\&' website for zsh has been created at \fBhttp://www\&.zshwiki\&.org/\fP\&. ++This is a site which can be added to and modified directly by users without ++any special permission\&. You can add your own zsh tips and configurations\&. ++.\" Yodl file: Zsh/invoke.yo ++.SH "INVOCATION" ++The following flags are interpreted by the shell when invoked to determine ++where the shell will read commands from: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-c\fP ++Take the first argument as a command to execute, rather than reading commands ++from a script or standard input\&. If any further arguments are given, the ++first one is assigned to \fB$0\fP, rather than being used as a positional ++parameter\&. ++.TP ++\fB\-i\fP ++Force shell to be interactive\&. It is still possible to specify a ++script to execute\&. ++.TP ++\fB\-s\fP ++Force shell to read commands from the standard input\&. ++If the \fB\-s\fP flag is not present and an argument is given, ++the first argument is taken to be the pathname of a script to ++execute\&. ++.PP ++If there are any remaining arguments after option processing, and neither ++of the options \fB\-c\fP or \fB\-s\fP was supplied, the first argument is taken ++as the file name of a script containing shell commands to be executed\&. If ++the option \fBPATH_SCRIPT\fP is set, and the file name does not contain a ++directory path (i\&.e\&. there is no `\fB/\fP\&' in the name), first the current ++directory and then the command path given by the variable \fBPATH\fP are ++searched for the script\&. If the option is not set or the file name ++contains a `\fB/\fP\&' it is used directly\&. ++.PP ++After the first one or two arguments have been appropriated as described above, ++the remaining arguments are assigned to the positional parameters\&. ++.PP ++For further options, which are common to invocation and the \fBset\fP ++builtin, see ++\fIzshoptions\fP(1)\&. ++.PP ++Options may be specified by name using the \fB\-o\fP option\&. \fB\-o\fP acts like ++a single\-letter option, but takes a following string as the option name\&. ++For example, ++.PP ++.RS ++.nf ++\fBzsh \-x \-o shwordsplit scr\fP ++.fi ++.RE ++.PP ++runs the script \fBscr\fP, setting the \fBXTRACE\fP option by the corresponding ++letter `\fB\-x\fP\&' and the \fBSH_WORD_SPLIT\fP option by name\&. ++Options may be turned \fIoff\fP by name by using \fB+o\fP instead of \fB\-o\fP\&. ++\fB\-o\fP can be stacked up with preceding single\-letter options, so for example ++`\fB\-xo shwordsplit\fP\&' or `\fB\-xoshwordsplit\fP' is equivalent to ++`\fB\-x \-o shwordsplit\fP\&'\&. ++.PP ++Options may also be specified by name in GNU long option style, ++`\fB\-\fP\fB\-\fP\fIoption\-name\fP\&'\&. When this is done, `\fB\-\fP' characters in the ++option name are permitted: they are translated into `\fB_\fP\&', and thus ignored\&. ++So, for example, `\fBzsh \-\fP\fB\-sh\-word\-split\fP\&' invokes zsh with the ++\fBSH_WORD_SPLIT\fP option turned on\&. Like other option syntaxes, options can ++be turned off by replacing the initial `\fB\-\fP\&' with a `\fB+\fP'; thus ++`\fB+\-sh\-word\-split\fP\&' is equivalent to `\fB\-\fP\fB\-no\-sh\-word\-split\fP'\&. ++Unlike other option syntaxes, GNU\-style long options cannot be stacked with ++any other options, so for example `\fB\-x\-shwordsplit\fP\&' is an error, ++rather than being treated like `\fB\-x \-\fP\fB\-shwordsplit\fP\&'\&. ++.PP ++The special GNU\-style option `\fB\-\fP\fB\-version\fP\&' is handled; it sends to ++standard output the shell\&'s version information, then exits successfully\&. ++`\fB\-\fP\fB\-help\fP\&' is also handled; it sends to standard output a list of ++options that can be used when invoking the shell, then exits successfully\&. ++.PP ++Option processing may be finished, allowing following arguments that start with ++`\fB\-\fP\&' or `\fB+\fP' to be treated as normal arguments, in two ways\&. ++Firstly, a lone `\fB\-\fP\&' (or `\fB+\fP') as an argument by itself ends ++option processing\&. Secondly, a special option `\fB\-\fP\fB\-\fP\&' (or ++`\fB+\-\fP\&'), which may be specified on its own (which is the standard ++POSIX usage) or may be stacked with preceding options (so `\fB\-x\-\fP\&' is ++equivalent to `\fB\-x \-\fP\fB\-\fP\&')\&. Options are not permitted to be stacked ++after `\fB\-\fP\fB\-\fP\&' (so `\fB\-x\-f\fP' is an error), but note the GNU\-style ++option form discussed above, where `\fB\-\fP\fB\-shwordsplit\fP\&' is permitted ++and does not end option processing\&. ++.PP ++Except when the \fBsh\fP/\fBksh\fP emulation single\-letter options are in effect, ++the option `\fB\-b\fP\&' (or `\fB+b\fP') ends option processing\&. ++`\fB\-b\fP\&' is like `\fB\-\fP\fB\-\fP', except that further single\-letter options ++can be stacked after the `\fB\-b\fP\&' and will take effect as normal\&. ++.PP ++.PP ++.\" Yodl file: Zsh/compat.yo ++.SH "COMPATIBILITY" ++Zsh tries to emulate \fBsh\fP or \fBksh\fP when it is invoked as ++\fBsh\fP or \fBksh\fP respectively; more precisely, it looks at the first ++letter of the name by which it was invoked, excluding any initial `\fBr\fP\&' ++(assumed to stand for `restricted\&'), and if that is `\fBs\fP' or `\fBk\fP' it ++will emulate \fBsh\fP or \fBksh\fP\&. Furthermore, if invoked as \fBsu\fP (which ++happens on certain systems when the shell is executed by the \fBsu\fP ++command), the shell will try to find an alternative name from the \fBSHELL\fP ++environment variable and perform emulation based on that\&. ++.PP ++In \fBsh\fP and \fBksh\fP compatibility modes the following ++parameters are not special and not initialized by the shell: ++\fBARGC\fP, ++\fBargv\fP, ++\fBcdpath\fP, ++\fBfignore\fP, ++\fBfpath\fP, ++\fBHISTCHARS\fP, ++\fBmailpath\fP, ++\fBMANPATH\fP, ++\fBmanpath\fP, ++\fBpath\fP, ++\fBprompt\fP, ++\fBPROMPT\fP, ++\fBPROMPT2\fP, ++\fBPROMPT3\fP, ++\fBPROMPT4\fP, ++\fBpsvar\fP, ++\fBstatus\fP, ++\fBwatch\fP\&. ++.PP ++The usual zsh startup/shutdown scripts are not executed\&. Login shells ++source \fB/etc/profile\fP followed by \fB$HOME/\&.profile\fP\&. If the ++\fBENV\fP environment variable is set on invocation, \fB$ENV\fP is sourced ++after the profile scripts\&. The value of \fBENV\fP is subjected to ++parameter expansion, command substitution, and arithmetic expansion ++before being interpreted as a pathname\&. Note that the \fBPRIVILEGED\fP ++option also affects the execution of startup files\&. ++.PP ++The following options are set if the shell is invoked as \fBsh\fP or ++\fBksh\fP: ++\fBNO_BAD_PATTERN\fP, ++\fBNO_BANG_HIST\fP, ++\fBNO_BG_NICE\fP, ++\fBNO_EQUALS\fP, ++\fBNO_FUNCTION_ARGZERO\fP, ++\fBGLOB_SUBST\fP, ++\fBNO_GLOBAL_EXPORT\fP, ++\fBNO_HUP\fP, ++\fBINTERACTIVE_COMMENTS\fP, ++\fBKSH_ARRAYS\fP, ++\fBNO_MULTIOS\fP, ++\fBNO_NOMATCH\fP, ++\fBNO_NOTIFY\fP, ++\fBPOSIX_BUILTINS\fP, ++\fBNO_PROMPT_PERCENT\fP, ++\fBRM_STAR_SILENT\fP, ++\fBSH_FILE_EXPANSION\fP, ++\fBSH_GLOB\fP, ++\fBSH_OPTION_LETTERS\fP, ++\fBSH_WORD_SPLIT\fP\&. ++Additionally the \fBBSD_ECHO\fP and \fBIGNORE_BRACES\fP ++options are set if zsh is invoked as \fBsh\fP\&. ++Also, the ++\fBKSH_OPTION_PRINT\fP, ++\fBLOCAL_OPTIONS\fP, ++\fBPROMPT_BANG\fP, ++\fBPROMPT_SUBST\fP ++and ++\fBSINGLE_LINE_ZLE\fP ++options are set if zsh is invoked as \fBksh\fP\&. ++.\" Yodl file: Zsh/restricted.yo ++.SH "RESTRICTED SHELL" ++When the basename of the command used to invoke zsh starts with the letter ++`\fBr\fP\&' or the `\fB\-r\fP' command line option is supplied at invocation, the ++shell becomes restricted\&. Emulation mode is determined after stripping the ++letter `\fBr\fP\&' from the invocation name\&. The following are disabled in ++restricted mode: ++.PP ++.PD 0 ++.TP ++.PD ++\(bu ++changing directories with the \fBcd\fP builtin ++.TP ++\(bu ++changing or unsetting the \fBPATH\fP, \fBpath\fP, \fBMODULE_PATH\fP, ++\fBmodule_path\fP, \fBSHELL\fP, \fBHISTFILE\fP, \fBHISTSIZE\fP, \fBGID\fP, \fBEGID\fP, ++\fBUID\fP, \fBEUID\fP, \fBUSERNAME\fP, \fBLD_LIBRARY_PATH\fP, ++\fBLD_AOUT_LIBRARY_PATH\fP, \fBLD_PRELOAD\fP and \fBLD_AOUT_PRELOAD\fP ++parameters ++.TP ++\(bu ++specifying command names containing \fB/\fP ++.TP ++\(bu ++specifying command pathnames using \fBhash\fP ++.TP ++\(bu ++redirecting output to files ++.TP ++\(bu ++using the \fBexec\fP builtin command to replace the shell with another ++command ++.TP ++\(bu ++using \fBjobs \-Z\fP to overwrite the shell process\&' argument and ++environment space ++.TP ++\(bu ++using the \fBARGV0\fP parameter to override \fBargv[0]\fP for external ++commands ++.TP ++\(bu ++turning off restricted mode with \fBset +r\fP or \fBunsetopt ++RESTRICTED\fP ++.PP ++These restrictions are enforced after processing the startup files\&. The ++startup files should set up \fBPATH\fP to point to a directory of commands ++which can be safely invoked in the restricted environment\&. They may also ++add further restrictions by disabling selected builtins\&. ++.PP ++Restricted mode can also be activated any time by setting the ++\fBRESTRICTED\fP option\&. This immediately enables all the restrictions ++described above even if the shell still has not processed all startup ++files\&. ++.\" Yodl file: Zsh/files.yo ++.SH "STARTUP/SHUTDOWN FILES" ++Commands are first read from \fB/etc/zshenv\fP; this cannot be overridden\&. ++Subsequent behaviour is modified by the \fBRCS\fP and ++\fBGLOBAL_RCS\fP options; the former affects all startup files, while the ++second only affects global startup files (those shown here with an ++path starting with a \fB/\fP)\&. If one of the options ++is unset at any point, any subsequent startup file(s) ++of the corresponding ++type will not be read\&. It is also possible for a file in \fB$ZDOTDIR\fP to ++re\-enable \fBGLOBAL_RCS\fP\&. Both \fBRCS\fP and \fBGLOBAL_RCS\fP are set by ++default\&. ++.PP ++Commands are then read from \fB$ZDOTDIR/\&.zshenv\fP\&. ++If the shell is a login shell, commands ++are read from \fB/etc/zprofile\fP and then \fB$ZDOTDIR/\&.zprofile\fP\&. ++Then, if the shell is interactive, ++commands are read from \fB/etc/zshrc\fP and then \fB$ZDOTDIR/\&.zshrc\fP\&. ++Finally, if the shell is a login shell, \fB/etc/zlogin\fP and ++\fB$ZDOTDIR/\&.zlogin\fP are read\&. ++.PP ++When a login shell exits, the files \fB$ZDOTDIR/\&.zlogout\fP and then ++\fB/etc/zlogout\fP are read\&. This happens with either an explicit exit ++via the \fBexit\fP or \fBlogout\fP commands, or an implicit exit by reading ++end\-of\-file from the terminal\&. However, if the shell terminates due ++to \fBexec\fP\&'ing another process, the logout files are not read\&. ++These are also affected by the \fBRCS\fP and \fBGLOBAL_RCS\fP options\&. ++Note also that the \fBRCS\fP option affects the saving of history files, ++i\&.e\&. if \fBRCS\fP is unset when the shell exits, no history file will be ++saved\&. ++.PP ++If \fBZDOTDIR\fP is unset, \fBHOME\fP is used instead\&. ++Files listed above as being in \fB/etc\fP may be in another ++directory, depending on the installation\&. ++.PP ++As \fB/etc/zshenv\fP is run for all instances of zsh, it is important that ++it be kept as small as possible\&. In particular, it is a good idea to ++put code that does not need to be run for every single shell behind ++a test of the form `\fBif [[ \-o rcs ]]; then \&.\&.\&.\fP\&' so that it will not ++be executed when zsh is invoked with the `\fB\-f\fP\&' option\&. ++.PP ++Any of these files may be pre\-compiled with the \fBzcompile\fP builtin ++command (see \fIzshbuiltins\fP(1))\&. If a compiled file exists (named for the original file plus the ++\fB\&.zwc\fP extension) and it is newer than the original file, the compiled ++file will be used instead\&. ++.\" Yodl file: Zsh/filelist.yo ++.SH "FILES" ++.PD 0 ++.TP ++\fB$ZDOTDIR/\&.zshenv\fP ++.TP ++\fB$ZDOTDIR/\&.zprofile\fP ++.TP ++\fB$ZDOTDIR/\&.zshrc\fP ++.TP ++\fB$ZDOTDIR/\&.zlogin\fP ++.TP ++\fB$ZDOTDIR/\&.zlogout\fP ++.TP ++\fB${TMPPREFIX}*\fP (default is /tmp/zsh*) ++.TP ++\fB/etc/zshenv\fP ++.TP ++\fB/etc/zprofile\fP ++.TP ++\fB/etc/zshrc\fP ++.TP ++\fB/etc/zlogin\fP ++.TP ++\fB/etc/zlogout\fP (installation\-specific \- \fB/etc\fP is the default) ++.PD ++.\" Yodl file: Zsh/seealso.yo ++.SH "SEE ALSO" ++\fIsh\fP(1), ++\fIcsh\fP(1), ++\fItcsh\fP(1), ++\fIrc\fP(1), ++\fIbash\fP(1), ++\fIksh\fP(1), ++\fIzshbuiltins\fP(1), ++\fIzshcompwid\fP(1), ++\fIzshcompsys\fP(1), ++\fIzshcompctl\fP(1), ++\fIzshexpn\fP(1), ++\fIzshmisc\fP(1), ++\fIzshmodules\fP(1), ++\fIzshoptions\fP(1), ++\fIzshparam\fP(1), ++\fIzshzle\fP(1) ++.PP ++\fBIEEE Standard for information Technology \- ++Portable Operating System Interface (POSIX) \- ++Part 2: Shell and Utilities\fP, ++IEEE Inc, 1993, ISBN 1\-55937\-255\-9\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshcalsys.1 +@@ -0,0 +1,948 @@ ++.TH "ZSHCALSYS" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshcalsys \- zsh calendar system ++.\" Yodl file: Zsh/calsys.yo ++.SH "DESCRIPTION" ++.PP ++The shell is supplied with a series of functions to replace and enhance the ++traditional Unix \fBcalendar\fP programme, which warns the user of imminent ++or future events, details of which are stored in a text file (typically ++\fBcalendar\fP in the user\&'s home directory)\&. The version provided here ++includes a mechanism for alerting the user when an event is due\&. ++.PP ++In addition a function \fBage\fP is provided that can be used in a glob ++qualifier; it allows files to be selected based on their modification ++times\&. ++.PP ++The format of the \fBcalendar\fP file and the dates used there in and in ++the \fBage\fP function are described first, then the functions that can ++be called to examine and modify the \fBcalendar\fP file\&. ++.PP ++The functions here depend on the availability of the \fBzsh/datetime\fP ++module which is usually installed with the shell\&. The library function ++\fBstrptime()\fP must be available; it is present on most recent ++operating systems\&. ++.PP ++.PP ++.SH "FILE AND DATE FORMATS" ++.PP ++.SS "Calendar File Format" ++.PP ++The calendar file is by default \fB~/calendar\fP\&. This can be configured ++by the \fBcalendar\-file\fP style, see ++the section STYLES below\&. The basic format consists ++of a series of separate lines, with no indentation, each including ++a date and time specification followed by a description of the event\&. ++.PP ++Various enhancements to this format are supported, based on the syntax ++of Emacs calendar mode\&. An indented line indicates a continuation line ++that continues the description of the event from the preceding line ++(note the date may not be continued in this way)\&. An initial ampersand ++(\fB&\fP) is ignored for compatibility\&. ++.PP ++An indented line on which the first non\-whitespace character is \fB#\fP ++is not displayed with the calendar entry, but is still scanned for ++information\&. This can be used to hide information useful to the ++calendar system but not to the user, such as the unique identifier ++used by \fBcalendar_add\fP\&. ++.PP ++The Emacs extension that a date with no description may refer to a number ++of succeeding events at different times is not supported\&. ++.PP ++Unless the \fBdone\-file\fP style has been altered, any events which ++have been processed are appended to the file with the same name as the ++calendar file with the suffix \fB\&.done\fP, hence \fB~/calendar\&.done\fP by ++default\&. ++.PP ++An example is shown below\&. ++.PP ++.SS "Date Format" ++.PP ++The format of the date and time is designed to allow flexibility without ++admitting ambiguity\&. (The words `date\&' and `time' are both used in the ++documentation below; except where specifically noted this implies a string ++that may include both a date and a time specification\&.) Note that there is ++no localization support; month and day names must be in English and ++separator characters are fixed\&. Matching is case insensitive, and only the ++first three letters of the names are significant, although as a special ++case a form beginning "month" does not match "Monday"\&. Furthermore, time ++zones are not handled; all times are assumed to be local\&. ++.PP ++It is recommended that, rather than exploring the intricacies of the ++system, users find a date format that is natural to them and stick to it\&. ++This will avoid unexpected effects\&. Various key facts should be noted\&. ++.PP ++.PD 0 ++.TP ++.PD ++\(bu ++In particular, note the confusion between ++\fImonth\fP\fB/\fP\fIday\fP\fB/\fP\fIyear\fP and ++\fIday\fP\fB/\fP\fImonth\fP\fB/\fP\fIyear\fP when the month is numeric; these ++formats should be avoided if at all possible\&. Many alternatives are ++available\&. ++.TP ++\(bu ++The year must be given in full to avoid confusion, and only years ++from 1900 to 2099 inclusive are matched\&. ++.PP ++The following give some obvious examples; users finding here ++a format they like and not subject to vagaries of style may skip ++the full description\&. As dates and times are matched separately ++(even though the time may be embedded in the date), any date format ++may be mixed with any format for the time of day provide the ++separators are clear (whitespace, colons, commas)\&. ++.PP ++.RS ++.nf ++\fB2007/04/03 13:13 ++2007/04/03:13:13 ++2007/04/03 1:13 pm ++3rd April 2007, 13:13 ++April 3rd 2007 1:13 p\&.m\&. ++Apr 3, 2007 13:13 ++Tue Apr 03 13:13:00 2007 ++13:13 2007/apr/3\fP ++.fi ++.RE ++.PP ++More detailed rules follow\&. ++.PP ++Times are parsed and extracted before dates\&. They must use colons ++to separate hours and minutes, though a dot is allowed before seconds ++if they are present\&. This limits time formats to the following: ++.PP ++.PD 0 ++.TP ++.PD ++\(bu ++\fIHH\fP\fB:\fP\fIMM\fP[\fB:\fP\fISS\fP[\fB\&.\fP\fIFFFFF\fP]] [\fBam\fP|\fBpm\fP|\fBa\&.m\&.\fP|\fBp\&.m\&.\fP] ++.TP ++\(bu ++\fIHH\fP\fB:\fP\fIMM\fP\fB\&.\fP\fISS\fP[\fB\&.\fP\fIFFFFF\fP] [\fBam\fP|\fBpm\fP|\fBa\&.m\&.\fP|\fBp\&.m\&.\fP] ++.PP ++Here, square brackets indicate optional elements, possibly with ++alternatives\&. Fractions of a second are recognised but ignored\&. For ++absolute times (the normal format require by the \fBcalendar\fP file and the ++\fBage\fP function) a date is mandatory but a time of day is not; the time ++returned is at the start of the date\&. One variation is allowed: if ++\fBa\&.m\&.\fP or \fBp\&.m\&.\fP or one of their variants is present, an hour without a ++minute is allowed, e\&.g\&. \fB3 p\&.m\&.\fP\&. ++.PP ++Time zones are not handled, though if one is matched following a time ++specification it will be removed to allow a surrounding date to be ++parsed\&. This only happens if the format of the timezone is not too ++unusual\&. The following are examples of forms that are understood: ++.PP ++.RS ++.nf ++\fB+0100 ++GMT ++GMT\-7 ++CET+1CDT\fP ++.fi ++.RE ++.PP ++Any part of the timezone that is not numeric must have exactly three ++capital letters in the name\&. ++.PP ++Dates suffer from the ambiguity between \fIDD\fP\fB/\fP\fIMM\fP\fB/\fP\fIYYYY\fP ++and \fIMM\fP\fB/\fP\fIDD\fP\fB/\fP\fIYYYY\fP\&. It is recommended this form is ++avoided with purely numeric dates, but use of ordinals, ++eg\&. \fB3rd/04/2007\fP, will resolve the ambiguity as the ordinal is always ++parsed as the day of the month\&. Years must be four digits (and the first ++two must be \fB19\fP or \fB20\fP); \fB03/04/08\fP is not recognised\&. Other ++numbers may have leading zeroes, but they are not required\&. The following ++are handled: ++.PP ++.PD 0 ++.TP ++.PD ++\(bu ++\fIYYYY\fP\fB/\fP\fIMM\fP\fB/\fP\fIDD\fP ++.TP ++\(bu ++\fIYYYY\fP\fB\-\fP\fIMM\fP\fB\-\fP\fIDD\fP ++.TP ++\(bu ++\fIYYYY\fP\fB/\fP\fIMNM\fP\fB/\fP\fIDD\fP ++.TP ++\(bu ++\fIYYYY\fP\fB\-\fP\fIMNM\fP\fB\-\fP\fIDD\fP ++.TP ++\(bu ++\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP] \fIMNM\fP[\fB,\fP] [ \fIYYYY\fP ] ++.TP ++\(bu ++\fIMNM\fP \fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP][\fB,\fP] [ \fIYYYY\fP ] ++.TP ++\(bu ++\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIMM\fP[\fB,\fP] \fIYYYY\fP ++.TP ++\(bu ++\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIMM\fP\fB/\fP\fIYYYY\fP ++.TP ++\(bu ++\fIMM\fP\fB/\fP\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP][\fB,\fP] \fIYYYY\fP ++.TP ++\(bu ++\fIMM\fP\fB/\fP\fIDD\fP[\fBth\fP|\fBst\fP|\fBrd\fP]\fB/\fP\fIYYYY\fP ++.PP ++Here, \fIMNM\fP is at least the first three letters of a month name, ++matched case\-insensitively\&. The remainder of the month name may appear but ++its contents are irrelevant, so janissary, febrile, martial, apricot, ++maybe, junta, etc\&. are happily handled\&. ++.PP ++Where the year is shown as optional, the current year is assumed\&. There ++are only two such cases, the form \fBJun 20\fP or \fB14 September\fP (the only ++two commonly occurring forms, apart from a "the" in some forms of English, ++which isn\&'t currently supported)\&. Such dates will of course become ++ambiguous in the future, so should ideally be avoided\&. ++.PP ++Times may follow dates with a colon, e\&.g\&. \fB1965/07/12:09:45\fP; this is in ++order to provide a format with no whitespace\&. A comma and whitespace are ++allowed, e\&.g\&. \fB1965/07/12, 09:45\fP\&. Currently the order of these ++separators is not checked, so illogical formats such as \fB1965/07/12, : ++,09:45\fP will also be matched\&. For simplicity such variations are not shown ++in the list above\&. Otherwise, a time is only recognised as being ++associated with a date if there is only whitespace in between, or if the ++time was embedded in the date\&. ++.PP ++Days of the week are not normally scanned, but will be ignored if they ++occur at the start of the date pattern only\&. However, in contexts where it ++is useful to specify dates relative to today, days of the week with no ++other date specification may be given\&. The day is assumed to be either ++today or within the past week\&. Likewise, the words \fByesterday\fP, ++\fBtoday\fP and \fBtomorrow\fP are handled\&. All matches are case\-insensitive\&. ++Hence if today is Monday, then \fBSunday\fP is equivalent to \fByesterday\fP, ++\fBMonday\fP is equivalent to \fBtoday\fP, but \fBTuesday\fP gives a date six ++days ago\&. This is not generally useful within the calendar file\&. ++Dates in this format may be combined with a time specification; for ++example \fBTomorrow, 8 p\&.m\&.\fP\&. ++.PP ++For example, the standard date format: ++.PP ++.RS ++.nf ++\fBFri Aug 18 17:00:48 BST 2006\fP ++.fi ++.RE ++.PP ++is handled by matching \fIHH\fP\fB:\fP\fIMM\fP\fB:\fP\fISS\fP and removing it ++together with the matched (but unused) time zone\&. This leaves the following: ++.PP ++.RS ++.nf ++\fBFri Aug 18 2006\fP ++.fi ++.RE ++.PP ++\fBFri\fP is ignored and the rest is matched according to the standard rules\&. ++.PP ++.SS "Relative Time Format" ++.PP ++In certain places relative times are handled\&. Here, a date is not allowed; ++instead a combination of various supported periods are allowed, together ++with an optional time\&. The periods must be in order from most to ++least significant\&. ++.PP ++In some cases, a more accurate calculation is possible when there is an ++anchor date: offsets of months or years pick the correct day, rather than ++being rounded, and it is possible to pick a particular day in a month as ++`(1st Friday)\&', etc\&., as described in more detail below\&. ++.PP ++Anchors are available in the following cases\&. If one or two times are ++passed to the function \fBcalendar\fP, the start time acts an anchor for the ++end time when the end time is relative (even if the start time is ++implicit)\&. When examining calendar files, the scheduled event being ++examined anchors the warning time when it is given explicitly by means of ++the \fBWARN\fP keyword; likewise, the scheduled event anchors a repetition ++period when given by the \fBRPT\fP keyword, so that specifications such as ++\fBRPT 2 months, 3rd Thursday\fP are handled properly\&. Finally, the \fB\-R\fP ++argument to \fBcalendar_scandate\fP directly provides an anchor for relative ++calculations\&. ++.PP ++The periods handled, with possible abbreviations are: ++.PP ++.PD 0 ++.TP ++.PD ++Years ++\fByears\fP, \fByrs\fP, \fBys\fP, \fByear\fP, \fByr\fP, \fBy\fP, \fByearly\fP\&. ++A year is 365\&.25 days unless there is an anchor\&. ++.TP ++Months ++\fBmonths\fP, \fBmons\fP, \fBmnths\fP, \fBmths\fP, \fBmonth\fP, \fBmon\fP, ++\fBmnth\fP, \fBmth\fP, \fBmonthly\fP\&. Note that \fBm\fP, \fBms\fP, \fBmn\fP, \fBmns\fP ++are ambiguous and are \fInot\fP handled\&. A month is a period ++of 30 days rather than a calendar month unless there is an anchor\&. ++.TP ++Weeks ++\fBweeks\fP, \fBwks\fP, \fBws\fP, \fBweek\fP, \fBwk\fP, \fBw\fP, \fBweekly\fP ++.TP ++Days ++\fBdays\fP, \fBdys\fP, \fBds\fP, \fBday\fP, \fBdy\fP, \fBd\fP, \fBdaily\fP ++.TP ++Hours ++\fBhours\fP, \fBhrs\fP, \fBhs\fP, \fBhour\fP, \fBhr\fP, \fBh\fP, \fBhourly\fP ++.TP ++Minutes ++\fBminutes\fP, \fBmins\fP, \fBminute\fP, \fBmin\fP, but \fInot\fP \fBm\fP, ++\fBms\fP, \fBmn\fP or \fBmns\fP ++.TP ++Seconds ++\fBseconds\fP, \fBsecs\fP, \fBss\fP, \fBsecond\fP, \fBsec\fP, \fBs\fP ++.PP ++Spaces between the numbers are optional, but are required between items, ++although a comma may be used (with or without spaces)\&. ++.PP ++The forms \fByearly\fP to \fBhourly\fP allow the number to be omitted; it is ++assumed to be 1\&. For example, \fB1 d\fP and \fBdaily\fP are equivalent\&. Note ++that using those forms with plurals is confusing; \fB2 yearly\fP is the same ++as \fB2 years\fP, \fInot\fP twice yearly, so it is recommended they only ++be used without numbers\&. ++.PP ++When an anchor time is present, there is an extension to handle regular ++events in the form of the \fIn\fPth \fIsome\fPday of the month\&. Such a ++specification must occur immediately after any year and month ++specification, but before any time of day, and must be in the form ++\fIn\fP\fB(th|st|rd)\fP \fIday\fP, for example \fB1st Tuesday\fP or ++\fB3rd Monday\fP\&. As in other places, days are matched case insensitively, ++must be in English, and only the first three letters are significant except ++that a form beginning `month\&' does not match `Monday'\&. No attempt is made ++to sanitize the resulting date; attempts to squeeze too many occurrences ++into a month will push the day into the next month (but in the obvious ++fashion, retaining the correct day of the week)\&. ++.PP ++Here are some examples: ++.PP ++.RS ++.nf ++\fB30 years 3 months 4 days 3:42:41 ++14 days 5 hours ++Monthly, 3rd Thursday ++4d,10hr\fP ++.fi ++.RE ++.PP ++.SS "Example" ++.PP ++Here is an example calendar file\&. It uses a consistent date format, ++as recommended above\&. ++.PP ++.RS ++.nf ++\fBFeb 1, 2006 14:30 Pointless bureaucratic meeting ++Mar 27, 2006 11:00 Mutual recrimination and finger pointing ++ Bring water pistol and waterproofs ++Mar 31, 2006 14:00 Very serious managerial pontification ++ # UID 12C7878A9A50 ++Apr 10, 2006 13:30 Even more pointless blame assignment exercise WARN 30 mins ++May 18, 2006 16:00 Regular moaning session RPT monthly, 3rd Thursday\fP ++.fi ++.RE ++.PP ++The second entry has a continuation line\&. The third entry has a ++continuation line that will not be shown when the entry is displayed, but ++the unique identifier will be used by the \fBcalendar_add\fP function when ++updating the event\&. The fourth entry will produce a warning 30 minutes ++before the event (to allow you to equip yourself appropriately)\&. The fifth ++entry repeats after a month on the 3rd Thursday, i\&.e\&. June 15, 2006, at the ++same time\&. ++.PP ++.SH "USER FUNCTIONS" ++.PP ++This section describes functions that are designed to be called ++directly by the user\&. The first part describes those functions ++associated with the user\&'s calendar; the second part describes ++the use in glob qualifiers\&. ++.PP ++.SS "Calendar system functions" ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBcalendar\fP [ \fB\-abdDsv\fP ] [ \fB\-C\fP \fIcalfile\fP ] [ \-n \fInum\fP ] [ \fB\-S\fP \fIshowprog\fP ] [ [ \fIstart\fP ] \fIend\fP ]( ++.TP ++.PD ++\fBcalendar \-r\fP [ \fB\-abdDrsv\fP ] [ \fB\-C\fP \fIcalfile\fP ] [ \-n \fInum\fP ] [ \fB\-S\fP \fIshowprog\fP ] [ \fIstart\fP ] ++Show events in the calendar\&. ++.RS ++.PP ++With no arguments, show events from the start of today until the end of ++the next working day after today\&. In other words, if today is Friday, ++Saturday, or Sunday, show up to the end of the following Monday, otherwise ++show today and tomorrow\&. ++.PP ++If \fIend\fP is given, show events from the start of today up to the time ++and date given, which is in the format described in the previous section\&. ++Note that if this is a date the time is assumed to be midnight at the ++start of the date, so that effectively this shows all events before ++the given date\&. ++.PP ++\fIend\fP may start with a \fB+\fP, in which case the remainder of the ++specification is a relative time format as described in the previous ++section indicating the range of time from the start time that is to ++be included\&. ++.PP ++If \fIstart\fP is also given, show events starting from that time and date\&. ++The word \fBnow\fP can be used to indicate the current time\&. ++.PP ++To implement an alert when events are due, include \fBcalendar \-s\fP in your ++\fB~/\&.zshrc\fP file\&. ++.PP ++Options: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-a\fP ++Show all items in the calendar, regardless of the \fBstart\fP and ++\fBend\fP\&. ++.TP ++\fB\-b\fP ++Brief: don\&'t display continuation lines (i\&.e\&. indented lines following ++the line with the date/time), just the first line\&. ++.TP ++\fB\-B\fP \fIlines\fP ++Brief: display at most the first \fIlines\fP lines of the calendar ++entry\&. `\fB\-B 1\fP\&' is equivalent to `\fB\-b\fP'\&. ++.TP ++\fB\-C\fP \fIcalfile\fP ++Explicitly specify a calendar file instead of the value of ++the \fBcalendar\-file\fP style or the default \fB~/calendar\fP\&. ++.TP ++\fB\-d\fP ++Move any events that have passed from the calendar file to the ++"done" file, as given by the \fBdone\-file\fP style or the default ++which is the calendar file with \fB\&.done\fP appended\&. This option ++is implied by the \fB\-s\fP option\&. ++.TP ++\fB\-D\fP ++Turns off the option \fB\-d\fP, even if the \fB\-s\fP option is also present\&. ++.TP ++\fB\-n\fP \fInum\fP, \fB\-\fP\fInum\fP ++Show at least \fInum\fP events, if present in the calendar file, regardless ++of the \fBstart\fP and \fBend\fP\&. ++.TP ++\fB\-r\fP ++Show all the remaining options in the calendar, ignoring the given \fBend\fP ++time\&. The \fBstart\fP time is respected; any argument given is treated ++as a \fBstart\fP time\&. ++.TP ++\fB\-s\fP ++Use the shell\&'s \fBsched\fP command to schedule a timed event that ++will warn the user when an event is due\&. Note that the \fBsched\fP command ++only runs if the shell is at an interactive prompt; a foreground task ++blocks the scheduled task from running until it is finished\&. ++.RS ++.PP ++The timed event usually runs the programme \fBcalendar_show\fP to show ++the event, as described in ++the section UTILITY FUNCTIONS below\&. ++.PP ++By default, a warning of the event is shown five minutes before it is due\&. ++The warning period can be configured by the style \fBwarn\-time\fP or ++for a single calendar entry by including \fBWARN\fP \fIreltime\fP in the first ++line of the entry, where \fIreltime\fP is one of the usual relative time ++formats\&. ++.PP ++A repeated event may be indicated by including \fBRPT\fP \fIreldate\fP in the ++first line of the entry\&. After the scheduled event has been displayed ++it will be re\-entered into the calendar file at a time \fIreldate\fP ++after the existing event\&. Note that this is currently the only use ++made of the repeat count, so that it is not possible to query the schedule ++for a recurrence of an event in the calendar until the previous event ++has passed\&. ++.PP ++If \fBRPT\fP is used, it is also possible to specify that certain ++recurrences of an event are rescheduled or cancelled\&. This is ++done with the \fBOCCURRENCE\fP keyword, followed by whitespace and the ++date and time of the occurrence in the regular sequence, followed by ++whitespace and either the date and time of the rescheduled event or ++the exact string \fBCANCELLED\fP\&. In this case the date and time must ++be in exactly the "date with local time" format used by the ++\fBtext/calendar\fP MIME type (RFC 2445), ++\fI
\fP\fBT\fP\fI\fP (note the presence of the literal ++character \fBT\fP)\&. The first word (the regular recurrence) may be ++something other than a proper date/time to indicate that the event ++is additional to the normal sequence; a convention that retains ++the formatting appearance is \fBXXXXXXXXTXXXXXX\fP\&. ++.PP ++Furthermore, it is useful to record the next regular recurrence ++(as then the displayed date may be for a rescheduled event so cannot ++be used for calculating the regular sequence)\&. This is specified by ++\fBRECURRENCE\fP and a time or date in the same format\&. \fBcalendar_add\fP ++adds such an indication when it encounters a recurring event that does not ++include one, based on the headline date/time\&. ++.PP ++If \fBcalendar_add\fP is used to update occurrences the \fBUID\fP keyword ++described there should be present in both the existing entry and the added ++occurrence in order to identify recurring event sequences\&. ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBThu May 6, 2010 11:00 Informal chat RPT 1 week ++ # RECURRENCE 20100506T110000 ++ # OCCURRENCE 20100513T110000 20100513T120000 ++ # OCCURRENCE 20100520T110000 CANCELLED\fP ++.fi ++.RE ++.PP ++The event that occurs at 11:00 on 13th May 2010 is rescheduled an hour ++later\&. The event that occurs a week later is cancelled\&. The occurrences ++are given on a continuation line starting with a \fB#\fP character so will ++not usually be displayed as part of the event\&. As elsewhere, no account of ++time zones is taken with the times\&. After the next event occurs the headline ++date/time will be `\fBThu May 13, 2010 12:00\fP\&' while the \fBRECURRENCE\fP ++date/time will be `\fB20100513T110000\fP\&' (note that cancelled and ++moved events are not taken account of in the \fBRECURRENCE\fP, which ++records what the next regular recurrence is, but they are accounted for in ++the headline date/time)\&. ++.PP ++It is safe to run \fBcalendar \-s\fP to reschedule an existing event ++(if the calendar file has changed, for example), and also to have it ++running in multiples instances of the shell since the calendar file ++is locked when in use\&. ++.PP ++By default, expired events are moved to the "done" file; see the \fB\-d\fP ++option\&. Use \fB\-D\fP to prevent this\&. ++.RE ++.TP ++\fB\-S\fP \fIshowprog\fP ++Explicitly specify a programme to be used for showing events instead ++of the value of the \fBshow\-prog\fP style or the default \fBcalendar_show\fP\&. ++.TP ++\fB\-v\fP ++Verbose: show more information about stages of processing\&. This ++is useful for confirming that the function has successfully parsed ++the dates in the calendar file\&. ++.RE ++.TP ++\fBcalendar_add\fP [ \fB\-BL\fP ] \fIevent \&.\&.\&.\fP ++Adds a single event to the calendar in the appropriate location\&. ++The event can contain multiple lines, as described in ++the section Calendar File Format above\&. ++Using this function ensures that the calendar file is sorted in date ++and time order\&. It also makes special arrangements for locking ++the file while it is altered\&. The old calendar is left in a file ++with the suffix \fB\&.old\fP\&. ++.RS ++.PP ++The option \fB\-B\fP indicates that backing up the calendar file will be ++handled by the caller and should not be performed by \fBcalendar_add\fP\&. The ++option \fB\-L\fP indicates that \fBcalendar_add\fP does not need to lock the ++calendar file as it is already locked\&. These options will not usually be ++needed by users\&. ++.PP ++If the style \fBreformat\-date\fP is true, the date and time of the ++new entry will be rewritten into the standard date format: see ++the descriptions of this style and the style \fBdate\-format\fP\&. ++.PP ++The function can use a unique identifier stored with each event to ensure ++that updates to existing events are treated correctly\&. The entry ++should contain the word \fBUID\fP, followed by whitespace, followed by ++a word consisting entirely of hexadecimal digits of arbitrary length ++(all digits are significant, including leading zeroes)\&. As the UID ++is not directly useful to the user, it is convenient to hide it on ++an indented continuation line starting with a \fB#\fP, for example: ++.PP ++.RS ++.nf ++\fBAug 31, 2007 09:30 Celebrate the end of the holidays ++ # UID 045B78A0\fP ++.fi ++.RE ++.PP ++The second line will not be shown by the \fBcalendar\fP function\&. ++.PP ++It is possible to specify the \fBRPT\fP keyword followed by \fBCANCELLED\fP ++instead of a relative time\&. This causes any matched event or series ++of events to be cancelled (the original event does not have to be marked ++as recurring in order to be cancelled by this method)\&. A \fBUID\fP is ++required in order to match an existing event in the calendar\&. ++.PP ++\fBcalendar_add\fP will attempt to manage recurrences and occurrences of ++repeating events as described for event scheduling by \fBcalendar \-s\fP ++above\&. To reschedule or cancel a single event \fBcalendar_add\fP should be ++called with an entry that includes the correct \fBUID\fP but does \fInot\fP ++include the \fBRPT\fP keyword as this is taken to mean the entry applies to a ++series of repeating events and hence replaces all existing information\&. ++Each rescheduled or cancelled occurrence must have an \fBOCCURRENCE\fP ++keyword in the entry passed to \fBcalendar_add\fP which will be merged into ++the calendar file\&. Any existing reference to the occurrence is replaced\&. ++An occurrence that does not refer to a valid existing event is added as a ++one\-off occurrence to the same calendar entry\&. ++.RE ++.TP ++\fBcalendar_edit\fP ++This calls the user\&'s editor to edit the calendar file\&. If ++there are arguments, they are taken as the editor to use (the file name ++is appended to the commands); otherwise, the editor is given by the ++variable \fBVISUAL\fP, if set, else the variable \fBEDITOR\fP\&. ++.RS ++.PP ++If the calendar scheduler was running, then after editing the file ++\fBcalendar \-s\fP is called to update it\&. ++.PP ++This function locks out the calendar system during the edit\&. ++Hence it should be used to edit the calendar file if there is any ++possibility of a calendar event occurring meanwhile\&. Note this ++can lead to another shell with calendar functions enabled hanging waiting ++for a lock, so it is necessary to quit the editor as soon as possible\&. ++.RE ++.TP ++\fBcalendar_parse\fP \fIcalendar\-entry\fP ++This is the internal function that analyses the parts of a calendar ++entry, which is passed as the only argument\&. The function returns ++status 1 if the argument could not be parsed as a calendar entry ++and status 2 if the wrong number of arguments were passed; it also sets the ++parameter \fBreply\fP to an empty associative array\&. Otherwise, ++it returns status 0 and sets elements of the associative ++array \fBreply\fP as follows: ++.PD 0 ++.TP ++time ++The time as a string of digits in the same units as ++\fB$EPOCHSECONDS\fP ++.TP ++schedtime ++The regularly scheduled time\&. This may differ from ++the actual event time \fBtime\fP if this is a recurring event and the next ++occurrence has been rescheduled\&. Then \fBtime\fP gives the actual time ++and \fBschedtime\fP the time of the regular recurrence before modification\&. ++.TP ++text1 ++The text from the line not including the date and time of the ++event, but including any \fBWARN\fP or \fBRPT\fP keywords and values\&. ++.TP ++warntime ++Any warning time given by the \fBWARN\fP keyword as a string ++of digits containing the time at which to warn in the same units as ++\fB$EPOCHSECONDS\fP\&. (Note this is an absolute time, not the relative time ++passed down\&.) Not set no \fBWARN\fP keyword and value were ++matched\&. ++.TP ++warnstr ++The raw string matched after the \fBWARN\fP keyword, else unset\&. ++.TP ++rpttime ++Any recurrence time given by the \fBRPT\fP keyword as a string ++of digits containing the time of the recurrence in the same units ++as \fB$EPOCHSECONDS\fP\&. (Note this is an absolute time\&.) Not set if ++no \fBRPT\fP keyword and value were matched\&. ++.TP ++schedrpttime ++The next regularly scheduled occurrence of a recurring ++event before modification\&. This may differ from \fBrpttime\fP, which is the ++actual time of the event that may have been rescheduled from the regular ++time\&. ++.TP ++rptstr ++The raw string matched after the \fBRPT\fP keyword, else unset\&. ++.TP ++text2 ++The text from the line after removal of the date and any ++keywords and values\&. ++.PD ++) ++.TP ++\fBcalendar_showdate\fP [ \fB\-r\fP ] [ \fB\-f\fP \fIfmt\fP ] \fIdate\-spec \&.\&.\&.\fP ++The given \fIdate\-spec\fP is interpreted and the corresponding date and ++time printed\&. If the initial \fIdate\-spec\fP begins with a \fB+\fP or ++\fB\-\fP it is treated as relative to the current time; \fIdate\-spec\fPs after ++the first are treated as relative to the date calculated so far and ++a leading \fB+\fP is optional in that case\&. This allows one to ++use the system as a date calculator\&. For example, \fBcalendar_showdate \&'+1 ++month, 1st Friday\&'\fP shows the date of the first Friday of next month\&. ++.RS ++.PP ++With the option \fB\-r\fP nothing is printed but the value of the date and ++time in seconds since the epoch is stored in the parameter \fBREPLY\fP\&. ++.PP ++With the option \fB\-f\fP \fIfmt\fP the given date/time conversion format ++is passed to \fBstrftime\fP; see notes on the \fBdate\-format\fP style below\&. ++.PP ++In order to avoid ambiguity with negative relative date specifications, ++options must occur in separate words; in other words, \fB\-r\fP and \fB\-f\fP ++should not be combined in the same word\&. ++.RE ++.TP ++\fBcalendar_sort\fP ++Sorts the calendar file into date and time order\&. The old calendar is ++left in a file with the suffix \fB\&.old\fP\&. ++.PP ++.SS "Glob qualifiers" ++.PP ++The function \fBage\fP can be autoloaded and use separately from ++the calendar system, although it uses the function \fBcalendar_scandate\fP ++for date formatting\&. It requires the \fBzsh/stat\fP builtin, but uses ++only the builtin \fBzstat\fP\&. ++.PP ++\fBage\fP selects files having a given modification time for use ++as a glob qualifier\&. The format of the date is the same as that ++understood by the calendar system, described in ++the section FILE AND DATE FORMATS above\&. ++.PP ++The function can take one or two arguments, which can be supplied either ++directly as command or arguments, or separately as shell parameters\&. ++.PP ++.RS ++.nf ++\fBprint *(e:age 2006/10/04 2006/10/09:)\fP ++.fi ++.RE ++.PP ++The example above matches all files modified between the start of those ++dates\&. The second argument may alternatively be a relative time ++introduced by a \fB+\fP: ++.PP ++.RS ++.nf ++\fBprint *(e:age 2006/10/04 +5d:)\fP ++.fi ++.RE ++.PP ++The example above is equivalent to the previous example\&. ++.PP ++In addition to the special use of days of the week, \fBtoday\fP and ++\fByesterday\fP, times with no date may be specified; these apply to today\&. ++Obviously such uses become problematic around midnight\&. ++.PP ++.RS ++.nf ++\fBprint *(e\-age 12:00 13:30\-)\fP ++.fi ++.RE ++.PP ++The example above shows files modified between 12:00 and 13:00 today\&. ++.PP ++.RS ++.nf ++\fBprint *(e:age 2006/10/04:)\fP ++.fi ++.RE ++.PP ++The example above matches all files modified on that date\&. If the second ++argument is omitted it is taken to be exactly 24 hours after the first ++argument (even if the first argument contains a time)\&. ++.PP ++.RS ++.nf ++\fBprint *(e\-age 2006/10/04:10:15 2006/10/04:10:45\-)\fP ++.fi ++.RE ++.PP ++The example above supplies times\&. Note that whitespace within the time and ++date specification must be quoted to ensure \fBage\fP receives the correct ++arguments, hence the use of the additional colon to separate the date and ++time\&. ++.PP ++.RS ++.nf ++\fBAGEREF1=2006/10/04:10:15 ++AGEREF2=2006/10/04:10:45 ++print *(+age)\fP ++.fi ++.RE ++.PP ++This shows the same example before using another form of argument ++passing\&. The dates and times in the parameters \fBAGEREF1\fP and \fBAGEREF2\fP ++stay in effect until unset, but will be overridden if any argument is ++passed as an explicit argument to age\&. Any explicit argument ++causes both parameters to be ignored\&. ++.PP ++.SH "STYLES" ++.PP ++The zsh style mechanism using the \fBzstyle\fP command is describe in ++\fIzshmodules\fP(1)\&. This is the same mechanism ++used in the completion system\&. ++.PP ++The styles below are all examined in the context ++\fB:datetime:\fP\fIfunction\fP\fB:\fP, for example \fB:datetime:calendar:\fP\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBcalendar\-file\fP ++The location of the main calendar\&. The default is \fB~/calendar\fP\&. ++.TP ++\fBdate\-format\fP ++A \fBstrftime\fP format string (see \fIstrftime\fP(3)) with the zsh ++extensions providing various numbers with no leading zero or space ++if the number is a single digit as described for the ++\fB%D{\fP\fIstring\fP\fB}\fP prompt format in ++the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. ++.RS ++.PP ++This is used for outputting dates in \fBcalendar\fP, both to support ++the \fB\-v\fP option and when adding recurring events back to the calendar ++file, and in \fBcalendar_showdate\fP as the final output format\&. ++.PP ++If the style is not set, the default used is similar the standard system ++format as output by the \fBdate\fP command (also known as `ctime format\&'): ++`\fB%a %b %d %H:%M:%S %Z %Y\fP\&'\&. ++.RE ++.TP ++\fBdone\-file\fP ++The location of the file to which events which have passed are appended\&. ++The default is the calendar file location with the suffix \fB\&.done\fP\&. ++The style may be set to an empty string in which case a "done" file ++will not be maintained\&. ++.TP ++\fBreformat\-date\fP ++Boolean, used by \fBcalendar_add\fP\&. If it is true, the date and time ++of new entries added to the calendar will be reformatted to the format ++given by the style \fBdate\-format\fP or its default\&. Only the date and ++time of the event itself is reformatted; any subsidiary dates and times ++such as those associated with repeat and warning times are left alone\&. ++.TP ++\fBshow\-prog\fP ++The programme run by \fBcalendar\fP for showing events\&. It will ++be passed the start time and stop time of the events requested in seconds ++since the epoch followed by the event text\&. Note that \fBcalendar \-s\fP uses ++a start time and stop time equal to one another to indicate alerts ++for specific events\&. ++.RS ++.PP ++The default is the function \fBcalendar_show\fP\&. ++.RE ++.TP ++\fBwarn\-time\fP ++The time before an event at which a warning will be displayed, if the ++first line of the event does not include the text \fBEVENT\fP \fIreltime\fP\&. ++The default is 5 minutes\&. ++.PP ++.SH "UTILITY FUNCTIONS" ++.PP ++.PD 0 ++.TP ++.PD ++\fBcalendar_lockfiles\fP ++Attempt to lock the files given in the argument\&. To prevent ++problems with network file locking this is done in an ad hoc fashion ++by attempting to create a symbolic link to the file with the name ++\fIfile\fP\fB\&.lockfile\fP\&. No other system level functions are used ++for locking, i\&.e\&. the file can be accessed and modified by any ++utility that does not use this mechanism\&. In particular, the user is not ++prevented from editing the calendar file at the same time unless ++\fBcalendar_edit\fP is used\&. ++.RS ++.PP ++Three attempts are made to lock the file before giving up\&. If the module ++\fBzsh/zselect\fP is available, the times of the attempts are jittered so that ++multiple instances of the calling function are unlikely to retry at the ++same time\&. ++.PP ++The files locked are appended to the array \fBlockfiles\fP, which should ++be local to the caller\&. ++.PP ++If all files were successfully locked, status zero is returned, else status one\&. ++.PP ++This function may be used as a general file locking function, although ++this will only work if only this mechanism is used to lock files\&. ++.RE ++.TP ++\fBcalendar_read\fP ++This is a backend used by various other functions to parse the ++calendar file, which is passed as the only argument\&. The array ++\fBcalendar_entries\fP is set to the list of events in the file; no ++pruning is done except that ampersands are removed from the start of ++the line\&. Each entry may contain multiple lines\&. ++.TP ++\fBcalendar_scandate\fP ++This is a generic function to parse dates and times that may be ++used separately from the calendar system\&. The argument is a date ++or time specification as described in ++the section FILE AND DATE FORMATS above\&. The parameter \fBREPLY\fP ++is set to the number of seconds since the epoch corresponding to that date ++or time\&. By default, the date and time may occur anywhere within the given ++argument\&. ++.RS ++.PP ++Returns status zero if the date and time were successfully parsed, ++else one\&. ++.PP ++Options: ++.PD 0 ++.TP ++.PD ++\fB\-a\fP ++The date and time are anchored to the start of the argument; they ++will not be matched if there is preceding text\&. ++.TP ++\fB\-A\fP ++The date and time are anchored to both the start and end of the argument; ++they will not be matched if the is any other text in the argument\&. ++.TP ++\fB\-d\fP ++Enable additional debugging output\&. ++.TP ++\fB\-m\fP ++Minus\&. When \fB\-R\fP \fIanchor_time\fP is also given the relative time is ++calculated backwards from \fIanchor_time\fP\&. ++.TP ++\fB\-r\fP ++The argument passed is to be parsed as a relative time\&. ++.TP ++\fB\-R\fP \fIanchor_time\fP ++The argument passed is to be parsed as a relative time\&. The time is ++relative to \fIanchor_time\fP, a time in seconds since the epoch, ++and the returned value is the absolute time corresponding to advancing ++\fIanchor_time\fP by the relative time given\&. ++This allows lengths of months to be correctly taken into account\&. If ++the final day does not exist in the given month, the last day of the ++final month is given\&. For example, if the anchor time is during 31st ++January 2007 and the relative time is 1 month, the final time is the ++same time of day during 28th February 2007\&. ++.TP ++\fB\-s\fP ++In addition to setting \fBREPLY\fP, set \fBREPLY2\fP to the remainder of ++the argument after the date and time have been stripped\&. This is ++empty if the option \fB\-A\fP was given\&. ++.TP ++\fB\-t\fP ++Allow a time with no date specification\&. The date is assumed to be ++today\&. The behaviour is unspecified if the iron tongue of midnight ++is tolling twelve\&. ++.RE ++.TP ++\fBcalendar_show\fP ++The function used by default to display events\&. It accepts a start time ++and end time for events, both in epoch seconds, and an event description\&. ++.RS ++.PP ++The event is always printed to standard output\&. If the command line editor ++is active (which will usually be the case) the command line will be ++redisplayed after the output\&. ++.PP ++If the parameter \fBDISPLAY\fP is set and the start and end times are ++the same (indicating a scheduled event), the function uses the ++command \fBxmessage\fP to display a window with the event details\&. ++.RE ++.RE ++.PP ++.SH "BUGS" ++.PP ++As the system is based entirely on shell functions (with a little support ++from the \fBzsh/datetime\fP module) the mechanisms used are not as robust as ++those provided by a dedicated calendar utility\&. Consequently the user ++should not rely on the shell for vital alerts\&. ++.PP ++There is no \fBcalendar_delete\fP function\&. ++.PP ++There is no localization support for dates and times, nor any support ++for the use of time zones\&. ++.PP ++Relative periods of months and years do not take into account the variable ++number of days\&. ++.PP ++The \fBcalendar_show\fP function is currently hardwired to use \fBxmessage\fP ++for displaying alerts on X Window System displays\&. This should be ++configurable and ideally integrate better with the desktop\&. ++.PP ++\fBcalendar_lockfiles\fP hangs the shell while waiting for a lock on a file\&. ++If called from a scheduled task, it should instead reschedule the event ++that caused it\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshoptions.1 +@@ -0,0 +1,1674 @@ ++.TH "ZSHOPTIONS" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshoptions \- zsh options ++.\" Yodl file: Zsh/options.yo ++.SH "SPECIFYING OPTIONS" ++Options are primarily referred to by name\&. ++These names are case insensitive and underscores are ignored\&. ++For example, `\fBallexport\fP\&' is equivalent to `\fBA__lleXP_ort\fP'\&. ++.PP ++The sense of an option name may be inverted by preceding it with ++`\fBno\fP\&', so `\fBsetopt No_Beep\fP' is equivalent to `\fBunsetopt beep\fP'\&. ++This inversion can only be done once, so `\fBnonobeep\fP\&' is \fInot\fP ++a synonym for `\fBbeep\fP\&'\&. Similarly, `\fBtify\fP' is not a synonym for ++`\fBnonotify\fP\&' (the inversion of `\fBnotify\fP')\&. ++.PP ++Some options also have one or more single letter names\&. ++There are two sets of single letter options: one used by default, ++and another used to emulate \fBsh\fP/\fBksh\fP (used when the ++\fBSH_OPTION_LETTERS\fP option is set)\&. ++The single letter options can be used on the shell command line, ++or with the \fBset\fP, \fBsetopt\fP and \fBunsetopt\fP ++builtins, as normal Unix options preceded by `\fB\-\fP\&'\&. ++.PP ++The sense of the single letter options may be inverted by using ++`\fB+\fP\&' instead of `\fB\-\fP'\&. ++Some of the single letter option names refer to an option being off, ++in which case the inversion of that name refers to the option being on\&. ++For example, `\fB+n\fP\&' is the short name of `\fBexec\fP', and ++`\fB\-n\fP\&' is the short name of its inversion, `\fBnoexec\fP'\&. ++.PP ++In strings of single letter options supplied to the shell at startup, ++trailing whitespace will be ignored; for example the string `\fB\-f \fP\&' ++will be treated just as `\fB\-f\fP\&', but the string `\fB\-f i\fP' is an error\&. ++This is because many systems which implement the `\fB#!\fP\&' mechanism for ++calling scripts do not strip trailing whitespace\&. ++.PP ++.SH "DESCRIPTION OF OPTIONS" ++In the following list, options set by default in all emulations are marked ++; those set by default only in csh, ksh, sh, or zsh emulations are marked ++, , , as appropriate\&. When listing options (by `\fBsetopt\fP\&', ++`\fBunsetopt\fP\&', `\fBset \-o\fP' or `\fBset +o\fP'), those turned on by default ++appear in the list prefixed with `\fBno\fP\&'\&. Hence (unless ++\fBKSH_OPTION_PRINT\fP is set), `\fBsetopt\fP\&' shows all options whose settings ++are changed from the default\&. ++.PP ++.SS "Changing Directories" ++.PD 0 ++.TP ++.PD ++\fBAUTO_CD\fP (\fB\-J\fP) ++If a command is issued that can\&'t be executed as a normal command, ++and the command is the name of a directory, perform the \fBcd\fP ++command to that directory\&. ++.TP ++\fBAUTO_PUSHD\fP (\fB\-N\fP) ++Make \fBcd\fP push the old directory onto the directory stack\&. ++.TP ++\fBCDABLE_VARS\fP (\fB\-T\fP) ++If the argument to a \fBcd\fP command (or an implied \fBcd\fP with the ++\fBAUTO_CD\fP option set) is not a directory, and does not begin with a ++slash, try to expand the expression as if it were preceded by a `\fB~\fP\&' (see ++the section `Filename Expansion\&')\&. ++.TP ++\fBCHASE_DOTS\fP ++When changing to a directory containing a path segment `\fB\&.\&.\fP\&' which would ++otherwise be treated as canceling the previous segment in the path (in ++other words, `\fBfoo/\&.\&.\fP\&' would be removed from the path, or if `\fB\&.\&.\fP' is ++the first part of the path, the last part of the current working directory ++would be removed), instead resolve the path to the physical directory\&. ++This option is overridden by \fBCHASE_LINKS\fP\&. ++.RS ++.PP ++For example, suppose \fB/foo/bar\fP is a link to the directory \fB/alt/rod\fP\&. ++Without this option set, `\fBcd /foo/bar/\&.\&.\fP\&' changes to \fB/foo\fP; with it ++set, it changes to \fB/alt\fP\&. The same applies if the current directory ++is \fB/foo/bar\fP and `\fBcd \&.\&.\fP\&' is used\&. Note that all other symbolic ++links in the path will also be resolved\&. ++.RE ++.TP ++\fBCHASE_LINKS\fP (\fB\-w\fP) ++Resolve symbolic links to their true values when changing directory\&. ++This also has the effect of \fBCHASE_DOTS\fP, i\&.e\&. a `\fB\&.\&.\fP\&' path segment ++will be treated as referring to the physical parent, even if the preceding ++path segment is a symbolic link\&. ++.TP ++\fBPOSIX_CD\fP ++Modifies the behaviour of \fBcd\fP, \fBchdir\fP and \fBpushd\fP commands ++to make them more compatible with the POSIX standard\&. The behaviour with ++the option unset is described in the documentation for the \fBcd\fP ++builtin in ++\fIzshbuiltins\fP(1)\&. ++If the option is set, the shell does not test for directories beneath ++the local directory (`\fB\&.\fP\&') until after all directories in \fBcdpath\fP ++have been tested\&. ++.RS ++.PP ++Also, if the option is set, the conditions under which the shell ++prints the new directory after changing to it are modified\&. It is ++no longer restricted to interactive shells (although printing of ++the directory stack with \fBpushd\fP is still limited to interactive ++shells); and any use of a component of \fBCDPATH\fP, including a `\fB\&.\fP\&' but ++excluding an empty component that is otherwise treated as `\fB\&.\fP\&', causes ++the directory to be printed\&. ++.RE ++.TP ++\fBPUSHD_IGNORE_DUPS\fP ++Don\&'t push multiple copies of the same directory onto the directory stack\&. ++.TP ++\fBPUSHD_MINUS\fP ++Exchanges the meanings of `\fB+\fP\&' and `\fB\-\fP' ++when used with a number to specify a directory in the stack\&. ++.TP ++\fBPUSHD_SILENT\fP (\fB\-E\fP) ++Do not print the directory stack after \fBpushd\fP or \fBpopd\fP\&. ++.TP ++\fBPUSHD_TO_HOME\fP (\fB\-D\fP) ++Have \fBpushd\fP with no arguments act like `\fBpushd $HOME\fP\&'\&. ++.PP ++.SS "Completion" ++.PD 0 ++.TP ++.PD ++\fBALWAYS_LAST_PROMPT\fP ++If unset, key functions that list completions try to return to the last ++prompt if given a numeric argument\&. If set these functions try to ++return to the last prompt if given \fIno\fP numeric argument\&. ++.TP ++\fBALWAYS_TO_END\fP ++If a completion is performed with the cursor within a word, and a ++full completion is inserted, the cursor is moved to the end of the ++word\&. That is, the cursor is moved to the end of the word if either ++a single match is inserted or menu completion is performed\&. ++.TP ++\fBAUTO_LIST\fP (\fB\-9\fP) ++Automatically list choices on an ambiguous completion\&. ++.TP ++\fBAUTO_MENU\fP ++Automatically use menu completion after the second consecutive request for ++completion, for example by pressing the tab key repeatedly\&. This option ++is overridden by \fBMENU_COMPLETE\fP\&. ++.TP ++\fBAUTO_NAME_DIRS\fP ++Any parameter that is set to the absolute name of a directory ++immediately becomes a name for that directory, that will be used ++by the `\fB%~\fP\&' ++and related prompt sequences, and will be available when completion ++is performed on a word starting with `\fB~\fP\&'\&. ++(Otherwise, the parameter must be used in the form `\fB~\fP\fIparam\fP\&' first\&.) ++.TP ++\fBAUTO_PARAM_KEYS\fP ++If a parameter name was completed and a following character ++(normally a space) automatically ++inserted, and the next character typed is one ++of those that have to come directly after the name (like `\fB}\fP\&', `\fB:\fP', ++etc\&.), the automatically added character is deleted, so that the character ++typed comes immediately after the parameter name\&. ++Completion in a brace expansion is affected similarly: the added character ++is a `\fB,\fP\&', which will be removed if `\fB}\fP' is typed next\&. ++.TP ++\fBAUTO_PARAM_SLASH\fP ++If a parameter is completed whose content is the name of a directory, ++then add a trailing slash instead of a space\&. ++.TP ++\fBAUTO_REMOVE_SLASH\fP ++When the last character resulting from a completion is a slash and the next ++character typed is a word delimiter, a slash, or a character that ends ++a command (such as a semicolon or an ampersand), remove the slash\&. ++.TP ++\fBBASH_AUTO_LIST\fP ++On an ambiguous completion, automatically list choices when the ++completion function is called twice in succession\&. This takes ++precedence over \fBAUTO_LIST\fP\&. The setting of \fBLIST_AMBIGUOUS\fP is ++respected\&. If \fBAUTO_MENU\fP is set, the menu behaviour will then start ++with the third press\&. Note that this will not work with ++\fBMENU_COMPLETE\fP, since repeated completion calls immediately cycle ++through the list in that case\&. ++.TP ++\fBCOMPLETE_ALIASES\fP ++Prevents aliases on the command line from being internally substituted ++before completion is attempted\&. The effect is to make the alias a ++distinct command for completion purposes\&. ++.TP ++\fBCOMPLETE_IN_WORD\fP ++If unset, the cursor is set to the end of the word if completion is ++started\&. Otherwise it stays there and completion is done from both ends\&. ++.TP ++\fBGLOB_COMPLETE\fP ++When the current word has a glob pattern, do not insert all the words ++resulting from the expansion but generate matches as for completion and ++cycle through them like \fBMENU_COMPLETE\fP\&. The matches are generated as if ++a `\fB*\fP\&' was added to the end of the word, or inserted at the cursor when ++\fBCOMPLETE_IN_WORD\fP is set\&. This actually uses pattern matching, not ++globbing, so it works not only for files but for any completion, such as ++options, user names, etc\&. ++.RS ++.PP ++Note that when the pattern matcher is used, matching control (for example, ++case\-insensitive or anchored matching) cannot be used\&. This limitation ++only applies when the current word contains a pattern; simply turning ++on the \fBGLOB_COMPLETE\fP option does not have this effect\&. ++.RE ++.TP ++\fBHASH_LIST_ALL\fP ++Whenever a command completion is attempted, make sure the entire ++command path is hashed first\&. This makes the first completion slower\&. ++.TP ++\fBLIST_AMBIGUOUS\fP ++This option works when \fBAUTO_LIST\fP or \fBBASH_AUTO_LIST\fP is also ++set\&. If there is an unambiguous prefix to insert on the command line, ++that is done without a completion list being displayed; in other ++words, auto\-listing behaviour only takes place when nothing would be ++inserted\&. In the case of \fBBASH_AUTO_LIST\fP, this means that the list ++will be delayed to the third call of the function\&. ++.TP ++\fBLIST_BEEP\fP ++Beep on an ambiguous completion\&. More accurately, this forces the ++completion widgets to return status 1 on an ambiguous completion, which ++causes the shell to beep if the option \fBBEEP\fP is also set; this may ++be modified if completion is called from a user\-defined widget\&. ++.TP ++\fBLIST_PACKED\fP ++Try to make the completion list smaller (occupying less lines) by ++printing the matches in columns with different widths\&. ++.TP ++\fBLIST_ROWS_FIRST\fP ++Lay out the matches in completion lists sorted horizontally, that is, ++the second match is to the right of the first one, not under it as ++usual\&. ++.TP ++\fBLIST_TYPES\fP (\fB\-X\fP) ++When listing files that are possible completions, show the ++type of each file with a trailing identifying mark\&. ++.TP ++\fBMENU_COMPLETE\fP (\fB\-Y\fP) ++On an ambiguous completion, instead of listing possibilities or beeping, ++insert the first match immediately\&. Then when completion is requested ++again, remove the first match and insert the second match, etc\&. ++When there are no more matches, go back to the first one again\&. ++\fBreverse\-menu\-complete\fP may be used to loop through the list ++in the other direction\&. This option overrides \fBAUTO_MENU\fP\&. ++.TP ++\fBREC_EXACT\fP (\fB\-S\fP) ++In completion, recognize exact matches even ++if they are ambiguous\&. ++.PP ++.SS "Expansion and Globbing" ++.PD 0 ++.TP ++.PD ++\fBBAD_PATTERN\fP (\fB+2\fP) ++If a pattern for filename generation is badly formed, print an error message\&. ++(If this option is unset, the pattern will be left unchanged\&.) ++.TP ++\fBBARE_GLOB_QUAL\fP ++In a glob pattern, treat a trailing set of parentheses as a qualifier ++list, if it contains no `\fB|\fP\&', `\fB(\fP' or (if special) `\fB~\fP' ++characters\&. See the section `Filename Generation\&'\&. ++.TP ++\fBBRACE_CCL\fP ++Expand expressions in braces which would not otherwise undergo brace ++expansion to a lexically ordered list of all the characters\&. See ++the section `Brace Expansion\&'\&. ++.TP ++\fBCASE_GLOB\fP ++Make globbing (filename generation) sensitive to case\&. Note that other ++uses of patterns are always sensitive to case\&. If the option is unset, ++the presence of any character which is special to filename generation ++will cause case\-insensitive matching\&. For example, \fBcvs(/)\fP ++can match the directory \fBCVS\fP owing to the presence of the globbing flag ++(unless the option \fBBARE_GLOB_QUAL\fP is unset)\&. ++.TP ++\fBCASE_MATCH\fP ++Make regular expressions using the \fBzsh/regex\fP module (including ++matches with \fB=~\fP) sensitive to case\&. ++.TP ++\fBCSH_NULL_GLOB\fP ++If a pattern for filename generation has no matches, ++delete the pattern from the argument list; ++do not report an error unless all the patterns ++in a command have no matches\&. ++Overrides \fBNOMATCH\fP\&. ++.TP ++\fBEQUALS\fP ++Perform \fB=\fP filename expansion\&. ++(See the section `Filename Expansion\&'\&.) ++.TP ++\fBEXTENDED_GLOB\fP ++Treat the `\fB#\fP\&', `\fB~\fP' and `\fB^\fP' characters as part of patterns ++for filename generation, etc\&. (An initial unquoted `\fB~\fP\&' ++always produces named directory expansion\&.) ++.TP ++\fBGLOB\fP (\fB+F\fP, ksh: \fB+f\fP) ++Perform filename generation (globbing)\&. ++(See the section `Filename Generation\&'\&.) ++.TP ++\fBGLOB_ASSIGN\fP ++If this option is set, filename generation (globbing) is ++performed on the right hand side of scalar parameter assignments of ++the form `\fIname\fP\fB=\fP\fIpattern\fP (e\&.g\&. `\fBfoo=*\fP\&')\&. ++If the result has more than one word the parameter will become an array ++with those words as arguments\&. This option is provided for backwards ++compatibility only: globbing is always performed on the right hand side ++of array assignments of the form `\fIname\fP\fB=(\fP\fIvalue\fP\fB)\fP\&' ++(e\&.g\&. `\fBfoo=(*)\fP\&') and this form is recommended for clarity; ++with this option set, it is not possible to predict whether the result ++will be an array or a scalar\&. ++.TP ++\fBGLOB_DOTS\fP (\fB\-4\fP) ++Do not require a leading `\fB\&.\fP\&' in a filename to be matched explicitly\&. ++.TP ++\fBGLOB_SUBST\fP ++Treat any characters resulting from parameter expansion as being ++eligible for file expansion and filename generation, and any ++characters resulting from command substitution as being eligible for ++filename generation\&. Braces (and commas in between) do not become eligible ++for expansion\&. ++.TP ++\fBHIST_SUBST_PATTERN\fP ++Substitutions using the \fB:s\fP and \fB:&\fP history modifiers are performed ++with pattern matching instead of string matching\&. This occurs wherever ++history modifiers are valid, including glob qualifiers and parameters\&. ++See ++the section Modifiers in \fIzshexpn\fP(1)\&. ++.TP ++\fBIGNORE_BRACES\fP (\fB\-I\fP) ++Do not perform brace expansion\&. ++.TP ++\fBKSH_GLOB\fP ++In pattern matching, the interpretation of parentheses is affected by ++a preceding `\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP'\&. ++See the section `Filename Generation\&'\&. ++.TP ++\fBMAGIC_EQUAL_SUBST\fP ++All unquoted arguments of the form `\fIanything\fP\fB=\fP\fIexpression\fP\&' ++appearing after the command name have filename expansion (that is, ++where \fIexpression\fP has a leading `\fB~\fP\&' or `\fB=\fP') performed on ++\fIexpression\fP as if it were a parameter assignment\&. The argument is ++not otherwise treated specially; it is passed to the command as a single ++argument, and not used as an actual parameter assignment\&. For example, in ++\fBecho foo=~/bar:~/rod\fP, both occurrences of \fB~\fP would be replaced\&. ++Note that this happens anyway with \fBtypeset\fP and similar statements\&. ++.RS ++.PP ++This option respects the setting of the \fBKSH_TYPESET\fP option\&. In other ++words, if both options are in effect, arguments looking like ++assignments will not undergo word splitting\&. ++.RE ++.TP ++\fBMARK_DIRS\fP (\fB\-8\fP, ksh: \fB\-X\fP) ++Append a trailing `\fB/\fP\&' to all directory ++names resulting from filename generation (globbing)\&. ++.TP ++\fBMULTIBYTE\fP ++Respect multibyte characters when found in strings\&. ++When this option is set, strings are examined using the ++system library to determine how many bytes form a character, depending ++on the current locale\&. This affects the way characters are counted in ++pattern matching, parameter values and various delimiters\&. ++.RS ++.PP ++The option is on by default if the shell was compiled with ++\fBMULTIBYTE_SUPPORT\fP except in \fBsh\fP emulation; otherwise it is off by ++default and has no effect if turned on\&. The mode is off in \fBsh\fP ++emulation for compatibility but for interactive use may need to be ++turned on if the terminal interprets multibyte characters\&. ++.PP ++If the option is off a single byte is always treated as a single ++character\&. This setting is designed purely for examining strings ++known to contain raw bytes or other values that may not be characters ++in the current locale\&. It is not necessary to unset the option merely ++because the character set for the current locale does not contain multibyte ++characters\&. ++.PP ++The option does not affect the shell\&'s editor, which always uses the ++locale to determine multibyte characters\&. This is because ++the character set displayed by the terminal emulator is independent of ++shell settings\&. ++.RE ++.TP ++\fBNOMATCH\fP (\fB+3\fP) ++If a pattern for filename generation has no matches, ++print an error, instead of ++leaving it unchanged in the argument list\&. ++This also applies to file expansion ++of an initial `\fB~\fP\&' or `\fB=\fP'\&. ++.TP ++\fBNULL_GLOB\fP (\fB\-G\fP) ++If a pattern for filename generation has no matches, ++delete the pattern from the argument list instead ++of reporting an error\&. Overrides \fBNOMATCH\fP\&. ++.TP ++\fBNUMERIC_GLOB_SORT\fP ++If numeric filenames are matched by a filename generation pattern, ++sort the filenames numerically rather than lexicographically\&. ++.TP ++\fBRC_EXPAND_PARAM\fP (\fB\-P\fP) ++Array expansions of the form ++`\fIfoo\fP\fB${\fP\fIxx\fP\fB}\fP\fIbar\fP\&', where the parameter ++\fIxx\fP is set to \fB(\fP\fIa b c\fP\fB)\fP, are substituted with ++`\fIfooabar foobbar foocbar\fP\&' instead of the default ++`\fIfooa b cbar\fP\&'\&. Note that an empty array will therefore cause ++all arguments to be removed\&. ++.TP ++\fBREMATCH_PCRE\fP ++If set, regular expression matching with the \fB=~\fP operator will use ++Perl\-Compatible Regular Expressions from the PCRE library, if available\&. ++If not set, regular expressions will use the extended regexp syntax ++provided by the system libraries\&. ++.TP ++\fBSH_GLOB\fP ++Disables the special meaning of `\fB(\fP\&', `\fB|\fP', `\fB)\fP' ++and \&'\fB<\fP' for globbing the result of parameter and command substitutions, ++and in some other places where ++the shell accepts patterns\&. If \fBSH_GLOB\fP is set but \fBKSH_GLOB\fP is ++not, the shell allows the interpretation of ++subshell expressions enclosed in parentheses in some cases where there ++is no space before the opening parenthesis, e\&.g\&. \fB!(true)\fP ++is interpreted as if there were a space after the \fB!\fP\&. This option is ++set by default if zsh is invoked as \fBsh\fP or \fBksh\fP\&. ++.TP ++\fBUNSET\fP (\fB+u\fP, ksh: \fB+u\fP) ++Treat unset parameters as if they were empty when substituting\&. ++Otherwise they are treated as an error\&. ++.TP ++\fBWARN_CREATE_GLOBAL\fP ++Print a warning message when a global parameter is created in a function ++by an assignment\&. This often indicates that a parameter has not been ++declared local when it should have been\&. Parameters explicitly declared ++global from within a function using \fBtypeset \-g\fP do not cause a warning\&. ++Note that there is no warning when a local parameter is assigned to in ++a nested function, which may also indicate an error\&. ++.PP ++.SS "History" ++.PD 0 ++.TP ++.PD ++\fBAPPEND_HISTORY\fP ++If this is set, zsh sessions will append their history list to ++the history file, rather than replace it\&. Thus, multiple parallel ++zsh sessions will all have the new entries from their history lists ++added to the history file, in the order that they exit\&. ++The file will still be periodically re\-written to trim it when the ++number of lines grows 20% beyond the value specified by ++\fB$SAVEHIST\fP (see also the HIST_SAVE_BY_COPY option)\&. ++.TP ++\fBBANG_HIST\fP (\fB+K\fP) ++Perform textual history expansion, \fBcsh\fP\-style, ++treating the character `\fB!\fP\&' specially\&. ++.TP ++\fBEXTENDED_HISTORY\fP ++Save each command\&'s beginning timestamp (in seconds since the epoch) ++and the duration (in seconds) to the history file\&. The format of ++this prefixed data is: ++.RS ++.PP ++`\fB:\fP \fI\fP\fB:\fP\fI\fP\fB;\fP\fI\fP\&'\&. ++.RE ++.TP ++\fBHIST_ALLOW_CLOBBER\fP ++Add `\fB|\fP\&' to output redirections in the history\&. This allows history ++references to clobber files even when \fBCLOBBER\fP is unset\&. ++.TP ++\fBHIST_BEEP\fP ++Beep when an attempt is made to access a history entry which ++isn\&'t there\&. ++.TP ++\fBHIST_EXPIRE_DUPS_FIRST\fP ++If the internal history needs to be trimmed to add the current command line, ++setting this option will cause the oldest history event that has a duplicate ++to be lost before losing a unique event from the list\&. ++You should be sure to set the value of \fBHISTSIZE\fP to a larger number ++than \fBSAVEHIST\fP in order to give you some room for the duplicated ++events, otherwise this option will behave just like ++\fBHIST_IGNORE_ALL_DUPS\fP once the history fills up with unique events\&. ++.TP ++\fBHIST_FCNTL_LOCK\fP ++When writing out the history file, by default zsh uses ad\-hoc file locking ++to avoid known problems with locking on some operating systems\&. With this ++option locking is done by means of the system\&'s \fBfcntl\fP call, where ++this method is available\&. On recent operating systems this may ++provide better performance, in particular avoiding history corruption when ++files are stored on NFS\&. ++.TP ++\fBHIST_FIND_NO_DUPS\fP ++When searching for history entries in the line editor, do not display ++duplicates of a line previously found, even if the duplicates are not ++contiguous\&. ++.TP ++\fBHIST_IGNORE_ALL_DUPS\fP ++If a new command line being added to the history list duplicates an ++older one, the older command is removed from the list (even if it is ++not the previous event)\&. ++.TP ++\fBHIST_IGNORE_DUPS\fP (\fB\-h\fP) ++Do not enter command lines into the history list ++if they are duplicates of the previous event\&. ++.TP ++\fBHIST_IGNORE_SPACE\fP (\fB\-g\fP) ++Remove command lines from the history list when the first character on ++the line is a space, or when one of the expanded aliases contains a ++leading space\&. Only normal aliases (not global or suffix aliases) ++have this behaviour\&. ++Note that the command lingers in the internal history until the next ++command is entered before it vanishes, allowing you to briefly reuse ++or edit the line\&. If you want to make it vanish right away without ++entering another command, type a space and press return\&. ++.TP ++\fBHIST_LEX_WORDS\fP ++By default, shell history that is read in from files is split into ++words on all white space\&. This means that arguments with quoted ++whitespace are not correctly handled, with the consequence that ++references to words in history lines that have been read from a file ++may be inaccurate\&. When this option is set, words read in from a ++history file are divided up in a similar fashion to normal shell ++command line handling\&. Although this produces more accurately delimited ++words, if the size of the history file is large this can be slow\&. Trial ++and error is necessary to decide\&. ++.TP ++\fBHIST_NO_FUNCTIONS\fP ++Remove function definitions from the history list\&. ++Note that the function lingers in the internal history until the next ++command is entered before it vanishes, allowing you to briefly reuse ++or edit the definition\&. ++.TP ++\fBHIST_NO_STORE\fP ++Remove the \fBhistory\fP (\fBfc \-l\fP) command from the history list ++when invoked\&. ++Note that the command lingers in the internal history until the next ++command is entered before it vanishes, allowing you to briefly reuse ++or edit the line\&. ++.TP ++\fBHIST_REDUCE_BLANKS\fP ++Remove superfluous blanks from each command line ++being added to the history list\&. ++.TP ++\fBHIST_SAVE_BY_COPY\fP ++When the history file is re\-written, we normally write out a copy of ++the file named $HISTFILE\&.new and then rename it over the old one\&. ++However, if this option is unset, we instead truncate the old ++history file and write out the new version in\-place\&. If one of the ++history\-appending options is enabled, this option only has an effect ++when the enlarged history file needs to be re\-written to trim it ++down to size\&. Disable this only if you have special needs, as doing ++so makes it possible to lose history entries if zsh gets interrupted ++during the save\&. ++.RS ++.PP ++When writing out a copy of the history file, zsh preserves the old ++file\&'s permissions and group information, but will refuse to write ++out a new file if it would change the history file\&'s owner\&. ++.RE ++.TP ++\fBHIST_SAVE_NO_DUPS\fP ++When writing out the history file, older commands that duplicate ++newer ones are omitted\&. ++.TP ++\fBHIST_VERIFY\fP ++Whenever the user enters a line with history expansion, ++don\&'t execute the line directly; instead, perform ++history expansion and reload the line into the editing buffer\&. ++.TP ++\fBINC_APPEND_HISTORY\fP ++This options works like \fBAPPEND_HISTORY\fP except that new history lines ++are added to the \fB$HISTFILE\fP incrementally (as soon as they are ++entered), rather than waiting until the shell exits\&. ++The file will still be periodically re\-written to trim it when the ++number of lines grows 20% beyond the value specified by ++\fB$SAVEHIST\fP (see also the HIST_SAVE_BY_COPY option)\&. ++.TP ++\fBSHARE_HISTORY\fP ++.RS ++.PP ++This option both imports new commands from the history file, and also ++causes your typed commands to be appended to the history file (the ++latter is like specifying \fBINC_APPEND_HISTORY\fP)\&. ++The history lines are also output with timestamps ala ++\fBEXTENDED_HISTORY\fP (which makes it easier to find the spot where ++we left off reading the file after it gets re\-written)\&. ++.PP ++By default, history movement commands visit the imported lines as ++well as the local lines, but you can toggle this on and off with the ++set\-local\-history zle binding\&. It is also possible to create a zle ++widget that will make some commands ignore imported commands, and ++some include them\&. ++.PP ++If you find that you want more control over when commands ++get imported, you may wish to turn \fBSHARE_HISTORY\fP off, ++\fBINC_APPEND_HISTORY\fP on, and then manually import ++commands whenever you need them using `\fBfc \-RI\fP\&'\&. ++.RE ++.RE ++.PP ++.SS "Initialisation" ++.PD 0 ++.TP ++.PD ++\fBALL_EXPORT\fP (\fB\-a\fP, ksh: \fB\-a\fP) ++All parameters subsequently defined are automatically exported\&. ++.TP ++\fBGLOBAL_EXPORT\fP (\fB\fP) ++If this option is set, passing the \fB\-x\fP flag to the builtins \fBdeclare\fP, ++\fBfloat\fP, \fBinteger\fP, \fBreadonly\fP and \fBtypeset\fP (but not \fBlocal\fP) ++will also set the \fB\-g\fP flag; hence parameters exported to ++the environment will not be made local to the enclosing function, unless ++they were already or the flag \fB+g\fP is given explicitly\&. If the option is ++unset, exported parameters will be made local in just the same way as any ++other parameter\&. ++.RS ++.PP ++This option is set by default for backward compatibility; it is not ++recommended that its behaviour be relied upon\&. Note that the builtin ++\fBexport\fP always sets both the \fB\-x\fP and \fB\-g\fP flags, and hence its ++effect extends beyond the scope of the enclosing function; this is the ++most portable way to achieve this behaviour\&. ++.RE ++.TP ++\fBGLOBAL_RCS\fP (\fB\-d\fP) ++If this option is unset, the startup files \fB/etc/zprofile\fP, ++\fB/etc/zshrc\fP, \fB/etc/zlogin\fP and \fB/etc/zlogout\fP will not be run\&. It ++can be disabled and re\-enabled at any time, including inside local startup ++files (\fB\&.zshrc\fP, etc\&.)\&. ++.TP ++\fBRCS\fP (\fB+f\fP) ++After \fB/etc/zshenv\fP is sourced on startup, source the ++\fB\&.zshenv\fP, \fB/etc/zprofile\fP, \fB\&.zprofile\fP, ++\fB/etc/zshrc\fP, \fB\&.zshrc\fP, \fB/etc/zlogin\fP, \fB\&.zlogin\fP, and \fB\&.zlogout\fP ++files, as described in the section `Files\&'\&. ++If this option is unset, the \fB/etc/zshenv\fP file is still sourced, but any ++of the others will not be; it can be set at any time to prevent the ++remaining startup files after the currently executing one from ++being sourced\&. ++.PP ++.SS "Input/Output" ++.PD 0 ++.TP ++.PD ++\fBALIASES\fP ++Expand aliases\&. ++.TP ++\fBCLOBBER\fP (\fB+C\fP, ksh: \fB+C\fP) ++Allows `\fB>\fP\&' redirection to truncate existing files, ++and `\fB>>\fP\&' to create files\&. ++Otherwise `\fB>!\fP\&' or `\fB>|\fP' must be used to truncate a file, ++and `\fB>>!\fP\&' or `\fB>>|\fP' to create a file\&. ++.TP ++\fBCORRECT\fP (\fB\-0\fP) ++Try to correct the spelling of commands\&. ++Note that, when the \fBHASH_LIST_ALL\fP option is not set or when some ++directories in the path are not readable, this may falsely report spelling ++errors the first time some commands are used\&. ++.RS ++.PP ++The shell variable \fBCORRECT_IGNORE\fP may be set to a pattern to ++match words that will never be offered as corrections\&. ++.RE ++.TP ++\fBCORRECT_ALL\fP (\fB\-O\fP) ++Try to correct the spelling of all arguments in a line\&. ++.TP ++\fBDVORAK\fP ++Use the Dvorak keyboard instead of the standard qwerty keyboard as a basis ++for examining spelling mistakes for the \fBCORRECT\fP and \fBCORRECT_ALL\fP ++options and the \fBspell\-word\fP editor command\&. ++.TP ++\fBFLOW_CONTROL\fP ++If this option is unset, ++output flow control via start/stop characters (usually assigned to ++^S/^Q) is disabled in the shell\&'s editor\&. ++.TP ++\fBIGNORE_EOF\fP (\fB\-7\fP) ++Do not exit on end\-of\-file\&. Require the use ++of \fBexit\fP or \fBlogout\fP instead\&. ++However, ten consecutive EOFs will cause the shell to exit anyway, ++to avoid the shell hanging if its tty goes away\&. ++.RS ++.PP ++Also, if this option is set and the Zsh Line Editor is used, widgets ++implemented by shell functions can be bound to EOF (normally ++Control\-D) without printing the normal warning message\&. This works ++only for normal widgets, not for completion widgets\&. ++.RE ++.TP ++\fBINTERACTIVE_COMMENTS\fP (\fB\-k\fP) ++Allow comments even in interactive shells\&. ++.TP ++\fBHASH_CMDS\fP ++Note the location of each command the first time it is executed\&. ++Subsequent invocations of the same command will use the ++saved location, avoiding a path search\&. ++If this option is unset, no path hashing is done at all\&. ++However, when \fBCORRECT\fP is set, commands whose names do not appear in ++the functions or aliases hash tables are hashed in order to avoid ++reporting them as spelling errors\&. ++.TP ++\fBHASH_DIRS\fP ++Whenever a command name is hashed, hash the directory containing it, ++as well as all directories that occur earlier in the path\&. ++Has no effect if neither \fBHASH_CMDS\fP nor \fBCORRECT\fP is set\&. ++.TP ++\fBMAIL_WARNING\fP (\fB\-U\fP) ++Print a warning message if a mail file has been ++accessed since the shell last checked\&. ++.TP ++\fBPATH_DIRS\fP (\fB\-Q\fP) ++Perform a path search even on command names with slashes in them\&. ++Thus if `\fB/usr/local/bin\fP\&' is in the user's path, and he or she types ++`\fBX11/xinit\fP\&', the command `\fB/usr/local/bin/X11/xinit\fP' will be executed ++(assuming it exists)\&. ++Commands explicitly beginning with `\fB/\fP\&', `\fB\&./\fP' or `\fB\&.\&./\fP' ++are not subject to the path search\&. ++This also applies to the `\fB\&.\fP\&' builtin\&. ++.RS ++.PP ++Note that subdirectories of the current directory are always searched for ++executables specified in this form\&. This takes place before any search ++indicated by this option, and regardless of whether `\fB\&.\fP\&' or the current ++directory appear in the command search path\&. ++.RE ++.TP ++\fBPATH_SCRIPT\fP ++If this option is not set, a script passed as the first non\-option argument ++to the shell must contain the name of the file to open\&. If this ++option is set, and the script does not specify a directory path, ++the script is looked for first in the current directory, then in the ++command path\&. See ++the section INVOCATION in \fIzsh\fP(1)\&. ++.TP ++\fBPRINT_EIGHT_BIT\fP ++Print eight bit characters literally in completion lists, etc\&. ++This option is not necessary if your system correctly returns the ++printability of eight bit characters (see \fIctype\fP(3))\&. ++.TP ++\fBPRINT_EXIT_VALUE\fP (\fB\-1\fP) ++Print the exit value of programs with non\-zero exit status\&. ++.TP ++\fBRC_QUOTES\fP ++Allow the character sequence `\fB\&''\fP' to signify a single quote ++within singly quoted strings\&. Note this does not apply in quoted strings ++using the format \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP, where a backslashed single quote can ++be used\&. ++.TP ++\fBRM_STAR_SILENT\fP (\fB\-H\fP) ++Do not query the user before executing `\fBrm *\fP\&' or `\fBrm path/*\fP'\&. ++.TP ++\fBRM_STAR_WAIT\fP ++If querying the user before executing `\fBrm *\fP\&' or `\fBrm path/*\fP', ++first wait ten seconds and ignore anything typed in that time\&. ++This avoids the problem of reflexively answering `yes\&' to the query ++when one didn\&'t really mean it\&. The wait and query can always be ++avoided by expanding the `\fB*\fP\&' in ZLE (with tab)\&. ++.TP ++\fBSHORT_LOOPS\fP ++Allow the short forms of \fBfor\fP, \fBrepeat\fP, \fBselect\fP, ++\fBif\fP, and \fBfunction\fP constructs\&. ++.TP ++\fBSUN_KEYBOARD_HACK\fP (\fB\-L\fP) ++If a line ends with a backquote, and there are an odd number ++of backquotes on the line, ignore the trailing backquote\&. ++This is useful on some keyboards where the return key is ++too small, and the backquote key lies annoyingly close to it\&. ++As an alternative the variable \fBKEYBOARD_HACK\fP lets you choose the ++character to be removed\&. ++.PP ++.SS "Job Control" ++.PD 0 ++.TP ++.PD ++\fBAUTO_CONTINUE\fP ++With this option set, stopped jobs that are removed from the job table ++with the \fBdisown\fP builtin command are automatically sent a \fBCONT\fP ++signal to make them running\&. ++.TP ++\fBAUTO_RESUME\fP (\fB\-W\fP) ++Treat single word simple commands without redirection ++as candidates for resumption of an existing job\&. ++.TP ++\fBBG_NICE\fP (\fB\-6\fP) ++Run all background jobs at a lower priority\&. This option ++is set by default\&. ++.TP ++\fBCHECK_JOBS\fP ++Report the status of background and suspended jobs before exiting a shell ++with job control; a second attempt to exit the shell will succeed\&. ++\fBNO_CHECK_JOBS\fP is best used only in combination with \fBNO_HUP\fP, else ++such jobs will be killed automatically\&. ++.RS ++.PP ++The check is omitted if the commands run from the previous command line ++included a `\fBjobs\fP\&' command, since it is assumed the user is aware that ++there are background or suspended jobs\&. A `\fBjobs\fP\&' command run from one ++of the hook functions defined in ++the section SPECIAL FUNCTIONS in \fIzshmisc\fP(1) ++is not counted for this purpose\&. ++.RE ++.TP ++\fBHUP\fP ++Send the \fBHUP\fP signal to running jobs when the ++shell exits\&. ++.TP ++\fBLONG_LIST_JOBS\fP (\fB\-R\fP) ++List jobs in the long format by default\&. ++.TP ++\fBMONITOR\fP (\fB\-m\fP, ksh: \fB\-m\fP) ++Allow job control\&. Set by default in interactive shells\&. ++.TP ++\fBNOTIFY\fP (\fB\-5\fP, ksh: \fB\-b\fP) ++Report the status of background jobs immediately, rather than ++waiting until just before printing a prompt\&. ++.TP ++\fBPOSIX_JOBS\fP ++This option makes job control more compliant with the POSIX standard\&. ++.RS ++.PP ++When the option is not set, the \fBMONITOR\fP option is unset on entry to ++subshells, so that job control is no longer active\&. When the option is ++set, the \fBMONITOR\fP option and job control remain active in the ++subshell, but note that the subshell has no access to jobs in the parent ++shell\&. ++.PP ++When the option is not set, jobs put in the background or foreground ++with \fBbg\fP or \fBfg\fP are displayed with the same information that would ++be reported by \fBjobs\fP\&. When the option is set, only the text is ++printed\&. The output from \fBjobs\fP itself is not affected by the option\&. ++.PP ++When the option is not set, job information from the parent ++shell is saved for output within a subshell (for example, within a ++pipeline)\&. When the option is set, the output of \fBjobs\fP is empty ++until a job is started within the subshell\&. ++.PP ++When the option is set, it becomes possible to use the \fBwait\fP builtin to ++wait for the last job started in the background (as given by \fB$!\fP) even ++if that job has already exited\&. This works even if the option is turned ++on temporarily around the use of the \fBwait\fP builtin\&. ++.RE ++.RE ++.PP ++.SS "Prompting" ++.PD 0 ++.TP ++.PD ++\fBPROMPT_BANG\fP ++If set, `\fB!\fP\&' is treated specially in prompt expansion\&. ++See ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. ++.TP ++\fBPROMPT_CR\fP (\fB+V\fP) ++Print a carriage return just before printing ++a prompt in the line editor\&. This is on by default as multi\-line editing ++is only possible if the editor knows where the start of the line appears\&. ++.TP ++\fBPROMPT_SP\fP ++Attempt to preserve a partial line (i\&.e\&. a line that did not end with a ++newline) that would otherwise be covered up by the command prompt due to ++the \fBPROMPT_CR\fP option\&. This works by outputting some cursor\-control ++characters, including a series of spaces, that should make the terminal ++wrap to the next line when a partial line is present (note that this is ++only successful if your terminal has automatic margins, which is typical)\&. ++.RS ++.PP ++When a partial line is preserved, by default you will see an inverse+bold ++character at the end of the partial line: a "%" for a normal user or ++a "#" for root\&. If set, the shell parameter \fBPROMPT_EOL_MARK\fP can be ++used to customize how the end of partial lines are shown\&. ++.PP ++NOTE: if the \fBPROMPT_CR\fP option is not set, enabling this option will ++have no effect\&. This option is on by default\&. ++.RE ++.TP ++\fBPROMPT_PERCENT\fP ++If set, `\fB%\fP\&' is treated specially in prompt expansion\&. ++See ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. ++.TP ++\fBPROMPT_SUBST\fP ++If set, \fIparameter expansion\fP, \fIcommand substitution\fP and ++\fIarithmetic expansion\fP are performed in prompts\&. Substitutions ++within prompts do not affect the command status\&. ++.TP ++\fBTRANSIENT_RPROMPT\fP ++Remove any right prompt from display when accepting a command ++line\&. This may be useful with terminals with other cut/paste methods\&. ++.PP ++.SS "Scripts and Functions" ++.PD 0 ++.TP ++.PD ++\fBC_BASES\fP ++Output hexadecimal numbers in the standard C format, for example `\fB0xFF\fP\&' ++instead of the usual `\fB16#FF\fP\&'\&. If the option \fBOCTAL_ZEROES\fP is also ++set (it is not by default), octal numbers will be treated similarly and ++hence appear as `\fB077\fP\&' instead of `\fB8#77\fP'\&. This option has no effect ++on the choice of the output base, nor on the output of bases other than ++hexadecimal and octal\&. Note that these formats will be understood on input ++irrespective of the setting of \fBC_BASES\fP\&. ++.TP ++\fBC_PRECEDENCES\fP ++This alters the precedence of arithmetic operators to be more ++like C and other programming languages; ++the section ARITHMETIC EVALUATION in \fIzshmisc\fP(1) ++has an explicit list\&. ++.TP ++\fBDEBUG_BEFORE_CMD\fP ++Run the \fBDEBUG\fP trap before each command; otherwise it is run after ++each command\&. Setting this option mimics the behaviour of ksh 93; with ++the option unset the behaviour is that of ksh 88\&. ++.TP ++\fBERR_EXIT\fP (\fB\-e\fP, ksh: \fB\-e\fP) ++If a command has a non\-zero exit status, execute the \fBZERR\fP ++trap, if set, and exit\&. This is disabled while running initialization ++scripts\&. ++.RS ++.PP ++The behaviour is also disabled inside \fBDEBUG\fP traps\&. In this ++case the option is handled specially: it is unset on entry to ++the trap\&. If the option \fBDEBUG_BEFORE_CMD\fP is set, ++as it is by default, and the option \fBERR_EXIT\fP is found to have been set ++on exit, then the command for which the \fBDEBUG\fP trap is being executed is ++skipped\&. The option is restored after the trap exits\&. ++.RE ++.TP ++\fBERR_RETURN\fP ++If a command has a non\-zero exit status, return immediately from the ++enclosing function\&. The logic is identical to that for \fBERR_EXIT\fP, ++except that an implicit \fBreturn\fP statement is executed instead of an ++\fBexit\fP\&. This will trigger an exit at the outermost level of a ++non\-interactive script\&. ++.TP ++\fBEVAL_LINENO\fP ++If set, line numbers of expressions evaluated using the builtin \fBeval\fP ++are tracked separately of the enclosing environment\&. This applies both ++to the parameter \fBLINENO\fP and the line number output by the prompt ++escape \fB%i\fP\&. If the option is set, the prompt escape \fB%N\fP will output ++the string `\fB(eval)\fP\&' instead of the script or function name as an ++indication\&. (The two prompt escapes are typically used in the parameter ++\fBPS4\fP to be output when the option \fBXTRACE\fP is set\&.) If ++\fBEVAL_LINENO\fP is unset, the line number of the surrounding script or ++function is retained during the evaluation\&. ++.TP ++\fBEXEC\fP (\fB+n\fP, ksh: \fB+n\fP) ++Do execute commands\&. Without this option, commands are ++read and checked for syntax errors, but not executed\&. ++This option cannot be turned off in an interactive shell, ++except when `\fB\-n\fP\&' is supplied to the shell at startup\&. ++.TP ++\fBFUNCTION_ARGZERO\fP ++When executing a shell function or sourcing a script, set \fB$0\fP ++temporarily to the name of the function/script\&. ++.TP ++\fBLOCAL_OPTIONS\fP ++If this option is set at the point of return from a shell function, ++most options (including this one) which were in force upon entry to ++the function are restored; options that are not restored are ++\fBPRIVILEGED\fP and \fBRESTRICTED\fP\&. Otherwise, only this option and the ++\fBXTRACE\fP and \fBPRINT_EXIT_VALUE\fP options are restored\&. Hence ++if this is explicitly unset by a shell function the other options in ++force at the point of return will remain so\&. ++A shell function can also guarantee itself a known shell configuration ++with a formulation like `\fBemulate \-L zsh\fP\&'; the \fB\-L\fP activates ++\fBLOCAL_OPTIONS\fP\&. ++.TP ++\fBLOCAL_TRAPS\fP ++If this option is set when a signal trap is set inside a function, then the ++previous status of the trap for that signal will be restored when the ++function exits\&. Note that this option must be set \fIprior\fP to altering the ++trap behaviour in a function; unlike \fBLOCAL_OPTIONS\fP, the value on exit ++from the function is irrelevant\&. However, it does not need to be set ++before any global trap for that to be correctly restored by a function\&. ++For example, ++.RS ++.PP ++.RS ++.nf ++\fBunsetopt localtraps ++trap \- INT ++fn() { setopt localtraps; trap \&'' INT; sleep 3; }\fP ++.fi ++.RE ++.PP ++will restore normal handling of \fBSIGINT\fP after the function exits\&. ++.RE ++.TP ++\fBMULTI_FUNC_DEF\fP ++Allow definitions of multiple functions at once in the form `\fBfn1 ++fn2\fP\fI\&.\&.\&.\fP\fB()\fP\&'; if the option is not set, this causes ++a parse error\&. Definition of multiple functions with the \fBfunction\fP ++keyword is always allowed\&. Multiple function definitions are not often ++used and can cause obscure errors\&. ++.TP ++\fBMULTIOS\fP ++Perform implicit \fBtee\fPs or \fBcat\fPs when multiple ++redirections are attempted (see the section `Redirection\&')\&. ++.TP ++\fBOCTAL_ZEROES\fP ++Interpret any integer constant beginning with a 0 as octal, per IEEE Std ++1003\&.2\-1992 (ISO 9945\-2:1993)\&. This is not enabled by default as it ++causes problems with parsing of, for example, date and time strings with ++leading zeroes\&. ++.RS ++.PP ++Sequences of digits indicating a numeric base such as the `\fB08\fP\&' ++component in `\fB08#77\fP\&' are always interpreted as decimal, regardless ++of leading zeroes\&. ++.RE ++.TP ++\fBSOURCE_TRACE\fP ++If set, zsh will print an informational message announcing the name of ++each file it loads\&. The format of the output is similar to that ++for the \fBXTRACE\fP option, with the message \fB\fP\&. ++A file may be loaded by the shell itself when it ++starts up and shuts down (\fBStartup/Shutdown Files\fP) or by the use of ++the `\fBsource\fP\&' and `\fBdot\fP' builtin commands\&. ++.TP ++\fBTYPESET_SILENT\fP ++If this is unset, executing any of the `\fBtypeset\fP\&' family of ++commands with no options and a list of parameters that have no values ++to be assigned but already exist will display the value of the parameter\&. ++If the option is set, they will only be shown when parameters are selected ++with the `\fB\-m\fP\&' option\&. The option `\fB\-p\fP' is available whether or not ++the option is set\&. ++.TP ++\fBVERBOSE\fP (\fB\-v\fP, ksh: \fB\-v\fP) ++Print shell input lines as they are read\&. ++.TP ++\fBXTRACE\fP (\fB\-x\fP, ksh: \fB\-x\fP) ++Print commands and their arguments as they are executed\&. The ++output is proceded by the value of \fB$PS4\fP, formatted as described ++in ++the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. ++.PP ++.SS "Shell Emulation" ++.PD 0 ++.TP ++.PD ++\fBBASH_REMATCH\fP ++When set, matches performed with the \fB=~\fP operator will set the ++\fBBASH_REMATCH\fP array variable, instead of the default \fBMATCH\fP and ++\fBmatch\fP variables\&. The first element of the \fBBASH_REMATCH\fP array ++will contain the entire matched text and subsequent elements will contain ++extracted substrings\&. This option makes more sense when \fBKSH_ARRAYS\fP is ++also set, so that the entire matched portion is stored at index 0 and the ++first substring is at index 1\&. Without this option, the \fBMATCH\fP variable ++contains the entire matched text and the \fBmatch\fP array variable contains ++substrings\&. ++.TP ++\fBBSD_ECHO\fP ++Make the \fBecho\fP builtin compatible with the BSD \fIecho\fP(1) command\&. ++This disables backslashed escape sequences in echo strings unless the ++\fB\-e\fP option is specified\&. ++.TP ++\fBCSH_JUNKIE_HISTORY\fP ++A history reference without an event specifier will always refer to the ++previous command\&. Without this option, such a history reference refers ++to the same event as the previous history reference, defaulting to the ++previous command\&. ++.TP ++\fBCSH_JUNKIE_LOOPS\fP ++Allow loop bodies to take the form `\fIlist\fP; \fBend\fP\&' instead of ++`\fBdo\fP \fIlist\fP; \fBdone\fP\&'\&. ++.TP ++\fBCSH_JUNKIE_QUOTES\fP ++Changes the rules for single\- and double\-quoted text to match that of ++\fBcsh\fP\&. These require that embedded newlines be preceded by a backslash; ++unescaped newlines will cause an error message\&. ++In double\-quoted strings, it is made impossible to escape `\fB$\fP\&', `\fB`\fP' ++or `\fB"\fP\&' (and `\fB\e\fP' itself no longer needs escaping)\&. ++Command substitutions are only expanded once, and cannot be nested\&. ++.TP ++\fBCSH_NULLCMD\fP ++Do not use the values of \fBNULLCMD\fP and \fBREADNULLCMD\fP ++when running redirections with no command\&. This make ++such redirections fail (see the section `Redirection\&')\&. ++.TP ++\fBKSH_ARRAYS\fP ++Emulate \fBksh\fP array handling as closely as possible\&. If this option ++is set, array elements are numbered from zero, an array parameter ++without subscript refers to the first element instead of the whole array, ++and braces are required to delimit a subscript (`\fB${path[2]}\fP\&' rather ++than just `\fB$path[2]\fP\&')\&. ++.TP ++\fBKSH_AUTOLOAD\fP ++Emulate \fBksh\fP function autoloading\&. This means that when a function is ++autoloaded, the corresponding file is merely executed, and must define ++the function itself\&. (By default, the function is defined to the contents ++of the file\&. However, the most common \fBksh\fP\-style case \- of the file ++containing only a simple definition of the function \- is always handled ++in the \fBksh\fP\-compatible manner\&.) ++.TP ++\fBKSH_OPTION_PRINT\fP ++Alters the way options settings are printed: instead of separate lists of ++set and unset options, all options are shown, marked `on\&' if ++they are in the non\-default state, `off\&' otherwise\&. ++.TP ++\fBKSH_TYPESET\fP ++Alters the way arguments to the \fBtypeset\fP family of commands, including ++\fBdeclare\fP, \fBexport\fP, \fBfloat\fP, \fBinteger\fP, \fBlocal\fP and ++\fBreadonly\fP, are processed\&. Without this option, zsh will perform normal ++word splitting after command and parameter expansion in arguments of an ++assignment; with it, word splitting does not take place in those cases\&. ++.TP ++\fBKSH_ZERO_SUBSCRIPT\fP ++Treat use of a subscript of value zero in array or string expressions as a ++reference to the first element, i\&.e\&. the element that usually has the ++subscript 1\&. Ignored if \fBKSH_ARRAYS\fP is also set\&. ++.RS ++.PP ++If neither this option nor \fBKSH_ARRAYS\fP is set, accesses to an element of ++an array or string with subscript zero return an empty element or string, ++while attempts to set element zero of an array or string are treated as an ++error\&. However, attempts to set an otherwise valid subscript range that ++includes zero will succeed\&. For example, if \fBKSH_ZERO_SUBSCRIPT\fP is not ++set, ++.PP ++.RS ++.nf ++\fBarray[0]=(element)\fP ++.fi ++.RE ++.PP ++is an error, while ++.PP ++.RS ++.nf ++\fBarray[0,1]=(element)\fP ++.fi ++.RE ++.PP ++is not and will replace the first element of the array\&. ++.PP ++This option is for compatibility with older versions of the shell and ++is not recommended in new code\&. ++.RE ++.TP ++\fBPOSIX_ALIASES\fP ++When this option is set, reserved words are not candidates for ++alias expansion: it is still possible to declare any of them as an alias, ++but the alias will never be expanded\&. Reserved words are described in ++the section RESERVED WORDS in \fIzshmisc\fP(1)\&. ++.RS ++.PP ++Alias expansion takes place while text is being read; hence when this ++option is set it does not take effect until the end of any function or ++other piece of shell code parsed as one unit\&. Note this may ++cause differences from other shells even when the option is in ++effect\&. For example, when running a command with `\fBzsh \-c\fP\&', ++or even `\fBzsh \-o posixaliases \-c\fP\&', the entire command argument is parsed ++as one unit, so aliases defined within the argument are not available even ++in later lines\&. If in doubt, avoid use of aliases in non\-interactive ++code\&. ++.RE ++.TP ++\fBPOSIX_BUILTINS\fP ++When this option is set the \fBcommand\fP builtin can be used to execute ++shell builtin commands\&. Parameter assignments specified before shell ++functions and special builtins are kept after the command completes unless ++the special builtin is prefixed with the \fBcommand\fP builtin\&. Special ++builtins are ++\fB\&.\fP, ++\fB:\fP, ++\fBbreak\fP, ++\fBcontinue\fP, ++\fBdeclare\fP, ++\fBeval\fP, ++\fBexit\fP, ++\fBexport\fP, ++\fBinteger\fP, ++\fBlocal\fP, ++\fBreadonly\fP, ++\fBreturn\fP, ++\fBset\fP, ++\fBshift\fP, ++\fBsource\fP, ++\fBtimes\fP, ++\fBtrap\fP and ++\fBunset\fP\&. ++.RS ++.PP ++In addition, various error conditions associated with the above builtins ++or \fBexec\fP cause a non\-interactive shell to exit and an interactive ++shell to return to its top\-level processing\&. ++.RE ++.TP ++\fBPOSIX_IDENTIFIERS\fP ++When this option is set, only the ASCII characters \fBa\fP to \fBz\fP, \fBA\fP to ++\fBZ\fP, \fB0\fP to \fB9\fP and \fB_\fP may be used in identifiers (names ++of shell parameters and modules)\&. ++.RS ++.PP ++When the option is unset and multibyte character support is enabled (i\&.e\&. it ++is compiled in and the option \fBMULTIBYTE\fP is set), then additionally any ++alphanumeric characters in the local character set may be used in ++identifiers\&. Note that scripts and functions written with this feature are ++not portable, and also that both options must be set before the script ++or function is parsed; setting them during execution is not sufficient ++as the syntax \fIvariable\fP\fB=\fP\fIvalue\fP has already been parsed as ++a command rather than an assignment\&. ++.PP ++If multibyte character support is not compiled into the shell this option is ++ignored; all octets with the top bit set may be used in identifiers\&. ++This is non\-standard but is the traditional zsh behaviour\&. ++.RE ++.TP ++\fBPOSIX_STRINGS\fP ++This option affects processing of quoted strings\&. Currently it only ++affects the behaviour of null characters, i\&.e\&. character 0 in the ++portable character set corresponding to US ASCII\&. ++.RS ++.PP ++When this option is not set, null characters embedded within strings ++of the form \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP are treated as ordinary characters\&. The ++entire string is maintained within the shell and output to files where ++necessary, although owing to restrictions of the library interface ++the string is truncated at the null character in file names, environment ++variables, or in arguments to external programs\&. ++.PP ++When this option is set, the \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP expression is truncated at ++the null character\&. Note that remaining parts of the same string ++beyond the termination of the quotes are not trunctated\&. ++.PP ++For example, the command line argument \fBa$\&'b\e0c'd\fP is treated with ++the option off as the characters \fBa\fP, \fBb\fP, null, \fBc\fP, \fBd\fP, ++and with the option on as the characters \fBa\fP, \fBb\fP, \fBd\fP\&. ++.RE ++.TP ++\fBPOSIX_TRAPS\fP ++When the is option is set, the usual zsh behaviour of executing ++traps for \fBEXIT\fP on exit from shell functions is suppressed\&. ++In that case, manipulating \fBEXIT\fP traps always alters the global ++trap for exiting the shell; the \fBLOCAL_TRAPS\fP option is ++ignored for the \fBEXIT\fP trap\&. ++.TP ++\fBSH_FILE_EXPANSION\fP ++Perform filename expansion (e\&.g\&., ~ expansion) \fIbefore\fP ++parameter expansion, command substitution, arithmetic expansion ++and brace expansion\&. ++If this option is unset, it is performed \fIafter\fP ++brace expansion, so things like `\fB~$USERNAME\fP\&' and ++`\fB~{pfalstad,rc}\fP\&' will work\&. ++.TP ++\fBSH_NULLCMD\fP ++Do not use the values of \fBNULLCMD\fP and \fBREADNULLCMD\fP ++when doing redirections, use `\fB:\fP\&' instead (see the section `Redirection')\&. ++.TP ++\fBSH_OPTION_LETTERS\fP ++If this option is set the shell tries to interpret single letter options ++(which are used with \fBset\fP and \fBsetopt\fP) like \fBksh\fP does\&. ++This also affects the value of the \fB\-\fP special parameter\&. ++.TP ++\fBSH_WORD_SPLIT\fP (\fB\-y\fP) ++Causes field splitting to be performed on unquoted parameter expansions\&. ++Note that this option has nothing to do with word splitting\&. ++(See the section `Parameter Expansion\&'\&.) ++.TP ++\fBTRAPS_ASYNC\fP ++While waiting for a program to exit, handle signals and run traps ++immediately\&. Otherwise the trap is run after a child process has exited\&. ++Note this does not affect the point at which traps are run for any case ++other than when the shell is waiting for a child process\&. ++.PP ++.SS "Shell State" ++.PD 0 ++.TP ++.PD ++\fBINTERACTIVE\fP (\fB\-i\fP, ksh: \fB\-i\fP) ++This is an interactive shell\&. This option is set upon initialisation if ++the standard input is a tty and commands are being read from standard input\&. ++(See the discussion of \fBSHIN_STDIN\fP\&.) ++This heuristic may be overridden by specifying a state for this option ++on the command line\&. ++The value of this option can only be changed via flags supplied at ++invocation of the shell\&. ++It cannot be changed once zsh is running\&. ++.TP ++\fBLOGIN\fP (\fB\-l\fP, ksh: \fB\-l\fP) ++This is a login shell\&. ++If this option is not explicitly set, the shell becomes a login shell if ++the first character of the \fBargv[0]\fP passed to the shell is a `\fB\-\fP\&'\&. ++.TP ++\fBPRIVILEGED\fP (\fB\-p\fP, ksh: \fB\-p\fP) ++Turn on privileged mode\&. This is enabled automatically on startup if the ++effective user (group) ID is not equal to the real user (group) ID\&. Turning ++this option off causes the effective user and group IDs to be set to the ++real user and group IDs\&. This option disables sourcing user startup files\&. ++If zsh is invoked as `\fBsh\fP\&' or `\fBksh\fP' with this option set, ++\fB/etc/suid_profile\fP is sourced (after \fB/etc/profile\fP on interactive ++shells)\&. Sourcing \fB~/\&.profile\fP is disabled and the contents of the ++\fBENV\fP variable is ignored\&. This option cannot be changed using the ++\fB\-m\fP option of \fBsetopt\fP and \fBunsetopt\fP, and changing it inside a ++function always changes it globally regardless of the \fBLOCAL_OPTIONS\fP ++option\&. ++.TP ++\fBRESTRICTED\fP (\fB\-r\fP) ++Enables restricted mode\&. This option cannot be changed using ++\fBunsetopt\fP, and setting it inside a function always changes it ++globally regardless of the \fBLOCAL_OPTIONS\fP option\&. See ++the section `Restricted Shell\&'\&. ++.TP ++\fBSHIN_STDIN\fP (\fB\-s\fP, ksh: \fB\-s\fP) ++Commands are being read from the standard input\&. ++Commands are read from standard input if no command is specified with ++\fB\-c\fP and no file of commands is specified\&. If \fBSHIN_STDIN\fP ++is set explicitly on the command line, ++any argument that would otherwise have been ++taken as a file to run will instead be treated as a normal positional ++parameter\&. ++Note that setting or unsetting this option on the command line does not ++necessarily affect the state the option will have while the shell is ++running \- that is purely an indicator of whether on not commands are ++\fIactually\fP being read from standard input\&. ++The value of this option can only be changed via flags supplied at ++invocation of the shell\&. ++It cannot be changed once zsh is running\&. ++.TP ++\fBSINGLE_COMMAND\fP (\fB\-t\fP, ksh: \fB\-t\fP) ++If the shell is reading from standard input, it exits after a single command ++has been executed\&. This also makes the shell non\-interactive, unless the ++\fBINTERACTIVE\fP option is explicitly set on the command line\&. ++The value of this option can only be changed via flags supplied at ++invocation of the shell\&. ++It cannot be changed once zsh is running\&. ++.PP ++.SS "Zle" ++.PD 0 ++.TP ++.PD ++\fBBEEP\fP (\fB+B\fP) ++Beep on error in ZLE\&. ++.TP ++\fBCOMBINING_CHARS\fP ++Assume that the terminal displays combining characters correctly\&. ++Specifically, if a base alphanumeric character is followed by one or more ++zero\-width punctuation characters, assume that the zero\-width characters ++will be displayed as modifications to the base character within the ++same width\&. Not all terminals handle this\&. If this option is not ++set, zero\-width characters are displayed separately with special ++mark\-up\&. ++.RS ++.PP ++If this option is set, the pattern test \fB[[:WORD:]]\fP matches a ++zero\-width punctuation character on the assumption that it will be ++used as part of a word in combination with a word character\&. ++Otherwise the base shell does not handle combining characters specially\&. ++.RE ++.TP ++\fBEMACS\fP ++If ZLE is loaded, turning on this option has the equivalent effect ++of `\fBbindkey \-e\fP\&'\&. In addition, the VI option is unset\&. ++Turning it off has no effect\&. The option setting is ++not guaranteed to reflect the current keymap\&. This option is ++provided for compatibility; \fBbindkey\fP is the recommended interface\&. ++.TP ++\fBOVERSTRIKE\fP ++Start up the line editor in overstrike mode\&. ++.TP ++\fBSINGLE_LINE_ZLE\fP (\fB\-M\fP) ++Use single\-line command line editing instead of multi\-line\&. ++.RS ++.PP ++Note that although this is on by default in ksh emulation it only ++provides superficial compatibility with the ksh line editor and ++reduces the effectiveness of the zsh line editor\&. As it has no ++effect on shell syntax, many users may wish to disable this option ++when using ksh emulation interactively\&. ++.RE ++.TP ++\fBVI\fP ++If ZLE is loaded, turning on this option has the equivalent effect ++of `\fBbindkey \-v\fP\&'\&. In addition, the EMACS option is unset\&. ++Turning it off has no effect\&. The option setting is ++not guaranteed to reflect the current keymap\&. This option is ++provided for compatibility; \fBbindkey\fP is the recommended interface\&. ++.TP ++\fBZLE\fP (\fB\-Z\fP) ++Use the zsh line editor\&. Set by default in interactive shells connected to ++a terminal\&. ++.PP ++.SH "OPTION ALIASES" ++Some options have alternative names\&. These aliases are never used for ++output, but can be used just like normal option names when specifying ++options to the shell\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBBRACE_EXPAND\fP ++\fINO_\fP\fBIGNORE_BRACES\fP ++(ksh and bash compatibility) ++.TP ++\fBDOT_GLOB\fP ++\fBGLOB_DOTS\fP ++(bash compatibility) ++.TP ++\fBHASH_ALL\fP ++\fBHASH_CMDS\fP ++(bash compatibility) ++.TP ++\fBHIST_APPEND\fP ++\fBAPPEND_HISTORY\fP ++(bash compatibility) ++.TP ++\fBHIST_EXPAND\fP ++\fBBANG_HIST\fP ++(bash compatibility) ++.TP ++\fBLOG\fP ++\fINO_\fP\fBHIST_NO_FUNCTIONS\fP ++(ksh compatibility) ++.TP ++\fBMAIL_WARN\fP ++\fBMAIL_WARNING\fP ++(bash compatibility) ++.TP ++\fBONE_CMD\fP ++\fBSINGLE_COMMAND\fP ++(bash compatibility) ++.TP ++\fBPHYSICAL\fP ++\fBCHASE_LINKS\fP ++(ksh and bash compatibility) ++.TP ++\fBPROMPT_VARS\fP ++\fBPROMPT_SUBST\fP ++(bash compatibility) ++.TP ++\fBSTDIN\fP ++\fBSHIN_STDIN\fP ++(ksh compatibility) ++.TP ++\fBTRACK_ALL\fP ++\fBHASH_CMDS\fP ++(ksh compatibility) ++.SH "SINGLE LETTER OPTIONS" ++.SS "Default set" ++.PD 0 ++.TP ++\fB\-0\fP ++CORRECT ++.TP ++\fB\-1\fP ++PRINT_EXIT_VALUE ++.TP ++\fB\-2\fP ++\fINO_\fPBAD_PATTERN ++.TP ++\fB\-3\fP ++\fINO_\fPNOMATCH ++.TP ++\fB\-4\fP ++GLOB_DOTS ++.TP ++\fB\-5\fP ++NOTIFY ++.TP ++\fB\-6\fP ++BG_NICE ++.TP ++\fB\-7\fP ++IGNORE_EOF ++.TP ++\fB\-8\fP ++MARK_DIRS ++.TP ++\fB\-9\fP ++AUTO_LIST ++.TP ++\fB\-B\fP ++\fINO_\fPBEEP ++.TP ++\fB\-C\fP ++\fINO_\fPCLOBBER ++.TP ++\fB\-D\fP ++PUSHD_TO_HOME ++.TP ++\fB\-E\fP ++PUSHD_SILENT ++.TP ++\fB\-F\fP ++\fINO_\fPGLOB ++.TP ++\fB\-G\fP ++NULL_GLOB ++.TP ++\fB\-H\fP ++RM_STAR_SILENT ++.TP ++\fB\-I\fP ++IGNORE_BRACES ++.TP ++\fB\-J\fP ++AUTO_CD ++.TP ++\fB\-K\fP ++\fINO_\fPBANG_HIST ++.TP ++\fB\-L\fP ++SUN_KEYBOARD_HACK ++.TP ++\fB\-M\fP ++SINGLE_LINE_ZLE ++.TP ++\fB\-N\fP ++AUTO_PUSHD ++.TP ++\fB\-O\fP ++CORRECT_ALL ++.TP ++\fB\-P\fP ++RC_EXPAND_PARAM ++.TP ++\fB\-Q\fP ++PATH_DIRS ++.TP ++\fB\-R\fP ++LONG_LIST_JOBS ++.TP ++\fB\-S\fP ++REC_EXACT ++.TP ++\fB\-T\fP ++CDABLE_VARS ++.TP ++\fB\-U\fP ++MAIL_WARNING ++.TP ++\fB\-V\fP ++\fINO_\fPPROMPT_CR ++.TP ++\fB\-W\fP ++AUTO_RESUME ++.TP ++\fB\-X\fP ++LIST_TYPES ++.TP ++\fB\-Y\fP ++MENU_COMPLETE ++.TP ++\fB\-Z\fP ++ZLE ++.TP ++\fB\-a\fP ++ALL_EXPORT ++.TP ++\fB\-e\fP ++ERR_EXIT ++.TP ++\fB\-f\fP ++\fINO_\fPRCS ++.TP ++\fB\-g\fP ++HIST_IGNORE_SPACE ++.TP ++\fB\-h\fP ++HIST_IGNORE_DUPS ++.TP ++\fB\-i\fP ++INTERACTIVE ++.TP ++\fB\-k\fP ++INTERACTIVE_COMMENTS ++.TP ++\fB\-l\fP ++LOGIN ++.TP ++\fB\-m\fP ++MONITOR ++.TP ++\fB\-n\fP ++\fINO_\fPEXEC ++.TP ++\fB\-p\fP ++PRIVILEGED ++.TP ++\fB\-r\fP ++RESTRICTED ++.TP ++\fB\-s\fP ++SHIN_STDIN ++.TP ++\fB\-t\fP ++SINGLE_COMMAND ++.TP ++\fB\-u\fP ++\fINO_\fPUNSET ++.TP ++\fB\-v\fP ++VERBOSE ++.TP ++\fB\-w\fP ++CHASE_LINKS ++.TP ++\fB\-x\fP ++XTRACE ++.TP ++\fB\-y\fP ++SH_WORD_SPLIT ++.PD ++.SS "sh/ksh emulation set" ++.PD 0 ++.TP ++\fB\-C\fP ++\fINO_\fPCLOBBER ++.TP ++\fB\-T\fP ++TRAPS_ASYNC ++.TP ++\fB\-X\fP ++MARK_DIRS ++.TP ++\fB\-a\fP ++ALL_EXPORT ++.TP ++\fB\-b\fP ++NOTIFY ++.TP ++\fB\-e\fP ++ERR_EXIT ++.TP ++\fB\-f\fP ++\fINO_\fPGLOB ++.TP ++\fB\-i\fP ++INTERACTIVE ++.TP ++\fB\-l\fP ++LOGIN ++.TP ++\fB\-m\fP ++MONITOR ++.TP ++\fB\-n\fP ++\fINO_\fPEXEC ++.TP ++\fB\-p\fP ++PRIVILEGED ++.TP ++\fB\-r\fP ++RESTRICTED ++.TP ++\fB\-s\fP ++SHIN_STDIN ++.TP ++\fB\-t\fP ++SINGLE_COMMAND ++.TP ++\fB\-u\fP ++\fINO_\fPUNSET ++.TP ++\fB\-v\fP ++VERBOSE ++.TP ++\fB\-x\fP ++XTRACE ++.PD ++.SS "Also note" ++.PD 0 ++.TP ++\fB\-A\fP ++Used by \fBset\fP for setting arrays ++.TP ++\fB\-b\fP ++Used on the command line to specify end of option processing ++.TP ++\fB\-c\fP ++Used on the command line to specify a single command ++.TP ++\fB\-m\fP ++Used by \fBsetopt\fP for pattern\-matching option setting ++.TP ++\fB\-o\fP ++Used in all places to allow use of long option names ++.TP ++\fB\-s\fP ++Used by \fBset\fP to sort positional parameters ++.PD +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshtcpsys.1 +@@ -0,0 +1,835 @@ ++.TH "ZSHTCPSYS" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshtcpsys \- zsh tcp system ++.\" Yodl file: Zsh/tcpsys.yo ++.SH "DESCRIPTION" ++.PP ++A module \fBzsh/net/tcp\fP is provided to provide network I/O over ++TCP/IP from within the shell; see its description in ++\fIzshmodules\fP(1) ++\&. This manual page describes a function suite based on the module\&. ++If the module is installed, the functions are usually installed at the ++same time, in which case they will be available for ++autoloading in the default function search path\&. In addition to the ++\fBzsh/net/tcp\fP module, the \fBzsh/zselect\fP module is used to implement ++timeouts on read operations\&. For troubleshooting tips, consult the ++corresponding advice for the \fBzftp\fP functions described in ++\fIzshzftpsys\fP(1) ++\&. ++.PP ++There are functions corresponding to the basic I/O operations open, close, ++read and send, named \fBtcp_open\fP etc\&., as well as a function ++\fBtcp_expect\fP for pattern match analysis of data read as input\&. The ++system makes it easy to receive data from and send data to multiple named ++sessions at once\&. In addition, it can be linked with the shell\&'s line ++editor in such a way that input data is automatically shown at the ++terminal\&. Other facilities available including logging, filtering and ++configurable output prompts\&. ++.PP ++To use the system where it is available, it should be enough to ++`\fBautoload \-U tcp_open\fP\&' and run \fBtcp_open\fP as documented below to ++start a session\&. The \fBtcp_open\fP function will autoload the remaining ++functions\&. ++.PP ++.PP ++.SH "TCP USER FUNCTIONS" ++.PP ++.SS "Basic I/O" ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBtcp_open [\-qz]\fP \fIhost port\fP \fB[\fP \fIsess\fP \fB]\fP ++.TP ++.PD 0 ++\fBtcp_open [\-qz] [ \-s\fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ] \&.\&.\&. \fP ++.TP ++.PD ++\fBtcp_open [\-qz] [\-a\fP \fIfd\fP \fB| \-f\fP \fIfd\fP \fB] [\fP \fIsess\fP \fB]\fP ++Open a new session\&. In the first and simplest form, open a TCP connection ++to host \fIhost\fP at port \fIport\fP; numeric and symbolic forms are ++understood for both\&. ++.RS ++.PP ++If \fIsess\fP is given, this becomes the name of the session which can be ++used to refer to multiple different TCP connections\&. If \fIsess\fP is ++not given, the function will invent a numeric name value (note this is ++\fInot\fP the same as the file descriptor to which the session is attached)\&. ++It is recommended that session names not include `funny\&' characters, where ++funny characters are not well\-defined but certainly do not include ++alphanumerics or underscores, and certainly do include whitespace\&. ++.PP ++In the second case, one or more sessions to be opened are given by name\&. ++A single session name is given after \fB\-s\fP and a comma\-separated list ++after \fB\-l\fP; both options may be repeated as many times as necessary\&. ++A failure to open any session causes \fBtcp_open\fP to abort\&. ++The host and port are read from the file \fB\&.ztcp_sessions\fP in the same ++directory as the user\&'s zsh initialisation files, i\&.e\&. usually the home ++directory, but \fB$ZDOTDIR\fP if that is set\&. The file consists of lines ++each giving a session name and the corresponding host and port, in that ++order (note the session name comes first, not last), separated by ++whitespace\&. ++.PP ++The third form allows passive and fake TCP connections\&. If the option ++\fB\-a\fP is used, its argument is a file descriptor open for listening for ++connections\&. No function front\-end is provided to open such a file ++descriptor, but a call to `\fBztcp \-l\fP \fIport\fP\&' will create one with the ++file descriptor stored in the parameter \fB$REPLY\fP\&. The listening port can ++be closed with `\fBztcp \-c\fP \fIfd\fP\&'\&. A call to `\fBtcp_open \-a\fP \fIfd\fP' ++will block until a remote TCP connection is made to \fIport\fP on the local ++machine\&. At this point, a session is created in the usual way and is ++largely indistinguishable from an active connection created with one of the ++first two forms\&. ++.PP ++If the option \fB\-f\fP is used, its argument is a file descriptor which is ++used directly as if it were a TCP session\&. How well the remainder of the ++TCP function system copes with this depends on what actually underlies this ++file descriptor\&. A regular file is likely to be unusable; a FIFO (pipe) of ++some sort will work better, but note that it is not a good idea for two ++different sessions to attempt to read from the same FIFO at once\&. ++.PP ++If the option \fB\-q\fP is given with any of the three forms, \fBtcp_open\fP ++will not print informational messages, although it will in any case exit ++with an appropriate status\&. ++.PP ++If the line editor (zle) is in use, which is typically the case if the ++shell is interactive, \fBtcp_open\fP installs a handler inside \fBzle\fP which ++will check for new data at the same time as it checks for keyboard input\&. ++This is convenient as the shell consumes no CPU time while waiting; the ++test is performed by the operating system\&. Giving the option \fB\-z\fP to ++any of the forms of \fBtcp_open\fP prevents the handler from being ++installed, so data must be read explicitly\&. Note, however, this is not ++necessary for executing complete sets of send and read commands from a ++function, as zle is not active at this point\&. Generally speaking, the ++handler is only active when the shell is waiting for input at a command ++prompt or in the \fBvared\fP builtin\&. The option has no effect if zle is not ++active; `\fB[[ \-o zle]]\fP\&' will test for this\&. ++.PP ++The first session to be opened becomes the current session and subsequent ++calls to \fBtcp_open\fP do not change it\&. The current session is stored ++in the parameter \fB$TCP_SESS\fP; see below for more detail about the ++parameters used by the system\&. ++.PP ++The function \fBtcp_on_open\fP, if defined, is called when a session ++is opened\&. See the description below\&. ++.RE ++.TP ++\fBtcp_close [\-qn] [ \-a | \-l\fP \fIsess\fP\fB,\&.\&.\&. |\fP \fIsess\fP \fB\&.\&.\&. ]\fP ++Close the named sessions, or the current session if none is given, ++or all open sessions if \fB\-a\fP is given\&. The options \fB\-l\fP and \fB\-s\fP are ++both handled for consistency with \fBtcp_open\fP, although the latter is ++redundant\&. ++.RS ++.PP ++If the session being closed is the current one, \fB$TCP_SESS\fP is unset, ++leaving no current session, even if there are other sessions still open\&. ++.PP ++If the session was opened with \fBtcp_open \-f\fP, the file descriptor is ++closed so long as it is in the range 0 to 9 accessible directly from the ++command line\&. If the option \fB\-n\fP is given, no attempt will be made to ++close file descriptors in this case\&. The \fB\-n\fP option is not used for ++genuine \fBztcp\fP session; the file descriptors are always closed with the ++session\&. ++.PP ++If the option \fB\-q\fP is given, no informational messages will be printed\&. ++.RE ++.TP ++.PD 0 ++\fBtcp_read [\-bdq] [ \-t\fP \fITO\fP \fB] [ \-T\fP \fITO\fP \fB]\fP ++.TP ++.PD ++ \fB[ \-a | \-u\fP \fIfd\fP \fB\&.\&.\&. | \-l\fP \fIsess\fP\fB,\&.\&.\&. | \-s\fP \fIsess\fP \fB\&.\&.\&.]\fP ++Perform a read operation on the current session, or on a list of ++sessions if any are given with \fB\-u\fP, \fB\-l\fP or \fB\-s\fP, or all open ++sessions if the option \fB\-a\fP is given\&. Any of the \fB\-u\fP, \fB\-l\fP or ++\fB\-s\fP options may be repeated or mixed together\&. The \fB\-u\fP option ++specifies a file descriptor directly (only those managed by this system ++are useful), the other two specify sessions as described for ++\fBtcp_open\fP above\&. ++.RS ++.PP ++The function checks for new data available on all the sessions listed\&. ++Unless the \fB\-b\fP option is given, it will not block waiting for new data\&. ++Any one line of data from any of the available sessions will be read, ++stored in the parameter \fB$TCP_LINE\fP, and displayed to standard output ++unless \fB$TCP_SILENT\fP contains a non\-empty string\&. When printed to ++standard output the string \fB$TCP_PROMPT\fP will be shown at the start of ++the line; the default form for this includes the name of the session being ++read\&. See below for more information on these parameters\&. In this mode, ++\fBtcp_read\fP can be called repeatedly until it returns status 2 which ++indicates all pending input from all specified sessions has been handled\&. ++.PP ++With the option \fB\-b\fP, equivalent to an infinite timeout, the function ++will block until a line is available to read from one of the specified ++sessions\&. However, only a single line is returned\&. ++.PP ++The option \fB\-d\fP indicates that all pending input should be drained\&. In ++this case \fBtcp_read\fP may process multiple lines in the manner given ++above; only the last is stored in \fB$TCP_LINE\fP, but the complete set is ++stored in the array \fB$tcp_lines\fP\&. This is cleared at the start of each ++call to \fBtcp_read\fP\&. ++.PP ++The options \fB\-t\fP and \fB\-T\fP specify a timeout in seconds, which may be a ++floating point number for increased accuracy\&. With \fB\-t\fP the timeout is ++applied before each line read\&. With \fB\-T\fP, the timeout applies to the ++overall operation, possibly including multiple read operations if the ++option \fB\-d\fP is present; without this option, there is no distinction ++between \fB\-t\fP and \fB\-T\fP\&. ++.PP ++The function does not print informational messages, but if the option ++\fB\-q\fP is given, no error message is printed for a non\-existent session\&. ++.PP ++A return status of 2 indicates a timeout or no data to read\&. Any other ++non\-zero return status indicates some error condition\&. ++.PP ++See \fBtcp_log\fP for how to control where data is sent by \fBtcp_read\fP\&. ++.RE ++.TP ++.PD 0 ++\fBtcp_send [\-cnq] [ \-s\fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIdata\fP \fB\&.\&.\&.\fP ++.TP ++.PD ++\fBtcp_send [\-cnq] \-a\fP \fIdata\fP \fB\&.\&.\&.\fP ++Send the supplied data strings to all the specified sessions in turn\&. The ++underlying operation differs little from a `\fBprint \-r\fP\&' to the session's ++file descriptor, although it attempts to prevent the shell from dying owing ++to a \fBSIGPIPE\fP caused by an attempt to write to a defunct session\&. ++.RS ++.PP ++The option \fB\-c\fP causes \fBtcp_send\fP to behave like \fBcat\fP\&. It reads ++lines from standard input until end of input and sends them in turn to the ++specified session(s) exactly as if they were given as \fIdata\fP ++arguments to individual \fBtcp_send\fP commands\&. ++.PP ++The option \fB\-n\fP prevents \fBtcp_send\fP from putting a newline at the end ++of the data strings\&. ++.PP ++The remaining options all behave as for \fBtcp_read\fP\&. ++.PP ++The data arguments are not further processed once they have been passed to ++\fBtcp_send\fP; they are simply passed down to \fBprint \-r\fP\&. ++.PP ++If the parameter \fB$TCP_OUTPUT\fP is a non\-empty string and logging is ++enabled then the data sent to each session will be echoed to the log ++file(s) with \fB$TCP_OUTPUT\fP in front where appropriate, much ++in the manner of \fB$TCP_PROMPT\fP\&. ++.RE ++.RE ++.PP ++.SS "Session Management" ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBtcp_alias [\-q]\fP \fIalias\fP\fB=\fP\fIsess\fP \fB\&.\&.\&.\fP ++.TP ++.PD 0 ++\fBtcp_alias [\-q] [\fP \fIalias\fP \fB] \&.\&.\&.\fP ++.TP ++.PD ++\fBtcp_alias \-d [\-q]\fP \fIalias\fP \fB\&.\&.\&.\fP ++This function is not particularly well tested\&. ++.RS ++.PP ++The first form creates an alias for a session name; \fIalias\fP can then be ++used to refer to the existing session \fIsess\fP\&. As many aliases may be ++listed as required\&. ++.PP ++The second form lists any aliases specified, or all aliases if none\&. ++.PP ++The third form deletes all the aliases listed\&. The underlying sessions are ++not affected\&. ++.PP ++The option \fB\-q\fP suppresses an inconsistently chosen subset of error ++messages\&. ++.RE ++.TP ++\fBtcp_log [\-asc] [ \-n | \-N ] [\fP \fIlogfile\fP \fB]\fP ++With an argument \fIlogfile\fP, all future input from \fBtcp_read\fP will be ++logged to the named file\&. Unless \fB\-a\fP (append) is given, this file will ++first be truncated or created empty\&. With no arguments, show the current ++status of logging\&. ++.RS ++.PP ++With the option \fB\-s\fP, per\-session logging is enabled\&. Input from ++\fBtcp_read\fP is output to the file \fIlogfile\fP\&.\fIsess\fP\&. As the ++session is automatically discriminated by the filename, the contents are ++raw (no \fB$TCP_PROMPT\fP)\&. The option \fB\-a\fP applies as above\&. ++Per\-session logging and logging of all data in one file are not mutually ++exclusive\&. ++.PP ++The option \fB\-c\fP closes all logging, both complete and per\-session logs\&. ++.PP ++The options \fB\-n\fP and \fB\-N\fP respectively turn off or restore output of ++data read by \fBtcp_read\fP to standard output; hence `\fBtcp_log \-cn\fP\&' turns ++off all output by \fBtcp_read\fP\&. ++.PP ++The function is purely a convenient front end to setting the parameters ++\fB$TCP_LOG\fP, \fB$TCP_LOG_SESS\fP, \fB$TCP_SILENT\fP, which are described below\&. ++.RE ++.TP ++\fBtcp_rename\fP \fIold\fP \fInew\fP ++Rename session \fIold\fP to session \fInew\fP\&. The old name becomes invalid\&. ++.TP ++\fBtcp_sess [\fP \fIsess\fP \fB[\fP \fIcommand\fP \fB\&.\&.\&. ] ]\fP ++With no arguments, list all the open sessions and associated file ++descriptors\&. The current session is marked with a star\&. For use in ++functions, direct access to the parameters \fB$tcp_by_name\fP, \fB$tcp_by_fd\fP ++and \fB$TCP_SESS\fP is probably more convenient; see below\&. ++.RS ++.PP ++With a \fIsess\fP argument, set the current session to \fIsess\fP\&. ++This is equivalent to changing \fB$TCP_SESS\fP directly\&. ++.PP ++With additional arguments, temporarily set the current session while ++executing the string \fBcommand \&.\&.\&.\fP\&. The first argument is re\-evaluated ++so as to expand aliases etc\&., but the remaining arguments are passed ++through as the appear to \fBtcp_sess\fP\&. The original session is restored ++when \fBtcp_sess\fP exits\&. ++.RE ++.RE ++.PP ++.SS "Advanced I/O" ++.PP ++.PD 0 ++.TP ++.PD ++\fBtcp_command\fP \fIsend\-options\fP \fB\&.\&.\&.\fP \fIsend\-arguments\fP \fB\&.\&.\&.\fP ++This is a convenient front\-end to \fBtcp_send\fP\&. All arguments are passed ++to \fBtcp_send\fP, then the function pauses waiting for data\&. While data is ++arriving at least every \fB$TCP_TIMEOUT\fP (default 0\&.3) seconds, data is ++handled and printed out according to the current settings\&. Status 0 is ++always returned\&. ++.RS ++.PP ++This is generally only useful for interactive use, to prevent the display ++becoming fragmented by output returned from the connection\&. Within a ++programme or function it is generally better to handle reading data by a ++more explicit method\&. ++.RE ++.TP ++.PD 0 ++\fBtcp_expect [ \-q ] [ \-p\fP \fIvar\fP \fB] [ \-t \fP \fIto\fP \fB| \-T\fP \fITO\fP\fB]\fP ++.TP ++.PD ++\fB [ \-a | \-s\fP \fIsess\fP \fB\&.\&.\&. | \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIpattern\fP \&.\&.\&. ++Wait for input matching any of the given \fIpattern\fPs from any of the ++specified sessions\&. Input is ignored until an input line matches one of ++the given patterns; at this point status zero is returned, the matching ++line is stored in \fB$TCP_LINE\fP, and the full set of lines read during the ++call to \fBtcp_expect\fP is stored in the array \fB$tcp_expect_lines\fP\&. ++.RS ++.PP ++Sessions are specified in the same way as \fBtcp_read\fP: the default is to ++use the current session, otherwise the sessions specified by \fB\-a\fP, ++\fB\-s\fP, or \fB\-l\fP are used\&. ++.PP ++Each \fIpattern\fP is a standard zsh extended\-globbing pattern; note that it ++needs to be quoted to avoid it being expanded immediately by filename ++generation\&. It must match the full line, so to match a substring there ++must be a `\fB*\fP\&' at the start and end\&. The line matched against includes ++the \fB$TCP_PROMPT\fP added by \fBtcp_read\fP\&. It is possible to include the ++globbing flags `\fB#b\fP\&' or `\fB#m\fP' in the patterns to make backreferences ++available in the parameters \fB$MATCH\fP, \fB$match\fP, etc\&., as described in ++the base zsh documentation on pattern matching\&. ++.PP ++Unlike \fBtcp_read\fP, the default behaviour of \fBtcp_expect\fP is to block ++indefinitely until the required input is found\&. This can be modified by ++specifying a timeout with \fB\-t\fP or \fB\-T\fP; these function as in ++\fBtcp_read\fP, specifying a per\-read or overall timeout, respectively, in ++seconds, as an integer or floating\-point number\&. As \fBtcp_read\fP, the ++function returns status 2 if a timeout occurs\&. ++.PP ++The function returns as soon as any one of the patterns given match\&. If ++the caller needs to know which of the patterns matched, the option \fB\-p\fP ++\fIvar\fP can be used; on return, \fB$var\fP is set to the number of the ++pattern using ordinary zsh indexing, i\&.e\&. the first is 1, and so on\&. Note ++the absence of a `\fB$\fP\&' in front of \fIvar\fP\&. To avoid clashes, the ++parameter cannot begin with `\fB_expect\fP\&'\&. ++.PP ++The option \fB\-q\fP is passed directly down to \fBtcp_read\fP\&. ++.PP ++As all input is done via \fBtcp_read\fP, all the usual rules about output of ++lines read apply\&. One exception is that the parameter \fB$tcp_lines\fP will ++only reflect the line actually matched by \fBtcp_expect\fP; use ++\fB$tcp_expect_lines\fP for the full set of lines read during the function ++call\&. ++.RE ++.TP ++\fBtcp_proxy\fP ++This is a simple\-minded function to accept a TCP connection and execute a ++command with I/O redirected to the connection\&. Extreme caution should be ++taken as there is no security whatsoever and this can leave your computer ++open to the world\&. Ideally, it should only be used behind a firewall\&. ++.RS ++.PP ++The first argument is a TCP port on which the function will listen\&. ++.PP ++The remaining arguments give a command and its arguments to execute with ++standard input, standard output and standard error redirected to the ++file descriptor on which the TCP session has been accepted\&. ++If no command is given, a new zsh is started\&. This gives everyone on ++your network direct access to your account, which in many cases will be a ++bad thing\&. ++.PP ++The command is run in the background, so \fBtcp_proxy\fP can then accept new ++connections\&. It continues to accept new connections until interrupted\&. ++.RE ++.TP ++\fBtcp_spam [\-ertv] [ \-a | \-s \fP \fIsess\fP \fB| \-l\fP \fIsess\fP\fB,\&.\&.\&. ]\fP \fIcmd\fP \fB\&.\&.\&.\fP ++Execute `\fIcmd\fP \fB\&.\&.\&.\fP\&' for each session in turn\&. Note this executes ++the command and arguments; it does not send the command line as data ++unless the \fB\-t\fP (transmit) option is given\&. ++.RS ++.PP ++The sessions may be selected explicitly with the standard \fB\-a\fP, \fB\-s\fP or ++\fB\-l\fP options, or may be chosen implicitly\&. If none of the three options ++is given the rules are: first, if the array \fB$tcp_spam_list\fP is set, this ++is taken as the list of sessions, otherwise all sessions are taken\&. ++Second, any sessions given in the array \fB$tcp_no_spam_list\fP are removed ++from the list of sessions\&. ++.PP ++Normally, any sessions added by the `\fB\-a\fP\&' flag or when all sessions are ++chosen implicitly are spammed in alphabetic order; sessions given by the ++\fB$tcp_spam_list\fP array or on the command line are spammed in the order ++given\&. The \fB\-r\fP flag reverses the order however it was arrived it\&. ++.PP ++The \fB\-v\fP flag specifies that a \fB$TCP_PROMPT\fP will be output before each ++session\&. This is output after any modification to TCP_SESS by the ++user\-defined \fBtcp_on_spam\fP function described below\&. (Obviously that ++function is able to generate its own output\&.) ++.PP ++If the option \fB\-e\fP is present, the line given as \fIcmd \&.\&.\&.\fP is executed ++using \fBeval\fP, otherwise it is executed without any further processing\&. ++.RE ++.TP ++\fBtcp_talk\fP ++This is a fairly simple\-minded attempt to force input to the line editor to ++go straight to the default TCP_SESSION\&. ++.RS ++.PP ++An escape string, \fB$TCP_TALK_ESCAPE\fP, default `:\&', is used to allow ++access to normal shell operation\&. If it is on its own at the start of the ++line, or followed only by whitespace, the line editor returns to normal ++operation\&. Otherwise, the string and any following whitespace are skipped ++and the remainder of the line executed as shell input without any change of ++the line editor\&'s operating mode\&. ++.PP ++The current implementation is somewhat deficient in terms of use of the ++command history\&. For this reason, many users will prefer to use some form ++of alternative approach for sending data easily to the current session\&. ++One simple approach is to alias some special character (such as `\fB%\fP\&') to ++`\fBtcp_command \-\fP\fB\-\fP\&'\&. ++.RE ++.TP ++\fBtcp_wait\fP ++The sole argument is an integer or floating point number which gives the ++seconds to delay\&. The shell will do nothing for that period except wait ++for input on all TCP sessions by calling \fBtcp_read \-a\fP\&. This is similar ++to the interactive behaviour at the command prompt when zle handlers are ++installed\&. ++.PP ++.SS "`One\-shot\&' file transfer" ++.PD 0 ++.TP ++.PD 0 ++\fBtcp_point\fP \fIport\fP ++.TP ++.PD ++\fBtcp_shoot\fP \fIhost\fP \fIport\fP ++This pair of functions provide a simple way to transfer a file between ++two hosts within the shell\&. Note, however, that bulk data transfer is ++currently done using \fBcat\fP\&. \fBtcp_point\fP reads any data arriving at ++\fIport\fP and sends it to standard output; \fBtcp_shoot\fP connects to ++\fIport\fP on \fIhost\fP and sends its standard input\&. Any unused \fIport\fP ++may be used; the standard mechanism for picking a port is to think of a ++random four\-digit number above 1024 until one works\&. ++.RS ++.PP ++To transfer a file from host \fBwoodcock\fP to host \fBspringes\fP, on ++\fBspringes\fP: ++.PP ++.RS ++.nf ++\fBtcp_point 8091 >output_file\fP ++.fi ++.RE ++.PP ++and on \fBwoodcock\fP: ++.PP ++.RS ++.nf ++\fBtcp_shoot springes 8091
}@t{T}@var{} (note the presence of the literal ++character @t{T}). The first word (the regular recurrence) may be ++something other than a proper date/time to indicate that the event ++is additional to the normal sequence; a convention that retains ++the formatting appearance is @t{XXXXXXXXTXXXXXX}. ++ ++@noindent ++Furthermore, it is useful to record the next regular recurrence ++(as then the displayed date may be for a rescheduled event so cannot ++be used for calculating the regular sequence). This is specified by ++@t{RECURRENCE} and a time or date in the same format. @t{calendar_add} ++adds such an indication when it encounters a recurring event that does not ++include one, based on the headline date/time. ++ ++@noindent ++If @t{calendar_add} is used to update occurrences the @t{UID} keyword ++described there should be present in both the existing entry and the added ++occurrence in order to identify recurring event sequences. ++ ++@noindent ++For example, ++ ++@noindent ++@example ++Thu May 6, 2010 11:00 Informal chat RPT 1 week ++ # RECURRENCE 20100506T110000 ++ # OCCURRENCE 20100513T110000 20100513T120000 ++ # OCCURRENCE 20100520T110000 CANCELLED ++@end example ++ ++@noindent ++The event that occurs at 11:00 on 13th May 2010 is rescheduled an hour ++later. The event that occurs a week later is cancelled. The occurrences ++are given on a continuation line starting with a @t{#} character so will ++not usually be displayed as part of the event. As elsewhere, no account of ++time zones is taken with the times. After the next event occurs the headline ++date/time will be `@t{Thu May 13, 2010 12:00}' while the @t{RECURRENCE} ++date/time will be `@t{20100513T110000}' (note that cancelled and ++moved events are not taken account of in the @t{RECURRENCE}, which ++records what the next regular recurrence is, but they are accounted for in ++the headline date/time). ++ ++@noindent ++It is safe to run @t{calendar -s} to reschedule an existing event ++(if the calendar file has changed, for example), and also to have it ++running in multiples instances of the shell since the calendar file ++is locked when in use. ++ ++@noindent ++By default, expired events are moved to the "done" file; see the @t{-d} ++option. Use @t{-D} to prevent this. ++ ++@item @t{-S} @var{showprog} ++Explicitly specify a programme to be used for showing events instead ++of the value of the @t{show-prog} style or the default @t{calendar_show}. ++ ++@item @t{-v} ++Verbose: show more information about stages of processing. This ++is useful for confirming that the function has successfully parsed ++the dates in the calendar file. ++ ++@end table ++ ++@findex calendar_add ++@item @t{calendar_add} [ @t{-BL} ] @var{event ...} ++Adds a single event to the calendar in the appropriate location. ++The event can contain multiple lines, as described in ++@ref{Calendar File and Date Formats}. ++Using this function ensures that the calendar file is sorted in date ++and time order. It also makes special arrangements for locking ++the file while it is altered. The old calendar is left in a file ++with the suffix @t{.old}. ++ ++@noindent ++The option @t{-B} indicates that backing up the calendar file will be ++handled by the caller and should not be performed by @t{calendar_add}. The ++option @t{-L} indicates that @t{calendar_add} does not need to lock the ++calendar file as it is already locked. These options will not usually be ++needed by users. ++ ++@noindent ++If the style @t{reformat-date} is true, the date and time of the ++new entry will be rewritten into the standard date format: see ++the descriptions of this style and the style @t{date-format}. ++ ++@noindent ++The function can use a unique identifier stored with each event to ensure ++that updates to existing events are treated correctly. The entry ++should contain the word @t{UID}, followed by whitespace, followed by ++a word consisting entirely of hexadecimal digits of arbitrary length ++(all digits are significant, including leading zeroes). As the UID ++is not directly useful to the user, it is convenient to hide it on ++an indented continuation line starting with a @t{#}, for example: ++ ++@noindent ++@example ++Aug 31, 2007 09:30 Celebrate the end of the holidays ++ # UID 045B78A0 ++@end example ++ ++@noindent ++The second line will not be shown by the @t{calendar} function. ++ ++@noindent ++It is possible to specify the @t{RPT} keyword followed by @t{CANCELLED} ++instead of a relative time. This causes any matched event or series ++of events to be cancelled (the original event does not have to be marked ++as recurring in order to be cancelled by this method). A @t{UID} is ++required in order to match an existing event in the calendar. ++ ++@noindent ++@t{calendar_add} will attempt to manage recurrences and occurrences of ++repeating events as described for event scheduling by @t{calendar -s} ++above. To reschedule or cancel a single event @t{calendar_add} should be ++called with an entry that includes the correct @t{UID} but does @emph{not} ++include the @t{RPT} keyword as this is taken to mean the entry applies to a ++series of repeating events and hence replaces all existing information. ++Each rescheduled or cancelled occurrence must have an @t{OCCURRENCE} ++keyword in the entry passed to @t{calendar_add} which will be merged into ++the calendar file. Any existing reference to the occurrence is replaced. ++An occurrence that does not refer to a valid existing event is added as a ++one-off occurrence to the same calendar entry. ++ ++@findex calendar_edit ++@item @t{calendar_edit} ++This calls the user's editor to edit the calendar file. If ++there are arguments, they are taken as the editor to use (the file name ++is appended to the commands); otherwise, the editor is given by the ++variable @t{VISUAL}, if set, else the variable @t{EDITOR}. ++ ++@noindent ++If the calendar scheduler was running, then after editing the file ++@t{calendar -s} is called to update it. ++ ++@noindent ++This function locks out the calendar system during the edit. ++Hence it should be used to edit the calendar file if there is any ++possibility of a calendar event occurring meanwhile. Note this ++can lead to another shell with calendar functions enabled hanging waiting ++for a lock, so it is necessary to quit the editor as soon as possible. ++ ++@findex calendar_parse ++@item @t{calendar_parse} @var{calendar-entry} ++This is the internal function that analyses the parts of a calendar ++entry, which is passed as the only argument. The function returns ++status 1 if the argument could not be parsed as a calendar entry ++and status 2 if the wrong number of arguments were passed; it also sets the ++parameter @t{reply} to an empty associative array. Otherwise, ++it returns status 0 and sets elements of the associative ++array @t{reply} as follows: ++@table @asis ++@item time ++The time as a string of digits in the same units as ++@t{$EPOCHSECONDS} ++@item schedtime ++The regularly scheduled time. This may differ from ++the actual event time @t{time} if this is a recurring event and the next ++occurrence has been rescheduled. Then @t{time} gives the actual time ++and @t{schedtime} the time of the regular recurrence before modification. ++@item text1 ++The text from the line not including the date and time of the ++event, but including any @t{WARN} or @t{RPT} keywords and values. ++@item warntime ++Any warning time given by the @t{WARN} keyword as a string ++of digits containing the time at which to warn in the same units as ++@t{$EPOCHSECONDS}. (Note this is an absolute time, not the relative time ++passed down.) Not set no @t{WARN} keyword and value were ++matched. ++@item warnstr ++The raw string matched after the @t{WARN} keyword, else unset. ++@item rpttime ++Any recurrence time given by the @t{RPT} keyword as a string ++of digits containing the time of the recurrence in the same units ++as @t{$EPOCHSECONDS}. (Note this is an absolute time.) Not set if ++no @t{RPT} keyword and value were matched. ++@item schedrpttime ++The next regularly scheduled occurrence of a recurring ++event before modification. This may differ from @t{rpttime}, which is the ++actual time of the event that may have been rescheduled from the regular ++time. ++@item rptstr ++The raw string matched after the @t{RPT} keyword, else unset. ++@item text2 ++The text from the line after removal of the date and any ++keywords and values. ++ ++@end table ++) ++@findex calendar_showdate ++@item @t{calendar_showdate} [ @t{-r} ] [ @t{-f} @var{fmt} ] @var{date-spec ...} ++The given @var{date-spec} is interpreted and the corresponding date and ++time printed. If the initial @var{date-spec} begins with a @t{+} or ++@t{-} it is treated as relative to the current time; @var{date-spec}s after ++the first are treated as relative to the date calculated so far and ++a leading @t{+} is optional in that case. This allows one to ++use the system as a date calculator. For example, @t{calendar_showdate '+1 ++month, 1st Friday'} shows the date of the first Friday of next month. ++ ++@noindent ++With the option @t{-r} nothing is printed but the value of the date and ++time in seconds since the epoch is stored in the parameter @t{REPLY}. ++ ++@noindent ++With the option @t{-f} @var{fmt} the given date/time conversion format ++is passed to @t{strftime}; see notes on the @t{date-format} style below. ++ ++@noindent ++In order to avoid ambiguity with negative relative date specifications, ++options must occur in separate words; in other words, @t{-r} and @t{-f} ++should not be combined in the same word. ++ ++@findex calendar_sort ++@item @t{calendar_sort} ++Sorts the calendar file into date and time order. The old calendar is ++left in a file with the suffix @t{.old}. ++ ++@end table ++ ++@noindent ++ ++@subsection Glob qualifiers ++@noindent ++@findex age ++ ++@noindent ++The function @t{age} can be autoloaded and use separately from ++the calendar system, although it uses the function @t{calendar_scandate} ++for date formatting. It requires the @t{zsh/stat} builtin, but uses ++only the builtin @t{zstat}. ++ ++@noindent ++@t{age} selects files having a given modification time for use ++as a glob qualifier. The format of the date is the same as that ++understood by the calendar system, described in ++@ref{Calendar File and Date Formats}. ++ ++@noindent ++The function can take one or two arguments, which can be supplied either ++directly as command or arguments, or separately as shell parameters. ++ ++@noindent ++@example ++print *(e:age 2006/10/04 2006/10/09:) ++@end example ++ ++@noindent ++The example above matches all files modified between the start of those ++dates. The second argument may alternatively be a relative time ++introduced by a @t{+}: ++ ++@noindent ++@example ++print *(e:age 2006/10/04 +5d:) ++@end example ++ ++@noindent ++The example above is equivalent to the previous example. ++ ++@noindent ++In addition to the special use of days of the week, @t{today} and ++@t{yesterday}, times with no date may be specified; these apply to today. ++Obviously such uses become problematic around midnight. ++ ++@noindent ++@example ++print *(e-age 12:00 13:30-) ++@end example ++ ++@noindent ++The example above shows files modified between 12:00 and 13:00 today. ++ ++@noindent ++@example ++print *(e:age 2006/10/04:) ++@end example ++ ++@noindent ++The example above matches all files modified on that date. If the second ++argument is omitted it is taken to be exactly 24 hours after the first ++argument (even if the first argument contains a time). ++ ++@noindent ++@example ++print *(e-age 2006/10/04:10:15 2006/10/04:10:45-) ++@end example ++ ++@noindent ++The example above supplies times. Note that whitespace within the time and ++date specification must be quoted to ensure @t{age} receives the correct ++arguments, hence the use of the additional colon to separate the date and ++time. ++ ++@noindent ++@example ++AGEREF1=2006/10/04:10:15 ++AGEREF2=2006/10/04:10:45 ++print *(+age) ++@end example ++ ++@noindent ++This shows the same example before using another form of argument ++passing. The dates and times in the parameters @t{AGEREF1} and @t{AGEREF2} ++stay in effect until unset, but will be overridden if any argument is ++passed as an explicit argument to age. Any explicit argument ++causes both parameters to be ignored. ++ ++@noindent ++@node Calendar Styles, Calendar Utility Functions, Calendar System User Functions, Calendar Function System ++ ++@section Styles ++@noindent ++ ++@noindent ++The zsh style mechanism using the @t{zstyle} command is describe in ++@ref{The zsh/zutil Module}. This is the same mechanism ++used in the completion system. ++ ++@noindent ++The styles below are all examined in the context ++@t{:datetime:}@var{function}@t{:}, for example @t{:datetime:calendar:}. ++ ++@noindent ++@table @asis ++@kindex calendar-file ++@item @t{calendar-file} ++The location of the main calendar. The default is @t{~/calendar}. ++ ++@kindex date-format ++@item @t{date-format} ++A @t{strftime} format string (see man page strftime(3)) with the zsh ++extensions providing various numbers with no leading zero or space ++if the number is a single digit as described for the ++@t{%D@{}@var{string}@t{@}} prompt format in ++@ref{Prompt Expansion}. ++ ++@noindent ++This is used for outputting dates in @t{calendar}, both to support ++the @t{-v} option and when adding recurring events back to the calendar ++file, and in @t{calendar_showdate} as the final output format. ++ ++@noindent ++If the style is not set, the default used is similar the standard system ++format as output by the @t{date} command (also known as `ctime format'): ++`@t{%a %b %d %H:%M:%S %Z %Y}'. ++ ++@kindex done-file ++@item @t{done-file} ++The location of the file to which events which have passed are appended. ++The default is the calendar file location with the suffix @t{.done}. ++The style may be set to an empty string in which case a "done" file ++will not be maintained. ++ ++@kindex reformat-date ++@item @t{reformat-date} ++Boolean, used by @t{calendar_add}. If it is true, the date and time ++of new entries added to the calendar will be reformatted to the format ++given by the style @t{date-format} or its default. Only the date and ++time of the event itself is reformatted; any subsidiary dates and times ++such as those associated with repeat and warning times are left alone. ++ ++@kindex show-prog ++@item @t{show-prog} ++The programme run by @t{calendar} for showing events. It will ++be passed the start time and stop time of the events requested in seconds ++since the epoch followed by the event text. Note that @t{calendar -s} uses ++a start time and stop time equal to one another to indicate alerts ++for specific events. ++ ++@noindent ++The default is the function @t{calendar_show}. ++ ++@kindex warn-time ++@item @t{warn-time} ++The time before an event at which a warning will be displayed, if the ++first line of the event does not include the text @t{EVENT} @var{reltime}. ++The default is 5 minutes. ++ ++@end table ++ ++@noindent ++@node Calendar Utility Functions, Calendar Bugs, Calendar Styles, Calendar Function System ++ ++@section Utility functions ++@noindent ++ ++@noindent ++@table @asis ++@findex calendar_lockfiles ++@item @t{calendar_lockfiles} ++Attempt to lock the files given in the argument. To prevent ++problems with network file locking this is done in an ad hoc fashion ++by attempting to create a symbolic link to the file with the name ++@var{file}@t{.lockfile}. No other system level functions are used ++for locking, i.e. the file can be accessed and modified by any ++utility that does not use this mechanism. In particular, the user is not ++prevented from editing the calendar file at the same time unless ++@t{calendar_edit} is used. ++ ++@noindent ++Three attempts are made to lock the file before giving up. If the module ++@t{zsh/zselect} is available, the times of the attempts are jittered so that ++multiple instances of the calling function are unlikely to retry at the ++same time. ++ ++@noindent ++The files locked are appended to the array @t{lockfiles}, which should ++be local to the caller. ++ ++@noindent ++If all files were successfully locked, status zero is returned, else status one. ++ ++@noindent ++This function may be used as a general file locking function, although ++this will only work if only this mechanism is used to lock files. ++ ++@findex calendar_read ++@item @t{calendar_read} ++This is a backend used by various other functions to parse the ++calendar file, which is passed as the only argument. The array ++@t{calendar_entries} is set to the list of events in the file; no ++pruning is done except that ampersands are removed from the start of ++the line. Each entry may contain multiple lines. ++ ++@findex calendar_scandate ++@item @t{calendar_scandate} ++This is a generic function to parse dates and times that may be ++used separately from the calendar system. The argument is a date ++or time specification as described in ++@ref{Calendar File and Date Formats}. The parameter @t{REPLY} ++is set to the number of seconds since the epoch corresponding to that date ++or time. By default, the date and time may occur anywhere within the given ++argument. ++ ++@noindent ++Returns status zero if the date and time were successfully parsed, ++else one. ++ ++@noindent ++Options: ++@table @asis ++@item @t{-a} ++The date and time are anchored to the start of the argument; they ++will not be matched if there is preceding text. ++ ++@item @t{-A} ++The date and time are anchored to both the start and end of the argument; ++they will not be matched if the is any other text in the argument. ++ ++@item @t{-d} ++Enable additional debugging output. ++ ++@item @t{-m} ++Minus. When @t{-R} @var{anchor_time} is also given the relative time is ++calculated backwards from @var{anchor_time}. ++ ++@item @t{-r} ++The argument passed is to be parsed as a relative time. ++ ++@item @t{-R} @var{anchor_time} ++The argument passed is to be parsed as a relative time. The time is ++relative to @var{anchor_time}, a time in seconds since the epoch, ++and the returned value is the absolute time corresponding to advancing ++@var{anchor_time} by the relative time given. ++This allows lengths of months to be correctly taken into account. If ++the final day does not exist in the given month, the last day of the ++final month is given. For example, if the anchor time is during 31st ++January 2007 and the relative time is 1 month, the final time is the ++same time of day during 28th February 2007. ++ ++@item @t{-s} ++In addition to setting @t{REPLY}, set @t{REPLY2} to the remainder of ++the argument after the date and time have been stripped. This is ++empty if the option @t{-A} was given. ++ ++@item @t{-t} ++Allow a time with no date specification. The date is assumed to be ++today. The behaviour is unspecified if the iron tongue of midnight ++is tolling twelve. ++ ++@end table ++ ++@findex calendar_show ++@item @t{calendar_show} ++The function used by default to display events. It accepts a start time ++and end time for events, both in epoch seconds, and an event description. ++ ++@noindent ++The event is always printed to standard output. If the command line editor ++is active (which will usually be the case) the command line will be ++redisplayed after the output. ++ ++@noindent ++If the parameter @t{DISPLAY} is set and the start and end times are ++the same (indicating a scheduled event), the function uses the ++command @t{xmessage} to display a window with the event details. ++ ++@end table ++ ++@noindent ++@node Calendar Bugs, , Calendar Utility Functions, Calendar Function System ++ ++@section Bugs ++@noindent ++ ++@noindent ++As the system is based entirely on shell functions (with a little support ++from the @t{zsh/datetime} module) the mechanisms used are not as robust as ++those provided by a dedicated calendar utility. Consequently the user ++should not rely on the shell for vital alerts. ++ ++@noindent ++There is no @t{calendar_delete} function. ++ ++@noindent ++There is no localization support for dates and times, nor any support ++for the use of time zones. ++ ++@noindent ++Relative periods of months and years do not take into account the variable ++number of days. ++ ++@noindent ++The @t{calendar_show} function is currently hardwired to use @t{xmessage} ++for displaying alerts on X Window System displays. This should be ++configurable and ideally integrate better with the desktop. ++ ++@noindent ++@t{calendar_lockfiles} hangs the shell while waiting for a lock on a file. ++If called from a scheduled task, it should instead reschedule the event ++that caused it. ++@c (avoiding a yodl bug) ++@c Yodl file: Zsh/tcpsys.yo ++@node TCP Function System, Zftp Function System, Calendar Function System, Top ++ ++@chapter TCP Function System ++@noindent ++@cindex TCP function system ++@cindex ztcp, function system based on ++ ++@section Description ++@noindent ++ ++@noindent ++A module @t{zsh/net/tcp} is provided to provide network I/O over ++TCP/IP from within the shell; see its description in ++@ref{Zsh Modules} ++. This manual page describes a function suite based on the module. ++If the module is installed, the functions are usually installed at the ++same time, in which case they will be available for ++autoloading in the default function search path. In addition to the ++@t{zsh/net/tcp} module, the @t{zsh/zselect} module is used to implement ++timeouts on read operations. For troubleshooting tips, consult the ++corresponding advice for the @t{zftp} functions described in ++@ref{Zftp Function System} ++. ++ ++@noindent ++There are functions corresponding to the basic I/O operations open, close, ++read and send, named @t{tcp_open} etc., as well as a function ++@t{tcp_expect} for pattern match analysis of data read as input. The ++system makes it easy to receive data from and send data to multiple named ++sessions at once. In addition, it can be linked with the shell's line ++editor in such a way that input data is automatically shown at the ++terminal. Other facilities available including logging, filtering and ++configurable output prompts. ++ ++@noindent ++To use the system where it is available, it should be enough to ++`@t{autoload -U tcp_open}' and run @t{tcp_open} as documented below to ++start a session. The @t{tcp_open} function will autoload the remaining ++functions. ++ ++@noindent ++@menu ++* TCP Functions:: ++* TCP Parameters:: ++* TCP Examples:: ++* TCP Bugs:: ++@end menu ++ ++@noindent ++@node TCP Functions, TCP Parameters, , TCP Function System ++ ++@section TCP User Functions ++@noindent ++ ++@noindent ++ ++@subsection Basic I/O ++@noindent ++ ++@noindent ++@table @asis ++@findex tcp_open ++@item @t{tcp_open [-qz]} @var{host port} @t{[} @var{sess} @t{]} ++@itemx @t{tcp_open [-qz] [ -s} @var{sess} @t{| -l} @var{sess}@t{,... ] ... } ++@itemx @t{tcp_open [-qz] [-a} @var{fd} @t{| -f} @var{fd} @t{] [} @var{sess} @t{]} ++Open a new session. In the first and simplest form, open a TCP connection ++to host @var{host} at port @var{port}; numeric and symbolic forms are ++understood for both. ++ ++@noindent ++If @var{sess} is given, this becomes the name of the session which can be ++used to refer to multiple different TCP connections. If @var{sess} is ++not given, the function will invent a numeric name value (note this is ++@emph{not} the same as the file descriptor to which the session is attached). ++It is recommended that session names not include `funny' characters, where ++funny characters are not well-defined but certainly do not include ++alphanumerics or underscores, and certainly do include whitespace. ++ ++@noindent ++In the second case, one or more sessions to be opened are given by name. ++A single session name is given after @t{-s} and a comma-separated list ++after @t{-l}; both options may be repeated as many times as necessary. ++A failure to open any session causes @t{tcp_open} to abort. ++The host and port are read from the file @t{.ztcp_sessions} in the same ++directory as the user's zsh initialisation files, i.e. usually the home ++directory, but @t{$ZDOTDIR} if that is set. The file consists of lines ++each giving a session name and the corresponding host and port, in that ++order (note the session name comes first, not last), separated by ++whitespace. ++ ++@noindent ++The third form allows passive and fake TCP connections. If the option ++@t{-a} is used, its argument is a file descriptor open for listening for ++connections. No function front-end is provided to open such a file ++descriptor, but a call to `@t{ztcp -l} @var{port}' will create one with the ++file descriptor stored in the parameter @t{$REPLY}. The listening port can ++be closed with `@t{ztcp -c} @var{fd}'. A call to `@t{tcp_open -a} @var{fd}' ++will block until a remote TCP connection is made to @var{port} on the local ++machine. At this point, a session is created in the usual way and is ++largely indistinguishable from an active connection created with one of the ++first two forms. ++ ++@noindent ++If the option @t{-f} is used, its argument is a file descriptor which is ++used directly as if it were a TCP session. How well the remainder of the ++TCP function system copes with this depends on what actually underlies this ++file descriptor. A regular file is likely to be unusable; a FIFO (pipe) of ++some sort will work better, but note that it is not a good idea for two ++different sessions to attempt to read from the same FIFO at once. ++ ++@noindent ++If the option @t{-q} is given with any of the three forms, @t{tcp_open} ++will not print informational messages, although it will in any case exit ++with an appropriate status. ++ ++@noindent ++If the line editor (zle) is in use, which is typically the case if the ++shell is interactive, @t{tcp_open} installs a handler inside @t{zle} which ++will check for new data at the same time as it checks for keyboard input. ++This is convenient as the shell consumes no CPU time while waiting; the ++test is performed by the operating system. Giving the option @t{-z} to ++any of the forms of @t{tcp_open} prevents the handler from being ++installed, so data must be read explicitly. Note, however, this is not ++necessary for executing complete sets of send and read commands from a ++function, as zle is not active at this point. Generally speaking, the ++handler is only active when the shell is waiting for input at a command ++prompt or in the @t{vared} builtin. The option has no effect if zle is not ++active; `@t{[[ -o zle]]}' will test for this. ++ ++@noindent ++The first session to be opened becomes the current session and subsequent ++calls to @t{tcp_open} do not change it. The current session is stored ++in the parameter @t{$TCP_SESS}; see below for more detail about the ++parameters used by the system. ++ ++@noindent ++The function @t{tcp_on_open}, if defined, is called when a session ++is opened. See the description below. ++ ++@findex tcp_close ++@item @t{tcp_close [-qn] [ -a | -l} @var{sess}@t{,... |} @var{sess} @t{... ]} ++Close the named sessions, or the current session if none is given, ++or all open sessions if @t{-a} is given. The options @t{-l} and @t{-s} are ++both handled for consistency with @t{tcp_open}, although the latter is ++redundant. ++ ++@noindent ++If the session being closed is the current one, @t{$TCP_SESS} is unset, ++leaving no current session, even if there are other sessions still open. ++ ++@noindent ++If the session was opened with @t{tcp_open -f}, the file descriptor is ++closed so long as it is in the range 0 to 9 accessible directly from the ++command line. If the option @t{-n} is given, no attempt will be made to ++close file descriptors in this case. The @t{-n} option is not used for ++genuine @t{ztcp} session; the file descriptors are always closed with the ++session. ++ ++@noindent ++If the option @t{-q} is given, no informational messages will be printed. ++ ++@findex tcp_read ++@item @t{tcp_read [-bdq] [ -t} @var{TO} @t{] [ -T} @var{TO} @t{]} ++@itemx @t{[ -a | -u} @var{fd} @t{... | -l} @var{sess}@t{,... | -s} @var{sess} @t{...]} ++Perform a read operation on the current session, or on a list of ++sessions if any are given with @t{-u}, @t{-l} or @t{-s}, or all open ++sessions if the option @t{-a} is given. Any of the @t{-u}, @t{-l} or ++@t{-s} options may be repeated or mixed together. The @t{-u} option ++specifies a file descriptor directly (only those managed by this system ++are useful), the other two specify sessions as described for ++@t{tcp_open} above. ++ ++@noindent ++The function checks for new data available on all the sessions listed. ++Unless the @t{-b} option is given, it will not block waiting for new data. ++Any one line of data from any of the available sessions will be read, ++stored in the parameter @t{$TCP_LINE}, and displayed to standard output ++unless @t{$TCP_SILENT} contains a non-empty string. When printed to ++standard output the string @t{$TCP_PROMPT} will be shown at the start of ++the line; the default form for this includes the name of the session being ++read. See below for more information on these parameters. In this mode, ++@t{tcp_read} can be called repeatedly until it returns status 2 which ++indicates all pending input from all specified sessions has been handled. ++ ++@noindent ++With the option @t{-b}, equivalent to an infinite timeout, the function ++will block until a line is available to read from one of the specified ++sessions. However, only a single line is returned. ++ ++@noindent ++The option @t{-d} indicates that all pending input should be drained. In ++this case @t{tcp_read} may process multiple lines in the manner given ++above; only the last is stored in @t{$TCP_LINE}, but the complete set is ++stored in the array @t{$tcp_lines}. This is cleared at the start of each ++call to @t{tcp_read}. ++ ++@noindent ++The options @t{-t} and @t{-T} specify a timeout in seconds, which may be a ++floating point number for increased accuracy. With @t{-t} the timeout is ++applied before each line read. With @t{-T}, the timeout applies to the ++overall operation, possibly including multiple read operations if the ++option @t{-d} is present; without this option, there is no distinction ++between @t{-t} and @t{-T}. ++ ++@noindent ++The function does not print informational messages, but if the option ++@t{-q} is given, no error message is printed for a non-existent session. ++ ++@noindent ++A return status of 2 indicates a timeout or no data to read. Any other ++non-zero return status indicates some error condition. ++ ++@noindent ++See @t{tcp_log} for how to control where data is sent by @t{tcp_read}. ++ ++@findex tcp_send ++@item @t{tcp_send [-cnq] [ -s} @var{sess} @t{| -l} @var{sess}@t{,... ]} @var{data} @t{...} ++@itemx @t{tcp_send [-cnq] -a} @var{data} @t{...} ++Send the supplied data strings to all the specified sessions in turn. The ++underlying operation differs little from a `@t{print -r}' to the session's ++file descriptor, although it attempts to prevent the shell from dying owing ++to a @t{SIGPIPE} caused by an attempt to write to a defunct session. ++ ++@noindent ++The option @t{-c} causes @t{tcp_send} to behave like @t{cat}. It reads ++lines from standard input until end of input and sends them in turn to the ++specified session(s) exactly as if they were given as @var{data} ++arguments to individual @t{tcp_send} commands. ++ ++@noindent ++The option @t{-n} prevents @t{tcp_send} from putting a newline at the end ++of the data strings. ++ ++@noindent ++The remaining options all behave as for @t{tcp_read}. ++ ++@noindent ++The data arguments are not further processed once they have been passed to ++@t{tcp_send}; they are simply passed down to @t{print -r}. ++ ++@noindent ++If the parameter @t{$TCP_OUTPUT} is a non-empty string and logging is ++enabled then the data sent to each session will be echoed to the log ++file(s) with @t{$TCP_OUTPUT} in front where appropriate, much ++in the manner of @t{$TCP_PROMPT}. ++ ++@end table ++ ++@noindent ++ ++@subsection Session Management ++@noindent ++ ++@noindent ++@table @asis ++@findex tcp_alias ++@item @t{tcp_alias [-q]} @var{alias}@t{=}@var{sess} @t{...} ++@itemx @t{tcp_alias [-q] [} @var{alias} @t{] ...} ++@itemx @t{tcp_alias -d [-q]} @var{alias} @t{...} ++This function is not particularly well tested. ++ ++@noindent ++The first form creates an alias for a session name; @var{alias} can then be ++used to refer to the existing session @var{sess}. As many aliases may be ++listed as required. ++ ++@noindent ++The second form lists any aliases specified, or all aliases if none. ++ ++@noindent ++The third form deletes all the aliases listed. The underlying sessions are ++not affected. ++ ++@noindent ++The option @t{-q} suppresses an inconsistently chosen subset of error ++messages. ++ ++@findex tcp_log ++@item @t{tcp_log [-asc] [ -n | -N ] [} @var{logfile} @t{]} ++With an argument @var{logfile}, all future input from @t{tcp_read} will be ++logged to the named file. Unless @t{-a} (append) is given, this file will ++first be truncated or created empty. With no arguments, show the current ++status of logging. ++ ++@noindent ++With the option @t{-s}, per-session logging is enabled. Input from ++@t{tcp_read} is output to the file @var{logfile}.@var{sess}. As the ++session is automatically discriminated by the filename, the contents are ++raw (no @t{$TCP_PROMPT}). The option @t{-a} applies as above. ++Per-session logging and logging of all data in one file are not mutually ++exclusive. ++ ++@noindent ++The option @t{-c} closes all logging, both complete and per-session logs. ++ ++@noindent ++The options @t{-n} and @t{-N} respectively turn off or restore output of ++data read by @t{tcp_read} to standard output; hence `@t{tcp_log -cn}' turns ++off all output by @t{tcp_read}. ++ ++@noindent ++The function is purely a convenient front end to setting the parameters ++@t{$TCP_LOG}, @t{$TCP_LOG_SESS}, @t{$TCP_SILENT}, which are described below. ++ ++@findex tcp_rename ++@item @t{tcp_rename} @var{old} @var{new} ++Rename session @var{old} to session @var{new}. The old name becomes invalid. ++ ++@findex tcp_sess ++@item @t{tcp_sess [} @var{sess} @t{[} @var{command} @t{... ] ]} ++With no arguments, list all the open sessions and associated file ++descriptors. The current session is marked with a star. For use in ++functions, direct access to the parameters @t{$tcp_by_name}, @t{$tcp_by_fd} ++and @t{$TCP_SESS} is probably more convenient; see below. ++ ++@noindent ++With a @var{sess} argument, set the current session to @var{sess}. ++This is equivalent to changing @t{$TCP_SESS} directly. ++ ++@noindent ++With additional arguments, temporarily set the current session while ++executing the string @t{command ...}. The first argument is re-evaluated ++so as to expand aliases etc., but the remaining arguments are passed ++through as the appear to @t{tcp_sess}. The original session is restored ++when @t{tcp_sess} exits. ++ ++@end table ++ ++@noindent ++ ++@subsection Advanced I/O ++@noindent ++ ++@noindent ++@table @asis ++@findex tcp_command ++@item @t{tcp_command} @var{send-options} @t{...} @var{send-arguments} @t{...} ++This is a convenient front-end to @t{tcp_send}. All arguments are passed ++to @t{tcp_send}, then the function pauses waiting for data. While data is ++arriving at least every @t{$TCP_TIMEOUT} (default 0.3) seconds, data is ++handled and printed out according to the current settings. Status 0 is ++always returned. ++ ++@noindent ++This is generally only useful for interactive use, to prevent the display ++becoming fragmented by output returned from the connection. Within a ++programme or function it is generally better to handle reading data by a ++more explicit method. ++ ++@findex tcp_expect ++@item @t{tcp_expect [ -q ] [ -p} @var{var} @t{] [ -t } @var{to} @t{| -T} @var{TO}@t{]} ++@itemx @t{ [ -a | -s} @var{sess} @t{... | -l} @var{sess}@t{,... ]} @var{pattern} ... ++Wait for input matching any of the given @var{pattern}s from any of the ++specified sessions. Input is ignored until an input line matches one of ++the given patterns; at this point status zero is returned, the matching ++line is stored in @t{$TCP_LINE}, and the full set of lines read during the ++call to @t{tcp_expect} is stored in the array @t{$tcp_expect_lines}. ++ ++@noindent ++Sessions are specified in the same way as @t{tcp_read}: the default is to ++use the current session, otherwise the sessions specified by @t{-a}, ++@t{-s}, or @t{-l} are used. ++ ++@noindent ++Each @var{pattern} is a standard zsh extended-globbing pattern; note that it ++needs to be quoted to avoid it being expanded immediately by filename ++generation. It must match the full line, so to match a substring there ++must be a `@t{*}' at the start and end. The line matched against includes ++the @t{$TCP_PROMPT} added by @t{tcp_read}. It is possible to include the ++globbing flags `@t{#b}' or `@t{#m}' in the patterns to make backreferences ++available in the parameters @t{$MATCH}, @t{$match}, etc., as described in ++the base zsh documentation on pattern matching. ++ ++@noindent ++Unlike @t{tcp_read}, the default behaviour of @t{tcp_expect} is to block ++indefinitely until the required input is found. This can be modified by ++specifying a timeout with @t{-t} or @t{-T}; these function as in ++@t{tcp_read}, specifying a per-read or overall timeout, respectively, in ++seconds, as an integer or floating-point number. As @t{tcp_read}, the ++function returns status 2 if a timeout occurs. ++ ++@noindent ++The function returns as soon as any one of the patterns given match. If ++the caller needs to know which of the patterns matched, the option @t{-p} ++@var{var} can be used; on return, @t{$var} is set to the number of the ++pattern using ordinary zsh indexing, i.e. the first is 1, and so on. Note ++the absence of a `@t{$}' in front of @var{var}. To avoid clashes, the ++parameter cannot begin with `@t{_expect}'. ++ ++@noindent ++The option @t{-q} is passed directly down to @t{tcp_read}. ++ ++@noindent ++As all input is done via @t{tcp_read}, all the usual rules about output of ++lines read apply. One exception is that the parameter @t{$tcp_lines} will ++only reflect the line actually matched by @t{tcp_expect}; use ++@t{$tcp_expect_lines} for the full set of lines read during the function ++call. ++ ++@findex tcp_proxy ++@item @t{tcp_proxy} ++This is a simple-minded function to accept a TCP connection and execute a ++command with I/O redirected to the connection. Extreme caution should be ++taken as there is no security whatsoever and this can leave your computer ++open to the world. Ideally, it should only be used behind a firewall. ++ ++@noindent ++The first argument is a TCP port on which the function will listen. ++ ++@noindent ++The remaining arguments give a command and its arguments to execute with ++standard input, standard output and standard error redirected to the ++file descriptor on which the TCP session has been accepted. ++If no command is given, a new zsh is started. This gives everyone on ++your network direct access to your account, which in many cases will be a ++bad thing. ++ ++@noindent ++The command is run in the background, so @t{tcp_proxy} can then accept new ++connections. It continues to accept new connections until interrupted. ++ ++@findex tcp_spam ++@item @t{tcp_spam [-ertv] [ -a | -s } @var{sess} @t{| -l} @var{sess}@t{,... ]} @var{cmd} @t{...} ++Execute `@var{cmd} @t{...}' for each session in turn. Note this executes ++the command and arguments; it does not send the command line as data ++unless the @t{-t} (transmit) option is given. ++ ++@noindent ++The sessions may be selected explicitly with the standard @t{-a}, @t{-s} or ++@t{-l} options, or may be chosen implicitly. If none of the three options ++is given the rules are: first, if the array @t{$tcp_spam_list} is set, this ++is taken as the list of sessions, otherwise all sessions are taken. ++Second, any sessions given in the array @t{$tcp_no_spam_list} are removed ++from the list of sessions. ++ ++@noindent ++Normally, any sessions added by the `@t{-a}' flag or when all sessions are ++chosen implicitly are spammed in alphabetic order; sessions given by the ++@t{$tcp_spam_list} array or on the command line are spammed in the order ++given. The @t{-r} flag reverses the order however it was arrived it. ++ ++@noindent ++The @t{-v} flag specifies that a @t{$TCP_PROMPT} will be output before each ++session. This is output after any modification to TCP_SESS by the ++user-defined @t{tcp_on_spam} function described below. (Obviously that ++function is able to generate its own output.) ++ ++@noindent ++If the option @t{-e} is present, the line given as @var{cmd ...} is executed ++using @t{eval}, otherwise it is executed without any further processing. ++ ++@findex tcp_talk ++@item @t{tcp_talk} ++This is a fairly simple-minded attempt to force input to the line editor to ++go straight to the default TCP_SESSION. ++ ++@noindent ++An escape string, @t{$TCP_TALK_ESCAPE}, default `:', is used to allow ++access to normal shell operation. If it is on its own at the start of the ++line, or followed only by whitespace, the line editor returns to normal ++operation. Otherwise, the string and any following whitespace are skipped ++and the remainder of the line executed as shell input without any change of ++the line editor's operating mode. ++ ++@noindent ++The current implementation is somewhat deficient in terms of use of the ++command history. For this reason, many users will prefer to use some form ++of alternative approach for sending data easily to the current session. ++One simple approach is to alias some special character (such as `@t{%}') to ++`@t{tcp_command -}@t{-}'. ++ ++@findex tcp_wait ++@item @t{tcp_wait} ++The sole argument is an integer or floating point number which gives the ++seconds to delay. The shell will do nothing for that period except wait ++for input on all TCP sessions by calling @t{tcp_read -a}. This is similar ++to the interactive behaviour at the command prompt when zle handlers are ++installed. ++ ++@end table ++ ++@noindent ++ ++@subsection `One-shot' file transfer ++@noindent ++@table @asis ++@item @t{tcp_point} @var{port} ++@itemx @t{tcp_shoot} @var{host} @var{port} ++This pair of functions provide a simple way to transfer a file between ++two hosts within the shell. Note, however, that bulk data transfer is ++currently done using @t{cat}. @t{tcp_point} reads any data arriving at ++@var{port} and sends it to standard output; @t{tcp_shoot} connects to ++@var{port} on @var{host} and sends its standard input. Any unused @var{port} ++may be used; the standard mechanism for picking a port is to think of a ++random four-digit number above 1024 until one works. ++ ++@noindent ++To transfer a file from host @t{woodcock} to host @t{springes}, on ++@t{springes}: ++ ++@noindent ++@example ++tcp_point 8091 >output_file ++@end example ++ ++@noindent ++and on @t{woodcock}: ++ ++@noindent ++@example ++tcp_shoot springes 8091 zsh.report ++@end example ++ ++@noindent ++You should check the @t{zsh.report} file for any sensitive information ++such as passwords and delete them by hand before sending the script to the ++developers. Also, as the output can be voluminous, it's best to wait for ++the developers to ask for this information before sending it. ++ ++@noindent ++You can also use @t{reporter} to dump only a subset of the shell state. ++This is sometimes useful for creating startup files for the first time. ++Most of the output from reporter is far more detailed than usually is ++necessary for a startup file, but the @t{aliases}, @t{options}, and ++@t{zstyles} states may be useful because they include only changes from ++the defaults. The @t{bindings} state may be useful if you have created ++any of your own keymaps, because @t{reporter} arranges to dump the keymap ++creation commands as well as the bindings for every keymap. ++ ++@noindent ++As is usual with automated tools, if you create a startup file with ++@t{reporter}, you should edit the results to remove unnecessary commands. ++Note that if you're using the new completion system, you should @emph{not} ++dump the @t{functions} state to your startup files with @t{reporter}; use ++the @t{compdump} function instead (see ++@ref{Completion System}). ++ ++@noindent ++@table @asis ++@item @t{reporter} [ @var{state} ... ] ++@findex reporter ++Print to standard output the indicated subset of the current shell state. ++The @var{state} arguments may be one or more of: ++ ++@noindent ++@table @asis ++@item @t{all} ++Output everything listed below. ++@item @t{aliases} ++Output alias definitions. ++@item @t{bindings} ++Output ZLE key maps and bindings. ++@item @t{completion} ++Output old-style @t{compctl} commands. ++New completion is covered by @t{functions} and @t{zstyles}. ++@item @t{functions} ++Output autoloads and function definitions. ++@item @t{limits} ++Output @t{limit} commands. ++@item @t{options} ++Output @t{setopt} commands. ++@item @t{styles} ++Same as @t{zstyles}. ++@item @t{variables} ++Output shell parameter assignments, plus @t{export} ++commands for any environment variables. ++@item @t{zstyles} ++Output @t{zstyle} commands. ++@end table ++ ++@noindent ++If the @var{state} is omitted, @t{all} is assumed. ++ ++ ++@noindent ++With the exception of `@t{all}', every @var{state} can be abbreviated by ++any prefix, even a single letter; thus @t{a} is the same as @t{aliases}, ++@t{z} is the same as @t{zstyles}, etc. ++@end table ++ ++@noindent ++ ++@subsection Manipulating Hook Functions ++@noindent ++@cindex hook function utility ++ ++@noindent ++@table @asis ++@findex add-zsh-hook ++@item @t{add-zsh-hook} [-dD] @var{hook} @var{function} ++Several functions are special to the shell, as described in the section ++Special Functions, @ref{Functions}, ++in that they are automatic called at a specific point during shell execution. ++Each has an associated array consisting of names of functions to be ++called at the same point; these are so-called `hook functions'. ++The shell function @t{add-zsh-hook} provides a simple way of adding or ++removing functions from the array. ++ ++@noindent ++@var{hook} is one of @t{chpwd}, @t{periodic}, @t{precmd}, @t{preexec}, ++@t{zshaddhistory}, @t{zshexit}, or @t{zsh_directory_name}, ++the special functions in question. Note that @t{zsh_directory_name} ++is called in a different way from the other functions, but may ++still be manipulated as a hook. ++ ++@noindent ++@var{function} is name of an ordinary shell function. If no options ++are given this will be added to the array of functions to be executed ++in the given context. ++ ++@noindent ++If the option @t{-d} is given, the @var{function} is removed from ++the array of functions to be executed. ++ ++@noindent ++If the option @t{-D} is given, the @var{function} is treated as a pattern ++and any matching names of functions are removed from the array of ++functions to be executed. ++ ++@noindent ++The options @t{-U}, @t{-z} and @t{-k} are passed as arguments to ++@t{autoload} for @var{function}. For functions contributed with zsh, the ++options @t{-Uz} are appropriate. ++ ++@end table ++ ++@noindent ++@node Recent Directories, Version Control Information, Utilities, User Contributions ++@cindex recent directories, maintaining list of ++@cindex directories, maintaining list of recent ++@findex cdr ++@findex _cdr ++@findex chpwd_recent_add ++@findex chpwd_recent_dirs ++@findex chpwd_recent_filehandler ++ ++@section Remembering Recent Directories ++@noindent ++ ++@noindent ++The function @t{cdr} allows you to change the working directory to a ++previous working directory from a list maintained automatically. It is ++similar in concept to the directory stack controlled by the @t{pushd}, ++@t{popd} and @t{dirs} builtins, but is more configurable, and as it stores ++all entries in files it is maintained across sessions and (by default) ++between terminal emulators in the current session. (The @t{pushd} ++directory stack is not actually modified or used by @t{cdr} unless you ++configure it to do so as described in the configuration section below.) ++ ++@noindent ++ ++@subsection Installation ++@noindent ++ ++@noindent ++The system works by means of a hook function that is called every time the ++directory changes. To install the system, autoload the required functions ++and use the @t{add-zsh-hook} function described above: ++ ++@noindent ++@example ++autoload -Uz chpwd_recent_dirs cdr add-zsh-hook ++add-zsh-hook chpwd chpwd_recent_dirs ++@end example ++ ++@noindent ++Now every time you change directly interactively, no matter which ++command you use, the directory to which you change will be remembered ++in most-recent-first order. ++ ++@noindent ++ ++@subsection Use ++@noindent ++ ++@noindent ++All direct user interaction is via the @t{cdr} function. ++ ++@noindent ++The argument to cdr is a number @var{N} corresponding to the @var{N}th most ++recently changed-to directory. 1 is the immediately preceding directory; ++the current directory is remembered but is not offered as a destination. ++Note that if you have multiple windows open 1 may refer to a directory ++changed to in another window; you can avoid this by having per-terminal ++files for storing directory as described for the ++@t{recent-dirs-file} style below. ++ ++@noindent ++If you set the @t{recent-dirs-default} style described below @t{cdr} ++will behave the same as @t{cd} if given a non-numeric argument, or more ++than one argument. The recent directory list is updated just the same ++however you change directory. ++ ++@noindent ++If the argument is omitted, 1 is assumed. This is similar to @t{pushd}'s ++behaviour of swapping the two most recent directories on the stack. ++ ++@noindent ++Completion for the argument to @t{cdr} is available if compinit has been ++run; menu selection is recommended, using: ++ ++@noindent ++@example ++zstyle ':completion:*:*:cdr:*:*' menu selection ++@end example ++ ++@noindent ++to allow you to cycle through recent directories; the order is preserved, ++so the first choice is the most recent directory before the current one. ++The verbose style is also recommended to ensure the directory is shown; this ++style is on by default so no action is required unless you have changed it. ++ ++@noindent ++ ++@subsection Options ++@noindent ++ ++@noindent ++The behaviour of @t{cdr} may be modified by the following options. ++ ++@noindent ++@table @asis ++@item @t{-l} ++lists the numbers and the corresponding directories in ++abbreviated form (i.e. with @t{~} substitution reapplied), one per line. ++The directories here are not quoted (this would only be an issue if a ++directory name contained a newline). This is used by the completion ++system. ++ ++@item @t{-r} ++sets the variable @t{reply} to the current set of directories. Nothing ++is printed and the directory is not changed. ++ ++@item @t{-e} ++allows you to edit the list of directories, one per line. The ++list can be edited to any extent you like; no sanity checking is ++performed. Completion is available. No quoting is necessary (except for ++newlines, where I have in any case no sympathy); directories are in ++unabbreviated from and contain an absolute path, i.e. they start with @t{/}. ++Usually the first entry should be left as the current directory. ++ ++@end table ++ ++@noindent ++ ++@subsection Configuration ++@noindent ++ ++@noindent ++Configuration is by means of the styles mechanism that should be familiar ++from completion; if not, see the description of the @t{zstyle} command in ++@ref{The zsh/zutil Module}. The context for setting styles ++should be @t{':chpwd:*'} in case the meaning of the context is extended in ++future, for example: ++ ++@noindent ++@example ++zstyle ':chpwd:*' recent-dirs-max 0 ++@end example ++ ++@noindent ++sets the value of the @t{recent-dirs-max} style to 0. In practice the ++style name is specific enough that a context of '*' should be fine. ++ ++@noindent ++An exception is @t{recent-dirs-insert}, which is used exclusively by the ++completion system and so has the usual completion system context ++(@t{':completion:*'} if nothing more specific is needed), though again ++@t{'*'} should be fine in practice. ++ ++@noindent ++@table @asis ++@item @t{recent-dirs-default} ++If true, and the command is expecting a recent directory index, and ++either there is more than one argument or the argument is not an ++integer, then fall through to "cd". This allows the lazy to use only ++one command for directory changing. Completion recognises this, too; ++see recent-dirs-insert for how to control completion when this option ++is in use. ++ ++@item @t{recent-dirs-file} ++The file where the list of directories is saved. The default ++is @t{$@{ZDOTDIR:-$HOME@}/.chpwd-recent-dirs}, i.e. this is in your ++home directory unless you have set the variable @t{ZDOTDIR} to point ++somewhere else. Directory names are saved in @t{$'}@var{...}@t{'} quoted ++form, so each line in the file can be supplied directly to the shell as an ++argument. ++ ++@noindent ++The value of this style may be an array. In this case, the first ++file in the list will always be used for saving directories while any ++other files are left untouched. When reading the recent directory ++list, if there are fewer than the maximum number of entries in the ++first file, the contents of later files in the array will be appended ++with duplicates removed from the list shown. The contents of the two ++files are not sorted together, i.e. all the entries in the first file ++are shown first. The special value @t{+} can appear in the list to ++indicate the default file should be read at that point. This allows ++effects like the following: ++ ++@noindent ++@example ++zstyle ':chpwd:*' recent-dirs-file \ ++~/.chpwd-recent-dirs-$@{TTY##*/@} + ++@end example ++ ++@noindent ++Recent directories are read from a file numbered according to ++the terminal. If there are insufficient entries the list ++is supplemented from the default file. ++ ++@noindent ++It is possible to use @t{zstyle -e} to make the directory configurable ++at run time: ++ ++@noindent ++@example ++zstyle -e ':chpwd:*' recent-dirs-file pick-recent-dirs-file ++pick-recent-dirs-file() @{ ++ if [[ $PWD = ~/text/writing(|/*) ]]; then ++ reply=(~/.chpwd-recent-dirs-writing) ++ else ++ reply=(+) ++ fi ++@} ++@end example ++ ++@noindent ++In this example, if the current directory is @t{~/text/writing} or a ++directory under it, then use a special file for saving recent ++directories, else use the default. ++ ++@item @t{recent-dirs-insert} ++Used by completion. If @t{recent-dirs-default} is true, then setting ++this to @t{true} causes the actual directory, rather than its index, to ++be inserted on the command line; this has the same effect as using ++the corresponding index, but makes the history clearer and the line ++easier to edit. With this setting, if part of an argument was ++already typed, normal directory completion rather than recent ++directory completion is done; this is because recent directory ++completion is expected to be done by cycling through entries menu ++fashion. ++ ++@noindent ++If the value of the style is @t{always}, then only recent directories will ++be completed; in that case, use the @t{cd} command when you want to ++complete other directories. ++ ++@noindent ++If the value is @t{fallback}, recent directories will be tried first, then ++normal directory completion is performed if recent directory completion ++failed to find a match. ++ ++@noindent ++Finally, if the value is @t{both} then both sets of completions are ++presented; the usual tag mechanism can be used to distinguish results, with ++recent directories tagged as @t{recent-dirs}. Note that the recent ++directories inserted are abbreviated with directory names where appropriate. ++ ++@item @t{recent-dirs-max} ++The maximum number of directories to save to the file. If ++this is zero or negative there is no maximum. The default is 20. ++Note this includes the current directory, which isn't offered, ++so the highest number of directories you will be offered ++is one less than the maximum. ++ ++@item @t{recent-dirs-prune} ++This style is an array determining what directories should (or should ++not) be added to the recent list. Elements of the array can include: ++ ++@noindent ++@table @asis ++@item @t{parent} ++Prune parents (more accurately, ancestors) from the recent list. ++If present, changing directly down by any number of directories ++causes the current directory to be overwritten. For example, ++changing from ~pws to ~pws/some/other/dir causes ~pws not to be ++left on the recent directory stack. This only applies to direct ++changes to descendant directories; earlier directories on the ++list are not pruned. For example, changing from ~pws/yet/another ++to ~pws/some/other/dir does not cause ~pws to be pruned. ++ ++@item @t{pattern:@var{pattern}} ++Gives a zsh pattern for directories that should not be ++added to the recent list (if not already there). This element ++can be repeated to add different patterns. For example, ++@t{'pattern:/tmp(|/*)'} stops @t{/tmp} or its descendants ++from being added. The @t{EXTENDED_GLOB} option is always turned on ++for these patterns. ++ ++@end table ++ ++@item @t{recent-dirs-pushd} ++If set to true, @t{cdr} will use @t{pushd} instead of @t{cd} to change the ++directory, so the directory is saved on the directory stack. As the ++directory stack is completely separate from the list of files saved ++by the mechanism used in this file there is no obvious reason to do ++this. ++ ++@end table ++ ++@noindent ++ ++@subsection Use with dynamic directory naming ++@noindent ++ ++@noindent ++It is possible to refer to recent directories using the dynamic directory ++name syntax by using the supplied function @t{zsh_directory_name_cdr} ++a hook: ++ ++@noindent ++@example ++autoload -Uz add-zsh-hook ++add-zsh-hook -Uz zsh_directory_name zsh_directory_name_cdr ++@end example ++ ++@noindent ++When this is done, @t{~[1]} will refer to the most recent ++directory other than $PWD, and so on. Completion after @t{~[}@var{...} ++also works. ++ ++@noindent ++ ++@subsection Details of directory handling ++@noindent ++ ++@noindent ++This section is for the curious or confused; most users will not ++need to know this information. ++ ++@noindent ++Recent directories are saved to a file immediately and hence are ++preserved across sessions. Note currently no file locking is applied: ++the list is updated immediately on interactive commands and nowhere else ++(unlike history), and it is assumed you are only going to change ++directory in one window at once. This is not safe on shared accounts, ++but in any case the system has limited utility when someone else is ++changing to a different set of directories behind your back. ++ ++@noindent ++To make this a little safer, only directory changes instituted from the ++command line, either directly or indirectly through shell function calls ++(but not through subshells, evals, traps, completion functions and the ++like) are saved. Shell functions should use @t{cd -q} or @t{pushd -q} to ++avoid side effects if the change to the directory is to be invisible at the ++command line. See the contents of the function @t{chpwd_recent_dirs} for ++more details. ++ ++@noindent ++@node Version Control Information, Prompt Themes, Recent Directories, User Contributions ++ ++@section Gathering information from version control systems ++@noindent ++@cindex version control utility ++ ++@noindent ++In a lot of cases, it is nice to automatically retrieve information from ++version control systems (VCSs), such as subversion, CVS or git, to be able ++to provide it to the user; possibly in the user's prompt. So that you can ++instantly tell which branch you are currently on, for example. ++ ++@noindent ++In order to do that, you may use the @t{vcs_info} function. ++ ++@noindent ++The following VCSs are supported, showing the abbreviated name by which ++they are referred to within the system: ++@table @asis ++@item Bazaar (@t{bzr}) ++http://bazaar-vcs.org/ ++@item Codeville (@t{cdv}) ++http://codeville.org/ ++@item Concurrent Versioning System (@t{cvs}) ++http://www.nongnu.org/cvs/ ++@item Darcs (@t{darcs}) ++http://darcs.net/ ++@item Fossil (@t{fossil}) ++http://fossil-scm.org/ ++@item Git (@t{git}) ++http://git-scm.com/ ++@item GNU arch (@t{tla}) ++http://www.gnu.org/software/gnu-arch/ ++@item Mercurial (@t{hg}) ++http://mercurial.selenic.com/ ++@item Monotone (@t{mtn}) ++http://monotone.ca/ ++@item Perforce (@t{p4}) ++http://www.perforce.com/ ++@item Subversion (@t{svn}) ++http://subversion.tigris.org/ ++@item SVK (@t{svk}) ++http://svk.bestpractical.com/ ++@end table ++ ++@noindent ++There is also support for the patch management system @t{quilt} ++(http://savannah.nongnu.org/projects/quilt). See @t{Quilt Support} ++below for details. ++ ++@noindent ++To load @t{vcs_info}: ++ ++@noindent ++@example ++autoload -Uz vcs_info ++@end example ++ ++@noindent ++It can be used in any existing prompt, because it does not require any ++@t{$psvar} entries to be left available. ++ ++@noindent ++ ++@subsection Quickstart ++@noindent ++ ++@noindent ++To get this feature working quickly (including colors), you can do the ++following (assuming, you loaded @t{vcs_info} properly - see above): ++ ++@noindent ++@example ++zstyle ':vcs_info:*' actionformats \ ++ '%F@{5@}(%f%s%F@{5@})%F@{3@}-%F@{5@}[%F@{2@}%b%F@{3@}|%F@{1@}%a%F@{5@}]%f ' ++zstyle ':vcs_info:*' formats \ ++ '%F@{5@}(%f%s%F@{5@})%F@{3@}-%F@{5@}[%F@{2@}%b%F@{5@}]%f ' ++zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F@{1@}:%F@{3@}%r' ++precmd () @{ vcs_info @} ++PS1='%F@{5@}[%F@{2@}%n%F@{5@}] %F@{3@}%3~ $@{vcs_info_msg_0_@}%f%# ' ++@end example ++ ++@noindent ++Obviously, the last two lines are there for demonstration. You need to ++call @t{vcs_info} from your @t{precmd} function. Once that is done you need ++a @t{single quoted} @t{'$@{vcs_info_msg_0_@}'} in your prompt. ++ ++@noindent ++To be able to use @t{'$@{vcs_info_msg_0_@}'} directly in your prompt like ++this, you will need to have the @t{PROMPT_SUBST} option enabled. ++ ++@noindent ++Now call the @t{vcs_info_printsys} utility from the command line: ++ ++@noindent ++@example ++% vcs_info_printsys ++## list of supported version control backends: ++## disabled systems are prefixed by a hash sign (#) ++bzr ++cdv ++cvs ++darcs ++fossil ++git ++hg ++mtn ++p4 ++svk ++svn ++tla ++## flavours (cannot be used in the enable or disable styles; they ++## are enabled and disabled with their master [git-svn -> git]) ++## they *can* be used in contexts: ':vcs_info:git-svn:*'. ++git-p4 ++git-svn ++hg-git ++hg-hgsubversion ++hg-hgsvn ++@end example ++ ++@noindent ++You may not want all of these because there is no point in running the ++code to detect systems you do not use. So there is a way to disable ++some backends altogether: ++ ++@noindent ++@example ++zstyle ':vcs_info:*' disable bzr cdv darcs mtn svk tla ++@end example ++ ++@noindent ++You may also pick a few from that list and enable only those: ++ ++@noindent ++@example ++zstyle ':vcs_info:*' enable git cvs svn ++@end example ++ ++@noindent ++If you rerun @t{vcs_info_printsys} after one of these commands, you will ++see the backends listed in the @t{disable} style (or backends not in the ++@t{enable} style - if you used that) marked as disabled by a hash sign. ++That means the detection of these systems is skipped @emph{completely}. No ++wasted time there. ++ ++@noindent ++ ++@subsection Configuration ++@noindent ++ ++@noindent ++The @t{vcs_info} feature can be configured via @t{zstyle}. ++ ++@noindent ++First, the context in which we are working: ++@example ++:vcs_info:@var{vcs-string}:@var{user-context}:@var{repo-root-name} ++@end example ++ ++@noindent ++@table @asis ++@item @var{vcs-string} ++is one of: @cite{git}, @cite{git-svn}, @cite{git-p4}, @cite{hg}, @cite{hg-git}, ++@cite{hg-hgsubversion}, @cite{hg-hgsvn}, @cite{darcs}, @cite{bzr}, @cite{cdv}, @cite{mtn}, ++@cite{svn}, @cite{cvs}, @cite{svk}, @cite{tla}, @cite{p4} or @cite{fossil}. When hooks are ++active the hooks name is added after a `+'. (See @cite{Hooks in vcs_info} ++below.) ++ ++@item @var{user-context} ++is a freely configurable string, assignable by ++the user as the first argument to @t{vcs_info} (see its description ++below). ++ ++@item @var{repo-root-name} ++is the name of a repository in which you want a ++style to match. So, if you want a setting specific to @t{/usr/src/zsh}, ++with that being a CVS checkout, you can set @var{repo-root-name} to ++@t{zsh} to make it so. ++ ++@end table ++ ++@noindent ++There are three special values for @var{vcs-string}: The first is named ++@t{-init-}, that is in effect as long as there was no decision what VCS ++backend to use. The second is @t{-preinit-}; it is used @emph{before} ++@t{vcs_info} is run, when initializing the data exporting variables. The ++third special value is @t{formats} and is used by the @t{vcs_info_lastmsg} ++for looking up its styles. ++ ++@noindent ++The initial value of @var{repo-root-name} is @t{-all-} and it is replaced ++with the actual name, as soon as it is known. Only use this part of the ++context for defining the @t{formats}, @t{actionformats} or ++@t{branchformat} styles, as it is guaranteed that @var{repo-root-name} is ++set up correctly for these only. For all other styles, just use @t{'*'} ++instead. ++ ++@noindent ++There are two pre-defined values for @var{user-context}: ++@table @asis ++@item @t{default} ++the one used if none is specified ++@item @t{command} ++used by vcs_info_lastmsg to lookup its styles ++@end table ++ ++@noindent ++You can of course use @t{':vcs_info:*'} to match all VCSs in all ++user-contexts at once. ++ ++@noindent ++This is a description of all styles that are looked up. ++ ++@noindent ++@table @asis ++@kindex formats ++@item @t{formats} ++A list of formats, used when actionformats is not used ++(which is most of the time). ++ ++@kindex actionformats ++@item @t{actionformats} ++A list of formats, used if there is a special ++action going on in your current repository; like an interactive rebase or ++a merge conflict. ++ ++@kindex branchformat ++@item @t{branchformat} ++Some backends replace @t{%b} in the formats and ++actionformats styles above, not only by a branch name but also by a ++revision number. This style lets you modify how that string should look. ++ ++@kindex nvcsformats ++@item @t{nvcsformats} ++These "formats" are exported when we didn't detect a version control system ++for the current directory or @t{vcs_info} was disabled. This is useful if ++you want @t{vcs_info} to completely take over the generation of your ++prompt. You would do something like @t{PS1='$@{vcs_info_msg_0_@}'} to ++accomplish that. ++ ++@kindex hgrevformat ++@item @t{hgrevformat} ++@t{hg} uses both a hash and a revision number to reference a specific ++changeset in a repository. With this style you can format the revision ++string (see @t{branchformat}) to include either or both. It's only ++useful when @t{get-revision} is true. ++ ++@kindex max-exports ++@item @t{max-exports} ++Defines the maximum number of ++@t{vcs_info_msg_*_} variables @t{vcs_info} will export. ++ ++@kindex enable ++@item @t{enable} ++A list of backends you want to use. Checked in the @t{-init-} context. If ++this list contains an item called @t{NONE} no backend is used at all and ++@t{vcs_info} will do nothing. If this list contains @t{ALL}, @t{vcs_info} ++will use all known backends. Only with @t{ALL} in @t{enable} will the ++@t{disable} style have any effect. @t{ALL} and @t{NONE} are case insensitive. ++ ++@kindex disable ++@item @t{disable} ++A list of VCSs you don't want @t{vcs_info} to test for ++repositories (checked in the @t{-init-} context, too). Only used if ++@t{enable} contains @t{ALL}. ++ ++@kindex disable-patterns ++@item @t{disable-patterns} ++A list of patterns that are checked against @t{$PWD}. If a pattern ++matches, @t{vcs_info} will be disabled. This style is checked in the ++@t{:vcs_info:-init-:*:-all-} context. ++ ++@noindent ++Say, @t{~/.zsh} is a directory under version control, in which you do ++not want @t{vcs_info} to be active, do: ++@example ++zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh(|/*)" ++@end example ++ ++@kindex use-quilt ++@item @t{use-quilt} ++If enabled, the @t{quilt} support code is active in `addon' mode. ++See @t{Quilt Support} for details. ++ ++@kindex quilt-standalone ++@item @t{quilt-standalone} ++If enabled, `standalone' mode detection is attempted if no VCS is active ++in a given directory. See @t{Quilt Support} for details. ++ ++@kindex quilt-patch-dir ++@item @t{quilt-patch-dir} ++Overwrite the value of the @t{$QUILT_PATCHES} environment variable. See ++@t{Quilt Support} for details. ++ ++@kindex quiltcommand ++@item @t{quiltcommand} ++When @t{quilt} itself is called in quilt support the value of this style ++is used as the command name. ++ ++@kindex check-for-changes ++@item @t{check-for-changes} ++If enabled, this style causes the @t{%c} and @t{%u} format escapes to show ++when the working directory has uncommitted changes. The strings displayed by ++these escapes can be controlled via the @t{stagedstr} and @t{unstagedstr} ++styles. The only backends that currently support this option are @t{git} and ++@t{hg} (@t{hg} only supports unstaged). ++ ++@noindent ++For this style to be evaluated with the @t{hg} backend, the @t{get-revision} ++style needs to be set and the @t{use-simple} style needs to be unset. The ++latter is the default; the former is not. ++ ++@noindent ++Note, the actions taken if this style is enabled are potentially expensive ++(read: they may be slow, depending on how big the current repository is). ++Therefore, it is disabled by default. ++ ++@kindex stagedstr ++@item @t{stagedstr} ++This string will be used in the @t{%c} escape if there are staged changes in ++the repository. ++ ++@kindex unstagedstr ++@item @t{unstagedstr} ++This string will be used in the @t{%u} escape if there are unstaged changes ++in the repository. ++ ++@kindex command ++@item @t{command} ++This style causes @t{vcs_info} to use the supplied string as the command ++to use as the VCS's binary. Note, that setting this in ':vcs_info:*' is ++not a good idea. ++ ++@noindent ++If the value of this style is empty (which is the default), the used binary ++name is the name of the backend in use (e.g. @t{svn} is used in an @t{svn} ++repository). ++ ++@noindent ++The @t{repo-root-name} part in the context is always the default @t{-all-} ++when this style is looked up. ++ ++@noindent ++For example, this style can be used to use binaries from non-default ++installation directories. Assume, @t{git} is installed in /usr/bin but ++your sysadmin installed a newer version in /usr/bin/local. Instead of ++changing the order of your @t{$PATH} parameter, you can do this: ++@example ++zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git ++@end example ++ ++@kindex use-server ++@item @t{use-server} ++This is used by the Perforce backend (@t{p4}) to decide if it should ++contact the Perforce server to find out if a directory is managed ++by Perforce. This is the only reliable way of doing this, but runs ++the risk of a delay if the server name cannot be found. If the ++server (more specifically, the @t{host}@t{:}@t{port} pair describing the ++server) cannot be contacted, its name is put into the associative array ++@t{vcs_info_p4_dead_servers} and is not contacted again during the session ++until it is removed by hand. If you do not set this style, the @t{p4} ++backend is only usable if you have set the environment variable ++@t{P4CONFIG} to a file name and have corresponding files in the root ++directories of each Perforce client. See comments in the function ++@t{VCS_INFO_detect_p4} for more detail. ++ ++@kindex use-simple ++@item @t{use-simple} ++If there are two different ways of gathering ++information, you can select the simpler one by setting this style to true; ++the default is to use the not-that-simple code, which is potentially a lot ++slower but might be more accurate in all possible cases. This style is ++used by the @t{bzr} and @t{hg} backends. In the case of @t{hg} it will invoke ++the external hexdump program to parse the binary dirstate cache file; this ++method will not return the local revision number. ++ ++@kindex get-revision ++@item @t{get-revision} ++If set to true, vcs_info goes the extra mile to figure out the revision of ++a repository's work tree (currently for the @t{git} and @t{hg} backends, ++where this kind of information is not always vital). For @t{git}, the ++hash value of the currently checked out commit is available via the @t{%i} ++expansion. With @t{hg}, the local revision number and the corresponding ++global hash are available via @t{%i}. ++ ++@kindex get-mq ++@item @t{get-mq} ++If set to true, the @t{hg} backend will look for a Mercurial Queue (@t{mq}) ++patch directory. Information will be available via the `@t{%m}' replacement. ++ ++@kindex get-bookmarks ++@item @t{get-bookmarks} ++If set to true, the @t{hg} backend will try to get a list of current ++bookmarks. They will be available via the `@t{%m}' replacement. ++ ++@kindex use-prompt-escapes ++@item @t{use-prompt-escapes} ++Determines if we assume that the assembled ++string from @t{vcs_info} includes prompt escapes. (Used by ++@t{vcs_info_lastmsg}.) ++ ++@kindex debug ++@item @t{debug} ++Enable debugging output to track possible problems. Currently this style ++is only used by @t{vcs_info}'s hooks system. ++ ++@kindex hooks ++@item @t{hooks} ++A list style that defines hook-function names. See @cite{Hooks in vcs_info} ++below for details. ++ ++@end table ++ ++@noindent ++The default values for these styles in all contexts are: ++ ++@noindent ++@table @asis ++@item @t{formats} ++" (%s)-[%b]%u%c-" ++@item @t{actionformats} ++" (%s)-[%b|%a]%u%c-" ++@item @t{branchformat} ++"%b:%r" (for bzr, svn, svk and hg) ++@item @t{nvcsformats} ++"" ++@item @t{hgrevformat} ++"%r:%h" ++@item @t{max-exports} ++2 ++@item @t{enable} ++ALL ++@item @t{disable} ++(empty list) ++@item @t{disable-patterns} ++(empty list) ++@item @t{check-for-changes} ++false ++@item @t{stagedstr} ++(string: "S") ++@item @t{unstagedstr} ++(string: "U") ++@item @t{command} ++(empty string) ++@item @t{use-server} ++false ++@item @t{use-simple} ++false ++@item @t{get-revision} ++false ++@item @t{get-mq} ++true ++@item @t{get-bookmarks} ++false ++@item @t{use-prompt-escapes} ++true ++@item @t{debug} ++false ++@item @t{hooks} ++(empty list) ++@item @t{use-quilt} ++false ++@item @t{quilt-standalone} ++false ++@item @t{quilt-patch-dir} ++empty - use @t{$QUILT_PATCHES} ++@item @t{quiltcommand} ++quilt ++@end table ++ ++@noindent ++In normal @t{formats} and @t{actionformats} the following replacements are ++done: ++ ++@noindent ++@table @asis ++@item @t{%s} ++The VCS in use (git, hg, svn, etc.). ++@item @t{%b} ++Information about the current branch. ++@item @t{%a} ++An identifier that describes the action. Only makes sense in ++@t{actionformats}. ++@item @t{%i} ++The current revision number or identifier. For @t{hg} ++the @t{hgrevformat} style may be used to customize the output. ++@item @t{%c} ++The string from the @t{stagedstr} style if there are staged ++changes in the repository. ++@item @t{%u} ++The string from the @t{unstagedstr} style if there are ++unstaged changes in the repository. ++@item @t{%R} ++The base directory of the repository. ++@item @t{%r} ++The repository name. If @t{%R} is @t{/foo/bar/repoXY}, @t{%r} ++is @t{repoXY}. ++@item @t{%S} ++A subdirectory within a repository. If @t{$PWD} is ++@t{/foo/bar/repoXY/beer/tasty}, @t{%S} is @t{beer/tasty}. ++@item @t{%m} ++A "misc" replacement. It is at the discretion of the backend to ++decide what this replacement expands to. It is currently used by the @t{hg} ++and @t{git} backends to display patch information from the @t{mq} and ++@t{stgit} extensions. ++@end table ++ ++@noindent ++In @t{branchformat} these replacements are done: ++ ++@noindent ++@table @asis ++@item @t{%b} ++The branch name. ++@item @t{%r} ++The current revision number or the @t{hgrevformat} style for ++@t{hg}. ++@end table ++ ++@noindent ++In @t{hgrevformat} these replacements are done: ++ ++@noindent ++@table @asis ++@item @t{%r} ++The current local revision number. ++@item @t{%h} ++The current 40-character changeset ID hash identifier. ++@end table ++ ++@noindent ++In @t{patch-format} and @t{nopatch-format} these replacements are done: ++ ++@noindent ++@table @asis ++@item @t{%p} ++The name of the top-most applied patch. ++@item @t{%u} ++The number of unapplied patches. ++@item @t{%n} ++The number of applied patches. ++@item @t{%c} ++The number of unapplied patches. ++@item @t{%g} ++The names of active @t{mq} guards (@t{hg} backend). ++@item @t{%G} ++The number of active @t{mq} guards (@t{hg} backend). ++@end table ++ ++@noindent ++Not all VCS backends have to support all replacements. For @t{nvcsformats} ++no replacements are performed at all, it is just a string. ++ ++@noindent ++ ++@subsection Oddities ++@noindent ++ ++@noindent ++If you want to use the @t{%b} (bold off) prompt expansion in @t{formats}, ++which expands @t{%b} itself, use @t{%%b}. That will cause the @t{vcs_info} ++expansion to replace @t{%%b} with @t{%b}, so that zsh's prompt expansion ++mechanism can handle it. Similarly, to hand down @t{%b} from ++@t{branchformat}, use @t{%%%%b}. Sorry for this inconvenience, but it ++cannot be easily avoided. Luckily we do not clash with a lot of prompt ++expansions and this only needs to be done for those. ++ ++@noindent ++ ++@subsection Quilt Support ++@noindent ++ ++@noindent ++@cite{Quilt} is not a version control system, therefore this is not implemented ++as a backend. It can help keeping track of a series of patches. People use it ++to keep a set of changes they want to use on top of software packages (which ++is tightly integrated into the package build process - the Debian project ++does this for a large number of packages). Quilt can also help individual ++developers keep track of their own patches on top of real version control ++systems. ++ ++@noindent ++The @t{vcs_info} integration tries to support both ways of using quilt by ++having two slightly different modes of operation: `addon' mode and ++`standalone' mode). ++ ++@noindent ++For `addon' mode to become active @t{vcs_info} must have already detected a ++real version control system controlling the directory. If that is the case, ++a directory that holds quilt's patches needs to be found. That directory is ++configurable via the `@t{QUILT_PATCHES}' environment variable. If that ++variable exists its value is used, otherwise the value `@t{patches}' is ++assumed. The value from @t{$QUILT_PATCHES} can be overwritten using the ++@t{`quilt-patches'} style. (Note: you can use @t{vcs_info} to keep the value ++of @t{$QUILT_PATCHES} correct all the time via the @t{post-quilt} hook). ++ ++@noindent ++When the directory in question is found, quilt is assumed to be active. To ++gather more information, @t{vcs_info} looks for a directory called `.pc'; ++Quilt uses that directory to track its current state. If this directory does ++not exist we know that quilt has not done anything to the working directory ++(read: no patches have been applied yet). ++ ++@noindent ++If patches are applied, @t{vcs_info} will try to find out which. If you want ++to know which patches of a series are not yet applied, you need to activate ++the @t{get-unapplied} style in the appropriate context. ++ ++@noindent ++@t{vcs_info} allows for very detailed control over how the gathered ++information is presented (see the below sections, @cite{Styles} and @cite{Hooks in ++vcs_info}), all of which are documented below. Note there are a number of ++other patch tracking systems that work on top of a certain version control ++system (like @t{stgit} for @cite{git}, or @t{mq} for @cite{hg}); the configuration ++for systems like that are generally configured the same way as the @cite{quilt} ++support. ++ ++@noindent ++If the @cite{quilt} support is working in `addon' mode, the produced string is ++available as a simple format replacement (@t{%Q} to be precise), which can ++be used in @t{formats} and @t{actionformats}; see below for details). ++ ++@noindent ++If, on the other hand, the support code is working in `standalone' mode, ++@t{vcs_info} will pretend as if @t{quilt} were an actual version control ++system. That means that the version control system identifier (which ++otherwise would be something like `svn' or `cvs') will be set to ++`@t{-quilt-}'. This has implications on the used style context where this ++identifier is the second element. @t{vcs_info} will have filled in a proper ++value for the "repository's" root directory and the string containing the ++information about quilt's state will be available as the `misc' replacement ++(and @t{%Q} for compatibility with `addon' mode. ++ ++@noindent ++What is left to discuss is how `standalone' mode is detected. The detection ++itself is a series of searches for directories. You can have this detection ++enabled all the time in every directory that is not otherwise under version ++control. If you know there is only a limited set of trees where you would ++like @t{vcs_info} to try and look for Quilt in `standalone' mode to minimise ++the amount of searching on every call to @t{vcs_info}, there are a number of ++ways to do that: ++ ++@noindent ++Essentially, `standalone' mode detection is controlled by a style called ++`@t{quilt-standalone}'. It is a string style and its value can have different ++effects. The simplest values are: `@t{always}' to run detection every time ++@t{vcs_info} is run, and `@t{never}' to turn the detection off entirely. ++ ++@noindent ++If the value of @t{quilt-standalone} is something else, it is interpreted ++differently. If the value is the name of a scalar variable the value of that ++variable is checked and that value is used in the same `always'/`never' way ++as described above. ++ ++@noindent ++If the value of @t{quilt-standalone} is an array, the elements of that array ++are used as directory names under which you want the detection to be active. ++ ++@noindent ++If @t{quilt-standalone} is an associative array, the keys are taken as ++directory names under which you want the detection to be active, but only if ++the corresponding value is the string `@t{true}'. ++ ++@noindent ++Last, but not least, if the value of @t{quilt-standalone} is the name of a ++function, the function is called without arguments and the return value ++decides whether detection should be active. A `0' return value is true; a ++non-zero return value is interpreted as false. ++ ++@noindent ++Note, if there is both a function and a variable by the name of ++@t{quilt-standalone}, the function will take precedence. ++ ++@noindent ++ ++@subsection Function Descriptions (Public API) ++@noindent ++ ++@noindent ++@table @asis ++@findex vcs_info ++@item @t{vcs_info} [@var{user-context}] ++The main function, that runs all backends and assembles all data into ++@t{$@{vcs_info_msg_*_@}}. This is the function you want to call from ++@t{precmd} if you want to include up-to-date information in your prompt (see ++@t{Variable description} below). If an argument is given, that string will be ++used instead of @t{default} in the @var{user-context} field of the style ++context. ++ ++@findex vcs_info_hookadd ++@item @t{vcs_info_hookadd} ++Statically registers a number of functions to a given hook. The hook needs ++to be given as the first argument; what follows is a list of hook-function ++names to register to the hook. The `@t{+vi-}' prefix needs to be left out ++here. See @cite{Hooks in vcs_info} below for details. ++ ++@findex vcs_info_hookdel ++@item @t{vcs_info_hookdel} ++Remove hook-functions from a given hook. The hook needs to be given as the ++first non-option argument; what follows is a list of hook-function ++names to un-register from the hook. If `@t{-a}' is used as the first ++argument, @t{all} occurances of the functions are unregistered. Otherwise ++only the last occurance is removed (if a function was registered to a hook ++more than once) . The `@t{+vi-}' prefix needs to be left out here. See ++@cite{Hooks in vcs_info} below for details. ++ ++@findex vcs_info_lastmsg ++@item @t{vcs_info_lastmsg} ++Outputs the last @t{$@{vcs_info_msg_*_@}} value. ++Takes into account the value of the @t{use-prompt-escapes} style in ++@t{':vcs_info:formats:command:-all-'}. It also only prints @t{max-exports} ++values. ++ ++@findex vcs_info_printsys ++@item @t{vcs_info_printsys} [@var{user-context}] ++Prints a list of all ++supported version control systems. Useful to find out possible contexts ++(and which of them are enabled) or values for the @t{disable} style. ++ ++@findex vcs_info_setsys ++@item @t{vcs_info_setsys} ++Initializes @t{vcs_info}'s internal list of ++available backends. With this function, you can add support for new VCSs ++without restarting the shell. ++ ++@end table ++ ++@noindent ++All functions named VCS_INFO_* are for internal use only. ++ ++@noindent ++ ++@subsection Variable Description ++@noindent ++ ++@noindent ++@table @asis ++@item @t{$@{vcs_info_msg_}@var{N}@t{_@}} (Note the trailing underscore) ++Where @var{N} is an integer, e.g., @t{vcs_info_msg_0_}. These variables ++are the storage for the informational message the last @t{vcs_info} call ++has assembled. These are strongly connected to the @t{formats}, ++@t{actionformats} and @t{nvcsformats} styles described above. Those styles ++are lists. The first member of that list gets expanded into ++@t{$@{vcs_info_msg_0_@}}, the second into @t{$@{vcs_info_msg_1_@}} ++and the Nth into @t{$@{vcs_info_msg_N-1_@}}. These parameters are ++exported into the environment. (See the @t{max-exports} style above.) ++ ++@end table ++ ++@noindent ++All variables named VCS_INFO_* are for internal use only. ++ ++@noindent ++ ++@subsection Hooks in vcs_info ++@noindent ++ ++@noindent ++Hooks are places in @t{vcs_info} where you can run your own code. That ++code can communicate with the code that called it and through that, ++change the system's behaviour. ++ ++@noindent ++For configuration, hooks change the style context: ++@example ++:vcs_info:@var{vcs-string}+@var{hook-name}:@var{user-context}:@var{repo-root-name} ++@end example ++ ++@noindent ++To register functions to a hook, you need to list them in the @t{hooks} ++style in the appropriate context. ++ ++@noindent ++Example: ++@example ++zstyle ':vcs_info:*+foo:*' hooks bar baz ++@end example ++ ++@noindent ++This registers functions to the hook `foo' for all backends. In order to ++avoid namespace problems, all registered function names are prepended by ++a `+vi-', so the actual functions called for the `foo' hook are ++`@t{+vi-bar}' and `@t{+vi-baz}'. ++ ++@noindent ++If you would like to register a function to a hook regardless of the ++current context, you may use the @t{vcs_info_hookadd} function. To remove ++a function that was added like that, the @t{vcs_info_hookdel} function ++can be used. ++ ++@noindent ++If something seems weird, you can enable the `debug' boolean style in ++the proper context and the hook-calling code will print what it tried ++to execute and whether the function in question existed. ++ ++@noindent ++When you register more than one function to a hook, all functions are ++executed one after another until one function returns non-zero or until ++all functions have been called. Context-sensitive hook functions are ++executed @t{before} statically registered ones (the ones added by ++@t{vcs_info_hookadd}). ++ ++@noindent ++You may pass data between functions via an associative array, @t{user_data}. ++For example: ++@example ++ +++vi-git-myfirsthook()@{ ++ user_data[myval]=$myval ++@} +++vi-git-mysecondhook()@{ ++ # do something with $@{user_data[myval]@} ++@} ++@end example ++ ++@noindent ++There are a number of variables that are special in hook contexts: ++ ++@noindent ++@table @asis ++@item @t{ret} ++The return value that the hooks system will return to the caller. The ++default is an integer `zero'. If and how a changed @t{ret} value changes ++the execution of the caller depends on the specific hook. See the hook ++documentation below for details. ++ ++@item @t{hook_com} ++An associated array which is used for bidirectional communication from ++the caller to hook functions. The used keys depend on the specific hook. ++ ++@item @t{context} ++The active context of the hook. Functions that wish to change this ++variable should make it local scope first. ++ ++@item @t{vcs} ++The current VCS after it was detected. The same values as in the ++enable/disable style are used. Available in all hooks except @t{start-up}. ++ ++@end table ++ ++@noindent ++Finally, the full list of currently available hooks: ++ ++@noindent ++@table @asis ++@item @t{start-up} ++Called after starting @t{vcs_info} but before the VCS in this directory is ++determined. It can be used to deactivate @t{vcs_info} temporarily if ++necessary. When @t{ret} is set to @t{1}, @t{vcs_info} aborts and does ++nothing; when set to @t{2}, @t{vcs_info} sets up everything as if no ++version control were active and exits. ++ ++@item @t{pre-get-data} ++Same as @t{start-up} but after the VCS was detected. ++ ++@item @t{gen-hg-bookmark-string} ++Called in the Mercurial backend when a bookmark string is generated; the ++@t{get-revision} and @t{get-bookmarks} styles must be true. ++ ++@noindent ++This hook gets the names of the Mercurial bookmarks that ++@t{vcs_info} collected from `hg'. ++ ++@noindent ++When setting @t{ret} to non-zero, the string in ++@t{$@{hook_com[hg-bookmark-string]@}} will be used in the @t{%m} escape in ++@t{formats} and @t{actionformats} and will be availabe in the global ++@t{backend_misc} array as @t{$@{backend_misc[bookmarks]@}}. ++ ++@item @t{gen-applied-string} ++Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backends ++and in @t{quilt} support when the @t{applied-string} is generated; the ++@t{use-quilt} zstyle must be true for @t{quilt} (the @t{mq} and @t{stgit} ++backends are active by default). ++ ++@noindent ++This hook gets the names of all applied patches which @t{vcs_info} collected ++so far in the opposite order, which means that the first argument is the ++top-most patch and so forth. ++ ++@noindent ++When setting @t{ret} to non-zero, the string in ++@t{$@{hook_com[applied-string]@}} will be used in the @t{%m} escape in ++@t{formats} and @t{actionformats}; it will be available in the global ++@t{backend_misc} array as @t{$backend_misc[patches]@}}; and it will be ++available as @t{%p} in the @t{patch-format} and @t{nopatch-format} styles. ++ ++@item @t{gen-unapplied-string} ++Called in the @t{git} (with @t{stgit}), and @t{hg} (with @t{mq}) backend ++and in @t{quilt} support when the @t{unapplied-string} is generated; the ++@t{get-unapplied} style must be true. ++ ++@noindent ++This hook gets the names of all unapplied patches which @t{vcs_info} ++collected so far in the opposite order, which mean that the first argument is ++the patch next-in-line to be applied and so forth. ++ ++@noindent ++When setting @t{ret} to non-zero, the string in ++@t{$@{hook_com[unapplied-string]@}} will be available as @t{%u} in the ++@t{patch-format} and @t{nopatch-format} styles. ++ ++@item @t{gen-mqguards-string} ++Called in the @t{hg} backend when @t{guards-string} is generated; the ++@t{get-mq} style must be true (default). ++ ++@noindent ++This hook gets the names of any active @t{mq} guards. ++ ++@noindent ++When setting @t{ret} to non-zero, the string in ++@t{$@{hook_com[guards-string]@}} will be used in the @t{%g} escape in the ++@t{patch-format} and @t{nopatch-format} styles. ++ ++@item @t{no-vcs} ++This hooks is called when no version control system was detected. ++ ++@noindent ++The `hook_com' parameter is not used. ++ ++@item @t{post-quilt} ++Called after the @t{quilt} support is done. The following information ++is passed as arguments to the hook: 1. the quilt-support mode (`addon' or ++`standalone'); 2. the directory that contains the patch series; 3. the ++directory that holds quilt's status information (the `.pc' directory) or ++the string @t{"-nopc-"} if that directory wasn't found. ++ ++@noindent ++The `hook_com' parameter is not used. ++ ++@item @t{set-branch-format} ++Called before `@t{branchformat}' is set. The only argument to the ++hook is the format that is configured at this point. ++ ++@noindent ++The `@t{hook_com}' keys considered are `@t{branch}' and `@t{revision}'. ++They are set to the values figured out so far by @t{vcs_info} and any ++change will be used directly when the actual replacement is done. ++ ++@noindent ++If @t{ret} is set to non-zero, the string in ++@t{$@{hook_com[branch-replace]@}} will be used unchanged as the ++`@t{%b}' replacement in the variables set by @t{vcs_info}. ++ ++@item @t{set-hgrev-format} ++Called before a `@t{hgrevformat}' is set. The only argument to the ++hook is the format that is configured at this point. ++ ++@noindent ++The `@t{hook_com}' keys considered are `@t{hash}' and `@t{localrev}'. ++They are set to the values figured out so far by @t{vcs_info} and any ++change will be used directly when the actual replacement is done. ++ ++@noindent ++If @t{ret} is set to non-zero, the string in ++@t{$@{hook_com[rev-replace]@}} will be used unchanged as the ++`@t{%i}' replacement in the variables set by @t{vcs_info}. ++ ++@item @t{set-message} ++Called each time before a `@t{vcs_info_msg_N_}' message is set. ++It takes two arguments; the first being the `N' in the message ++variable name, the second is the currently configured @t{formats} or ++@t{actionformats}. ++ ++@noindent ++There are a number of `@t{hook_com}' keys, that are used here: ++`@t{action}', `@t{branch}', `@t{base}', `@t{base-name}', `@t{subdir}', ++`@t{staged}', `@t{unstaged}', `@t{revision}', `@t{misc}', `@t{vcs}' ++and one `@t{miscN}' entry for each backend-specific data field (@t{N} ++starting at zero). They are set to the values figured out so far by ++@t{vcs_info} and any change will be used directly when the actual ++replacement is done. ++ ++@noindent ++Since this hook is triggered multiple times (once for each configured ++@t{formats} or @t{actionformats}), each of the `@t{hook_com}' keys mentioned ++above (except for the @t{miscN} entries) has an `@t{_orig}' counterpart, ++so even if you changed a value to your liking you can still get the ++original value in the next run. Changing the `@t{_orig}' values is ++probably not a good idea. ++ ++@noindent ++If @t{ret} is set to non-zero, the string in ++@t{$@{hook_com[message]@}} will be used unchanged as the message by ++@t{vcs_info}. ++ ++@end table ++ ++@noindent ++If all of this sounds rather confusing, take a look at the @t{Examples} ++section below and also in the Misc/vcs_info-examples file in the Zsh source. ++They contain some explanatory code. ++ ++@noindent ++ ++@subsection Examples ++@noindent ++ ++@noindent ++Don't use @t{vcs_info} at all (even though it's in your prompt): ++@example ++zstyle ':vcs_info:*' enable NONE ++@end example ++ ++@noindent ++Disable the backends for @t{bzr} and @t{svk}: ++@example ++zstyle ':vcs_info:*' disable bzr svk ++@end example ++ ++@noindent ++Disable everything @emph{but} @t{bzr} and @t{svk}: ++@example ++zstyle ':vcs_info:*' enable bzr svk ++@end example ++ ++@noindent ++Provide a special formats for @t{git}: ++@example ++zstyle ':vcs_info:git:*' formats ' GIT, BABY! [%b]' ++zstyle ':vcs_info:git:*' actionformats ' GIT ACTION! [%b|%a]' ++@end example ++ ++@noindent ++All @t{%x} expansion in all sorts of formats ("formats", "actionformats", ++branchformat, you name it) are done using the `@t{zformat}' builtin from ++the `@t{zsh/zutil}' module. That means you can do everything with these ++@t{%x} items what zformat supports. In particular, if you want something ++that is really long to have a fixed width, like a hash in a mercurial ++branchformat, you can do this: @t{%12.12i}. That'll shrink the 40 character ++hash to its 12 leading characters. The form is actually ++`@t{%}@var{min}@t{.}@var{max}@t{x}'. More is possible. ++See @ref{The zsh/zutil Module} for details. ++ ++@noindent ++Use the quicker @t{bzr} backend ++@example ++zstyle ':vcs_info:bzr:*' use-simple true ++@end example ++ ++@noindent ++If you do use @t{use-simple}, please report if it does `the-right-thing[tm]'. ++ ++@noindent ++Display the revision number in yellow for @t{bzr} and @t{svn}: ++@example ++zstyle ':vcs_info:(svn|bzr):*' branchformat '%b%@{'$@{fg[yellow]@}'%@}:%r' ++@end example ++ ++@noindent ++If you want colors, make sure you enclose the color codes in @t{%@{...%@}} ++if you want to use the string provided by @t{vcs_info} in prompts. ++ ++@noindent ++Here is how to print the VCS information as a command (not in a prompt): ++@example ++alias vcsi='vcs_info command; vcs_info_lastmsg' ++@end example ++ ++@noindent ++This way, you can even define different formats for output via ++@t{vcs_info_lastmsg} in the ':vcs_info:*:command:*' namespace. ++ ++@noindent ++Now as promised, some code that uses hooks: ++say, you'd like to replace the string `svn' by `subversion' in ++@t{vcs_info}'s @t{%s} @t{formats} replacement. ++ ++@noindent ++First, we will tell @t{vcs_info} to call a function when populating ++the message variables with the gathered information: ++@example ++zstyle ':vcs_info:*+set-message:*' hooks svn2subversion ++@end example ++ ++@noindent ++Nothing happens. Which is reasonable, since we didn't define the actual ++function yet. To see what the hooks subsystem is trying to do, enable the ++`@t{debug}' style: ++@example ++zstyle ':vcs_info:*+*:*' debug true ++@end example ++ ++@noindent ++That should give you an idea what is going on. Specifically, the function ++that we are looking for is `@t{+vi-svn2subversion}'. Note, the `@t{+vi-}' ++prefix. So, everything is in order, just as documented. When you are done ++checking out the debugging output, disable it again: ++@example ++zstyle ':vcs_info:*+*:*' debug false ++@end example ++ ++@noindent ++Now, let's define the function: ++@example ++ ++function +vi-svn2subversion() @{ ++ [[ $@{hook_com[vcs_orig]@} == svn ]] && hook_com[vcs]=subversion ++@} ++@end example ++ ++@noindent ++Simple enough. And it could have even been simpler, if only we had ++registered our function in a less generic context. If we do it only in ++the `@t{svn}' backend's context, we don't need to test which the active ++backend is: ++@example ++zstyle ':vcs_info:svn+set-message:*' hooks svn2subversion ++@end example ++@example ++ ++function +vi-svn2subversion() @{ ++ hook_com[vcs]=subversion ++@} ++@end example ++ ++@noindent ++And finally a little more elaborate example, that uses a hook to create ++a customised bookmark string for the @t{hg} backend. ++ ++@noindent ++Again, we start off by registering a function: ++@example ++zstyle ':vcs_info:hg+gen-hg-bookmark-string:*' hooks hgbookmarks ++@end example ++ ++@noindent ++And then we define the `@t{+vi-hgbookmarks} function: ++@example ++ ++function +vi-hgbookmarks() @{ ++ # The default is to connect all bookmark names by ++ # commas. This mixes things up a little. ++ # Imagine, there's one type of bookmarks that is ++ # special to you. Say, because it's *your* work. ++ # Those bookmarks look always like this: "sh/*" ++ # (because your initials are sh, for example). ++ # This makes the bookmarks string use only those ++ # bookmarks. If there's more than one, it ++ # concatenates them using commas. ++ local s i ++ # The bookmarks returned by `hg' are available in ++ # the functions positional parameters. ++ (( $# == 0 )) && return 0 ++ for i in "$@@"; do ++ if [[ $i == sh/* ]]; then ++ [[ -n $s ]] && s=$s, ++ s=$@{s@}$i ++ fi ++ done ++ # Now, the communication with the code that calls ++ # the hook functions is done via the hook_com[] ++ # hash. The key, at which the `gen-hg-bookmark-string' ++ # hook looks at is `hg-bookmark-string'. So: ++ hook_com[hg-bookmark-string]=$s ++ # And to signal, that we want to use the sting we ++ # just generated, set the special variable `ret' to ++ # something other than the default zero: ++ ret=1 ++ return 0 ++@} ++ ++@end example ++ ++@noindent ++Some longer examples and code snippets which might be useful are available in ++the examples file located at Misc/vcs_info-examples in the Zsh source ++directory. ++ ++@noindent ++This concludes our guided tour through zsh's @t{vcs_info}. ++ ++@noindent ++@node Prompt Themes, ZLE Functions, Version Control Information, User Contributions ++ ++@section Prompt Themes ++@noindent ++ ++@noindent ++ ++@subsection Installation ++@noindent ++ ++@noindent ++You should make sure all the functions from the @t{Functions/Prompts} ++directory of the source distribution are available; they all begin with ++the string `@t{prompt_}' except for the special function`@t{promptinit}'. ++You also need the `@t{colors}' function from @t{Functions/Misc}. All of ++these functions may already have been installed on your system; if not, ++you will need to find them and copy them. The directory should appear as ++one of the elements of the @t{fpath} array (this should already be the ++case if they were installed), and at least the function @t{promptinit} ++should be autoloaded; it will autoload the rest. Finally, to initialize ++the use of the system you need to call the @t{promptinit} function. The ++following code in your @t{.zshrc} will arrange for this; assume the ++functions are stored in the directory @t{~/myfns}: ++ ++@noindent ++@example ++fpath=(~/myfns $fpath) ++autoload -U promptinit ++promptinit ++@end example ++ ++@noindent ++ ++@subsection Theme Selection ++@noindent ++ ++@noindent ++Use the @t{prompt} command to select your preferred theme. This command ++may be added to your @t{.zshrc} following the call to @t{promptinit} in ++order to start zsh with a theme already selected. ++ ++@noindent ++@table @asis ++@item @t{prompt} [ @t{-c} | @t{-l} ] ++@itemx @t{prompt} [ @t{-p} | @t{-h} ] [ @var{theme} ... ] ++@itemx @t{prompt} [ @t{-s} ] @var{theme} [ @var{arg} ... ] ++Set or examine the prompt theme. With no options and a @var{theme} ++argument, the theme with that name is set as the current theme. The ++available themes are determined at run time; use the @t{-l} option to see ++a list. The special @var{theme} `@t{random}' selects at random one of the ++available themes and sets your prompt to that. ++ ++@noindent ++In some cases the @var{theme} may be modified by one or more arguments, ++which should be given after the theme name. See the help for each theme ++for descriptions of these arguments. ++ ++@noindent ++Options are: ++ ++@noindent ++@table @asis ++@item @t{-c} ++Show the currently selected theme and its parameters, if any. ++@item @t{-l} ++List all available prompt themes. ++@item @t{-p} ++Preview the theme named by @var{theme}, or all themes if no ++@var{theme} is given. ++@item @t{-h} ++Show help for the theme named by @var{theme}, or for the ++@t{prompt} function if no @var{theme} is given. ++@item @t{-s} ++Set @var{theme} as the current theme and save state. ++@end table ++ ++@item @t{prompt_}@var{theme}@t{_setup} ++Each available @var{theme} has a setup function which is called by the ++@t{prompt} function to install that theme. This function may define ++other functions as necessary to maintain the prompt, including functions ++used to preview the prompt or provide help for its use. You should not ++normally call a theme's setup function directly. ++ ++@end table ++ ++@noindent ++@node ZLE Functions, Exception Handling, Prompt Themes, User Contributions ++ ++@section ZLE Functions ++@noindent ++ ++@noindent ++ ++@subsection Widgets ++@noindent ++ ++@noindent ++These functions all implement user-defined ZLE widgets (see ++@ref{Zsh Line Editor}) which can be bound to keystrokes in interactive shells. To use them, ++your @t{.zshrc} should contain lines of the form ++ ++@noindent ++@example ++autoload @var{function} ++zle -N @var{function} ++@end example ++ ++@noindent ++followed by an appropriate @t{bindkey} command to associate the function ++with a key sequence. Suggested bindings are described below. ++ ++@noindent ++@table @asis ++@item bash-style word functions ++If you are looking for functions to implement moving over and editing ++words in the manner of bash, where only alphanumeric characters are ++considered word characters, you can use the functions described in ++the next section. The following is sufficient: ++ ++@noindent ++@example ++autoload -U select-word-style ++select-word-style bash ++@end example ++ ++@noindent ++ ++@tindex forward-word-match ++@tindex backward-word-match ++@tindex kill-word-match ++@tindex backward-kill-word-match ++@tindex transpose-words-match ++@tindex capitalize-word-match ++@tindex up-case-word-match ++@tindex down-case-word-match ++@tindex select-word-style ++@tindex match-word-context ++@tindex match-words-by-style ++@item @t{forward-word-match}, @t{backward-word-match} ++@itemx @t{kill-word-match}, @t{backward-kill-word-match} ++@itemx @t{transpose-words-match}, @t{capitalize-word-match} ++@itemx @t{up-case-word-match}, @t{down-case-word-match} ++@itemx @t{select-word-style}, @t{match-word-context}, @t{match-words-by-style} ++The eight `@t{-match}' functions are drop-in replacements for the ++builtin widgets without the suffix. By default they behave in a similar ++way. However, by the use of styles and the function @t{select-word-style}, ++the way words are matched can be altered. ++ ++@noindent ++The simplest way of configuring the functions is to use ++@t{select-word-style}, which can either be called as a normal function with ++the appropriate argument, or invoked as a user-defined widget that will ++prompt for the first character of the word style to be used. The first ++time it is invoked, the eight @t{-match} functions will automatically ++replace the builtin versions, so they do not need to be loaded explicitly. ++ ++@noindent ++The word styles available are as follows. Only the first character ++is examined. ++ ++@noindent ++@table @asis ++@item @t{bash} ++Word characters are alphanumeric characters only. ++ ++@item @t{normal} ++As in normal shell operation: word characters are alphanumeric characters ++plus any characters present in the string given by the parameter ++@t{$WORDCHARS}. ++ ++@item @t{shell} ++Words are complete shell command arguments, possibly including complete ++quoted strings, or any tokens special to the shell. ++ ++@item @t{whitespace} ++Words are any set of characters delimited by whitespace. ++ ++@item @t{default} ++Restore the default settings; this is usually the same as `@t{normal}'. ++ ++@end table ++ ++@noindent ++All but `@t{default}' can be input as an upper case character, which has ++the same effect but with subword matching turned on. In this case, words ++with upper case characters are treated specially: each separate run of ++upper case characters, or an upper case character followed by any number of ++other characters, is considered a word. The style @t{subword-range} ++can supply an alternative character range to the default `@t{[:upper:]}'; ++the value of the style is treated as the contents of a `@t{[}@var{...}@t{]}' ++pattern (note that the outer brackets should not be supplied, only ++those surrounding named ranges). ++ ++@noindent ++More control can be obtained using the @t{zstyle} command, as described in ++@ref{The zsh/zutil Module}. Each style is looked up in the ++context @t{:zle:}@var{widget} where @var{widget} is the name of the ++user-defined widget, not the name of the function implementing it, so in ++the case of the definitions supplied by @t{select-word-style} the ++appropriate contexts are @t{:zle:forward-word}, and so on. The function ++@t{select-word-style} itself always defines styles for the context ++`@t{:zle:*}' which can be overridden by more specific (longer) patterns as ++well as explicit contexts. ++ ++@noindent ++The style @t{word-style} specifies the rules to use. This may have the ++following values. ++ ++@noindent ++@table @asis ++@item @t{normal} ++Use the standard shell rules, i.e. alphanumerics and @t{$WORDCHARS}, unless ++overridden by the styles @t{word-chars} or @t{word-class}. ++ ++@item @t{specified} ++Similar to @t{normal}, but @emph{only} the specified characters, and not also ++alphanumerics, are considered word characters. ++ ++@item @t{unspecified} ++The negation of specified. The given characters are those which will ++@emph{not} be considered part of a word. ++ ++@item @t{shell} ++Words are obtained by using the syntactic rules for generating shell ++command arguments. In addition, special tokens which are never command ++arguments such as `@t{()}' are also treated as words. ++ ++@item @t{whitespace} ++Words are whitespace-delimited strings of characters. ++ ++@end table ++ ++@noindent ++The first three of those rules usually use @t{$WORDCHARS}, but the value ++in the parameter can be overridden by the style @t{word-chars}, which works ++in exactly the same way as @t{$WORDCHARS}. In addition, the style ++@t{word-class} uses character class syntax to group characters and takes ++precedence over @t{word-chars} if both are set. The @t{word-class} style ++does not include the surrounding brackets of the character class; for ++example, `@t{-:[:alnum:]}' is a valid @t{word-class} to include all ++alphanumerics plus the characters `@t{-}' and `@t{:}'. Be careful ++including `@t{]}', `@t{^}' and `@t{-}' as these are special inside ++character classes. ++ ++@noindent ++@t{word-style} may also have `@t{-subword}' appended to its value to ++turn on subword matching, as described above. ++ ++@noindent ++The style @t{skip-chars} is mostly useful for ++@t{transpose-words} and similar functions. If set, it gives a count of ++characters starting at the cursor position which will not be considered ++part of the word and are treated as space, regardless of what they actually ++are. For example, if ++ ++@noindent ++@example ++zstyle ':zle:transpose-words' skip-chars 1 ++@end example ++ ++@noindent ++has been set, and @t{transpose-words-match} is called with the cursor on ++the @var{X} of @t{foo}@var{X}@t{bar}, where @var{X} can be any character, then ++the resulting expression is @t{bar}@var{X}@t{foo}. ++ ++@noindent ++Finer grained control can be obtained by setting the style @t{word-context} ++to an array of pairs of entries. Each pair of entries consists of a ++@var{pattern} and a @var{subcontext}. The shell argument the cursor is on is ++matched against each @var{pattern} in turn until one matches; if it does, ++the context is extended by a colon and the corresponding @var{subcontext}. ++Note that the test is made against the original word on the line, with no ++stripping of quotes. Special handling is done between words: the current ++context is examined and if it contains the string @t{back}, the word before ++the cursor is considered, else the word after cursor is considered. Some ++examples are given below. ++ ++@noindent ++Here are some examples of use of the styles, actually taken from the ++simplified interface in @t{select-word-style}: ++ ++@noindent ++@example ++zstyle ':zle:*' word-style standard ++zstyle ':zle:*' word-chars @value{dsq} ++@end example ++ ++@noindent ++Implements bash-style word handling for all widgets, i.e. only ++alphanumerics are word characters; equivalent to setting ++the parameter @t{WORDCHARS} empty for the given context. ++ ++@noindent ++@example ++style ':zle:*kill*' word-style space ++@end example ++ ++@noindent ++Uses space-delimited words for widgets with the word `kill' in the name. ++Neither of the styles @t{word-chars} nor @t{word-class} is used in this case. ++ ++@noindent ++Here are some examples of use of the @t{word-context} style to extend ++the context. ++ ++@noindent ++@example ++zstyle ':zle:*' word-context "*/*" file "[[:space:]]" whitespace ++zstyle ':zle:transpose-words:whitespace' word-style shell ++zstyle ':zle:transpose-words:filename' word-style normal ++zstyle ':zle:transpose-words:filename' word-chars @value{dsq} ++@end example ++ ++@noindent ++This provides two different ways of using @t{transpose-words} depending on ++whether the cursor is on whitespace between words or on a filename, here ++any word containing a @t{/}. On whitespace, complete arguments as defined ++by standard shell rules will be transposed. In a filename, only ++alphanumerics will be transposed. Elsewhere, words will be transposed ++using the default style for @t{:zle:transpose-words}. ++ ++@noindent ++The word matching and all the handling of @t{zstyle} settings is actually ++implemented by the function @t{match-words-by-style}. This can be used to ++create new user-defined widgets. The calling function should set the local ++parameter @t{curcontext} to @t{:zle:}@var{widget}, create the local ++parameter @t{matched_words} and call @t{match-words-by-style} with no ++arguments. On return, @t{matched_words} will be set to an array with the ++elements: (1) the start of the line (2) the word before the cursor (3) any ++non-word characters between that word and the cursor (4) any non-word ++character at the cursor position plus any remaining non-word characters ++before the next word, including all characters specified by the ++@t{skip-chars} style, (5) the word at or following the cursor (6) any ++non-word characters following that word (7) the remainder of the line. Any ++of the elements may be an empty string; the calling function should test ++for this to decide whether it can perform its function. ++ ++@noindent ++It is possible to pass options with arguments to @t{match-words-by-style} ++to override the use of styles. The options are: ++@table @asis ++@item @t{-w} ++@var{word-style} ++@item @t{-s} ++@var{skip-chars} ++@item @t{-c} ++@var{word-class} ++@item @t{-C} ++@var{word-chars} ++@item @t{-r} ++@var{subword-range} ++@end table ++ ++@noindent ++For example, @t{match-words-by-style -w shell -c 0} may be used to ++extract the command argument around the cursor. ++ ++@noindent ++The @t{word-context} style is implemented by the function ++@t{match-word-context}. This should not usually need to be called ++directly. ++ ++@tindex copy-earlier-word ++@item @t{copy-earlier-word} ++This widget works like a combination of @t{insert-last-word} and ++@t{copy-prev-shell-word}. Repeated invocations of the widget retrieve ++earlier words on the relevant history line. With a numeric argument ++@var{N}, insert the @var{N}th word from the history line; @var{N} may be ++negative to count from the end of the line. ++ ++@noindent ++If @t{insert-last-word} has been used to retrieve the last word on a ++previous history line, repeated invocations will replace that word with ++earlier words from the same line. ++ ++@noindent ++Otherwise, the widget applies to words on the line currently being edited. ++The @t{widget} style can be set to the name of another widget that should ++be called to retrieve words. This widget must accept the same three ++arguments as @t{insert-last-word}. ++ ++@tindex cycle-completion-positions ++@item @t{cycle-completion-positions} ++After inserting an unambiguous string into the command line, the new ++function based completion system may know about multiple places in ++this string where characters are missing or differ from at least one ++of the possible matches. It will then place the cursor on the ++position it considers to be the most interesting one, i.e. the one ++where one can disambiguate between as many matches as possible with as ++little typing as possible. ++ ++@noindent ++This widget allows the cursor to be easily moved to the other interesting ++spots. It can be invoked repeatedly to cycle between all positions ++reported by the completion system. ++ ++@tindex delete-whole-word-match ++@item @t{delete-whole-word-match} ++This is another function which works like the @t{-match} functions ++described immediately above, i.e. using styles to decide the word ++boundaries. However, it is not a replacement for any existing function. ++ ++@noindent ++The basic behaviour is to delete the word around the cursor. There is no ++numeric prefix handling; only the single word around the cursor is ++considered. If the widget contains the string @t{kill}, the removed text ++will be placed in the cutbuffer for future yanking. This can be obtained ++by defining @t{kill-whole-word-match} as follows: ++ ++@noindent ++@example ++zle -N kill-whole-word-match delete-whole-word-match ++@end example ++ ++@noindent ++and then binding the widget @t{kill-whole-word-match}. ++ ++@tindex down-line-or-beginning-search ++@tindex up-line-or-beginning-search ++@item @t{up-line-or-beginning-search}, @t{down-line-or-beginning-search} ++These widgets are similar to the builtin functions @t{up-line-or-search} ++and @t{down-line-or-search}: if in a multiline buffer they move up or ++down within the buffer, otherwise they search for a history line matching ++the start of the current line. In this case, however, they search for ++a line which matches the current line up to the current cursor position, in ++the manner of @t{history-beginning-search-backward} and @t{-forward}, rather ++than the first word on the line. ++ ++@tindex edit-command-line ++@item @t{edit-command-line} ++Edit the command line using your visual editor, as in @t{ksh}. ++ ++@noindent ++@example ++bindkey -M vicmd v edit-command-line ++@end example ++ ++@tindex history-beginning-search-backward-end ++@tindex history-beginning-search-forward-end ++@item @t{history-search-end} ++This function implements the widgets ++@t{history-beginning-search-backward-end} and ++@t{history-beginning-search-forward-end}. These commands work by first ++calling the corresponding builtin widget (see ++@ref{History Control}) and then moving the cursor to the end of the line. The original cursor ++position is remembered and restored before calling the builtin widget a ++second time, so that the same search is repeated to look farther through ++the history. ++ ++@noindent ++Although you @t{autoload} only one function, the commands to use it are ++slightly different because it implements two widgets. ++ ++@noindent ++@example ++zle -N history-beginning-search-backward-end \ ++ history-search-end ++zle -N history-beginning-search-forward-end \ ++ history-search-end ++bindkey '\e^P' history-beginning-search-backward-end ++bindkey '\e^N' history-beginning-search-forward-end ++@end example ++ ++@tindex history-beginning-search-menu ++@item @t{history-beginning-search-menu} ++This function implements yet another form of history searching. The ++text before the cursor is used to select lines from the history, ++as for @t{history-beginning-search-backward} except that all matches are ++shown in a numbered menu. Typing the appropriate digits inserts the ++full history line. Note that leading zeroes must be typed (they are only ++shown when necessary for removing ambiguity). The entire history is ++searched; there is no distinction between forwards and backwards. ++ ++@noindent ++With a prefix argument, the search is not anchored to the start of ++the line; the string typed by the use may appear anywhere in the line ++in the history. ++ ++@noindent ++If the widget name contains `@t{-end}' the cursor is moved to the end of ++the line inserted. If the widget name contains `@t{-space}' any space ++in the text typed is treated as a wildcard and can match anything (hence ++a leading space is equivalent to giving a prefix argument). Both ++forms can be combined, for example: ++ ++@noindent ++@example ++zle -N history-beginning-search-menu-space-end \ ++ history-beginning-search-menu ++@end example ++ ++@tindex history-pattern-search ++@tindex history-pattern-search-backward ++@tindex history-pattern-search-forward ++@item @t{history-pattern-search} ++The function @t{history-pattern-search} implements widgets which prompt ++for a pattern with which to search the history backwards or forwards. The ++pattern is in the usual zsh format, however the first character may be ++@t{^} to anchor the search to the start of the line, and the last character ++may be @t{$} to anchor the search to the end of the line. If the ++search was not anchored to the end of the line the cursor is positioned ++just after the pattern found. ++ ++@noindent ++The commands to create bindable widgets are similar to those in the ++example immediately above: ++ ++@noindent ++@example ++autoload -U history-pattern-search ++zle -N history-pattern-search-backward history-pattern-search ++zle -N history-pattern-search-forward history-pattern-search ++@end example ++ ++@tindex incarg ++@vindex incarg, use of ++@item @t{incarg} ++Typing the keystrokes for this widget with the cursor placed on or to the ++left of an integer causes that integer to be incremented by one. With a ++numeric prefix argument, the number is incremented by the amount of the ++argument (decremented if the prefix argument is negative). The shell ++parameter @t{incarg} may be set to change the default increment to ++something other than one. ++ ++@noindent ++@example ++bindkey '^X+' incarg ++@end example ++ ++@tindex incremental-complete-word ++@item @t{incremental-complete-word} ++This allows incremental completion of a word. After starting this ++command, a list of completion choices can be shown after every character ++you type, which you can delete with @t{^H} or @t{DEL}. Pressing return ++accepts the completion so far and returns you to normal editing (that is, ++the command line is @emph{not} immediately executed). You can hit @t{TAB} to ++do normal completion, @t{^G} to abort back to the state when you started, ++and @t{^D} to list the matches. ++ ++@noindent ++This works only with the new function based completion system. ++ ++@noindent ++@example ++bindkey '^Xi' incremental-complete-word ++@end example ++ ++@tindex insert-composed-char ++@item @t{insert-composed-char} ++This function allows you to compose characters that don't appear on the ++keyboard to be inserted into the command line. The command is followed by ++two keys corresponding to ASCII characters (there is no prompt). For ++accented characters, the two keys are a base character followed by a code ++for the accent, while for other special characters the two characters ++together form a mnemonic for the character to be inserted. The ++two-character codes are a subset of those given by RFC 1345 (see for ++example @t{http://www.faqs.org/rfcs/rfc1345.html}). ++ ++@noindent ++The function may optionally be followed by up to two characters which ++replace one or both of the characters read from the keyboard; if both ++characters are supplied, no input is read. For example, ++@t{insert-composed-char a:} can be used within a widget to insert an a with ++umlaut into the command line. This has the advantages over use of a ++literal character that it is more portable. ++ ++@noindent ++For best results zsh should have been built with support for multibyte ++characters (configured with @t{--enable-multibyte}); however, the function ++works for the limited range of characters available in single-byte ++character sets such as ISO-8859-1. ++ ++@noindent ++The character is converted into the local representation and ++inserted into the command line at the cursor position. ++(The conversion is done within the shell, using whatever facilities ++the C library provides.) With a numeric argument, the character and its ++code are previewed in the status line ++ ++@noindent ++The function may be run outside zle in which case it prints the character ++(together with a newline) to standard output. Input is still read from ++keystrokes. ++ ++@noindent ++See @t{insert-unicode-char} for an alternative way of inserting Unicode ++characters using their hexadecimal character number. ++ ++@noindent ++The set of accented characters is reasonably complete up to Unicode ++character U+0180, the set of special characters less so. However, it ++is very sporadic from that point. Adding new characters is easy, ++however; see the function @t{define-composed-chars}. Please send any ++additions to @t{zsh-workers@@zsh.org}. ++ ++@noindent ++The codes for the second character when used to accent the first are as ++follows. Note that not every character can take every accent. ++@table @asis ++@item @t{!} ++Grave. ++@item @t{'} ++Acute. ++@item @t{>} ++Circumflex. ++@item @t{?} ++Tilde. (This is not @t{~} as RFC 1345 does not assume that ++character is present on the keyboard.) ++@item @t{-} ++Macron. (A horizontal bar over the base character.) ++@item @t{(} ++Breve. (A shallow dish shape over the base character.) ++@item @t{.} ++Dot above the base character, or in the case of @t{i} no dot, ++or in the case of @t{L} and @t{l} a centered dot. ++@item @t{:} ++Diaeresis (Umlaut). ++@item @t{c} ++Cedilla. ++@item @t{_} ++Underline, however there are currently no underlined characters. ++@item @t{/} ++Stroke through the base character. ++@item @t{"} ++Double acute (only supported on a few letters). ++@item @t{;} ++Ogonek. (A little forward facing hook at the bottom right ++of the character.) ++@item @t{<} ++Caron. (A little v over the letter.) ++@item @t{0} ++Circle over the base character. ++@item @t{2} ++Hook over the base character. ++@item @t{9} ++Horn over the base character. ++@end table ++ ++@noindent ++The most common characters from the Arabic, Cyrillic, Greek and Hebrew ++alphabets are available; consult RFC 1345 for the appropriate sequences. ++In addition, a set of two letter codes not in RFC 1345 are available for ++the double-width characters corresponding to ASCII characters from @t{!} ++to @t{~} (0x21 to 0x7e) by preceding the character with @t{^}, for ++example @t{^A} for a double-width @t{A}. ++ ++@noindent ++The following other two-character sequences are understood. ++ ++@noindent ++@table @asis ++@item ASCII characters ++These are already present on most keyboards: ++@table @asis ++@item @t{<(} ++Left square bracket ++@item @t{//} ++Backslash (solidus) ++@item @t{)>} ++Right square bracket ++@item @t{(!} ++Left brace (curly bracket) ++@item @t{!!} ++Vertical bar (pipe symbol) ++@item @t{!)} ++Right brace (curly bracket) ++@item @t{'?} ++Tilde ++@end table ++ ++@item Special letters ++Characters found in various variants of the Latin alphabet: ++@table @asis ++@item @t{ss} ++Eszett (scharfes S) ++@item @t{D-}, @t{d-} ++Eth ++@item @t{TH}, @t{th} ++Thorn ++@item @t{kk} ++Kra ++@item @t{'n} ++'n ++@item @t{NG}, @t{ng} ++Ng ++@item @t{OI}, @t{oi} ++Oi ++@item @t{yr} ++yr ++@item @t{ED} ++ezh ++@end table ++ ++@item Currency symbols ++@table @asis ++@item @t{Ct} ++Cent ++@item @t{Pd} ++Pound sterling (also lira and others) ++@item @t{Cu} ++Currency ++@item @t{Ye} ++Yen ++@item @t{Eu} ++Euro (N.B. not in RFC 1345) ++@end table ++ ++@item Punctuation characters ++References to "right" quotes indicate the shape (like a 9 rather than 6) ++rather than their grammatical use. (For example, a "right" low double ++quote is used to open quotations in German.) ++@table @asis ++@item @t{!I} ++Inverted exclamation mark ++@item @t{BB} ++Broken vertical bar ++@item @t{SE} ++Section ++@item @t{Co} ++Copyright ++@item @t{-a} ++Spanish feminine ordinal indicator ++@item @t{<<} ++Left guillemet ++@item @t{-}@t{-} ++Soft hyphen ++@item @t{Rg} ++Registered trade mark ++@item @t{PI} ++Pilcrow (paragraph) ++@item @t{-o} ++Spanish masculine ordinal indicator ++@item @t{>>} ++Right guillemet ++@item @t{?I} ++Inverted question mark ++@item @t{-1} ++Hyphen ++@item @t{-N} ++En dash ++@item @t{-M} ++Em dash ++@item @t{-3} ++Horizontal bar ++@item @t{:3} ++Vertical ellipsis ++@item @t{.3} ++Horizontal midline ellipsis ++@item @t{!2} ++Double vertical line ++@item @t{=2} ++Double low line ++@item @t{'6} ++Left single quote ++@item @t{'9} ++Right single quote ++@item @t{.9} ++"Right" low quote ++@item @t{9'} ++Reversed "right" quote ++@item @t{"6} ++Left double quote ++@item @t{"9} ++Right double quote ++@item @t{:9} ++"Right" low double quote ++@item @t{9"} ++Reversed "right" double quote ++@item @t{/-} ++Dagger ++@item @t{/=} ++Double dagger ++@end table ++ ++@item Mathematical symbols ++@table @asis ++@item @t{DG} ++Degree ++@item @t{-2}, @t{+-}, @t{-+} ++- sign, +/- sign, -/+ sign ++@item @t{2S} ++Superscript 2 ++@item @t{3S} ++Superscript 3 ++@item @t{1S} ++Superscript 1 ++@item @t{My} ++Micro ++@item @t{.M} ++Middle dot ++@item @t{14} ++Quarter ++@item @t{12} ++Half ++@item @t{34} ++Three quarters ++@item @t{*X} ++Multiplication ++@item @t{-:} ++Division ++@item @t{%0} ++Per mille ++@item @t{FA}, @t{TE}, @t{/0} ++For all, there exists, empty set ++@item @t{dP}, @t{DE}, @t{NB} ++Partial derivative, delta (increment), del ++(nabla) ++@item @t{(-}, @t{-)} ++Element of, contains ++@item @t{*P}, @t{+Z} ++Product, sum ++@item @t{*-}, @t{Ob}, @t{Sb} ++Asterisk, ring, bullet ++@item @t{RT}, @t{0(}, @t{00} ++Root sign, proportional to, infinity ++@end table ++ ++@item Other symbols ++@table @asis ++@item @t{cS}, @t{cH}, @t{cD}, @t{cC} ++Card suits: spades, hearts, diamonds, ++clubs ++@item @t{Md}, @t{M8}, @t{M2}, @t{Mb}, @t{Mx}, @t{MX} ++Musical notation: ++crotchet (quarter note), quaver (eighth note), semiquavers (sixteenth ++notes), flag sign, natural sign, sharp sign ++@item @t{Fm}, @t{Ml} ++Female, male ++@end table ++ ++@item Accents on their own ++@table @asis ++@item @t{'>} ++Circumflex (same as caret, @t{^}) ++@item @t{'!} ++Grave (same as backtick, @t{`}) ++@item @t{',} ++Cedilla ++@item @t{':} ++Diaeresis (Umlaut) ++@item @t{'m} ++Macron ++@item @t{''} ++Acute ++@end table ++ ++@end table ++ ++@tindex insert-files ++@item @t{insert-files} ++This function allows you type a file pattern, and see the results of the ++expansion at each step. When you hit return, all expansions are inserted ++into the command line. ++ ++@noindent ++@example ++bindkey '^Xf' insert-files ++@end example ++ ++@tindex insert-unicode-char ++@item @t{insert-unicode-char} ++When first executed, the user inputs a set of hexadecimal digits. ++This is terminated with another call to @t{insert-unicode-char}. ++The digits are then turned into the corresponding Unicode character. ++For example, if the widget is bound to @t{^XU}, the character sequence ++`@t{^XU 4 c ^XU}' inserts @t{L} (Unicode U+004c). ++ ++@noindent ++See @t{insert-composed-char} for a way of inserting characters ++using a two-character mnemonic. ++ ++@tindex narrow-to-region ++@tindex narrow-to-region-invisible ++@item @t{narrow-to-region [ -p} @var{pre} @t{] [ -P} @var{post} @t{]} ++@itemx @t{[ -S} @var{statepm} @t{| -R} @var{statepm} @t{] [ -n ] [} @var{start} @var{end} @t{]}) ++@itemx @t{narrow-to-region-invisible} ++Narrow the editable portion of the buffer to the region between the cursor ++and the mark, which may be in either order. The region may not be empty. ++ ++@noindent ++@t{narrow-to-region} may be used as a widget or called as a function from a ++user-defined widget; by default, the text outside the editable area remains ++visible. A @t{recursive-edit} is performed and the original widening ++status is then restored. Various options and arguments are available when ++it is called as a function. ++ ++@noindent ++The options @t{-p} @var{pretext} and @t{-P} @var{posttext} may be ++used to replace the text before and after the display for the duration of ++the function; either or both may be an empty string. ++ ++@noindent ++If the option @t{-n} is also given, @var{pretext} or @var{posttext} will only ++be inserted if there is text before or after the region respectively which ++will be made invisible. ++ ++@noindent ++Two numeric arguments may be given which will be used instead of the cursor ++and mark positions. ++ ++@noindent ++The option @t{-S} @var{statepm} is used to narrow according to the other ++options while saving the original state in the parameter with name ++@var{statepm}, while the option @t{-R} @var{statepm} is used to restore the ++state from the parameter; note in both cases the @emph{name} of the parameter ++is required. In the second case, other options and arguments are ++irrelevant. When this method is used, no @t{recursive-edit} is performed; ++the calling widget should call this function with the option @t{-S}, ++perform its own editing on the command line or pass control to the user ++via `@t{zle recursive-edit}', then call this function with the option ++@t{-R}. The argument @var{statepm} must be a suitable name for an ordinary ++parameter, except that parameters beginning with the prefix @t{_ntr_} are ++reserved for use within @t{narrow-to-region}. Typically the parameter will ++be local to the calling function. ++ ++@noindent ++@t{narrow-to-region-invisible} is a simple widget which calls ++@t{narrow-to-region} with arguments which replace any text outside the ++region with `@t{...}'. ++ ++@noindent ++The display is restored (and the widget returns) upon any zle command ++which would usually cause the line to be accepted or aborted. Hence an ++additional such command is required to accept or abort the current line. ++ ++@noindent ++The return status of both widgets is zero if the line was accepted, else ++non-zero. ++ ++@noindent ++Here is a trivial example of a widget using this feature. ++@example ++local state ++narrow-to-region -p $'Editing restricted region\n' \ ++ -P @value{dsq} -S state ++zle recursive-edit ++narrow-to-region -R state ++@end example ++ ++@tindex predict-on ++@tindex predict-off ++@item @t{predict-on} ++This set of functions implements predictive typing using history search. ++After @t{predict-on}, typing characters causes the editor to look backward ++in the history for the first line beginning with what you have typed so ++far. After @t{predict-off}, editing returns to normal for the line found. ++In fact, you often don't even need to use @t{predict-off}, because if the ++line doesn't match something in the history, adding a key performs ++standard completion, and then inserts itself if no completions were found. ++However, editing in the middle of a line is liable to confuse prediction; ++see the @t{toggle} style below. ++ ++@noindent ++With the function based completion system (which is needed for this), you ++should be able to type @t{TAB} at almost any point to advance the cursor ++to the next @value{dsbq}interesting@value{dsq} character position (usually the end of the ++current word, but sometimes somewhere in the middle of the word). And of ++course as soon as the entire line is what you want, you can accept with ++return, without needing to move the cursor to the end first. ++ ++@noindent ++The first time @t{predict-on} is used, it creates several additional ++widget functions: ++ ++@noindent ++@table @asis ++@item @t{delete-backward-and-predict} ++Replaces the @t{backward-delete-char} ++widget. You do not need to bind this yourself. ++@item @t{insert-and-predict} ++Implements predictive typing by replacing the ++@t{self-insert} widget. You do not need to bind this yourself. ++@item @t{predict-off} ++Turns off predictive typing. ++@end table ++ ++@noindent ++Although you @t{autoload} only the @t{predict-on} function, it is ++necessary to create a keybinding for @t{predict-off} as well. ++ ++@noindent ++@example ++zle -N predict-on ++zle -N predict-off ++bindkey '^X^Z' predict-on ++bindkey '^Z' predict-off ++@end example ++ ++@tindex read-from-minibuffer ++@item @t{read-from-minibuffer} ++This is most useful when called as a function from inside a widget, but will ++work correctly as a widget in its own right. It prompts for a value ++below the current command line; a value may be input using all of the ++standard zle operations (and not merely the restricted set available ++when executing, for example, @t{execute-named-cmd}). The value is then ++returned to the calling function in the parameter @t{$REPLY} and the ++editing buffer restored to its previous state. If the read was aborted ++by a keyboard break (typically @t{^G}), the function returns status 1 ++and @t{$REPLY} is not set. ++ ++@noindent ++If one argument is supplied to the function it is taken as a prompt, ++otherwise `@t{? }' is used. If two arguments are supplied, they are the ++prompt and the initial value of @t{$LBUFFER}, and if a third argument is ++given it is the initial value of @t{$RBUFFER}. This provides a default ++value and starting cursor placement. Upon return the entire buffer is the ++value of @t{$REPLY}. ++ ++@noindent ++One option is available: `@t{-k} @var{num}' specifies that @var{num} ++characters are to be read instead of a whole line. The line editor is not ++invoked recursively in this case, so depending on the terminal settings ++the input may not be visible, and only the input keys are placed in ++@t{$REPLY}, not the entire buffer. Note that unlike the @t{read} builtin ++@var{num} must be given; there is no default. ++ ++@noindent ++The name is a slight misnomer, as in fact the shell's own minibuffer is ++not used. Hence it is still possible to call @t{executed-named-cmd} and ++similar functions while reading a value. ++ ++@tindex replace-string ++@tindex replace-string-again ++@tindex replace-pattern ++@item @t{replace-string}, @t{replace-pattern} ++@itemx @t{replace-string-again}, @t{replace-pattern-again} ++The function @t{replace-string} implements three widgets. ++If defined under the same name as the function, it prompts for two ++strings; the first (source) string will be replaced by the second ++everywhere it occurs in the line editing buffer. ++ ++@noindent ++If the widget name contains the word `@t{pattern}', for example by ++defining the widget using the command `@t{zle -N replace-pattern ++replace-string}', then the matching is performed using zsh patterns. All ++zsh extended globbing patterns can be used in the source string; note ++that unlike filename generation the pattern does not need to match an ++entire word, nor do glob qualifiers have any effect. In addition, the ++replacement string can contain parameter or command substitutions. ++Furthermore, a `@t{&}' in the replacement string will be replaced with ++the matched source string, and a backquoted digit `@t{\}@var{N}' will be ++replaced by the @var{N}th parenthesised expression matched. The form ++`@t{\@{}@var{N}@t{@}}' may be used to protect the digit from following ++digits. ++ ++@noindent ++If the widget instead contains the word `@t{regex}' (or `@t{regexp}'), ++then the matching is performed using regular expressions, respecting ++the setting of the option @t{RE_MATCH_PCRE} (see the description of the ++function @t{regexp-replace} below). The special replacement facilities ++described above for pattern matching are available. ++ ++@noindent ++By default the previous source or replacement string will not be offered ++for editing. However, this feature can be activated by setting the style ++@t{edit-previous} in the context @t{:zle:}@var{widget} (for example, ++@t{:zle:replace-string}) to @t{true}. In addition, a positive ++numeric argument forces the previous values to be offered, a negative or ++zero argument forces them not to be. ++ ++@noindent ++The function @t{replace-string-again} can be used to repeat the previous ++replacement; no prompting is done. As with @t{replace-string}, if the name ++of the widget contains the word `@t{pattern}' or `@t{regex}', pattern or ++regular expression matching is performed, else a literal string ++replacement. Note that the previous source and replacement text are the ++same whether pattern, regular expression or string matching is used. ++ ++@noindent ++For example, starting from the line: ++ ++@noindent ++@example ++print This line contains fan and fond ++@end example ++ ++@noindent ++and invoking @t{replace-pattern} with the source string ++`@t{f(?)n}' and ++the replacement string `@t{c\1r}' produces the not very useful line: ++ ++@noindent ++@example ++print This line contains car and cord ++@end example ++ ++@noindent ++The range of the replacement string can be limited by using the ++@t{narrow-to-region-invisible} widget. One limitation of the current ++version is that @t{undo} will cycle through changes to the replacement ++and source strings before undoing the replacement itself. ++ ++@tindex send-invisible ++@item @t{send-invisible} ++This is similar to read-from-minibuffer in that it may be called as a ++function from a widget or as a widget of its own, and interactively reads ++input from the keyboard. However, the input being typed is concealed and ++a string of asterisks (`@t{*}') is shown instead. The value is saved in ++the parameter @t{$INVISIBLE} to which a reference is inserted into the ++editing buffer at the restored cursor position. If the read was aborted ++by a keyboard break (typically @t{^G}) or another escape from editing such ++as @t{push-line}, @t{$INVISIBLE} is set to empty and the original buffer ++is restored unchanged. ++ ++@noindent ++If one argument is supplied to the function it is taken as a prompt, ++otherwise `@t{Non-echoed text: }' is used (as in emacs). If a second and ++third argument are supplied they are used to begin and end the reference ++to @t{$INVISIBLE} that is inserted into the buffer. The default is to ++open with @t{$@{}, then @t{INVISIBLE}, and close with @t{@}}, but many ++other effects are possible. ++ ++@tindex smart-insert-last-word ++@item @t{smart-insert-last-word} ++This function may replace the @t{insert-last-word} widget, like so: ++ ++@noindent ++@example ++zle -N insert-last-word smart-insert-last-word ++@end example ++ ++@noindent ++With a numeric prefix, or when passed command line arguments in a call ++from another widget, it behaves like @t{insert-last-word}, except that ++words in comments are ignored when @t{INTERACTIVE_COMMENTS} is set. ++ ++@noindent ++Otherwise, the rightmost @value{dsbq}interesting@value{dsq} word from the previous command is ++found and inserted. The default definition of @value{dsbq}interesting@value{dsq} is that the ++word contains at least one alphabetic character, slash, or backslash. ++This definition may be overridden by use of the @t{match} style. The ++context used to look up the style is the widget name, so usually the ++context is @t{:insert-last-word}. However, you can bind this function to ++different widgets to use different patterns: ++ ++@noindent ++@example ++zle -N insert-last-assignment smart-insert-last-word ++zstyle :insert-last-assignment match '[[:alpha:]][][[:alnum:]]#=*' ++bindkey '\e=' insert-last-assignment ++@end example ++ ++@noindent ++If no interesting word is found and the @t{auto-previous} style is set to ++a true value, the search continues upward through the history. When ++@t{auto-previous} is unset or false (the default), the widget must be ++invoked repeatedly in order to search earlier history lines. ++ ++@tindex transpose-lines ++@item @t{transpose-lines} ++Only useful with a multi-line editing buffer; the lines here are ++lines within the current on-screen buffer, not history lines. ++The effect is similar to the function of the same name in Emacs. ++ ++@noindent ++Transpose the current line with the previous line and move the cursor ++to the start of the next line. Repeating this (which can be done by ++providing a positive numeric prefix argument) has the effect of moving ++the line above the cursor down by a number of lines. ++ ++@noindent ++With a negative numeric prefix argument, requires two lines above the ++cursor. These two lines are transposed and the cursor moved to the ++start of the previous line. Using a numeric prefix less than -1 ++has the effect of moving the line above the cursor up by minus that ++number of lines. ++ ++@tindex which-command ++@item @t{which-command} ++This function is a drop-in replacement for the builtin widget ++@t{which-command}. It has enhanced behaviour, in that it correctly ++detects whether or not the command word needs to be expanded as an ++alias; if so, it continues tracing the command word from the expanded ++alias until it reaches the command that will be executed. ++ ++@noindent ++The style @t{whence} is available in the context @t{:zle:$WIDGET}; this ++may be set to an array to give the command and options that will be used to ++investigate the command word found. The default is @t{whence -c}. ++ ++@end table ++ ++@noindent ++ ++@subsection Utility Functions ++@noindent ++ ++@noindent ++These functions are useful in constructing widgets. They ++should be loaded with `@t{autoload -U} @var{function}' and called ++as indicated from user-defined widgets. ++ ++@noindent ++@table @asis ++@tindex split-shell-arguments ++@item @t{split-shell-arguments} ++This function splits the line currently being edited into shell arguments ++and whitespace. The result is stored in the array @t{reply}. The array ++contains all the parts of the line in order, starting with any whitespace ++before the first argument, and finishing with any whitespace after the last ++argument. Hence (so long as the option @t{KSH_ARRAYS} is not set) ++whitespace is given by odd indices in the array and arguments by ++even indices. Note that no stripping of quotes is done; joining together ++all the elements of @t{reply} in order is guaranteed to produce the ++original line. ++ ++@noindent ++The parameter @t{REPLY} is set to the index of the word in @t{reply} which ++contains the character after the cursor, where the first element has index ++1. The parameter @t{REPLY2} is set to the index of the character under the ++cursor in that word, where the first character has index 1. ++ ++@noindent ++Hence @t{reply}, @t{REPLY} and @t{REPLY2} should all be made local to ++the enclosing function. ++ ++@noindent ++See the function @t{modify-current-argument}, described below, for ++an example of how to call this function. ++ ++@tindex modify-current-argument ++@item @t{modify-current-argument} @var{expr-using-}@t{$ARG} ++This function provides a simple method of allowing user-defined widgets ++to modify the command line argument under the cursor (or immediately to the ++left of the cursor if the cursor is between arguments). The argument ++should be an expression which when evaluated operates on the shell ++parameter @t{ARG}, which will have been set to the command line argument ++under the cursor. The expression should be suitably quoted to prevent ++it being evaluated too early. ++ ++@noindent ++For example, a user-defined widget containing the following code ++converts the characters in the argument under the cursor into all upper ++case: ++ ++@noindent ++@example ++modify-current-argument '$@{(U)ARG@}' ++@end example ++ ++@noindent ++The following strips any quoting from the current word (whether backslashes ++or one of the styles of quotes), and replaces it with single quoting ++throughout: ++ ++@noindent ++@example ++modify-current-argument '$@{(qq)$@{(Q)ARG@}@}' ++@end example ++ ++@end table ++ ++@noindent ++ ++@subsection Styles ++@noindent ++ ++@noindent ++The behavior of several of the above widgets can be controlled by the use ++of the @t{zstyle} mechanism. In particular, widgets that interact with ++the completion system pass along their context to any completions that ++they invoke. ++ ++@noindent ++@table @asis ++@kindex break-keys, widget style ++@item @t{break-keys} ++This style is used by the @t{incremental-complete-word} widget. Its value ++should be a pattern, and all keys matching this pattern will cause the ++widget to stop incremental completion without the key having any further ++effect. Like all styles used directly by ++@t{incremental-complete-word}, this style is looked up using the ++context `@t{:incremental}'. ++ ++@kindex completer, completion style ++@item @t{completer} ++The @t{incremental-complete-word} and @t{insert-and-predict} widgets set ++up their top-level context name before calling completion. This allows ++one to define different sets of completer functions for normal completion ++and for these widgets. For example, to use completion, approximation and ++correction for normal completion, completion and correction for ++incremental completion and only completion for prediction one could use: ++ ++@noindent ++@example ++zstyle ':completion:*' completer \ ++ _complete _correct _approximate ++zstyle ':completion:incremental:*' completer \ ++ _complete _correct ++zstyle ':completion:predict:*' completer \ ++ _complete ++@end example ++ ++@noindent ++It is a good idea to restrict the completers used in prediction, because ++they may be automatically invoked as you type. The @t{_list} and ++@t{_menu} completers should never be used with prediction. The ++@t{_approximate}, @t{_correct}, @t{_expand}, and @t{_match} completers may ++be used, but be aware that they may change characters anywhere in the word ++behind the cursor, so you need to watch carefully that the result is what ++you intended. ++ ++@kindex cursor, completion style ++@item @t{cursor} ++The @t{insert-and-predict} widget uses this style, in the context ++`@t{:predict}', to decide where to place the cursor after completion has ++been tried. Values are: ++ ++@noindent ++@table @asis ++@item @t{complete} ++The cursor is left where it was when completion finished, but only if ++it is after a character equal to the one just inserted by the user. If ++it is after another character, this value is the same as `@t{key}'. ++ ++@item @t{key} ++The cursor is left ++after the @var{n}th occurrence of the character just inserted, where ++@var{n} is the number of times that character appeared in the word ++before completion was attempted. In short, this has the effect of ++leaving the cursor after the character just typed even if the ++completion code found out that no other characters need to be inserted ++at that position. ++ ++@end table ++ ++@noindent ++Any other value for this style unconditionally leaves the cursor at the ++position where the completion code left it. ++ ++@kindex list, widget style ++@item @t{list} ++When using the @t{incremental-complete-word} widget, this style says ++if the matches should be listed on every key press (if they fit on the ++screen). Use the context prefix `@t{:completion:incremental}'. ++ ++@noindent ++The @t{insert-and-predict} widget uses this style to decide if the ++completion should be shown even if there is only one possible completion. ++This is done if the value of this style is the string @t{always}. In this ++case the context is `@t{:predict}' (@emph{not} `@t{:completion:predict}'). ++ ++@kindex match, widget style ++@item @t{match} ++This style is used by @t{smart-insert-last-word} to provide a pattern ++(using full @t{EXTENDED_GLOB} syntax) that matches an interesting word. ++The context is the name of the widget to which @t{smart-insert-last-word} ++is bound (see above). The default behavior of @t{smart-insert-last-word} ++is equivalent to: ++ ++@noindent ++@example ++zstyle :insert-last-word match '*[[:alpha:]/\\]*' ++@end example ++ ++@noindent ++However, you might want to include words that contain spaces: ++ ++@noindent ++@example ++zstyle :insert-last-word match '*[[:alpha:][:space:]/\\]*' ++@end example ++ ++@noindent ++Or include numbers as long as the word is at least two characters long: ++ ++@noindent ++@example ++zstyle :insert-last-word match '*([[:digit:]]?|[[:alpha:]/\\])*' ++@end example ++ ++@noindent ++The above example causes redirections like "2>" to be included. ++ ++@kindex prompt, widget style ++@item @t{prompt} ++The @t{incremental-complete-word} widget shows the value of this ++style in the status line during incremental completion. The string ++value may contain any of the following substrings in the manner of ++the @t{PS1} and other prompt parameters: ++ ++@noindent ++@table @asis ++@item @t{%c} ++Replaced by the name of the completer function that generated the ++matches (without the leading underscore). ++ ++@item @t{%l} ++When the @t{list} style is set, ++replaced by `@t{...}' if the list of matches is too long to fit on the ++screen and with an empty string otherwise. If the @t{list} style is ++`false' or not set, `@t{%l}' is always removed. ++ ++@item @t{%n} ++Replaced by the number of matches generated. ++ ++@item @t{%s} ++Replaced by `@t{-no match-}', `@t{-no prefix-}', or an empty string ++if there is no completion matching the word on the line, if the ++matches have no common prefix different from the word on the line, or ++if there is such a common prefix, respectively. ++ ++@item @t{%u} ++Replaced by the unambiguous part of all matches, if there ++is any, and if it is different from the word on the line. ++ ++@end table ++ ++@noindent ++Like `@t{break-keys}', this uses the `@t{:incremental}' context. ++ ++@kindex stop-keys, widget style ++@item @t{stop-keys} ++This style is used by the @t{incremental-complete-word} widget. Its value ++is treated similarly to the one for the @t{break-keys} style (and uses ++the same context: `@t{:incremental}'). However, in ++this case all keys matching the pattern given as its value will stop ++incremental completion and will then execute their usual function. ++ ++@kindex toggle, widget style ++@item @t{toggle} ++This boolean style is used by @t{predict-on} and its related widgets in ++the context `@t{:predict}'. If set to one of the standard `true' values, ++predictive typing is automatically toggled off in situations where it is ++unlikely to be useful, such as when editing a multi-line buffer or after ++moving into the middle of a line and then deleting a character. The ++default is to leave prediction turned on until an explicit call to ++@t{predict-off}. ++ ++@kindex verbose, widget style ++@item @t{verbose} ++This boolean style is used by @t{predict-on} and its related widgets in ++the context `@t{:predict}'. If set to one of the standard `true' values, ++these widgets display a message below the prompt when the predictive state ++is toggled. This is most useful in combination with the @t{toggle} style. ++The default does not display these messages. ++ ++@kindex widget, widget style ++@item @t{widget} ++This style is similar to the @t{command} style: For widget functions that ++use @t{zle} to call other widgets, this style can sometimes be used to ++override the widget which is called. The context for this style is the ++name of the calling widget (@emph{not} the name of the calling function, ++because one function may be bound to multiple widget names). ++ ++@noindent ++@example ++zstyle :copy-earlier-word widget smart-insert-last-word ++@end example ++ ++@noindent ++Check the documentation for the calling widget or function to determine ++whether the @t{widget} style is used. ++ ++@end table ++ ++@noindent ++@node Exception Handling, MIME Functions, ZLE Functions, User Contributions ++ ++@section Exception Handling ++@noindent ++ ++@noindent ++Two functions are provided to enable zsh to provide exception handling in a ++form that should be familiar from other languages. ++ ++@noindent ++@table @asis ++@findex throw ++@item @t{throw} @var{exception} ++The function @t{throw} throws the named @var{exception}. The name is ++an arbitrary string and is only used by the @t{throw} and @t{catch} ++functions. An exception is for the most part treated the same as a ++shell error, i.e. an unhandled exception will cause the shell to abort all ++processing in a function or script and to return to the top level in an ++interactive shell. ++ ++@item @t{catch} @var{exception-pattern} ++The function @t{catch} returns status zero if an exception was thrown and ++the pattern @var{exception-pattern} matches its name. Otherwise it ++returns status 1. @var{exception-pattern} is a standard ++shell pattern, respecting the current setting of the @t{EXTENDED_GLOB} ++option. An alias @t{catch} is also defined to prevent the argument to the ++function from matching filenames, so patterns may be used unquoted. Note ++that as exceptions are not fundamentally different from other shell errors ++it is possible to catch shell errors by using an empty string as the ++exception name. The shell variable @t{CAUGHT} is set by @t{catch} to the ++name of the exception caught. It is possible to rethrow an exception by ++calling the @t{throw} function again once an exception has been caught. ++@findex catch ++ ++@end table ++ ++@noindent ++The functions are designed to be used together with the @t{always} construct ++described in ++@ref{Complex Commands}. This is important as only this ++construct provides the required support for exceptions. A typical example ++is as follows. ++ ++@noindent ++@example ++@{ ++ # "try" block ++ # ... nested code here calls "throw MyExcept" ++@} always @{ ++ # "always" block ++ if catch MyExcept; then ++ print "Caught exception MyExcept" ++ elif catch @value{dsq}; then ++ print "Caught a shell error. Propagating..." ++ throw @value{dsq} ++ fi ++ # Other exceptions are not handled but may be caught further ++ # up the call stack. ++@} ++@end example ++ ++@noindent ++If all exceptions should be caught, the following idiom might be ++preferable. ++ ++@noindent ++@example ++@{ ++ # ... nested code here throws an exception ++@} always @{ ++ if catch *; then ++ case $CAUGHT in ++ (MyExcept) ++ print "Caught my own exception" ++ ;; ++ (*) ++ print "Caught some other exception" ++ ;; ++ esac ++ fi ++@} ++@end example ++ ++@noindent ++In common with exception handling in other languages, the exception may be ++thrown by code deeply nested inside the `try' block. However, note that it ++must be thrown inside the current shell, not in a subshell forked for a ++pipeline, parenthesised current-shell construct, or some form of ++command or process substitution. ++ ++@noindent ++The system internally uses the shell variable @t{EXCEPTION} to record the ++name of the exception between throwing and catching. One drawback of this ++scheme is that if the exception is not handled the variable @t{EXCEPTION} ++remains set and may be incorrectly recognised as the name of an exception ++if a shell error subsequently occurs. Adding @t{unset EXCEPTION} at the ++start of the outermost layer of any code that uses exception handling will ++eliminate this problem. ++ ++@noindent ++@node MIME Functions, Mathematical Functions, Exception Handling, User Contributions ++ ++@section MIME Functions ++@noindent ++ ++@noindent ++Three functions are available to provide handling of files recognised by ++extension, for example to dispatch a file @t{text.ps} when executed as a ++command to an appropriate viewer. ++ ++@noindent ++@table @asis ++@findex zsh-mime-setup ++@findex zsh-mime-handler ++@item @t{zsh-mime-setup} [ @t{-fv} ] [ @t{-l} [ @var{suffix ...} ] ] ++@itemx @t{zsh-mime-handler [-l] @var{command arguments ...}} ++These two functions use the files @t{~/.mime.types} and @t{/etc/mime.types}, ++which associate types and extensions, as well as @t{~/.mailcap} and ++@t{/etc/mailcap} files, which associate types and the programs that ++handle them. These are provided on many systems with the Multimedia ++Internet Mail Extensions. ++ ++@noindent ++To enable the system, the function @t{zsh-mime-setup} should be ++autoloaded and run. This allows files with extensions to be treated ++as executable; such files be completed by the function completion system. ++The function @t{zsh-mime-handler} should not need to be called by the ++user. ++ ++@noindent ++The system works by setting up suffix aliases with `@t{alias -s}'. ++Suffix aliases already installed by the user will not be overwritten. ++ ++@noindent ++For suffixes defined in lower case, upper case variants will also ++automatically be handled (e.g. @t{PDF} is automatically handled if ++handling for the suffix @t{pdf} is defined), but not vice versa. ++ ++@noindent ++Repeated calls to @t{zsh-mime-setup} do not override the existing ++mapping between suffixes and executable files unless the option @t{-f} ++is given. Note, however, that this does not override existing suffix ++aliases assigned to handlers other than @t{zsh-mime-handler}. ++ ++@noindent ++Calling @t{zsh-mime-setup} with the option @t{-l} lists the existing ++mappings without altering them. Suffixes to list (which may contain ++pattern characters that should be quoted from immediate interpretation ++on the command line) may be given as additional arguments, otherwise ++all suffixes are listed. ++ ++@noindent ++Calling @t{zsh-mime-setup} with the option ++@t{-v} causes verbose output to be shown during the setup operation. ++ ++@noindent ++The system respects the @t{mailcap} flags @t{needsterminal} and ++@t{copiousoutput}, see man page mailcap(4). ++ ++@noindent ++The functions use the following styles, which are defined with the ++@t{zstyle} builtin command (@ref{The zsh/zutil Module}). They should be defined ++before @t{zsh-mime-setup} is run. The contexts used all ++start with @t{:mime:}, with additional components in some cases. ++It is recommended that a trailing @t{*} (suitably quoted) be appended ++to style patterns in case the system is extended in future. Some ++examples are given below. ++@table @asis ++@kindex current-shell, MIME style ++@item @t{current-shell} ++If this boolean style is true, the mailcap handler for the context in ++question is run using the @t{eval} builtin instead of by starting a new ++@t{sh} process. This is more efficient, but may not work in the occasional ++cases where the mailcap handler uses strict POSIX syntax. ++ ++@kindex execute-as-is, MIME style ++@item @t{execute-as-is} ++This style gives a list of patterns to be matched against files ++passed for execution with a handler program. If the file matches ++the pattern, the entire command line is executed in its current form, ++with no handler. This is useful for files which might have suffixes ++but nonetheless be executable in their own right. If the style ++is not set, the pattern @t{*(*) *(/)} is used; ++hence executable files are executed directly and not passed to a ++handler, and the option @t{AUTO_CD} may be used to change to directories ++that happen to have MIME suffixes. ++ ++@kindex file-path, MIME style ++@item @t{file-path} ++Used if the style @t{find-file-in-path} is true for the same context. ++Set to an array of directories that are used for searching for the ++file to be handled; the default is the command path given by the ++special parameter @t{path}. The shell option @t{PATH_DIRS} is respected; ++if that is set, the appropriate path will be searched even if the ++name of the file to be handled as it appears on the command line contains ++a `@t{/}'. ++The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style ++@t{handler}. ++ ++@kindex find-file-in-path, MIME style ++@item @t{find-file-in-path} ++If set, allows files whose names do not contain absolute paths ++to be searched for in the command path or the path specified by the ++@t{file-path} style. If the file is not found in the path, it is looked ++for locally (whether or not the current directory is in the path); if it is ++not found locally, the handler will abort unless the @t{handle-nonexistent} ++style is set. Files found in the path are tested as described for ++the style @t{execute-as-is}. ++The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style ++@t{handler}. ++ ++@kindex flags, MIME style ++@item @t{flags} ++Defines flags to go with a handler; the context is as for the ++@t{handler} style, and the format is as for the flags in @t{mailcap}. ++ ++@kindex handle-nonexistent, MIME style ++@item @t{handle-nonexistent} ++By default, arguments that don't correspond to files are not passed ++to the MIME handler in order to prevent it from intercepting commands found ++in the path that happen to have suffixes. This style may be set to ++an array of extended glob patterns for arguments that will be passed to the ++handler even if they don't exist. If it is not explicitly set it ++defaults to @t{[[:alpha:]]#:/*} which allows URLs to be passed to the MIME ++handler even though they don't exist in that format in the file system. ++The full context is @t{:mime:.}@var{suffix}@t{:}, as described for the style ++@t{handler}. ++ ++@kindex handler, MIME style ++@item @t{handler} ++Specifies a handler for a suffix; the suffix is given by the context as ++@t{:mime:.}@var{suffix}@t{:}, and the format of the handler is exactly ++that in @t{mailcap}. Note in particular the `@t{.}' and trailing colon ++to distinguish this use of the context. This overrides any handler ++specified by the @t{mailcap} files. If the handler requires a terminal, ++the @t{flags} style should be set to include the word @t{needsterminal}, ++or if the output is to be displayed through a pager (but not if the ++handler is itself a pager), it should include @t{copiousoutput}. ++ ++@kindex mailcap, MIME style ++@item @t{mailcap} ++A list of files in the format of @t{~/.mailcap} and ++@t{/etc/mailcap} to be read during setup, replacing the default list ++which consists of those two files. The context is @t{:mime:}. ++A @t{+} in the list will be replaced by the default files. ++ ++@kindex mailcap-priorities, MIME style ++@item @t{mailcap-priorities} ++This style is used to resolve multiple mailcap entries for the same MIME ++type. It consists of an array of the following elements, in descending ++order of priority; later entries will be used if earlier entries are ++unable to resolve the entries being compared. If none of the tests ++resolve the entries, the first entry encountered is retained. ++ ++@noindent ++@table @asis ++@item @t{files} ++The order of files (entries in the @t{mailcap} style) read. Earlier ++files are preferred. (Note this does not resolve entries in the same file.) ++ ++@item @t{priority} ++The priority flag from the mailcap entry. The priority is an integer ++from 0 to 9 with the default value being 5. ++ ++@item @t{flags} ++The test given by the @t{mailcap-prio-flags} option is used to resolve ++entries. ++ ++@item @t{place} ++Later entries are preferred; as the entries are strictly ordered, this ++test always succeeds. ++ ++@end table ++ ++@noindent ++Note that as this style is handled during initialisation, the context ++is always @t{:mime:}, with no discrimination by suffix. ++ ++@kindex mailcap-prio-flags, MIME style ++@item @t{mailcap-prio-flags} ++This style is used when the keyword @t{flags} is encountered in the ++list of tests specified by the @t{mailcap-priorities} style. ++It should be set to a list of patterns, each of which is tested against ++the flags specified in the mailcap entry (in other words, the sets of ++assignments found with some entries in the mailcap file). Earlier ++patterns in the list are preferred to later ones, and matched patterns ++are preferred to unmatched ones. ++ ++@kindex mime-types, MIME style ++@item @t{mime-types} ++A list of files in the format of @t{~/.mime.types} and ++@t{/etc/mime.types} to be read during setup, replacing the default list ++which consists of those two files. The context is @t{:mime:}. ++A @t{+} in the list will be replaced by the default files. ++ ++@kindex never-background, MIME style ++@item @t{never-background} ++If this boolean style is set, the handler for the given context is ++always run in the foreground, even if the flags provided in the mailcap ++entry suggest it need not be (for example, it doesn't require a ++terminal). ++ ++@kindex pager, MIME style ++@item @t{pager} ++If set, will be used instead of @t{$PAGER} or @t{more} to handle ++suffixes where the @t{copiousoutput} flag is set. The context is ++as for @t{handler}, i.e. @t{:mime:.}@var{suffix}@t{:} for handling ++a file with the given @var{suffix}. ++ ++@end table ++ ++@noindent ++Examples: ++ ++@noindent ++@example ++zstyle ':mime:*' mailcap ~/.mailcap /usr/local/etc/mailcap ++zstyle ':mime:.txt:' handler less %s ++zstyle ':mime:.txt:' flags needsterminal ++@end example ++ ++@noindent ++When @t{zsh-mime-setup} is subsequently run, it will look for ++@t{mailcap} entries in the two files given. Files of suffix @t{.txt} ++will be handled by running `@t{less} @var{file.txt}'. The flag ++@t{needsterminal} is set to show that this program must run attached to a ++terminal. ++ ++@noindent ++As there are several steps to dispatching a command, the following ++should be checked if attempting to execute a file by extension ++@t{.}@var{ext} does not have the expected effect. ++ ++@noindent ++The command `@t{alias -s} @var{ext}' should show ++`@t{ps=zsh-mime-handler}'. If it shows something else, another suffix ++alias was already installed and was not overwritten. If it shows ++nothing, no handler was installed: this is most likely because no ++handler was found in the @t{.mime.types} and @t{mailcap} combination for ++@t{.ext} files. In that case, appropriate handling should be added to ++@t{~/.mime.types} and @t{mailcap}. ++ ++@noindent ++If the extension is handled by @t{zsh-mime-handler} but the file is ++not opened correctly, either the handler defined for the type is ++incorrect, or the flags associated with it are in appropriate. Running ++@t{zsh-mime-setup -l} will show the handler and, if there are any, the ++flags. A @t{%s} in the handler is replaced by the file (suitably quoted ++if necessary). Check that the handler program listed lists and can ++be run in the way shown. Also check that the flags @t{needsterminal} or ++@t{copiousoutput} are set if the handler needs to be run under a ++terminal; the second flag is used if the output should be sent to a pager. ++An example of a suitable @t{mailcap} entry for such a program is: ++ ++@noindent ++@example ++text/html; /usr/bin/lynx '%s'; needsterminal ++@end example ++ ++@noindent ++Running `@t{zsh-mime-handler -l} @var{command line}' prints the command ++line that would be executed, simplified to remove the effect of any ++flags, and quoted so that the output can be run as a complete zsh ++command line. This is used by the completion system to decide how to ++complete after a file handled by @t{zsh-mime-setup}. ++ ++@findex pick-web-browser ++@item @t{pick-web-browser} ++This function is separate from the two MIME functions described above ++and can be assigned directly to a suffix: ++ ++@noindent ++@example ++autoload -U pick-web-browser ++alias -s html=pick-web-browser ++@end example ++ ++@noindent ++It is provided as an intelligent front end to dispatch a web browser. ++It may be run as either a function or a shell script. The status ++255 is returned if no browser could be started. ++ ++@noindent ++Various styles are available to customize the choice of browsers: ++ ++@noindent ++@table @asis ++@item @t{browser-style} ++The value of the style is an array giving preferences in decreasing order ++for the type of browser to use. The values of elements may be ++ ++@noindent ++@table @asis ++@item @t{running} ++Use a GUI browser that is already running when an X Window display is ++available. The browsers listed in the @t{x-browsers} style are tried ++in order until one is found; if it is, the file will be displayed in ++that browser, so the user may need to check whether it has appeared. ++If no running browser is found, one is not started. Browsers other than ++Firefox, Opera and Konqueror are assumed to understand the Mozilla ++syntax for opening a URL remotely. ++ ++@item @t{x} ++Start a new GUI browser when an X Window display is available. Search for ++the availability of one of the browsers listed in the @t{x-browsers} style ++and start the first one that is found. No check is made for an already ++running browser. ++ ++@item @t{tty} ++Start a terminal-based browser. Search for the availability of one ++of the browsers listed in the @t{tty-browsers} style and start the ++first one that is found. ++ ++@end table ++ ++@noindent ++If the style is not set the default @t{running x tty} is used. ++ ++@item @t{x-browsers} ++An array in decreasing order ++of preference of browsers to use when running under the X Window System. ++The array consists of the command name under which to start the ++browser. They are looked up in the context @t{:mime:} (which may ++be extended in future, so appending `@t{*}' is recommended). For ++example, ++ ++@noindent ++@example ++zstyle ':mime:*' x-browsers opera konqueror firefox ++@end example ++ ++@noindent ++specifies that @t{pick-web-browser} should first look for a running ++instance of Opera, Konqueror or Firefox, in that order, and if it ++fails to find any should attempt to start Opera. The default is ++@t{firefox mozilla netscape opera konqueror}. ++ ++@item @t{tty-browsers} ++An array similar to @t{x-browsers}, except that it gives browsers to ++use when no X Window display is available. The default is ++@t{elinks links lynx}. ++ ++@item @t{command} ++If it is set this style is used to pick the command ++used to open a page for a browser. The context is ++@t{:mime:browser:new:$browser:} to start a new browser or ++@t{:mime:browser:running:$browser:} to open a URL in a browser already ++running on the current X display, where @t{$browser} is the value matched ++in the @t{x-browsers} or @t{tty-browsers} style. The escape sequence ++@t{%b} in the style's value will be replaced by the browser, while @t{%u} ++will be replaced by the URL. If the style is not set, the default for all ++new instances is equivalent to @t{%b %u} and the defaults for using running ++browsers are equivalent to the values @t{kfmclient openURL %u} for ++Konqueror, @t{firefox -new-tab %u} for Firefox, @t{opera -newpage %u} ++for Opera, and @t{%b -remote "openUrl(%u)"} for all others. ++ ++@end table ++ ++@end table ++ ++@noindent ++@node Mathematical Functions, User Configuration Functions, MIME Functions, User Contributions ++ ++@section Mathematical Functions ++@noindent ++ ++@noindent ++@table @asis ++@findex zcalc ++@item @t{zcalc} [ @var{expression} ... ] ++A reasonably powerful calculator based on zsh's arithmetic evaluation ++facility. The syntax is similar to that of formulae in most programming ++languages; see ++@ref{Arithmetic Evaluation} for details. The mathematical ++library @t{zsh/mathfunc} will be loaded if it is available; see ++@ref{The zsh/mathfunc Module}. The mathematical functions ++correspond to the raw system libraries, so trigonometric functions are ++evaluated using radians, and so on. ++ ++@noindent ++Each line typed is evaluated as an expression. The prompt shows a number, ++which corresponds to a positional parameter where the result of that ++calculation is stored. For example, the result of the calculation on the ++line preceded by `@t{4> }' is available as @t{$4}. The last value ++calculated is available as @t{ans}. Full command line editing, including ++the history of previous calculations, is available; the history is saved in ++the file @t{~/.zcalc_history}. To exit, enter a blank line or type `@t{:q}' ++on its own (`@t{q}' is allowed for historical compatibility). ++ ++@noindent ++If arguments are given to @t{zcalc} on start up, they are used to prime the ++first few positional parameters. A visual indication of this is given when ++the calculator starts. ++ ++@noindent ++The constants @t{PI} (3.14159...) and @t{E} (2.71828...) are provided. ++Parameter assignment is possible, but note that all parameters will be put ++into the global namespace. ++ ++@noindent ++The output base can be initialised by passing the option `@t{-#}@var{base}', ++for example `@t{zcalc -#16}' (the `@t{#}' may have to be quoted, depending ++on the globbing options set). ++ ++@noindent ++The prompt is configurable via the parameter @t{ZCALCPROMPT}, which ++undergoes standard prompt expansion. The index of the current entry is ++stored locally in the first element of the array @t{psvar}, which can be ++referred to in @t{ZCALCPROMPT} as `@t{%1v}'. The default prompt is ++`@t{%1v> }'. ++ ++@noindent ++A few special commands are available; these are introduced by a colon. ++For backward compatibility, the colon may be omitted for certain ++commands. Completion is available if @t{compinit} has been run. ++ ++@noindent ++The output precision may be specified within zcalc by special commands ++familiar from many calculators. ++@table @asis ++@item @t{:norm} ++The default output format. It corresponds to the printf @t{%g} ++specification. Typically this shows six decimal digits. ++ ++@item @t{:sci} @var{digits} ++Scientific notation, corresponding to the printf @t{%g} output format with ++the precision given by @var{digits}. This produces either fixed point or ++exponential notation depending on the value output. ++ ++@item @t{:fix} @var{digits} ++Fixed point notation, corresponding to the printf @t{%f} output format with ++the precision given by @var{digits}. ++ ++@item @t{:eng} @var{digits} ++Exponential notation, corresponding to the printf @t{%E} output format with ++the precision given by @var{digits}. ++ ++@item @t{:raw} ++Raw output: this is the default form of the output from a math ++evaluation. This may show more precision than the number actually ++possesses. ++ ++@end table ++ ++@noindent ++Other special commands: ++@table @asis ++@item @t{:!}@var{line...} ++Execute @var{line...} as a normal shell command line. Note that it ++is executed in the context of the function, i.e. with local variables. ++Space is optional after @t{:!}. ++ ++@item @t{:local} @var{arg} ... ++Declare variables local to the function. Note that certain variables ++are used by the function for its own purposes. Other variables ++may be used, too, but they will be taken from or put into the global ++scope. ++ ++@item @t{:function} @var{name} [ @var{body} ] ++Define a mathematical function or (with no @var{body}) delete it. ++The function is defined using @t{zmathfuncdef}, see below. ++ ++@noindent ++Note that @t{zcalc} takes care of all quoting. Hence for example: ++ ++@noindent ++@example ++function cube $1 * $1 * $1 ++@end example ++ ++@noindent ++defines a function to cube the sole argument. ++ ++@item @t{[#}@var{base}@t{]} ++This is not a special command, rather part of normal arithmetic ++syntax; however, when this form appears on a line by itself the default ++output radix is set to @var{base}. Use, for example, `@t{[#16]}' to display ++hexadecimal output preceded by an indication of the base, or `@t{[##16]}' ++just to display the raw number in the given base. Bases themselves are ++always specified in decimal. `@t{[#]}' restores the normal output format. ++Note that setting an output base suppresses floating point output; use ++`@t{[#]}' to return to normal operation. ++ ++@end table ++ ++@noindent ++See the comments in the function for a few extra tips. ++ ++@findex zmathfuncdef ++@item @t{zmathfuncdef} [ @var{mathfunc} [ @var{body} ] ] ++A convenient front end to @t{functions -M}. ++ ++@noindent ++With two arguments, define a mathematical function named @var{mathfunc} ++which can be used in any form of arithmetic evaluation. @var{body} ++is a mathematical expression to implement the function. It may ++contain references to position parameters @t{$1}, @t{$2}, ... ++to refer to mandatory parameters and @t{$@{1:-}@var{defvalue}@t{@}} ... ++to refer to optional parameters. Note that the forms must be ++strictly adhered to for the function to calculate the correct number ++of arguments. The implementation is held in a shell function named ++@t{zsh_math_func_}@var{mathfunc}; usually the user will not need ++to refer to the shell function directly. Any existing function ++of the same name is silently replaced. ++ ++@noindent ++With one argument, remove the mathematical function @var{mathfunc} ++as well as the shell function implementation. ++ ++@noindent ++With no arguments, list all @var{mathfunc} functions in a form ++suitable for restoring the definition. ++The functions have not necessarily been defined by @t{zmathfuncdef}. ++ ++@end table ++ ++@noindent ++@node User Configuration Functions, Other Functions, Mathematical Functions, User Contributions ++ ++@section User Configuration Functions ++@noindent ++ ++@noindent ++The @t{zsh/newuser} module comes with a function to aid in configuring ++shell options for new users. If the module is installed, this function can ++also be run by hand. It is available even if the module's default ++behaviour, namely running the function for a new user logging in without ++startup files, is inhibited. ++ ++@noindent ++@table @asis ++@item @t{zsh-newuser-install} [ @t{-f} ] ++The function presents the user with various options for customizing ++their initialization scripts. Currently only @t{~/.zshrc} is handled. ++@t{$ZDOTDIR/.zshrc} is used instead if the parameter @t{ZDOTDIR} is ++set; this provides a way for the user to configure a file without ++altering an existing @t{.zshrc}. ++ ++@noindent ++By default the function exits immediately if it finds any of the files ++@t{.zshenv}, @t{.zprofile}, @t{.zshrc}, or @t{.zlogin} in the appropriate ++directory. The option @t{-f} is required in order to force the function ++to continue. Note this may happen even if @t{.zshrc} itself does not ++exist. ++ ++@noindent ++As currently configured, the function will exit immediately if the ++user has root privileges; this behaviour cannot be overridden. ++ ++@noindent ++Once activated, the function's behaviour is supposed to be ++self-explanatory. Menus are present allowing the user to alter ++the value of options and parameters. Suggestions for improvements are ++always welcome. ++ ++@noindent ++When the script exits, the user is given the opportunity to save the new ++file or not; changes are not irreversible until this point. However, ++the script is careful to restrict changes to the file only to a group ++marked by the lines `@t{# Lines configured by zsh-newuser-install}' and ++`@t{# End of lines configured by zsh-newuser-install}'. In addition, ++the old version of @t{.zshrc} is saved to a file with the suffix ++@t{.zni} appended. ++ ++@noindent ++If the function edits an existing @t{.zshrc}, it is up to the user ++to ensure that the changes made will take effect. For example, if ++control usually returns early from the existing @t{.zshrc} the lines ++will not be executed; or a later initialization file may override ++options or parameters, and so on. The function itself does not attempt to ++detect any such conflicts. ++ ++@end table ++ ++@noindent ++@node Other Functions, , User Configuration Functions, User Contributions ++ ++@section Other Functions ++@noindent ++ ++@noindent ++There are a large number of helpful functions in the @t{Functions/Misc} ++directory of the zsh distribution. Most are very simple and do not ++require documentation here, but a few are worthy of special mention. ++ ++@noindent ++ ++@subsection Descriptions ++@noindent ++ ++@noindent ++@table @asis ++@findex colors ++@item @t{colors} ++This function initializes several associative arrays to map color names to ++(and from) the ANSI standard eight-color terminal codes. These are used ++by the prompt theme system (@ref{Prompt Themes}). You seldom should need to run ++@t{colors} more than once. ++ ++@noindent ++The eight base colors are: black, red, green, yellow, blue, magenta, cyan, ++and white. Each of these has codes for foreground and background. In ++addition there are eight intensity attributes: bold, faint, standout, ++underline, blink, reverse, and conceal. Finally, there are six codes used ++to negate attributes: none (reset all attributes to the defaults), normal ++(neither bold nor faint), no-standout, no-underline, no-blink, and ++no-reverse. ++ ++@noindent ++Some terminals do not support all combinations of colors and intensities. ++ ++@noindent ++The associative arrays are: ++ ++@noindent ++@table @asis ++@item color ++@itemx colour ++Map all the color names to their integer codes, and integer codes to the ++color names. The eight base names map to the foreground color codes, as ++do names prefixed with `@t{fg-}', such as `@t{fg-red}'. Names prefixed ++with `@t{bg-}', such as `@t{bg-blue}', refer to the background codes. The ++reverse mapping from code to color yields base name for foreground codes ++and the @t{bg-} form for backgrounds. ++ ++@noindent ++Although it is a misnomer to call them `colors', these arrays also map the ++other fourteen attributes from names to codes and codes to names. ++ ++@item fg ++@itemx fg_bold ++@itemx fg_no_bold ++Map the eight basic color names to ANSI terminal escape sequences that set ++the corresponding foreground text properties. The @t{fg} sequences change ++the color without changing the eight intensity attributes. ++ ++@item bg ++@itemx bg_bold ++@itemx bg_no_bold ++Map the eight basic color names to ANSI terminal escape sequences that set ++the corresponding background properties. The @t{bg} sequences change the ++color without changing the eight intensity attributes. ++ ++@end table ++ ++@noindent ++In addition, the scalar parameters @t{reset_color} and @t{bold_color} are ++set to the ANSI terminal escapes that turn off all attributes and turn on ++bold intensity, respectively. ++ ++@findex fned ++@item @t{fned} @var{name} ++Same as @t{zed -f}. This function does not appear in the zsh ++distribution, but can be created by linking @t{zed} to the name @t{fned} ++in some directory in your @t{fpath}. ++ ++@findex is-at-least ++@item @t{is-at-least} @var{needed} [ @var{present} ] ++Perform a greater-than-or-equal-to comparison of two strings having the ++format of a zsh version number; that is, a string of numbers and text with ++segments separated by dots or dashes. If the @var{present} string is not ++provided, @t{$ZSH_VERSION} is used. Segments are paired left-to-right in ++the two strings with leading non-number parts ignored. If one string has ++fewer segments than the other, the missing segments are considered zero. ++ ++@noindent ++This is useful in startup files to set options and other state that are ++not available in all versions of zsh. ++ ++@noindent ++@example ++is-at-least 3.1.6-15 && setopt NO_GLOBAL_RCS ++is-at-least 3.1.0 && setopt HIST_REDUCE_BLANKS ++is-at-least 2.6-17 || print "You can't use is-at-least here." ++@end example ++ ++@findex nslookup ++@item @t{nslookup} [ @var{arg} ... ] ++This wrapper function for the @t{nslookup} command requires the ++@t{zsh/zpty} module (see ++@ref{The zsh/zpty Module}). It behaves exactly like the standard @t{nslookup} ++except that it provides customizable prompts (including a right-side ++prompt) and completion of nslookup commands, host names, etc. (if you use ++the function-based completion system). Completion styles may be set with ++the context prefix `@t{:completion:nslookup}'. ++ ++@noindent ++See also the @t{pager}, @t{prompt} and @t{rprompt} styles below. ++ ++@findex regexp-replace ++@item @t{regexp-replace} @var{var} @var{regexp} @var{replace} ++Use regular expressions to perform a global search and replace operation ++on a variable. If the option @t{RE_MATCH_PCRE} is not set, POSIX ++extended regular expressions are used, else Perl-compatible regular ++expressions (this requires the shell to be linked against the @t{pcre} ++library). ++ ++@noindent ++@var{var} is the name of the variable containing the string to be matched. ++The variable will be modified directly by the function. The ++variables @t{MATCH}, @t{MBEGIN}, @t{MEND}, @t{match}, @t{mbegin}, @t{mend} ++should be avoided as these are used by the regular expression code. ++ ++@noindent ++@var{regexp} is the regular expression to match against the string. ++ ++@noindent ++@var{replace} is the replacement text. This can contain parameter, command ++and arithmetic expressions which will be replaced: in particular, a ++reference to @t{$MATCH} will be replaced by the text matched by the pattern. ++ ++@noindent ++The return status is 0 if at least one match was performed, else 1. ++ ++@findex run-help ++@item @t{run-help} @var{cmd} ++This function is designed to be invoked by the @t{run-help} ZLE widget, ++in place of the default alias. See `Accessing On-Line Help' ++(@ref{Utilities}) for setup instructions. ++ ++@noindent ++In the discussion which follows, if @var{cmd} is a file system path, it is ++first reduced to its rightmost component (the file name). ++ ++@noindent ++Help is first sought by looking for a file named @var{cmd} in the directory ++named by the @t{HELPDIR} parameter. If no file is found, an assistant ++function, alias, or command named @t{run-help-@var{cmd}} is sought. If ++found, the assistant is executed with the rest of the current command line ++(everything after the command name @var{cmd}) as its arguments. When ++neither file nor assistant is found, the external command ++`@t{man} @var{cmd}' is run. ++ ++@noindent ++An example assistant for the "ssh" command: ++ ++@noindent ++@example ++run-help-ssh() @{ ++ emulate -LR zsh ++ local -a args ++ # Delete the "-l username" option ++ zparseopts -D -E -a args l: ++ # Delete other options, leaving: host command ++ args=($@{@@:#-*@}) ++ if [[ $@{#args@} -lt 2 ]]; then ++ man ssh ++ else ++ run-help $args[2] ++ fi ++@} ++@end example ++ ++@noindent ++Several of these assistants are provided in the @t{Functions/Misc} ++directory. These must be autoloaded, or placed as executable scripts in ++your search path, in order to be found and used by @t{run-help}. ++ ++@noindent ++@table @asis ++@findex run-help-git ++@findex run-help-svk ++@findex run-help-svn ++@item @t{run-help-git} ++@itemx @t{run-help-svk} ++@itemx @t{run-help-svn} ++Assistant functions for the @t{git}, @t{svk}, and @t{svn} commands. ++ ++@end table ++ ++@item @t{tetris} ++Zsh was once accused of not being as complete as Emacs, ++because it lacked a Tetris game. This function was written to ++refute this vicious slander. ++ ++@noindent ++This function must be used as a ZLE widget: ++ ++@noindent ++@example ++autoload -U tetris ++zle -N tetris ++bindkey @var{keys} tetris ++@end example ++ ++@noindent ++To start a game, execute the widget by typing the @var{keys}. Whatever command ++line you were editing disappears temporarily, and your keymap is also ++temporarily replaced by the Tetris control keys. The previous editor state ++is restored when you quit the game (by pressing `@t{q}') or when you lose. ++ ++@noindent ++If you quit in the middle of a game, the next invocation of the @t{tetris} ++widget will continue where you left off. If you lost, it will start a new ++game. ++ ++@findex zargs ++@item @t{zargs} [ @var{option} ... @t{-}@t{-} ] [ @var{input} ... ] [ @t{-}@t{-} @var{command} [ @var{arg} ... ] ] ++This function works like GNU xargs, except that instead of reading lines ++of arguments from the standard input, it takes them from the command line. ++This is useful because zsh, especially with recursive glob operators, ++often can construct a command line for a shell function that is longer ++than can be accepted by an external command. ++ ++@noindent ++The @var{option} list represents options of the @t{zargs} command itself, ++which are the same as those of @t{xargs}. The @var{input} list is the ++collection of strings (often file names) that become the arguments of the ++@t{command}, analogous to the standard input of @t{xargs}. Finally, the ++@var{arg} list consists of those arguments (usually options) that are ++passed to the @var{command} each time it runs. The @var{arg} list precedes ++the elements from the @t{input} list in each run. If no @var{command} is ++provided, then no @var{arg} list may be provided, and in that event the ++default command is `@t{print}' with arguments `@t{-r -}@t{-}'. ++ ++@noindent ++For example, to get a long @t{ls} listing of all plain files in the ++current directory or its subdirectories: ++ ++@noindent ++@example ++autoload -U zargs ++zargs -- **/*(.) -- ls -l ++@end example ++ ++@noindent ++Note that `@t{-}@t{-}' is used both to mark the end of the @var{option} ++list and to mark the end of the @var{input} list, so it must appear twice ++whenever the @var{input} list may be empty. If there is guaranteed to be ++at least one @var{input} and the first @var{input} does not begin with a ++`@t{-}', then the first `@t{-}@t{-}' may be omitted. ++ ++@noindent ++In the event that the string `@t{-}@t{-}' is or may be an @var{input}, the ++@t{-e} option may be used to change the end-of-inputs marker. Note that ++this does @emph{not} change the end-of-options marker. For example, to use ++`@t{..}' as the marker: ++ ++@noindent ++@example ++zargs -e.. -- **/*(.) .. ls -l ++@end example ++ ++@noindent ++This is a good choice in that example because no plain file can be named ++`@t{..}', but the best end-marker depends on the circumstances. ++ ++@noindent ++For details of the other @t{zargs} options, see man page xargs(1) or run ++@t{zargs} with the @t{-}@t{-help} option. ++ ++@findex zed ++@item @t{zed} [ @t{-f} ] @var{name} ++@itemx @t{zed -b} ++This function uses the ZLE editor to edit a file or function. ++ ++@noindent ++Only one @var{name} argument is allowed. ++If the @t{-f} option is given, the name is taken to be that of ++a function; if the function is marked for autoloading, @t{zed} searches ++for it in the @t{fpath} and loads it. Note that functions edited this way ++are installed into the current shell, but @emph{not} written back to the ++autoload file. ++ ++@noindent ++Without @t{-f}, @var{name} is the path name of the file to edit, which need ++not exist; it is created on write, if necessary. ++ ++@noindent ++While editing, the function sets the main keymap to @t{zed} and the ++vi command keymap to @t{zed-vicmd}. These will be copied from the existing ++@t{main} and @t{vicmd} keymaps if they do not exist the first time @t{zed} ++is run. They can be used to provide special key bindings used only in zed. ++ ++@noindent ++If it creates the keymap, @t{zed} rebinds the return key to insert a line ++break and `@t{^X^W}' to accept the edit in the @t{zed} keymap, and binds ++`@t{ZZ}' to accept the edit in the @t{zed-vicmd} keymap. ++ ++@noindent ++The bindings alone can be installed by running `@t{zed -b}'. This is ++suitable for putting into a startup file. Note that, if rerun, ++this will overwrite the existing @t{zed} and @t{zed-vicmd} keymaps. ++ ++@noindent ++Completion is available, and styles may be set with the context prefix ++`@t{:completion:zed}'. ++ ++@noindent ++A zle widget @t{zed-set-file-name} is available. This can be called by ++name from within zed using `@t{\ex zed-set-file-name}' (note, however, that ++because of zed's rebindings you will have to type @t{^j} at the end instead ++of the return key), or can be bound to a key in either of the @t{zed} or ++@t{zed-vicmd} keymaps after `@t{zed -b}' has been run. When the widget is ++called, it prompts for a new name for the file being edited. When zed ++exits the file will be written under that name and the original file will ++be left alone. The widget has no effect with `@t{zed -f}'. ++ ++@noindent ++While @t{zed-set-file-name} is running, zed uses the keymap ++@t{zed-normal-keymap}, which is linked from the main keymap in effect ++at the time zed initialised its bindings. (This is to make the return key ++operate normally.) The result is that if the main keymap has been changed, ++the widget won't notice. This is not a concern for most users. ++ ++@findex zcp ++@findex zln ++@item @t{zcp} [ @t{-finqQvwW} ] @var{srcpat} @var{dest} ++@itemx @t{zln} [ @t{-finqQsvwW} ] @var{srcpat} @var{dest} ++Same as @t{zmv -C} and @t{zmv -L}, respectively. These functions do not ++appear in the zsh distribution, but can be created by linking @t{zmv} to ++the names @t{zcp} and @t{zln} in some directory in your @t{fpath}. ++ ++@item @t{zkbd} ++See `Keyboard Definition' ++(@ref{Utilities}). ++ ++@findex zmv ++@item @t{zmv} [ @t{-finqQsvwW} ] [ -C | -L | -M | -p @var{program} ] [ -o @var{optstring} ] @var{srcpat} @var{dest} ++Move (usually, rename) files matching the pattern @var{srcpat} to ++corresponding files having names of the form given by @var{dest}, where ++@var{srcpat} contains parentheses surrounding patterns which will be ++replaced in turn by $1, $2, ... in @var{dest}. For example, ++ ++@noindent ++@example ++zmv '(*).lis' '$1.txt' ++@end example ++ ++@noindent ++renames `@t{foo.lis}' to `@t{foo.txt}', `@t{my.old.stuff.lis}' to ++`@t{my.old.stuff.txt}', and so on. ++ ++@noindent ++The pattern is always treated as an @t{EXTENDED_GLOB} pattern. Any file ++whose name is not changed by the substitution is simply ignored. Any ++error (a substitution resulted in an empty string, two substitutions gave ++the same result, the destination was an existing regular file and @t{-f} ++was not given) causes the entire function to abort without doing anything. ++ ++@noindent ++Options: ++ ++@noindent ++@table @asis ++@item @t{-f} ++Force overwriting of destination files. Not currently ++passed down to the @t{mv}/@t{cp}/@t{ln} command due to vagaries of ++implementations (but you can use @t{-o-f} to do that). ++@item @t{-i} ++Interactive: show each line to be executed and ask the user ++whether to execute it. `Y' or `y' will execute it, anything else will ++skip it. Note that you just need to type one character. ++@item @t{-n} ++No execution: print what would happen, but don't do it. ++@item @t{-q} ++Turn bare glob qualifiers off: now assumed by default, so ++this has no effect. ++@item @t{-Q} ++Force bare glob qualifiers on. Don't turn this on unless ++you are actually using glob qualifiers in a pattern. ++@item @t{-s} ++Symbolic, passed down to @t{ln}; only works with @t{-L}. ++@item @t{-v} ++Verbose: print each command as it's being executed. ++@item @t{-w} ++Pick out wildcard parts of the pattern, as described above, ++and implicitly add parentheses for referring to them. ++@item @t{-W} ++Just like @t{-w}, with the addition of turning wildcards in ++the replacement pattern into sequential $@{1@} .. $@{N@} references. ++@item @t{-C} ++@itemx @t{-L} ++@itemx @t{-M} ++Force @t{cp}, @t{ln} or @t{mv}, respectively, regardless of ++the name of the function. ++@item @t{-p} @var{program} ++Call @var{program} instead of @t{cp}, @t{ln} or ++@t{mv}. Whatever it does, it should at least understand the form ++@example ++@var{program} @t{-}@t{-} @var{oldname} @var{newname} ++@end example ++where @var{oldname} and @var{newname} are filenames generated by @t{zmv}. ++@item @t{-o} @var{optstring} ++The @var{optstring} is split into words and ++passed down verbatim to the @t{cp}, @t{ln} or @t{mv} command called to ++perform the work. It should probably begin with a `@t{-}'. ++@end table ++ ++@noindent ++Further examples: ++ ++@noindent ++@example ++zmv -v '(* *)' '$@{1// /_@}' ++@end example ++ ++@noindent ++For any file in the current directory with at least one space in the name, ++replace every space by an underscore and display the commands executed. ++ ++@noindent ++For more complete examples and other implementation details, see the ++@t{zmv} source file, usually located in one of the directories named in ++your @t{fpath}, or in @t{Functions/Misc/zmv} in the zsh distribution. ++ ++@item @t{zrecompile} ++See `Recompiling Functions' ++(@ref{Utilities}). ++ ++@findex zstyle+ ++@item @t{zstyle+} @var{context} @var{style} @var{value} [ + @var{subcontext} @var{style} @var{value} ... ] ++This makes defining styles a bit simpler by using a single `@t{+}' as a ++special token that allows you to append a context name to the previously ++used context name. Like this: ++ ++@noindent ++@example ++zstyle+ ':foo:bar' style1 value1 \ ++ +':baz' style2 value2 \ ++ +':frob' style3 value3 ++@end example ++ ++@noindent ++This defines `style1' with `value1' for the context @t{:foo:bar} as usual, ++but it also defines `style2' with `value2' for the context ++@t{:foo:bar:baz} and `style3' with `value3' for @t{:foo:bar:frob}. Any ++@var{subcontext} may be the empty string to re-use the first context ++unchanged. ++ ++@end table ++ ++@noindent ++ ++@subsection Styles ++@noindent ++ ++@noindent ++@table @asis ++@kindex insert-tab, completion style ++@item @t{insert-tab} ++The @t{zed} function @emph{sets} this style in context `@t{:completion:zed:*}' ++to turn off completion when @t{TAB} is typed at the beginning of a line. ++You may override this by setting your own value for this context and style. ++ ++@kindex pager, nslookup style ++@item @t{pager} ++The @t{nslookup} function looks up this style in the context ++`@t{:nslookup}' to determine the program used to display output that does ++not fit on a single screen. ++ ++@kindex prompt, nslookup style ++@kindex rprompt, nslookup style ++@item @t{prompt} ++@itemx @t{rprompt} ++The @t{nslookup} function looks up this style in the context ++`@t{:nslookup}' to set the prompt and the right-side prompt, respectively. ++The usual expansions for the @t{PS1} and @t{RPS1} parameters may be used ++(see ++@ref{Prompt Expansion}). ++ ++@end table ++@c (avoiding a yodl bug) ++@c (avoiding a yodl bug) ++@c (avoiding a yodl bug) ++@c Yodl file: Zsh/index.yo ++@node Concept Index, Variables Index, Top, Top ++@page ++@unnumbered Concept Index ++ ++@printindex cp ++ ++@noindent ++@node Variables Index, Options Index, Concept Index, Top ++@page ++@unnumbered Variables Index ++ ++@printindex vr ++ ++@noindent ++@node Options Index, Functions Index, Variables Index, Top ++@page ++@unnumbered Options Index ++ ++@printindex pg ++ ++@noindent ++@node Functions Index, Editor Functions Index, Options Index, Top ++@page ++@unnumbered Functions Index ++ ++@printindex fn ++ ++@noindent ++@node Editor Functions Index, Style and Tag Index, Functions Index, Top ++@page ++@unnumbered Editor Functions Index ++ ++@printindex tp ++ ++@noindent ++@node Style and Tag Index, , Editor Functions Index, Top ++@page ++@unnumbered Style and Tag Index ++ ++@printindex ky ++@c (avoiding a yodl bug) ++ ++@contents ++@bye +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshcontrib.1 +@@ -0,0 +1,4365 @@ ++.TH "ZSHCONTRIB" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshcontrib \- user contributions to zsh ++.\" Yodl file: Zsh/contrib.yo ++.SH "DESCRIPTION" ++.PP ++The Zsh source distribution includes a number of items contributed by the ++user community\&. These are not inherently a part of the shell, and some ++may not be available in every zsh installation\&. The most significant of ++these are documented here\&. For documentation on other contributed items ++such as shell functions, look for comments in the function source files\&. ++.PP ++.PP ++.SH "UTILITIES" ++.PP ++.SS "Accessing On\-Line Help" ++.PP ++The key sequence \fBESC h\fP is normally bound by ZLE to execute the ++\fBrun\-help\fP widget (see ++\fIzshzle\fP(1))\&. This invokes the \fBrun\-help\fP command with the command word from the ++current input line as its argument\&. By default, \fBrun\-help\fP is an alias ++for the \fBman\fP command, so this often fails when the command word is a ++shell builtin or a user\-defined function\&. By redefining the \fBrun\-help\fP ++alias, one can improve the on\-line help provided by the shell\&. ++.PP ++The \fBhelpfiles\fP utility, found in the \fBUtil\fP directory of the ++distribution, is a Perl program that can be used to process the zsh manual ++to produce a separate help file for each shell builtin and for many other ++shell features as well\&. The autoloadable \fBrun\-help\fP function, found in ++\fBFunctions/Misc\fP, searches for these helpfiles and performs several ++other tests to produce the most complete help possible for the command\&. ++.PP ++There may already be a directory of help files on your system; look in ++\fB/usr/share/zsh\fP or \fB/usr/local/share/zsh\fP and subdirectories below ++those, or ask your system administrator\&. ++.PP ++To create your own help files with \fBhelpfiles\fP, choose or create a ++directory where the individual command help files will reside\&. For ++example, you might choose \fB~/zsh_help\fP\&. If you unpacked the zsh ++distribution in your home directory, you would use the commands: ++.PP ++.RS ++.nf ++\fBmkdir ~/zsh_help ++cd ~/zsh_help ++man zshall | colcrt \- | \e ++perl ~/zsh\-4\&.3\&.12\-dev\-1/Util/helpfiles\fP ++.fi ++.RE ++.PP ++Next, to use the \fBrun\-help\fP function, you need to add lines something ++like the following to your \fB\&.zshrc\fP or equivalent startup file: ++.PP ++.RS ++.nf ++\fBunalias run\-help ++autoload run\-help ++HELPDIR=~/zsh_help\fP ++.fi ++.RE ++.PP ++The \fBHELPDIR\fP parameter tells \fBrun\-help\fP where to look for the help ++files\&. If your system already has a help file directory installed, set ++\fBHELPDIR\fP to the path of that directory instead\&. ++.PP ++Note that in order for `\fBautoload run\-help\fP\&' to work, the \fBrun\-help\fP ++file must be in one of the directories named in your \fBfpath\fP array (see ++\fIzshparam\fP(1))\&. This should already be the case if you have a standard zsh ++installation; if it is not, copy \fBFunctions/Misc/run\-help\fP to an ++appropriate directory\&. ++.PP ++.SS "Recompiling Functions" ++.PP ++If you frequently edit your zsh functions, or periodically update your zsh ++installation to track the latest developments, you may find that function ++digests compiled with the \fBzcompile\fP builtin are frequently out of date ++with respect to the function source files\&. This is not usually a problem, ++because zsh always looks for the newest file when loading a function, but ++it may cause slower shell startup and function loading\&. Also, if a digest ++file is explicitly used as an element of \fBfpath\fP, zsh won\&'t check whether ++any of its source files has changed\&. ++.PP ++The \fBzrecompile\fP autoloadable function, found in \fBFunctions/Misc\fP, can ++be used to keep function digests up to date\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBzrecompile\fP [ \fB\-qt\fP ] [ \fIname\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzrecompile\fP [ \fB\-qt\fP ] \fB\-p\fP \fIargs\fP [ \fB\-\fP\fB\-\fP \fIargs\fP \&.\&.\&. ] ++This tries to find \fB*\&.zwc\fP files and automatically re\-compile them if at ++least one of the original files is newer than the compiled file\&. This ++works only if the names stored in the compiled files are full paths or are ++relative to the directory that contains the \fB\&.zwc\fP file\&. ++.RS ++.PP ++In the first form, each \fIname\fP is the name of a compiled file or a ++directory containing \fB*\&.zwc\fP files that should be checked\&. If no ++arguments are given, the directories and \fB*\&.zwc\fP files in \fBfpath\fP are ++used\&. ++.PP ++When \fB\-t\fP is given, no compilation is performed, but a return status of ++zero (true) is set if there are files that need to be re\-compiled and ++non\-zero (false) otherwise\&. The \fB\-q\fP option quiets the chatty output ++that describes what \fBzrecompile\fP is doing\&. ++.PP ++Without the \fB\-t\fP option, the return status is zero if all files that ++needed re\-compilation could be compiled and non\-zero if compilation for at ++least one of the files failed\&. ++.PP ++If the \fB\-p\fP option is given, the \fIargs\fP are interpreted as one ++or more sets of arguments for \fBzcompile\fP, separated by `\fB\-\fP\fB\-\fP\&'\&. ++For example: ++.PP ++.RS ++.nf ++\fBzrecompile \-p \e ++ \-R ~/\&.zshrc \-\- \e ++ \-M ~/\&.zcompdump \-\- \e ++ ~/zsh/comp\&.zwc ~/zsh/Completion/*/_*\fP ++.fi ++.RE ++.PP ++This compiles \fB~/\&.zshrc\fP into \fB~/\&.zshrc\&.zwc\fP if that doesn\&'t exist or ++if it is older than \fB~/\&.zshrc\fP\&. The compiled file will be marked for ++reading instead of mapping\&. The same is done for \fB~/\&.zcompdump\fP and ++\fB~/\&.zcompdump\&.zwc\fP, but this compiled file is marked for mapping\&. The ++last line re\-creates the file \fB~/zsh/comp\&.zwc\fP if any of the files ++matching the given pattern is newer than it\&. ++.PP ++Without the \fB\-p\fP option, \fBzrecompile\fP does not create function digests ++that do not already exist, nor does it add new functions to the digest\&. ++.RE ++.RE ++.PP ++The following shell loop is an example of a method for creating function ++digests for all functions in your \fBfpath\fP, assuming that you have write ++permission to the directories: ++.PP ++.RS ++.nf ++\fBfor ((i=1; i <= $#fpath; ++i)); do ++ dir=$fpath[i] ++ zwc=${dir:t}\&.zwc ++ if [[ $dir == (\&.|\&.\&.) || $dir == (\&.|\&.\&.)/* ]]; then ++ continue ++ fi ++ files=($dir/*(N\-\&.)) ++ if [[ \-w $dir:h && \-n $files ]]; then ++ files=(${${(M)files%/*/*}#/}) ++ if ( cd $dir:h && ++ zrecompile \-p \-U \-z $zwc $files ); then ++ fpath[i]=$fpath[i]\&.zwc ++ fi ++ fi ++done\fP ++.fi ++.RE ++.PP ++The \fB\-U\fP and \fB\-z\fP options are appropriate for functions in the default ++zsh installation \fBfpath\fP; you may need to use different options for your ++personal function directories\&. ++.PP ++Once the digests have been created and your \fBfpath\fP modified to refer to ++them, you can keep them up to date by running \fBzrecompile\fP with no ++arguments\&. ++.PP ++.SS "Keyboard Definition" ++.PP ++The large number of possible combinations of keyboards, workstations, ++terminals, emulators, and window systems makes it impossible for zsh to ++have built\-in key bindings for every situation\&. The \fBzkbd\fP utility, ++found in Functions/Misc, can help you quickly create key bindings for your ++configuration\&. ++.PP ++Run \fBzkbd\fP either as an autoloaded function, or as a shell script: ++.PP ++.RS ++.nf ++\fBzsh \-f ~/zsh\-4\&.3\&.12\-dev\-1/Functions/Misc/zkbd\fP ++.fi ++.RE ++.PP ++When you run \fBzkbd\fP, it first asks you to enter your terminal type; if ++the default it offers is correct, just press return\&. It then asks you to ++press a number of different keys to determine characteristics of your ++keyboard and terminal; \fBzkbd\fP warns you if it finds anything out of the ++ordinary, such as a Delete key that sends neither \fB^H\fP nor \fB^?\fP\&. ++.PP ++The keystrokes read by \fBzkbd\fP are recorded as a definition for an ++associative array named \fBkey\fP, written to a file in the subdirectory ++\fB\&.zkbd\fP within either your \fBHOME\fP or \fBZDOTDIR\fP directory\&. The name ++of the file is composed from the \fBTERM\fP, \fBVENDOR\fP and \fBOSTYPE\fP ++parameters, joined by hyphens\&. ++.PP ++You may read this file into your \fB\&.zshrc\fP or another startup file with ++the `\fBsource\fP\&' or `\fB\&.\fP' commands, then reference the \fBkey\fP parameter ++in bindkey commands, like this: ++.PP ++.RS ++.nf ++\fBsource ${ZDOTDIR:\-$HOME}/\&.zkbd/$TERM\-$VENDOR\-$OSTYPE ++[[ \-n ${key[Left]} ]] && bindkey "${key[Left]}" backward\-char ++[[ \-n ${key[Right]} ]] && bindkey "${key[Right]}" forward\-char ++# etc\&.\fP ++.fi ++.RE ++.PP ++Note that in order for `\fBautoload zkbd\fP\&' to work, the \fBzkdb\fP file must ++be in one of the directories named in your \fBfpath\fP array (see ++\fIzshparam\fP(1))\&. This should already be the case if you have a standard zsh ++installation; if it is not, copy \fBFunctions/Misc/zkbd\fP to an ++appropriate directory\&. ++.PP ++.SS "Dumping Shell State" ++.PP ++Occasionally you may encounter what appears to be a bug in the shell, ++particularly if you are using a beta version of zsh or a development ++release\&. Usually it is sufficient to send a description of the ++problem to one of the zsh mailing lists (see ++\fIzsh\fP(1)), but sometimes one of the zsh developers will need to recreate your ++environment in order to track the problem down\&. ++.PP ++The script named \fBreporter\fP, found in the \fBUtil\fP directory of the ++distribution, is provided for this purpose\&. (It is also possible to ++\fBautoload reporter\fP, but \fBreporter\fP is not installed in \fBfpath\fP ++by default\&.) This script outputs a detailed dump of the shell state, ++in the form of another script that can be read with `\fBzsh \-f\fP\&' to ++recreate that state\&. ++.PP ++To use \fBreporter\fP, read the script into your shell with the `\fB\&.\fP\&' ++command and redirect the output into a file: ++.PP ++.RS ++.nf ++\fB\&. ~/zsh\-4\&.3\&.12\-dev\-1/Util/reporter > zsh\&.report\fP ++.fi ++.RE ++.PP ++You should check the \fBzsh\&.report\fP file for any sensitive information ++such as passwords and delete them by hand before sending the script to the ++developers\&. Also, as the output can be voluminous, it\&'s best to wait for ++the developers to ask for this information before sending it\&. ++.PP ++You can also use \fBreporter\fP to dump only a subset of the shell state\&. ++This is sometimes useful for creating startup files for the first time\&. ++Most of the output from reporter is far more detailed than usually is ++necessary for a startup file, but the \fBaliases\fP, \fBoptions\fP, and ++\fBzstyles\fP states may be useful because they include only changes from ++the defaults\&. The \fBbindings\fP state may be useful if you have created ++any of your own keymaps, because \fBreporter\fP arranges to dump the keymap ++creation commands as well as the bindings for every keymap\&. ++.PP ++As is usual with automated tools, if you create a startup file with ++\fBreporter\fP, you should edit the results to remove unnecessary commands\&. ++Note that if you\&'re using the new completion system, you should \fInot\fP ++dump the \fBfunctions\fP state to your startup files with \fBreporter\fP; use ++the \fBcompdump\fP function instead (see ++\fIzshcompsys\fP(1))\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBreporter\fP [ \fIstate\fP \&.\&.\&. ] ++Print to standard output the indicated subset of the current shell state\&. ++The \fIstate\fP arguments may be one or more of: ++.RS ++.PP ++.PD 0 ++.TP ++\fBall\fP ++Output everything listed below\&. ++.TP ++\fBaliases\fP ++Output alias definitions\&. ++.TP ++\fBbindings\fP ++Output ZLE key maps and bindings\&. ++.TP ++\fBcompletion\fP ++Output old\-style \fBcompctl\fP commands\&. ++New completion is covered by \fBfunctions\fP and \fBzstyles\fP\&. ++.TP ++\fBfunctions\fP ++Output autoloads and function definitions\&. ++.TP ++\fBlimits\fP ++Output \fBlimit\fP commands\&. ++.TP ++\fBoptions\fP ++Output \fBsetopt\fP commands\&. ++.TP ++\fBstyles\fP ++Same as \fBzstyles\fP\&. ++.TP ++\fBvariables\fP ++Output shell parameter assignments, plus \fBexport\fP ++commands for any environment variables\&. ++.TP ++\fBzstyles\fP ++Output \fBzstyle\fP commands\&. ++.PD ++.PP ++If the \fIstate\fP is omitted, \fBall\fP is assumed\&. ++.RE ++.PP ++With the exception of `\fBall\fP\&', every \fIstate\fP can be abbreviated by ++any prefix, even a single letter; thus \fBa\fP is the same as \fBaliases\fP, ++\fBz\fP is the same as \fBzstyles\fP, etc\&. ++.RE ++.PP ++.SS "Manipulating Hook Functions" ++.PP ++.PD 0 ++.TP ++.PD ++\fBadd\-zsh\-hook\fP [\-dD] \fIhook\fP \fIfunction\fP ++Several functions are special to the shell, as described in the section ++SPECIAL FUNCTIONS, see \fIzshmisc\fP(1), ++in that they are automatic called at a specific point during shell execution\&. ++Each has an associated array consisting of names of functions to be ++called at the same point; these are so\-called `hook functions\&'\&. ++The shell function \fBadd\-zsh\-hook\fP provides a simple way of adding or ++removing functions from the array\&. ++.RS ++.PP ++\fIhook\fP is one of \fBchpwd\fP, \fBperiodic\fP, \fBprecmd\fP, \fBpreexec\fP, ++\fBzshaddhistory\fP, \fBzshexit\fP, or \fBzsh_directory_name\fP, ++the special functions in question\&. Note that \fBzsh_directory_name\fP ++is called in a different way from the other functions, but may ++still be manipulated as a hook\&. ++.PP ++\fIfunction\fP is name of an ordinary shell function\&. If no options ++are given this will be added to the array of functions to be executed ++in the given context\&. ++.PP ++If the option \fB\-d\fP is given, the \fIfunction\fP is removed from ++the array of functions to be executed\&. ++.PP ++If the option \fB\-D\fP is given, the \fIfunction\fP is treated as a pattern ++and any matching names of functions are removed from the array of ++functions to be executed\&. ++.PP ++The options \fB\-U\fP, \fB\-z\fP and \fB\-k\fP are passed as arguments to ++\fBautoload\fP for \fIfunction\fP\&. For functions contributed with zsh, the ++options \fB\-Uz\fP are appropriate\&. ++.RE ++.RE ++.PP ++.SH "REMEMBERING RECENT DIRECTORIES" ++.PP ++The function \fBcdr\fP allows you to change the working directory to a ++previous working directory from a list maintained automatically\&. It is ++similar in concept to the directory stack controlled by the \fBpushd\fP, ++\fBpopd\fP and \fBdirs\fP builtins, but is more configurable, and as it stores ++all entries in files it is maintained across sessions and (by default) ++between terminal emulators in the current session\&. (The \fBpushd\fP ++directory stack is not actually modified or used by \fBcdr\fP unless you ++configure it to do so as described in the configuration section below\&.) ++.PP ++.SS "Installation" ++.PP ++The system works by means of a hook function that is called every time the ++directory changes\&. To install the system, autoload the required functions ++and use the \fBadd\-zsh\-hook\fP function described above: ++.PP ++.RS ++.nf ++\fBautoload \-Uz chpwd_recent_dirs cdr add\-zsh\-hook ++add\-zsh\-hook chpwd chpwd_recent_dirs\fP ++.fi ++.RE ++.PP ++Now every time you change directly interactively, no matter which ++command you use, the directory to which you change will be remembered ++in most\-recent\-first order\&. ++.PP ++.SS "Use" ++.PP ++All direct user interaction is via the \fBcdr\fP function\&. ++.PP ++The argument to cdr is a number \fIN\fP corresponding to the \fIN\fPth most ++recently changed\-to directory\&. 1 is the immediately preceding directory; ++the current directory is remembered but is not offered as a destination\&. ++Note that if you have multiple windows open 1 may refer to a directory ++changed to in another window; you can avoid this by having per\-terminal ++files for storing directory as described for the ++\fBrecent\-dirs\-file\fP style below\&. ++.PP ++If you set the \fBrecent\-dirs\-default\fP style described below \fBcdr\fP ++will behave the same as \fBcd\fP if given a non\-numeric argument, or more ++than one argument\&. The recent directory list is updated just the same ++however you change directory\&. ++.PP ++If the argument is omitted, 1 is assumed\&. This is similar to \fBpushd\fP\&'s ++behaviour of swapping the two most recent directories on the stack\&. ++.PP ++Completion for the argument to \fBcdr\fP is available if compinit has been ++run; menu selection is recommended, using: ++.PP ++.RS ++.nf ++\fBzstyle \&':completion:*:*:cdr:*:*' menu selection\fP ++.fi ++.RE ++.PP ++to allow you to cycle through recent directories; the order is preserved, ++so the first choice is the most recent directory before the current one\&. ++The verbose style is also recommended to ensure the directory is shown; this ++style is on by default so no action is required unless you have changed it\&. ++.PP ++.SS "Options" ++.PP ++The behaviour of \fBcdr\fP may be modified by the following options\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-l\fP ++lists the numbers and the corresponding directories in ++abbreviated form (i\&.e\&. with \fB~\fP substitution reapplied), one per line\&. ++The directories here are not quoted (this would only be an issue if a ++directory name contained a newline)\&. This is used by the completion ++system\&. ++.TP ++\fB\-r\fP ++sets the variable \fBreply\fP to the current set of directories\&. Nothing ++is printed and the directory is not changed\&. ++.TP ++\fB\-e\fP ++allows you to edit the list of directories, one per line\&. The ++list can be edited to any extent you like; no sanity checking is ++performed\&. Completion is available\&. No quoting is necessary (except for ++newlines, where I have in any case no sympathy); directories are in ++unabbreviated from and contain an absolute path, i\&.e\&. they start with \fB/\fP\&. ++Usually the first entry should be left as the current directory\&. ++.PP ++.SS "Configuration" ++.PP ++Configuration is by means of the styles mechanism that should be familiar ++from completion; if not, see the description of the \fBzstyle\fP command in ++see \fIzshmodules\fP(1)\&. The context for setting styles ++should be \fB\&':chpwd:*'\fP in case the meaning of the context is extended in ++future, for example: ++.PP ++.RS ++.nf ++\fBzstyle \&':chpwd:*' recent\-dirs\-max 0\fP ++.fi ++.RE ++.PP ++sets the value of the \fBrecent\-dirs\-max\fP style to 0\&. In practice the ++style name is specific enough that a context of \&'*' should be fine\&. ++.PP ++An exception is \fBrecent\-dirs\-insert\fP, which is used exclusively by the ++completion system and so has the usual completion system context ++(\fB\&':completion:*'\fP if nothing more specific is needed), though again ++\fB\&'*'\fP should be fine in practice\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBrecent\-dirs\-default\fP ++If true, and the command is expecting a recent directory index, and ++either there is more than one argument or the argument is not an ++integer, then fall through to "cd"\&. This allows the lazy to use only ++one command for directory changing\&. Completion recognises this, too; ++see recent\-dirs\-insert for how to control completion when this option ++is in use\&. ++.TP ++\fBrecent\-dirs\-file\fP ++The file where the list of directories is saved\&. The default ++is \fB${ZDOTDIR:\-$HOME}/\&.chpwd\-recent\-dirs\fP, i\&.e\&. this is in your ++home directory unless you have set the variable \fBZDOTDIR\fP to point ++somewhere else\&. Directory names are saved in \fB$\&'\fP\fI\&.\&.\&.\fP\fB'\fP quoted ++form, so each line in the file can be supplied directly to the shell as an ++argument\&. ++.RS ++.PP ++The value of this style may be an array\&. In this case, the first ++file in the list will always be used for saving directories while any ++other files are left untouched\&. When reading the recent directory ++list, if there are fewer than the maximum number of entries in the ++first file, the contents of later files in the array will be appended ++with duplicates removed from the list shown\&. The contents of the two ++files are not sorted together, i\&.e\&. all the entries in the first file ++are shown first\&. The special value \fB+\fP can appear in the list to ++indicate the default file should be read at that point\&. This allows ++effects like the following: ++.PP ++.RS ++.nf ++\fBzstyle \&':chpwd:*' recent\-dirs\-file \e ++~/\&.chpwd\-recent\-dirs\-${TTY##*/} +\fP ++.fi ++.RE ++.PP ++Recent directories are read from a file numbered according to ++the terminal\&. If there are insufficient entries the list ++is supplemented from the default file\&. ++.PP ++It is possible to use \fBzstyle \-e\fP to make the directory configurable ++at run time: ++.PP ++.RS ++.nf ++\fBzstyle \-e \&':chpwd:*' recent\-dirs\-file pick\-recent\-dirs\-file ++pick\-recent\-dirs\-file() { ++ if [[ $PWD = ~/text/writing(|/*) ]]; then ++ reply=(~/\&.chpwd\-recent\-dirs\-writing) ++ else ++ reply=(+) ++ fi ++}\fP ++.fi ++.RE ++.PP ++In this example, if the current directory is \fB~/text/writing\fP or a ++directory under it, then use a special file for saving recent ++directories, else use the default\&. ++.RE ++.TP ++\fBrecent\-dirs\-insert\fP ++Used by completion\&. If \fBrecent\-dirs\-default\fP is true, then setting ++this to \fBtrue\fP causes the actual directory, rather than its index, to ++be inserted on the command line; this has the same effect as using ++the corresponding index, but makes the history clearer and the line ++easier to edit\&. With this setting, if part of an argument was ++already typed, normal directory completion rather than recent ++directory completion is done; this is because recent directory ++completion is expected to be done by cycling through entries menu ++fashion\&. ++.RS ++.PP ++If the value of the style is \fBalways\fP, then only recent directories will ++be completed; in that case, use the \fBcd\fP command when you want to ++complete other directories\&. ++.PP ++If the value is \fBfallback\fP, recent directories will be tried first, then ++normal directory completion is performed if recent directory completion ++failed to find a match\&. ++.PP ++Finally, if the value is \fBboth\fP then both sets of completions are ++presented; the usual tag mechanism can be used to distinguish results, with ++recent directories tagged as \fBrecent\-dirs\fP\&. Note that the recent ++directories inserted are abbreviated with directory names where appropriate\&. ++.RE ++.TP ++\fBrecent\-dirs\-max\fP ++The maximum number of directories to save to the file\&. If ++this is zero or negative there is no maximum\&. The default is 20\&. ++Note this includes the current directory, which isn\&'t offered, ++so the highest number of directories you will be offered ++is one less than the maximum\&. ++.TP ++\fBrecent\-dirs\-prune\fP ++This style is an array determining what directories should (or should ++not) be added to the recent list\&. Elements of the array can include: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBparent\fP ++Prune parents (more accurately, ancestors) from the recent list\&. ++If present, changing directly down by any number of directories ++causes the current directory to be overwritten\&. For example, ++changing from ~pws to ~pws/some/other/dir causes ~pws not to be ++left on the recent directory stack\&. This only applies to direct ++changes to descendant directories; earlier directories on the ++list are not pruned\&. For example, changing from ~pws/yet/another ++to ~pws/some/other/dir does not cause ~pws to be pruned\&. ++.TP ++\fBpattern:\fIpattern\fP\fP ++Gives a zsh pattern for directories that should not be ++added to the recent list (if not already there)\&. This element ++can be repeated to add different patterns\&. For example, ++\fB\&'pattern:/tmp(|/*)'\fP stops \fB/tmp\fP or its descendants ++from being added\&. The \fBEXTENDED_GLOB\fP option is always turned on ++for these patterns\&. ++.RE ++.TP ++\fBrecent\-dirs\-pushd\fP ++If set to true, \fBcdr\fP will use \fBpushd\fP instead of \fBcd\fP to change the ++directory, so the directory is saved on the directory stack\&. As the ++directory stack is completely separate from the list of files saved ++by the mechanism used in this file there is no obvious reason to do ++this\&. ++.PP ++.SS "Use with dynamic directory naming" ++.PP ++It is possible to refer to recent directories using the dynamic directory ++name syntax by using the supplied function \fBzsh_directory_name_cdr\fP ++a hook: ++.PP ++.RS ++.nf ++\fBautoload \-Uz add\-zsh\-hook ++add\-zsh\-hook \-Uz zsh_directory_name zsh_directory_name_cdr\fP ++.fi ++.RE ++.PP ++When this is done, \fB~[1]\fP will refer to the most recent ++directory other than $PWD, and so on\&. Completion after \fB~[\fP\fI\&.\&.\&.\fP ++also works\&. ++.PP ++.SS "Details of directory handling" ++.PP ++This section is for the curious or confused; most users will not ++need to know this information\&. ++.PP ++Recent directories are saved to a file immediately and hence are ++preserved across sessions\&. Note currently no file locking is applied: ++the list is updated immediately on interactive commands and nowhere else ++(unlike history), and it is assumed you are only going to change ++directory in one window at once\&. This is not safe on shared accounts, ++but in any case the system has limited utility when someone else is ++changing to a different set of directories behind your back\&. ++.PP ++To make this a little safer, only directory changes instituted from the ++command line, either directly or indirectly through shell function calls ++(but not through subshells, evals, traps, completion functions and the ++like) are saved\&. Shell functions should use \fBcd \-q\fP or \fBpushd \-q\fP to ++avoid side effects if the change to the directory is to be invisible at the ++command line\&. See the contents of the function \fBchpwd_recent_dirs\fP for ++more details\&. ++.PP ++.SH "GATHERING INFORMATION FROM VERSION CONTROL SYSTEMS" ++.PP ++In a lot of cases, it is nice to automatically retrieve information from ++version control systems (VCSs), such as subversion, CVS or git, to be able ++to provide it to the user; possibly in the user\&'s prompt\&. So that you can ++instantly tell which branch you are currently on, for example\&. ++.PP ++In order to do that, you may use the \fBvcs_info\fP function\&. ++.PP ++The following VCSs are supported, showing the abbreviated name by which ++they are referred to within the system: ++.PD 0 ++.TP ++Bazaar (\fBbzr\fP) ++http://bazaar\-vcs\&.org/ ++.TP ++Codeville (\fBcdv\fP) ++http://codeville\&.org/ ++.TP ++Concurrent Versioning System (\fBcvs\fP) ++http://www\&.nongnu\&.org/cvs/ ++.TP ++Darcs (\fBdarcs\fP) ++http://darcs\&.net/ ++.TP ++Fossil (\fBfossil\fP) ++http://fossil\-scm\&.org/ ++.TP ++Git (\fBgit\fP) ++http://git\-scm\&.com/ ++.TP ++GNU arch (\fBtla\fP) ++http://www\&.gnu\&.org/software/gnu\-arch/ ++.TP ++Mercurial (\fBhg\fP) ++http://mercurial\&.selenic\&.com/ ++.TP ++Monotone (\fBmtn\fP) ++http://monotone\&.ca/ ++.TP ++Perforce (\fBp4\fP) ++http://www\&.perforce\&.com/ ++.TP ++Subversion (\fBsvn\fP) ++http://subversion\&.tigris\&.org/ ++.TP ++SVK (\fBsvk\fP) ++http://svk\&.bestpractical\&.com/ ++.PD ++.PP ++There is also support for the patch management system \fBquilt\fP ++(http://savannah\&.nongnu\&.org/projects/quilt)\&. See \fBQuilt Support\fP ++below for details\&. ++.PP ++To load \fBvcs_info\fP: ++.PP ++.RS ++.nf ++\fBautoload \-Uz vcs_info\fP ++.fi ++.RE ++.PP ++It can be used in any existing prompt, because it does not require any ++\fB$psvar\fP entries to be left available\&. ++.PP ++.SS "Quickstart" ++.PP ++To get this feature working quickly (including colors), you can do the ++following (assuming, you loaded \fBvcs_info\fP properly \- see above): ++.PP ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' actionformats \e ++ \&'%F{5}(%f%s%F{5})%F{3}\-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' ++zstyle \&':vcs_info:*' formats \e ++ \&'%F{5}(%f%s%F{5})%F{3}\-%F{5}[%F{2}%b%F{5}]%f ' ++zstyle \&':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' ++precmd () { vcs_info } ++PS1=\&'%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# '\fP ++.fi ++.RE ++.PP ++Obviously, the last two lines are there for demonstration\&. You need to ++call \fBvcs_info\fP from your \fBprecmd\fP function\&. Once that is done you need ++a \fBsingle quoted\fP \fB\&'${vcs_info_msg_0_}'\fP in your prompt\&. ++.PP ++To be able to use \fB\&'${vcs_info_msg_0_}'\fP directly in your prompt like ++this, you will need to have the \fBPROMPT_SUBST\fP option enabled\&. ++.PP ++Now call the \fBvcs_info_printsys\fP utility from the command line: ++.PP ++.RS ++.nf ++\fB% vcs_info_printsys ++## list of supported version control backends: ++## disabled systems are prefixed by a hash sign (#) ++bzr ++cdv ++cvs ++darcs ++fossil ++git ++hg ++mtn ++p4 ++svk ++svn ++tla ++## flavours (cannot be used in the enable or disable styles; they ++## are enabled and disabled with their master [git\-svn \-> git]) ++## they *can* be used in contexts: \&':vcs_info:git\-svn:*'\&. ++git\-p4 ++git\-svn ++hg\-git ++hg\-hgsubversion ++hg\-hgsvn\fP ++.fi ++.RE ++.PP ++You may not want all of these because there is no point in running the ++code to detect systems you do not use\&. So there is a way to disable ++some backends altogether: ++.PP ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' disable bzr cdv darcs mtn svk tla\fP ++.fi ++.RE ++.PP ++You may also pick a few from that list and enable only those: ++.PP ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' enable git cvs svn\fP ++.fi ++.RE ++.PP ++If you rerun \fBvcs_info_printsys\fP after one of these commands, you will ++see the backends listed in the \fBdisable\fP style (or backends not in the ++\fBenable\fP style \- if you used that) marked as disabled by a hash sign\&. ++That means the detection of these systems is skipped \fIcompletely\fP\&. No ++wasted time there\&. ++.PP ++.SS "Configuration" ++.PP ++The \fBvcs_info\fP feature can be configured via \fBzstyle\fP\&. ++.PP ++First, the context in which we are working: ++.RS ++.nf ++\fB:vcs_info:\fIvcs\-string\fP:\fIuser\-context\fP:\fIrepo\-root\-name\fP\fP ++.fi ++.RE ++.PP ++.PD 0 ++.TP ++.PD ++\fIvcs\-string\fP ++is one of: \fBgit\fP, \fBgit\-svn\fP, \fBgit\-p4\fP, \fBhg\fP, \fBhg\-git\fP, ++\fBhg\-hgsubversion\fP, \fBhg\-hgsvn\fP, \fBdarcs\fP, \fBbzr\fP, \fBcdv\fP, \fBmtn\fP, ++\fBsvn\fP, \fBcvs\fP, \fBsvk\fP, \fBtla\fP, \fBp4\fP or \fBfossil\fP\&. When hooks are ++active the hooks name is added after a `+\&'\&. (See \fBHooks in vcs_info\fP ++below\&.) ++.TP ++\fIuser\-context\fP ++is a freely configurable string, assignable by ++the user as the first argument to \fBvcs_info\fP (see its description ++below)\&. ++.TP ++\fIrepo\-root\-name\fP ++is the name of a repository in which you want a ++style to match\&. So, if you want a setting specific to \fB/usr/src/zsh\fP, ++with that being a CVS checkout, you can set \fIrepo\-root\-name\fP to ++\fBzsh\fP to make it so\&. ++.PP ++There are three special values for \fIvcs\-string\fP: The first is named ++\fB\-init\-\fP, that is in effect as long as there was no decision what VCS ++backend to use\&. The second is \fB\-preinit\-\fP; it is used \fIbefore\fP ++\fBvcs_info\fP is run, when initializing the data exporting variables\&. The ++third special value is \fBformats\fP and is used by the \fBvcs_info_lastmsg\fP ++for looking up its styles\&. ++.PP ++The initial value of \fIrepo\-root\-name\fP is \fB\-all\-\fP and it is replaced ++with the actual name, as soon as it is known\&. Only use this part of the ++context for defining the \fBformats\fP, \fBactionformats\fP or ++\fBbranchformat\fP styles, as it is guaranteed that \fIrepo\-root\-name\fP is ++set up correctly for these only\&. For all other styles, just use \fB\&'*'\fP ++instead\&. ++.PP ++There are two pre\-defined values for \fIuser\-context\fP: ++.PD 0 ++.TP ++\fBdefault\fP ++the one used if none is specified ++.TP ++\fBcommand\fP ++used by vcs_info_lastmsg to lookup its styles ++.PD ++.PP ++You can of course use \fB\&':vcs_info:*'\fP to match all VCSs in all ++user\-contexts at once\&. ++.PP ++This is a description of all styles that are looked up\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBformats\fP ++A list of formats, used when actionformats is not used ++(which is most of the time)\&. ++.TP ++\fBactionformats\fP ++A list of formats, used if there is a special ++action going on in your current repository; like an interactive rebase or ++a merge conflict\&. ++.TP ++\fBbranchformat\fP ++Some backends replace \fB%b\fP in the formats and ++actionformats styles above, not only by a branch name but also by a ++revision number\&. This style lets you modify how that string should look\&. ++.TP ++\fBnvcsformats\fP ++These "formats" are exported when we didn\&'t detect a version control system ++for the current directory or \fBvcs_info\fP was disabled\&. This is useful if ++you want \fBvcs_info\fP to completely take over the generation of your ++prompt\&. You would do something like \fBPS1=\&'${vcs_info_msg_0_}'\fP to ++accomplish that\&. ++.TP ++\fBhgrevformat\fP ++\fBhg\fP uses both a hash and a revision number to reference a specific ++changeset in a repository\&. With this style you can format the revision ++string (see \fBbranchformat\fP) to include either or both\&. It\&'s only ++useful when \fBget\-revision\fP is true\&. ++.TP ++\fBmax\-exports\fP ++Defines the maximum number of ++\fBvcs_info_msg_*_\fP variables \fBvcs_info\fP will export\&. ++.TP ++\fBenable\fP ++A list of backends you want to use\&. Checked in the \fB\-init\-\fP context\&. If ++this list contains an item called \fBNONE\fP no backend is used at all and ++\fBvcs_info\fP will do nothing\&. If this list contains \fBALL\fP, \fBvcs_info\fP ++will use all known backends\&. Only with \fBALL\fP in \fBenable\fP will the ++\fBdisable\fP style have any effect\&. \fBALL\fP and \fBNONE\fP are case insensitive\&. ++.TP ++\fBdisable\fP ++A list of VCSs you don\&'t want \fBvcs_info\fP to test for ++repositories (checked in the \fB\-init\-\fP context, too)\&. Only used if ++\fBenable\fP contains \fBALL\fP\&. ++.TP ++\fBdisable\-patterns\fP ++A list of patterns that are checked against \fB$PWD\fP\&. If a pattern ++matches, \fBvcs_info\fP will be disabled\&. This style is checked in the ++\fB:vcs_info:\-init\-:*:\-all\-\fP context\&. ++.RS ++.PP ++Say, \fB~/\&.zsh\fP is a directory under version control, in which you do ++not want \fBvcs_info\fP to be active, do: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' disable\-patterns "$HOME/\&.zsh(|/*)"\fP ++.fi ++.RE ++.RE ++.TP ++\fBuse\-quilt\fP ++If enabled, the \fBquilt\fP support code is active in `addon\&' mode\&. ++See \fBQuilt Support\fP for details\&. ++.TP ++\fBquilt\-standalone\fP ++If enabled, `standalone\&' mode detection is attempted if no VCS is active ++in a given directory\&. See \fBQuilt Support\fP for details\&. ++.TP ++\fBquilt\-patch\-dir\fP ++Overwrite the value of the \fB$QUILT_PATCHES\fP environment variable\&. See ++\fBQuilt Support\fP for details\&. ++.TP ++\fBquiltcommand\fP ++When \fBquilt\fP itself is called in quilt support the value of this style ++is used as the command name\&. ++.TP ++\fBcheck\-for\-changes\fP ++If enabled, this style causes the \fB%c\fP and \fB%u\fP format escapes to show ++when the working directory has uncommitted changes\&. The strings displayed by ++these escapes can be controlled via the \fBstagedstr\fP and \fBunstagedstr\fP ++styles\&. The only backends that currently support this option are \fBgit\fP and ++\fBhg\fP (\fBhg\fP only supports unstaged)\&. ++.RS ++.PP ++For this style to be evaluated with the \fBhg\fP backend, the \fBget\-revision\fP ++style needs to be set and the \fBuse\-simple\fP style needs to be unset\&. The ++latter is the default; the former is not\&. ++.PP ++Note, the actions taken if this style is enabled are potentially expensive ++(read: they may be slow, depending on how big the current repository is)\&. ++Therefore, it is disabled by default\&. ++.RE ++.TP ++\fBstagedstr\fP ++This string will be used in the \fB%c\fP escape if there are staged changes in ++the repository\&. ++.TP ++\fBunstagedstr\fP ++This string will be used in the \fB%u\fP escape if there are unstaged changes ++in the repository\&. ++.TP ++\fBcommand\fP ++This style causes \fBvcs_info\fP to use the supplied string as the command ++to use as the VCS\&'s binary\&. Note, that setting this in ':vcs_info:*' is ++not a good idea\&. ++.RS ++.PP ++If the value of this style is empty (which is the default), the used binary ++name is the name of the backend in use (e\&.g\&. \fBsvn\fP is used in an \fBsvn\fP ++repository)\&. ++.PP ++The \fBrepo\-root\-name\fP part in the context is always the default \fB\-all\-\fP ++when this style is looked up\&. ++.PP ++For example, this style can be used to use binaries from non\-default ++installation directories\&. Assume, \fBgit\fP is installed in /usr/bin but ++your sysadmin installed a newer version in /usr/bin/local\&. Instead of ++changing the order of your \fB$PATH\fP parameter, you can do this: ++.RS ++.nf ++\fBzstyle \&':vcs_info:git:*:\-all\-' command /usr/local/bin/git\fP ++.fi ++.RE ++.RE ++.TP ++\fBuse\-server\fP ++This is used by the Perforce backend (\fBp4\fP) to decide if it should ++contact the Perforce server to find out if a directory is managed ++by Perforce\&. This is the only reliable way of doing this, but runs ++the risk of a delay if the server name cannot be found\&. If the ++server (more specifically, the \fBhost\fP\fB:\fP\fBport\fP pair describing the ++server) cannot be contacted, its name is put into the associative array ++\fBvcs_info_p4_dead_servers\fP and is not contacted again during the session ++until it is removed by hand\&. If you do not set this style, the \fBp4\fP ++backend is only usable if you have set the environment variable ++\fBP4CONFIG\fP to a file name and have corresponding files in the root ++directories of each Perforce client\&. See comments in the function ++\fBVCS_INFO_detect_p4\fP for more detail\&. ++.TP ++\fBuse\-simple\fP ++If there are two different ways of gathering ++information, you can select the simpler one by setting this style to true; ++the default is to use the not\-that\-simple code, which is potentially a lot ++slower but might be more accurate in all possible cases\&. This style is ++used by the \fBbzr\fP and \fBhg\fP backends\&. In the case of \fBhg\fP it will invoke ++the external hexdump program to parse the binary dirstate cache file; this ++method will not return the local revision number\&. ++.TP ++\fBget\-revision\fP ++If set to true, vcs_info goes the extra mile to figure out the revision of ++a repository\&'s work tree (currently for the \fBgit\fP and \fBhg\fP backends, ++where this kind of information is not always vital)\&. For \fBgit\fP, the ++hash value of the currently checked out commit is available via the \fB%i\fP ++expansion\&. With \fBhg\fP, the local revision number and the corresponding ++global hash are available via \fB%i\fP\&. ++.TP ++\fBget\-mq\fP ++If set to true, the \fBhg\fP backend will look for a Mercurial Queue (\fBmq\fP) ++patch directory\&. Information will be available via the `\fB%m\fP\&' replacement\&. ++.TP ++\fBget\-bookmarks\fP ++If set to true, the \fBhg\fP backend will try to get a list of current ++bookmarks\&. They will be available via the `\fB%m\fP\&' replacement\&. ++.TP ++\fBuse\-prompt\-escapes\fP ++Determines if we assume that the assembled ++string from \fBvcs_info\fP includes prompt escapes\&. (Used by ++\fBvcs_info_lastmsg\fP\&.) ++.TP ++\fBdebug\fP ++Enable debugging output to track possible problems\&. Currently this style ++is only used by \fBvcs_info\fP\&'s hooks system\&. ++.TP ++\fBhooks\fP ++A list style that defines hook\-function names\&. See \fBHooks in vcs_info\fP ++below for details\&. ++.PP ++The default values for these styles in all contexts are: ++.PP ++.PD 0 ++.TP ++\fBformats\fP ++" (%s)\-[%b]%u%c\-" ++.TP ++\fBactionformats\fP ++" (%s)\-[%b|%a]%u%c\-" ++.TP ++\fBbranchformat\fP ++"%b:%r" (for bzr, svn, svk and hg) ++.TP ++\fBnvcsformats\fP ++"" ++.TP ++\fBhgrevformat\fP ++"%r:%h" ++.TP ++\fBmax\-exports\fP ++2 ++.TP ++\fBenable\fP ++ALL ++.TP ++\fBdisable\fP ++(empty list) ++.TP ++\fBdisable\-patterns\fP ++(empty list) ++.TP ++\fBcheck\-for\-changes\fP ++false ++.TP ++\fBstagedstr\fP ++(string: "S") ++.TP ++\fBunstagedstr\fP ++(string: "U") ++.TP ++\fBcommand\fP ++(empty string) ++.TP ++\fBuse\-server\fP ++false ++.TP ++\fBuse\-simple\fP ++false ++.TP ++\fBget\-revision\fP ++false ++.TP ++\fBget\-mq\fP ++true ++.TP ++\fBget\-bookmarks\fP ++false ++.TP ++\fBuse\-prompt\-escapes\fP ++true ++.TP ++\fBdebug\fP ++false ++.TP ++\fBhooks\fP ++(empty list) ++.TP ++\fBuse\-quilt\fP ++false ++.TP ++\fBquilt\-standalone\fP ++false ++.TP ++\fBquilt\-patch\-dir\fP ++empty \- use \fB$QUILT_PATCHES\fP ++.TP ++\fBquiltcommand\fP ++quilt ++.PD ++.PP ++In normal \fBformats\fP and \fBactionformats\fP the following replacements are ++done: ++.PP ++.PD 0 ++.TP ++\fB%s\fP ++The VCS in use (git, hg, svn, etc\&.)\&. ++.TP ++\fB%b\fP ++Information about the current branch\&. ++.TP ++\fB%a\fP ++An identifier that describes the action\&. Only makes sense in ++\fBactionformats\fP\&. ++.TP ++\fB%i\fP ++The current revision number or identifier\&. For \fBhg\fP ++the \fBhgrevformat\fP style may be used to customize the output\&. ++.TP ++\fB%c\fP ++The string from the \fBstagedstr\fP style if there are staged ++changes in the repository\&. ++.TP ++\fB%u\fP ++The string from the \fBunstagedstr\fP style if there are ++unstaged changes in the repository\&. ++.TP ++\fB%R\fP ++The base directory of the repository\&. ++.TP ++\fB%r\fP ++The repository name\&. If \fB%R\fP is \fB/foo/bar/repoXY\fP, \fB%r\fP ++is \fBrepoXY\fP\&. ++.TP ++\fB%S\fP ++A subdirectory within a repository\&. If \fB$PWD\fP is ++\fB/foo/bar/repoXY/beer/tasty\fP, \fB%S\fP is \fBbeer/tasty\fP\&. ++.TP ++\fB%m\fP ++A "misc" replacement\&. It is at the discretion of the backend to ++decide what this replacement expands to\&. It is currently used by the \fBhg\fP ++and \fBgit\fP backends to display patch information from the \fBmq\fP and ++\fBstgit\fP extensions\&. ++.PD ++.PP ++In \fBbranchformat\fP these replacements are done: ++.PP ++.PD 0 ++.TP ++\fB%b\fP ++The branch name\&. ++.TP ++\fB%r\fP ++The current revision number or the \fBhgrevformat\fP style for ++\fBhg\fP\&. ++.PD ++.PP ++In \fBhgrevformat\fP these replacements are done: ++.PP ++.PD 0 ++.TP ++\fB%r\fP ++The current local revision number\&. ++.TP ++\fB%h\fP ++The current 40\-character changeset ID hash identifier\&. ++.PD ++.PP ++In \fBpatch\-format\fP and \fBnopatch\-format\fP these replacements are done: ++.PP ++.PD 0 ++.TP ++\fB%p\fP ++The name of the top\-most applied patch\&. ++.TP ++\fB%u\fP ++The number of unapplied patches\&. ++.TP ++\fB%n\fP ++The number of applied patches\&. ++.TP ++\fB%c\fP ++The number of unapplied patches\&. ++.TP ++\fB%g\fP ++The names of active \fBmq\fP guards (\fBhg\fP backend)\&. ++.TP ++\fB%G\fP ++The number of active \fBmq\fP guards (\fBhg\fP backend)\&. ++.PD ++.PP ++Not all VCS backends have to support all replacements\&. For \fBnvcsformats\fP ++no replacements are performed at all, it is just a string\&. ++.PP ++.SS "Oddities" ++.PP ++If you want to use the \fB%b\fP (bold off) prompt expansion in \fBformats\fP, ++which expands \fB%b\fP itself, use \fB%%b\fP\&. That will cause the \fBvcs_info\fP ++expansion to replace \fB%%b\fP with \fB%b\fP, so that zsh\&'s prompt expansion ++mechanism can handle it\&. Similarly, to hand down \fB%b\fP from ++\fBbranchformat\fP, use \fB%%%%b\fP\&. Sorry for this inconvenience, but it ++cannot be easily avoided\&. Luckily we do not clash with a lot of prompt ++expansions and this only needs to be done for those\&. ++.PP ++.SS "Quilt Support" ++.PP ++\fBQuilt\fP is not a version control system, therefore this is not implemented ++as a backend\&. It can help keeping track of a series of patches\&. People use it ++to keep a set of changes they want to use on top of software packages (which ++is tightly integrated into the package build process \- the Debian project ++does this for a large number of packages)\&. Quilt can also help individual ++developers keep track of their own patches on top of real version control ++systems\&. ++.PP ++The \fBvcs_info\fP integration tries to support both ways of using quilt by ++having two slightly different modes of operation: `addon\&' mode and ++`standalone\&' mode)\&. ++.PP ++For `addon\&' mode to become active \fBvcs_info\fP must have already detected a ++real version control system controlling the directory\&. If that is the case, ++a directory that holds quilt\&'s patches needs to be found\&. That directory is ++configurable via the `\fBQUILT_PATCHES\fP\&' environment variable\&. If that ++variable exists its value is used, otherwise the value `\fBpatches\fP\&' is ++assumed\&. The value from \fB$QUILT_PATCHES\fP can be overwritten using the ++\fB`quilt\-patches\&'\fP style\&. (Note: you can use \fBvcs_info\fP to keep the value ++of \fB$QUILT_PATCHES\fP correct all the time via the \fBpost\-quilt\fP hook)\&. ++.PP ++When the directory in question is found, quilt is assumed to be active\&. To ++gather more information, \fBvcs_info\fP looks for a directory called `\&.pc\&'; ++Quilt uses that directory to track its current state\&. If this directory does ++not exist we know that quilt has not done anything to the working directory ++(read: no patches have been applied yet)\&. ++.PP ++If patches are applied, \fBvcs_info\fP will try to find out which\&. If you want ++to know which patches of a series are not yet applied, you need to activate ++the \fBget\-unapplied\fP style in the appropriate context\&. ++.PP ++\fBvcs_info\fP allows for very detailed control over how the gathered ++information is presented (see the below sections, \fBStyles\fP and \fBHooks in ++vcs_info\fP), all of which are documented below\&. Note there are a number of ++other patch tracking systems that work on top of a certain version control ++system (like \fBstgit\fP for \fBgit\fP, or \fBmq\fP for \fBhg\fP); the configuration ++for systems like that are generally configured the same way as the \fBquilt\fP ++support\&. ++.PP ++If the \fBquilt\fP support is working in `addon\&' mode, the produced string is ++available as a simple format replacement (\fB%Q\fP to be precise), which can ++be used in \fBformats\fP and \fBactionformats\fP; see below for details)\&. ++.PP ++If, on the other hand, the support code is working in `standalone\&' mode, ++\fBvcs_info\fP will pretend as if \fBquilt\fP were an actual version control ++system\&. That means that the version control system identifier (which ++otherwise would be something like `svn\&' or `cvs') will be set to ++`\fB\-quilt\-\fP\&'\&. This has implications on the used style context where this ++identifier is the second element\&. \fBvcs_info\fP will have filled in a proper ++value for the "repository\&'s" root directory and the string containing the ++information about quilt\&'s state will be available as the `misc' replacement ++(and \fB%Q\fP for compatibility with `addon\&' mode\&. ++.PP ++What is left to discuss is how `standalone\&' mode is detected\&. The detection ++itself is a series of searches for directories\&. You can have this detection ++enabled all the time in every directory that is not otherwise under version ++control\&. If you know there is only a limited set of trees where you would ++like \fBvcs_info\fP to try and look for Quilt in `standalone\&' mode to minimise ++the amount of searching on every call to \fBvcs_info\fP, there are a number of ++ways to do that: ++.PP ++Essentially, `standalone\&' mode detection is controlled by a style called ++`\fBquilt\-standalone\fP\&'\&. It is a string style and its value can have different ++effects\&. The simplest values are: `\fBalways\fP\&' to run detection every time ++\fBvcs_info\fP is run, and `\fBnever\fP\&' to turn the detection off entirely\&. ++.PP ++If the value of \fBquilt\-standalone\fP is something else, it is interpreted ++differently\&. If the value is the name of a scalar variable the value of that ++variable is checked and that value is used in the same `always\&'/`never' way ++as described above\&. ++.PP ++If the value of \fBquilt\-standalone\fP is an array, the elements of that array ++are used as directory names under which you want the detection to be active\&. ++.PP ++If \fBquilt\-standalone\fP is an associative array, the keys are taken as ++directory names under which you want the detection to be active, but only if ++the corresponding value is the string `\fBtrue\fP\&'\&. ++.PP ++Last, but not least, if the value of \fBquilt\-standalone\fP is the name of a ++function, the function is called without arguments and the return value ++decides whether detection should be active\&. A `0\&' return value is true; a ++non\-zero return value is interpreted as false\&. ++.PP ++Note, if there is both a function and a variable by the name of ++\fBquilt\-standalone\fP, the function will take precedence\&. ++.PP ++.SS "Function Descriptions (Public API)" ++.PP ++.PD 0 ++.TP ++.PD ++\fBvcs_info\fP [\fIuser\-context\fP] ++The main function, that runs all backends and assembles all data into ++\fB${vcs_info_msg_*_}\fP\&. This is the function you want to call from ++\fBprecmd\fP if you want to include up\-to\-date information in your prompt (see ++\fBVariable description\fP below)\&. If an argument is given, that string will be ++used instead of \fBdefault\fP in the \fIuser\-context\fP field of the style ++context\&. ++.TP ++\fBvcs_info_hookadd\fP ++Statically registers a number of functions to a given hook\&. The hook needs ++to be given as the first argument; what follows is a list of hook\-function ++names to register to the hook\&. The `\fB+vi\-\fP\&' prefix needs to be left out ++here\&. See \fBHooks in vcs_info\fP below for details\&. ++.TP ++\fBvcs_info_hookdel\fP ++Remove hook\-functions from a given hook\&. The hook needs to be given as the ++first non\-option argument; what follows is a list of hook\-function ++names to un\-register from the hook\&. If `\fB\-a\fP\&' is used as the first ++argument, \fBall\fP occurances of the functions are unregistered\&. Otherwise ++only the last occurance is removed (if a function was registered to a hook ++more than once) \&. The `\fB+vi\-\fP\&' prefix needs to be left out here\&. See ++\fBHooks in vcs_info\fP below for details\&. ++.TP ++\fBvcs_info_lastmsg\fP ++Outputs the last \fB${vcs_info_msg_*_}\fP value\&. ++Takes into account the value of the \fBuse\-prompt\-escapes\fP style in ++\fB\&':vcs_info:formats:command:\-all\-'\fP\&. It also only prints \fBmax\-exports\fP ++values\&. ++.TP ++\fBvcs_info_printsys\fP [\fIuser\-context\fP] ++Prints a list of all ++supported version control systems\&. Useful to find out possible contexts ++(and which of them are enabled) or values for the \fBdisable\fP style\&. ++.TP ++\fBvcs_info_setsys\fP ++Initializes \fBvcs_info\fP\&'s internal list of ++available backends\&. With this function, you can add support for new VCSs ++without restarting the shell\&. ++.PP ++All functions named VCS_INFO_* are for internal use only\&. ++.PP ++.SS "Variable Description" ++.PP ++.PD 0 ++.TP ++.PD ++\fB${vcs_info_msg_\fP\fIN\fP\fB_}\fP (Note the trailing underscore) ++Where \fIN\fP is an integer, e\&.g\&., \fBvcs_info_msg_0_\fP\&. These variables ++are the storage for the informational message the last \fBvcs_info\fP call ++has assembled\&. These are strongly connected to the \fBformats\fP, ++\fBactionformats\fP and \fBnvcsformats\fP styles described above\&. Those styles ++are lists\&. The first member of that list gets expanded into ++\fB${vcs_info_msg_0_}\fP, the second into \fB${vcs_info_msg_1_}\fP ++and the Nth into \fB${vcs_info_msg_N\-1_}\fP\&. These parameters are ++exported into the environment\&. (See the \fBmax\-exports\fP style above\&.) ++.PP ++All variables named VCS_INFO_* are for internal use only\&. ++.PP ++.SS "Hooks in vcs_info" ++.PP ++Hooks are places in \fBvcs_info\fP where you can run your own code\&. That ++code can communicate with the code that called it and through that, ++change the system\&'s behaviour\&. ++.PP ++For configuration, hooks change the style context: ++.RS ++.nf ++\fB:vcs_info:\fIvcs\-string\fP+\fIhook\-name\fP:\fIuser\-context\fP:\fIrepo\-root\-name\fP\fP ++.fi ++.RE ++.PP ++To register functions to a hook, you need to list them in the \fBhooks\fP ++style in the appropriate context\&. ++.PP ++Example: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*+foo:*' hooks bar baz\fP ++.fi ++.RE ++.PP ++This registers functions to the hook `foo\&' for all backends\&. In order to ++avoid namespace problems, all registered function names are prepended by ++a `+vi\-\&', so the actual functions called for the `foo' hook are ++`\fB+vi\-bar\fP\&' and `\fB+vi\-baz\fP'\&. ++.PP ++If you would like to register a function to a hook regardless of the ++current context, you may use the \fBvcs_info_hookadd\fP function\&. To remove ++a function that was added like that, the \fBvcs_info_hookdel\fP function ++can be used\&. ++.PP ++If something seems weird, you can enable the `debug\&' boolean style in ++the proper context and the hook\-calling code will print what it tried ++to execute and whether the function in question existed\&. ++.PP ++When you register more than one function to a hook, all functions are ++executed one after another until one function returns non\-zero or until ++all functions have been called\&. Context\-sensitive hook functions are ++executed \fBbefore\fP statically registered ones (the ones added by ++\fBvcs_info_hookadd\fP)\&. ++.PP ++You may pass data between functions via an associative array, \fBuser_data\fP\&. ++For example: ++.RS ++.nf ++\fB +++vi\-git\-myfirsthook(){ ++ user_data[myval]=$myval ++} +++vi\-git\-mysecondhook(){ ++ # do something with ${user_data[myval]} ++}\fP ++.fi ++.RE ++.PP ++There are a number of variables that are special in hook contexts: ++.PP ++.PD 0 ++.TP ++.PD ++\fBret\fP ++The return value that the hooks system will return to the caller\&. The ++default is an integer `zero\&'\&. If and how a changed \fBret\fP value changes ++the execution of the caller depends on the specific hook\&. See the hook ++documentation below for details\&. ++.TP ++\fBhook_com\fP ++An associated array which is used for bidirectional communication from ++the caller to hook functions\&. The used keys depend on the specific hook\&. ++.TP ++\fBcontext\fP ++The active context of the hook\&. Functions that wish to change this ++variable should make it local scope first\&. ++.TP ++\fBvcs\fP ++The current VCS after it was detected\&. The same values as in the ++enable/disable style are used\&. Available in all hooks except \fBstart\-up\fP\&. ++.PP ++Finally, the full list of currently available hooks: ++.PP ++.PD 0 ++.TP ++.PD ++\fBstart\-up\fP ++Called after starting \fBvcs_info\fP but before the VCS in this directory is ++determined\&. It can be used to deactivate \fBvcs_info\fP temporarily if ++necessary\&. When \fBret\fP is set to \fB1\fP, \fBvcs_info\fP aborts and does ++nothing; when set to \fB2\fP, \fBvcs_info\fP sets up everything as if no ++version control were active and exits\&. ++.TP ++\fBpre\-get\-data\fP ++Same as \fBstart\-up\fP but after the VCS was detected\&. ++.TP ++\fBgen\-hg\-bookmark\-string\fP ++Called in the Mercurial backend when a bookmark string is generated; the ++\fBget\-revision\fP and \fBget\-bookmarks\fP styles must be true\&. ++.RS ++.PP ++This hook gets the names of the Mercurial bookmarks that ++\fBvcs_info\fP collected from `hg\&'\&. ++.PP ++When setting \fBret\fP to non\-zero, the string in ++\fB${hook_com[hg\-bookmark\-string]}\fP will be used in the \fB%m\fP escape in ++\fBformats\fP and \fBactionformats\fP and will be availabe in the global ++\fBbackend_misc\fP array as \fB${backend_misc[bookmarks]}\fP\&. ++.RE ++.TP ++\fBgen\-applied\-string\fP ++Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backends ++and in \fBquilt\fP support when the \fBapplied\-string\fP is generated; the ++\fBuse\-quilt\fP zstyle must be true for \fBquilt\fP (the \fBmq\fP and \fBstgit\fP ++backends are active by default)\&. ++.RS ++.PP ++This hook gets the names of all applied patches which \fBvcs_info\fP collected ++so far in the opposite order, which means that the first argument is the ++top\-most patch and so forth\&. ++.PP ++When setting \fBret\fP to non\-zero, the string in ++\fB${hook_com[applied\-string]}\fP will be used in the \fB%m\fP escape in ++\fBformats\fP and \fBactionformats\fP; it will be available in the global ++\fBbackend_misc\fP array as \fB$backend_misc[patches]}\fP; and it will be ++available as \fB%p\fP in the \fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. ++.RE ++.TP ++\fBgen\-unapplied\-string\fP ++Called in the \fBgit\fP (with \fBstgit\fP), and \fBhg\fP (with \fBmq\fP) backend ++and in \fBquilt\fP support when the \fBunapplied\-string\fP is generated; the ++\fBget\-unapplied\fP style must be true\&. ++.RS ++.PP ++This hook gets the names of all unapplied patches which \fBvcs_info\fP ++collected so far in the opposite order, which mean that the first argument is ++the patch next\-in\-line to be applied and so forth\&. ++.PP ++When setting \fBret\fP to non\-zero, the string in ++\fB${hook_com[unapplied\-string]}\fP will be available as \fB%u\fP in the ++\fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. ++.RE ++.TP ++\fBgen\-mqguards\-string\fP ++Called in the \fBhg\fP backend when \fBguards\-string\fP is generated; the ++\fBget\-mq\fP style must be true (default)\&. ++.RS ++.PP ++This hook gets the names of any active \fBmq\fP guards\&. ++.PP ++When setting \fBret\fP to non\-zero, the string in ++\fB${hook_com[guards\-string]}\fP will be used in the \fB%g\fP escape in the ++\fBpatch\-format\fP and \fBnopatch\-format\fP styles\&. ++.RE ++.TP ++\fBno\-vcs\fP ++This hooks is called when no version control system was detected\&. ++.RS ++.PP ++The `hook_com\&' parameter is not used\&. ++.RE ++.TP ++\fBpost\-quilt\fP ++Called after the \fBquilt\fP support is done\&. The following information ++is passed as arguments to the hook: 1\&. the quilt\-support mode (`addon\&' or ++`standalone\&'); 2\&. the directory that contains the patch series; 3\&. the ++directory that holds quilt\&'s status information (the `\&.pc' directory) or ++the string \fB"\-nopc\-"\fP if that directory wasn\&'t found\&. ++.RS ++.PP ++The `hook_com\&' parameter is not used\&. ++.RE ++.TP ++\fBset\-branch\-format\fP ++Called before `\fBbranchformat\fP\&' is set\&. The only argument to the ++hook is the format that is configured at this point\&. ++.RS ++.PP ++The `\fBhook_com\fP\&' keys considered are `\fBbranch\fP' and `\fBrevision\fP'\&. ++They are set to the values figured out so far by \fBvcs_info\fP and any ++change will be used directly when the actual replacement is done\&. ++.PP ++If \fBret\fP is set to non\-zero, the string in ++\fB${hook_com[branch\-replace]}\fP will be used unchanged as the ++`\fB%b\fP\&' replacement in the variables set by \fBvcs_info\fP\&. ++.RE ++.TP ++\fBset\-hgrev\-format\fP ++Called before a `\fBhgrevformat\fP\&' is set\&. The only argument to the ++hook is the format that is configured at this point\&. ++.RS ++.PP ++The `\fBhook_com\fP\&' keys considered are `\fBhash\fP' and `\fBlocalrev\fP'\&. ++They are set to the values figured out so far by \fBvcs_info\fP and any ++change will be used directly when the actual replacement is done\&. ++.PP ++If \fBret\fP is set to non\-zero, the string in ++\fB${hook_com[rev\-replace]}\fP will be used unchanged as the ++`\fB%i\fP\&' replacement in the variables set by \fBvcs_info\fP\&. ++.RE ++.TP ++\fBset\-message\fP ++Called each time before a `\fBvcs_info_msg_N_\fP\&' message is set\&. ++It takes two arguments; the first being the `N\&' in the message ++variable name, the second is the currently configured \fBformats\fP or ++\fBactionformats\fP\&. ++.RS ++.PP ++There are a number of `\fBhook_com\fP\&' keys, that are used here: ++`\fBaction\fP\&', `\fBbranch\fP', `\fBbase\fP', `\fBbase\-name\fP', `\fBsubdir\fP', ++`\fBstaged\fP\&', `\fBunstaged\fP', `\fBrevision\fP', `\fBmisc\fP', `\fBvcs\fP' ++and one `\fBmiscN\fP\&' entry for each backend\-specific data field (\fBN\fP ++starting at zero)\&. They are set to the values figured out so far by ++\fBvcs_info\fP and any change will be used directly when the actual ++replacement is done\&. ++.PP ++Since this hook is triggered multiple times (once for each configured ++\fBformats\fP or \fBactionformats\fP), each of the `\fBhook_com\fP\&' keys mentioned ++above (except for the \fBmiscN\fP entries) has an `\fB_orig\fP\&' counterpart, ++so even if you changed a value to your liking you can still get the ++original value in the next run\&. Changing the `\fB_orig\fP\&' values is ++probably not a good idea\&. ++.PP ++If \fBret\fP is set to non\-zero, the string in ++\fB${hook_com[message]}\fP will be used unchanged as the message by ++\fBvcs_info\fP\&. ++.RE ++.RE ++.PP ++If all of this sounds rather confusing, take a look at the \fBExamples\fP ++section below and also in the Misc/vcs_info\-examples file in the Zsh source\&. ++They contain some explanatory code\&. ++.PP ++.SS "Examples" ++.PP ++Don\&'t use \fBvcs_info\fP at all (even though it's in your prompt): ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' enable NONE\fP ++.fi ++.RE ++.PP ++Disable the backends for \fBbzr\fP and \fBsvk\fP: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' disable bzr svk\fP ++.fi ++.RE ++.PP ++Disable everything \fIbut\fP \fBbzr\fP and \fBsvk\fP: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*' enable bzr svk\fP ++.fi ++.RE ++.PP ++Provide a special formats for \fBgit\fP: ++.RS ++.nf ++\fBzstyle \&':vcs_info:git:*' formats ' GIT, BABY! [%b]' ++zstyle \&':vcs_info:git:*' actionformats ' GIT ACTION! [%b|%a]'\fP ++.fi ++.RE ++.PP ++All \fB%x\fP expansion in all sorts of formats ("formats", "actionformats", ++branchformat, you name it) are done using the `\fBzformat\fP\&' builtin from ++the `\fBzsh/zutil\fP\&' module\&. That means you can do everything with these ++\fB%x\fP items what zformat supports\&. In particular, if you want something ++that is really long to have a fixed width, like a hash in a mercurial ++branchformat, you can do this: \fB%12\&.12i\fP\&. That\&'ll shrink the 40 character ++hash to its 12 leading characters\&. The form is actually ++`\fB%\fP\fImin\fP\fB\&.\fP\fImax\fP\fBx\fP\&'\&. More is possible\&. ++See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1) for details\&. ++.PP ++Use the quicker \fBbzr\fP backend ++.RS ++.nf ++\fBzstyle \&':vcs_info:bzr:*' use\-simple true\fP ++.fi ++.RE ++.PP ++If you do use \fBuse\-simple\fP, please report if it does `the\-right\-thing[tm]\&'\&. ++.PP ++Display the revision number in yellow for \fBbzr\fP and \fBsvn\fP: ++.RS ++.nf ++\fBzstyle \&':vcs_info:(svn|bzr):*' branchformat '%b%{'${fg[yellow]}'%}:%r'\fP ++.fi ++.RE ++.PP ++If you want colors, make sure you enclose the color codes in \fB%{\&.\&.\&.%}\fP ++if you want to use the string provided by \fBvcs_info\fP in prompts\&. ++.PP ++Here is how to print the VCS information as a command (not in a prompt): ++.RS ++.nf ++\fBalias vcsi=\&'vcs_info command; vcs_info_lastmsg'\fP ++.fi ++.RE ++.PP ++This way, you can even define different formats for output via ++\fBvcs_info_lastmsg\fP in the \&':vcs_info:*:command:*' namespace\&. ++.PP ++Now as promised, some code that uses hooks: ++say, you\&'d like to replace the string `svn' by `subversion' in ++\fBvcs_info\fP\&'s \fB%s\fP \fBformats\fP replacement\&. ++.PP ++First, we will tell \fBvcs_info\fP to call a function when populating ++the message variables with the gathered information: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*+set\-message:*' hooks svn2subversion\fP ++.fi ++.RE ++.PP ++Nothing happens\&. Which is reasonable, since we didn\&'t define the actual ++function yet\&. To see what the hooks subsystem is trying to do, enable the ++`\fBdebug\fP\&' style: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*+*:*' debug true\fP ++.fi ++.RE ++.PP ++That should give you an idea what is going on\&. Specifically, the function ++that we are looking for is `\fB+vi\-svn2subversion\fP\&'\&. Note, the `\fB+vi\-\fP' ++prefix\&. So, everything is in order, just as documented\&. When you are done ++checking out the debugging output, disable it again: ++.RS ++.nf ++\fBzstyle \&':vcs_info:*+*:*' debug false\fP ++.fi ++.RE ++.PP ++Now, let\&'s define the function: ++.RS ++.nf ++\fB ++function +vi\-svn2subversion() { ++ [[ ${hook_com[vcs_orig]} == svn ]] && hook_com[vcs]=subversion ++}\fP ++.fi ++.RE ++.PP ++Simple enough\&. And it could have even been simpler, if only we had ++registered our function in a less generic context\&. If we do it only in ++the `\fBsvn\fP\&' backend's context, we don't need to test which the active ++backend is: ++.RS ++.nf ++\fBzstyle \&':vcs_info:svn+set\-message:*' hooks svn2subversion\fP ++.fi ++.RE ++.RS ++.nf ++\fB ++function +vi\-svn2subversion() { ++ hook_com[vcs]=subversion ++}\fP ++.fi ++.RE ++.PP ++And finally a little more elaborate example, that uses a hook to create ++a customised bookmark string for the \fBhg\fP backend\&. ++.PP ++Again, we start off by registering a function: ++.RS ++.nf ++\fBzstyle \&':vcs_info:hg+gen\-hg\-bookmark\-string:*' hooks hgbookmarks\fP ++.fi ++.RE ++.PP ++And then we define the `\fB+vi\-hgbookmarks\fP function: ++.RS ++.nf ++\fB ++function +vi\-hgbookmarks() { ++ # The default is to connect all bookmark names by ++ # commas\&. This mixes things up a little\&. ++ # Imagine, there\&'s one type of bookmarks that is ++ # special to you\&. Say, because it\&'s *your* work\&. ++ # Those bookmarks look always like this: "sh/*" ++ # (because your initials are sh, for example)\&. ++ # This makes the bookmarks string use only those ++ # bookmarks\&. If there\&'s more than one, it ++ # concatenates them using commas\&. ++ local s i ++ # The bookmarks returned by `hg\&' are available in ++ # the functions positional parameters\&. ++ (( $# == 0 )) && return 0 ++ for i in "$@"; do ++ if [[ $i == sh/* ]]; then ++ [[ \-n $s ]] && s=$s, ++ s=${s}$i ++ fi ++ done ++ # Now, the communication with the code that calls ++ # the hook functions is done via the hook_com[] ++ # hash\&. The key, at which the `gen\-hg\-bookmark\-string\&' ++ # hook looks at is `hg\-bookmark\-string\&'\&. So: ++ hook_com[hg\-bookmark\-string]=$s ++ # And to signal, that we want to use the sting we ++ # just generated, set the special variable `ret\&' to ++ # something other than the default zero: ++ ret=1 ++ return 0 ++} ++\fP ++.fi ++.RE ++.PP ++Some longer examples and code snippets which might be useful are available in ++the examples file located at Misc/vcs_info\-examples in the Zsh source ++directory\&. ++.PP ++This concludes our guided tour through zsh\&'s \fBvcs_info\fP\&. ++.PP ++.SH "PROMPT THEMES" ++.PP ++.SS "Installation" ++.PP ++You should make sure all the functions from the \fBFunctions/Prompts\fP ++directory of the source distribution are available; they all begin with ++the string `\fBprompt_\fP\&' except for the special function`\fBpromptinit\fP'\&. ++You also need the `\fBcolors\fP\&' function from \fBFunctions/Misc\fP\&. All of ++these functions may already have been installed on your system; if not, ++you will need to find them and copy them\&. The directory should appear as ++one of the elements of the \fBfpath\fP array (this should already be the ++case if they were installed), and at least the function \fBpromptinit\fP ++should be autoloaded; it will autoload the rest\&. Finally, to initialize ++the use of the system you need to call the \fBpromptinit\fP function\&. The ++following code in your \fB\&.zshrc\fP will arrange for this; assume the ++functions are stored in the directory \fB~/myfns\fP: ++.PP ++.RS ++.nf ++\fBfpath=(~/myfns $fpath) ++autoload \-U promptinit ++promptinit\fP ++.fi ++.RE ++.PP ++.SS "Theme Selection" ++.PP ++Use the \fBprompt\fP command to select your preferred theme\&. This command ++may be added to your \fB\&.zshrc\fP following the call to \fBpromptinit\fP in ++order to start zsh with a theme already selected\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBprompt\fP [ \fB\-c\fP | \fB\-l\fP ] ++.TP ++.PD 0 ++\fBprompt\fP [ \fB\-p\fP | \fB\-h\fP ] [ \fItheme\fP \&.\&.\&. ] ++.TP ++.PD ++\fBprompt\fP [ \fB\-s\fP ] \fItheme\fP [ \fIarg\fP \&.\&.\&. ] ++Set or examine the prompt theme\&. With no options and a \fItheme\fP ++argument, the theme with that name is set as the current theme\&. The ++available themes are determined at run time; use the \fB\-l\fP option to see ++a list\&. The special \fItheme\fP `\fBrandom\fP\&' selects at random one of the ++available themes and sets your prompt to that\&. ++.RS ++.PP ++In some cases the \fItheme\fP may be modified by one or more arguments, ++which should be given after the theme name\&. See the help for each theme ++for descriptions of these arguments\&. ++.PP ++Options are: ++.PP ++.PD 0 ++.TP ++\fB\-c\fP ++Show the currently selected theme and its parameters, if any\&. ++.TP ++\fB\-l\fP ++List all available prompt themes\&. ++.TP ++\fB\-p\fP ++Preview the theme named by \fItheme\fP, or all themes if no ++\fItheme\fP is given\&. ++.TP ++\fB\-h\fP ++Show help for the theme named by \fItheme\fP, or for the ++\fBprompt\fP function if no \fItheme\fP is given\&. ++.TP ++\fB\-s\fP ++Set \fItheme\fP as the current theme and save state\&. ++.PD ++.RE ++.TP ++\fBprompt_\fP\fItheme\fP\fB_setup\fP ++Each available \fItheme\fP has a setup function which is called by the ++\fBprompt\fP function to install that theme\&. This function may define ++other functions as necessary to maintain the prompt, including functions ++used to preview the prompt or provide help for its use\&. You should not ++normally call a theme\&'s setup function directly\&. ++.PP ++.SH "ZLE FUNCTIONS" ++.PP ++.SS "Widgets" ++.PP ++These functions all implement user\-defined ZLE widgets (see ++\fIzshzle\fP(1)) which can be bound to keystrokes in interactive shells\&. To use them, ++your \fB\&.zshrc\fP should contain lines of the form ++.PP ++.RS ++.nf ++\fBautoload \fIfunction\fP ++zle \-N \fIfunction\fP\fP ++.fi ++.RE ++.PP ++followed by an appropriate \fBbindkey\fP command to associate the function ++with a key sequence\&. Suggested bindings are described below\&. ++.PP ++.PD 0 ++.TP ++.PD ++bash\-style word functions ++If you are looking for functions to implement moving over and editing ++words in the manner of bash, where only alphanumeric characters are ++considered word characters, you can use the functions described in ++the next section\&. The following is sufficient: ++.RS ++.PP ++.RS ++.nf ++\fBautoload \-U select\-word\-style ++select\-word\-style bash\fP ++.fi ++.RE ++.PP ++.RE ++.TP ++.PD 0 ++\fBforward\-word\-match\fP, \fBbackward\-word\-match\fP ++.TP ++.PD 0 ++\fBkill\-word\-match\fP, \fBbackward\-kill\-word\-match\fP ++.TP ++.PD 0 ++\fBtranspose\-words\-match\fP, \fBcapitalize\-word\-match\fP ++.TP ++.PD 0 ++\fBup\-case\-word\-match\fP, \fBdown\-case\-word\-match\fP ++.TP ++.PD ++\fBselect\-word\-style\fP, \fBmatch\-word\-context\fP, \fBmatch\-words\-by\-style\fP ++The eight `\fB\-match\fP\&' functions are drop\-in replacements for the ++builtin widgets without the suffix\&. By default they behave in a similar ++way\&. However, by the use of styles and the function \fBselect\-word\-style\fP, ++the way words are matched can be altered\&. ++.RS ++.PP ++The simplest way of configuring the functions is to use ++\fBselect\-word\-style\fP, which can either be called as a normal function with ++the appropriate argument, or invoked as a user\-defined widget that will ++prompt for the first character of the word style to be used\&. The first ++time it is invoked, the eight \fB\-match\fP functions will automatically ++replace the builtin versions, so they do not need to be loaded explicitly\&. ++.PP ++The word styles available are as follows\&. Only the first character ++is examined\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBbash\fP ++Word characters are alphanumeric characters only\&. ++.TP ++\fBnormal\fP ++As in normal shell operation: word characters are alphanumeric characters ++plus any characters present in the string given by the parameter ++\fB$WORDCHARS\fP\&. ++.TP ++\fBshell\fP ++Words are complete shell command arguments, possibly including complete ++quoted strings, or any tokens special to the shell\&. ++.TP ++\fBwhitespace\fP ++Words are any set of characters delimited by whitespace\&. ++.TP ++\fBdefault\fP ++Restore the default settings; this is usually the same as `\fBnormal\fP\&'\&. ++.PP ++All but `\fBdefault\fP\&' can be input as an upper case character, which has ++the same effect but with subword matching turned on\&. In this case, words ++with upper case characters are treated specially: each separate run of ++upper case characters, or an upper case character followed by any number of ++other characters, is considered a word\&. The style \fBsubword\-range\fP ++can supply an alternative character range to the default `\fB[:upper:]\fP\&'; ++the value of the style is treated as the contents of a `\fB[\fP\fI\&.\&.\&.\fP\fB]\fP\&' ++pattern (note that the outer brackets should not be supplied, only ++those surrounding named ranges)\&. ++.PP ++More control can be obtained using the \fBzstyle\fP command, as described in ++\fIzshmodules\fP(1)\&. Each style is looked up in the ++context \fB:zle:\fP\fIwidget\fP where \fIwidget\fP is the name of the ++user\-defined widget, not the name of the function implementing it, so in ++the case of the definitions supplied by \fBselect\-word\-style\fP the ++appropriate contexts are \fB:zle:forward\-word\fP, and so on\&. The function ++\fBselect\-word\-style\fP itself always defines styles for the context ++`\fB:zle:*\fP\&' which can be overridden by more specific (longer) patterns as ++well as explicit contexts\&. ++.PP ++The style \fBword\-style\fP specifies the rules to use\&. This may have the ++following values\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBnormal\fP ++Use the standard shell rules, i\&.e\&. alphanumerics and \fB$WORDCHARS\fP, unless ++overridden by the styles \fBword\-chars\fP or \fBword\-class\fP\&. ++.TP ++\fBspecified\fP ++Similar to \fBnormal\fP, but \fIonly\fP the specified characters, and not also ++alphanumerics, are considered word characters\&. ++.TP ++\fBunspecified\fP ++The negation of specified\&. The given characters are those which will ++\fInot\fP be considered part of a word\&. ++.TP ++\fBshell\fP ++Words are obtained by using the syntactic rules for generating shell ++command arguments\&. In addition, special tokens which are never command ++arguments such as `\fB()\fP\&' are also treated as words\&. ++.TP ++\fBwhitespace\fP ++Words are whitespace\-delimited strings of characters\&. ++.PP ++The first three of those rules usually use \fB$WORDCHARS\fP, but the value ++in the parameter can be overridden by the style \fBword\-chars\fP, which works ++in exactly the same way as \fB$WORDCHARS\fP\&. In addition, the style ++\fBword\-class\fP uses character class syntax to group characters and takes ++precedence over \fBword\-chars\fP if both are set\&. The \fBword\-class\fP style ++does not include the surrounding brackets of the character class; for ++example, `\fB\-:[:alnum:]\fP\&' is a valid \fBword\-class\fP to include all ++alphanumerics plus the characters `\fB\-\fP\&' and `\fB:\fP'\&. Be careful ++including `\fB]\fP\&', `\fB^\fP' and `\fB\-\fP' as these are special inside ++character classes\&. ++.PP ++\fBword\-style\fP may also have `\fB\-subword\fP\&' appended to its value to ++turn on subword matching, as described above\&. ++.PP ++The style \fBskip\-chars\fP is mostly useful for ++\fBtranspose\-words\fP and similar functions\&. If set, it gives a count of ++characters starting at the cursor position which will not be considered ++part of the word and are treated as space, regardless of what they actually ++are\&. For example, if ++.PP ++.RS ++.nf ++\fBzstyle \&':zle:transpose\-words' skip\-chars 1\fP ++.fi ++.RE ++.PP ++has been set, and \fBtranspose\-words\-match\fP is called with the cursor on ++the \fIX\fP of \fBfoo\fP\fIX\fP\fBbar\fP, where \fIX\fP can be any character, then ++the resulting expression is \fBbar\fP\fIX\fP\fBfoo\fP\&. ++.PP ++Finer grained control can be obtained by setting the style \fBword\-context\fP ++to an array of pairs of entries\&. Each pair of entries consists of a ++\fIpattern\fP and a \fIsubcontext\fP\&. The shell argument the cursor is on is ++matched against each \fIpattern\fP in turn until one matches; if it does, ++the context is extended by a colon and the corresponding \fIsubcontext\fP\&. ++Note that the test is made against the original word on the line, with no ++stripping of quotes\&. Special handling is done between words: the current ++context is examined and if it contains the string \fBback\fP, the word before ++the cursor is considered, else the word after cursor is considered\&. Some ++examples are given below\&. ++.PP ++Here are some examples of use of the styles, actually taken from the ++simplified interface in \fBselect\-word\-style\fP: ++.PP ++.RS ++.nf ++\fBzstyle \&':zle:*' word\-style standard ++zstyle \&':zle:*' word\-chars ''\fP ++.fi ++.RE ++.PP ++Implements bash\-style word handling for all widgets, i\&.e\&. only ++alphanumerics are word characters; equivalent to setting ++the parameter \fBWORDCHARS\fP empty for the given context\&. ++.PP ++.RS ++.nf ++\fBstyle \&':zle:*kill*' word\-style space\fP ++.fi ++.RE ++.PP ++Uses space\-delimited words for widgets with the word `kill\&' in the name\&. ++Neither of the styles \fBword\-chars\fP nor \fBword\-class\fP is used in this case\&. ++.PP ++Here are some examples of use of the \fBword\-context\fP style to extend ++the context\&. ++.PP ++.RS ++.nf ++\fBzstyle \&':zle:*' word\-context "*/*" file "[[:space:]]" whitespace ++zstyle \&':zle:transpose\-words:whitespace' word\-style shell ++zstyle \&':zle:transpose\-words:filename' word\-style normal ++zstyle \&':zle:transpose\-words:filename' word\-chars ''\fP ++.fi ++.RE ++.PP ++This provides two different ways of using \fBtranspose\-words\fP depending on ++whether the cursor is on whitespace between words or on a filename, here ++any word containing a \fB/\fP\&. On whitespace, complete arguments as defined ++by standard shell rules will be transposed\&. In a filename, only ++alphanumerics will be transposed\&. Elsewhere, words will be transposed ++using the default style for \fB:zle:transpose\-words\fP\&. ++.PP ++The word matching and all the handling of \fBzstyle\fP settings is actually ++implemented by the function \fBmatch\-words\-by\-style\fP\&. This can be used to ++create new user\-defined widgets\&. The calling function should set the local ++parameter \fBcurcontext\fP to \fB:zle:\fP\fIwidget\fP, create the local ++parameter \fBmatched_words\fP and call \fBmatch\-words\-by\-style\fP with no ++arguments\&. On return, \fBmatched_words\fP will be set to an array with the ++elements: (1) the start of the line (2) the word before the cursor (3) any ++non\-word characters between that word and the cursor (4) any non\-word ++character at the cursor position plus any remaining non\-word characters ++before the next word, including all characters specified by the ++\fBskip\-chars\fP style, (5) the word at or following the cursor (6) any ++non\-word characters following that word (7) the remainder of the line\&. Any ++of the elements may be an empty string; the calling function should test ++for this to decide whether it can perform its function\&. ++.PP ++It is possible to pass options with arguments to \fBmatch\-words\-by\-style\fP ++to override the use of styles\&. The options are: ++.PD 0 ++.TP ++\fB\-w\fP ++\fIword\-style\fP ++.TP ++\fB\-s\fP ++\fIskip\-chars\fP ++.TP ++\fB\-c\fP ++\fIword\-class\fP ++.TP ++\fB\-C\fP ++\fIword\-chars\fP ++.TP ++\fB\-r\fP ++\fIsubword\-range\fP ++.PD ++.PP ++For example, \fBmatch\-words\-by\-style \-w shell \-c 0\fP may be used to ++extract the command argument around the cursor\&. ++.PP ++The \fBword\-context\fP style is implemented by the function ++\fBmatch\-word\-context\fP\&. This should not usually need to be called ++directly\&. ++.RE ++.TP ++\fBcopy\-earlier\-word\fP ++This widget works like a combination of \fBinsert\-last\-word\fP and ++\fBcopy\-prev\-shell\-word\fP\&. Repeated invocations of the widget retrieve ++earlier words on the relevant history line\&. With a numeric argument ++\fIN\fP, insert the \fIN\fPth word from the history line; \fIN\fP may be ++negative to count from the end of the line\&. ++.RS ++.PP ++If \fBinsert\-last\-word\fP has been used to retrieve the last word on a ++previous history line, repeated invocations will replace that word with ++earlier words from the same line\&. ++.PP ++Otherwise, the widget applies to words on the line currently being edited\&. ++The \fBwidget\fP style can be set to the name of another widget that should ++be called to retrieve words\&. This widget must accept the same three ++arguments as \fBinsert\-last\-word\fP\&. ++.RE ++.TP ++\fBcycle\-completion\-positions\fP ++After inserting an unambiguous string into the command line, the new ++function based completion system may know about multiple places in ++this string where characters are missing or differ from at least one ++of the possible matches\&. It will then place the cursor on the ++position it considers to be the most interesting one, i\&.e\&. the one ++where one can disambiguate between as many matches as possible with as ++little typing as possible\&. ++.RS ++.PP ++This widget allows the cursor to be easily moved to the other interesting ++spots\&. It can be invoked repeatedly to cycle between all positions ++reported by the completion system\&. ++.RE ++.TP ++\fBdelete\-whole\-word\-match\fP ++This is another function which works like the \fB\-match\fP functions ++described immediately above, i\&.e\&. using styles to decide the word ++boundaries\&. However, it is not a replacement for any existing function\&. ++.RS ++.PP ++The basic behaviour is to delete the word around the cursor\&. There is no ++numeric prefix handling; only the single word around the cursor is ++considered\&. If the widget contains the string \fBkill\fP, the removed text ++will be placed in the cutbuffer for future yanking\&. This can be obtained ++by defining \fBkill\-whole\-word\-match\fP as follows: ++.PP ++.RS ++.nf ++\fBzle \-N kill\-whole\-word\-match delete\-whole\-word\-match\fP ++.fi ++.RE ++.PP ++and then binding the widget \fBkill\-whole\-word\-match\fP\&. ++.RE ++.TP ++\fBup\-line\-or\-beginning\-search\fP, \fBdown\-line\-or\-beginning\-search\fP ++These widgets are similar to the builtin functions \fBup\-line\-or\-search\fP ++and \fBdown\-line\-or\-search\fP: if in a multiline buffer they move up or ++down within the buffer, otherwise they search for a history line matching ++the start of the current line\&. In this case, however, they search for ++a line which matches the current line up to the current cursor position, in ++the manner of \fBhistory\-beginning\-search\-backward\fP and \fB\-forward\fP, rather ++than the first word on the line\&. ++.TP ++\fBedit\-command\-line\fP ++Edit the command line using your visual editor, as in \fBksh\fP\&. ++.RS ++.PP ++.RS ++.nf ++\fBbindkey \-M vicmd v edit\-command\-line\fP ++.fi ++.RE ++.RE ++.TP ++\fBhistory\-search\-end\fP ++This function implements the widgets ++\fBhistory\-beginning\-search\-backward\-end\fP and ++\fBhistory\-beginning\-search\-forward\-end\fP\&. These commands work by first ++calling the corresponding builtin widget (see ++`History Control\&' in \fIzshzle\fP(1)) and then moving the cursor to the end of the line\&. The original cursor ++position is remembered and restored before calling the builtin widget a ++second time, so that the same search is repeated to look farther through ++the history\&. ++.RS ++.PP ++Although you \fBautoload\fP only one function, the commands to use it are ++slightly different because it implements two widgets\&. ++.PP ++.RS ++.nf ++\fBzle \-N history\-beginning\-search\-backward\-end \e ++ history\-search\-end ++zle \-N history\-beginning\-search\-forward\-end \e ++ history\-search\-end ++bindkey \&'\ee^P' history\-beginning\-search\-backward\-end ++bindkey \&'\ee^N' history\-beginning\-search\-forward\-end\fP ++.fi ++.RE ++.RE ++.TP ++\fBhistory\-beginning\-search\-menu\fP ++This function implements yet another form of history searching\&. The ++text before the cursor is used to select lines from the history, ++as for \fBhistory\-beginning\-search\-backward\fP except that all matches are ++shown in a numbered menu\&. Typing the appropriate digits inserts the ++full history line\&. Note that leading zeroes must be typed (they are only ++shown when necessary for removing ambiguity)\&. The entire history is ++searched; there is no distinction between forwards and backwards\&. ++.RS ++.PP ++With a prefix argument, the search is not anchored to the start of ++the line; the string typed by the use may appear anywhere in the line ++in the history\&. ++.PP ++If the widget name contains `\fB\-end\fP\&' the cursor is moved to the end of ++the line inserted\&. If the widget name contains `\fB\-space\fP\&' any space ++in the text typed is treated as a wildcard and can match anything (hence ++a leading space is equivalent to giving a prefix argument)\&. Both ++forms can be combined, for example: ++.PP ++.RS ++.nf ++\fBzle \-N history\-beginning\-search\-menu\-space\-end \e ++ history\-beginning\-search\-menu\fP ++.fi ++.RE ++.RE ++.TP ++\fBhistory\-pattern\-search\fP ++The function \fBhistory\-pattern\-search\fP implements widgets which prompt ++for a pattern with which to search the history backwards or forwards\&. The ++pattern is in the usual zsh format, however the first character may be ++\fB^\fP to anchor the search to the start of the line, and the last character ++may be \fB$\fP to anchor the search to the end of the line\&. If the ++search was not anchored to the end of the line the cursor is positioned ++just after the pattern found\&. ++.RS ++.PP ++The commands to create bindable widgets are similar to those in the ++example immediately above: ++.PP ++.RS ++.nf ++\fBautoload \-U history\-pattern\-search ++zle \-N history\-pattern\-search\-backward history\-pattern\-search ++zle \-N history\-pattern\-search\-forward history\-pattern\-search\fP ++.fi ++.RE ++.RE ++.TP ++\fBincarg\fP ++Typing the keystrokes for this widget with the cursor placed on or to the ++left of an integer causes that integer to be incremented by one\&. With a ++numeric prefix argument, the number is incremented by the amount of the ++argument (decremented if the prefix argument is negative)\&. The shell ++parameter \fBincarg\fP may be set to change the default increment to ++something other than one\&. ++.RS ++.PP ++.RS ++.nf ++\fBbindkey \&'^X+' incarg\fP ++.fi ++.RE ++.RE ++.TP ++\fBincremental\-complete\-word\fP ++This allows incremental completion of a word\&. After starting this ++command, a list of completion choices can be shown after every character ++you type, which you can delete with \fB^H\fP or \fBDEL\fP\&. Pressing return ++accepts the completion so far and returns you to normal editing (that is, ++the command line is \fInot\fP immediately executed)\&. You can hit \fBTAB\fP to ++do normal completion, \fB^G\fP to abort back to the state when you started, ++and \fB^D\fP to list the matches\&. ++.RS ++.PP ++This works only with the new function based completion system\&. ++.PP ++.RS ++.nf ++\fBbindkey \&'^Xi' incremental\-complete\-word\fP ++.fi ++.RE ++.RE ++.TP ++\fBinsert\-composed\-char\fP ++This function allows you to compose characters that don\&'t appear on the ++keyboard to be inserted into the command line\&. The command is followed by ++two keys corresponding to ASCII characters (there is no prompt)\&. For ++accented characters, the two keys are a base character followed by a code ++for the accent, while for other special characters the two characters ++together form a mnemonic for the character to be inserted\&. The ++two\-character codes are a subset of those given by RFC 1345 (see for ++example \fBhttp://www\&.faqs\&.org/rfcs/rfc1345\&.html\fP)\&. ++.RS ++.PP ++The function may optionally be followed by up to two characters which ++replace one or both of the characters read from the keyboard; if both ++characters are supplied, no input is read\&. For example, ++\fBinsert\-composed\-char a:\fP can be used within a widget to insert an a with ++umlaut into the command line\&. This has the advantages over use of a ++literal character that it is more portable\&. ++.PP ++For best results zsh should have been built with support for multibyte ++characters (configured with \fB\-\-enable\-multibyte\fP); however, the function ++works for the limited range of characters available in single\-byte ++character sets such as ISO\-8859\-1\&. ++.PP ++The character is converted into the local representation and ++inserted into the command line at the cursor position\&. ++(The conversion is done within the shell, using whatever facilities ++the C library provides\&.) With a numeric argument, the character and its ++code are previewed in the status line ++.PP ++The function may be run outside zle in which case it prints the character ++(together with a newline) to standard output\&. Input is still read from ++keystrokes\&. ++.PP ++See \fBinsert\-unicode\-char\fP for an alternative way of inserting Unicode ++characters using their hexadecimal character number\&. ++.PP ++The set of accented characters is reasonably complete up to Unicode ++character U+0180, the set of special characters less so\&. However, it ++is very sporadic from that point\&. Adding new characters is easy, ++however; see the function \fBdefine\-composed\-chars\fP\&. Please send any ++additions to \fBzsh\-workers@zsh\&.org\fP\&. ++.PP ++The codes for the second character when used to accent the first are as ++follows\&. Note that not every character can take every accent\&. ++.PD 0 ++.TP ++\fB!\fP ++Grave\&. ++.TP ++\fB\&'\fP ++Acute\&. ++.TP ++\fB>\fP ++Circumflex\&. ++.TP ++\fB?\fP ++Tilde\&. (This is not \fB~\fP as RFC 1345 does not assume that ++character is present on the keyboard\&.) ++.TP ++\fB\-\fP ++Macron\&. (A horizontal bar over the base character\&.) ++.TP ++\fB(\fP ++Breve\&. (A shallow dish shape over the base character\&.) ++.TP ++\fB\&.\fP ++Dot above the base character, or in the case of \fBi\fP no dot, ++or in the case of \fBL\fP and \fBl\fP a centered dot\&. ++.TP ++\fB:\fP ++Diaeresis (Umlaut)\&. ++.TP ++\fBc\fP ++Cedilla\&. ++.TP ++\fB_\fP ++Underline, however there are currently no underlined characters\&. ++.TP ++\fB/\fP ++Stroke through the base character\&. ++.TP ++\fB"\fP ++Double acute (only supported on a few letters)\&. ++.TP ++\fB;\fP ++Ogonek\&. (A little forward facing hook at the bottom right ++of the character\&.) ++.TP ++\fB<\fP ++Caron\&. (A little v over the letter\&.) ++.TP ++\fB0\fP ++Circle over the base character\&. ++.TP ++\fB2\fP ++Hook over the base character\&. ++.TP ++\fB9\fP ++Horn over the base character\&. ++.PD ++.PP ++The most common characters from the Arabic, Cyrillic, Greek and Hebrew ++alphabets are available; consult RFC 1345 for the appropriate sequences\&. ++In addition, a set of two letter codes not in RFC 1345 are available for ++the double\-width characters corresponding to ASCII characters from \fB!\fP ++to \fB~\fP (0x21 to 0x7e) by preceding the character with \fB^\fP, for ++example \fB^A\fP for a double\-width \fBA\fP\&. ++.PP ++The following other two\-character sequences are understood\&. ++.PP ++.PD 0 ++.TP ++.PD ++ASCII characters ++These are already present on most keyboards: ++.PD 0 ++.TP ++\fB<(\fP ++Left square bracket ++.TP ++\fB//\fP ++Backslash (solidus) ++.TP ++\fB)>\fP ++Right square bracket ++.TP ++\fB(!\fP ++Left brace (curly bracket) ++.TP ++\fB!!\fP ++Vertical bar (pipe symbol) ++.TP ++\fB!)\fP ++Right brace (curly bracket) ++.TP ++\fB\&'?\fP ++Tilde ++.PD ++.TP ++Special letters ++Characters found in various variants of the Latin alphabet: ++.PD 0 ++.TP ++\fBss\fP ++Eszett (scharfes S) ++.TP ++\fBD\-\fP, \fBd\-\fP ++Eth ++.TP ++\fBTH\fP, \fBth\fP ++Thorn ++.TP ++\fBkk\fP ++Kra ++.TP ++\fB\&'n\fP ++\&'n ++.TP ++\fBNG\fP, \fBng\fP ++Ng ++.TP ++\fBOI\fP, \fBoi\fP ++Oi ++.TP ++\fByr\fP ++yr ++.TP ++\fBED\fP ++ezh ++.PD ++.TP ++Currency symbols ++.PD 0 ++.TP ++\fBCt\fP ++Cent ++.TP ++\fBPd\fP ++Pound sterling (also lira and others) ++.TP ++\fBCu\fP ++Currency ++.TP ++\fBYe\fP ++Yen ++.TP ++\fBEu\fP ++Euro (N\&.B\&. not in RFC 1345) ++.PD ++.TP ++Punctuation characters ++References to "right" quotes indicate the shape (like a 9 rather than 6) ++rather than their grammatical use\&. (For example, a "right" low double ++quote is used to open quotations in German\&.) ++.PD 0 ++.TP ++\fB!I\fP ++Inverted exclamation mark ++.TP ++\fBBB\fP ++Broken vertical bar ++.TP ++\fBSE\fP ++Section ++.TP ++\fBCo\fP ++Copyright ++.TP ++\fB\-a\fP ++Spanish feminine ordinal indicator ++.TP ++\fB<<\fP ++Left guillemet ++.TP ++\fB\-\fP\fB\-\fP ++Soft hyphen ++.TP ++\fBRg\fP ++Registered trade mark ++.TP ++\fBPI\fP ++Pilcrow (paragraph) ++.TP ++\fB\-o\fP ++Spanish masculine ordinal indicator ++.TP ++\fB>>\fP ++Right guillemet ++.TP ++\fB?I\fP ++Inverted question mark ++.TP ++\fB\-1\fP ++Hyphen ++.TP ++\fB\-N\fP ++En dash ++.TP ++\fB\-M\fP ++Em dash ++.TP ++\fB\-3\fP ++Horizontal bar ++.TP ++\fB:3\fP ++Vertical ellipsis ++.TP ++\fB\&.3\fP ++Horizontal midline ellipsis ++.TP ++\fB!2\fP ++Double vertical line ++.TP ++\fB=2\fP ++Double low line ++.TP ++\fB\&'6\fP ++Left single quote ++.TP ++\fB\&'9\fP ++Right single quote ++.TP ++\fB\&.9\fP ++"Right" low quote ++.TP ++\fB9\&'\fP ++Reversed "right" quote ++.TP ++\fB"6\fP ++Left double quote ++.TP ++\fB"9\fP ++Right double quote ++.TP ++\fB:9\fP ++"Right" low double quote ++.TP ++\fB9"\fP ++Reversed "right" double quote ++.TP ++\fB/\-\fP ++Dagger ++.TP ++\fB/=\fP ++Double dagger ++.PD ++.TP ++Mathematical symbols ++.PD 0 ++.TP ++\fBDG\fP ++Degree ++.TP ++\fB\-2\fP, \fB+\-\fP, \fB\-+\fP ++\- sign, +/\- sign, \-/+ sign ++.TP ++\fB2S\fP ++Superscript 2 ++.TP ++\fB3S\fP ++Superscript 3 ++.TP ++\fB1S\fP ++Superscript 1 ++.TP ++\fBMy\fP ++Micro ++.TP ++\fB\&.M\fP ++Middle dot ++.TP ++\fB14\fP ++Quarter ++.TP ++\fB12\fP ++Half ++.TP ++\fB34\fP ++Three quarters ++.TP ++\fB*X\fP ++Multiplication ++.TP ++\fB\-:\fP ++Division ++.TP ++\fB%0\fP ++Per mille ++.TP ++\fBFA\fP, \fBTE\fP, \fB/0\fP ++For all, there exists, empty set ++.TP ++\fBdP\fP, \fBDE\fP, \fBNB\fP ++Partial derivative, delta (increment), del ++(nabla) ++.TP ++\fB(\-\fP, \fB\-)\fP ++Element of, contains ++.TP ++\fB*P\fP, \fB+Z\fP ++Product, sum ++.TP ++\fB*\-\fP, \fBOb\fP, \fBSb\fP ++Asterisk, ring, bullet ++.TP ++\fBRT\fP, \fB0(\fP, \fB00\fP ++Root sign, proportional to, infinity ++.PD ++.TP ++Other symbols ++.PD 0 ++.TP ++\fBcS\fP, \fBcH\fP, \fBcD\fP, \fBcC\fP ++Card suits: spades, hearts, diamonds, ++clubs ++.TP ++\fBMd\fP, \fBM8\fP, \fBM2\fP, \fBMb\fP, \fBMx\fP, \fBMX\fP ++Musical notation: ++crotchet (quarter note), quaver (eighth note), semiquavers (sixteenth ++notes), flag sign, natural sign, sharp sign ++.TP ++\fBFm\fP, \fBMl\fP ++Female, male ++.PD ++.TP ++Accents on their own ++.PD 0 ++.TP ++\fB\&'>\fP ++Circumflex (same as caret, \fB^\fP) ++.TP ++\fB\&'!\fP ++Grave (same as backtick, \fB`\fP) ++.TP ++\fB\&',\fP ++Cedilla ++.TP ++\fB\&':\fP ++Diaeresis (Umlaut) ++.TP ++\fB\&'m\fP ++Macron ++.TP ++\fB\&''\fP ++Acute ++.PD ++.RE ++.TP ++\fBinsert\-files\fP ++This function allows you type a file pattern, and see the results of the ++expansion at each step\&. When you hit return, all expansions are inserted ++into the command line\&. ++.RS ++.PP ++.RS ++.nf ++\fBbindkey \&'^Xf' insert\-files\fP ++.fi ++.RE ++.RE ++.TP ++\fBinsert\-unicode\-char\fP ++When first executed, the user inputs a set of hexadecimal digits\&. ++This is terminated with another call to \fBinsert\-unicode\-char\fP\&. ++The digits are then turned into the corresponding Unicode character\&. ++For example, if the widget is bound to \fB^XU\fP, the character sequence ++`\fB^XU 4 c ^XU\fP\&' inserts \fBL\fP (Unicode U+004c)\&. ++.RS ++.PP ++See \fBinsert\-composed\-char\fP for a way of inserting characters ++using a two\-character mnemonic\&. ++.RE ++.TP ++.PD 0 ++\fBnarrow\-to\-region [ \-p\fP \fIpre\fP \fB] [ \-P\fP \fIpost\fP \fB]\fP ++.TP ++.PD 0 ++ \fB[ \-S\fP \fIstatepm\fP \fB| \-R\fP \fIstatepm\fP \fB] [ \-n ] [\fP \fIstart\fP \fIend\fP \fB]\fP) ++.TP ++.PD ++\fBnarrow\-to\-region\-invisible\fP ++Narrow the editable portion of the buffer to the region between the cursor ++and the mark, which may be in either order\&. The region may not be empty\&. ++.RS ++.PP ++\fBnarrow\-to\-region\fP may be used as a widget or called as a function from a ++user\-defined widget; by default, the text outside the editable area remains ++visible\&. A \fBrecursive\-edit\fP is performed and the original widening ++status is then restored\&. Various options and arguments are available when ++it is called as a function\&. ++.PP ++The options \fB\-p\fP \fIpretext\fP and \fB\-P\fP \fIposttext\fP may be ++used to replace the text before and after the display for the duration of ++the function; either or both may be an empty string\&. ++.PP ++If the option \fB\-n\fP is also given, \fIpretext\fP or \fIposttext\fP will only ++be inserted if there is text before or after the region respectively which ++will be made invisible\&. ++.PP ++Two numeric arguments may be given which will be used instead of the cursor ++and mark positions\&. ++.PP ++The option \fB\-S\fP \fIstatepm\fP is used to narrow according to the other ++options while saving the original state in the parameter with name ++\fIstatepm\fP, while the option \fB\-R\fP \fIstatepm\fP is used to restore the ++state from the parameter; note in both cases the \fIname\fP of the parameter ++is required\&. In the second case, other options and arguments are ++irrelevant\&. When this method is used, no \fBrecursive\-edit\fP is performed; ++the calling widget should call this function with the option \fB\-S\fP, ++perform its own editing on the command line or pass control to the user ++via `\fBzle recursive\-edit\fP\&', then call this function with the option ++\fB\-R\fP\&. The argument \fIstatepm\fP must be a suitable name for an ordinary ++parameter, except that parameters beginning with the prefix \fB_ntr_\fP are ++reserved for use within \fBnarrow\-to\-region\fP\&. Typically the parameter will ++be local to the calling function\&. ++.PP ++\fBnarrow\-to\-region\-invisible\fP is a simple widget which calls ++\fBnarrow\-to\-region\fP with arguments which replace any text outside the ++region with `\fB\&.\&.\&.\fP\&'\&. ++.PP ++The display is restored (and the widget returns) upon any zle command ++which would usually cause the line to be accepted or aborted\&. Hence an ++additional such command is required to accept or abort the current line\&. ++.PP ++The return status of both widgets is zero if the line was accepted, else ++non\-zero\&. ++.PP ++Here is a trivial example of a widget using this feature\&. ++.RS ++.nf ++\fBlocal state ++narrow\-to\-region \-p $\&'Editing restricted region\en' \e ++ \-P \&'' \-S state ++zle recursive\-edit ++narrow\-to\-region \-R state\fP ++.fi ++.RE ++.RE ++.TP ++\fBpredict\-on\fP ++This set of functions implements predictive typing using history search\&. ++After \fBpredict\-on\fP, typing characters causes the editor to look backward ++in the history for the first line beginning with what you have typed so ++far\&. After \fBpredict\-off\fP, editing returns to normal for the line found\&. ++In fact, you often don\&'t even need to use \fBpredict\-off\fP, because if the ++line doesn\&'t match something in the history, adding a key performs ++standard completion, and then inserts itself if no completions were found\&. ++However, editing in the middle of a line is liable to confuse prediction; ++see the \fBtoggle\fP style below\&. ++.RS ++.PP ++With the function based completion system (which is needed for this), you ++should be able to type \fBTAB\fP at almost any point to advance the cursor ++to the next ``interesting\&'' character position (usually the end of the ++current word, but sometimes somewhere in the middle of the word)\&. And of ++course as soon as the entire line is what you want, you can accept with ++return, without needing to move the cursor to the end first\&. ++.PP ++The first time \fBpredict\-on\fP is used, it creates several additional ++widget functions: ++.PP ++.PD 0 ++.TP ++\fBdelete\-backward\-and\-predict\fP ++Replaces the \fBbackward\-delete\-char\fP ++widget\&. You do not need to bind this yourself\&. ++.TP ++\fBinsert\-and\-predict\fP ++Implements predictive typing by replacing the ++\fBself\-insert\fP widget\&. You do not need to bind this yourself\&. ++.TP ++\fBpredict\-off\fP ++Turns off predictive typing\&. ++.PD ++.PP ++Although you \fBautoload\fP only the \fBpredict\-on\fP function, it is ++necessary to create a keybinding for \fBpredict\-off\fP as well\&. ++.PP ++.RS ++.nf ++\fBzle \-N predict\-on ++zle \-N predict\-off ++bindkey \&'^X^Z' predict\-on ++bindkey \&'^Z' predict\-off\fP ++.fi ++.RE ++.RE ++.TP ++\fBread\-from\-minibuffer\fP ++This is most useful when called as a function from inside a widget, but will ++work correctly as a widget in its own right\&. It prompts for a value ++below the current command line; a value may be input using all of the ++standard zle operations (and not merely the restricted set available ++when executing, for example, \fBexecute\-named\-cmd\fP)\&. The value is then ++returned to the calling function in the parameter \fB$REPLY\fP and the ++editing buffer restored to its previous state\&. If the read was aborted ++by a keyboard break (typically \fB^G\fP), the function returns status 1 ++and \fB$REPLY\fP is not set\&. ++.RS ++.PP ++If one argument is supplied to the function it is taken as a prompt, ++otherwise `\fB? \fP\&' is used\&. If two arguments are supplied, they are the ++prompt and the initial value of \fB$LBUFFER\fP, and if a third argument is ++given it is the initial value of \fB$RBUFFER\fP\&. This provides a default ++value and starting cursor placement\&. Upon return the entire buffer is the ++value of \fB$REPLY\fP\&. ++.PP ++One option is available: `\fB\-k\fP \fInum\fP\&' specifies that \fInum\fP ++characters are to be read instead of a whole line\&. The line editor is not ++invoked recursively in this case, so depending on the terminal settings ++the input may not be visible, and only the input keys are placed in ++\fB$REPLY\fP, not the entire buffer\&. Note that unlike the \fBread\fP builtin ++\fInum\fP must be given; there is no default\&. ++.PP ++The name is a slight misnomer, as in fact the shell\&'s own minibuffer is ++not used\&. Hence it is still possible to call \fBexecuted\-named\-cmd\fP and ++similar functions while reading a value\&. ++.RE ++.TP ++.PD 0 ++\fBreplace\-string\fP, \fBreplace\-pattern\fP ++.TP ++.PD ++\fBreplace\-string\-again\fP, \fBreplace\-pattern\-again\fP ++The function \fBreplace\-string\fP implements three widgets\&. ++If defined under the same name as the function, it prompts for two ++strings; the first (source) string will be replaced by the second ++everywhere it occurs in the line editing buffer\&. ++.RS ++.PP ++If the widget name contains the word `\fBpattern\fP\&', for example by ++defining the widget using the command `\fBzle \-N replace\-pattern ++replace\-string\fP\&', then the matching is performed using zsh patterns\&. All ++zsh extended globbing patterns can be used in the source string; note ++that unlike filename generation the pattern does not need to match an ++entire word, nor do glob qualifiers have any effect\&. In addition, the ++replacement string can contain parameter or command substitutions\&. ++Furthermore, a `\fB&\fP\&' in the replacement string will be replaced with ++the matched source string, and a backquoted digit `\fB\e\fP\fIN\fP\&' will be ++replaced by the \fIN\fPth parenthesised expression matched\&. The form ++`\fB\e{\fP\fIN\fP\fB}\fP\&' may be used to protect the digit from following ++digits\&. ++.PP ++If the widget instead contains the word `\fBregex\fP\&' (or `\fBregexp\fP'), ++then the matching is performed using regular expressions, respecting ++the setting of the option \fBRE_MATCH_PCRE\fP (see the description of the ++function \fBregexp\-replace\fP below)\&. The special replacement facilities ++described above for pattern matching are available\&. ++.PP ++By default the previous source or replacement string will not be offered ++for editing\&. However, this feature can be activated by setting the style ++\fBedit\-previous\fP in the context \fB:zle:\fP\fIwidget\fP (for example, ++\fB:zle:replace\-string\fP) to \fBtrue\fP\&. In addition, a positive ++numeric argument forces the previous values to be offered, a negative or ++zero argument forces them not to be\&. ++.PP ++The function \fBreplace\-string\-again\fP can be used to repeat the previous ++replacement; no prompting is done\&. As with \fBreplace\-string\fP, if the name ++of the widget contains the word `\fBpattern\fP\&' or `\fBregex\fP', pattern or ++regular expression matching is performed, else a literal string ++replacement\&. Note that the previous source and replacement text are the ++same whether pattern, regular expression or string matching is used\&. ++.PP ++For example, starting from the line: ++.PP ++.RS ++.nf ++\fBprint This line contains fan and fond\fP ++.fi ++.RE ++.PP ++and invoking \fBreplace\-pattern\fP with the source string ++`\fBf(?)n\fP\&' and ++the replacement string `\fBc\e1r\fP\&' produces the not very useful line: ++.PP ++.RS ++.nf ++\fBprint This line contains car and cord\fP ++.fi ++.RE ++.PP ++The range of the replacement string can be limited by using the ++\fBnarrow\-to\-region\-invisible\fP widget\&. One limitation of the current ++version is that \fBundo\fP will cycle through changes to the replacement ++and source strings before undoing the replacement itself\&. ++.RE ++.TP ++\fBsend\-invisible\fP ++This is similar to read\-from\-minibuffer in that it may be called as a ++function from a widget or as a widget of its own, and interactively reads ++input from the keyboard\&. However, the input being typed is concealed and ++a string of asterisks (`\fB*\fP\&') is shown instead\&. The value is saved in ++the parameter \fB$INVISIBLE\fP to which a reference is inserted into the ++editing buffer at the restored cursor position\&. If the read was aborted ++by a keyboard break (typically \fB^G\fP) or another escape from editing such ++as \fBpush\-line\fP, \fB$INVISIBLE\fP is set to empty and the original buffer ++is restored unchanged\&. ++.RS ++.PP ++If one argument is supplied to the function it is taken as a prompt, ++otherwise `\fBNon\-echoed text: \fP\&' is used (as in emacs)\&. If a second and ++third argument are supplied they are used to begin and end the reference ++to \fB$INVISIBLE\fP that is inserted into the buffer\&. The default is to ++open with \fB${\fP, then \fBINVISIBLE\fP, and close with \fB}\fP, but many ++other effects are possible\&. ++.RE ++.TP ++\fBsmart\-insert\-last\-word\fP ++This function may replace the \fBinsert\-last\-word\fP widget, like so: ++.RS ++.PP ++.RS ++.nf ++\fBzle \-N insert\-last\-word smart\-insert\-last\-word\fP ++.fi ++.RE ++.PP ++With a numeric prefix, or when passed command line arguments in a call ++from another widget, it behaves like \fBinsert\-last\-word\fP, except that ++words in comments are ignored when \fBINTERACTIVE_COMMENTS\fP is set\&. ++.PP ++Otherwise, the rightmost ``interesting\&'' word from the previous command is ++found and inserted\&. The default definition of ``interesting\&'' is that the ++word contains at least one alphabetic character, slash, or backslash\&. ++This definition may be overridden by use of the \fBmatch\fP style\&. The ++context used to look up the style is the widget name, so usually the ++context is \fB:insert\-last\-word\fP\&. However, you can bind this function to ++different widgets to use different patterns: ++.PP ++.RS ++.nf ++\fBzle \-N insert\-last\-assignment smart\-insert\-last\-word ++zstyle :insert\-last\-assignment match \&'[[:alpha:]][][[:alnum:]]#=*' ++bindkey \&'\ee=' insert\-last\-assignment\fP ++.fi ++.RE ++.PP ++If no interesting word is found and the \fBauto\-previous\fP style is set to ++a true value, the search continues upward through the history\&. When ++\fBauto\-previous\fP is unset or false (the default), the widget must be ++invoked repeatedly in order to search earlier history lines\&. ++.RE ++.TP ++\fBtranspose\-lines\fP ++Only useful with a multi\-line editing buffer; the lines here are ++lines within the current on\-screen buffer, not history lines\&. ++The effect is similar to the function of the same name in Emacs\&. ++.RS ++.PP ++Transpose the current line with the previous line and move the cursor ++to the start of the next line\&. Repeating this (which can be done by ++providing a positive numeric prefix argument) has the effect of moving ++the line above the cursor down by a number of lines\&. ++.PP ++With a negative numeric prefix argument, requires two lines above the ++cursor\&. These two lines are transposed and the cursor moved to the ++start of the previous line\&. Using a numeric prefix less than \-1 ++has the effect of moving the line above the cursor up by minus that ++number of lines\&. ++.RE ++.TP ++\fBwhich\-command\fP ++This function is a drop\-in replacement for the builtin widget ++\fBwhich\-command\fP\&. It has enhanced behaviour, in that it correctly ++detects whether or not the command word needs to be expanded as an ++alias; if so, it continues tracing the command word from the expanded ++alias until it reaches the command that will be executed\&. ++.RS ++.PP ++The style \fBwhence\fP is available in the context \fB:zle:$WIDGET\fP; this ++may be set to an array to give the command and options that will be used to ++investigate the command word found\&. The default is \fBwhence \-c\fP\&. ++.RE ++.RE ++.PP ++.SS "Utility Functions" ++.PP ++These functions are useful in constructing widgets\&. They ++should be loaded with `\fBautoload \-U\fP \fIfunction\fP\&' and called ++as indicated from user\-defined widgets\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBsplit\-shell\-arguments\fP ++This function splits the line currently being edited into shell arguments ++and whitespace\&. The result is stored in the array \fBreply\fP\&. The array ++contains all the parts of the line in order, starting with any whitespace ++before the first argument, and finishing with any whitespace after the last ++argument\&. Hence (so long as the option \fBKSH_ARRAYS\fP is not set) ++whitespace is given by odd indices in the array and arguments by ++even indices\&. Note that no stripping of quotes is done; joining together ++all the elements of \fBreply\fP in order is guaranteed to produce the ++original line\&. ++.RS ++.PP ++The parameter \fBREPLY\fP is set to the index of the word in \fBreply\fP which ++contains the character after the cursor, where the first element has index ++1\&. The parameter \fBREPLY2\fP is set to the index of the character under the ++cursor in that word, where the first character has index 1\&. ++.PP ++Hence \fBreply\fP, \fBREPLY\fP and \fBREPLY2\fP should all be made local to ++the enclosing function\&. ++.PP ++See the function \fBmodify\-current\-argument\fP, described below, for ++an example of how to call this function\&. ++.RE ++.TP ++\fBmodify\-current\-argument\fP \fIexpr\-using\-\fP\fB$ARG\fP ++This function provides a simple method of allowing user\-defined widgets ++to modify the command line argument under the cursor (or immediately to the ++left of the cursor if the cursor is between arguments)\&. The argument ++should be an expression which when evaluated operates on the shell ++parameter \fBARG\fP, which will have been set to the command line argument ++under the cursor\&. The expression should be suitably quoted to prevent ++it being evaluated too early\&. ++.RS ++.PP ++For example, a user\-defined widget containing the following code ++converts the characters in the argument under the cursor into all upper ++case: ++.PP ++.RS ++.nf ++\fBmodify\-current\-argument \&'${(U)ARG}'\fP ++.fi ++.RE ++.PP ++The following strips any quoting from the current word (whether backslashes ++or one of the styles of quotes), and replaces it with single quoting ++throughout: ++.PP ++.RS ++.nf ++\fBmodify\-current\-argument \&'${(qq)${(Q)ARG}}'\fP ++.fi ++.RE ++.RE ++.RE ++.PP ++.SS "Styles" ++.PP ++The behavior of several of the above widgets can be controlled by the use ++of the \fBzstyle\fP mechanism\&. In particular, widgets that interact with ++the completion system pass along their context to any completions that ++they invoke\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBbreak\-keys\fP ++This style is used by the \fBincremental\-complete\-word\fP widget\&. Its value ++should be a pattern, and all keys matching this pattern will cause the ++widget to stop incremental completion without the key having any further ++effect\&. Like all styles used directly by ++\fBincremental\-complete\-word\fP, this style is looked up using the ++context `\fB:incremental\fP\&'\&. ++.TP ++\fBcompleter\fP ++The \fBincremental\-complete\-word\fP and \fBinsert\-and\-predict\fP widgets set ++up their top\-level context name before calling completion\&. This allows ++one to define different sets of completer functions for normal completion ++and for these widgets\&. For example, to use completion, approximation and ++correction for normal completion, completion and correction for ++incremental completion and only completion for prediction one could use: ++.RS ++.PP ++.RS ++.nf ++\fBzstyle \&':completion:*' completer \e ++ _complete _correct _approximate ++zstyle \&':completion:incremental:*' completer \e ++ _complete _correct ++zstyle \&':completion:predict:*' completer \e ++ _complete\fP ++.fi ++.RE ++.PP ++It is a good idea to restrict the completers used in prediction, because ++they may be automatically invoked as you type\&. The \fB_list\fP and ++\fB_menu\fP completers should never be used with prediction\&. The ++\fB_approximate\fP, \fB_correct\fP, \fB_expand\fP, and \fB_match\fP completers may ++be used, but be aware that they may change characters anywhere in the word ++behind the cursor, so you need to watch carefully that the result is what ++you intended\&. ++.RE ++.TP ++\fBcursor\fP ++The \fBinsert\-and\-predict\fP widget uses this style, in the context ++`\fB:predict\fP\&', to decide where to place the cursor after completion has ++been tried\&. Values are: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBcomplete\fP ++The cursor is left where it was when completion finished, but only if ++it is after a character equal to the one just inserted by the user\&. If ++it is after another character, this value is the same as `\fBkey\fP\&'\&. ++.TP ++\fBkey\fP ++The cursor is left ++after the \fIn\fPth occurrence of the character just inserted, where ++\fIn\fP is the number of times that character appeared in the word ++before completion was attempted\&. In short, this has the effect of ++leaving the cursor after the character just typed even if the ++completion code found out that no other characters need to be inserted ++at that position\&. ++.PP ++Any other value for this style unconditionally leaves the cursor at the ++position where the completion code left it\&. ++.RE ++.TP ++\fBlist\fP ++When using the \fBincremental\-complete\-word\fP widget, this style says ++if the matches should be listed on every key press (if they fit on the ++screen)\&. Use the context prefix `\fB:completion:incremental\fP\&'\&. ++.RS ++.PP ++The \fBinsert\-and\-predict\fP widget uses this style to decide if the ++completion should be shown even if there is only one possible completion\&. ++This is done if the value of this style is the string \fBalways\fP\&. In this ++case the context is `\fB:predict\fP\&' (\fInot\fP `\fB:completion:predict\fP')\&. ++.RE ++.TP ++\fBmatch\fP ++This style is used by \fBsmart\-insert\-last\-word\fP to provide a pattern ++(using full \fBEXTENDED_GLOB\fP syntax) that matches an interesting word\&. ++The context is the name of the widget to which \fBsmart\-insert\-last\-word\fP ++is bound (see above)\&. The default behavior of \fBsmart\-insert\-last\-word\fP ++is equivalent to: ++.RS ++.PP ++.RS ++.nf ++\fBzstyle :insert\-last\-word match \&'*[[:alpha:]/\e\e]*'\fP ++.fi ++.RE ++.PP ++However, you might want to include words that contain spaces: ++.PP ++.RS ++.nf ++\fBzstyle :insert\-last\-word match \&'*[[:alpha:][:space:]/\e\e]*'\fP ++.fi ++.RE ++.PP ++Or include numbers as long as the word is at least two characters long: ++.PP ++.RS ++.nf ++\fBzstyle :insert\-last\-word match \&'*([[:digit:]]?|[[:alpha:]/\e\e])*'\fP ++.fi ++.RE ++.PP ++The above example causes redirections like "2>" to be included\&. ++.RE ++.TP ++\fBprompt\fP ++The \fBincremental\-complete\-word\fP widget shows the value of this ++style in the status line during incremental completion\&. The string ++value may contain any of the following substrings in the manner of ++the \fBPS1\fP and other prompt parameters: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB%c\fP ++Replaced by the name of the completer function that generated the ++matches (without the leading underscore)\&. ++.TP ++\fB%l\fP ++When the \fBlist\fP style is set, ++replaced by `\fB\&.\&.\&.\fP\&' if the list of matches is too long to fit on the ++screen and with an empty string otherwise\&. If the \fBlist\fP style is ++`false\&' or not set, `\fB%l\fP' is always removed\&. ++.TP ++\fB%n\fP ++Replaced by the number of matches generated\&. ++.TP ++\fB%s\fP ++Replaced by `\fB\-no match\-\fP\&', `\fB\-no prefix\-\fP', or an empty string ++if there is no completion matching the word on the line, if the ++matches have no common prefix different from the word on the line, or ++if there is such a common prefix, respectively\&. ++.TP ++\fB%u\fP ++Replaced by the unambiguous part of all matches, if there ++is any, and if it is different from the word on the line\&. ++.PP ++Like `\fBbreak\-keys\fP\&', this uses the `\fB:incremental\fP' context\&. ++.RE ++.TP ++\fBstop\-keys\fP ++This style is used by the \fBincremental\-complete\-word\fP widget\&. Its value ++is treated similarly to the one for the \fBbreak\-keys\fP style (and uses ++the same context: `\fB:incremental\fP\&')\&. However, in ++this case all keys matching the pattern given as its value will stop ++incremental completion and will then execute their usual function\&. ++.TP ++\fBtoggle\fP ++This boolean style is used by \fBpredict\-on\fP and its related widgets in ++the context `\fB:predict\fP\&'\&. If set to one of the standard `true' values, ++predictive typing is automatically toggled off in situations where it is ++unlikely to be useful, such as when editing a multi\-line buffer or after ++moving into the middle of a line and then deleting a character\&. The ++default is to leave prediction turned on until an explicit call to ++\fBpredict\-off\fP\&. ++.TP ++\fBverbose\fP ++This boolean style is used by \fBpredict\-on\fP and its related widgets in ++the context `\fB:predict\fP\&'\&. If set to one of the standard `true' values, ++these widgets display a message below the prompt when the predictive state ++is toggled\&. This is most useful in combination with the \fBtoggle\fP style\&. ++The default does not display these messages\&. ++.TP ++\fBwidget\fP ++This style is similar to the \fBcommand\fP style: For widget functions that ++use \fBzle\fP to call other widgets, this style can sometimes be used to ++override the widget which is called\&. The context for this style is the ++name of the calling widget (\fInot\fP the name of the calling function, ++because one function may be bound to multiple widget names)\&. ++.RS ++.PP ++.RS ++.nf ++\fBzstyle :copy\-earlier\-word widget smart\-insert\-last\-word\fP ++.fi ++.RE ++.PP ++Check the documentation for the calling widget or function to determine ++whether the \fBwidget\fP style is used\&. ++.RE ++.RE ++.PP ++.SH "EXCEPTION HANDLING" ++.PP ++Two functions are provided to enable zsh to provide exception handling in a ++form that should be familiar from other languages\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBthrow\fP \fIexception\fP ++The function \fBthrow\fP throws the named \fIexception\fP\&. The name is ++an arbitrary string and is only used by the \fBthrow\fP and \fBcatch\fP ++functions\&. An exception is for the most part treated the same as a ++shell error, i\&.e\&. an unhandled exception will cause the shell to abort all ++processing in a function or script and to return to the top level in an ++interactive shell\&. ++.TP ++\fBcatch\fP \fIexception\-pattern\fP ++The function \fBcatch\fP returns status zero if an exception was thrown and ++the pattern \fIexception\-pattern\fP matches its name\&. Otherwise it ++returns status 1\&. \fIexception\-pattern\fP is a standard ++shell pattern, respecting the current setting of the \fBEXTENDED_GLOB\fP ++option\&. An alias \fBcatch\fP is also defined to prevent the argument to the ++function from matching filenames, so patterns may be used unquoted\&. Note ++that as exceptions are not fundamentally different from other shell errors ++it is possible to catch shell errors by using an empty string as the ++exception name\&. The shell variable \fBCAUGHT\fP is set by \fBcatch\fP to the ++name of the exception caught\&. It is possible to rethrow an exception by ++calling the \fBthrow\fP function again once an exception has been caught\&. ++.PP ++The functions are designed to be used together with the \fBalways\fP construct ++described in ++\fIzshmisc\fP(1)\&. This is important as only this ++construct provides the required support for exceptions\&. A typical example ++is as follows\&. ++.PP ++.RS ++.nf ++\fB{ ++ # "try" block ++ # \&.\&.\&. nested code here calls "throw MyExcept" ++} always { ++ # "always" block ++ if catch MyExcept; then ++ print "Caught exception MyExcept" ++ elif catch \&''; then ++ print "Caught a shell error\&. Propagating\&.\&.\&." ++ throw \&'' ++ fi ++ # Other exceptions are not handled but may be caught further ++ # up the call stack\&. ++}\fP ++.fi ++.RE ++.PP ++If all exceptions should be caught, the following idiom might be ++preferable\&. ++.PP ++.RS ++.nf ++\fB{ ++ # \&.\&.\&. nested code here throws an exception ++} always { ++ if catch *; then ++ case $CAUGHT in ++ (MyExcept) ++ print "Caught my own exception" ++ ;; ++ (*) ++ print "Caught some other exception" ++ ;; ++ esac ++ fi ++}\fP ++.fi ++.RE ++.PP ++In common with exception handling in other languages, the exception may be ++thrown by code deeply nested inside the `try\&' block\&. However, note that it ++must be thrown inside the current shell, not in a subshell forked for a ++pipeline, parenthesised current\-shell construct, or some form of ++command or process substitution\&. ++.PP ++The system internally uses the shell variable \fBEXCEPTION\fP to record the ++name of the exception between throwing and catching\&. One drawback of this ++scheme is that if the exception is not handled the variable \fBEXCEPTION\fP ++remains set and may be incorrectly recognised as the name of an exception ++if a shell error subsequently occurs\&. Adding \fBunset EXCEPTION\fP at the ++start of the outermost layer of any code that uses exception handling will ++eliminate this problem\&. ++.PP ++.SH "MIME FUNCTIONS" ++.PP ++Three functions are available to provide handling of files recognised by ++extension, for example to dispatch a file \fBtext\&.ps\fP when executed as a ++command to an appropriate viewer\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBzsh\-mime\-setup\fP [ \fB\-fv\fP ] [ \fB\-l\fP [ \fIsuffix \&.\&.\&.\fP ] ] ++.TP ++.PD ++\fBzsh\-mime\-handler [\-l] \fIcommand arguments \&.\&.\&.\fP\fP ++These two functions use the files \fB~/\&.mime\&.types\fP and \fB/etc/mime\&.types\fP, ++which associate types and extensions, as well as \fB~/\&.mailcap\fP and ++\fB/etc/mailcap\fP files, which associate types and the programs that ++handle them\&. These are provided on many systems with the Multimedia ++Internet Mail Extensions\&. ++.RS ++.PP ++To enable the system, the function \fBzsh\-mime\-setup\fP should be ++autoloaded and run\&. This allows files with extensions to be treated ++as executable; such files be completed by the function completion system\&. ++The function \fBzsh\-mime\-handler\fP should not need to be called by the ++user\&. ++.PP ++The system works by setting up suffix aliases with `\fBalias \-s\fP\&'\&. ++Suffix aliases already installed by the user will not be overwritten\&. ++.PP ++For suffixes defined in lower case, upper case variants will also ++automatically be handled (e\&.g\&. \fBPDF\fP is automatically handled if ++handling for the suffix \fBpdf\fP is defined), but not vice versa\&. ++.PP ++Repeated calls to \fBzsh\-mime\-setup\fP do not override the existing ++mapping between suffixes and executable files unless the option \fB\-f\fP ++is given\&. Note, however, that this does not override existing suffix ++aliases assigned to handlers other than \fBzsh\-mime\-handler\fP\&. ++.PP ++Calling \fBzsh\-mime\-setup\fP with the option \fB\-l\fP lists the existing ++mappings without altering them\&. Suffixes to list (which may contain ++pattern characters that should be quoted from immediate interpretation ++on the command line) may be given as additional arguments, otherwise ++all suffixes are listed\&. ++.PP ++Calling \fBzsh\-mime\-setup\fP with the option ++\fB\-v\fP causes verbose output to be shown during the setup operation\&. ++.PP ++The system respects the \fBmailcap\fP flags \fBneedsterminal\fP and ++\fBcopiousoutput\fP, see \fImailcap\fP(4)\&. ++.PP ++The functions use the following styles, which are defined with the ++\fBzstyle\fP builtin command (see \fIzshmodules\fP(1))\&. They should be defined ++before \fBzsh\-mime\-setup\fP is run\&. The contexts used all ++start with \fB:mime:\fP, with additional components in some cases\&. ++It is recommended that a trailing \fB*\fP (suitably quoted) be appended ++to style patterns in case the system is extended in future\&. Some ++examples are given below\&. ++.PD 0 ++.TP ++.PD ++\fBcurrent\-shell\fP ++If this boolean style is true, the mailcap handler for the context in ++question is run using the \fBeval\fP builtin instead of by starting a new ++\fBsh\fP process\&. This is more efficient, but may not work in the occasional ++cases where the mailcap handler uses strict POSIX syntax\&. ++.TP ++\fBexecute\-as\-is\fP ++This style gives a list of patterns to be matched against files ++passed for execution with a handler program\&. If the file matches ++the pattern, the entire command line is executed in its current form, ++with no handler\&. This is useful for files which might have suffixes ++but nonetheless be executable in their own right\&. If the style ++is not set, the pattern \fB*(*) *(/)\fP is used; ++hence executable files are executed directly and not passed to a ++handler, and the option \fBAUTO_CD\fP may be used to change to directories ++that happen to have MIME suffixes\&. ++.TP ++\fBfile\-path\fP ++Used if the style \fBfind\-file\-in\-path\fP is true for the same context\&. ++Set to an array of directories that are used for searching for the ++file to be handled; the default is the command path given by the ++special parameter \fBpath\fP\&. The shell option \fBPATH_DIRS\fP is respected; ++if that is set, the appropriate path will be searched even if the ++name of the file to be handled as it appears on the command line contains ++a `\fB/\fP\&'\&. ++The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style ++\fBhandler\fP\&. ++.TP ++\fBfind\-file\-in\-path\fP ++If set, allows files whose names do not contain absolute paths ++to be searched for in the command path or the path specified by the ++\fBfile\-path\fP style\&. If the file is not found in the path, it is looked ++for locally (whether or not the current directory is in the path); if it is ++not found locally, the handler will abort unless the \fBhandle\-nonexistent\fP ++style is set\&. Files found in the path are tested as described for ++the style \fBexecute\-as\-is\fP\&. ++The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style ++\fBhandler\fP\&. ++.TP ++\fBflags\fP ++Defines flags to go with a handler; the context is as for the ++\fBhandler\fP style, and the format is as for the flags in \fBmailcap\fP\&. ++.TP ++\fBhandle\-nonexistent\fP ++By default, arguments that don\&'t correspond to files are not passed ++to the MIME handler in order to prevent it from intercepting commands found ++in the path that happen to have suffixes\&. This style may be set to ++an array of extended glob patterns for arguments that will be passed to the ++handler even if they don\&'t exist\&. If it is not explicitly set it ++defaults to \fB[[:alpha:]]#:/*\fP which allows URLs to be passed to the MIME ++handler even though they don\&'t exist in that format in the file system\&. ++The full context is \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, as described for the style ++\fBhandler\fP\&. ++.TP ++\fBhandler\fP ++Specifies a handler for a suffix; the suffix is given by the context as ++\fB:mime:\&.\fP\fIsuffix\fP\fB:\fP, and the format of the handler is exactly ++that in \fBmailcap\fP\&. Note in particular the `\fB\&.\fP\&' and trailing colon ++to distinguish this use of the context\&. This overrides any handler ++specified by the \fBmailcap\fP files\&. If the handler requires a terminal, ++the \fBflags\fP style should be set to include the word \fBneedsterminal\fP, ++or if the output is to be displayed through a pager (but not if the ++handler is itself a pager), it should include \fBcopiousoutput\fP\&. ++.TP ++\fBmailcap\fP ++A list of files in the format of \fB~/\&.mailcap\fP and ++\fB/etc/mailcap\fP to be read during setup, replacing the default list ++which consists of those two files\&. The context is \fB:mime:\fP\&. ++A \fB+\fP in the list will be replaced by the default files\&. ++.TP ++\fBmailcap\-priorities\fP ++This style is used to resolve multiple mailcap entries for the same MIME ++type\&. It consists of an array of the following elements, in descending ++order of priority; later entries will be used if earlier entries are ++unable to resolve the entries being compared\&. If none of the tests ++resolve the entries, the first entry encountered is retained\&. ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBfiles\fP ++The order of files (entries in the \fBmailcap\fP style) read\&. Earlier ++files are preferred\&. (Note this does not resolve entries in the same file\&.) ++.TP ++\fBpriority\fP ++The priority flag from the mailcap entry\&. The priority is an integer ++from 0 to 9 with the default value being 5\&. ++.TP ++\fBflags\fP ++The test given by the \fBmailcap\-prio\-flags\fP option is used to resolve ++entries\&. ++.TP ++\fBplace\fP ++Later entries are preferred; as the entries are strictly ordered, this ++test always succeeds\&. ++.PP ++Note that as this style is handled during initialisation, the context ++is always \fB:mime:\fP, with no discrimination by suffix\&. ++.RE ++.TP ++\fBmailcap\-prio\-flags\fP ++This style is used when the keyword \fBflags\fP is encountered in the ++list of tests specified by the \fBmailcap\-priorities\fP style\&. ++It should be set to a list of patterns, each of which is tested against ++the flags specified in the mailcap entry (in other words, the sets of ++assignments found with some entries in the mailcap file)\&. Earlier ++patterns in the list are preferred to later ones, and matched patterns ++are preferred to unmatched ones\&. ++.TP ++\fBmime\-types\fP ++A list of files in the format of \fB~/\&.mime\&.types\fP and ++\fB/etc/mime\&.types\fP to be read during setup, replacing the default list ++which consists of those two files\&. The context is \fB:mime:\fP\&. ++A \fB+\fP in the list will be replaced by the default files\&. ++.TP ++\fBnever\-background\fP ++If this boolean style is set, the handler for the given context is ++always run in the foreground, even if the flags provided in the mailcap ++entry suggest it need not be (for example, it doesn\&'t require a ++terminal)\&. ++.TP ++\fBpager\fP ++If set, will be used instead of \fB$PAGER\fP or \fBmore\fP to handle ++suffixes where the \fBcopiousoutput\fP flag is set\&. The context is ++as for \fBhandler\fP, i\&.e\&. \fB:mime:\&.\fP\fIsuffix\fP\fB:\fP for handling ++a file with the given \fIsuffix\fP\&. ++.PP ++Examples: ++.PP ++.RS ++.nf ++\fBzstyle \&':mime:*' mailcap ~/\&.mailcap /usr/local/etc/mailcap ++zstyle \&':mime:\&.txt:' handler less %s ++zstyle \&':mime:\&.txt:' flags needsterminal\fP ++.fi ++.RE ++.PP ++When \fBzsh\-mime\-setup\fP is subsequently run, it will look for ++\fBmailcap\fP entries in the two files given\&. Files of suffix \fB\&.txt\fP ++will be handled by running `\fBless\fP \fIfile\&.txt\fP\&'\&. The flag ++\fBneedsterminal\fP is set to show that this program must run attached to a ++terminal\&. ++.PP ++As there are several steps to dispatching a command, the following ++should be checked if attempting to execute a file by extension ++\fB\&.\fP\fIext\fP does not have the expected effect\&. ++.PP ++The command `\fBalias \-s\fP \fIext\fP\&' should show ++`\fBps=zsh\-mime\-handler\fP\&'\&. If it shows something else, another suffix ++alias was already installed and was not overwritten\&. If it shows ++nothing, no handler was installed: this is most likely because no ++handler was found in the \fB\&.mime\&.types\fP and \fBmailcap\fP combination for ++\fB\&.ext\fP files\&. In that case, appropriate handling should be added to ++\fB~/\&.mime\&.types\fP and \fBmailcap\fP\&. ++.PP ++If the extension is handled by \fBzsh\-mime\-handler\fP but the file is ++not opened correctly, either the handler defined for the type is ++incorrect, or the flags associated with it are in appropriate\&. Running ++\fBzsh\-mime\-setup \-l\fP will show the handler and, if there are any, the ++flags\&. A \fB%s\fP in the handler is replaced by the file (suitably quoted ++if necessary)\&. Check that the handler program listed lists and can ++be run in the way shown\&. Also check that the flags \fBneedsterminal\fP or ++\fBcopiousoutput\fP are set if the handler needs to be run under a ++terminal; the second flag is used if the output should be sent to a pager\&. ++An example of a suitable \fBmailcap\fP entry for such a program is: ++.PP ++.RS ++.nf ++\fBtext/html; /usr/bin/lynx \&'%s'; needsterminal\fP ++.fi ++.RE ++.PP ++Running `\fBzsh\-mime\-handler \-l\fP \fIcommand line\fP\&' prints the command ++line that would be executed, simplified to remove the effect of any ++flags, and quoted so that the output can be run as a complete zsh ++command line\&. This is used by the completion system to decide how to ++complete after a file handled by \fBzsh\-mime\-setup\fP\&. ++.RE ++.TP ++\fBpick\-web\-browser\fP ++This function is separate from the two MIME functions described above ++and can be assigned directly to a suffix: ++.RS ++.PP ++.RS ++.nf ++\fBautoload \-U pick\-web\-browser ++alias \-s html=pick\-web\-browser\fP ++.fi ++.RE ++.PP ++It is provided as an intelligent front end to dispatch a web browser\&. ++It may be run as either a function or a shell script\&. The status ++255 is returned if no browser could be started\&. ++.PP ++Various styles are available to customize the choice of browsers: ++.PP ++.PD 0 ++.TP ++.PD ++\fBbrowser\-style\fP ++The value of the style is an array giving preferences in decreasing order ++for the type of browser to use\&. The values of elements may be ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBrunning\fP ++Use a GUI browser that is already running when an X Window display is ++available\&. The browsers listed in the \fBx\-browsers\fP style are tried ++in order until one is found; if it is, the file will be displayed in ++that browser, so the user may need to check whether it has appeared\&. ++If no running browser is found, one is not started\&. Browsers other than ++Firefox, Opera and Konqueror are assumed to understand the Mozilla ++syntax for opening a URL remotely\&. ++.TP ++\fBx\fP ++Start a new GUI browser when an X Window display is available\&. Search for ++the availability of one of the browsers listed in the \fBx\-browsers\fP style ++and start the first one that is found\&. No check is made for an already ++running browser\&. ++.TP ++\fBtty\fP ++Start a terminal\-based browser\&. Search for the availability of one ++of the browsers listed in the \fBtty\-browsers\fP style and start the ++first one that is found\&. ++.PP ++If the style is not set the default \fBrunning x tty\fP is used\&. ++.RE ++.TP ++\fBx\-browsers\fP ++An array in decreasing order ++of preference of browsers to use when running under the X Window System\&. ++The array consists of the command name under which to start the ++browser\&. They are looked up in the context \fB:mime:\fP (which may ++be extended in future, so appending `\fB*\fP\&' is recommended)\&. For ++example, ++.RS ++.PP ++.RS ++.nf ++\fBzstyle \&':mime:*' x\-browsers opera konqueror firefox\fP ++.fi ++.RE ++.PP ++specifies that \fBpick\-web\-browser\fP should first look for a running ++instance of Opera, Konqueror or Firefox, in that order, and if it ++fails to find any should attempt to start Opera\&. The default is ++\fBfirefox mozilla netscape opera konqueror\fP\&. ++.RE ++.TP ++\fBtty\-browsers\fP ++An array similar to \fBx\-browsers\fP, except that it gives browsers to ++use when no X Window display is available\&. The default is ++\fBelinks links lynx\fP\&. ++.TP ++\fBcommand\fP ++If it is set this style is used to pick the command ++used to open a page for a browser\&. The context is ++\fB:mime:browser:new:$browser:\fP to start a new browser or ++\fB:mime:browser:running:$browser:\fP to open a URL in a browser already ++running on the current X display, where \fB$browser\fP is the value matched ++in the \fBx\-browsers\fP or \fBtty\-browsers\fP style\&. The escape sequence ++\fB%b\fP in the style\&'s value will be replaced by the browser, while \fB%u\fP ++will be replaced by the URL\&. If the style is not set, the default for all ++new instances is equivalent to \fB%b %u\fP and the defaults for using running ++browsers are equivalent to the values \fBkfmclient openURL %u\fP for ++Konqueror, \fBfirefox \-new\-tab %u\fP for Firefox, \fBopera \-newpage %u\fP ++for Opera, and \fB%b \-remote "openUrl(%u)"\fP for all others\&. ++.RE ++.RE ++.PP ++.SH "MATHEMATICAL FUNCTIONS" ++.PP ++.PD 0 ++.TP ++.PD ++\fBzcalc\fP [ \fIexpression\fP \&.\&.\&. ] ++A reasonably powerful calculator based on zsh\&'s arithmetic evaluation ++facility\&. The syntax is similar to that of formulae in most programming ++languages; see ++the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) for details\&. The mathematical ++library \fBzsh/mathfunc\fP will be loaded if it is available; see ++the section `The zsh/mathfunc Module\&' in \fIzshmodules\fP(1)\&. The mathematical functions ++correspond to the raw system libraries, so trigonometric functions are ++evaluated using radians, and so on\&. ++.RS ++.PP ++Each line typed is evaluated as an expression\&. The prompt shows a number, ++which corresponds to a positional parameter where the result of that ++calculation is stored\&. For example, the result of the calculation on the ++line preceded by `\fB4> \fP\&' is available as \fB$4\fP\&. The last value ++calculated is available as \fBans\fP\&. Full command line editing, including ++the history of previous calculations, is available; the history is saved in ++the file \fB~/\&.zcalc_history\fP\&. To exit, enter a blank line or type `\fB:q\fP\&' ++on its own (`\fBq\fP\&' is allowed for historical compatibility)\&. ++.PP ++If arguments are given to \fBzcalc\fP on start up, they are used to prime the ++first few positional parameters\&. A visual indication of this is given when ++the calculator starts\&. ++.PP ++The constants \fBPI\fP (3\&.14159\&.\&.\&.) and \fBE\fP (2\&.71828\&.\&.\&.) are provided\&. ++Parameter assignment is possible, but note that all parameters will be put ++into the global namespace\&. ++.PP ++The output base can be initialised by passing the option `\fB\-#\fP\fIbase\fP\&', ++for example `\fBzcalc \-#16\fP\&' (the `\fB#\fP' may have to be quoted, depending ++on the globbing options set)\&. ++.PP ++The prompt is configurable via the parameter \fBZCALCPROMPT\fP, which ++undergoes standard prompt expansion\&. The index of the current entry is ++stored locally in the first element of the array \fBpsvar\fP, which can be ++referred to in \fBZCALCPROMPT\fP as `\fB%1v\fP\&'\&. The default prompt is ++`\fB%1v> \fP\&'\&. ++.PP ++A few special commands are available; these are introduced by a colon\&. ++For backward compatibility, the colon may be omitted for certain ++commands\&. Completion is available if \fBcompinit\fP has been run\&. ++.PP ++The output precision may be specified within zcalc by special commands ++familiar from many calculators\&. ++.PD 0 ++.TP ++.PD ++\fB:norm\fP ++The default output format\&. It corresponds to the printf \fB%g\fP ++specification\&. Typically this shows six decimal digits\&. ++.TP ++\fB:sci\fP \fIdigits\fP ++Scientific notation, corresponding to the printf \fB%g\fP output format with ++the precision given by \fIdigits\fP\&. This produces either fixed point or ++exponential notation depending on the value output\&. ++.TP ++\fB:fix\fP \fIdigits\fP ++Fixed point notation, corresponding to the printf \fB%f\fP output format with ++the precision given by \fIdigits\fP\&. ++.TP ++\fB:eng\fP \fIdigits\fP ++Exponential notation, corresponding to the printf \fB%E\fP output format with ++the precision given by \fIdigits\fP\&. ++.TP ++\fB:raw\fP ++Raw output: this is the default form of the output from a math ++evaluation\&. This may show more precision than the number actually ++possesses\&. ++.PP ++Other special commands: ++.PD 0 ++.TP ++.PD ++\fB:!\fP\fIline\&.\&.\&.\fP ++Execute \fIline\&.\&.\&.\fP as a normal shell command line\&. Note that it ++is executed in the context of the function, i\&.e\&. with local variables\&. ++Space is optional after \fB:!\fP\&. ++.TP ++\fB:local\fP \fIarg\fP \&.\&.\&. ++Declare variables local to the function\&. Note that certain variables ++are used by the function for its own purposes\&. Other variables ++may be used, too, but they will be taken from or put into the global ++scope\&. ++.TP ++\fB:function\fP \fIname\fP [ \fIbody\fP ] ++Define a mathematical function or (with no \fIbody\fP) delete it\&. ++The function is defined using \fBzmathfuncdef\fP, see below\&. ++.RS ++.PP ++Note that \fBzcalc\fP takes care of all quoting\&. Hence for example: ++.PP ++.RS ++.nf ++\fBfunction cube $1 * $1 * $1\fP ++.fi ++.RE ++.PP ++defines a function to cube the sole argument\&. ++.RE ++.TP ++\fB[#\fP\fIbase\fP\fB]\fP ++This is not a special command, rather part of normal arithmetic ++syntax; however, when this form appears on a line by itself the default ++output radix is set to \fIbase\fP\&. Use, for example, `\fB[#16]\fP\&' to display ++hexadecimal output preceded by an indication of the base, or `\fB[##16]\fP\&' ++just to display the raw number in the given base\&. Bases themselves are ++always specified in decimal\&. `\fB[#]\fP\&' restores the normal output format\&. ++Note that setting an output base suppresses floating point output; use ++`\fB[#]\fP\&' to return to normal operation\&. ++.PP ++See the comments in the function for a few extra tips\&. ++.RE ++.TP ++\fBzmathfuncdef\fP [ \fImathfunc\fP [ \fIbody\fP ] ] ++A convenient front end to \fBfunctions \-M\fP\&. ++.RS ++.PP ++With two arguments, define a mathematical function named \fImathfunc\fP ++which can be used in any form of arithmetic evaluation\&. \fIbody\fP ++is a mathematical expression to implement the function\&. It may ++contain references to position parameters \fB$1\fP, \fB$2\fP, \&.\&.\&. ++to refer to mandatory parameters and \fB${1:\-\fP\fIdefvalue\fP\fB}\fP \&.\&.\&. ++to refer to optional parameters\&. Note that the forms must be ++strictly adhered to for the function to calculate the correct number ++of arguments\&. The implementation is held in a shell function named ++\fBzsh_math_func_\fP\fImathfunc\fP; usually the user will not need ++to refer to the shell function directly\&. Any existing function ++of the same name is silently replaced\&. ++.PP ++With one argument, remove the mathematical function \fImathfunc\fP ++as well as the shell function implementation\&. ++.PP ++With no arguments, list all \fImathfunc\fP functions in a form ++suitable for restoring the definition\&. ++The functions have not necessarily been defined by \fBzmathfuncdef\fP\&. ++.RE ++.RE ++.PP ++.SH "USER CONFIGURATION FUNCTIONS" ++.PP ++The \fBzsh/newuser\fP module comes with a function to aid in configuring ++shell options for new users\&. If the module is installed, this function can ++also be run by hand\&. It is available even if the module\&'s default ++behaviour, namely running the function for a new user logging in without ++startup files, is inhibited\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBzsh\-newuser\-install\fP [ \fB\-f\fP ] ++The function presents the user with various options for customizing ++their initialization scripts\&. Currently only \fB~/\&.zshrc\fP is handled\&. ++\fB$ZDOTDIR/\&.zshrc\fP is used instead if the parameter \fBZDOTDIR\fP is ++set; this provides a way for the user to configure a file without ++altering an existing \fB\&.zshrc\fP\&. ++.RS ++.PP ++By default the function exits immediately if it finds any of the files ++\fB\&.zshenv\fP, \fB\&.zprofile\fP, \fB\&.zshrc\fP, or \fB\&.zlogin\fP in the appropriate ++directory\&. The option \fB\-f\fP is required in order to force the function ++to continue\&. Note this may happen even if \fB\&.zshrc\fP itself does not ++exist\&. ++.PP ++As currently configured, the function will exit immediately if the ++user has root privileges; this behaviour cannot be overridden\&. ++.PP ++Once activated, the function\&'s behaviour is supposed to be ++self\-explanatory\&. Menus are present allowing the user to alter ++the value of options and parameters\&. Suggestions for improvements are ++always welcome\&. ++.PP ++When the script exits, the user is given the opportunity to save the new ++file or not; changes are not irreversible until this point\&. However, ++the script is careful to restrict changes to the file only to a group ++marked by the lines `\fB# Lines configured by zsh\-newuser\-install\fP\&' and ++`\fB# End of lines configured by zsh\-newuser\-install\fP\&'\&. In addition, ++the old version of \fB\&.zshrc\fP is saved to a file with the suffix ++\fB\&.zni\fP appended\&. ++.PP ++If the function edits an existing \fB\&.zshrc\fP, it is up to the user ++to ensure that the changes made will take effect\&. For example, if ++control usually returns early from the existing \fB\&.zshrc\fP the lines ++will not be executed; or a later initialization file may override ++options or parameters, and so on\&. The function itself does not attempt to ++detect any such conflicts\&. ++.RE ++.RE ++.PP ++.SH "OTHER FUNCTIONS" ++.PP ++There are a large number of helpful functions in the \fBFunctions/Misc\fP ++directory of the zsh distribution\&. Most are very simple and do not ++require documentation here, but a few are worthy of special mention\&. ++.PP ++.SS "Descriptions" ++.PP ++.PD 0 ++.TP ++.PD ++\fBcolors\fP ++This function initializes several associative arrays to map color names to ++(and from) the ANSI standard eight\-color terminal codes\&. These are used ++by the prompt theme system (see above)\&. You seldom should need to run ++\fBcolors\fP more than once\&. ++.RS ++.PP ++The eight base colors are: black, red, green, yellow, blue, magenta, cyan, ++and white\&. Each of these has codes for foreground and background\&. In ++addition there are eight intensity attributes: bold, faint, standout, ++underline, blink, reverse, and conceal\&. Finally, there are six codes used ++to negate attributes: none (reset all attributes to the defaults), normal ++(neither bold nor faint), no\-standout, no\-underline, no\-blink, and ++no\-reverse\&. ++.PP ++Some terminals do not support all combinations of colors and intensities\&. ++.PP ++The associative arrays are: ++.PP ++.PD 0 ++.TP ++.PD 0 ++color ++.TP ++.PD ++colour ++Map all the color names to their integer codes, and integer codes to the ++color names\&. The eight base names map to the foreground color codes, as ++do names prefixed with `\fBfg\-\fP\&', such as `\fBfg\-red\fP'\&. Names prefixed ++with `\fBbg\-\fP\&', such as `\fBbg\-blue\fP', refer to the background codes\&. The ++reverse mapping from code to color yields base name for foreground codes ++and the \fBbg\-\fP form for backgrounds\&. ++.RS ++.PP ++Although it is a misnomer to call them `colors\&', these arrays also map the ++other fourteen attributes from names to codes and codes to names\&. ++.RE ++.TP ++.PD 0 ++fg ++.TP ++.PD 0 ++fg_bold ++.TP ++.PD ++fg_no_bold ++Map the eight basic color names to ANSI terminal escape sequences that set ++the corresponding foreground text properties\&. The \fBfg\fP sequences change ++the color without changing the eight intensity attributes\&. ++.TP ++.PD 0 ++bg ++.TP ++.PD 0 ++bg_bold ++.TP ++.PD ++bg_no_bold ++Map the eight basic color names to ANSI terminal escape sequences that set ++the corresponding background properties\&. The \fBbg\fP sequences change the ++color without changing the eight intensity attributes\&. ++.PP ++In addition, the scalar parameters \fBreset_color\fP and \fBbold_color\fP are ++set to the ANSI terminal escapes that turn off all attributes and turn on ++bold intensity, respectively\&. ++.RE ++.TP ++\fBfned\fP \fIname\fP ++Same as \fBzed \-f\fP\&. This function does not appear in the zsh ++distribution, but can be created by linking \fBzed\fP to the name \fBfned\fP ++in some directory in your \fBfpath\fP\&. ++.TP ++\fBis\-at\-least\fP \fIneeded\fP [ \fIpresent\fP ] ++Perform a greater\-than\-or\-equal\-to comparison of two strings having the ++format of a zsh version number; that is, a string of numbers and text with ++segments separated by dots or dashes\&. If the \fIpresent\fP string is not ++provided, \fB$ZSH_VERSION\fP is used\&. Segments are paired left\-to\-right in ++the two strings with leading non\-number parts ignored\&. If one string has ++fewer segments than the other, the missing segments are considered zero\&. ++.RS ++.PP ++This is useful in startup files to set options and other state that are ++not available in all versions of zsh\&. ++.PP ++.RS ++.nf ++\fBis\-at\-least 3\&.1\&.6\-15 && setopt NO_GLOBAL_RCS ++is\-at\-least 3\&.1\&.0 && setopt HIST_REDUCE_BLANKS ++is\-at\-least 2\&.6\-17 || print "You can\&'t use is\-at\-least here\&."\fP ++.fi ++.RE ++.RE ++.TP ++\fBnslookup\fP [ \fIarg\fP \&.\&.\&. ] ++This wrapper function for the \fBnslookup\fP command requires the ++\fBzsh/zpty\fP module (see ++\fIzshmodules\fP(1))\&. It behaves exactly like the standard \fBnslookup\fP ++except that it provides customizable prompts (including a right\-side ++prompt) and completion of nslookup commands, host names, etc\&. (if you use ++the function\-based completion system)\&. Completion styles may be set with ++the context prefix `\fB:completion:nslookup\fP\&'\&. ++.RS ++.PP ++See also the \fBpager\fP, \fBprompt\fP and \fBrprompt\fP styles below\&. ++.RE ++.TP ++\fBregexp\-replace\fP \fIvar\fP \fIregexp\fP \fIreplace\fP ++Use regular expressions to perform a global search and replace operation ++on a variable\&. If the option \fBRE_MATCH_PCRE\fP is not set, POSIX ++extended regular expressions are used, else Perl\-compatible regular ++expressions (this requires the shell to be linked against the \fBpcre\fP ++library)\&. ++.RS ++.PP ++\fIvar\fP is the name of the variable containing the string to be matched\&. ++The variable will be modified directly by the function\&. The ++variables \fBMATCH\fP, \fBMBEGIN\fP, \fBMEND\fP, \fBmatch\fP, \fBmbegin\fP, \fBmend\fP ++should be avoided as these are used by the regular expression code\&. ++.PP ++\fIregexp\fP is the regular expression to match against the string\&. ++.PP ++\fIreplace\fP is the replacement text\&. This can contain parameter, command ++and arithmetic expressions which will be replaced: in particular, a ++reference to \fB$MATCH\fP will be replaced by the text matched by the pattern\&. ++.PP ++The return status is 0 if at least one match was performed, else 1\&. ++.RE ++.TP ++\fBrun\-help\fP \fIcmd\fP ++This function is designed to be invoked by the \fBrun\-help\fP ZLE widget, ++in place of the default alias\&. See `Accessing On\-Line Help\&' ++above for setup instructions\&. ++.RS ++.PP ++In the discussion which follows, if \fIcmd\fP is a file system path, it is ++first reduced to its rightmost component (the file name)\&. ++.PP ++Help is first sought by looking for a file named \fIcmd\fP in the directory ++named by the \fBHELPDIR\fP parameter\&. If no file is found, an assistant ++function, alias, or command named \fBrun\-help\-\fIcmd\fP\fP is sought\&. If ++found, the assistant is executed with the rest of the current command line ++(everything after the command name \fIcmd\fP) as its arguments\&. When ++neither file nor assistant is found, the external command ++`\fBman\fP \fIcmd\fP\&' is run\&. ++.PP ++An example assistant for the "ssh" command: ++.PP ++.RS ++.nf ++\fBrun\-help\-ssh() { ++ emulate \-LR zsh ++ local \-a args ++ # Delete the "\-l username" option ++ zparseopts \-D \-E \-a args l: ++ # Delete other options, leaving: host command ++ args=(${@:#\-*}) ++ if [[ ${#args} \-lt 2 ]]; then ++ man ssh ++ else ++ run\-help $args[2] ++ fi ++}\fP ++.fi ++.RE ++.PP ++Several of these assistants are provided in the \fBFunctions/Misc\fP ++directory\&. These must be autoloaded, or placed as executable scripts in ++your search path, in order to be found and used by \fBrun\-help\fP\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBrun\-help\-git\fP ++.TP ++.PD 0 ++\fBrun\-help\-svk\fP ++.TP ++.PD ++\fBrun\-help\-svn\fP ++Assistant functions for the \fBgit\fP, \fBsvk\fP, and \fBsvn\fP commands\&. ++.RE ++.TP ++\fBtetris\fP ++Zsh was once accused of not being as complete as Emacs, ++because it lacked a Tetris game\&. This function was written to ++refute this vicious slander\&. ++.RS ++.PP ++This function must be used as a ZLE widget: ++.PP ++.RS ++.nf ++\fBautoload \-U tetris ++zle \-N tetris ++bindkey \fIkeys\fP tetris\fP ++.fi ++.RE ++.PP ++To start a game, execute the widget by typing the \fIkeys\fP\&. Whatever command ++line you were editing disappears temporarily, and your keymap is also ++temporarily replaced by the Tetris control keys\&. The previous editor state ++is restored when you quit the game (by pressing `\fBq\fP\&') or when you lose\&. ++.PP ++If you quit in the middle of a game, the next invocation of the \fBtetris\fP ++widget will continue where you left off\&. If you lost, it will start a new ++game\&. ++.RE ++.TP ++\fBzargs\fP [ \fIoption\fP \&.\&.\&. \fB\-\fP\fB\-\fP ] [ \fIinput\fP \&.\&.\&. ] [ \fB\-\fP\fB\-\fP \fIcommand\fP [ \fIarg\fP \&.\&.\&. ] ] ++This function works like GNU xargs, except that instead of reading lines ++of arguments from the standard input, it takes them from the command line\&. ++This is useful because zsh, especially with recursive glob operators, ++often can construct a command line for a shell function that is longer ++than can be accepted by an external command\&. ++.RS ++.PP ++The \fIoption\fP list represents options of the \fBzargs\fP command itself, ++which are the same as those of \fBxargs\fP\&. The \fIinput\fP list is the ++collection of strings (often file names) that become the arguments of the ++\fBcommand\fP, analogous to the standard input of \fBxargs\fP\&. Finally, the ++\fIarg\fP list consists of those arguments (usually options) that are ++passed to the \fIcommand\fP each time it runs\&. The \fIarg\fP list precedes ++the elements from the \fBinput\fP list in each run\&. If no \fIcommand\fP is ++provided, then no \fIarg\fP list may be provided, and in that event the ++default command is `\fBprint\fP\&' with arguments `\fB\-r \-\fP\fB\-\fP'\&. ++.PP ++For example, to get a long \fBls\fP listing of all plain files in the ++current directory or its subdirectories: ++.PP ++.RS ++.nf ++\fBautoload \-U zargs ++zargs \-\- **/*(\&.) \-\- ls \-l\fP ++.fi ++.RE ++.PP ++Note that `\fB\-\fP\fB\-\fP\&' is used both to mark the end of the \fIoption\fP ++list and to mark the end of the \fIinput\fP list, so it must appear twice ++whenever the \fIinput\fP list may be empty\&. If there is guaranteed to be ++at least one \fIinput\fP and the first \fIinput\fP does not begin with a ++`\fB\-\fP\&', then the first `\fB\-\fP\fB\-\fP' may be omitted\&. ++.PP ++In the event that the string `\fB\-\fP\fB\-\fP\&' is or may be an \fIinput\fP, the ++\fB\-e\fP option may be used to change the end\-of\-inputs marker\&. Note that ++this does \fInot\fP change the end\-of\-options marker\&. For example, to use ++`\fB\&.\&.\fP\&' as the marker: ++.PP ++.RS ++.nf ++\fBzargs \-e\&.\&. \-\- **/*(\&.) \&.\&. ls \-l\fP ++.fi ++.RE ++.PP ++This is a good choice in that example because no plain file can be named ++`\fB\&.\&.\fP\&', but the best end\-marker depends on the circumstances\&. ++.PP ++For details of the other \fBzargs\fP options, see \fIxargs\fP(1) or run ++\fBzargs\fP with the \fB\-\fP\fB\-help\fP option\&. ++.RE ++.TP ++.PD 0 ++\fBzed\fP [ \fB\-f\fP ] \fIname\fP ++.TP ++.PD ++\fBzed \-b\fP ++This function uses the ZLE editor to edit a file or function\&. ++.RS ++.PP ++Only one \fIname\fP argument is allowed\&. ++If the \fB\-f\fP option is given, the name is taken to be that of ++a function; if the function is marked for autoloading, \fBzed\fP searches ++for it in the \fBfpath\fP and loads it\&. Note that functions edited this way ++are installed into the current shell, but \fInot\fP written back to the ++autoload file\&. ++.PP ++Without \fB\-f\fP, \fIname\fP is the path name of the file to edit, which need ++not exist; it is created on write, if necessary\&. ++.PP ++While editing, the function sets the main keymap to \fBzed\fP and the ++vi command keymap to \fBzed\-vicmd\fP\&. These will be copied from the existing ++\fBmain\fP and \fBvicmd\fP keymaps if they do not exist the first time \fBzed\fP ++is run\&. They can be used to provide special key bindings used only in zed\&. ++.PP ++If it creates the keymap, \fBzed\fP rebinds the return key to insert a line ++break and `\fB^X^W\fP\&' to accept the edit in the \fBzed\fP keymap, and binds ++`\fBZZ\fP\&' to accept the edit in the \fBzed\-vicmd\fP keymap\&. ++.PP ++The bindings alone can be installed by running `\fBzed \-b\fP\&'\&. This is ++suitable for putting into a startup file\&. Note that, if rerun, ++this will overwrite the existing \fBzed\fP and \fBzed\-vicmd\fP keymaps\&. ++.PP ++Completion is available, and styles may be set with the context prefix ++`\fB:completion:zed\fP\&'\&. ++.PP ++A zle widget \fBzed\-set\-file\-name\fP is available\&. This can be called by ++name from within zed using `\fB\eex zed\-set\-file\-name\fP\&' (note, however, that ++because of zed\&'s rebindings you will have to type \fB^j\fP at the end instead ++of the return key), or can be bound to a key in either of the \fBzed\fP or ++\fBzed\-vicmd\fP keymaps after `\fBzed \-b\fP\&' has been run\&. When the widget is ++called, it prompts for a new name for the file being edited\&. When zed ++exits the file will be written under that name and the original file will ++be left alone\&. The widget has no effect with `\fBzed \-f\fP\&'\&. ++.PP ++While \fBzed\-set\-file\-name\fP is running, zed uses the keymap ++\fBzed\-normal\-keymap\fP, which is linked from the main keymap in effect ++at the time zed initialised its bindings\&. (This is to make the return key ++operate normally\&.) The result is that if the main keymap has been changed, ++the widget won\&'t notice\&. This is not a concern for most users\&. ++.RE ++.TP ++.PD 0 ++\fBzcp\fP [ \fB\-finqQvwW\fP ] \fIsrcpat\fP \fIdest\fP ++.TP ++.PD ++\fBzln\fP [ \fB\-finqQsvwW\fP ] \fIsrcpat\fP \fIdest\fP ++Same as \fBzmv \-C\fP and \fBzmv \-L\fP, respectively\&. These functions do not ++appear in the zsh distribution, but can be created by linking \fBzmv\fP to ++the names \fBzcp\fP and \fBzln\fP in some directory in your \fBfpath\fP\&. ++.TP ++\fBzkbd\fP ++See `Keyboard Definition\&' ++above\&. ++.TP ++\fBzmv\fP [ \fB\-finqQsvwW\fP ] [ \-C | \-L | \-M | \-p \fIprogram\fP ] [ \-o \fIoptstring\fP ] \fIsrcpat\fP \fIdest\fP ++Move (usually, rename) files matching the pattern \fIsrcpat\fP to ++corresponding files having names of the form given by \fIdest\fP, where ++\fIsrcpat\fP contains parentheses surrounding patterns which will be ++replaced in turn by $1, $2, \&.\&.\&. in \fIdest\fP\&. For example, ++.RS ++.PP ++.RS ++.nf ++\fBzmv \&'(*)\&.lis' '$1\&.txt'\fP ++.fi ++.RE ++.PP ++renames `\fBfoo\&.lis\fP\&' to `\fBfoo\&.txt\fP', `\fBmy\&.old\&.stuff\&.lis\fP' to ++`\fBmy\&.old\&.stuff\&.txt\fP\&', and so on\&. ++.PP ++The pattern is always treated as an \fBEXTENDED_GLOB\fP pattern\&. Any file ++whose name is not changed by the substitution is simply ignored\&. Any ++error (a substitution resulted in an empty string, two substitutions gave ++the same result, the destination was an existing regular file and \fB\-f\fP ++was not given) causes the entire function to abort without doing anything\&. ++.PP ++Options: ++.PP ++.PD 0 ++.TP ++\fB\-f\fP ++Force overwriting of destination files\&. Not currently ++passed down to the \fBmv\fP/\fBcp\fP/\fBln\fP command due to vagaries of ++implementations (but you can use \fB\-o\-f\fP to do that)\&. ++.TP ++\fB\-i\fP ++Interactive: show each line to be executed and ask the user ++whether to execute it\&. `Y\&' or `y' will execute it, anything else will ++skip it\&. Note that you just need to type one character\&. ++.TP ++\fB\-n\fP ++No execution: print what would happen, but don\&'t do it\&. ++.TP ++\fB\-q\fP ++Turn bare glob qualifiers off: now assumed by default, so ++this has no effect\&. ++.TP ++\fB\-Q\fP ++Force bare glob qualifiers on\&. Don\&'t turn this on unless ++you are actually using glob qualifiers in a pattern\&. ++.TP ++\fB\-s\fP ++Symbolic, passed down to \fBln\fP; only works with \fB\-L\fP\&. ++.TP ++\fB\-v\fP ++Verbose: print each command as it\&'s being executed\&. ++.TP ++\fB\-w\fP ++Pick out wildcard parts of the pattern, as described above, ++and implicitly add parentheses for referring to them\&. ++.TP ++\fB\-W\fP ++Just like \fB\-w\fP, with the addition of turning wildcards in ++the replacement pattern into sequential ${1} \&.\&. ${N} references\&. ++.TP ++\fB\-C\fP ++.TP ++\fB\-L\fP ++.TP ++\fB\-M\fP ++Force \fBcp\fP, \fBln\fP or \fBmv\fP, respectively, regardless of ++the name of the function\&. ++.TP ++\fB\-p\fP \fIprogram\fP ++Call \fIprogram\fP instead of \fBcp\fP, \fBln\fP or ++\fBmv\fP\&. Whatever it does, it should at least understand the form ++`\fIprogram\fP \fB\-\fP\fB\-\fP \fIoldname\fP \fInewname\fP\&' ++where \fIoldname\fP and \fInewname\fP are filenames generated by \fBzmv\fP\&. ++.TP ++\fB\-o\fP \fIoptstring\fP ++The \fIoptstring\fP is split into words and ++passed down verbatim to the \fBcp\fP, \fBln\fP or \fBmv\fP command called to ++perform the work\&. It should probably begin with a `\fB\-\fP\&'\&. ++.PD ++.PP ++Further examples: ++.PP ++.RS ++.nf ++\fBzmv \-v \&'(* *)' '${1// /_}'\fP ++.fi ++.RE ++.PP ++For any file in the current directory with at least one space in the name, ++replace every space by an underscore and display the commands executed\&. ++.PP ++For more complete examples and other implementation details, see the ++\fBzmv\fP source file, usually located in one of the directories named in ++your \fBfpath\fP, or in \fBFunctions/Misc/zmv\fP in the zsh distribution\&. ++.RE ++.TP ++\fBzrecompile\fP ++See `Recompiling Functions\&' ++above\&. ++.TP ++\fBzstyle+\fP \fIcontext\fP \fIstyle\fP \fIvalue\fP [ + \fIsubcontext\fP \fIstyle\fP \fIvalue\fP \&.\&.\&. ] ++This makes defining styles a bit simpler by using a single `\fB+\fP\&' as a ++special token that allows you to append a context name to the previously ++used context name\&. Like this: ++.RS ++.PP ++.RS ++.nf ++\fBzstyle+ \&':foo:bar' style1 value1 \e ++ +\&':baz' style2 value2 \e ++ +\&':frob' style3 value3\fP ++.fi ++.RE ++.PP ++This defines `style1\&' with `value1' for the context \fB:foo:bar\fP as usual, ++but it also defines `style2\&' with `value2' for the context ++\fB:foo:bar:baz\fP and `style3\&' with `value3' for \fB:foo:bar:frob\fP\&. Any ++\fIsubcontext\fP may be the empty string to re\-use the first context ++unchanged\&. ++.RE ++.RE ++.PP ++.SS "Styles" ++.PP ++.PD 0 ++.TP ++.PD ++\fBinsert\-tab\fP ++The \fBzed\fP function \fIsets\fP this style in context `\fB:completion:zed:*\fP\&' ++to turn off completion when \fBTAB\fP is typed at the beginning of a line\&. ++You may override this by setting your own value for this context and style\&. ++.TP ++\fBpager\fP ++The \fBnslookup\fP function looks up this style in the context ++`\fB:nslookup\fP\&' to determine the program used to display output that does ++not fit on a single screen\&. ++.TP ++.PD 0 ++\fBprompt\fP ++.TP ++.PD ++\fBrprompt\fP ++The \fBnslookup\fP function looks up this style in the context ++`\fB:nslookup\fP\&' to set the prompt and the right\-side prompt, respectively\&. ++The usual expansions for the \fBPS1\fP and \fBRPS1\fP parameters may be used ++(see ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshbuiltins.1 +@@ -0,0 +1,2514 @@ ++.TH "ZSHBUILTINS" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshbuiltins \- zsh built\-in commands ++.\" Yodl file: Zsh/builtins.yo ++.SH "SHELL BUILTIN COMMANDS" ++.PD 0 ++.TP ++.PD ++\fB\-\fP \fIsimple command\fP ++See the section `Precommand Modifiers\&'\&. ++.TP ++\fB\&.\fP \fIfile\fP [ \fIarg\fP \&.\&.\&. ] ++Read commands from \fIfile\fP and execute them in the current shell ++environment\&. ++.RS ++.PP ++If \fIfile\fP does not contain a slash, or if \fBPATH_DIRS\fP is set, ++the shell looks in the components of \fB$path\fP to find the directory ++containing \fIfile\fP\&. Files in the current directory are not read ++unless `\fB\&.\fP\&' appears somewhere in \fB$path\fP\&. If a file named ++`\fIfile\fP\fB\&.zwc\fP\&' is found, is newer than \fIfile\fP, and is the ++compiled form (created with the \fBzcompile\fP builtin) of \fIfile\fP, ++then commands are read from that file instead of \fIfile\fP\&. ++.PP ++If any arguments \fIarg\fP are given, ++they become the positional parameters; the old positional ++parameters are restored when the \fIfile\fP is done executing\&. ++If \fIfile\fP was not found the return status is 127; if \fIfile\fP was found ++but contained a syntax error the return status is 126; else the return ++status is the exit status of the last command executed\&. ++.RE ++.TP ++\fB:\fP [ \fIarg\fP \&.\&.\&. ] ++This command does nothing, although normal argument expansions is performed ++which may have effects on shell parameters\&. A zero exit status is returned\&. ++.TP ++\fBalias\fP [ {\fB+|\fB\-\fP\fP}\fBgmrsL\fP ] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] ++For each \fIname\fP with a corresponding \fIvalue\fP, define an alias ++with that value\&. A trailing space in \fIvalue\fP causes the next word ++to be checked for alias expansion\&. If the \fB\-g\fP flag is present, ++define a global alias; global aliases are expanded even if they do not ++occur in command position\&. ++.RS ++.PP ++If the \fB\-s\fP flags is present, define a suffix alias: if the command ++word on a command line is in the form `\fItext\fP\fB\&.\fP\fIname\fP\&', where ++\fItext\fP is any non\-empty string, it is replaced by the text ++`\fIvalue\fP \fItext\fP\fB\&.\fP\fIname\fP\&'\&. Note that \fIname\fP is treated as ++a literal string, not a pattern\&. A trailing space in \fIvalue\fP is not ++special in this case\&. For example, ++.PP ++.RS ++.nf ++\fBalias \-s ps=gv\fP ++.fi ++.RE ++.PP ++will cause the command `\fB*\&.ps\fP\&' to be expanded to `\fBgv *\&.ps\fP'\&. As ++alias expansion is carried out earlier than globbing, the `\fB*\&.ps\fP\&' will ++then be expanded\&. Suffix aliases constitute a different name space from ++other aliases (so in the above example it is still possible ++to create an alias for the command \fBps\fP) and the two sets are never ++listed together\&. ++.PP ++For each \fIname\fP with no \fIvalue\fP, ++print the value of \fIname\fP, if any\&. With no arguments, print all ++currently defined aliases other than suffix aliases\&. If the \fB\-m\fP flag ++is given the arguments 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 one of ++the \fB\-g\fP, \fB\-r\fP or \fB\-s\fP flags is present, restrict the printing to ++global, regular or suffix aliases, respectively; a regular alias is one ++which is neither a global nor a suffix alias\&. Using `\fB+\fP\&' ++instead of `\fB\-\fP\&', or ending the option list with a single ++`\fB+\fP\&', prevents the values of the aliases from being printed\&. ++.PP ++If the \fB\-L\fP flag is present, then print each ++alias in a manner suitable for putting in a startup script\&. The exit ++status is nonzero if a \fIname\fP (with no \fIvalue\fP) is given for ++which no alias has been defined\&. ++.PP ++For more on aliases, include common problems, ++see the section ALIASING in \fIzshmisc\fP(1)\&. ++.RE ++.TP ++\fBautoload\fP [ {\fB+\fP|\fB\-\fP}\fBUXktz\fP ] [ \fB\-w\fP ] [ \fIname\fP \&.\&.\&. ] ++Equivalent to \fBfunctions \-u\fP, with the exception of \fB\-X\fP/\fB+X\fP and ++\fB\-w\fP\&. ++.RS ++.PP ++The flag \fB\-X\fP may be used only inside a shell function, and may not be ++followed by a \fIname\fP\&. 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\&. ++.PP ++The flag \fB+X\fP attempts to load each \fIname\fP as an autoloaded function, ++but does \fInot\fP execute it\&. The exit status is zero (success) if the ++function was not previously defined \fIand\fP a definition for it was found\&. ++This does \fInot\fP 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\&. If ksh\-style autoloading is ++enabled, the function created will contain the contents of the file ++plus a call to the function itself appended to it, thus giving normal ++ksh autoloading behaviour on the first call to the function\&. ++.PP ++With the \fB\-w\fP flag, the \fIname\fPs are taken as names of files compiled ++with the \fBzcompile\fP builtin, and all functions defined in them are ++marked for autoloading\&. ++.PP ++The flags \fB\-z\fP and \fB\-k\fP mark the function to be autoloaded in ++native or ksh emulation, as if the option \fBKSH_AUTOLOAD\fP were ++unset or were set, respectively\&. The flags override the setting of ++the option at the time the function is loaded\&. ++.RE ++.TP ++.PD 0 ++\fBbg\fP [ \fIjob\fP \&.\&.\&. ] ++.TP ++.PD ++\fIjob\fP \&.\&.\&. \fB&\fP ++Put each specified \fIjob\fP in the background, ++or the current job if none is specified\&. ++.TP ++\fBbindkey\fP ++See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. ++.TP ++\fBbreak\fP [ \fIn\fP ] ++Exit from an enclosing \fBfor\fP, \fBwhile\fP, ++\fBuntil\fP, \fBselect\fP or \fBrepeat\fP loop\&. If \fIn\fP ++is specified, then break \fIn\fP levels instead of just one\&. ++.TP ++\fBbuiltin\fP \fIname\fP [ \fIargs\fP \&.\&.\&. ] ++Executes the builtin \fIname\fP, with the given \fIargs\fP\&. ++.TP ++\fBbye\fP ++Same as \fBexit\fP\&. ++.TP ++\fBcap\fP ++See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++.PD 0 ++\fBcd\fP [ \fB\-qsLP\fP ] [ \fIarg\fP ] ++.TP ++.PD 0 ++\fBcd\fP [ \fB\-qsLP\fP ] \fIold\fP \fInew\fP ++.TP ++.PD ++\fBcd\fP [ \fB\-qsLP\fP ] {\fB+\fP|\fB\-\fP}\fIn\fP ++Change the current directory\&. In the first form, change the ++current directory to \fIarg\fP, or to the value of \fB$HOME\fP if ++\fIarg\fP is not specified\&. If \fIarg\fP is `\fB\-\fP\&', change to the ++previous directory\&. ++.RS ++.PP ++Otherwise, if \fIarg\fP begins with a slash, attempt to change to the ++directory given by \fIarg\fP\&. ++.PP ++If \fIarg\fP does not begin with a slash, the behaviour depends on whether ++the current directory `\fB\&.\fP\&' occurs in the list of directories contained ++in the shell parameter \fBcdpath\fP\&. If it does not, first attempt to change ++to the directory \fIarg\fP under the current directory, and if that fails ++but \fBcdpath\fP is set and contains at least one element attempt to change ++to the directory \fIarg\fP under each component of \fBcdpath\fP in turn until ++successful\&. If `\fB\&.\fP\&' occurs in \fBcdpath\fP, then \fBcdpath\fP is searched ++strictly in order so that `\fB\&.\fP\&' is only tried at the appropriate point\&. ++.PP ++The order of testing \fBcdpath\fP is modified if the option \fBPOSIX_CD\fP ++is set, as described in the documentation for the option\&. ++.PP ++If no directory is found, the option \fBCDABLE_VARS\fP is set, and a ++parameter named \fIarg\fP 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\&. ++.PP ++The second form of \fBcd\fP substitutes the string \fInew\fP ++for the string \fIold\fP in the name of the current directory, ++and tries to change to this new directory\&. ++.PP ++The third form of \fBcd\fP extracts an entry from the directory ++stack, and changes to that directory\&. An argument of the form ++`\fB+\fP\fIn\fP\&' identifies a stack entry by counting from the left ++of the list shown by the \fBdirs\fP command, starting with zero\&. ++An argument of the form `\fB\-\fP\fIn\fP\&' counts from the right\&. ++If the \fBPUSHD_MINUS\fP option is set, the meanings of `\fB+\fP\&' ++and `\fB\-\fP\&' in this context are swapped\&. ++.PP ++If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP ++and the functions in the array \fBchpwd_functions\fP are not called\&. ++This is useful for calls to \fBcd\fP that do not change the environment ++seen by an interactive user\&. ++.PP ++If the \fB\-s\fP option is specified, \fBcd\fP refuses to change the current ++directory if the given pathname contains symlinks\&. If the \fB\-P\fP option ++is given or the \fBCHASE_LINKS\fP option is set, symbolic links are resolved ++to their true values\&. If the \fB\-L\fP option is given symbolic links are ++retained in the directory (and not resolved) regardless of the state of ++the \fBCHASE_LINKS\fP option\&. ++.RE ++.TP ++\fBchdir\fP ++Same as \fBcd\fP\&. ++.TP ++\fBclone\fP ++See the section `The zsh/clone Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcommand\fP [ \fB\-pvV\fP ] \fIsimple command\fP ++The simple command argument is taken as an external command instead of ++a function or builtin and is executed\&. If the \fBPOSIX_BUILTINS\fP option ++is set, builtins will also be executed but certain special properties ++of them are suppressed\&. The \fB\-p\fP flag causes a default path to be ++searched instead of that in \fB$path\fP\&. With the \fB\-v\fP flag, \fBcommand\fP ++is similar to \fBwhence\fP and with \fB\-V\fP, it is equivalent to \fBwhence ++\-v\fP\&. ++.RS ++.PP ++See also the section `Precommand Modifiers\&'\&. ++.RE ++.TP ++\fBcomparguments\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompcall\fP ++See the section `The zsh/compctl Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompctl\fP ++See the section `The zsh/compctl Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompdescribe\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompfiles\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompgroups\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompquote\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcomptags\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcomptry\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcompvalues\fP ++See the section `The zsh/computil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBcontinue\fP [ \fIn\fP ] ++Resume the next iteration of the enclosing ++\fBfor\fP, \fBwhile\fP, \fBuntil\fP, \fBselect\fP or ++\fBrepeat\fP loop\&. If \fIn\fP is specified, break out of ++\fIn\fP\-1 loops and resume at the \fIn\fPth enclosing loop\&. ++.TP ++\fBdeclare\fP ++Same as \fBtypeset\fP\&. ++.TP ++.PD 0 ++\fBdirs\fP [ \fB\-c\fP ] [ \fIarg\fP \&.\&.\&. ] ++.TP ++.PD ++\fBdirs\fP [ \fB\-lpv\fP ] ++With no arguments, print the contents of the directory stack\&. ++Directories are added to this stack with the \fBpushd\fP command, ++and removed with the \fBcd\fP or \fBpopd\fP commands\&. ++If arguments are specified, load them onto the directory stack, ++replacing anything that was there, and push the current directory ++onto the stack\&. ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-c\fP ++clear the directory stack\&. ++.TP ++\fB\-l\fP ++print directory names in full instead of using of using \fB~\fP expressions\&. ++.TP ++\fB\-p\fP ++print directory entries one per line\&. ++.TP ++\fB\-v\fP ++number the directories in the stack when printing\&. ++.PP ++.RE ++.TP ++\fBdisable\fP [ \fB\-afmrs\fP ] \fIname\fP \&.\&.\&. ++Temporarily disable the \fIname\fPd hash table elements\&. The default ++is to disable builtin commands\&. This allows you to use an external ++command with the same name as a builtin command\&. The \fB\-a\fP option ++causes \fBdisable\fP to act on regular or global aliases\&. The \fB\-s\fP ++option causes \fBdisable\fP to act on suffix aliases\&. The \fB\-f\fP option causes ++\fBdisable\fP to act on shell functions\&. The \fB\-r\fP options causes ++\fBdisable\fP to act on reserved words\&. Without arguments all disabled ++hash table elements from the corresponding hash table are printed\&. ++With the \fB\-m\fP 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 \fBenable\fP ++command\&. ++.TP ++.PD 0 ++\fBdisown\fP [ \fIjob\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fIjob\fP \&.\&.\&. \fB&|\fP ++.TP ++.PD ++\fIjob\fP \&.\&.\&. \fB&!\fP ++Remove the specified \fIjob\fPs from the job table; the shell will ++no longer report their status, and will not complain if you ++try to exit an interactive shell with them running or stopped\&. ++If no \fIjob\fP is specified, disown the current job\&. ++.RS ++.PP ++If the \fIjob\fPs are currently stopped and the \fBAUTO_CONTINUE\fP option ++is not set, a warning is printed containing information about how to ++make them running after they have been disowned\&. If one of the latter ++two forms is used, the \fIjob\fPs will automatically be made running, ++independent of the setting of the \fBAUTO_CONTINUE\fP option\&. ++.RE ++.TP ++\fBecho\fP [ \fB\-neE\fP ] [ \fIarg\fP \&.\&.\&. ] ++Write each \fIarg\fP on the standard output, with a space separating ++each one\&. ++If the \fB\-n\fP flag is not present, print a newline at the end\&. ++\fBecho\fP recognizes the following escape sequences: ++.RS ++.PP ++.PD 0 ++.TP ++\fB\ea\fP ++bell character ++.TP ++\fB\eb\fP ++backspace ++.TP ++\fB\ec\fP ++suppress final newline ++.TP ++\fB\ee\fP ++escape ++.TP ++\fB\ef\fP ++form feed ++.TP ++\fB\en\fP ++linefeed (newline) ++.TP ++\fB\er\fP ++carriage return ++.TP ++\fB\et\fP ++horizontal tab ++.TP ++\fB\ev\fP ++vertical tab ++.TP ++\fB\e\e\fP ++backslash ++.TP ++\fB\e0\fP\fINNN\fP ++character code in octal ++.TP ++\fB\ex\fP\fINN\fP ++character code in hexadecimal ++.TP ++\fB\eu\fP\fINNNN\fP ++unicode character code in hexadecimal ++.TP ++\fB\eU\fP\fINNNNNNNN\fP ++unicode character code in hexadecimal ++.PD ++.PP ++The \fB\-E\fP flag, or the \fBBSD_ECHO\fP option, can be used to disable ++these escape sequences\&. In the latter case, \fB\-e\fP flag can be used to ++enable them\&. ++.RE ++.TP ++\fBechotc\fP ++See the section `The zsh/termcap Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBechoti\fP ++See the section `The zsh/terminfo Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBemulate\fP [ \fB\-LR\fP ] [ {\fBzsh\fP|\fBsh\fP|\fBksh\fP|\fBcsh\fP} [ \fB\-c\fP \fBarg\fP ] ] ++Without any argument print current emulation mode\&. ++.RS ++.PP ++With single argument set up zsh options to emulate the specified shell ++as much as possible\&. ++\fBcsh\fP will never be fully emulated\&. ++If the argument is not one of the shells listed above, \fBzsh\fP ++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 ++the section `Compatibility\&' in \fIzshmisc\fP(1) ++\&. ++.PP ++If the \fB\-R\fP option is given, all options ++are reset to their default value corresponding to the specified emulation ++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 \fB\-L\fP option is given, ++the options \fBLOCAL_OPTIONS\fP and \fBLOCAL_TRAPS\fP will be set as ++well, causing the effects of the \fBemulate\fP command and any \fBsetopt\fP and ++\fBtrap\fP commands to be local to the immediately surrounding shell ++function, if any; normally these options are turned off in all emulation ++modes except \fBksh\fP\&. The \fB\-L\fP and \fB\-c\fP are mutually exclusive\&. ++.PP ++If \fB\-c\fP \fBarg\fP is given, evaluate \fBarg\fP while the requested ++emulation is temporarily in effect\&. The emulation and all options will ++be restored to their original values before \fBemulate\fP returns\&. The ++\fB\-R\fP flag may be used\&. ++.PP ++Use of \fB\-c\fP enables `sticky\&' emulation mode for functions defined ++within the evaluated expression: the emulation mode is associated ++thereafter with the function so that whenever the function is executed ++the emulation (respecting the \fB\-R\fP flag, if present) and all ++options are set before entry to the function, and restored after exit\&. ++If the function is called when the sticky emulation is already in ++effect, either within an `\fBemulate\fP \fIshell\fP \fB\-c\fP\&' expression or ++within another function with the same sticky emulation, entry and exit ++from the function do not cause options to be altered (except due to ++standard processing such as the \fBLOCAL_OPTIONS\fP option)\&. ++.PP ++For example: ++.PP ++.RS ++.nf ++\fBemulate sh \-c \&'fni() { setopt cshnullglob; } ++fno() { fni; }\&' ++fno ++\fP ++.fi ++.RE ++.PP ++The two functions \fBfni\fP and \fBfno\fP are defined with sticky \fBsh\fP ++emulation\&. \fBfno\fP is then executed, causing options associated ++with emulations to be set to their values in \fBsh\fP\&. \fBfni\fP then ++calls \fBfno\fP; because \fBfno\fP is also marked for sticky \fBsh\fP ++emulation, no option changes take place on entry to or exit from it\&. ++Hence the option \fBcshnullglob\fP, turned off by \fBsh\fP emulation, will ++be turned on within \fBfni\fP and remain on on return to \fBfno\fP\&. On exit ++from \fBfno\fP, the emulation mode and all options will be restored to the ++state they were in before entry to the temporary emulation\&. ++.PP ++The documentation above is typically sufficient for the intended ++purpose of executing code designed for other shells in a suitable ++environment\&. More detailed rules follow\&. ++.PD 0 ++.TP ++1\&. ++The sticky emulation environment provided by `\fBemulate\fP ++\fIshell\fP \fB\-c\fP\&' is identical to that provided by entry to ++a function marked for sticky emulation as a consequence of being ++defined in such an environment\&. Hence, for example, the sticky ++emulation is inherited by subfunctions defined within functions ++with sticky emulation\&. ++.TP ++2\&. ++No change of options takes place on entry to or exit from ++functions that are not marked for sticky emulation, other than those ++that would normally take place, even if those functions are called ++within sticky emulation\&. ++.TP ++3\&. ++No special handling is provided for functions marked for ++\fBautoload\fP nor for functions present in wordcode created by ++the \fBzcompile\fP command\&. ++.TP ++4\&. ++The presence or absence of the \fB\-R\fP flag to \fBemulate\fP ++corresponds to different sticky emulation modes, so for example ++`\fBemulate sh \-c\fP\&', `\fBemulate \-R sh \-c\fP' and `\fBemulate csh \-c\fP' ++are treated as three distinct sticky emulations\&. ++.PD ++.RE ++.TP ++\fBenable\fP [ \fB\-afmrs\fP ] \fIname\fP \&.\&.\&. ++Enable the \fIname\fPd hash table elements, presumably disabled ++earlier with \fBdisable\fP\&. The default is to enable builtin commands\&. ++The \fB\-a\fP option causes \fBenable\fP to act on regular or global aliases\&. ++The \fB\-s\fP option causes \fBenable\fP to act on suffix aliases\&. ++The \fB\-f\fP option causes \fBenable\fP to act on shell functions\&. The \fB\-r\fP ++option causes \fBenable\fP to act on reserved words\&. Without arguments ++all enabled hash table elements from the corresponding hash table are ++printed\&. With the \fB\-m\fP flag the arguments are taken as patterns ++(should be quoted) and all hash table elements from the corresponding ++hash table matching these patterns are enabled\&. Enabled objects can be ++disabled with the \fBdisable\fP builtin command\&. ++.TP ++\fBeval\fP [ \fIarg\fP \&.\&.\&. ] ++Read the arguments as input to the shell and execute the resulting ++command(s) in the current shell process\&. The return status is ++the same as if the commands had been executed directly by the shell; ++if there are no \fIargs\fP or they contain no commands (i\&.e\&. are ++an empty string or whitespace) the return status is zero\&. ++.TP ++\fBexec\fP [ \fB\-cl\fP ] [ \fB\-a\fP \fIargv0\fP ] \fIsimple command\fP ++Replace the current shell with an external command rather than forking\&. ++With \fB\-c\fP clear the environment; with \fB\-l\fP prepend \fB\-\fP to the ++\fBargv[0]\fP string of the command executed (to simulate a login shell); ++with \fB\-a\fP \fIargv0\fP set the \fBargv[0]\fP string of the command ++executed\&. See the section `Precommand Modifiers\&'\&. ++.TP ++\fBexit\fP [ \fIn\fP ] ++Exit the shell with the exit status specified by \fIn\fP; if none ++is specified, use the exit status from the last command executed\&. ++An EOF condition will also cause the shell to exit, unless ++the \fBIGNORE_EOF\fP option is set\&. ++.TP ++\fBexport\fP [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] ++The specified \fIname\fPs are marked for automatic export ++to the environment of subsequently executed commands\&. ++Equivalent to \fBtypeset \-gx\fP\&. ++If a parameter specified does not ++already exist, it is created in the global scope\&. ++.TP ++\fBfalse\fP [ \fIarg\fP \&.\&.\&. ] ++Do nothing and return an exit status of 1\&. ++.TP ++.PD 0 ++\fBfc\fP [ \fB\-e\fP \fIename\fP ] [ \fB\-m\fP \fImatch\fP ] [ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] ++.TP ++.PD 0 ++\fBfc\fP \fB\-l\fP [ \fB\-nrdfEiD\fP ] [ \fB\-t\fP \fItimefmt\fP ] [ \fB\-m\fP \fImatch\fP ] ++.TP ++.PD 0 ++ [ \fIold\fP\fB=\fP\fInew\fP \&.\&.\&. ] [ \fIfirst\fP [ \fIlast\fP ] ] ++.TP ++.PD 0 ++\fBfc\fP \fB\-p\fP [ \fB\-a\fP ] [ \fIfilename\fP [ \fIhistsize\fP [ \fIsavehistsize\fP ] ] ] ++.TP ++.PD 0 ++\fBfc\fP \fB\-P\fP ++.TP ++.PD ++\fBfc\fP \fB\-ARWI\fP [ \fIfilename\fP ] ++Select a range of commands from \fIfirst\fP to \fIlast\fP from the ++history list\&. ++The arguments \fIfirst\fP and \fIlast\fP may be specified as a ++number or as a string\&. A negative number is used as an offset ++to the current history event number\&. ++A string specifies the most recent event beginning with the given string\&. ++All substitutions \fIold\fP\fB=\fP\fInew\fP, if any, are then performed ++on the commands\&. ++.RS ++.PP ++If the \fB\-l\fP flag is given, the resulting commands are listed on ++standard output\&. ++If the \fB\-m\fP flag is also given the first argument is taken as a ++pattern (should be quoted) and only the history events matching this ++pattern will be shown\&. ++Otherwise the editor program \fIename\fP is invoked on a file containing ++these history events\&. If \fIename\fP is not given, the value ++of the parameter \fBFCEDIT\fP is used; if that is not set the value of the ++parameter \fBEDITOR\fP is used; if that is not set a builtin default, usually ++`\fBvi\fP\&' is used\&. If \fIename\fP is `\fB\-\fP', ++no editor is invoked\&. When editing is complete, the edited ++command is executed\&. ++.PP ++If \fIfirst\fP is not specified, it will be set to \-1 (the most recent ++event), or to \-16 if the \fB\-l\fP flag is given\&. ++If \fIlast\fP is not specified, it will be set to \fIfirst\fP, ++or to \-1 if the \fB\-l\fP flag is given\&. ++.PP ++The flag \fB\-r\fP reverses the order of the commands and the ++flag \fB\-n\fP suppresses command numbers when listing\&. ++.PP ++Also when listing, ++.PD 0 ++.TP ++\fB\-d\fP ++prints timestamps for each command ++.TP ++\fB\-f\fP ++prints full time\-date stamps in the US ++`\fIMM\fP\fB/\fP\fIDD\fP\fB/\fP\fIYY\fP \fIhh\fP:\fImm\fP\&' format ++.TP ++\fB\-E\fP ++prints full time\-date stamps in the European ++`\fIdd\fP\fB\&.\fP\fImm\fP\fB\&.\fP\fIyyyy\fP \fIhh\fP:\fImm\fP\&' format ++.TP ++\fB\-i\fP ++prints full time\-date stamps in ISO8601 ++`\fIyyyy\fP\fB\-\fP\fImm\fP\fB\-\fP\fIdd\fP \fIhh\fP:\fImm\fP\&' format ++.TP ++\fB\-t\fP \fIfmt\fP ++prints time and date stamps in the given format; ++\fIfmt\fP is formatted with the strftime function with the zsh extensions ++described for the \fB%D{\fP\fIstring\fP\fB}\fP prompt format in ++the section EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)\&. The resulting formatted string must be ++no more than 256 characters or will not be printed\&. ++.PP ++.TP ++\fB\-D\fP ++prints elapsed times; may be combined with one of the ++options above\&. ++.PD ++.PP ++.PP ++`\fBfc \-p\fP\&' pushes the current history list onto a stack and switches to a ++new history list\&. If the \fB\-a\fP option is also specified, this history list ++will be automatically popped when the current function scope is exited, which ++is a much better solution than creating a trap function to call `\fBfc \-P\fP\&' ++manually\&. If no arguments are specified, the history list is left empty, ++\fB$HISTFILE\fP is unset, and \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are set to their ++default values\&. If one argument is given, \fB$HISTFILE\fP is set to that ++filename, \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are left unchanged, and the history ++file is read in (if it exists) to initialize the new list\&. If a second ++argument is specified, \fB$HISTSIZE\fP & \fB$SAVEHIST\fP are instead set to the ++single specified numeric value\&. Finally, if a third argument is specified, ++\fB$SAVEHIST\fP is set to a separate value from \fB$HISTSIZE\fP\&. You are free to ++change these environment values for the new history list however you desire ++in order to manipulate the new history list\&. ++.PP ++`\fBfc \-P\fP\&' pops the history list back to an older list saved by `\fBfc \-p\fP'\&. ++The current list is saved to its \fB$HISTFILE\fP before it is destroyed ++(assuming that \fB$HISTFILE\fP and \fB$SAVEHIST\fP are set appropriately, of ++course)\&. The values of \fB$HISTFILE\fP, \fB$HISTSIZE\fP, and \fB$SAVEHIST\fP are ++restored to the values they had when `\fBfc \-p\fP\&' was called\&. Note that this ++restoration can conflict with making these variables "local", so your best ++bet is to avoid local declarations for these variables in functions that use ++`\fBfc \-p\fP\&'\&. The one other guaranteed\-safe combination is declaring these ++variables to be local at the top of your function and using the automatic ++option (\fB\-a\fP) with `\fBfc \-p\fP\&'\&. Finally, note that it is legal to manually ++pop a push marked for automatic popping if you need to do so before the ++function exits\&. ++.PP ++`\fBfc \-R\fP\&' reads the history from the given file, ++`\fBfc \-W\fP\&' writes the history out to the given file, ++and `\fBfc \-A\fP\&' appends the history out to the given file\&. ++If no filename is specified, the \fB$HISTFILE\fP is assumed\&. ++If the \fB\-I\fP option is added to \fB\-R\fP, only those events that are ++not already contained within the internal history list are added\&. ++If the \fB\-I\fP option is added to \fB\-A\fP or \fB\-W\fP, 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 \fB$SAVEHIST\fP ++entries\&. ++.RE ++.TP ++.PD 0 ++\fBfg\fP [ \fIjob\fP \&.\&.\&. ] ++.TP ++.PD ++\fIjob\fP \&.\&.\&. ++Bring each specified \fIjob\fP in turn to the foreground\&. ++If no \fIjob\fP is specified, resume the current job\&. ++.TP ++\fBfloat\fP [ {\fB+\fP|\fB\-\fP}\fBEFHghlprtux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] ++Equivalent to \fBtypeset \-E\fP, except that options irrelevant to floating ++point numbers are not permitted\&. ++.TP ++.PD 0 ++\fBfunctions\fP [ {\fB+\fP|\fB\-\fP}\fBUXkmtuz\fP ] [ \fIname\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fBfunctions \-M\fP \fImathfn\fP [ \fImin\fP [ \fImax\fP [ \fIshellfn\fP ] ] ] ++.TP ++.PD 0 ++\fBfunctions \-M\fP [ \fB\-m\fP \fIpattern\fP \&.\&.\&. ] ++.TP ++.PD ++\fBfunctions +M\fP [ \fB\-m\fP ] \fImathfn\fP ++Equivalent to \fBtypeset \-f\fP, with the exception of the \fB\-M\fP option\&. ++Use of the \fB\-M\fP option may not be combined with any of the options ++handled by \fBtypeset \-f\fP\&. ++.RS ++.PP ++\fBfunctions \-M\fP \fImathfn\fP defines \fImathfn\fP as the name of ++a mathematical function recognised in all forms of arithmetical expressions; ++see ++the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1)\&. By default \fImathfn\fP may take ++any number of comma\-separated arguments\&. If \fImin\fP is given, ++it must have exactly \fImin\fP args; if \fImin\fP and \fImax\fP are ++both given, it must have at least \fImin\fP and at most \fImax\fP ++args\&. \fImax\fP may be \-1 to indicate that there is no upper limit\&. ++.PP ++By default the function is implemented by a shell function of the same ++name; if \fIshellfn\fP is specified it gives the name of the corresponding ++shell function while \fImathfn\fP remains the name used in arithmetical ++expressions\&. The name of the function in \fB$0\fP is \fImathfn\fP (not ++\fIshellfn\fP as would usually be the case), provided the option ++\fBFUNCTION_ARGZERO\fP is in effect\&. The positional parameters in the shell ++function correspond to the arguments of the mathematical function call\&. ++The result of the last arithmetical expression evaluated ++inside the shell function (even if it is a form that normally only returns ++a status) gives the result of the mathematical function\&. ++.PP ++\fBfunctions \-M\fP with no arguments lists all such user\-defined functions in ++the same form as a definition\&. With the additional option \fB\-m\fP and ++a list of arguments, all functions whose \fImathfn\fP matches one of ++the pattern arguments are listed\&. ++.PP ++\fBfunction +M\fP removes the list of mathematical functions; with the ++additional option \fB\-m\fP the arguments are treated as patterns and ++all functions whose \fBmathfn\fP matches the pattern are removed\&. Note ++that the shell function implementing the behaviour is not removed ++(regardless of whether its name coincides with \fBmathfn\fP)\&. ++.PP ++For example, the following prints the cube of 3: ++.PP ++.RS ++.nf ++\fBzmath_cube() { (( $1 * $1 * $1 )) } ++functions \-M cube 1 1 zmath_cube ++print $(( cube(3) ))\fP ++.fi ++.RE ++.RE ++.TP ++\fBgetcap\fP ++See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBgetln\fP [ \fB\-AclneE\fP ] \fIname\fP \&.\&.\&. ++Read the top value from the buffer stack and put it in ++the shell parameter \fBname\fP\&. Equivalent to ++\fBread \-zr\fP\&. ++.TP ++\fBgetopts\fP \fIoptstring\fP \fIname\fP [ \fIarg\fP \&.\&.\&. ] ++Checks the \fIarg\fPs for legal options\&. If the \fIarg\fPs are omitted, ++use the positional parameters\&. A valid option argument ++begins with a `\fB+\fP\&' or a `\fB\-\fP'\&. An argument not beginning with ++a `\fB+\fP\&' or a `\fB\-\fP', or the argument `\fB\-\fP\fB\-\fP', ends the options\&. ++Note that a single `\fB\-\fP\&' is not considered a valid option argument\&. ++\fIoptstring\fP contains the letters that \fBgetopts\fP ++recognizes\&. If a letter is followed by a `\fB:\fP\&', that option ++requires an argument\&. The options can be ++separated from the argument by blanks\&. ++.RS ++.PP ++Each time it is invoked, \fBgetopts\fP places the option letter it finds ++in the shell parameter \fIname\fP, prepended with a `\fB+\fP\&' when ++\fIarg\fP begins with a `\fB+\fP\&'\&. The index of the next \fIarg\fP ++is stored in \fBOPTIND\fP\&. The option argument, if any, ++is stored in \fBOPTARG\fP\&. ++.PP ++The first option to be examined may be changed by explicitly assigning ++to \fBOPTIND\fP\&. \fBOPTIND\fP has an initial value of \fB1\fP, and is ++normally reset to \fB1\fP upon exit from a shell function\&. \fBOPTARG\fP ++is not reset and retains its value from the most recent call to ++\fBgetopts\fP\&. If either of \fBOPTIND\fP or \fBOPTARG\fP is explicitly ++unset, it remains unset, and the index or option argument is not ++stored\&. The option itself is still stored in \fIname\fP in this case\&. ++.PP ++A leading `\fB:\fP\&' in \fIoptstring\fP causes \fBgetopts\fP to store the ++letter of any invalid option in \fBOPTARG\fP, and to set \fIname\fP to ++`\fB?\fP\&' for an unknown option and to `\fB:\fP' when a required argument is ++missing\&. Otherwise, \fBgetopts\fP sets \fIname\fP to `\fB?\fP\&' and prints ++an error message when an option is invalid\&. The exit status is ++nonzero when there are no more options\&. ++.RE ++.TP ++\fBhash\fP [ \fB\-Ldfmrv\fP ] [ \fIname\fP[\fB=\fP\fIvalue\fP] ] \&.\&.\&. ++\fBhash\fP can be used to directly modify the contents of the command ++hash table, and the named directory hash table\&. Normally one would ++modify these tables by modifying one\&'s \fBPATH\fP ++(for the command hash table) or by creating appropriate shell parameters ++(for the named directory hash table)\&. ++The choice of hash table to work on is determined by the \fB\-d\fP option; ++without the option the command hash table is used, and with the option the ++named directory hash table is used\&. ++.RS ++.PP ++Given no arguments, and neither the \fB\-r\fP or \fB\-f\fP options, ++the selected hash table will be listed in full\&. ++.PP ++The \fB\-r\fP option causes the selected hash table to be emptied\&. ++It will be subsequently rebuilt in the normal fashion\&. ++The \fB\-f\fP option causes the selected hash table to be fully ++rebuilt immediately\&. For the command hash table this hashes ++all the absolute directories in the \fBPATH\fP, ++and for the named directory hash table this adds all users\&' home directories\&. ++These two options cannot be used with any arguments\&. ++.PP ++The \fB\-m\fP option causes the arguments to be taken as patterns ++(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\&. ++.PP ++For each \fIname\fP with a corresponding \fIvalue\fP, put `\fIname\fP\&' in ++the selected hash table, associating it with the pathname `\fIvalue\fP\&'\&. ++In the command hash table, this means that ++whenever `\fIname\fP\&' is used as a command argument, the shell will try ++to execute the file given by `\fIvalue\fP\&'\&. ++In the named directory hash table, this means ++that `\fIvalue\fP\&' may be referred to as `\fB~\fP\fIname\fP'\&. ++.PP ++For each \fIname\fP with no ++corresponding \fIvalue\fP, attempt to add \fIname\fP to the hash table, ++checking what the appropriate \fBvalue\fP is in the normal manner for ++that hash table\&. If an appropriate \fBvalue\fP can\&'t be found, then ++the hash table will be unchanged\&. ++.PP ++The \fB\-v\fP option causes hash table entries to be listed as they are ++added by explicit specification\&. If has no effect if used with \fB\-f\fP\&. ++.PP ++If the \fB\-L\fP flag is present, then each hash table entry is printed in ++the form of a call to hash\&. ++.RE ++.TP ++\fBhistory\fP ++Same as \fBfc \-l\fP\&. ++.TP ++\fBinteger\fP [ {\fB+\fP|\fB\-\fP}\fBHghilprtux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] ++Equivalent to \fBtypeset \-i\fP, except that options irrelevant to ++integers are not permitted\&. ++.TP ++.PD 0 ++\fBjobs\fP [ \fB\-dlprs\fP ] [ \fIjob\fP \&.\&.\&. ] ++.TP ++.PD ++\fBjobs \-Z\fP \fIstring\fP ++Lists information about each given job, or all jobs ++if \fIjob\fP is omitted\&. The \fB\-l\fP flag lists process ++IDs, and the \fB\-p\fP flag lists process groups\&. ++If the \fB\-r\fP flag is specified only running jobs will be listed ++and if the \fB\-s\fP flag is given only stopped jobs are shown\&. ++If the \fB\-d\fP flag is given, the directory from which the job was ++started (which may not be the current directory of the job) will also ++be shown\&. ++.RS ++.PP ++The \fB\-Z\fP option replaces the shell\&'s argument and environment space with ++the given string, truncated if necessary to fit\&. This will normally be ++visible in \fBps\fP (\fIps\fP(1)) listings\&. This feature is typically ++used by daemons, to indicate their state\&. ++.RE ++.TP ++.PD 0 ++\fBkill\fP [ \fB\-s\fP \fIsignal_name\fP | \fB\-n\fP \fIsignal_number\fP | \fB\-\fP\fIsig\fP ] \fIjob\fP \&.\&.\&. ++.TP ++.PD ++\fBkill\fP \fB\-l\fP [ \fIsig\fP \&.\&.\&. ] ++Sends either \fBSIGTERM\fP or the specified signal to the given ++jobs or processes\&. ++Signals are given by number or by names, with or without the `\fBSIG\fP\&' ++prefix\&. ++If the signal being sent is not `\fBKILL\fP\&' or `\fBCONT\fP', then the job ++will be sent a `\fBCONT\fP\&' signal if it is stopped\&. ++The argument \fIjob\fP can be the process ID of a job ++not in the job list\&. ++In the second form, \fBkill \-l\fP, if \fIsig\fP is not ++specified the signal names are listed\&. Otherwise, for each ++\fIsig\fP that is a name, the corresponding signal number is ++listed\&. For each \fIsig\fP that is a signal number or a number ++representing the exit status of a process which was terminated or ++stopped by a signal the name of the signal is printed\&. ++.RS ++.PP ++On some systems, alternative signal names are allowed for a few signals\&. ++Typical examples are \fBSIGCHLD\fP and \fBSIGCLD\fP or \fBSIGPOLL\fP and ++\fBSIGIO\fP, assuming they correspond to the same signal number\&. \fBkill ++\-l\fP will only list the preferred form, however \fBkill \-l\fP \fIalt\fP will ++show if the alternative form corresponds to a signal number\&. For example, ++under Linux \fBkill \-l IO\fP and \fBkill \-l POLL\fP both output 29, hence ++\fBkill \-IO\fP and \fBkill \-POLL\fP have the same effect\&. ++.PP ++Many systems will allow process IDs to be negative to kill a process ++group or zero to kill the current process group\&. ++.RE ++.TP ++\fBlet\fP \fIarg\fP \&.\&.\&. ++Evaluate each \fIarg\fP as an arithmetic expression\&. ++See ++the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) ++for a description of arithmetic expressions\&. The exit status is 0 if the ++value of the last expression is nonzero, 1 if it is zero, and 2 if ++an error occurred\&. ++.TP ++\fBlimit\fP [ \fB\-hs\fP ] [ \fIresource\fP [ \fIlimit\fP ] ] \&.\&.\&. ++Set or display resource limits\&. Unless the \fB\-s\fP flag is given, ++the limit applies only the children of the shell\&. If \fB\-s\fP is ++given without other arguments, the resource limits of the current ++shell is set to the previously set resource limits of the children\&. ++.RS ++.PP ++If \fIlimit\fP is not specified, print the current limit placed ++on \fIresource\fP, otherwise ++set the limit to the specified value\&. If the \fB\-h\fP flag ++is given, use hard limits instead of soft limits\&. ++If no \fIresource\fP is given, print all limits\&. ++.PP ++When looping over multiple resources, the shell will abort immediately if ++it detects a badly formed argument\&. However, if it fails to set a limit ++for some other reason it will continue trying to set the remaining limits\&. ++.PP ++\fIresource\fP can be one of: ++.PP ++.PD 0 ++.TP ++\fBaddressspace\fP ++Maximum amount of address space used\&. ++.TP ++\fBaiomemorylocked\fP ++Maximum amount of memory locked in RAM for AIO operations\&. ++.TP ++\fBaiooperations\fP ++Maximum number of AIO operations\&. ++.TP ++\fBcachedthreads\fP ++Maximum number of cached threads\&. ++.TP ++\fBcoredumpsize\fP ++Maximum size of a core dump\&. ++.TP ++\fBcputime\fP ++Maximum CPU seconds per process\&. ++.TP ++\fBdatasize\fP ++Maximum data size (including stack) for each process\&. ++.TP ++\fBdescriptors\fP ++Maximum value for a file descriptor\&. ++.TP ++\fBfilesize\fP ++Largest single file allowed\&. ++.TP ++\fBmaxproc\fP ++Maximum number of processes\&. ++.TP ++\fBmaxpthreads\fP ++Maximum number of threads per process\&. ++.TP ++\fBmemorylocked\fP ++Maximum amount of memory locked in RAM\&. ++.TP ++\fBmemoryuse\fP ++Maximum resident set size\&. ++.TP ++\fBmsgqueue\fP ++Maximum number of bytes in POSIX message queues\&. ++.TP ++\fBresident\fP ++Maximum resident set size\&. ++.TP ++\fBsigpending\fP ++Maximum number of pending signals\&. ++.TP ++\fBsockbufsize\fP ++Maximum size of all socket buffers\&. ++.TP ++\fBstacksize\fP ++Maximum stack size for each process\&. ++.TP ++\fBvmemorysize\fP ++Maximum amount of virtual memory\&. ++.PD ++.PP ++Which of these resource limits are available depends on the system\&. ++\fIresource\fP can be abbreviated to any unambiguous prefix\&. It ++can also be an integer, which corresponds to the integer defined ++for the resource by the operating system\&. ++.PP ++If argument corresponds to a number which is out of the range of the ++resources configured into the shell, the shell will try to read or write ++the limit anyway, and will report an error if this fails\&. As the shell ++does not store such resources internally, an attempt to set the limit will ++fail unless the \fB\-s\fP option is present\&. ++.PP ++\fIlimit\fP is a number, with an optional scaling factor, as follows: ++.PP ++.PD 0 ++.TP ++\fIn\fP\fBh\fP ++hours ++.TP ++\fIn\fP\fBk\fP ++kilobytes (default) ++.TP ++\fIn\fP\fBm\fP ++megabytes or minutes ++.TP ++[\fImm\fP\fB:\fP]\fIss\fP ++minutes and seconds ++.PD ++.PP ++The \fBlimit\fP command is not made available by default when the ++shell starts in a mode emulating another shell\&. It can be made available ++with the command `\fBzmodload \-F zsh/rlimits b:limit\fP\&'\&. ++.RE ++.TP ++\fBlocal\fP [ {\fB+\fP|\fB\-\fP}\fBAEFHUahlprtux\fP ] [ \fB\-LRZi\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] ] \&.\&.\&. ++Same as \fBtypeset\fP, except that the options \fB\-g\fP, and ++\fB\-f\fP are not permitted\&. In this case the \fB\-x\fP option does not force ++the use of \fB\-g\fP, i\&.e\&. exported variables will be local to functions\&. ++.TP ++\fBlog\fP ++List all users currently logged in who are affected by ++the current setting of the \fBwatch\fP parameter\&. ++.TP ++\fBlogout\fP [ \fIn\fP ] ++Same as \fBexit\fP, except that it only works in a login shell\&. ++.TP ++\fBnoglob\fP \fIsimple command\fP ++See the section `Precommand Modifiers\&'\&. ++.TP ++\fBpopd\fP [ [\-q] {\fB+\fP|\fB\-\fP}\fIn\fP ] ++Remove an entry from the directory stack, and perform a \fBcd\fP to ++the new top directory\&. With no argument, the current top entry is ++removed\&. An argument of the form `\fB+\fP\fIn\fP\&' identifies a stack ++entry by counting from the left of the list shown by the \fBdirs\fP command, ++starting with zero\&. An argument of the form \fB\-n\fP counts from the right\&. ++If the \fBPUSHD_MINUS\fP option is set, the meanings of `\fB+\fP\&' and ++`\fB\-\fP\&' in this context are swapped\&. ++.RS ++.PP ++If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP ++and the functions in the array \fB$chpwd_functions\fP are not called, ++and the new directory stack is not printed\&. This is useful for calls to ++\fBpopd\fP that do not change the environment seen by an interactive user\&. ++.RE ++.TP ++.PD 0 ++\fBprint\fP [ \fB\-abcDilmnNoOpPrsSz\fP ] [ \fB\-u\fP \fIn\fP ] [ \fB\-f\fP \fIformat\fP ] [ \fB\-C\fP \fIcols\fP ] ++.TP ++.PD ++ [ \fB\-R\fP [ \fB\-en\fP ]] [ \fIarg\fP \&.\&.\&. ] ++With the `\fB\-f\fP\&' option the arguments are printed as described by \fBprintf\fP\&. ++With no flags or with the flag `\fB\-\fP\&', the arguments are printed on ++the standard output as described by \fBecho\fP, with the following differences: ++the escape sequence `\fB\eM\-\fP\fIx\fP\&' metafies the character ++\fIx\fP (sets the highest bit), ++`\fB\eC\-\fP\fIx\fP\&' produces a control character (`\fB\eC\-@\fP' and `\fB\eC\-?\fP' give the ++characters NUL and delete), and `\fB\eE\fP\&' is a synonym for `\fB\ee\fP'\&. ++Finally, if not in an escape ++sequence, `\fB\e\fP\&' escapes the following character and is not printed\&. ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-a\fP ++Print arguments with the column incrementing first\&. Only useful with the ++\fB\-c\fP and \fB\-C\fP options\&. ++.TP ++\fB\-b\fP ++Recognize all the escape sequences defined for the \fBbindkey\fP command, ++see ++\fIzshzle\fP(1)\&. ++.TP ++\fB\-c\fP ++Print the arguments in columns\&. Unless \fB\-a\fP is also given, arguments are ++printed with the row incrementing first\&. ++.TP ++\fB\-C\fP \fIcols\fP ++Print the arguments in \fIcols\fP columns\&. Unless \fB\-a\fP is also given, ++arguments are printed with the row incrementing first\&. ++.TP ++\fB\-D\fP ++Treat the arguments as directory names, replacing prefixes with \fB~\fP ++expressions, as appropriate\&. ++.TP ++\fB\-i\fP ++If given together with \fB\-o\fP or \fB\-O\fP, sorting is performed ++case\-independently\&. ++.TP ++\fB\-l\fP ++Print the arguments separated by newlines instead of spaces\&. ++.TP ++\fB\-m\fP ++Take the first argument as a pattern (should be quoted), and remove ++it from the argument list together with subsequent arguments that ++do not match this pattern\&. ++.TP ++\fB\-n\fP ++Do not add a newline to the output\&. ++.TP ++\fB\-N\fP ++Print the arguments separated and terminated by nulls\&. ++.TP ++\fB\-o\fP ++Print the arguments sorted in ascending order\&. ++.TP ++\fB\-O\fP ++Print the arguments sorted in descending order\&. ++.TP ++\fB\-p\fP ++Print the arguments to the input of the coprocess\&. ++.TP ++\fB\-P\fP ++Perform prompt expansion (see ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. ++.TP ++\fB\-r\fP ++Ignore the escape conventions of \fBecho\fP\&. ++.TP ++\fB\-R\fP ++Emulate the BSD \fBecho\fP command, which does not process escape sequences ++unless the \fB\-e\fP flag is given\&. The \fB\-n\fP flag suppresses the trailing ++newline\&. Only the \fB\-e\fP and \fB\-n\fP flags are recognized after ++\fB\-R\fP; all other arguments and options are printed\&. ++.TP ++\fB\-s\fP ++Place the results in the history list instead of on the standard output\&. ++Each argument to the \fBprint\fP command is treated as a single word in the ++history, regardless of its content\&. ++.TP ++\fB\-S\fP ++Place the results in the history list instead of on the standard output\&. ++In this case only a single argument is allowed; it will be split into ++words as if it were a full shell command line\&. The effect is ++similar to reading the line from a history file with the ++\fBHIST_LEX_WORDS\fP option active\&. ++.TP ++\fB\-u\fP \fIn\fP ++Print the arguments to file descriptor \fIn\fP\&. ++.TP ++\fB\-z\fP ++Push the arguments onto the editing buffer stack, separated by spaces\&. ++.PP ++If any of `\fB\-m\fP\&', `\fB\-o\fP' or `\fB\-O\fP' are used in combination with ++`\fB\-f\fP\&' and there are no arguments (after the removal process in the ++case of `\fB\-m\fP\&') then nothing is printed\&. ++.RE ++.TP ++\fBprintf\fP \fIformat\fP [ \fIarg\fP \&.\&.\&. ] ++Print the arguments according to the format specification\&. Formatting ++rules are the same as used in C\&. The same escape sequences as for \fBecho\fP ++are recognised in the format\&. All C conversion specifications ending in ++one of csdiouxXeEfgGn are handled\&. In addition to this, `\fB%b\fP\&' can be ++used instead of `\fB%s\fP\&' to cause escape sequences in the argument to be ++recognised and `\fB%q\fP\&' can be used to quote the argument in such a way ++that allows it to be reused as shell input\&. With the numeric format ++specifiers, if the corresponding argument starts with a quote character, ++the numeric value of the following character is used as the number to ++print otherwise the argument is evaluated as an arithmetic expression\&. See ++the section `Arithmetic Evaluation\&' in \fIzshmisc\fP(1) ++for a description of arithmetic ++expressions\&. With `\fB%n\fP\&', the corresponding argument is taken as an ++identifier which is created as an integer parameter\&. ++.RS ++.PP ++Normally, conversion specifications are applied to each argument in order ++but they can explicitly specify the \fIn\fPth argument is to be used by ++replacing `\fB%\fP\&' by `\fB%\fP\fIn\fP\fB$\fP' and `\fB*\fP' by `\fB*\fP\fIn\fP\fB$\fP'\&. ++It is recommended that you do not mix references of this explicit style ++with the normal style and the handling of such mixed styles may be subject ++to future change\&. ++.PP ++If arguments remain unused after formatting, the format string is reused ++until all arguments have been consumed\&. With the \fBprint\fP builtin, this ++can be suppressed by using the \fB\-r\fP option\&. If more arguments are ++required by the format than have been specified, the behaviour is as if ++zero or an empty string had been specified as the argument\&. ++.RE ++.TP ++.PD 0 ++\fBpushd\fP [ \fB\-qsLP\fP ] [ \fIarg\fP ] ++.TP ++.PD 0 ++\fBpushd\fP [ \fB\-qsLP\fP ] \fIold\fP \fInew\fP ++.TP ++.PD ++\fBpushd\fP [ \fB\-qsLP\fP ] {\fB+\fP|\fB\-\fP}\fIn\fP ++Change the current directory, and push the old current directory ++onto the directory stack\&. In the first form, change the ++current directory to \fIarg\fP\&. ++If \fIarg\fP is not specified, change to the second directory ++on the stack (that is, exchange the top two entries), or ++change to \fB$HOME\fP if the \fBPUSHD_TO_HOME\fP ++option is set or if there is only one entry on the stack\&. ++Otherwise, \fIarg\fP is interpreted as it would be by \fBcd\fP\&. ++The meaning of \fIold\fP and \fInew\fP in the second form is also ++the same as for \fBcd\fP\&. ++.RS ++.PP ++The third form of \fBpushd\fP changes directory by rotating the ++directory list\&. An argument of the form `\fB+\fP\fIn\fP\&' identifies a stack ++entry by counting from the left of the list shown by the \fBdirs\fP ++command, starting with zero\&. An argument of the form `\fB\-\fP\fIn\fP\&' counts ++from the right\&. If the \fBPUSHD_MINUS\fP option is set, the meanings ++of `\fB+\fP\&' and `\fB\-\fP' in this context are swapped\&. ++.PP ++If the \fB\-q\fP (quiet) option is specified, the hook function \fBchpwd\fP ++and the functions in the array \fB$chpwd_functions\fP are not called, ++and the new directory stack is not printed\&. This is useful for calls to ++\fBpushd\fP that do not change the environment seen by an interactive user\&. ++.PP ++If the option \fB\-q\fP is not specified and the shell option \fBPUSHD_SILENT\fP ++is not set, the directory stack will be printed after a \fBpushd\fP is ++performed\&. ++.PP ++The options \fB\-s\fP, \fB\-L\fP and \fB\-P\fP have the same meanings as for the ++\fBcd\fP builtin\&. ++.RE ++.TP ++\fBpushln\fP [ \fIarg\fP \&.\&.\&. ] ++Equivalent to \fBprint \-nz\fP\&. ++.TP ++\fBpwd\fP [ \fB\-rLP\fP ] ++Print the absolute pathname of the current working directory\&. ++If the \fB\-r\fP or the \fB\-P\fP flag is specified, or the \fBCHASE_LINKS\fP ++option is set and the \fB\-L\fP flag is not given, the printed path will not ++contain symbolic links\&. ++.TP ++\fBr\fP ++Same as \fBfc \-e \-\fP\&. ++.TP ++.PD 0 ++\fBread\fP [ \fB\-rszpqAclneE\fP ] [ \fB\-t\fP [ \fInum\fP ] ] [ \fB\-k\fP [ \fInum\fP ] ] [ \fB\-d\fP \fIdelim\fP ] ++.TP ++.PD ++ [ \fB\-u\fP \fIn\fP ] [ \fIname\fP[\fB?\fP\fIprompt\fP] ] [ \fIname\fP \&.\&.\&. ] ++Read one line and break it into fields using the characters ++in \fB$IFS\fP as separators, except as noted below\&. ++The first field is assigned to the first \fIname\fP, the second field ++to the second \fIname\fP, etc\&., with leftover ++fields assigned to the last \fIname\fP\&. ++If \fIname\fP is omitted then ++\fBREPLY\fP is used for scalars and \fBreply\fP for arrays\&. ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-r\fP ++Raw mode: a `\fB\e\fP\&' at the end of a line does not signify line ++continuation and backslashes in the line don\&'t quote the following ++character and are not removed\&. ++.TP ++\fB\-s\fP ++Don\&'t echo back characters if reading from the terminal\&. Currently does ++not work with the \fB\-q\fP option\&. ++.TP ++\fB\-q\fP ++Read only one character from the terminal and set \fIname\fP to ++`\fBy\fP\&' if this character was `\fBy\fP' or `\fBY\fP' and to `\fBn\fP' otherwise\&. ++With this flag set the return status is zero only if the character was ++`\fBy\fP\&' or `\fBY\fP'\&. This option may be used with a timeout; if ++the read times out, or encounters end of file, status 2 is returned\&. ++Input is read from the terminal unless one of \fB\-u\fP ++or \fB\-p\fP is present\&. This option may also be used within zle widgets\&. ++.TP ++\fB\-k\fP [ \fInum\fP ] ++Read only one (or \fInum\fP) characters\&. All are assigned to the first ++\fIname\fP, without word splitting\&. This flag is ignored when \fB\-q\fP is ++present\&. Input is read from the terminal unless one of \fB\-u\fP or \fB\-p\fP ++is present\&. This option may also be used within zle widgets\&. ++.RS ++.PP ++Note that despite the mnemonic `key\&' this option does read full ++characters, which may consist of multiple bytes if the option ++\fBMULTIBYTE\fP is set\&. ++.RE ++.TP ++\fB\-z\fP ++Read one entry from the editor buffer stack and assign it to the first ++\fIname\fP, without word splitting\&. Text is pushed onto the stack with ++`\fBprint \-z\fP\&' or with \fBpush\-line\fP from the line editor (see ++\fIzshzle\fP(1))\&. This flag is ignored when the \fB\-k\fP or \fB\-q\fP flags are present\&. ++.TP ++.PD 0 ++\fB\-e\fP ++.TP ++.PD ++\fB\-E\fP ++The input read is printed (echoed) to the standard output\&. If the \fB\-e\fP ++flag is used, no input is assigned to the parameters\&. ++.TP ++\fB\-A\fP ++The first \fIname\fP is taken as the name of an array and all words are ++assigned to it\&. ++.TP ++.PD 0 ++\fB\-c\fP ++.TP ++.PD ++\fB\-l\fP ++These flags are allowed only if called inside a ++function used for completion (specified with the \fB\-K\fP flag to ++\fBcompctl\fP)\&. If the \fB\-c\fP flag is given, the words of the ++current command are read\&. If the \fB\-l\fP flag is given, the whole ++line is assigned as a scalar\&. If both flags are present, \fB\-l\fP ++is used and \fB\-c\fP is ignored\&. ++.TP ++\fB\-n\fP ++Together with \fB\-c\fP, the number of the word the cursor is on is ++read\&. With \fB\-l\fP, the index of the character the cursor is on is ++read\&. Note that the command name is word number 1, not word 0, ++and that when the cursor is at the end of the line, its character ++index is the length of the line plus one\&. ++.TP ++\fB\-u\fP \fIn\fP ++Input is read from file descriptor \fIn\fP\&. ++.TP ++\fB\-p\fP ++Input is read from the coprocess\&. ++.TP ++\fB\-d\fP \fIdelim\fP ++Input is terminated by the first character of \fIdelim\fP instead of ++by newline\&. ++.TP ++\fB\-t\fP [ \fInum\fP ] ++Test if input is available before attempting to read\&. If \fInum\fP ++is present, it must begin with a digit and will be evaluated ++to give a number of seconds, which may be a floating point number; ++in this case the read times out if input is not available within this ++time\&. If \fInum\fP is not present, it is taken to be zero, so that ++\fBread\fP returns immediately if no input is available\&. ++If no input is available, return status 1 and do not set any variables\&. ++ ++This option is not available when reading from the editor buffer with ++\fB\-z\fP, when called from within completion with \fB\-c\fP or \fB\-l\fP, with ++\fB\-q\fP which clears the input queue before reading, or within zle where ++other mechanisms should be used to test for input\&. ++ ++Note that read does not attempt to alter the input processing mode\&. The ++default mode is canonical input, in which an entire line is read at a time, ++so usually `\fBread \-t\fP\&' will not read anything until an entire line has ++been typed\&. However, when reading from the terminal with \fB\-k\fP ++input is processed one key at a time; in this case, only availability of ++the first character is tested, so that e\&.g\&. `\fBread \-t \-k 2\fP\&' can still ++block on the second character\&. Use two instances of `\fBread \-t \-k\fP\&' if ++this is not what is wanted\&. ++.PP ++If the first argument contains a `\fB?\fP\&', the remainder of this ++word is used as a \fIprompt\fP on standard error when the shell ++is interactive\&. ++.PP ++The value (exit status) of \fBread\fP is 1 when an end\-of\-file is ++encountered, or when \fB\-c\fP or \fB\-l\fP is present and the command is ++not called from a \fBcompctl\fP function, or as described for \fB\-q\fP\&. ++Otherwise the value is 0\&. ++.PP ++The behavior of some combinations of the \fB\-k\fP, \fB\-p\fP, \fB\-q\fP, \fB\-u\fP ++and \fB\-z\fP flags is undefined\&. Presently \fB\-q\fP cancels all the others, ++\fB\-p\fP cancels \fB\-u\fP, \fB\-k\fP cancels \fB\-z\fP, and otherwise \fB\-z\fP ++cancels both \fB\-p\fP and \fB\-u\fP\&. ++.PP ++The \fB\-c\fP or \fB\-l\fP flags cancel any and all of \fB\-kpquz\fP\&. ++.RE ++.TP ++\fBreadonly\fP ++Same as \fBtypeset \-r\fP\&. ++.TP ++\fBrehash\fP ++Same as \fBhash \-r\fP\&. ++.TP ++\fBreturn\fP [ \fIn\fP ] ++Causes a shell function or `\fB\&.\fP\&' script to return to ++the invoking script with the return status specified by \fIn\fP\&. If \fIn\fP ++is omitted, the return status is that of the last command ++executed\&. ++.RS ++.PP ++If \fBreturn\fP was executed from a trap in a \fBTRAP\fP\fINAL\fP function, ++the effect is different for zero and non\-zero return status\&. With zero ++status (or after an implicit return at the end of the trap), the shell ++will return to whatever it was previously processing; with a non\-zero ++status, the shell will behave as interrupted except that the return ++status of the trap is retained\&. Note that the numeric value of the signal ++which caused the trap is passed as the first argument, so the statement ++`\fBreturn $((128+$1))\fP\&' will return the same status as if the signal ++had not been trapped\&. ++.RE ++.TP ++\fBsched\fP ++See the section `The zsh/sched Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBset\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP [ \fIoption_name\fP ] ] \&.\&.\&. [ {\fB+\fP|\fB\-\fP}\fBA\fP [ \fIname\fP ] ] [ \fIarg\fP \&.\&.\&. ] ++Set the options for the shell and/or set the positional parameters, or ++declare and set an array\&. If the \fB\-s\fP option is given, it causes the ++specified arguments to be sorted before assigning them to the positional ++parameters (or to the array \fIname\fP if \fB\-A\fP is used)\&. With \fB+s\fP ++sort arguments in descending order\&. For the meaning of the other flags, see ++\fIzshoptions\fP(1)\&. Flags may be specified by name using the \fB\-o\fP option\&. If no option ++name is supplied with \fB\-o\fP, the current option states are printed: see ++the description of \fBsetopt\fP below for more information on the format\&. ++With \fB+o\fP they are printed in a form that can be used as input ++to the shell\&. ++.RS ++.PP ++If the \fB\-A\fP flag is specified, \fIname\fP is set to an array containing ++the given \fIarg\fPs; if no \fIname\fP is specified, all arrays are printed ++together with their values\&. ++.PP ++If \fB+A\fP is used and \fIname\fP is an array, the ++given arguments will replace the initial elements of that array; if no ++\fIname\fP is specified, all arrays are printed without their values\&. ++.PP ++The behaviour of arguments after \fB\-A\fP \fIname\fP or \fB+A\fP \fIname\fP ++depends on whether the option \fBKSH_ARRAYS\fP is set\&. If it is not set, all ++arguments following \fIname\fP are treated as values for the array, ++regardless of their form\&. If the option is set, normal option processing ++continues at that point; only regular arguments are treated as values for ++the array\&. This means that ++.PP ++.RS ++.nf ++\fBset \-A array \-x \-\- foo\fP ++.fi ++.RE ++.PP ++sets \fBarray\fP to `\fB\-x \-\fP\fB\- foo\fP\&' if \fBKSH_ARRAYS\fP is not set, but sets ++the array to \fBfoo\fP and turns on the option `\fB\-x\fP\&' if it is set\&. ++.PP ++If the \fB\-A\fP flag is not present, but there are arguments beyond the ++options, the positional parameters are set\&. If the option list (if any) ++is terminated by `\fB\-\fP\fB\-\fP\&', and there are no further arguments, the ++positional parameters will be unset\&. ++.PP ++If no arguments and no `\fB\-\fP\fB\-\fP\&' are given, then the names and values of ++all parameters are printed on the standard output\&. If the only argument is ++`\fB+\fP\&', the names of all parameters are printed\&. ++.PP ++For historical reasons, `\fBset \-\fP\&' is treated as `\fBset +xv\fP' ++and `\fBset \-\fP \fIargs\fP\&' as `\fBset +xv \-\-\fP \fIargs\fP' when in ++any other emulation mode than zsh\&'s native mode\&. ++.RE ++.TP ++\fBsetcap\fP ++See the section `The zsh/cap Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBsetopt\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP \fIoption_name\fP ] [ \fIname\fP \&.\&.\&. ] ++Set the options for the shell\&. All options specified either ++with flags or by name are set\&. ++.RS ++.PP ++If no arguments are supplied, the names of all options currently set are ++printed\&. The form is chosen so as to minimize the differences from the ++default options for the current emulation (the default emulation being ++native \fBzsh\fP, shown as \fB\fP in ++\fIzshoptions\fP(1))\&. ++Options that are on by default for the emulation are ++shown with the prefix \fBno\fP only if they are off, while other options are ++shown without the prefix \fBno\fP and only if they are on\&. In addition to ++options changed from the default state by the user, any options activated ++automatically by the shell (for example, \fBSHIN_STDIN\fP or \fBINTERACTIVE\fP) ++will be shown in the list\&. The format is further modified by the option ++\fBKSH_OPTION_PRINT\fP, however the rationale for choosing options with ++or without the \fBno\fP prefix remains the same in this case\&. ++.PP ++If the \fB\-m\fP flag is given the arguments are taken as patterns ++(which should be quoted to protect them from filename expansion), and all ++options with names matching these patterns are set\&. ++.RE ++.TP ++\fBshift\fP [ \fIn\fP ] [ \fIname\fP \&.\&.\&. ] ++The positional parameters \fB${\fP\fIn\fP+1\fB}\fP \&.\&.\&. are renamed ++to \fB$1\fP \&.\&.\&., where \fIn\fP is an arithmetic expression that ++defaults to 1\&. ++If any \fIname\fPs are given then the arrays with these names are ++shifted instead of the positional parameters\&. ++.TP ++\fBsource\fP \fIfile\fP [ \fIarg\fP \&.\&.\&. ] ++Same as `\fB\&.\fP\&', except that the current directory is always searched and ++is always searched first, before directories in \fB$path\fP\&. ++.TP ++\fBstat\fP ++See the section `The zsh/stat Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBsuspend\fP [ \fB\-f\fP ] ++Suspend the execution of the shell (send it a \fBSIGTSTP\fP) ++until it receives a \fBSIGCONT\fP\&. ++Unless the \fB\-f\fP option is given, this will refuse to suspend a login shell\&. ++.TP ++.PD 0 ++\fBtest\fP [ \fIarg\fP \&.\&.\&. ] ++.TP ++.PD ++\fB[\fP [ \fIarg\fP \&.\&.\&. ] \fB]\fP ++Like the system version of \fBtest\fP\&. Added for compatibility; ++use conditional expressions instead (see the section `Conditional Expressions\&')\&. ++The main differences between the conditional expression syntax and the ++\fBtest\fP and \fB[\fP builtins are: these commands are not handled ++syntactically, so for example an empty variable expansion may cause an ++argument to be omitted; syntax errors cause status 2 to be returned instead ++of a shell error; and arithmetic operators expect integer arguments rather ++than arithmetic expressions\&. ++.RS ++.PP ++The command attempts to implement POSIX and its extensions where these ++are specified\&. Unfortunately there are intrinsic ambiguities in ++the syntax; in particular there is no distinction between test operators ++and strings that resemble them\&. The standard attempts to resolve these ++for small numbers of arguments (up to four); for five or more arguments ++compatibility cannot be relied on\&. Users are urged wherever possible to ++use the `\fB[[\fP\&' test syntax which does not have these ambiguities\&. ++.RE ++.TP ++\fBtimes\fP ++Print the accumulated user and system times for the shell ++and for processes run from the shell\&. ++.TP ++\fBtrap\fP [ \fIarg\fP ] [ \fIsig\fP \&.\&.\&. ] ++\fIarg\fP 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 any of the signals specified by one or more \fIsig\fP args\&. ++Each \fIsig\fP can be given as a number, ++or as the name of a signal either with or without the string \fBSIG\fP ++in front (e\&.g\&. 1, HUP, and SIGHUP are all the same signal)\&. ++.RS ++.PP ++If \fIarg\fP is `\fB\-\fP\&', then the specified signals are reset to their ++defaults, or, if no \fIsig\fP args are present, all traps are reset\&. ++.PP ++If \fIarg\fP is an empty string, then the specified signals ++are ignored by the shell (and by the commands it invokes)\&. ++.PP ++If \fIarg\fP is omitted but one or more \fIsig\fP args are provided (i\&.e\&. ++the first argument is a valid signal number or name), the effect is the ++same as if \fIarg\fP had been specified as `\fB\-\fP\&'\&. ++.PP ++The \fBtrap\fP command with no arguments prints a list of commands ++associated with each signal\&. ++.PP ++If \fIsig\fP is \fBZERR\fP then \fIarg\fP will be executed ++after each command with a nonzero exit status\&. \fBERR\fP is an alias ++for \fBZERR\fP on systems that have no \fBSIGERR\fP signal (this is the ++usual case)\&. ++.PP ++If \fIsig\fP is \fBDEBUG\fP then \fIarg\fP will be executed ++before each command if the option \fBDEBUG_BEFORE_CMD\fP is set ++(as it is by default), else after each command\&. Here, a `command\&' is ++what is described as a `sublist\&' in the shell grammar, see ++the section SIMPLE COMMANDS & PIPELINES in \fIzshmisc\fP(1)\&. ++If \fBDEBUG_BEFORE_CMD\fP is set various additional features are available\&. ++First, it is possible to skip the next command by setting the option ++\fBERR_EXIT\fP; see the description of the \fBERR_EXIT\fP option in ++\fIzshoptions\fP(1)\&. Also, the shell parameter ++\fBZSH_DEBUG_CMD\fP is set to the string corresponding to the command ++to be executed following the trap\&. Note that this string is reconstructed ++from the internal format and may not be formatted the same way as the ++original text\&. The parameter is unset after the trap is executed\&. ++.PP ++If \fIsig\fP is \fB0\fP or \fBEXIT\fP ++and the \fBtrap\fP statement is executed inside the body of a function, ++then the command \fIarg\fP is executed after the function completes\&. ++The value of \fB$?\fP at the start of execution is the exit status of the ++shell or the return status of the function exiting\&. ++If \fIsig\fP is \fB0\fP or \fBEXIT\fP ++and the \fBtrap\fP statement is not executed inside the body of a function, ++then the command \fIarg\fP is executed when the shell terminates; the ++trap runs before any \fBzshexit\fP hook functions\&. ++.PP ++\fBZERR\fP, \fBDEBUG\fP, and \fBEXIT\fP traps are not executed inside other ++traps\&. \fBZERR\fP and \fBDEBUG\fP traps are kept within subshells, while ++other traps are reset\&. ++.PP ++Note that traps defined with the \fBtrap\fP builtin are slightly different ++from those defined as `\fBTRAP\fP\fINAL\fP () { \&.\&.\&. }\&', 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, ++.PP ++.RS ++.nf ++\fBtrap \&'print $LINENO' DEBUG\fP ++.fi ++.RE ++.PP ++will print the line number of a command executed after it has run, while ++.PP ++.RS ++.nf ++\fBTRAPDEBUG() { print $LINENO; }\fP ++.fi ++.RE ++.PP ++will always print the number zero\&. ++.PP ++Alternative signal names are allowed as described under \fBkill\fP above\&. ++Defining a trap under either name causes any trap under an alternative ++name to be removed\&. However, it is recommended that for consistency ++users stick exclusively to one name or another\&. ++.RE ++.TP ++\fBtrue\fP [ \fIarg\fP \&.\&.\&. ] ++Do nothing and return an exit status of 0\&. ++.TP ++\fBttyctl\fP \fB\-fu\fP ++The \fB\-f\fP option freezes the tty, and \fB\-u\fP unfreezes it\&. ++When the tty is frozen, no changes made to the tty settings by ++external programs will be honored by the shell, except for changes in the ++size of the screen; the shell will ++simply reset the settings to their previous values as soon as each ++command exits or is suspended\&. Thus, \fBstty\fP and similar programs have ++no effect when the tty is frozen\&. Without options it reports whether the ++terminal is frozen or not\&. ++.TP ++\fBtype\fP [ \fB\-wfpams\fP ] \fIname\fP \&.\&.\&. ++Equivalent to \fBwhence \-v\fP\&. ++.TP ++.PD 0 ++\fBtypeset\fP [ {\fB+\fP|\fB\-\fP}\fBAEFHUafghklprtuxmz\fP ] [ \fB\-LRZi\fP [ \fIn\fP ]] [ \fIname\fP[\fB=\fP\fIvalue\fP] \&.\&.\&. ] ++.TP ++.PD ++\fBtypeset\fP \-T [ {\fB+|\fB\-\fP\fP}\fBUrux\fP ] [ \fB\-LRZ\fP [ \fIn\fP ]] \fISCALAR\fP[\fB=\fP\fIvalue\fP] \fIarray\fP \fB[\fP \fIsep\fP \fB]\fP ++Set or display attributes and values for shell parameters\&. ++.RS ++.PP ++A parameter is created for each \fIname\fP that does not already refer ++to one\&. When inside a function, a new parameter is created for every ++\fIname\fP (even those that already exist), and is unset again when the ++function completes\&. See ++`Local Parameters\&' in \fIzshparam\fP(1)\&. The same rules apply to special shell parameters, which ++retain their special attributes when made local\&. ++.PP ++For each \fIname\fP\fB=\fP\fIvalue\fP assignment, the parameter ++\fIname\fP is set to \fIvalue\fP\&. Note that arrays currently cannot be ++assigned in \fBtypeset\fP expressions, only scalars and integers\&. Unless ++the option \fBKSH_TYPESET\fP is set, normal expansion rules apply to ++assignment arguments, so \fIvalue\fP may be split into separate words; if ++the option is set, assignments which can be recognised when expansion is ++performed are treated as single words\&. For example the command ++\fBtypeset vbl=$(echo one two)\fP is treated as having one argument if ++\fBKSH_TYPESET\fP is set, but otherwise is treated as having the two arguments ++\fBvbl=one\fP and \fBtwo\fP\&. ++.PP ++If the shell option \fBTYPESET_SILENT\fP is not set, for each remaining ++\fIname\fP that refers to a parameter that is set, the name and value of the ++parameter are printed in the form of an assignment\&. Nothing is printed for ++newly\-created parameters, or when any attribute flags listed below are ++given along with the \fIname\fP\&. Using `\fB+\fP\&' instead of minus to ++introduce an attribute turns it off\&. ++.PP ++If the \fB\-p\fP option is given, parameters and values are printed in the ++form of a typeset command and an assignment (which will be printed ++separately for arrays and associative arrays), regardless of other flags ++and options\&. Note that the \fB\-h\fP flag on parameters is respected; no ++value will be shown for these parameters\&. ++.PP ++If the \fB\-T\fP option is given, two or three arguments must be present (an ++exception is that zero arguments are allowed to show the list of parameters ++created in this fashion)\&. The first two are the name of a scalar and an ++array parameter (in that order) that will be tied together in the manner of ++\fB$PATH\fP and \fB$path\fP\&. The optional third argument is a single\-character ++separator which will be used to join the elements of the array to form the ++scalar; if absent, a colon is used, as with \fB$PATH\fP\&. Only the first ++character of the separator is significant; any remaining characters are ++ignored\&. Only the scalar parameter may be assigned 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 ++of them with another \fBtypeset\fP command; \fB+T\fP does not work, assigning ++an array to \fISCALAR\fP is an error, and assigning a scalar to \fIarray\fP ++sets it to be a single\-element array\&. Note that both `\fBtypeset \-xT \&.\&.\&.\fP\&' ++and `\fBexport \-T \&.\&.\&.\fP\&' work, but only the scalar will be marked for ++export\&. Setting the value using the scalar version causes a split on all ++separators (which cannot be quoted)\&. ++.PP ++The \fB\-g\fP (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 \fB+g\fP ++have any effect except in combination with \fB\-m\fP (see below)\&. ++.PP ++If no \fIname\fP 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 `\fB+\fP\&' ++rather than `\fB\-\fP\&' to introduce the flag suppresses printing of the values ++of parameters when there is no parameter name\&. Also, if the last option ++is the word `\fB+\fP\&', then names are printed but values are not\&. ++.PP ++If the \fB\-m\fP flag is given the \fIname\fP arguments are taken as patterns ++(which should be quoted)\&. With no attribute flags, all parameters (or ++functions with the \fB\-f\fP flag) with matching names are printed (the shell ++option \fBTYPESET_SILENT\fP is not used in this case)\&. Note that \fB\-m\fP is ++ignored if no patterns are given\&. If the \fB+g\fP flag is combined with ++\fB\-m\fP, a new local parameter is created for every matching parameter that ++is not already local\&. Otherwise \fB\-m\fP applies all other flags or ++assignments to the existing parameters\&. Except when assignments are made ++with \fIname\fP\fB=\fP\fIvalue\fP, using \fB+m\fP forces the matching parameters ++to be printed, even inside a function\&. ++.PP ++If no attribute flags are given and either no \fB\-m\fP flag is present or ++the \fB+m\fP form was used, each parameter name printed is preceded by a ++list of the attributes of that parameter (\fBarray\fP, \fBassociation\fP, ++\fBexported\fP, \fBinteger\fP, \fBreadonly\fP)\&. If \fB+m\fP is used with attribute ++flags, and all those flags are introduced with \fB+\fP, the matching ++parameter names are printed but their values are not\&. ++.PP ++Attribute flags that transform the final value (\fB\-L\fP, \fB\-R\fP, \fB\-Z\fP, ++\fB\-l\fP, \fBu\fP) are only applied to the expanded value at the point ++of a parameter expansion expression using `\fB$\fP\&'\&. They are not applied ++when a parameter is retrieved internally by the shell for any purpose\&. ++.PP ++The following attribute flags may be specified: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-A\fP ++The names refer to associative array parameters; see ++`Array Parameters\&' in \fIzshparam\fP(1)\&. ++.TP ++\fB\-L\fP ++Left justify and remove leading blanks from \fIvalue\fP\&. ++If \fIn\fP is nonzero, it defines the width of the field\&. ++If \fIn\fP is zero, the width is determined by the width of the value of ++the first assignment\&. In the case of numeric parameters, the length of the ++complete value assigned to the parameter is used to determine the width, ++not the value that would be output\&. ++.RS ++.PP ++The width is the count of characters, which may be multibyte characters ++if the \fBMULTIBYTE\fP option is in effect\&. Note that the screen ++width of the character is not taken into account; if this is required, ++use padding with parameter expansion flags ++\fB${(ml\fP\fI\&.\&.\&.\fP\fB)\fP\fI\&.\&.\&.\fP\fB}\fP as described in ++`Parameter Expansion Flags\&' in ++\fIzshexpn\fP(1)\&. ++.PP ++When the parameter is expanded, it is filled on the right with ++blanks or truncated if necessary to fit the field\&. ++Note truncation can lead to unexpected results with numeric parameters\&. ++Leading zeros are removed if the \fB\-Z\fP flag is also set\&. ++.RE ++.TP ++\fB\-R\fP ++Similar to \fB\-L\fP, except that right justification is used; ++when the parameter is expanded, the field is left filled with ++blanks or truncated from the end\&. May not be combined with the \fB\-Z\fP ++flag\&. ++.TP ++\fB\-U\fP ++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 \fBPATH\fP or \fBFIGNORE\fP, etc\&. ++This flag has a different meaning when used with \fB\-f\fP; see below\&. ++.TP ++\fB\-Z\fP ++Specially handled if set along with the \fB\-L\fP flag\&. ++Otherwise, similar to \fB\-R\fP, except that leading zeros are used for ++padding instead of blanks if the first non\-blank character is a digit\&. ++Numeric parameters are specially handled: they are always eligible ++for padding with zeroes, and the zeroes are inserted at an appropriate ++place in the output\&. ++.TP ++\fB\-a\fP ++The names refer to array parameters\&. An array parameter may be ++created this way, but it may not be assigned to in the \fBtypeset\fP ++statement\&. When displaying, both normal and associative arrays are ++shown\&. ++.TP ++\fB\-f\fP ++The names refer to functions rather than parameters\&. No assignments ++can be made, and the only other valid flags are \fB\-t\fP, \fB\-k\fP, \fB\-u\fP, ++\fB\-U\fP and \fB\-z\fP\&. The flag \fB\-t\fP turns on execution tracing for this ++function\&. The \fB\-u\fP and \fB\-U\fP flags cause the function to be ++marked for autoloading; \fB\-U\fP also causes alias expansion to be ++suppressed when the function is loaded\&. The \fBfpath\fP parameter ++will be searched to find the function definition when the function ++is first referenced; see the section `Functions\&'\&. The \fB\-k\fP and \fB\-z\fP flags ++make the function be loaded using ksh\-style or zsh\-style autoloading ++respectively\&. If neither is given, the setting of the KSH_AUTOLOAD option ++determines how the function is loaded\&. ++.TP ++\fB\-h\fP ++Hide: only useful for special parameters (those marked `\&' in the table in ++\fIzshparam\fP(1)), 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 `\fBtypeset \-h ++PATH\fP\&', a function containing `\fBtypeset PATH\fP' will create an ordinary ++local parameter without the usual behaviour of \fBPATH\fP\&. Alternatively, ++the local parameter may itself be given this attribute; hence inside a ++function `\fBtypeset \-h PATH\fP\&' creates an ordinary local parameter and the ++special \fBPATH\fP parameter is not altered in any way\&. It is also possible ++to create a local parameter using `\fBtypeset +h \fP\fIspecial\fP\&', where the ++local copy of \fIspecial\fP will retain its special properties regardless of ++having the \fB\-h\fP attribute\&. Global special parameters loaded from shell ++modules (currently those in \fBzsh/mapfile\fP and \fBzsh/parameter\fP) are ++automatically given the \fB\-h\fP attribute to avoid name clashes\&. ++.TP ++\fB\-H\fP ++Hide value: specifies that \fBtypeset\fP will not display the value of the ++parameter when listing parameters; the display for such parameters is ++always as if the `\fB+\fP\&' flag had been given\&. Use of the parameter is ++in other respects normal, and the option does not apply if the parameter is ++specified by name, or by pattern with the \fB\-m\fP option\&. This is on by ++default for the parameters in the \fBzsh/parameter\fP and \fBzsh/mapfile\fP ++modules\&. Note, however, that unlike the \fB\-h\fP flag this is also useful ++for non\-special parameters\&. ++.TP ++\fB\-i\fP ++Use an internal integer representation\&. If \fIn\fP is nonzero it ++defines the output arithmetic base, otherwise it is determined by the ++first assignment\&. Bases from 2 to 36 inclusive are allowed\&. ++.TP ++\fB\-E\fP ++Use an internal double\-precision floating point representation\&. On output ++the variable will be converted to scientific notation\&. If \fIn\fP is ++nonzero it defines the number of significant figures to display; the ++default is ten\&. ++.TP ++\fB\-F\fP ++Use an internal double\-precision floating point representation\&. On output ++the variable will be converted to fixed\-point decimal notation\&. If \fIn\fP ++is nonzero it defines the number of digits to display after the decimal ++point; the default is ten\&. ++.TP ++\fB\-l\fP ++Convert the result to lower case whenever the parameter is expanded\&. ++The value is \fInot\fP converted when assigned\&. ++.TP ++\fB\-r\fP ++The given \fIname\fPs are marked readonly\&. Note that if \fIname\fP is a ++special parameter, the readonly attribute can be turned on, but cannot then ++be turned off\&. ++.TP ++\fB\-t\fP ++Tags the named parameters\&. Tags have no special meaning to the shell\&. ++This flag has a different meaning when used with \fB\-f\fP; see above\&. ++.TP ++\fB\-u\fP ++Convert the result to upper case whenever the parameter is expanded\&. ++The value is \fInot\fP converted when assigned\&. ++This flag has a different meaning when used with \fB\-f\fP; see above\&. ++.TP ++\fB\-x\fP ++Mark for automatic export to the environment of subsequently ++executed commands\&. If the option \fBGLOBAL_EXPORT\fP is set, this implies ++the option \fB\-g\fP, unless \fB+g\fP is also explicitly given; in other words ++the parameter is not made local to the enclosing function\&. This is for ++compatibility with previous versions of zsh\&. ++.RE ++.TP ++\fBulimit\fP [ [ \fB\-SHacdfilmnpqstvx\fP | \fB\-N\fP \fIresource\fP [ \fIlimit\fP ] \&.\&.\&. ] ++Set or display resource limits of the shell and the processes started by ++the shell\&. The value of \fIlimit\fP can be a number in the unit specified ++below or one of the values `\fBunlimited\fP\&', which removes the limit on the ++resource, or `\fBhard\fP\&', which uses the current value of the hard limit on ++the resource\&. ++.RS ++.PP ++By default, only soft limits are manipulated\&. If the \fB\-H\fP flag ++is given use hard limits instead of soft limits\&. If the \fB\-S\fP flag is given ++together with the \fB\-H\fP flag set both hard and soft limits\&. ++.PP ++If no options are used, the file size limit (\fB\-f\fP) is assumed\&. ++.PP ++If \fIlimit\fP is omitted the current value of the specified resources are ++printed\&. When more than one resource value is printed, the limit name and ++unit is printed before each value\&. ++.PP ++When looping over multiple resources, the shell will abort immediately if ++it detects a badly formed argument\&. However, if it fails to set a limit ++for some other reason it will continue trying to set the remaining limits\&. ++.PP ++.PD 0 ++.TP ++\fB\-a\fP ++Lists all of the current resource limits\&. ++.TP ++\fB\-c\fP ++512\-byte blocks on the size of core dumps\&. ++.TP ++\fB\-d\fP ++K\-bytes on the size of the data segment\&. ++.TP ++\fB\-f\fP ++512\-byte blocks on the size of files written\&. ++.TP ++\fB\-i\fP ++The number of pending signals\&. ++.TP ++\fB\-l\fP ++K\-bytes on the size of locked\-in memory\&. ++.TP ++\fB\-m\fP ++K\-bytes on the size of physical memory\&. ++.TP ++\fB\-n\fP ++open file descriptors\&. ++.TP ++\fB\-q\fP ++Bytes in POSIX message queues\&. ++.TP ++\fB\-s\fP ++K\-bytes on the size of the stack\&. ++.TP ++\fB\-t\fP ++CPU seconds to be used\&. ++.TP ++\fB\-u\fP ++processes available to the user\&. ++.TP ++\fB\-v\fP ++K\-bytes on the size of virtual memory\&. On some systems this ++refers to the limit called `address space\&'\&. ++.TP ++\fB\-x\fP ++The number of locks on files\&. ++.PD ++.PP ++A resource may also be specified by integer in the form `\fB\-N\fP ++\fIresource\fP\&', where \fIresource\fP corresponds to the integer defined for ++the resource by the operating system\&. This may be used to set the limits ++for resources known to the shell which do not correspond to option letters\&. ++Such limits will be shown by number in the output of `\fBulimit \-a\fP\&'\&. ++.PP ++The number may alternatively be out of the range of limits compiled into ++the shell\&. The shell will try to read or write the limit anyway, and ++will report an error if this fails\&. ++.RE ++.TP ++\fBumask\fP [ \fB\-S\fP ] [ \fImask\fP ] ++The umask is set to \fImask\fP\&. \fImask\fP can be either ++an octal number or a symbolic value as described in \fIchmod\fP(1)\&. ++If \fImask\fP is omitted, the current value is printed\&. The \fB\-S\fP ++option causes the mask to be printed as a symbolic value\&. Otherwise, ++the mask is printed as an octal number\&. Note that in ++the symbolic form the permissions you specify are those which are to be ++allowed (not denied) to the users specified\&. ++.TP ++\fBunalias\fP ++Same as \fBunhash \-a\fP\&. ++.TP ++\fBunfunction\fP ++Same as \fBunhash \-f\fP\&. ++.TP ++\fBunhash\fP [ \fB\-adfms\fP ] \fIname\fP \&.\&.\&. ++Remove the element named \fIname\fP from an internal hash table\&. The ++default is remove elements from the command hash table\&. The \fB\-a\fP ++option causes \fBunhash\fP to remove regular or global aliases; note ++when removing a global aliases that the argument must be quoted to prevent ++it from being expanded before being passed to the command\&. ++The \fB\-s\fP option causes \fBunhash\fP to remove suffix aliases\&. ++The \fB\-f\fP option causes ++\fBunhash\fP to remove shell functions\&. The \fB\-d\fP options causes ++\fBunhash\fP to remove named directories\&. If the \fB\-m\fP flag is given ++the arguments are taken as patterns (should be quoted) and all elements ++of the corresponding hash table with matching names will be removed\&. ++.TP ++\fBunlimit\fP [ \fB\-hs\fP ] \fIresource\fP \&.\&.\&. ++The resource limit for each \fIresource\fP is set to the hard limit\&. ++If the \fB\-h\fP flag is given and the shell has appropriate privileges, ++the hard resource limit for each \fIresource\fP is removed\&. ++The resources of the shell process are only changed if the \fB\-s\fP ++flag is given\&. ++.RS ++.PP ++The \fBunlimit\fP command is not made available by default when the ++shell starts in a mode emulating another shell\&. It can be made available ++with the command `\fBzmodload \-F zsh/rlimits b:unlimit\fP\&'\&. ++.RE ++.TP ++\fBunset\fP [ \fB\-fmv\fP ] \fIname\fP \&.\&.\&. ++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\&. ++.RS ++.PP ++Individual elements of associative array parameters may be unset by using ++subscript syntax on \fIname\fP, which should be quoted (or the entire command ++prefixed with \fBnoglob\fP) to protect the subscript from filename generation\&. ++.PP ++If the \fB\-m\fP 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\&. ++.PP ++The \fB\-v\fP flag specifies that \fIname\fP refers to parameters\&. This is the ++default behaviour\&. ++.PP ++\fBunset \-f\fP is equivalent to \fBunfunction\fP\&. ++.RE ++.TP ++\fBunsetopt\fP [ {\fB+\fP|\fB\-\fP}\fIoptions\fP | {\fB+\fP|\fB\-\fP}\fBo\fP \fIoption_name\fP ] [ \fIname\fP \&.\&.\&. ] ++Unset the options for the shell\&. All options specified either ++with flags or by name are unset\&. If no arguments are supplied, ++the names of all options currently unset are printed\&. ++If the \fB\-m\fP 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\&. ++.TP ++\fBvared\fP ++See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. ++.TP ++\fBwait\fP [ \fIjob\fP \&.\&.\&. ] ++Wait for the specified jobs or processes\&. If \fIjob\fP is not given ++then all currently active child processes are waited for\&. ++Each \fIjob\fP can be either a job specification or the process ID ++of a job in the job table\&. ++The exit status from this command is that of the job waited for\&. ++.TP ++\fBwhence\fP [ \fB\-vcwfpams\fP ] \fIname\fP \&.\&.\&. ++For each name, indicate how it would be interpreted if used as a ++command name\&. ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-v\fP ++Produce a more verbose report\&. ++.TP ++\fB\-c\fP ++Print the results in a \fBcsh\fP\-like format\&. ++This takes precedence over \fB\-v\fP\&. ++.TP ++\fB\-w\fP ++For each \fIname\fP, print `\fIname\fP\fB:\fP \fIword\fP\&' where \fIword\fP ++is one of \fBalias\fP, \fBbuiltin\fP, \fBcommand\fP, \fBfunction\fP, ++\fBhashed\fP, \fBreserved\fP or \fBnone\fP, according as \fIname\fP ++corresponds to an alias, a built\-in command, an external command, a ++shell function, a command defined with the \fBhash\fP builtin, a ++reserved word, or is not recognised\&. This takes precedence over ++\fB\-v\fP and \fB\-c\fP\&. ++.TP ++\fB\-f\fP ++Causes the contents of a shell function to be ++displayed, which would otherwise not happen unless the \fB\-c\fP ++flag were used\&. ++.TP ++\fB\-p\fP ++Do a path search for \fIname\fP ++even if it is an alias, reserved word, shell function or builtin\&. ++.TP ++\fB\-a\fP ++Do a search for all occurrences of \fIname\fP ++throughout the command path\&. ++Normally only the first occurrence is printed\&. ++.TP ++\fB\-m\fP ++The arguments are taken as patterns (should be ++quoted), and the information is displayed for each command matching one ++of these patterns\&. ++.TP ++\fB\-s\fP ++If a pathname contains symlinks, print the symlink\-free pathname as well\&. ++.RE ++.TP ++\fBwhere\fP [ \fB\-wpms\fP ] \fIname\fP \&.\&.\&. ++Equivalent to \fBwhence \-ca\fP\&. ++.TP ++\fBwhich\fP [ \fB\-wpams\fP ] \fIname\fP \&.\&.\&. ++Equivalent to \fBwhence \-c\fP\&. ++.TP ++.PD 0 ++\fBzcompile\fP [ \fB\-U\fP ] [ \fB\-z\fP | \fB\-k\fP ] [ \fB\-R\fP | \fB\-M\fP ] \fIfile\fP [ \fIname\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fBzcompile\fP \fB\-ca\fP [ \fB\-m\fP ] [ \fB\-R\fP | \fB\-M\fP ] \fIfile\fP [ \fIname\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzcompile \-t\fP \fIfile\fP [ \fIname\fP \&.\&.\&. ] ++This builtin command can be used to compile functions or scripts, ++storing 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\&. ++.RS ++.PP ++The first form (without the \fB\-c\fP, \fB\-a\fP or \fB\-t\fP options) creates a ++compiled file\&. If only the \fIfile\fP argument is given, the ++output file has the name `\fIfile\fP\fB\&.zwc\fP\&' and will be placed in ++the same directory as the \fIfile\fP\&. The shell will load the compiled ++file instead of the normal function file when the function ++is autoloaded; see ++the section `Autoloading Functions\&' in \fIzshmisc\fP(1) ++for a description of how autoloaded functions are searched\&. The ++extension \fB\&.zwc\fP stands for `zsh word code\&'\&. ++.PP ++If there is at least one \fIname\fP argument, all the named files ++are compiled into the output \fIfile\fP given as the first argument\&. If ++\fIfile\fP does not end in \fB\&.zwc\fP, this extension is automatically ++appended\&. Files containing multiple compiled functions are called `digest\&' ++files, and are intended to be used as elements of the \fBFPATH\fP/\fBfpath\fP ++special array\&. ++.PP ++The second form, with the \fB\-c\fP or \fB\-a\fP options, writes the compiled ++definitions for all the named functions into \fIfile\fP\&. For \fB\-c\fP, 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 \fB\-a\fP option, in which case the \fBfpath\fP ++is searched and the contents of the definition files for those ++functions, if found, are compiled into \fIfile\fP\&. If both \fB\-c\fP and ++\fB\-a\fP 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 \fB\-c\fP or \fB\-a\fP option will be autoloaded as if the ++\fBKSH_AUTOLOAD\fP option were unset\&. ++.PP ++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 ++`\fBzcompile \-c\fP\&' does not include the additional functions defined in ++the file, and any other initialization code in the file is lost\&. Using ++`\fBzcompile \-a\fP\&' captures all this extra information\&. ++.PP ++If the \fB\-m\fP option is combined with \fB\-c\fP or \fB\-a\fP, ++the \fIname\fPs are used as patterns and all functions whose names ++match one of these patterns will be written\&. If no \fIname\fP is given, ++the definitions of all functions currently defined or marked as ++autoloaded will be written\&. ++.PP ++The third form, with the \fB\-t\fP option, examines an existing ++compiled file\&. Without further arguments, the names of the original ++files compiled into it are listed\&. The first line of output shows ++the version of the shell which compiled the file and how the file ++will be used (i\&.e\&. by reading it directly or by mapping it into memory)\&. ++With arguments, nothing is output and the return status is set to zero if ++definitions for \fIall\fP \fIname\fPs were found in the compiled ++file, and non\-zero if the definition for at least one \fIname\fP was not ++found\&. ++.PP ++Other options: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-U\fP ++Aliases are not expanded when compiling the \fIname\fPd files\&. ++.TP ++\fB\-R\fP ++When the compiled file is read, its contents are copied into the ++shell\&'s memory, rather than memory\-mapped (see \fB\-M\fP)\&. This ++happens automatically on systems that do not support memory mapping\&. ++.RS ++.PP ++When compiling scripts instead of autoloadable functions, it is ++often desirable to use this option; otherwise the whole file, including the ++code to define functions which have already been defined, will ++remain mapped, consequently wasting memory\&. ++.RE ++.TP ++\fB\-M\fP ++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 \fB\-R\fP nor ++\fB\-M\fP is given, the \fBzcompile\fP builtin decides what to do based ++on the size of the compiled file\&. ++.TP ++.PD 0 ++\fB\-k\fP ++.TP ++.PD ++\fB\-z\fP ++These options are used when the compiled file contains functions which ++are to be autoloaded\&. If \fB\-z\fP is given, the ++function will be autoloaded as if the \fBKSH_AUTOLOAD\fP option is ++\fInot\fP set, even if it is set at the time the compiled file is ++read, while if the \fB\-k\fP is given, the function will be loaded as if ++\fBKSH_AUTOLOAD\fP \fIis\fP set\&. These options also take precedence over ++any \fB\-k\fP or \fB\-z\fP options specified to the \fBautoload\fP builtin\&. If ++neither of these options is given, the function will be loaded as ++determined by the setting of the \fBKSH_AUTOLOAD\fP option at the time ++the compiled file is read\&. ++ ++These options may also appear as many times as necessary between the listed ++\fIname\fPs to specify the loading style of all following functions, up to ++the next \fB\-k\fP or \fB\-z\fP\&. ++ ++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)\&. ++.RE ++.TP ++\fBzformat\fP ++See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzftp\fP ++See the section `The zsh/zftp Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzle\fP ++See the section `Zle Builtins\&' in \fIzshzle\fP(1)\&. ++.TP ++.PD 0 ++\fBzmodload\fP [ \fB\-dL\fP ] [ \&.\&.\&. ] ++.TP ++.PD 0 ++\fBzmodload \-F\fP [ \fB\-lLme\fP \fB\-P\fP \fBparam\fP ] \fImodule\fP [\fB+\-\fP]\fIfeature\&.\&.\&.\fP ++.TP ++.PD 0 ++\fBzmodload \-e\fP [ \fB\-A\fP ] [ \&.\&.\&. ] ++.TP ++.PD 0 ++\fBzmodload\fP [ \fB\-a\fP [ \fB\-bcpf\fP [ \fB\-I\fP ] ] ] [ \fB\-iL\fP ] \&.\&.\&. ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-u\fP [ \fB\-abcdpf\fP [ \fB\-I\fP ] ] [ \fB\-iL\fP ] \&.\&.\&. ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-A\fP [ \fB\-L\fP ] [ \fImodalias\fP[\fB=\fP\fImodule\fP] \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-R\fP \fImodalias\fP \&.\&.\&. ++Performs operations relating to zsh\&'s loadable modules\&. ++Loading of modules while the shell is running (`dynamical loading\&') is not ++available on all operating systems, or on all installations on a particular ++operating system, although the \fBzmodload\fP command itself is always ++available and can be used to manipulate modules built into versions of the ++shell executable without dynamical loading\&. ++.RS ++.PP ++Without arguments the names of all currently loaded binary modules are ++printed\&. The \fB\-L\fP option causes this list to be in the form of a ++series of \fBzmodload\fP commands\&. Forms with arguments are: ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBzmodload\fP [ \fB\-i\fP ] \fIname\fP \&.\&.\&. ++.TP ++.PD ++\fBzmodload\fP \fB\-u\fP [ \fB\-i\fP ] \fIname\fP \&.\&.\&. ++In the simplest case, \fBzmodload\fP loads a binary module\&. The module must ++be in a file with a name consisting of the specified \fIname\fP followed by ++a standard suffix, usually `\fB\&.so\fP\&' (`\fB\&.sl\fP' on HPUX)\&. ++If the module to be loaded is already loaded the duplicate module is ++ignored\&. If \fBzmodload\fP detects an inconsistency, such as an ++invalid module name or circular dependency list, the current code block is ++aborted\&. Hence `\fBzmodload\fP \fImodule\fP \fB2>/dev/null\fP\&' is sufficient ++to test whether a module is available\&. ++If it is available, the module is loaded if necessary, while if it ++is not available, non\-zero status is silently returned\&. The option ++\fB\-i\fP is accepted for compatibility but has no effect\&. ++.RS ++.PP ++The \fIname\fPd module is searched for in the same way a command is, using ++\fB$module_path\fP instead of \fB$path\fP\&. However, the path search is ++performed even when the module name contains a `\fB/\fP\&', which it usually does\&. ++There is no way to prevent the path search\&. ++.PP ++If the module supports features (see below), \fBzmodload\fP tries to ++enable all features when loading a module\&. If the module was successfully ++loaded but not all features could be enabled, \fBzmodload\fP returns status 2\&. ++.PP ++With \fB\-u\fP, \fBzmodload\fP unloads modules\&. The same \fIname\fP ++must be given that was given when the module was loaded, but it is not ++necessary for the module to exist in the file system\&. ++The \fB\-i\fP option suppresses the error if the module is already ++unloaded (or was never loaded)\&. ++.PP ++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\&. ++.RE ++.TP ++\fBzmodload \-F\fP [ \fB\-almLe\fP \fB\-P\fP \fBparam\fP ] \fImodule\fP [\fB+\-\fP]\fIfeature\&.\&.\&.\fP ++\fBzmodload \-F\fP allows more selective control over the features provided ++by modules\&. With no options apart from \fB\-F\fP, the module named ++\fImodule\fP is loaded, if it was not already loaded, and the list of ++\fIfeature\fPs is set to the required state\&. If no ++\fIfeature\fPs are specified, the module is loaded, if it was not already ++loaded, but the state of features is unchanged\&. Each feature ++may be preceded by a \fB+\fP to turn the feature on, or \fB\-\fP to turn it ++off; the \fB+\fP is assumed if neither character is present\&. ++Any feature not explicitly mentioned is left in its current state; ++if the module was not previously loaded this means any such features will ++remain disabled\&. The return status is zero if all features were ++set, 1 if the module failed to load, and 2 if some features could ++not be set (for example, a parameter couldn\&'t be added because there ++was a different parameter of the same name) but the module was loaded\&. ++.RS ++.PP ++The standard features are builtins, conditions, parameters and math ++functions; these are indicated by the prefix `\fBb:\fP\&', `\fBc:\fP' ++(`\fBC:\fP\&' for an infix condition), `\fBp:\fP' and `\fBf:\fP', respectively, ++followed by the name that the corresponding feature would have in the ++shell\&. For example, `\fBb:strftime\fP\&' indicates a builtin named ++\fBstrftime\fP and \fBp:EPOCHSECONDS\fP indicates a parameter named ++\fBEPOCHSECONDS\fP\&. The module may provide other (`abstract\&') features of ++its own as indicated by its documentation; these have no prefix\&. ++.PP ++With \fB\-l\fP or \fB\-L\fP, features provided by the module are listed\&. With ++\fB\-l\fP alone, a list of features together with their states is shown, one ++feature per line\&. With \fB\-L\fP alone, a \fBzmodload \-F\fP command that would ++cause enabled features of the module to be turned on is shown\&. With ++\fB\-lL\fP, a \fBzmodload \-F\fP command that would cause all the features to be ++set to their current state is shown\&. If one of these combinations is given ++the option \fB\-P\fP \fIparam\fP then the parameter \fBparam\fP is set to an ++array of features, either features together with their state or (if ++\fB\-L\fP alone is given) enabled features\&. ++.PP ++With the option \fB\-L\fP the module name may be omitted; then a list ++of all enabled features for all modules providing features is printed ++in the form of \fBzmodload \-F\fP commands\&. If \fB\-l\fP is also given, ++the state of both enabled and disabled features is output in that form\&. ++.PP ++A set of features may be provided together with \fB\-l\fP or \fB\-L\fP and a ++module name; in that case only the state of those features is ++considered\&. Each feature may be preceded by \fB+\fP or \fB\-\fP but the ++character has no effect\&. If no set of features is provided, all ++features are considered\&. ++.PP ++With \fB\-e\fP, the command first tests that the module is loaded; ++if it is not, status 1 is returned\&. If the module is loaded, ++the list of features given as an argument is examined\&. Any feature ++given with no prefix is simply tested to see if the module provides it; ++any feature given with a prefix \fB+\fP or \fB\-\fP is tested to ++see if is provided and in the given state\&. If the tests on all features ++in the list succeed, status 0 is returned, else status 1\&. ++.PP ++With \fB\-m\fP, each entry in the given list of features is taken ++as a pattern to be matched against the list of features provided ++by the module\&. An initial \fB+\fP or \fB\-\fP must be given explicitly\&. ++This may not be combined with the \fB\-a\fP option as autoloads must ++be specified explicitly\&. ++.PP ++With \fB\-a\fP, the given list of features is marked for autoload from ++the specified module, which may not yet be loaded\&. An optional \fB+\fP ++may appear before the feature name\&. If the feature is prefixed with ++\fB\-\fP, any existing autoload is removed\&. The options \fB\-l\fP and \fB\-L\fP ++may be used to list autoloads\&. Autoloading is specific to individual ++features; when the module is loaded only the requested feature is ++enabled\&. Autoload requests are preserved if the module is ++subsequently unloaded until an explicit `\fBzmodload \-Fa\fP \fImodule\fP ++\fB\-\fP\fIfeature\fP\&' is issued\&. It is not an error to request an autoload ++for a feature of a module that is already loaded\&. ++.PP ++When the module is loaded each autoload is checked against the features ++actually provided by the module; if the feature is not provided the ++autoload request is deleted\&. A warning message is output; if the ++module is being loaded to provide a different feature, and that autoload ++is successful, there is no effect on the status of the current command\&. ++If the module is already loaded at the time when \fBzmodload \-Fa\fP is ++run, an error message is printed and status 1 returned\&. ++.PP ++\fBzmodload \-Fa\fP can be used with the \fB\-l\fP, \fB\-L\fP, \fB\-e\fP and ++\fB\-P\fP options for listing and testing the existence of autoloadable ++features\&. In this case \fB\-l\fP is ignored if \fB\-L\fP is specified\&. ++\fBzmodload \-FaL\fP with no module name lists autoloads for all modules\&. ++.PP ++Note that only standard features as described above can be autoloaded; ++other features require the module to be loaded before enabling\&. ++.RE ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-d\fP [ \fB\-L\fP ] [ \fIname\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-d\fP \fIname\fP \fIdep\fP \&.\&.\&. ++.TP ++.PD ++\fBzmodload\fP \fB\-ud\fP \fIname\fP [ \fIdep\fP \&.\&.\&. ] ++The \fB\-d\fP 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\&. ++.RS ++.PP ++With \fB\-d\fP and one argument, all dependencies for that module are listed\&. ++With \fB\-d\fP and no arguments, all module dependencies are listed\&. This ++listing is by default in a Makefile\-like format\&. The \fB\-L\fP option ++changes this format to a list of \fBzmodload \-d\fP commands\&. ++.PP ++If \fB\-d\fP and \fB\-u\fP are both used, dependencies are removed\&. If only one ++argument is given, all dependencies for that module are removed\&. ++.RE ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ab\fP [ \fB\-L\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ab\fP [ \fB\-i\fP ] \fIname\fP [ \fIbuiltin\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-ub\fP [ \fB\-i\fP ] \fIbuiltin\fP \&.\&.\&. ++The \fB\-ab\fP option defines autoloaded builtins\&. It defines the specified ++\fIbuiltin\fPs\&. When any of those builtins is called, the module specified ++in the first argument is loaded and all its features are enabled (for ++selective control of features use `\fBzmodload \-F \-a\fP\&' as described ++above)\&. If only the \fIname\fP is given, one builtin is defined, with ++the same name as the module\&. \fB\-i\fP suppresses the error if the builtin ++is already defined or autoloaded, but not if another builtin of the ++same name is already defined\&. ++.RS ++.PP ++With \fB\-ab\fP and no arguments, all autoloaded builtins are listed, with the ++module name (if different) shown in parentheses after the builtin name\&. ++The \fB\-L\fP option changes this format to a list of \fBzmodload \-a\fP ++commands\&. ++.PP ++If \fB\-b\fP is used together with the \fB\-u\fP option, it removes builtins ++previously defined with \fB\-ab\fP\&. This is only possible if the builtin is ++not yet loaded\&. \fB\-i\fP suppresses the error if the builtin is already ++removed (or never existed)\&. ++.PP ++Autoload requests are retained if the module is subsequently unloaded ++until an explicit `\fBzmodload \-ub\fP \fIbuiltin\fP\&' is issued\&. ++.RE ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ac\fP [ \fB\-IL\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ac\fP [ \fB\-iI\fP ] \fIname\fP [ \fIcond\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-uc\fP [ \fB\-iI\fP ] \fIcond\fP \&.\&.\&. ++The \fB\-ac\fP option is used to define autoloaded condition codes\&. The ++\fIcond\fP strings give the names of the conditions defined by the ++module\&. The optional \fB\-I\fP option is used to define infix condition ++names\&. Without this option prefix condition names are defined\&. ++.RS ++.PP ++If given no condition names, all defined names are listed (as a series of ++\fBzmodload\fP commands if the \fB\-L\fP option is given)\&. ++.PP ++The \fB\-uc\fP option removes definitions for autoloaded conditions\&. ++.RE ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ap\fP [ \fB\-L\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-ap\fP [ \fB\-i\fP ] \fIname\fP [ \fIparameter\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-up\fP [ \fB\-i\fP ] \fIparameter\fP \&.\&.\&. ++The \fB\-p\fP option is like the \fB\-b\fP and \fB\-c\fP options, but makes ++\fBzmodload\fP work on autoloaded parameters instead\&. ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-af\fP [ \fB\-L\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-af\fP [ \fB\-i\fP ] \fIname\fP [ \fIfunction\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-uf\fP [ \fB\-i\fP ] \fIfunction\fP \&.\&.\&. ++The \fB\-f\fP option is like the \fB\-b\fP, \fB\-p\fP, and \fB\-c\fP options, but ++makes \fBzmodload\fP work on autoloaded math functions instead\&. ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-a\fP [ \fB\-L\fP ] ++.TP ++.PD 0 ++\fBzmodload\fP \fB\-a\fP [ \fB\-i\fP ] \fIname\fP [ \fIbuiltin\fP \&.\&.\&. ] ++.TP ++.PD ++\fBzmodload\fP \fB\-ua\fP [ \fB\-i\fP ] \fIbuiltin\fP \&.\&.\&. ++Equivalent to \fB\-ab\fP and \fB\-ub\fP\&. ++.TP ++\fBzmodload \-e\fP [ \fB\-A\fP ] [ \fIstring\fP \&.\&.\&. ] ++The \fB\-e\fP option without arguments lists all loaded modules; if the \fB\-A\fP ++option is also given, module aliases corresponding to loaded modules are ++also shown\&. If arguments are provided, nothing is printed; ++the return status is set to zero if all \fIstring\fPs given as arguments ++are names of loaded modules and to one if at least on \fIstring\fP is not ++the name of a loaded module\&. This can be used to test for the ++availability of things implemented by modules\&. In this case, any ++aliases are automatically resolved and the \fB\-A\fP flag is not used\&. ++.TP ++\fBzmodload\fP \fB\-A\fP [ \fB\-L\fP ] [ \fImodalias\fP[\fB=\fP\fImodule\fP] \&.\&.\&. ] ++For each argument, if both \fImodalias\fP and \fImodule\fP are given, ++define \fImodalias\fP to be an alias for the module \fImodule\fP\&. ++If the module \fImodalias\fP is ever subsequently requested, either via a ++call to \fBzmodload\fP or implicitly, the shell will attempt to load ++\fImodule\fP instead\&. If \fImodule\fP is not given, show the definition of ++\fImodalias\fP\&. If no arguments are given, list all defined module aliases\&. ++When listing, if the \fB\-L\fP flag was also given, list the definition as a ++\fBzmodload\fP command to recreate the alias\&. ++.RS ++.PP ++The existence of aliases for modules is completely independent of whether ++the name resolved is actually loaded as a module: while the alias exists, ++loading and unloading the module under any alias has exactly the same ++effect as using the resolved name, and does not affect the connection ++between the alias and the resolved name which can be removed either by ++\fBzmodload \-R\fP or by redefining the alias\&. Chains of aliases (i\&.e\&. where ++the first resolved name is itself an alias) are valid so long as these are ++not circular\&. As the aliases take the same format as module names, they ++may include path separators: in this case, there is no requirement for any ++part of the path named to exist as the alias will be resolved first\&. For ++example, `\fBany/old/alias\fP\&' is always a valid alias\&. ++.PP ++Dependencies added to aliased modules are actually added to the resolved ++module; these remain if the alias is removed\&. It is valid to create an ++alias whose name is one of the standard shell modules and which resolves to ++a different module\&. However, if a module has dependencies, it ++will not be possible to use the module name as an alias as the module will ++already be marked as a loadable module in its own right\&. ++.PP ++Apart from the above, aliases can be used in the \fBzmodload\fP command ++anywhere module names are required\&. However, aliases will not be ++shown in lists of loaded modules with a bare `\fBzmodload\fP\&'\&. ++.RE ++.TP ++\fBzmodload\fP \fB\-R\fP \fImodalias\fP \&.\&.\&. ++For each \fImodalias\fP argument that was previously defined as a module ++alias via \fBzmodload \-A\fP, delete the alias\&. If any was not defined, an ++error is caused and the remainder of the line is ignored\&. ++.PP ++Note that \fBzsh\fP 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\&. ++.RE ++.TP ++\fBzparseopts\fP ++See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzprof\fP ++See the section `The zsh/zprof Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzpty\fP ++See the section `The zsh/zpty Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzregexparse\fP ++See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzsocket\fP ++See the section `The zsh/net/socket Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBzstyle\fP ++See the section `The zsh/zutil Module\&' in \fIzshmodules\fP(1)\&. ++.TP ++\fBztcp\fP ++See the section `The zsh/net/tcp Module\&' in \fIzshmodules\fP(1)\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshexpn.1 +@@ -0,0 +1,2701 @@ ++.TH "ZSHEXPN" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshexpn \- zsh expansion and substitution ++.\" Yodl file: Zsh/expn.yo ++.SH "DESCRIPTION" ++The following types of expansions are performed in the indicated order in ++five steps: ++.PP ++.PD 0 ++.TP ++.PD ++\fIHistory Expansion\fP ++This is performed only in interactive shells\&. ++.TP ++\fIAlias Expansion\fP ++Aliases are expanded immediately before the command line is parsed as ++explained ++under Aliasing in \fIzshmisc\fP(1)\&. ++.TP ++.PD 0 ++\fIProcess Substitution\fP ++.TP ++.PD 0 ++\fIParameter Expansion\fP ++.TP ++.PD 0 ++\fICommand Substitution\fP ++.TP ++.PD 0 ++\fIArithmetic Expansion\fP ++.TP ++.PD ++\fIBrace Expansion\fP ++These five are performed in one step in left\-to\-right fashion\&. After ++these expansions, all unquoted occurrences of the characters `\fB\e\fP\&', ++`\fB\&'\fP' and `\fB"\fP' are removed\&. ++.TP ++\fIFilename Expansion\fP ++If the \fBSH_FILE_EXPANSION\fP option is set, the order of expansion is ++modified for compatibility with \fBsh\fP and \fBksh\fP\&. In that case ++\fIfilename expansion\fP is performed immediately after \fIalias expansion\fP, ++preceding the set of five expansions mentioned above\&. ++.TP ++\fIFilename Generation\fP ++This expansion, commonly referred to as \fBglobbing\fP, is always done last\&. ++.PP ++The following sections explain the types of expansion in detail\&. ++.PP ++.SH "HISTORY EXPANSION" ++History expansion allows you to use words from previous command ++lines in the command line you are typing\&. This simplifies spelling ++corrections and the repetition of complicated commands or arguments\&. ++Immediately before execution, each command is saved in the history list, ++the size of which is controlled by the \fBHISTSIZE\fP parameter\&. The one ++most recent command is always retained in any case\&. Each saved command in ++the history list is called a history \fIevent\fP and is assigned a number, ++beginning with 1 (one) when the shell starts up\&. The history number that ++you may see in your prompt (see ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1)) is the number that is to be assigned to the \fInext\fP command\&. ++.PP ++.SS "Overview" ++A history expansion begins with the first character of the \fBhistchars\fP ++parameter, which is `\fB!\fP\&' by default, and may occur anywhere on the ++command line; history expansions do not nest\&. The `\fB!\fP\&' can be escaped ++with `\fB\e\fP\&' or can be enclosed between a pair of single quotes (\fB''\fP) ++to suppress its special meaning\&. Double quotes will \fInot\fP work for ++this\&. Following this history character is an optional event designator ++(see the section `Event Designators\&') and then an optional word ++designator (the section `Word Designators\&'); if neither of these designators is ++present, no history expansion occurs\&. ++.PP ++Input lines containing history expansions are echoed after being expanded, ++but before any other expansions take place and before the command is ++executed\&. It is this expanded form that is recorded as the history event ++for later references\&. ++.PP ++By default, a history reference with no event designator refers to the ++same event as any preceding history reference on that command line; if it ++is the only history reference in a command, it refers to the previous ++command\&. ++However, if the option \fBCSH_JUNKIE_HISTORY\fP is set, then every history ++reference with no event specification \fIalways\fP refers to the previous ++command\&. ++.PP ++For example, `\fB!\fP\&' is the event designator for the previous command, so ++`\fB!!:1\fP\&' always refers to the first word of the previous command, and ++`\fB!!$\fP\&' always refers to the last word of the previous command\&. With ++\fBCSH_JUNKIE_HISTORY\fP set, then `\fB!:1\fP\&' and `\fB!$\fP' function in the ++same manner as `\fB!!:1\fP\&' and `\fB!!$\fP', respectively\&. Conversely, if ++\fBCSH_JUNKIE_HISTORY\fP is unset, then `\fB!:1\fP\&' and `\fB!$\fP' refer to the ++first and last words, respectively, of the same event referenced by the ++nearest other history reference preceding them on the current command ++line, or to the previous command if there is no preceding reference\&. ++.PP ++The character sequence `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\&' (where `\fB^\fP' is ++actually the second character of the \fBhistchars\fP parameter) ++repeats the last command, replacing the string \fIfoo\fP with \fIbar\fP\&. ++More precisely, the sequence `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^\fP\&' is ++synonymous with `\fB!!:s\fP\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^\fP\&', hence other ++modifiers (see the section `Modifiers\&') may follow the final `\fB^\fP'\&. ++In particular, `\fB^\fP\fIfoo\fP\fB^\fP\fIbar\fP\fB^:G\fP\&' performs a global ++substitution\&. ++.PP ++If the shell encounters the character sequence `\fB!"\fP\&' ++in the input, the history mechanism is temporarily disabled until ++the current list (see ++\fIzshmisc\fP(1)) is fully parsed\&. The `\fB!"\fP\&' is removed from the input, and any ++subsequent `\fB!\fP\&' characters have no special significance\&. ++.PP ++A less convenient but more comprehensible form of command history support ++is provided by the \fBfc\fP builtin\&. ++.SS "Event Designators" ++An event designator is a reference to a command\-line entry in the history ++list\&. In the list below, remember that the initial \fB`!\&'\fP in each item ++may be changed to another character by setting the \fBhistchars\fP ++parameter\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB!\fP ++Start a history expansion, except when followed by a blank, newline, ++`\fB=\fP\&' or `\fB(\fP'\&. If followed immediately by a word designator ++(see the section `Word Designators\&'), this forms a history reference ++with no event designator (see the section `Overview\&')\&. ++.TP ++\fB!!\fP ++Refer to the previous command\&. ++By itself, this expansion ++repeats the previous command\&. ++.TP ++\fB!\fP\fIn\fP ++Refer to command\-line \fIn\fP\&. ++.TP ++\fB!\-\fP\fIn\fP ++Refer to the current command\-line minus \fIn\fP\&. ++.TP ++\fB!\fP\fIstr\fP ++Refer to the most recent command starting with \fIstr\fP\&. ++.TP ++\fB!?\fP\fIstr\fP[\fB?\fP] ++Refer to the most recent command containing \fIstr\fP\&. The trailing ++`\fB?\fP\&' is necessary if this reference is to be followed by a modifier or ++followed by any text that is not to be considered part of \fIstr\fP\&. ++.TP ++\fB!#\fP ++Refer to the current command line typed in so far\&. The line is ++treated as if it were complete up to and including the word before the ++one with the `\fB!#\fP\&' reference\&. ++.TP ++\fB!{\fP\&.\&.\&.\fB}\fP ++Insulate a history reference from adjacent characters (if necessary)\&. ++.SS "Word Designators" ++A word designator indicates which word or words of a given command line are ++to be included in a history reference\&. A `\fB:\fP\&' usually ++separates the event specification from the word designator\&. ++It may be omitted only if the word designator begins with a ++`\fB^\fP\&', `\fB$\fP', `\fB*\fP', `\fB\-\fP' or `\fB%\fP'\&. ++Word designators include: ++.PP ++.PD 0 ++.TP ++\fB0\fP ++The first input word (command)\&. ++.TP ++\fIn\fP ++The \fIn\fPth argument\&. ++.TP ++\fB^\fP ++The first argument\&. That is, \fB1\fP\&. ++.TP ++\fB$\fP ++The last argument\&. ++.TP ++\fB%\fP ++The word matched by (the most recent) \fB?\fP\fIstr\fP search\&. ++.TP ++\fIx\fP\fB\-\fP\fIy\fP ++A range of words; \fIx\fP defaults to \fB0\fP\&. ++.TP ++\fB*\fP ++All the arguments, or a null value if there are none\&. ++.TP ++\fIx\fP\fB*\fP ++Abbreviates `\fIx\fP\fB\-$\fP\&'\&. ++.TP ++\fIx\fP\fB\-\fP ++Like `\fIx\fP\fB*\fP\&' but omitting word \fB$\fP\&. ++.PD ++.PP ++Note that a `\fB%\fP\&' word designator works only when used in one of ++`\fB!%\fP\&', `\fB!:%\fP' or `\fB!?\fP\fIstr\fP\fB?:%\fP', and only when used after a ++\fB!?\fP expansion (possibly in an earlier command)\&. Anything else results ++in an error, although the error may not be the most obvious one\&. ++.SS "Modifiers" ++After the optional word designator, you can add ++a sequence of one or more of the following modifiers, ++each preceded by a `\fB:\fP\&'\&. These modifiers also work on the result ++of \fIfilename generation\fP and \fIparameter expansion\fP, except where ++noted\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBa\fP ++Turn a file name into an absolute path: prepends the current directory, ++if necessary, and resolves any use of `\fB\&.\&.\fP\&' and `\fB\&.\fP' in the path\&. ++Note that the transformation takes place even if the file or any ++intervening directories do not exist\&. ++.TP ++\fBA\fP ++As `\fBa\fP\&', but also resolve use of symbolic links where possible\&. ++Note that resolution of `\fB\&.\&.\fP\&' occurs \fIbefore\fP resolution of symbolic ++links\&. This call is equivalent to \fBa\fP unless your system has the ++\fBrealpath\fP system call (modern systems do)\&. ++.TP ++\fBc\fP ++Resolve a command name into an absolute path by searching the command ++path given by the \fBPATH\fP variable\&. This does not work for commands ++containing directory parts\&. Note also that this does not usually work as ++a glob qualifier unless a file of the same name is found in the ++current directory\&. ++.TP ++\fBe\fP ++Remove all but the part of the filename extension following the `\fB\&.\fP\&'; ++see the definition of the filename extension in the description of the ++\fBr\fP modifier below\&. Note that according to that definition the result ++will be empty if the string ends with a `\fB\&.\fP\&'\&. ++.TP ++\fBh\fP ++Remove a trailing pathname component, leaving the head\&. This works ++like `\fBdirname\fP\&'\&. ++.TP ++\fBl\fP ++Convert the words to all lowercase\&. ++.TP ++\fBp\fP ++Print the new command but do not execute it\&. Only works with history ++expansion\&. ++.TP ++\fBq\fP ++Quote the substituted words, escaping further substitutions\&. Works ++with history expansion and parameter expansion, though for parameters ++it is only useful if the resulting text is to be re\-evaluated such as ++by \fBeval\fP\&. ++.TP ++\fBQ\fP ++Remove one level of quotes from the substituted words\&. ++.TP ++\fBr\fP ++Remove a filename extension leaving the root name\&. Strings with no ++filename extension are not altered\&. A filename ++extension is a `\fB\&.\fP\&' followed by any number of characters (including ++zero) that are neither `\fB\&.\fP\&' nor `\fB/\fP' and that continue to the end ++of the string\&. For example, the extension of ++`\fBfoo\&.orig\&.c\fP\&' is `\fB\&.c\fP', and `\fBdir\&.c/foo\fP' has no extension\&. ++.TP ++\fBs/\fP\fIl\fP\fB/\fP\fIr\fP[\fB/\fP] ++Substitute \fIr\fP for \fIl\fP as described below\&. ++The substitution is done only for the ++first string that matches \fIl\fP\&. For arrays and for filename ++generation, this applies to each word of the expanded text\&. See ++below for further notes on substitutions\&. ++.RS ++.PP ++The forms `\fBgs/\fP\fIl\fP\fB/\fP\fIr\fP\&' and `\fBs/\fP\fIl\fP\fB/\fP\fIr\fP\fB/:G\fP' ++perform global substitution, i\&.e\&. substitute every occurrence of \fIr\fP ++for \fIl\fP\&. Note that the \fBg\fP or \fB:G\fP must appear in exactly the ++position shown\&. ++.PP ++See further notes on this form of substitution below\&. ++.RE ++.TP ++\fB&\fP ++Repeat the previous \fBs\fP substitution\&. Like \fBs\fP, may be preceded ++immediately by a \fBg\fP\&. In parameter expansion the \fB&\fP must appear ++inside braces, and in filename generation it must be quoted with a ++backslash\&. ++.TP ++\fBt\fP ++Remove all leading pathname components, leaving the tail\&. This works ++like `\fBbasename\fP\&'\&. ++.TP ++\fBu\fP ++Convert the words to all uppercase\&. ++.TP ++\fBx\fP ++Like \fBq\fP, but break into words at whitespace\&. Does not work with ++parameter expansion\&. ++.PP ++The \fBs/\fP\fIl\fP\fB/\fP\fIr\fP\fB/\fP substitution works as follows\&. By ++default the left\-hand side of substitutions are not patterns, but ++character strings\&. Any character can be used as the delimiter in place ++of `\fB/\fP\&'\&. A backslash quotes the delimiter character\&. The character ++`\fB&\fP\&', in the right\-hand\-side \fIr\fP, is replaced by the text from the ++left\-hand\-side \fIl\fP\&. The `\fB&\fP\&' can be quoted with a backslash\&. A ++null \fIl\fP uses the previous string either from the previous \fIl\fP or ++from the contextual scan string \fIs\fP from `\fB!?\fP\fIs\fP\&'\&. You can ++omit the rightmost delimiter if a newline immediately follows \fIr\fP; ++the rightmost `\fB?\fP\&' in a context scan can similarly be omitted\&. Note ++the same record of the last \fIl\fP and \fIr\fP is maintained across all ++forms of expansion\&. ++.PP ++Note that if a `\fB&\fP\&' is used within glob qualifers an extra backslash ++is needed as a \fB&\fP is a special character in this case\&. ++.PP ++If the option \fBHIST_SUBST_PATTERN\fP is set, \fIl\fP is treated as ++a pattern of the usual form described in ++the section FILENAME GENERATION below\&. This can be used in ++all the places where modifiers are available; note, however, that ++in globbing qualifiers parameter substitution has already taken place, ++so parameters in the replacement string should be quoted to ensure ++they are replaced at the correct time\&. ++Note also that complicated patterns used in globbing qualifiers may ++need the extended glob qualifier notation ++\fB(#q:s/\fP\fI\&.\&.\&.\fP\fB/\fP\fI\&.\&.\&.\fP\fB/)\fP in order for the ++shell to recognize the expression as a glob qualifier\&. Further, ++note that bad patterns in the substitution are not subject to ++the \fBNO_BAD_PATTERN\fP option so will cause an error\&. ++.PP ++When \fBHIST_SUBST_PATTERN\fP is set, \fIl\fP may start with a \fB#\fP ++to indicate that the pattern must match at the start of the string ++to be substituted, and a \fB%\fP may appear at the start or after an \fB#\fP ++to indicate that the pattern must match at the end of the string ++to be substituted\&. The \fB%\fP or \fB#\fP may be quoted with two ++backslashes\&. ++.PP ++For example, the following piece of filename generation code ++with the \fBEXTENDED_GLOB\fP option: ++.PP ++.RS ++.nf ++\fBprint *\&.c(#q:s/#%(#b)s(*)\&.c/\&'S${match[1]}\&.C'/)\fP ++.fi ++.RE ++.PP ++takes the expansion of \fB*\&.c\fP and applies the glob qualifiers in the ++\fB(#q\fP\fI\&.\&.\&.\fP\fB)\fP expression, which consists of a substitution ++modifier anchored to the start and end of each word (\fB#%\fP)\&. This ++turns on backreferences (\fB(#b)\fP), so that the parenthesised ++subexpression is available in the replacement string as \fB${match[1]}\fP\&. ++The replacement string is quoted so that the parameter is not substituted ++before the start of filename generation\&. ++.PP ++The following \fBf\fP, \fBF\fP, \fBw\fP and \fBW\fP modifiers work only with ++parameter expansion and filename generation\&. They are listed here to ++provide a single point of reference for all modifiers\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBf\fP ++Repeats the immediately (without a colon) following modifier until the ++resulting word doesn\&'t change any more\&. ++.TP ++\fBF:\fP\fIexpr\fP\fB:\fP ++Like \fBf\fP, but repeats only \fIn\fP times if the expression ++\fIexpr\fP evaluates to \fIn\fP\&. Any character can be used instead of ++the `\fB:\fP\&'; if `\fB(\fP', `\fB[\fP', or `\fB{\fP' ++is used as the opening delimiter, ++the closing delimiter should be \&'\fB)\fP', `\fB]\fP', or `\fB}\fP', ++respectively\&. ++.TP ++\fBw\fP ++Makes the immediately following modifier work on each word in the ++string\&. ++.TP ++\fBW:\fP\fIsep\fP\fB:\fP ++Like \fBw\fP but words are considered to be the parts of the string ++that are separated by \fIsep\fP\&. Any character can be used instead of ++the `\fB:\fP\&'; opening parentheses are handled specially, see above\&. ++.SH "PROCESS SUBSTITUTION" ++Each part of a command argument that takes the form ++`\fB<(\fP\fIlist\fP\fB)\fP\&', ++`\fB>(\fP\fIlist\fP\fB)\fP\&' or ++`\fB=(\fP\fIlist\fP\fB)\fP\&' ++is subject to process substitution\&. The expression may be preceded ++or followed by other strings except that, to prevent clashes with ++commonly occurring strings and patterns, the last ++form must occur at the start of a command argument, and the forms ++are only expanded when first parsing command or assignment arguments\&. ++Process substitutions may be used following redirection operators; in this ++case, the substitution must appear with no trailing string\&. ++.PP ++In the case of the \fB<\fP or \fB>\fP forms, the shell runs the commands in ++\fIlist\fP as a subprocess of the job executing the shell command line\&. ++If the system supports the \fB/dev/fd\fP ++mechanism, the command argument is the name of the device file ++corresponding to a file descriptor; otherwise, if the system supports named ++pipes (FIFOs), the command argument will be a named pipe\&. If the form with ++\fB>\fP is selected then writing on this special file will provide input for ++\fIlist\fP\&. If \fB<\fP is used, then the file passed as an argument will ++be connected to the output of the \fIlist\fP process\&. For example, ++.PP ++.RS ++.nf ++\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB) | ++tee >(\fP\fIprocess1\fP\fB) >(\fP\fIprocess2\fP\fB) >/dev/null\fP\fP ++.fi ++.RE ++.PP ++cuts fields 1 and 3 from the files \fIfile1\fP and \fIfile2\fP respectively, ++pastes the results together, and sends it to the processes ++\fIprocess1\fP and \fIprocess2\fP\&. ++.PP ++If \fB=(\fP\fI\&.\&.\&.\fP\fB)\fP is used instead of ++\fB<(\fP\fI\&.\&.\&.\fP\fB)\fP, ++then the file passed as an argument will be the name ++of a temporary file containing the output of the \fIlist\fP ++process\&. This may be used instead of the \fB<\fP ++form for a program that expects to lseek (see \fIlseek\fP(2)) ++on the input file\&. ++.PP ++There is an optimisation for substitutions of the form ++\fB=(<<<\fP\fIarg\fP\fB)\fP, where \fIarg\fP is a single\-word argument ++to the here\-string redirection \fB<<<\fP\&. This form produces a file name ++containing the value of \fIarg\fP after any substitutions have been ++performed\&. This is handled entirely within the current shell\&. This is ++effectively the reverse of the special form \fB$(<\fP\fIarg\fP\fB)\fP ++which treats \fIarg\fP as a file name and replaces it with the file\&'s ++contents\&. ++.PP ++The \fB=\fP form is useful as both the \fB/dev/fd\fP and the named pipe ++implementation of \fB<(\fP\fI\&.\&.\&.\fP\fB)\fP have drawbacks\&. In ++the former case, some programmes may automatically close the file ++descriptor in question before examining the file on the command line, ++particularly if this is necessary for security reasons such as when the ++programme is running setuid\&. In the second case, if the ++programme does not actually open the file, the subshell attempting to read ++from or write to the pipe will (in a typical implementation, different ++operating systems may have different behaviour) block for ever and have to ++be killed explicitly\&. In both cases, the shell actually supplies the ++information using a pipe, so that programmes that expect to lseek ++(see \fIlseek\fP(2)) on the file will not work\&. ++.PP ++Also note that the previous example can be more compactly and ++efficiently written (provided the \fBMULTIOS\fP option is set) as: ++.PP ++.RS ++.nf ++\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB)\fP \e ++\fB> >(\fP\fIprocess1\fP\fB) > >(\fP\fIprocess2\fP\fB)\fP\fP ++.fi ++.RE ++.PP ++The shell uses pipes instead of FIFOs to implement the latter ++two process substitutions in the above example\&. ++.PP ++There is an additional problem with \fB>(\fP\fIprocess\fP\fB)\fP; when ++this is attached to an external command, the parent shell does not wait ++for \fIprocess\fP to finish and hence an immediately following command ++cannot rely on the results being complete\&. The problem and solution are ++the same as described in the section \fIMULTIOS\fP in ++\fIzshmisc\fP(1)\&. Hence in a simplified ++version of the example above: ++.PP ++.RS ++.nf ++\fB\fBpaste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB)\fP \fB> >(\fP\fIprocess\fP\fB)\fP\fP ++.fi ++.RE ++.PP ++(note that no \fBMULTIOS\fP are involved), \fIprocess\fP will be run ++asynchronously as far as the parent shell is concerned\&. The workaround is: ++.PP ++.RS ++.nf ++\fB\fB{ paste <(cut \-f1\fP \fIfile1\fP\fB) <(cut \-f3\fP \fIfile2\fP\fB) }\fP \fB> >(\fP\fIprocess\fP\fB)\fP\fP ++.fi ++.RE ++.PP ++The extra processes here are ++spawned from the parent shell which will wait for their completion\&. ++.PP ++Another problem arises any time a job with a substitution that requires ++a temporary file is disowned by the shell, including the case where ++`\fB&!\fP\&' or `\fB&|\fP' appears at the end of a command containing a ++subsitution\&. In that case the temporary file will not be cleaned up as ++the shell no longer has any memory of the job\&. A workaround is to use ++a subshell, for example, ++.PP ++.RS ++.nf ++\fB(mycmd =(myoutput)) &!\fP ++.fi ++.RE ++.PP ++as the forked subshell will wait for the command to finish then remove ++the temporary file\&. ++.PP ++.SH "PARAMETER EXPANSION" ++The character `\fB$\fP\&' is used to introduce parameter expansions\&. ++See ++\fIzshparam\fP(1) ++for a description of parameters, including arrays, associative arrays, ++and subscript notation to access individual array elements\&. ++.PP ++Note in particular the fact that words of unquoted parameters are not ++automatically split on whitespace unless the option \fBSH_WORD_SPLIT\fP is ++set; see references to this option below for more details\&. This is an ++important difference from other shells\&. ++.PP ++In the expansions discussed below that require a pattern, the form of ++the pattern is the same as that used for filename generation; ++see the section `Filename Generation\&'\&. Note that these patterns, along with ++the replacement text of any substitutions, are themselves subject to ++parameter expansion, command substitution, and arithmetic expansion\&. ++In addition to the following operations, the colon modifiers described in ++the section `Modifiers\&' in the section `History Expansion' can be ++applied: for example, \fB${i:s/foo/bar/}\fP performs string ++substitution on the expansion of parameter \fB$i\fP\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB${\fP\fIname\fP\fB}\fP ++The value, if any, of the parameter \fIname\fP is substituted\&. ++The braces are required if the expansion is to be followed by ++a letter, digit, or underscore that is not to be interpreted ++as part of \fIname\fP\&. In addition, more complicated forms of substitution ++usually require the braces to be present; exceptions, which only apply if ++the option \fBKSH_ARRAYS\fP is not set, are a single subscript or any colon ++modifiers appearing after the name, or any of the characters `\fB^\fP\&', ++`\fB=\fP\&', `\fB~\fP', `\fB#\fP' or `\fB+\fP' appearing before the name, all of ++which work with or without braces\&. ++.RS ++.PP ++If \fIname\fP is an array parameter, and the \fBKSH_ARRAYS\fP option is not ++set, then the value of each ++element of \fIname\fP is substituted, one element per word\&. Otherwise, the ++expansion results in one word only; with \fBKSH_ARRAYS\fP, this is the first ++element of an array\&. No field splitting is done on the result unless the ++\fBSH_WORD_SPLIT\fP option is set\&. ++See also the flags \fB=\fP and \fBs:\fP\fIstring\fP\fB:\fP\&. ++.RE ++.TP ++\fB${+\fP\fIname\fP\fB}\fP ++If \fIname\fP is the name of a set parameter `\fB1\fP\&' is substituted, ++otherwise `\fB0\fP\&' is substituted\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB\-\fP\fIword\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB:\-\fP\fIword\fP\fB}\fP ++If \fIname\fP is set, or in the second form is non\-null, then substitute ++its value; otherwise substitute \fIword\fP\&. In the second form \fIname\fP ++may be omitted, in which case \fIword\fP is always substituted\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB+\fP\fIword\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB:+\fP\fIword\fP\fB}\fP ++If \fIname\fP is set, or in the second form is non\-null, then substitute ++\fIword\fP; otherwise substitute nothing\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB=\fP\fIword\fP\fB}\fP ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB:=\fP\fIword\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB::=\fP\fIword\fP\fB}\fP ++In the first form, if \fIname\fP is unset then set it to \fIword\fP; in the ++second form, if \fIname\fP is unset or null then set it to \fIword\fP; and ++in the third form, unconditionally set \fIname\fP to \fIword\fP\&. In all ++forms, the value of the parameter is then substituted\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB?\fP\fIword\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB:?\fP\fIword\fP\fB}\fP ++In the first form, if \fIname\fP is set, or in the second form if \fIname\fP ++is both set and non\-null, then substitute its value; otherwise, print ++\fIword\fP and exit from the shell\&. Interactive shells instead return to ++the prompt\&. If \fIword\fP is omitted, then a standard message is printed\&. ++.PP ++In any of the above expressions that test a variable and substitute an ++alternate \fIword\fP, note that you can use standard shell quoting in the ++\fIword\fP value to selectively override the splitting done by the ++\fBSH_WORD_SPLIT\fP option and the \fB=\fP flag, but not splitting by the ++\fBs:\fP\fIstring\fP\fB:\fP flag\&. ++.PP ++In the following expressions, when \fIname\fP is an array and ++the substitution is not quoted, or if the `\fB(@)\fP\&' flag or the ++\fIname\fP\fB[@]\fP syntax is used, matching and replacement is ++performed on each array element separately\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB##\fP\fIpattern\fP\fB}\fP ++If the \fIpattern\fP matches the beginning of the value of ++\fIname\fP, then substitute the value of \fIname\fP with ++the matched portion deleted; otherwise, just ++substitute the value of \fIname\fP\&. In the first ++form, the smallest matching pattern is preferred; ++in the second form, the largest matching pattern is ++preferred\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB%\fP\fIpattern\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB%%\fP\fIpattern\fP\fB}\fP ++If the \fIpattern\fP matches the end of the value of ++\fIname\fP, then substitute the value of \fIname\fP with ++the matched portion deleted; otherwise, just ++substitute the value of \fIname\fP\&. In the first ++form, the smallest matching pattern is preferred; ++in the second form, the largest matching pattern is ++preferred\&. ++.TP ++\fB${\fP\fIname\fP\fB:#\fP\fIpattern\fP\fB}\fP ++If the \fIpattern\fP matches the value of \fIname\fP, then substitute ++the empty string; otherwise, just substitute the value of \fIname\fP\&. ++If \fIname\fP is an array ++the matching array elements are removed (use the `\fB(M)\fP\&' flag to ++remove the non\-matched elements)\&. ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB:\fP\fIoffset\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB:\fP\fIoffset\fP\fB:\fP\fIlength\fP\fB}\fP ++This syntax gives effects similar to parameter subscripting ++in the form \fB$\fP\fIname\fP\fB[\fP\fIstart\fP\fB,\fP\fIend\fP\fB]\fP, but is ++compatible with other shells; note that both \fIoffset\fP and \fIlength\fP ++are interpreted differently from the components of a subscript\&. ++.RS ++.PP ++If \fIoffset\fP is non\-negative, then if the variable \fIname\fP is a ++scalar substitute the contents starting \fIoffset\fP characters from the ++first character of the string, and if \fIname\fP is an array substitute ++elements starting \fIoffset\fP elements from the first element\&. If ++\fIlength\fP is given, substitute that many characters or elements, ++otherwise the entire rest of the scalar or array\&. ++.PP ++A positive \fIoffset\fP is always treated as the offset of a character or ++element in \fIname\fP from the first character or element of the array ++(this is different from native zsh subscript notation)\&. Hence 0 ++refers to the first character or element regardless of the setting of ++the option \fBKSH_ARRAYS\fP\&. ++.PP ++A negative offset counts backwards from the end of the scalar or array, ++so that \-1 corresponds to the last character or element, and so on\&. ++.PP ++When positive, \fIlength\fP counts from the \fIoffset\fP position ++toward the end of the scalar or array\&. When negative, \fIlength\fP ++counts back from the end\&. If this results in a position smaller ++than \fIoffset\fP, a diagnostic is printed and nothing is substituted\&. ++.PP ++The option \fBMULTIBYTE\fP is obeyed, i\&.e\&. the offset and length ++count multibyte characters where appropriate\&. ++.PP ++\fIoffset\fP and \fIlength\fP undergo the same set of shell substitutions ++as for scalar assignment; in addition, they are then subject to arithmetic ++evaluation\&. Hence, for example ++.PP ++.RS ++.nf ++\fBprint ${foo:3} ++print ${foo: 1 + 2} ++print ${foo:$(( 1 + 2))} ++print ${foo:$(echo 1 + 2)}\fP ++.fi ++.RE ++.PP ++all have the same effect, extracting the string starting at the fourth ++character of \fB$foo\fP if the substution would otherwise return a scalar, ++or the array starting at the fourth element if \fB$foo\fP would return an ++array\&. Note that with the option \fBKSH_ARRAYS\fP \fB$foo\fP always returns ++a scalar (regardless of the use of the offset syntax) and a form ++such as \fB$foo[*]:3\fP is required to extract elements of an array named ++\fBfoo\fP\&. ++.PP ++If \fIoffset\fP is negative, the \fB\-\fP may not appear immediately ++after the \fB:\fP as this indicates the ++\fB${\fP\fIname\fP\fB:\-\fP\fIword\fP\fB}\fP form of substitution\&. Instead, a space ++may be inserted before the \fB\-\fP\&. Furthermore, neither \fIoffset\fP nor ++\fIlength\fP may begin with an alphabetic character or \fB&\fP as these are ++used to indicate history\-style modifiers\&. To substitute a value from a ++variable, the recommended approach is to precede it with a \fB$\fP as this ++signifies the intention (parameter substitution can easily be rendered ++unreadable); however, as arithmetic substitution is performed, the ++expression \fB${var: offs}\fP does work, retrieving the offset from ++\fB$offs\fP\&. ++.PP ++For further compatibility with other shells there is a special case ++for array offset 0\&. This usually accesses to the ++first element of the array\&. However, if the substitution refers the ++positional parameter array, e\&.g\&. \fB$@\fP or \fB$*\fP, then offset 0 ++instead refers to \fB$0\fP, offset 1 refers to \fB$1\fP, and so on\&. In ++other words, the positional parameter array is effectively extended by ++prepending \fB$0\fP\&. Hence \fB${*:0:1}\fP substitutes \fB$0\fP and ++\fB${*:1:1}\fP substitutes \fB$1\fP\&. ++.RE ++.TP ++.PD 0 ++\fB${\fP\fIname\fP\fB/\fP\fIpattern\fP\fB/\fP\fIrepl\fP\fB}\fP ++.TP ++.PD ++\fB${\fP\fIname\fP\fB//\fP\fIpattern\fP\fB/\fP\fIrepl\fP\fB}\fP ++Replace the longest possible match of \fIpattern\fP in the expansion of ++parameter \fIname\fP by string \fIrepl\fP\&. The first form ++replaces just the first occurrence, the second form all occurrences\&. ++Both \fIpattern\fP and \fIrepl\fP are subject to double\-quoted substitution, ++so that expressions like \fB${name/$opat/$npat}\fP will work, but note the ++usual rule that pattern characters in \fB$opat\fP are not treated specially ++unless either the option \fBGLOB_SUBST\fP is set, or \fB$opat\fP is instead ++substituted as \fB${~opat}\fP\&. ++.RS ++.PP ++The \fIpattern\fP may begin with a `\fB#\fP\&', in which case the ++\fIpattern\fP must match at the start of the string, or `\fB%\fP\&', in ++which case it must match at the end of the string, or `\fB#%\fP\&' in which ++case the \fIpattern\fP must match the entire string\&. The \fIrepl\fP may ++be an empty string, in which case the final `\fB/\fP\&' may also be omitted\&. ++To quote the final `\fB/\fP\&' in other cases it should be preceded by a ++single backslash; this is not necessary if the ++`\fB/\fP\&' occurs inside a substituted parameter\&. Note also that the `\fB#\fP', ++`\fB%\fP\&' and `\fB#%\fP are not active if they occur inside a substituted ++parameter, even at the start\&. ++.PP ++The first `\fB/\fP\&' may be preceded by a `\fB:\fP', in which case the match ++will only succeed if it matches the entire word\&. Note also the ++effect of the \fBI\fP and \fBS\fP parameter expansion flags below; however, ++the flags \fBM\fP, \fBR\fP, \fBB\fP, \fBE\fP and \fBN\fP are not useful\&. ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBfoo="twinkle twinkle little star" sub="t*e" rep="spy" ++print ${foo//${~sub}/$rep} ++print ${(S)foo//${~sub}/$rep}\fP ++.fi ++.RE ++.PP ++Here, the `\fB~\fP\&' ensures that the text of \fB$sub\fP is treated as a ++pattern rather than a plain string\&. In the first case, the longest ++match for \fBt*e\fP is substituted and the result is `\fBspy star\fP\&', ++while in the second case, the shortest matches are taken and the ++result is `\fBspy spy lispy star\fP\&'\&. ++.RE ++.TP ++\fB${#\fP\fIspec\fP\fB}\fP ++If \fIspec\fP is one of the above substitutions, substitute ++the length in characters of the result instead of ++the result itself\&. If \fIspec\fP is an array expression, ++substitute the number of elements of the result\&. ++Note that `\fB^\fP\&', `\fB=\fP', and `\fB~\fP', below, must appear ++to the left of `\fB#\fP\&' when these forms are combined\&. ++.TP ++\fB${^\fP\fIspec\fP\fB}\fP ++Turn on the \fBRC_EXPAND_PARAM\fP option for the ++evaluation of \fIspec\fP; if the `\fB^\fP\&' is doubled, turn it off\&. ++When this option is set, array expansions of the form ++\fIfoo\fP\fB${\fP\fIxx\fP\fB}\fP\fIbar\fP, ++where the parameter \fIxx\fP ++is set to \fB(\fP\fIa b c\fP\fB)\fP, are substituted with ++`\fIfooabar foobbar foocbar\fP\&' instead of the default ++`\fIfooa b cbar\fP\&'\&. Note that an empty array will therefore cause ++all arguments to be removed\&. ++.RS ++.PP ++Internally, each such expansion is converted into the ++equivalent list for brace expansion\&. E\&.g\&., \fB${^var}\fP becomes ++\fB{$var[1],$var[2],\fP\&.\&.\&.\fB}\fP, and is processed as described in ++the section `Brace Expansion\&' below\&. ++If word splitting is also in effect the ++\fB$var[\fP\fIN\fP\fB]\fP may themselves be split into different list ++elements\&. ++.RE ++.TP ++\fB${=\fP\fIspec\fP\fB}\fP ++Perform word splitting using the rules for \fBSH_WORD_SPLIT\fP during the ++evaluation of \fIspec\fP, but regardless of whether the parameter appears in ++double quotes; if the `\fB=\fP\&' is doubled, turn it off\&. ++This forces parameter expansions to be split into ++separate words before substitution, using \fBIFS\fP as a delimiter\&. ++This is done by default in most other shells\&. ++.RS ++.PP ++Note that splitting is applied to \fIword\fP in the assignment forms ++of \fIspec\fP \fIbefore\fP the assignment to \fIname\fP is performed\&. ++This affects the result of array assignments with the \fBA\fP flag\&. ++.RE ++.TP ++\fB${~\fP\fIspec\fP\fB}\fP ++Turn on the \fBGLOB_SUBST\fP option for the evaluation of ++\fIspec\fP; if the `\fB~\fP\&' is doubled, turn it off\&. When this option is ++set, the string resulting from the expansion will be interpreted as a ++pattern anywhere that is possible, such as in filename expansion and ++filename generation and pattern\-matching contexts like the right ++hand side of the `\fB=\fP\&' and `\fB!=\fP' operators in conditions\&. ++.RS ++.PP ++In nested substitutions, note that the effect of the \fB~\fP applies to the ++result of the current level of substitution\&. A surrounding pattern ++operation on the result may cancel it\&. Hence, for example, if the ++parameter \fBfoo\fP is set to \fB*\fP, \fB${~foo//\e*/*\&.c}\fP is substituted by ++the pattern \fB*\&.c\fP, which may be expanded by filename generation, but ++\fB${${~foo}//\e*/*\&.c}\fP substitutes to the string \fB*\&.c\fP, which will not ++be further expanded\&. ++.RE ++.RE ++.PP ++If a \fB${\fP\&.\&.\&.\fB}\fP type parameter expression or a ++\fB$(\fP\&.\&.\&.\fB)\fP type command substitution is used in place of ++\fIname\fP above, it is expanded first and the result is used as if ++it were the value of \fIname\fP\&. Thus it is ++possible to perform nested operations: \fB${${foo#head}%tail}\fP ++substitutes the value of \fB$foo\fP with both `\fBhead\fP\&' and `\fBtail\fP' ++deleted\&. The form with \fB$(\fP\&.\&.\&.\fB)\fP is often useful in ++combination with the flags described next; see the examples below\&. ++Each \fIname\fP or nested \fB${\fP\&.\&.\&.\fB}\fP in a parameter expansion may ++also be followed by a subscript expression as described in ++\fIArray Parameters\fP in \fIzshparam\fP(1)\&. ++.PP ++Note that double quotes may appear around nested expressions, in which ++case only the part inside is treated as quoted; for example, ++\fB${(f)"$(foo)"}\fP quotes the result of \fB$(foo)\fP, but the flag `\fB(f)\fP\&' ++(see below) is applied using the rules for unquoted expansions\&. Note ++further that quotes are themselves nested in this context; for example, in ++\fB"${(@f)"$(foo)"}"\fP, there are two sets of quotes, one surrounding the ++whole expression, the other (redundant) surrounding the \fB$(foo)\fP as ++before\&. ++.PP ++.SS "Parameter Expansion Flags" ++If the opening brace is directly followed by an opening parenthesis, ++the string up to the matching closing parenthesis will be taken as a ++list of flags\&. In cases where repeating a flag is meaningful, the ++repetitions need not be consecutive; for example, `(\fBq%q%q\fP)\&' ++means the same thing as the more readable `(\fB%%qqq\fP)\&'\&. The ++following flags are supported: ++.PP ++.PD 0 ++.TP ++.PD ++\fB#\fP ++Evaluate the resulting words as numeric expressions and output the ++characters corresponding to the resulting integer\&. Note that this form is ++entirely distinct from use of the \fB#\fP without parentheses\&. ++.RS ++.PP ++If the \fBMULTIBYTE\fP option is set and the number is greater than 127 ++(i\&.e\&. not an ASCII character) it is treated as a Unicode character\&. ++.RE ++.TP ++\fB%\fP ++Expand all \fB%\fP escapes in the resulting words in the same way as in ++prompts (see ++EXPANSION OF PROMPT SEQUENCES in \fIzshmisc\fP(1))\&. If this flag is given twice, ++full prompt expansion is done on the resulting words, depending on the ++setting of the \fBPROMPT_PERCENT\fP, \fBPROMPT_SUBST\fP and \fBPROMPT_BANG\fP ++options\&. ++.TP ++\fB@\fP ++In double quotes, array elements are put into separate words\&. ++E\&.g\&., `\fB"${(@)foo}"\fP\&' is equivalent to `\fB"${foo[@]}"\fP' and ++`\fB"${(@)foo[1,2]}"\fP\&' is the same as `\fB"$foo[1]" "$foo[2]"\fP'\&. ++This is distinct from \fIfield splitting\fP by the \fBf\fP, \fBs\fP ++or \fBz\fP flags, which still applies within each array element\&. ++.TP ++\fBA\fP ++Create an array parameter with `\fB${\fP\&.\&.\&.\fB=\fP\&.\&.\&.\fB}\fP\&', ++`\fB${\fP\&.\&.\&.\fB:=\fP\&.\&.\&.\fB}\fP\&' or `\fB${\fP\&.\&.\&.\fB::=\fP\&.\&.\&.\fB}\fP'\&. ++If this flag is repeated (as in `\fBAA\fP\&'), create an associative ++array parameter\&. Assignment is made before sorting or padding\&. ++The \fIname\fP part may be a subscripted range for ordinary ++arrays; the \fIword\fP part \fImust\fP be converted to an array, for ++example by using `\fB${(AA)=\fP\fIname\fP\fB=\fP\&.\&.\&.\fB}\fP\&' to activate ++field splitting, when creating an associative array\&. ++.TP ++\fBa\fP ++Sort in array index order; when combined with `\fBO\fP\&' sort in reverse ++array index order\&. Note that `\fBa\fP\&' is therefore equivalent to the ++default but `\fBOa\fP\&' is useful for obtaining an array's elements in reverse ++order\&. ++.TP ++\fBc\fP ++With \fB${#\fP\fIname\fP\fB}\fP, count the total number of characters in an array, ++as if the elements were concatenated with spaces between them\&. ++.TP ++\fBC\fP ++Capitalize the resulting words\&. `Words\&' in this case refers to sequences ++of alphanumeric characters separated by non\-alphanumerics, \fInot\fP to words ++that result from field splitting\&. ++.TP ++\fBD\fP ++Assume the string or array elements contain directories and attempt ++to substitute the leading part of these by names\&. The remainder of ++the path (the whole of it if the leading part was not subsituted) ++is then quoted so that the whole string can be used as a shell ++argument\&. This is the reverse of `\fB~\fP\&' substitution: see ++the section FILENAME EXPANSION below\&. ++.TP ++\fBe\fP ++Perform \fIparameter expansion\fP, \fIcommand substitution\fP and ++\fIarithmetic expansion\fP on the result\&. Such expansions can be ++nested but too deep recursion may have unpredictable effects\&. ++.TP ++\fBf\fP ++Split the result of the expansion at newlines\&. This is a shorthand ++for `\fBps:\en:\fP\&'\&. ++.TP ++\fBF\fP ++Join the words of arrays together using newline as a separator\&. ++This is a shorthand for `\fBpj:\en:\fP\&'\&. ++.TP ++\fBg:opts:\fP ++Process escape sequences like the echo builtin when no options are given ++(\fBg::\fP)\&. With the \fBo\fP option, octal escapes don\&'t take a leading ++zero\&. With the \fBc\fP option, sequences like `\fB^X\fP\&' are also processed\&. ++With the \fBe\fP option, processes `\fB\eM\-t\fP\&' and similar sequences like the ++print builtin\&. With both of the \fBo\fP and \fBe\fP options, behaves like the ++print builtin except that in none of these modes is `\fB\ec\fP\&' interpreted\&. ++.TP ++\fBi\fP ++Sort case\-insensitively\&. May be combined with `\fBn\fP\&' or `\fBO\fP'\&. ++.TP ++\fBk\fP ++If \fIname\fP refers to an associative array, substitute the \fIkeys\fP ++(element names) rather than the values of the elements\&. Used with ++subscripts (including ordinary arrays), force indices or keys to be ++substituted even if the subscript form refers to values\&. However, ++this flag may not be combined with subscript ranges\&. ++.TP ++\fBL\fP ++Convert all letters in the result to lower case\&. ++.TP ++\fBn\fP ++Sort decimal integers numerically; if the first differing ++characters of two test strings are not digits, sorting ++is lexical\&. Integers with more initial zeroes ++are sorted before those with fewer or none\&. Hence the array `\fBfoo1 foo02 ++foo2 foo3 foo20 foo23\fP\&' is sorted into the order shown\&. ++May be combined with `\fBi\fP\&' or `\fBO\fP'\&. ++.TP ++\fBo\fP ++Sort the resulting words in ascending order; if this appears on its ++own the sorting is lexical and case\-sensitive (unless the locale ++renders it case\-insensitive)\&. Sorting in ascending order is the ++default for other forms of sorting, so this is ignored if combined ++with `\fBa\fP\&', `\fBi\fP' or `\fBn\fP'\&. ++.TP ++\fBO\fP ++Sort the resulting words in descending order; `\fBO\fP\&' without `\fBa\fP', ++`\fBi\fP\&' or `\fBn\fP' sorts in reverse lexical order\&. May be combined ++with `\fBa\fP\&', `\fBi\fP' or `\fBn\fP' to reverse the order of sorting\&. ++.TP ++\fBP\fP ++This forces the value of the parameter \fIname\fP to be interpreted as a ++further parameter name, whose value will be used where appropriate\&. ++Note that flags set with one of the \fBtypeset\fP family of commands ++(in particular case transformations) are not applied to the value of ++\fIname\fP used in this fashion\&. ++.RS ++.PP ++If used with a nested parameter or command substitution, the result of that ++will be taken as a parameter name in the same way\&. For example, if you ++have `\fBfoo=bar\fP\&' and `\fBbar=baz\fP', the strings \fB${(P)foo}\fP, ++\fB${(P)${foo}}\fP, and \fB${(P)$(echo bar)}\fP will be expanded to `\fBbaz\fP\&'\&. ++.RE ++.TP ++\fBq\fP ++Quote characters that are special to the shell in the resulting words with ++backslashes; unprintable or invalid characters are quoted using the ++\fB$\&'\e\fP\fINNN\fP\fB'\fP form, with separate quotes for each octet\&. ++.RS ++.PP ++If this flag is given twice, the resulting words are quoted in single ++quotes and if it is given three times, the words are quoted in double ++quotes; in these forms no special handling of unprintable or invalid ++characters is attempted\&. If the flag is given four times, the words are ++quoted in single quotes preceded by a \fB$\fP\&. Note that in all three of ++these forms quoting is done unconditionally, even if this does not change ++the way the resulting string would be interpreted by the shell\&. ++.PP ++If a \fBq\-\fP is given (only a single \fBq\fP may appear), a minimal ++form of single quoting is used that only quotes the string if needed to ++protect special characters\&. Typically this form gives the most readable ++output\&. ++.RE ++.TP ++\fBQ\fP ++Remove one level of quotes from the resulting words\&. ++.TP ++\fBt\fP ++Use a string describing the type of the parameter where the value ++of the parameter would usually appear\&. This string consists of keywords ++separated by hyphens (`\fB\-\fP\&')\&. The first keyword in the string describes ++the main type, it can be one of `\fBscalar\fP\&', `\fBarray\fP', `\fBinteger\fP', ++`\fBfloat\fP\&' or `\fBassociation\fP'\&. The other keywords describe the type in ++more detail: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fBlocal\fP ++for local parameters ++.TP ++\fBleft\fP ++for left justified parameters ++.TP ++\fBright_blanks\fP ++for right justified parameters with leading blanks ++.TP ++\fBright_zeros\fP ++for right justified parameters with leading zeros ++.TP ++\fBlower\fP ++for parameters whose value is converted to all lower case when it is ++expanded ++.TP ++\fBupper\fP ++for parameters whose value is converted to all upper case when it is ++expanded ++.TP ++\fBreadonly\fP ++for readonly parameters ++.TP ++\fBtag\fP ++for tagged parameters ++.TP ++\fBexport\fP ++for exported parameters ++.TP ++\fBunique\fP ++for arrays which keep only the first occurrence of duplicated values ++.TP ++\fBhide\fP ++for parameters with the `hide\&' flag ++.TP ++\fBspecial\fP ++for special parameters defined by the shell ++.RE ++.TP ++\fBu\fP ++Expand only the first occurrence of each unique word\&. ++.TP ++\fBU\fP ++Convert all letters in the result to upper case\&. ++.TP ++\fBv\fP ++Used with \fBk\fP, substitute (as two consecutive words) both the key ++and the value of each associative array element\&. Used with subscripts, ++force values to be substituted even if the subscript form refers to ++indices or keys\&. ++.TP ++\fBV\fP ++Make any special characters in the resulting words visible\&. ++.TP ++\fBw\fP ++With \fB${#\fP\fIname\fP\fB}\fP, count words in arrays or strings; the \fBs\fP ++flag may be used to set a word delimiter\&. ++.TP ++\fBW\fP ++Similar to \fBw\fP with the difference that empty words between ++repeated delimiters are also counted\&. ++.TP ++\fBX\fP ++With this flag, parsing errors occurring with the \fBQ\fP, \fBe\fP and \fB#\fP ++flags or the pattern matching forms such as ++`\fB${\fP\fIname\fP\fB#\fP\fIpattern\fP\fB}\fP\&' are reported\&. Without the flag, ++errors are silently ignored\&. ++.TP ++\fBz\fP ++Split the result of the expansion into words using shell parsing to ++find the words, i\&.e\&. taking into account any quoting in the value\&. ++Comments are not treated specially but as ordinary strings, similar ++to interactive shells with the \fBINTERACTIVE_COMMENTS\fP option unset\&. ++.RS ++.PP ++Note that this is done very late, as for the `\fB(s)\fP\&' flag\&. So to ++access single words in the result, one has to use nested expansions as ++in `\fB${${(z)foo}[2]}\fP\&'\&. Likewise, to remove the quotes in the ++resulting words one would do: `\fB${(Q)${(z)foo}}\fP\&'\&. ++.RE ++.TP ++\fB0\fP ++Split the result of the expansion on null bytes\&. This is a shorthand ++for `\fBps:\e0:\fP\&'\&. ++.PP ++The following flags (except \fBp\fP) are followed by one or more arguments ++as shown\&. Any character, or the matching pairs `\fB(\fP\&.\&.\&.\fB)\fP\&', ++`\fB{\fP\&.\&.\&.\fB}\fP\&', `\fB[\fP\&.\&.\&.\fB]\fP', or `\fB<\fP\&.\&.\&.\fB>\fP', may be used in place ++of a colon as delimiters, but note that when a flag takes more than one ++argument, a matched pair of delimiters must surround each argument\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBp\fP ++Recognize the same escape sequences as the \fBprint\fP builtin ++in string arguments to any of the flags described below that ++follow this argument\&. ++.TP ++\fB~\fP ++Force string arguments to any of the flags below that follow within ++the parentheses to be treated as patterns\&. Compare with a \fB~\fP ++outside parentheses, which forces the entire substituted string to ++be treated as a pattern\&. Hence, for example, ++.RS ++.nf ++\fB[[ "?" = ${(~j\&.|\&.)array} ]]\fP ++.fi ++.RE ++with the \fBEXTENDED_GLOB\fP option set succeeds if and only if \fB$array\fP ++contains the string `\fB?\fP\&' as an element\&. The argument may be ++repeated to toggle the behaviour; its effect only lasts to the ++end of the parenthesised group\&. ++.TP ++\fBj:\fP\fIstring\fP\fB:\fP ++Join the words of arrays together using \fIstring\fP as a separator\&. ++Note that this occurs before field splitting by the \fBs:\fP\fIstring\fP\fB:\fP ++flag or the \fBSH_WORD_SPLIT\fP option\&. ++.TP ++\fBl:\fP\fIexpr\fP\fB::\fP\fIstring1\fP\fB::\fP\fIstring2\fP\fB:\fP ++Pad the resulting words on the left\&. Each word will be truncated if ++required and placed in a field \fIexpr\fP characters wide\&. ++.RS ++.PP ++The arguments \fB:\fP\fIstring1\fP\fB:\fP and \fB:\fP\fIstring2\fP\fB:\fP are ++optional; neither, the first, or both may be given\&. Note that the same ++pairs of delimiters must be used for each of the three arguments\&. The ++space to the left will be filled with \fIstring1\fP (concatenated as ++often as needed) or spaces if \fIstring1\fP is not given\&. If both ++\fIstring1\fP and \fIstring2\fP are given, \fBstring2\fP is inserted once ++directly to the left of each word, truncated if necessary, before ++\fIstring1\fP is used to produce any remaining padding\&. ++.PP ++If the \fBMULTIBYTE\fP option is in effect, the flag \fBm\fP may also ++be given, in which case widths will be used for the calculation of ++padding; otherwise individual multibyte characters are treated as occupying ++one unit of width\&. ++.PP ++If the \fBMULTIBYTE\fP option is not in effect, each byte in the string is ++treated as occupying one unit of width\&. ++.PP ++Control characters are always assumed to be one unit wide; this allows the ++mechanism to be used for generating repetitions of control characters\&. ++.RE ++.TP ++\fBm\fP ++Only useful together with one of the flags \fBl\fP or \fBr\fP or with the ++\fB#\fP length operator when the \fBMULTIBYTE\fP option ++is in effect\&. Use the character width reported by the system in ++calculating how much of the string it occupies or the overall ++length of the string\&. Most printable characters have a width of one ++unit, however certain Asian character sets and certain special effects ++use wider characters; combining characters have zero width\&. ++Non\-printable characters are arbitrarily counted as zero width; how they ++would actually be displayed will vary\&. ++.RS ++.PP ++If the \fBm\fP is repeated, the character either counts zero (if it has ++zero width), else one\&. For printable character strings this has the ++effect of counting the number of glyphs (visibly separate characters), ++except for the case where combining characters themselves have non\-zero ++width (true in certain alphabets)\&. ++.RE ++.TP ++\fBr:\fP\fIexpr\fP\fB::\fP\fIstring1\fP\fB::\fP\fIstring2\fP\fB:\fP ++As \fBl\fP, but pad the words on the right and insert \fIstring2\fP ++immediately to the right of the string to be padded\&. ++.RS ++.PP ++Left and right padding may be used together\&. In this case the strategy ++is to apply left padding to the first half width of each of the resulting ++words, and right padding to the second half\&. If the string to be ++padded has odd width the extra padding is applied on the left\&. ++.RE ++.TP ++\fBs:\fP\fIstring\fP\fB:\fP ++Force field splitting at the ++separator \fIstring\fP\&. Note that a \fIstring\fP of two or more ++characters means that all of them must match in sequence; this differs from ++the treatment of two or more characters in the \fBIFS\fP parameter\&. ++See also the \fB=\fP flag and the \fBSH_WORD_SPLIT\fP option\&. An empty ++string may also be given in which case every character will be a separate ++element\&. ++.RS ++.PP ++For historical reasons, the usual behaviour that empty array elements ++are retained inside double quotes is disabled for arrays generated ++by splitting; hence the following: ++.PP ++.RS ++.nf ++\fBline="one::three" ++print \-l "${(s\&.:\&.)line}"\fP ++.fi ++.RE ++.PP ++produces two lines of output for \fBone\fP and \fBthree\fP and elides the ++empty field\&. To override this behaviour, supply the "(@)" flag as well, ++i\&.e\&. \fB"${(@s\&.:\&.)line}"\fP\&. ++.RE ++.TP ++\fBZ:\fP\fIopts\fP\fB:\fP ++As \fBz\fP but takes a combination of option letters between a following ++pair of delimiter characters\&. \fB(Z+c+)\fP ++causes comments to be parsed as a string and retained; any field in the ++resulting array beginning with an unquoted comment character is a ++comment\&. \fB(Z+C+)\fP causes comments to be parsed ++and removed\&. The rule for comments is standard: anything between a word ++starting with the third character of \fB$HISTCHARS\fP, default \fB#\fP, up to ++the next newline is a comment\&. \fB(Z+n+)\fP causes ++unquoted newlines to be treated as ordinary whitespace, else they are ++treated as if they are shell code delimiters and converted to ++semicolons\&. ++.TP ++\fB_:\fP\fIflags\fP\fB:\fP ++The underscore (\fB_\fP) flag is reserved for future use\&. As of this ++revision of zsh, there are no valid \fIflags\fP; anything following an ++underscore, other than an empty pair of delimiters, is treated as an ++error, and the flag itself has no effect\&. ++.PP ++The following flags are meaningful with the \fB${\fP\&.\&.\&.\fB#\fP\&.\&.\&.\fB}\fP or ++\fB${\fP\&.\&.\&.\fB%\fP\&.\&.\&.\fB}\fP forms\&. The \fBS\fP and \fBI\fP flags may also be ++used with the \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP forms\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBS\fP ++Search substrings as well as beginnings or ends; with \fB#\fP start ++from the beginning and with \fB%\fP start from the end of the string\&. ++With substitution via \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP or ++\fB${\fP\&.\&.\&.\fB//\fP\&.\&.\&.\fB}\fP, specifies non\-greedy matching, i\&.e\&. that the ++shortest instead of the longest match should be replaced\&. ++.TP ++\fBI:\fP\fIexpr\fP\fB:\fP ++Search the \fIexpr\fPth match (where \fIexpr\fP evaluates to a number)\&. ++This only applies when searching for substrings, either with the \fBS\fP ++flag, or with \fB${\fP\&.\&.\&.\fB/\fP\&.\&.\&.\fB}\fP (only the \fIexpr\fPth match is ++substituted) or \fB${\fP\&.\&.\&.\fB//\fP\&.\&.\&.\fB}\fP (all matches from the ++\fIexpr\fPth on are substituted)\&. The default is to take the first match\&. ++.RS ++.PP ++The \fIexpr\fPth match is counted such that there is either one or zero ++matches from each starting position in the string, although for global ++substitution matches overlapping previous replacements are ignored\&. With ++the \fB${\fP\&.\&.\&.\fB%\fP\&.\&.\&.\fB}\fP and \fB${\fP\&.\&.\&.\fB%%\fP\&.\&.\&.\fB}\fP forms, the starting ++position for the match moves backwards from the end as the index increases, ++while with the other forms it moves forward from the start\&. ++.PP ++Hence with the string ++.RS ++.nf ++\fBwhich switch is the right switch for Ipswich?\fP ++.fi ++.RE ++substitutions of the form ++\fB${\fP(\fBSI:\fP\fIN\fP\fB:\fP)\fBstring#w*ch}\fP as \fIN\fP increases ++from 1 will match and remove `\fBwhich\fP\&', `\fBwitch\fP', `\fBwitch\fP' and ++`\fBwich\fP\&'; the form using `\fB##\fP' will match and remove `\fBwhich switch ++is the right switch for Ipswich\fP\&', `\fBwitch is the right switch for ++Ipswich\fP\&', `\fBwitch for Ipswich\fP' and `\fBwich\fP'\&. The form using `\fB%\fP' ++will remove the same matches as for `\fB#\fP\&', but in reverse order, and the ++form using `\fB%%\fP\&' will remove the same matches as for `\fB##\fP' in reverse ++order\&. ++.RE ++.TP ++\fBB\fP ++Include the index of the beginning of the match in the result\&. ++.TP ++\fBE\fP ++Include the index of the end of the match in the result\&. ++.TP ++\fBM\fP ++Include the matched portion in the result\&. ++.TP ++\fBN\fP ++Include the length of the match in the result\&. ++.TP ++\fBR\fP ++Include the unmatched portion in the result (the \fIR\fPest)\&. ++.PP ++.SS "Rules" ++.PP ++Here is a summary of the rules for substitution; this assumes that braces ++are present around the substitution, i\&.e\&. \fB${\&.\&.\&.}\fP\&. Some particular ++examples are given below\&. Note that the Zsh Development Group accepts ++\fIno responsibility\fP for any brain damage which may occur during the ++reading of the following rules\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB1\&.\fP \fINested Substitution\fP ++If multiple nested \fB${\&.\&.\&.}\fP forms are present, substitution is ++performed from the inside outwards\&. At each level, the substitution takes ++account of whether the current value is a scalar or an array, whether the ++whole substitution is in double quotes, and what flags are supplied to the ++current level of substitution, just as if the nested substitution were the ++outermost\&. The flags are not propagated up to enclosing ++substitutions; the nested substitution will return either a scalar or an ++array as determined by the flags, possibly adjusted for quoting\&. All the ++following steps take place where applicable at all levels of substitution\&. ++Note that, unless the `\fB(P)\fP\&' flag is present, the flags and any subscripts ++apply directly to the value of the nested substitution; for example, the ++expansion \fB${${foo}}\fP behaves exactly the same as \fB${foo}\fP\&. ++.RS ++.PP ++At each nested level of substitution, the substituted words undergo all ++forms of single\-word substitution (i\&.e\&. not filename generation), including ++command substitution, arithmetic expansion and filename expansion ++(i\&.e\&. leading \fB~\fP and \fB=\fP)\&. Thus, for example, \fB${${:\-=cat}:h}\fP ++expands to the directory where the \fBcat\fP program resides\&. (Explanation: ++the internal substitution has no parameter but a default value \fB=cat\fP, ++which is expanded by filename expansion to a full path; the outer ++substitution then applies the modifier \fB:h\fP and takes the directory part ++of the path\&.) ++.RE ++.TP ++\fB2\&.\fP \fIInternal Parameter Flags\fP ++Any parameter flags set by one of the \fBtypeset\fP family of commands, ++in particular the \fBL\fP, \fBR\fP, \fBZ\fP, \fBu\fP and \fBl\fP flags for padding ++and capitalization, are applied directly to the parameter value\&. ++.TP ++\fB3\&.\fP \fIParameter Subscripting\fP ++If the value is a raw parameter reference with a subscript, such as ++\fB${\fP\fIvar\fP\fB[3]}\fP, the effect of subscripting is applied directly to ++the parameter\&. Subscripts are evaluated left to right; subsequent ++subscripts apply to the scalar or array value yielded by the previous ++subscript\&. Thus if \fBvar\fP is an array, \fB${var[1][2]}\fP is the second ++character of the first word, but \fB${var[2,4][2]}\fP is the entire third ++word (the second word of the range of words two through four of the ++original array)\&. Any number of subscripts may appear\&. ++.TP ++\fB4\&.\fP \fIParameter Name Replacement\fP ++The effect of any \fB(P)\fP flag, which treats the value so far as a ++parameter name and replaces it with the corresponding value, is applied\&. ++.TP ++\fB5\&.\fP \fIDouble\-Quoted Joining\fP ++If the value after this process is an array, and the substitution ++appears in double quotes, and no \fB(@)\fP flag is present at the current ++level, the words of the value are joined with the first character of the ++parameter \fB$IFS\fP, by default a space, between each word (single word ++arrays are not modified)\&. If the \fB(j)\fP flag is present, that is used for ++joining instead of \fB$IFS\fP\&. ++.TP ++\fB6\&.\fP \fINested Subscripting\fP ++Any remaining subscripts (i\&.e\&. of a nested substitution) are evaluated at ++this point, based on whether the value is an array or a scalar\&. As with ++\fB3\&.\fP, multiple subscripts can appear\&. Note that \fB${foo[2,4][2]}\fP is ++thus equivalent to \fB${${foo[2,4]}[2]}\fP and also to ++\fB"${${(@)foo[2,4]}[2]}"\fP (the nested substitution returns an array in ++both cases), but not to \fB"${${foo[2,4]}[2]}"\fP (the nested substitution ++returns a scalar because of the quotes)\&. ++.TP ++\fB7\&.\fP \fIModifiers\fP ++Any modifiers, as specified by a trailing `\fB#\fP\&', `\fB%\fP', `\fB/\fP' ++(possibly doubled) or by a set of modifiers of the form \fB:\&.\&.\&.\fP (see ++the section `Modifiers\&' in the section `History Expansion'), are applied to the words ++of the value at this level\&. ++.TP ++\fB8\&.\fP \fICharacter evaluation\fP ++Any \fB(#)\fP flag is applied, evaluating the result so far numerically ++as a character\&. ++.TP ++\fB9\&.\fP \fILength\fP ++Any initial \fB#\fP modifier, i\&.e\&. in the form \fB${#\fP\fIvar\fP\fB}\fP, is ++used to evaluate the length of the expression so far\&. ++.TP ++\fB10\&.\fP \fIForced Joining\fP ++If the `\fB(j)\fP\&' flag is present, or no `\fB(j)\fP' flag is present but ++the string is to be split as given by rules \fB16\&.\fP or \fB17\&.\fP, and joining ++did not take place at step \fB5\&.\fP, any words in the value are joined ++together using the given string or the first character of \fB$IFS\fP if none\&. ++Note that the `\fB(F)\fP\&' flag implicitly supplies a string for joining in this ++manner\&. ++.TP ++\fB11\&.\fP \fICase modification\fP ++Any case modification from one of the flags \fB(L)\fP, \fB(U)\fP or \fB(C)\fP ++is applied\&. ++.TP ++\fB12\&.\fP \fIEscape sequence replacement\fP ++First any replacements from the \fB(g)\fP flag are performed, then any ++prompt\-style formatting from the \fB(%)\fP family of flags is applied\&. ++.TP ++\fB13\&.\fP \fIQuote application\fP ++Any quoting or unquoting using \fB(q)\fP and \fB(Q)\fP and related flags ++is applied\&. ++.TP ++\fB14\&.\fP \fIDirectory naming\fP ++Any directory name substitution using \fB(D)\fP flag is applied\&. ++.TP ++\fB15\&.\fP \fIVisibility enhancment\fP ++Any modifications to make characters visible using the \fB(V)\fP flag ++are applied\&. ++.TP ++\fB16\&.\fP \fIForced Splitting\fP ++If one of the `\fB(s)\fP\&', `\fB(f)\fP' or `\fB(z)\fP' flags are present, or the `\fB=\fP' ++specifier was present (e\&.g\&. \fB${=\fP\fIvar\fP\fB}\fP), the word is split on ++occurrences of the specified string, or (for \fB=\fP with neither of the two ++flags present) any of the characters in \fB$IFS\fP\&. ++.TP ++\fB17\&.\fP \fIShell Word Splitting\fP ++If no `\fB(s)\fP\&', `\fB(f)\fP' or `\fB=\fP' was given, but the word is not ++quoted and the option \fBSH_WORD_SPLIT\fP is set, the word is split on ++occurrences of any of the characters in \fB$IFS\fP\&. Note this step, too, ++takes place at all levels of a nested substitution\&. ++.TP ++\fB18\&.\fP \fIUniqueness\fP ++If the result is an array and the `\fB(u)\fP\&' flag was present, duplicate ++elements are removed from the array\&. ++.TP ++\fB19\&.\fP \fIOrdering\fP ++If the result is still an array and one of the `\fB(o)\fP\&' or `\fB(O)\fP' flags ++was present, the array is reordered\&. ++.TP ++\fB20\&.\fP \fIRe\-Evaluation\fP ++Any `\fB(e)\fP\&' flag is applied to the value, forcing it to be re\-examined ++for new parameter substitutions, but also for command and arithmetic ++substitutions\&. ++.TP ++\fB21\&.\fP \fIPadding\fP ++Any padding of the value by the `\fB(l\&.\fP\fIfill\fP\fB\&.)\fP\&' or ++`\fB(r\&.\fP\fIfill\fP\fB\&.)\fP\&' flags is applied\&. ++.TP ++\fB22\&.\fP \fISemantic Joining\fP ++In contexts where expansion semantics requires a single word to ++result, all words are rejoined with the first character of \fBIFS\fP ++between\&. So in `\fB${(P\fP\fB)${(f\fP\fB)lines}}\fP\&' ++the value of \fB${lines}\fP is split at newlines, but then must be ++joined again before the \fBP\fP flag can be applied\&. ++.RS ++.PP ++If a single word is not required, this rule is skipped\&. ++.RE ++.TP ++\fB23\&.\fP \fIEmpty argument removal\fP ++If the substitution does not appear in double quotes, any resulting ++zero\-length argument, whether from a scalar or an element of an array, ++is elided from the list of arguments inserted into the command line\&. ++.RS ++.PP ++Strictly speaking, the removal happens later as the same happens with ++other forms of substitution; the point to note here is simply that ++it occurs after any of the above parameter operations\&. ++.RE ++.RE ++.PP ++.SS "Examples" ++The flag \fBf\fP is useful to split a double\-quoted substitution line by ++line\&. For example, \fB${(f)"$(<\fP\fIfile\fP\fB)"}\fP ++substitutes the contents of \fIfile\fP divided so that each line is ++an element of the resulting array\&. Compare this with the effect of ++\fB$\fP\fB(<\fP\fIfile\fP\fB)\fP alone, which divides the file ++up by words, or the same inside double quotes, which makes the entire ++content of the file a single string\&. ++.PP ++The following illustrates the rules for nested parameter expansions\&. ++Suppose that \fB$foo\fP contains the array \fB(bar baz\fP\fB)\fP: ++.PP ++.PD 0 ++.TP ++.PD ++\fB"${(@)${foo}[1]}"\fP ++This produces the result \fBb\fP\&. First, the inner substitution ++\fB"${foo}"\fP, which has no array (\fB@\fP) flag, produces a single word ++result \fB"bar baz"\fP\&. The outer substitution \fB"${(@)\&.\&.\&.[1]}"\fP detects ++that this is a scalar, so that (despite the `\fB(@)\fP\&' flag) the subscript ++picks the first character\&. ++.TP ++\fB"${${(@)foo}[1]}"\fP ++This produces the result `\fBbar\fP\&'\&. In this case, the inner substitution ++\fB"${(@)foo}"\fP produces the array `\fB(bar baz\fP\fB)\fP\&'\&. The outer ++substitution \fB"${\&.\&.\&.[1]}"\fP detects that this is an array and picks the ++first word\&. This is similar to the simple case \fB"${foo[1]}"\fP\&. ++.PP ++As an example of the rules for word splitting and joining, suppose \fB$foo\fP ++contains the array `\fB(ax1 bx1\fP\fB)\fP\&'\&. Then ++.PP ++.PD 0 ++.TP ++.PD ++\fB${(s/x/)foo}\fP ++produces the words `\fBa\fP\&', `\fB1 b\fP' and `\fB1\fP'\&. ++.TP ++\fB${(j/x/s/x/)foo}\fP ++produces `\fBa\fP\&', `\fB1\fP', `\fBb\fP' and `\fB1\fP'\&. ++.TP ++\fB${(s/x/)foo%%1*}\fP ++produces `\fBa\fP\&' and `\fB b\fP' (note the extra space)\&. As substitution ++occurs before either joining or splitting, the operation first generates ++the modified array \fB(ax bx\fP\fB)\fP, which is joined to give ++\fB"ax bx"\fP, and then split to give `\fBa\fP\&', `\fB b\fP' and `'\&. The final ++empty string will then be elided, as it is not in double quotes\&. ++.PP ++.SH "COMMAND SUBSTITUTION" ++A command enclosed in parentheses preceded by a dollar sign, like ++`\fB$(\fP\&.\&.\&.\fB)\fP\&', or quoted with grave ++accents, like `\fB`\fP\&.\&.\&.\fB`\fP\&', is replaced with its standard output, with ++any trailing newlines deleted\&. ++If the substitution is not enclosed in double quotes, the ++output is broken into words using the \fBIFS\fP parameter\&. ++The substitution `\fB$(cat\fP \fIfoo\fP\fB)\fP\&' may be replaced ++by the equivalent but faster `\fB$(<\fP\fIfoo\fP\fB)\fP\&'\&. ++In either case, if the option \fBGLOB_SUBST\fP is set, ++the output is eligible for filename generation\&. ++.SH "ARITHMETIC EXPANSION" ++A string of the form `\fB$[\fP\fIexp\fP\fB]\fP\&' or ++`\fB$((\fP\fIexp\fP\fB))\fP\&' is substituted ++with the value of the arithmetic expression \fIexp\fP\&. \fIexp\fP is ++subjected to \fIparameter expansion\fP, \fIcommand substitution\fP ++and \fIarithmetic expansion\fP before it is evaluated\&. ++See the section `Arithmetic Evaluation\&'\&. ++.SH "BRACE EXPANSION" ++A string of the form ++`\fIfoo\fP\fB{\fP\fIxx\fP\fB,\fP\fIyy\fP\fB,\fP\fIzz\fP\fB}\fP\fIbar\fP\&' ++is expanded to the individual words ++`\fIfooxxbar\fP\&', `\fIfooyybar\fP' and `\fIfoozzbar\fP'\&. ++Left\-to\-right order is preserved\&. This construct ++may be nested\&. Commas may be quoted in order to ++include them literally in a word\&. ++.PP ++An expression of the form `\fB{\fP\fIn1\fP\fB\&.\&.\fP\fIn2\fP\fB}\fP\&', ++where \fIn1\fP and \fIn2\fP are integers, ++is expanded to every number between ++\fIn1\fP and \fIn2\fP inclusive\&. If either number begins with a ++zero, all the resulting numbers will be padded with leading zeroes to ++that minimum width, but for negative numbers the \fB\-\fP character is also ++included in the width\&. If the numbers are in decreasing order the ++resulting sequence will also be in decreasing order\&. ++.PP ++An expression of the form `\fB{\fP\fIn1\fP\fB\&.\&.\fP\fIn2\fP\fB\&.\&.\fP\fIn3\fP\fB}\fP\&', ++where \fIn1\fP, \fIn2\fP, and \fIn3\fP are integers, ++is expanded as above, but only every \fIn3\fPth number starting from \fIn1\fP ++is output\&. If \fIn3\fP is negative the numbers are output in reverse order, ++this is slightly different from simply swapping \fIn1\fP and \fIn2\fP in the case ++that the step \fIn3\fP doesn\&'t evenly divide the range\&. Zero padding can be ++specified in any of the three numbers, specifying it in the third can be useful ++to pad for example `\fB{\-99\&.\&.100\&.\&.01}\fP\&' which is not possible to specify by putting a ++0 on either of the first two numbers (i\&.e\&. pad to two characters)\&. ++.PP ++If a brace expression matches none of the above forms, it is left ++unchanged, unless the option \fBBRACE_CCL\fP (an abbreviation for `brace ++character class\&') is set\&. ++In that case, it is expanded to a list of the individual ++characters between the braces sorted into the order of the characters ++in the ASCII character set (multibyte characters are not currently ++handled)\&. The syntax is similar to a ++\fB[\fP\&.\&.\&.\fB]\fP expression in filename generation: ++`\fB\-\fP\&' is treated specially to denote a range of characters, but `\fB^\fP' or ++`\fB!\fP\&' as the first character is treated normally\&. For example, ++`\fB{abcdef0\-9}\fP\&' expands to 16 words \fB0 1 2 3 4 5 6 7 8 9 a b c d e f\fP\&. ++.PP ++Note that brace expansion is not part of filename generation (globbing); an ++expression such as \fB*/{foo,bar}\fP is split into two separate words ++\fB*/foo\fP and \fB*/bar\fP before filename generation takes place\&. In ++particular, note that this is liable to produce a `no match\&' error if ++\fIeither\fP of the two expressions does not match; this is to be contrasted ++with \fB*/(foo|bar)\fP, which is treated as a single pattern but otherwise ++has similar effects\&. ++.PP ++To combine brace expansion with array expansion, see the ++\fB${^\fP\fIspec\fP\fB}\fP form described ++in the section Parameter Expansion ++above\&. ++.PP ++.SH "FILENAME EXPANSION" ++Each word is checked to see if it begins with an unquoted `\fB~\fP\&'\&. ++If it does, then the word up to a `\fB/\fP\&', ++or the end of the word if there is no `\fB/\fP\&', ++is checked to see if it can be substituted in one of the ways ++described here\&. If so, then the `\fB~\fP\&' and the checked portion are ++replaced with the appropriate substitute value\&. ++.PP ++A `\fB~\fP\&' by itself is replaced by the value of \fB$HOME\fP\&. ++A `\fB~\fP\&' followed by a `\fB+\fP' or a `\fB\-\fP' is replaced by current ++or previous working directory, respectively\&. ++.PP ++A `\fB~\fP\&' followed by a number is replaced by the directory at that ++position in the directory stack\&. ++`\fB~0\fP\&' is equivalent to `\fB~+\fP', ++and `\fB~1\fP\&' is the top of the stack\&. ++`\fB~+\fP\&' followed by a number is replaced by the directory at that ++position in the directory stack\&. ++`\fB~+0\fP\&' is equivalent to `\fB~+\fP', ++and `\fB~+1\fP\&' is the top of the stack\&. ++`\fB~\-\fP\&' followed by a number is replaced by the directory that ++many positions from the bottom of the stack\&. ++`\fB~\-0\fP\&' is the bottom of the stack\&. ++The \fBPUSHD_MINUS\fP ++option exchanges the effects of `\fB~+\fP\&' and `\fB~\-\fP' where they are ++followed by a number\&. ++.PP ++.SS "Dynamic named directories" ++.PP ++If the function \fBzsh_directory_name\fP exists, or the shell variable ++\fBzsh_directory_name_functions\fP exists and contains an array of ++function names, then the functions are used to implement dynamic ++directory naming\&. The functions are tried in order until one returns ++status zero, so it is important that functions test whether they can ++handle the case in question and return an appropriate status\&. ++.PP ++A `\fB~\fP\&' followed by a string \fInamstr\fP in unquoted square brackets is ++treated specially as a dynamic directory name\&. Note that the first ++unquoted closing square bracket always terminates \fInamstr\fP\&. The shell ++function is passed two arguments: the string \fBn\fP (for name) and ++\fInamstr\fP\&. It should either set the array \fBreply\fP to a single element ++which is the directory corresponding to the name and return status zero ++(executing an assignment as the last statement is usually sufficient), or ++it should return status non\-zero\&. In the former case the element of reply ++is used as the directory; in the latter case the substitution is deemed to ++have failed\&. If all functions fail and the option \fBNOMATCH\fP is set, ++an error results\&. ++.PP ++The functions defined as above are also used to see if a directory can ++be turned into a name, for example when printing the directory stack or ++when expanding \fB%~\fP in prompts\&. In this case each function is passed two ++arguments: the string \fBd\fP (for directory) and the candidate for dynamic ++naming\&. The function should either return non\-zero status, if the ++directory cannot be named by the function, or it should set the array reply ++to consist of two elements: the first is the dynamic name for the directory ++(as would appear within `\fB~[\fP\fI\&.\&.\&.\fP\fB]\fP\&'), and the second is the ++prefix length of the directory to be replaced\&. For example, if the trial ++directory is \fB/home/myname/src/zsh\fP and the dynamic name for ++\fB/home/myname/src\fP (which has 16 characters) is \fBs\fP, then the function ++sets ++.PP ++.RS ++.nf ++\fBreply=(s 16)\fP ++.fi ++.RE ++.PP ++The directory name so returned is compared with possible static names for ++parts of the directory path, as described below; it is used if the prefix ++length matched (16 in the example) is longer than that matched by any ++static name\&. ++.PP ++It is not a requirement that a function implements both ++\fBn\fP and \fBd\fP calls; for example, it might be appropriate for certain ++dynamic forms of expansion not to be contracted to names\&. In that case ++any call with the first argument \fBd\fP should cause a non\-zero status to ++be returned\&. ++.PP ++The completion system calls `\fBzsh_directory_name c\fP\&' followed by ++equivalent calls to elements of the array ++\fBzsh_directory_name_functions\fP, if it exists, in order to ++complete dynamic names for directories\&. The code for this should be ++as for any other completion function as described in ++\fIzshcompsys\fP(1)\&. ++.PP ++As a working example, here is a function that expands any dynamic names ++beginning with the string \fBp:\fP to directories below ++\fB/home/pws/perforce\fP\&. In this simple case a static name for the ++directory would be just as effective\&. ++.PP ++.RS ++.nf ++\fBzsh_directory_name() { ++ emulate \-L zsh ++ setopt extendedglob ++ local \-a match mbegin mend ++ if [[ $1 = d ]]; then ++ # turn the directory into a name ++ if [[ $2 = (#b)(/home/pws/perforce/)([^/]##)* ]]; then ++ typeset \-ga reply ++ reply=(p:$match[2] $(( ${#match[1]} + ${#match[2]} )) ) ++ else ++ return 1 ++ fi ++ elif [[ $1 = n ]]; then ++ # turn the name into a directory ++ [[ $2 != (#b)p:(?*) ]] && return 1 ++ typeset \-ga reply ++ reply=(/home/pws/perforce/$match[1]) ++ elif [[ $1 = c ]]; then ++ # complete names ++ local expl ++ local \-a dirs ++ dirs=(/home/pws/perforce/*(/:t)) ++ dirs=(p:${^dirs}) ++ _wanted dynamic\-dirs expl \&'dynamic directory' compadd \-S\e] \-a dirs ++ return ++ else ++ return 1 ++ fi ++ return 0 ++}\fP ++.fi ++.RE ++.PP ++.SS "Static named directories" ++A `\fB~\fP\&' followed by anything not already covered consisting ++of any number of alphanumeric characters or underscore (`\fB_\fP\&'), ++hyphen (`\fB\-\fP\&'), or dot (`\fB\&.\fP') is looked up as a ++named directory, and replaced by the value of that named directory if found\&. ++Named directories are typically home directories for users on the system\&. ++They may also be defined if the text after the `\fB~\fP\&' is the name ++of a string shell parameter whose value begins with a `\fB/\fP\&'\&. ++Note that trailing slashes will be removed from the path to the directory ++(though the original parameter is not modified)\&. ++.PP ++It is also possible to define directory names using the \fB\-d\fP option to the ++\fBhash\fP builtin\&. ++.PP ++In certain circumstances (in prompts, for instance), when the shell ++prints a path, the path is checked to see if it has a named ++directory as its prefix\&. If so, then the prefix portion ++is replaced with a `\fB~\fP\&' followed by the name of the directory\&. ++The shortest way of referring to the directory is used, ++with ties broken in favour of using a named directory, ++except when the directory is \fB/\fP itself\&. The parameters \fB$PWD\fP and ++\fB$OLDPWD\fP are never abbreviated in this fashion\&. ++.PP ++.SS "`=\&' expansion" ++.PP ++If a word begins with an unquoted `\fB=\fP\&' ++and the \fBEQUALS\fP option is set, ++the remainder of the word is taken as the ++name of a command\&. If a command ++exists by that name, the word is replaced ++by the full pathname of the command\&. ++.PP ++.SS "Notes" ++.PP ++Filename expansion is performed on the right hand side of a parameter ++assignment, including those appearing after commands of the ++\fBtypeset\fP family\&. In this case, the right hand side will be treated ++as a colon\-separated list in the manner of the \fBPATH\fP parameter, ++so that a `\fB~\fP\&' or an `\fB=\fP' following a `\fB:\fP' is eligible for expansion\&. ++All such behaviour can be ++disabled by quoting the `\fB~\fP\&', the `\fB=\fP', or the whole expression (but not ++simply the colon); the \fBEQUALS\fP option is also respected\&. ++.PP ++If the option \fBMAGIC_EQUAL_SUBST\fP is set, any unquoted shell ++argument in the form `\fIidentifier\fP\fB=\fP\fIexpression\fP\&' becomes eligible ++for file expansion as described in the previous paragraph\&. Quoting the ++first `\fB=\fP\&' also inhibits this\&. ++.PP ++.SH "FILENAME GENERATION" ++If a word contains an unquoted instance of one of the characters ++`\fB*\fP\&', `\fB(\fP', `\fB|\fP', `\fB<\fP', `\fB[\fP', or `\fB?\fP', it is regarded ++as a pattern for filename generation, unless the \fBGLOB\fP option is unset\&. ++If the \fBEXTENDED_GLOB\fP option is set, ++the `\fB^\fP\&' and `\fB#\fP' characters also denote a pattern; otherwise ++they are not treated specially by the shell\&. ++.PP ++The word is replaced with a list of sorted filenames that match ++the pattern\&. If no matching pattern is found, the shell gives ++an error message, unless the \fBNULL_GLOB\fP option is set, ++in which case the word is deleted; or unless the \fBNOMATCH\fP ++option is unset, in which case the word is left unchanged\&. ++.PP ++In filename generation, ++the character `\fB/\fP\&' must be matched explicitly; ++also, a `\fB\&.\fP\&' must be matched ++explicitly at the beginning of a pattern or after a `\fB/\fP\&', unless the ++\fBGLOB_DOTS\fP option is set\&. ++No filename generation pattern ++matches the files `\fB\&.\fP\&' or `\fB\&.\&.\fP'\&. In other instances of pattern ++matching, the `\fB/\fP\&' and `\fB\&.\fP' are not treated specially\&. ++.SS "Glob Operators" ++.PD 0 ++.TP ++.PD ++\fB*\fP ++Matches any string, including the null string\&. ++.TP ++\fB?\fP ++Matches any character\&. ++.TP ++\fB[\fP\&.\&.\&.\fB]\fP ++Matches any of the enclosed characters\&. Ranges of characters ++can be specified by separating two characters by a `\fB\-\fP\&'\&. ++A `\fB\-\fP\&' or `\fB]\fP' may be matched by including it as the ++first character in the list\&. ++There are also several named classes of characters, in the form ++`\fB[:\fP\fIname\fP\fB:]\fP\&' with the following meanings\&. ++The first set use the macros provided by ++the operating system to test for the given character combinations, ++including any modifications due to local language settings, see ++\fIctype\fP(3): ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB[:alnum:]\fP ++The character is alphanumeric ++.TP ++\fB[:alpha:]\fP ++The character is alphabetic ++.TP ++\fB[:ascii:]\fP ++The character is 7\-bit, i\&.e\&. is a single\-byte character without ++the top bit set\&. ++.TP ++\fB[:blank:]\fP ++The character is either space or tab ++.TP ++\fB[:cntrl:]\fP ++The character is a control character ++.TP ++\fB[:digit:]\fP ++The character is a decimal digit ++.TP ++\fB[:graph:]\fP ++The character is a printable character other than whitespace ++.TP ++\fB[:lower:]\fP ++The character is a lowercase letter ++.TP ++\fB[:print:]\fP ++The character is printable ++.TP ++\fB[:punct:]\fP ++The character is printable but neither alphanumeric nor whitespace ++.TP ++\fB[:space:]\fP ++The character is whitespace ++.TP ++\fB[:upper:]\fP ++The character is an uppercase letter ++.TP ++\fB[:xdigit:]\fP ++The character is a hexadecimal digit ++.PP ++Another set of named classes is handled internally by the shell and ++is not sensitive to the locale: ++.PP ++.PD 0 ++.TP ++.PD ++\fB[:IDENT:]\fP ++The character is allowed to form part of a shell identifier, such ++as a parameter name ++.TP ++\fB[:IFS:]\fP ++The character is used as an input field separator, i\&.e\&. is contained in the ++\fBIFS\fP parameter ++.TP ++\fB[:IFSSPACE:]\fP ++The character is an IFS white space character; see the documentation ++for \fBIFS\fP in ++the \fIzshparam\fP(1) manual page\&. ++.TP ++\fB[:WORD:]\fP ++The character is treated as part of a word; this test is sensitive ++to the value of the \fBWORDCHARS\fP parameter ++.PP ++Note that the square brackets are additional ++to those enclosing the whole set of characters, so to test for a ++single alphanumeric character you need `\fB[[:alnum:]]\fP\&'\&. Named ++character sets can be used alongside other types, ++e\&.g\&. `\fB[[:alpha:]0\-9]\fP\&'\&. ++.RE ++.TP ++.PD 0 ++\fB[^\fP\&.\&.\&.\fB]\fP ++.TP ++.PD ++\fB[!\fP\&.\&.\&.\fB]\fP ++Like \fB[\fP\&.\&.\&.\fB]\fP, except that it matches any character which is ++not in the given set\&. ++.TP ++\fB<\fP[\fIx\fP]\fB\-\fP[\fIy\fP]\fB>\fP ++Matches any number in the range \fIx\fP to \fIy\fP, inclusive\&. ++Either of the numbers may be omitted to make the range open\-ended; ++hence `\fB<\->\fP\&' matches any number\&. To match individual digits, the ++\fB[\fP\&.\&.\&.\fB]\fP form is more efficient\&. ++.RS ++.PP ++Be careful when using other wildcards adjacent to patterns of this form; ++for example, \fB<0\-9>*\fP will actually match any number whatsoever at the ++start of the string, since the `\fB<0\-9>\fP\&' will match the first digit, and ++the `\fB*\fP\&' will match any others\&. This is a trap for the unwary, but is ++in fact an inevitable consequence of the rule that the longest possible ++match always succeeds\&. Expressions such as `\fB<0\-9>[^[:digit:]]*\fP\&' can be ++used instead\&. ++.RE ++.TP ++\fB(\fP\&.\&.\&.\fB)\fP ++Matches the enclosed pattern\&. This is used for grouping\&. ++If the \fBKSH_GLOB\fP option is set, then a ++`\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP' immediately preceding ++the `\fB(\fP\&' is treated specially, as detailed below\&. The option ++\fBSH_GLOB\fP prevents bare parentheses from being used in this way, though ++the \fBKSH_GLOB\fP option is still available\&. ++.RS ++.PP ++Note that grouping cannot extend over multiple directories: it is an error ++to have a `\fB/\fP\&' within a group (this only applies for patterns used in ++filename generation)\&. There is one exception: a group of the form ++\fB(\fP\fIpat\fP\fB/)#\fP appearing as a complete path segment can ++match a sequence of directories\&. For example, \fBfoo/(a*/)#bar\fP matches ++\fBfoo/bar\fP, \fBfoo/any/bar\fP, \fBfoo/any/anyother/bar\fP, and so on\&. ++.RE ++.TP ++\fIx\fP\fB|\fP\fIy\fP ++Matches either \fIx\fP or \fIy\fP\&. ++This operator has lower precedence than any other\&. ++The `\fB|\fP\&' character ++must be within parentheses, to avoid interpretation as a pipeline\&. ++.TP ++\fB^\fP\fIx\fP ++(Requires \fBEXTENDED_GLOB\fP to be set\&.) ++Matches anything except the pattern \fIx\fP\&. ++This has a higher precedence than `\fB/\fP\&', so `\fB^foo/bar\fP' ++will search directories in `\fB\&.\fP\&' except `\fB\&./foo\fP' ++for a file named `\fBbar\fP\&'\&. ++.TP ++\fIx\fP\fB~\fP\fIy\fP ++(Requires \fBEXTENDED_GLOB\fP to be set\&.) ++Match anything that matches the pattern \fIx\fP but does not match \fIy\fP\&. ++This has lower precedence than any operator except `\fB|\fP\&', so ++`\fB*/*~foo/bar\fP\&' will search for all files in all directories in `\fB\&.\fP' ++and then exclude `\fBfoo/bar\fP\&' if there was such a match\&. ++Multiple patterns can be excluded by ++`\fIfoo\fP\fB~\fP\fIbar\fP\fB~\fP\fIbaz\fP\&'\&. ++In the exclusion pattern (\fIy\fP), `\fB/\fP\&' and `\fB\&.\fP' are not treated ++specially the way they usually are in globbing\&. ++.TP ++\fIx\fP\fB#\fP ++(Requires \fBEXTENDED_GLOB\fP to be set\&.) ++Matches zero or more occurrences of the pattern \fIx\fP\&. ++This operator has high precedence; `\fB12#\fP\&' is equivalent to `\fB1(2#)\fP', ++rather than `\fB(12)#\fP\&'\&. It is an error for an unquoted `\fB#\fP' to follow ++something which cannot be repeated; this includes an empty string, a ++pattern already followed by `\fB##\fP\&', or parentheses when part of a ++\fBKSH_GLOB\fP pattern (for example, `\fB!(\fP\fIfoo\fP\fB)#\fP\&' is ++invalid and must be replaced by ++`\fB*(!(\fP\fIfoo\fP\fB))\fP\&')\&. ++.TP ++\fIx\fP\fB##\fP ++(Requires \fBEXTENDED_GLOB\fP to be set\&.) ++Matches one or more occurrences of the pattern \fIx\fP\&. ++This operator has high precedence; `\fB12##\fP\&' is equivalent to `\fB1(2##)\fP', ++rather than `\fB(12)##\fP\&'\&. No more than two active `\fB#\fP' characters may ++appear together\&. (Note the potential clash with glob qualifiers in the ++form `\fB1(2##)\fP\&' which should therefore be avoided\&.) ++.SS "ksh\-like Glob Operators" ++If the \fBKSH_GLOB\fP option is set, the effects of parentheses can be ++modified by a preceding `\fB@\fP\&', `\fB*\fP', `\fB+\fP', `\fB?\fP' or `\fB!\fP'\&. ++This character need not be unquoted to have special effects, ++but the `\fB(\fP\&' must be\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fB@(\fP\&.\&.\&.\fB)\fP ++Match the pattern in the parentheses\&. (Like `\fB(\fP\&.\&.\&.\fB)\fP\&'\&.) ++.TP ++\fB*(\fP\&.\&.\&.\fB)\fP ++Match any number of occurrences\&. (Like `\fB(\fP\&.\&.\&.\fB)#\fP\&'\&.) ++.TP ++\fB+(\fP\&.\&.\&.\fB)\fP ++Match at least one occurrence\&. (Like `\fB(\fP\&.\&.\&.\fB)##\fP\&'\&.) ++.TP ++\fB?(\fP\&.\&.\&.\fB)\fP ++Match zero or one occurrence\&. (Like `\fB(|\fP\&.\&.\&.\fB)\fP\&'\&.) ++.TP ++\fB!(\fP\&.\&.\&.\fB)\fP ++Match anything but the expression in parentheses\&. ++(Like `\fB(^(\fP\&.\&.\&.\fB))\fP\&'\&.) ++.SS "Precedence" ++The precedence of the operators given above is (highest) `\fB^\fP\&', `\fB/\fP', ++`\fB~\fP\&', `\fB|\fP' (lowest); the ++remaining operators are simply treated from left to right as part of a ++string, with `\fB#\fP\&' and `\fB##\fP' applying to the shortest possible ++preceding unit (i\&.e\&. a character, `\fB?\fP\&', `\fB[\fP\&.\&.\&.\fB]\fP', ++`\fB<\fP\&.\&.\&.\fB>\fP\&', or a parenthesised expression)\&. As mentioned ++above, a `\fB/\fP\&' used as a directory separator may not appear inside ++parentheses, while a `\fB|\fP\&' must do so; in patterns used in other contexts ++than filename generation (for example, in \fBcase\fP statements and tests ++within `\fB[[\fP\&.\&.\&.\fB]]\fP\&'), a `\fB/\fP' is not special; and `\fB/\fP' is also ++not special after a `\fB~\fP\&' appearing outside parentheses in a filename ++pattern\&. ++.SS "Globbing Flags" ++There are various flags which affect any text to their right up to the ++end of the enclosing group or to the end of the pattern; they require ++the \fBEXTENDED_GLOB\fP option\&. All take the form ++\fB(#\fP\fIX\fP\fB)\fP where \fIX\fP may have one of the following ++forms: ++.PP ++.PD 0 ++.TP ++.PD ++\fBi\fP ++Case insensitive: upper or lower case characters in the pattern match ++upper or lower case characters\&. ++.TP ++\fBl\fP ++Lower case characters in the pattern match upper or lower case ++characters; upper case characters in the pattern still only match ++upper case characters\&. ++.TP ++\fBI\fP ++Case sensitive: locally negates the effect of \fBi\fP or \fBl\fP from ++that point on\&. ++.TP ++\fBb\fP ++Activate backreferences for parenthesised groups in the pattern; ++this does not work in filename generation\&. When a pattern with a set of ++active parentheses is matched, the strings matched by the groups are ++stored in the array \fB$match\fP, the indices of the beginning of the matched ++parentheses in the array \fB$mbegin\fP, and the indices of the end in the array ++\fB$mend\fP, with the first element of each array corresponding to the first ++parenthesised group, and so on\&. These arrays are not otherwise special to ++the shell\&. The indices use the same convention as does parameter ++substitution, so that elements of \fB$mend\fP and \fB$mbegin\fP may be used in ++subscripts; the \fBKSH_ARRAYS\fP option is respected\&. Sets of globbing flags ++are not considered parenthesised groups; only the first nine active ++parentheses can be referenced\&. ++.RS ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBfoo="a string with a message" ++if [[ $foo = (a|an)\&' '(#b)(*)' '* ]]; then ++ print ${foo[$mbegin[1],$mend[1]]} ++fi\fP ++.fi ++.RE ++.PP ++prints `\fBstring with a\fP\&'\&. Note that the first parenthesis is before the ++\fB(#b)\fP and does not create a backreference\&. ++.PP ++Backreferences work with all forms of pattern matching other than filename ++generation, but note that when performing matches on an entire array, such ++as \fB${\fP\fIarray\fP\fB#\fP\fIpattern\fP\fB}\fP, or a global substitution, such ++as \fB${\fP\fIparam\fP\fB//\fP\fIpat\fP\fB/\fP\fIrepl\fP\fB}\fP, only the data for the ++last match remains available\&. In the case of global replacements this may ++still be useful\&. See the example for the \fBm\fP flag below\&. ++.PP ++The numbering of backreferences strictly follows the order of the opening ++parentheses from left to right in the pattern string, although sets of ++parentheses may be nested\&. There are special rules for parentheses followed ++by `\fB#\fP\&' or `\fB##\fP'\&. Only the last match of the parenthesis is ++remembered: for example, in `\fB[[ abab = (#b)([ab])# ]]\fP\&', only the final ++`\fBb\fP\&' is stored in \fBmatch[1]\fP\&. Thus extra parentheses may be necessary ++to match the complete segment: for example, use ++`\fBX((ab|cd)#)Y\fP\&' to match ++a whole string of either `\fBab\fP\&' or `\fBcd\fP' between `\fBX\fP' and `\fBY\fP', ++using the value of \fB$match[1]\fP rather than \fB$match[2]\fP\&. ++.PP ++If the match fails none of the parameters is altered, so in some cases it ++may be necessary to initialise them beforehand\&. If some of the ++backreferences fail to match \-\- which happens if they are in an alternate ++branch which fails to match, or if they are followed by \fB#\fP and matched ++zero times \-\- then the matched string is set to the empty string, and the ++start and end indices are set to \-1\&. ++.PP ++Pattern matching with backreferences is slightly slower than without\&. ++.RE ++.TP ++\fBB\fP ++Deactivate backreferences, negating the effect of the \fBb\fP flag from that ++point on\&. ++.TP ++\fBc\fP\fIN\fP\fB,\fP\fIM\fP ++The flag \fB(#c\fP\fIN\fP\fB,\fP\fIM\fP\fB)\fP can be used anywhere ++that the \fB#\fP or \fB##\fP operators can be used except in the expressions ++`\fB(*/)#\fP\&' and `\fB(*/)##\fP' in filename generation, where `\fB/\fP' ++has special meaning; it cannot be combined with other globbing flags and ++a bad pattern error occurs if it is misplaced\&. It is equivalent to the ++form \fB{\fP\fIN\fP\fB,\fP\fIM\fP\fB}\fP in regular expressions\&. The previous ++character or group is required to match between \fIN\fP and \fIM\fP times, ++inclusive\&. The form \fB(#c\fP\fIN\fP\fB)\fP requires exactly \fBN\fP ++matches; \fB(#c,\fP\fIM\fP\fB)\fP is equivalent to specifying \fIN\fP ++as 0; \fB(#c\fP\fIN\fP\fB,)\fP specifies that there is no maximum ++limit on the number of matches\&. ++.TP ++\fBm\fP ++Set references to the match data for the entire string matched; this is ++similar to backreferencing and does not work in filename generation\&. The ++flag must be in effect at the end of the pattern, i\&.e\&. not local to a ++group\&. The parameters \fB$MATCH\fP, \fB$MBEGIN\fP and \fB$MEND\fP will be set to ++the string matched and to the indices of the beginning and end of the ++string, respectively\&. This is most useful in parameter substitutions, as ++otherwise the string matched is obvious\&. ++.RS ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBarr=(veldt jynx grimps waqf zho buck) ++print ${arr//(#m)[aeiou]/${(U)MATCH}}\fP ++.fi ++.RE ++.PP ++forces all the matches (i\&.e\&. all vowels) into uppercase, printing ++`\fBvEldt jynx grImps wAqf zhO bUck\fP\&'\&. ++.PP ++Unlike backreferences, there is no speed penalty for using match ++references, other than the extra substitutions required for the ++replacement strings in cases such as the example shown\&. ++.RE ++.TP ++\fBM\fP ++Deactivate the \fBm\fP flag, hence no references to match data will be ++created\&. ++.TP ++\fBa\fP\fInum\fP ++Approximate matching: \fInum\fP errors are allowed in the string matched by ++the pattern\&. The rules for this are described in the next subsection\&. ++.TP ++\fBs\fP, \fBe\fP ++Unlike the other flags, these have only a local effect, and each must ++appear on its own: `\fB(#s)\fP\&' and `\fB(#e)\fP' are the only valid forms\&. ++The `\fB(#s)\fP\&' flag succeeds only at the start of the test string, and the ++`\fB(#e)\fP\&' flag succeeds only at the end of the test string; they ++correspond to `\fB^\fP\&' and `\fB$\fP' in standard regular expressions\&. They ++are useful for matching path segments in patterns other than those in ++filename generation (where path segments are in any case treated ++separately)\&. For example, `\fB*((#s)|/)test((#e)|/)*\fP\&' matches ++a path segment `\fBtest\fP\&' in any of the following strings: \fBtest\fP, ++\fBtest/at/start\fP, \fBat/end/test\fP, \fBin/test/middle\fP\&. ++.RS ++.PP ++Another use is in parameter substitution; for example ++`\fB${array/(#s)A*Z(#e)}\fP\&' will remove only elements of an ++array which ++match the complete pattern `\fBA*Z\fP\&'\&. There are other ways of performing ++many operations of this type, however the combination of the substitution ++operations `\fB/\fP\&' and `\fB//\fP' with the `\fB(#s)\fP' and `\fB(#e)\fP' flags ++provides a single simple and memorable method\&. ++.PP ++Note that assertions of the form `\fB(^(#s))\fP\&' also work, i\&.e\&. match ++anywhere except at the start of the string, although this actually means ++`anything except a zero\-length portion at the start of the string\&'; you ++need to use `\fB(""~(#s))\fP\&' to match a zero\-length portion of the string ++not at the start\&. ++.RE ++.TP ++\fBq\fP ++A `\fBq\fP\&' and everything up to the closing parenthesis of the globbing ++flags are ignored by the pattern matching code\&. This is intended to ++support the use of glob qualifiers, see below\&. The result is that ++the pattern `\fB(#b)(*)\&.c(#q\&.)\fP\&' can be used both for globbing ++and for ++matching against a string\&. In the former case, the `\fB(#q\&.)\fP\&' will be ++treated as a glob qualifier and the `\fB(#b)\fP\&' will not be useful, while in ++the latter case the `\fB(#b)\fP\&' is useful for backreferences and the ++`\fB(#q\&.)\fP\&' will be ignored\&. Note that colon modifiers in the glob ++qualifiers are also not applied in ordinary pattern matching\&. ++.TP ++\fBu\fP ++Respect the current locale in determining the presence of multibyte ++characters in a pattern, provided the shell was compiled with ++\fBMULTIBYTE_SUPPORT\fP\&. This overrides the \fBMULTIBYTE\fP ++option; the default behaviour is taken from the option\&. Compare \fBU\fP\&. ++(Mnemonic: typically multibyte characters are from Unicode in the UTF\-8 ++encoding, although any extension of ASCII supported by the system ++library may be used\&.) ++.TP ++\fBU\fP ++All characters are considered to be a single byte long\&. The opposite ++of \fBu\fP\&. This overrides the \fBMULTIBYTE\fP option\&. ++.PP ++For example, the test string \fBfooxx\fP can be matched by the pattern ++\fB(#i\fP\fB)FOOXX\fP, but not by \fB(#l\fP\fB)FOOXX\fP, ++\fB(#i\fP\fB)FOO\fP\fB(#I\fP\fB)XX\fP or ++\fB((#i\fP\fB)FOOX\fP\fB)X\fP\&. The string ++\fB(#ia2\fP\fB)readme\fP specifies case\-insensitive matching of ++\fBreadme\fP with up to two errors\&. ++.PP ++When using the ksh syntax for grouping both \fBKSH_GLOB\fP and ++\fBEXTENDED_GLOB\fP must be set and the left parenthesis should be ++preceded by \fB@\fP\&. Note also that the flags do not affect letters ++inside \fB[\&.\&.\&.]\fP groups, in other words \fB(#i\fP\fB)[a\-z]\fP ++still matches only lowercase letters\&. Finally, note that when ++examining whole paths case\-insensitively every directory must be ++searched for all files which match, so that a pattern of the form ++\fB(#i\fP\fB)/foo/bar/\&.\&.\&.\fP is potentially slow\&. ++.PP ++.SS "Approximate Matching" ++When matching approximately, the shell keeps a count of the errors found, ++which cannot exceed the number specified in the ++\fB(#a\fP\fInum\fP\fB)\fP flags\&. Four types of error are recognised: ++.PP ++.PD 0 ++.TP ++.PD ++1\&. ++Different characters, as in \fBfooxbar\fP and \fBfooybar\fP\&. ++.TP ++2\&. ++Transposition of characters, as in \fBbanana\fP and \fBabnana\fP\&. ++.TP ++3\&. ++A character missing in the target string, as with the pattern \fBroad\fP and ++target string \fBrod\fP\&. ++.TP ++4\&. ++An extra character appearing in the target string, as with \fBstove\fP ++and \fBstrove\fP\&. ++.PP ++Thus, the pattern \fB(#a3\fP\fB)abcd\fP matches \fBdcba\fP, with the ++errors occurring by using the first rule twice and the second once, ++grouping the string as \fB[d][cb][a]\fP and \fB[a][bc][d]\fP\&. ++.PP ++Non\-literal parts of the pattern must match exactly, including characters ++in character ranges: hence \fB(#a1\fP\fB)???\fP matches strings of ++length four, by applying rule 4 to an empty part of the pattern, but not ++strings of length two, since all the \fB?\fP must match\&. Other characters ++which must match exactly are initial dots in filenames (unless the ++\fBGLOB_DOTS\fP option is set), and all slashes in filenames, so that ++\fBa/bc\fP is two errors from \fBab/c\fP (the slash cannot be transposed with ++another character)\&. Similarly, errors are counted separately for ++non\-contiguous strings in the pattern, so that \fB(ab|cd\fP\fB)ef\fP ++is two errors from \fBaebf\fP\&. ++.PP ++When using exclusion via the \fB~\fP operator, approximate matching is ++treated entirely separately for the excluded part and must be activated ++separately\&. Thus, \fB(#a1\fP\fB)README~READ_ME\fP matches ++\fBREAD\&.ME\fP but not \fBREAD_ME\fP, as the trailing \fBREAD_ME\fP is matched ++without approximation\&. However, ++\fB(#a1\fP\fB)README~(#a1\fP\fB)READ_ME\fP ++does not match any pattern of the form \fBREAD\fP\fI?\fP\fBME\fP as all ++such forms are now excluded\&. ++.PP ++Apart from exclusions, there is only one overall error count; however, the ++maximum errors allowed may be altered locally, and this can be delimited by ++grouping\&. For example, ++\fB(#a1\fP\fB)cat\fP\fB((#a0\fP\fB)dog\fP\fB)fox\fP ++allows one error in total, which may not occur in the \fBdog\fP section, and ++the pattern ++\fB(#a1\fP\fB)cat\fP\fB(#a0\fP\fB)dog\fP\fB(#a1\fP\fB)fox\fP ++is equivalent\&. Note that the point at which an error is first found is the ++crucial one for establishing whether to use approximation; for example, ++\fB(#a1)abc(#a0)xyz\fP will not match \fBabcdxyz\fP, because the ++error occurs at the `\fBx\fP\&', where approximation is turned off\&. ++.PP ++Entire path segments may be matched approximately, so that ++`\fB(#a1)/foo/d/is/available/at/the/bar\fP\&' allows one error in any path ++segment\&. This is much less efficient than without the \fB(#a1)\fP, however, ++since every directory in the path must be scanned for a possible ++approximate match\&. It is best to place the \fB(#a1)\fP after any path ++segments which are known to be correct\&. ++.PP ++.SS "Recursive Globbing" ++A pathname component of the form `\fB(\fP\fIfoo\fP\fB/)#\fP\&' ++matches a path consisting of zero or more directories ++matching the pattern \fIfoo\fP\&. ++.PP ++As a shorthand, `\fB**/\fP\&' is equivalent to `\fB(*/)#\fP'; note that this ++therefore matches files in the current directory as well as ++subdirectories\&. ++Thus: ++.PP ++.RS ++.nf ++\fBls (*/)#bar\fP ++.fi ++.RE ++.PP ++or ++.PP ++.RS ++.nf ++\fBls **/bar\fP ++.fi ++.RE ++.PP ++does a recursive directory search for files named `\fBbar\fP\&' (potentially ++including the file `\fBbar\fP\&' in the current directory)\&. This form does not ++follow symbolic links; the alternative form `\fB***/\fP\&' does, but is ++otherwise identical\&. Neither of these can be combined with other forms of ++globbing within the same path segment; in that case, the `\fB*\fP\&' ++operators revert to their usual effect\&. ++.SS "Glob Qualifiers" ++Patterns used for filename generation may end in a ++list of qualifiers enclosed in parentheses\&. ++The qualifiers specify which filenames that otherwise match the given pattern ++will be inserted in the argument list\&. ++.PP ++If the option \fBBARE_GLOB_QUAL\fP is set, then a trailing set of parentheses ++containing no `\fB|\fP\&' or `\fB(\fP' characters (or `\fB~\fP' if it is special) ++is taken as a set of ++glob qualifiers\&. A glob subexpression that would normally be taken as glob ++qualifiers, for example `\fB(^x)\fP\&', can be forced to be treated as part of ++the glob pattern by doubling the parentheses, in this case producing ++`\fB((^x))\fP\&'\&. ++.PP ++If the option \fBEXTENDED_GLOB\fP is set, a different syntax for glob ++qualifiers is available, namely `\fB(#qx)\fP\&' where \fBx\fP is any of the same ++glob qualifiers used in the other format\&. The qualifiers must still appear ++at the end of the pattern\&. However, with this syntax multiple glob ++qualifiers may be chained together\&. They are treated as a logical AND of ++the individual sets of flags\&. Also, as the syntax is unambiguous, the ++expression will be treated as glob qualifiers just as long any parentheses ++contained within it are balanced; appearance of `\fB|\fP\&', `\fB(\fP' or ++`\fB~\fP\&' does not negate the effect\&. Note that qualifiers will be ++recognised in this form even if a bare glob qualifier exists at the end of ++the pattern, for example `\fB*(#q*)(\&.)\fP\&' will recognise executable regular ++files if both options are set; however, mixed syntax should probably be ++avoided for the sake of clarity\&. ++.PP ++A qualifier may be any one of the following: ++.PP ++.PD 0 ++.TP ++.PD ++\fB/\fP ++directories ++.TP ++\fBF\fP ++`full\&' (i\&.e\&. non\-empty) directories\&. Note that the ++opposite sense \fB(^F\fP\fB)\fP expands to empty directories ++and all non\-directories\&. Use \fB(/^F\fP\fB)\fP for ++empty directories\&. ++.TP ++\fB\&.\fP ++plain files ++.TP ++\fB@\fP ++symbolic links ++.TP ++\fB=\fP ++sockets ++.TP ++\fBp\fP ++named pipes (FIFOs) ++.TP ++\fB*\fP ++executable plain files (0100) ++.TP ++\fB%\fP ++device files (character or block special) ++.TP ++\fB%b\fP ++block special files ++.TP ++\fB%c\fP ++character special files ++.TP ++\fBr\fP ++owner\-readable files (0400) ++.TP ++\fBw\fP ++owner\-writable files (0200) ++.TP ++\fBx\fP ++owner\-executable files (0100) ++.TP ++\fBA\fP ++group\-readable files (0040) ++.TP ++\fBI\fP ++group\-writable files (0020) ++.TP ++\fBE\fP ++group\-executable files (0010) ++.TP ++\fBR\fP ++world\-readable files (0004) ++.TP ++\fBW\fP ++world\-writable files (0002) ++.TP ++\fBX\fP ++world\-executable files (0001) ++.TP ++\fBs\fP ++setuid files (04000) ++.TP ++\fBS\fP ++setgid files (02000) ++.TP ++\fBt\fP ++files with the sticky bit (01000) ++.TP ++\fBf\fP\fIspec\fP ++files with access rights matching \fIspec\fP\&. This \fIspec\fP may be a ++octal number optionally preceded by a `\fB=\fP\&', a `\fB+\fP', or a ++`\fB\-\fP\&'\&. If none of these characters is given, the behavior is the ++same as for `\fB=\fP\&'\&. The octal number describes the mode bits to be ++expected, if combined with a `\fB=\fP\&', the value given must match the ++file\-modes exactly, with a `\fB+\fP\&', at least the bits in the ++given number must be set in the file\-modes, and with a `\fB\-\fP\&', the ++bits in the number must not be set\&. Giving a `\fB?\fP\&' instead of a ++octal digit anywhere in the number ensures that the corresponding bits ++in the file\-modes are not checked, this is only useful in combination ++with `\fB=\fP\&'\&. ++.RS ++.PP ++If the qualifier `\fBf\fP\&' is followed by any other character anything ++up to the next matching character (`\fB[\fP\&', `\fB{\fP', and `\fB<\fP' match ++`\fB]\fP\&', `\fB}\fP', and `\fB>\fP' respectively, any other character ++matches itself) is taken as a list of comma\-separated ++\fIsub\-spec\fPs\&. Each \fIsub\-spec\fP may be either an octal number as ++described above or a list of any of the characters `\fBu\fP\&', `\fBg\fP', ++`\fBo\fP\&', and `\fBa\fP', followed by a `\fB=\fP', a `\fB+\fP', or a ++`\fB\-\fP\&', followed by a list of any of the characters `\fBr\fP', `\fBw\fP', ++`\fBx\fP\&', `\fBs\fP', and `\fBt\fP', or an octal digit\&. The first list of ++characters specify which access rights are to be checked\&. If a `\fBu\fP\&' ++is given, those for the owner of the file are used, if a `\fBg\fP\&' is ++given, those of the group are checked, a `\fBo\fP\&' means to test those ++of other users, and the `\fBa\fP\&' says to test all three groups\&. The ++`\fB=\fP\&', `\fB+\fP', and `\fB\-\fP' again says how the modes are to be ++checked and have the same meaning as described for the first form ++above\&. The second list of characters finally says which access rights ++are to be expected: `\fBr\fP\&' for read access, `\fBw\fP' for write access, ++`\fBx\fP\&' for the right to execute the file (or to search a directory), ++`\fBs\fP\&' for the setuid and setgid bits, and `\fBt\fP' for the sticky ++bit\&. ++.PP ++Thus, `\fB*(f70?)\fP\&' gives the files for which the owner has read, ++write, and execute permission, and for which other group members have ++no rights, independent of the permissions for other users\&. The pattern ++`\fB*(f\-100)\fP\&' gives all files for which the owner does not have ++execute permission, and `\fB*(f:gu+w,o\-rx:)\fP\&' gives the files for which ++the owner and the other members of the group have at least write ++permission, and for which other users don\&'t have read or execute ++permission\&. ++.RE ++.TP ++.PD 0 ++\fBe\fP\fIstring\fP ++.TP ++.PD ++\fB+\fP\fIcmd\fP ++The \fIstring\fP will be executed as shell code\&. The filename will be ++included in the list if and only if the code returns a zero status (usually ++the status of the last command)\&. ++.RS ++.PP ++In the first form, the first character after the `\fBe\fP\&' ++will be used as a separator and anything up to the next matching separator ++will be taken as the \fIstring\fP; `\fB[\fP\&', `\fB{\fP', and `\fB<\fP' match ++`\fB]\fP\&', `\fB}\fP', and `\fB>\fP', respectively, while any other character ++matches itself\&. Note that expansions must be quoted in the \fIstring\fP ++to prevent them from being expanded before globbing is done\&. ++\fIstring\fP is then executed as shell code\&. The string \fBglobqual\fP ++is appended to the array \fBzsh_eval_context\fP the duration of ++execution\&. ++.PP ++During the execution of \fIstring\fP the filename currently being tested is ++available in the parameter \fBREPLY\fP; the parameter may be altered to ++a string to be inserted into the list instead of the original ++filename\&. In addition, the parameter \fBreply\fP may be set to an array or a ++string, which overrides the value of \fBREPLY\fP\&. If set to an array, the ++latter is inserted into the command line word by word\&. ++.PP ++For example, suppose a directory contains a single file `\fBlonely\fP\&'\&. Then ++the expression `\fB*(e:\&'reply=(${REPLY}{1,2})':)\fP' will cause the words ++`\fBlonely1\fP\&' and `\fBlonely2\fP' to be inserted into the command line\&. Note ++the quoting of \fIstring\fP\&. ++.PP ++The form \fB+\fP\fIcmd\fP has the same effect, but no delimiters appear ++around \fIcmd\fP\&. Instead, \fIcmd\fP is taken as the longest sequence of ++characters following the \fB+\fP that are alphanumeric or underscore\&. ++Typically \fIcmd\fP will be the name of a shell function that contains the ++appropriate test\&. For example, ++.PP ++.RS ++.nf ++\fBnt() { [[ $REPLY \-nt $NTREF ]] } ++NTREF=reffile ++ls \-l *(+nt)\fP ++.fi ++.RE ++.PP ++lists all files in the directory that have been modified more recently than ++\fBreffile\fP\&. ++.RE ++.TP ++\fBd\fP\fIdev\fP ++files on the device \fIdev\fP ++.TP ++\fBl\fP[\fB\-\fP|\fB+\fP]\fIct\fP ++files having a link count less than \fIct\fP (\fB\-\fP), greater than ++\fIct\fP (\fB+\fP), or equal to \fIct\fP ++.TP ++\fBU\fP ++files owned by the effective user ID ++.TP ++\fBG\fP ++files owned by the effective group ID ++.TP ++\fBu\fP\fIid\fP ++files owned by user ID \fIid\fP if that is a number\&. Otherwise, ++\fIid\fP specifies a user name: the ++character after the `\fBu\fP\&' will be taken as a separator and the string ++between it and the next matching separator will be taken as a user name\&. ++The starting separators `\fB[\fP\&', `\fB{\fP', and `\fB<\fP' ++match the final separators `\fB]\fP\&', `\fB}\fP', and `\fB>\fP', respectively; ++any other character matches itself\&. The selected files are those ++owned by this user\&. For example, `\fBu:foo:\fP\&' or `\fBu[foo]\fP' selects ++files owned by user `\fBfoo\fP\&'\&. ++.TP ++\fBg\fP\fIid\fP ++like \fBu\fP\fIid\fP but with group IDs or names ++.TP ++\fBa\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP ++files accessed exactly \fIn\fP days ago\&. Files accessed within the last ++\fIn\fP days are selected using a negative value for \fIn\fP (\fB\-\fP\fIn\fP)\&. ++Files accessed more than \fIn\fP days ago are selected by a positive \fIn\fP ++value (\fB+\fP\fIn\fP)\&. Optional unit specifiers `\fBM\fP\&', `\fBw\fP', ++`\fBh\fP\&', `\fBm\fP' or `\fBs\fP' (e\&.g\&. `\fBah5\fP') cause the check to be ++performed with months (of 30 days), weeks, hours, minutes or seconds ++instead of days, respectively\&. ++.RS ++.PP ++Any fractional part of the difference between the access time and the ++current part in the appropriate units is ignored in the comparison\&. For ++instance, `\fBecho *(ah\-5)\fP\&' would echo files accessed within the last ++five hours, while `\fBecho *(ah+5)\fP\&' would echo files accessed at least ++six hours ago, as times strictly between five and six hours are treated ++as five hours\&. ++.RE ++.TP ++\fBm\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP ++like the file access qualifier, except that it uses the file modification ++time\&. ++.TP ++\fBc\fP[\fBMwhms\fP][\fB\-\fP|\fB+\fP]\fIn\fP ++like the file access qualifier, except that it uses the file inode change ++time\&. ++.TP ++\fBL\fP[\fB+\fP|\fB\-\fP]\fIn\fP ++files less than \fIn\fP bytes (\fB\-\fP), more than \fIn\fP bytes (\fB+\fP), or ++exactly \fIn\fP bytes in length\&. ++.RS ++.PP ++If this flag is directly followed by a `\fBk\fP\&' (`\fBK\fP'), `\fBm\fP' ++(`\fBM\fP\&'), or `\fBp\fP' (`\fBP\fP') (e\&.g\&. `\fBLk\-50\fP') the check is performed ++with kilobytes, megabytes, or blocks (of 512 bytes) instead\&. In this ++case a file is regarded as "exactly" the size if the file size rounded up ++to the next unit is equal to the test size\&. Hence `\fB*(Lm1)\fP\&' ++matches files from 1 byte up to 1 Megabyte inclusive\&. Note also that ++the set of files "less than" the test size only includes files that would ++not match the equality test; hence `\fB*(Lm\-1)\fP\&' only matches ++files of zero size\&. ++.RE ++.TP ++\fB^\fP ++negates all qualifiers following it ++.TP ++\fB\-\fP ++toggles between making the qualifiers work on symbolic links (the ++default) and the files they point to ++.TP ++\fBM\fP ++sets the \fBMARK_DIRS\fP option for the current pattern ++.TP ++\fBT\fP ++appends a trailing qualifier mark to the filenames, analogous to the ++\fBLIST_TYPES\fP option, for the current pattern (overrides \fBM\fP) ++.TP ++\fBN\fP ++sets the \fBNULL_GLOB\fP option for the current pattern ++.TP ++\fBD\fP ++sets the \fBGLOB_DOTS\fP option for the current pattern ++.TP ++\fBn\fP ++sets the \fBNUMERIC_GLOB_SORT\fP option for the current pattern ++.TP ++\fBo\fP\fIc\fP ++specifies how the names of the files should be sorted\&. If \fIc\fP is ++\fBn\fP they are sorted by name (the default); if it is \fBL\fP they ++are sorted depending on the size (length) of the files; if \fBl\fP ++they are sorted by the number of links; if \fBa\fP, \fBm\fP, or \fBc\fP ++they are sorted by the time of the last access, modification, or ++inode change respectively; if \fBd\fP, files in subdirectories appear before ++those in the current directory at each level of the search \-\- this is best ++combined with other criteria, for example `\fBodon\fP\&' to sort on names for ++files within the same directory; if \fBN\fP, no sorting is performed\&. ++Note that \fBa\fP, \fBm\fP, and \fBc\fP compare ++the age against the current time, hence the first name in the list is the ++youngest file\&. Also note that the modifiers \fB^\fP and \fB\-\fP are used, ++so `\fB*(^\-oL)\fP\&' gives a list of all files sorted by file size in descending ++order, following any symbolic links\&. Unless \fBoN\fP is used, multiple order ++specifiers may occur to resolve ties\&. ++.RS ++.PP ++\fBoe\fP and \fBo+\fP are special cases; they are each followed by shell code, ++delimited as for the \fBe\fP glob qualifier and the \fB+\fP glob qualifier ++respectively (see above)\&. The code is executed for each matched file with ++the parameter \fBREPLY\fP set to the name of the file on entry and ++\fBglobsort\fP appended to \fBzsh_eval_context\fP\&. The code ++should modify the parameter \fBREPLY\fP in some fashion\&. On return, the ++value of the parameter is used instead of the file name as the string on ++which to sort\&. Unlike other sort operators, \fBoe\fP and \fBo+\fP may be ++repeated, but note that the maximum number of sort operators of any kind ++that may appear in any glob expression is 12\&. ++.RE ++.TP ++\fBO\fP\fIc\fP ++like `\fBo\fP\&', but sorts in descending order; i\&.e\&. `\fB*(^oc)\fP' is the ++same as `\fB*(Oc)\fP\&' and `\fB*(^Oc)\fP' is the same as `\fB*(oc)\fP'; `\fBOd\fP' ++puts files in the current directory before those in subdirectories at each ++level of the search\&. ++.TP ++\fB[\fP\fIbeg\fP[\fB,\fP\fIend\fP]\fB]\fP ++specifies which of the matched filenames should be included in the ++returned list\&. The syntax is the same as for array ++subscripts\&. \fIbeg\fP and the optional \fIend\fP may be mathematical ++expressions\&. As in parameter subscripting they may be negative to make ++them count from the last match backward\&. E\&.g\&.: `\fB*(\-OL[1,3])\fP\&' ++gives a list of the names of the three largest files\&. ++.TP ++\fBP\fP\fIstring\fP ++The \fIstring\fP will be prepended to each glob match as a separate ++word\&. \fIstring\fP is delimited in the same way as arguments to the ++\fBe\fP glob qualifier described above\&. The qualifier can be repeated; ++the words are prepended separately so that the resulting command ++line contains the words in the same order they were given in the ++list of glob qualifiers\&. ++.RS ++.PP ++A typical use for this is to prepend an option before all occurrences ++of a file name; for example, the pattern `\fB*(P:\-f:)\fP\&' produces the ++command line arguments `\fB\-f\fP \fIfile1\fP \fB\-f\fP \fIfile2\fP \&.\&.\&.\&' ++.RE ++.RE ++.PP ++More than one of these lists can be combined, separated by commas\&. The ++whole list matches if at least one of the sublists matches (they are ++`or\&'ed, the qualifiers in the sublists are `and'ed)\&. Some qualifiers, ++however, affect all matches generated, independent of the sublist in ++which they are given\&. These are the qualifiers `\fBM\fP\&', `\fBT\fP', ++`\fBN\fP\&', `\fBD\fP', `\fBn\fP', `\fBo\fP', `\fBO\fP' and the subscripts given ++in brackets (`\fB[\&.\&.\&.]\fP\&')\&. ++.PP ++If a `\fB:\fP\&' appears in a qualifier list, the remainder of the expression in ++parenthesis is interpreted as a modifier (see the section `Modifiers\&' ++in the section `History Expansion\&')\&. Each modifier must be introduced by a ++separate `\fB:\fP\&'\&. Note also that the result after modification does not ++have to be an existing file\&. The name of any existing file can be followed ++by a modifier of the form `\fB(:\&.\&.)\fP\&' even if no actual filename generation ++is performed, although note that the presence of the parentheses ++causes the entire expression to be subjected to any global pattern matching ++options such as \fBNULL_GLOB\fP\&. Thus: ++.PP ++.RS ++.nf ++\fBls *(\-/)\fP ++.fi ++.RE ++.PP ++lists all directories and symbolic links that point to directories, ++and ++.PP ++.RS ++.nf ++\fBls *(%W)\fP ++.fi ++.RE ++.PP ++lists all world\-writable device files in the current directory, and ++.PP ++.RS ++.nf ++\fBls *(W,X)\fP ++.fi ++.RE ++.PP ++lists all files in the current directory that are ++world\-writable or world\-executable, and ++.PP ++.RS ++.nf ++\fBecho /tmp/foo*(u0^@:t)\fP ++.fi ++.RE ++.PP ++outputs the basename of all root\-owned files beginning with the string ++`\fBfoo\fP\&' in \fB/tmp\fP, ignoring symlinks, and ++.PP ++.RS ++.nf ++\fBls *\&.*~(lex|parse)\&.[ch](^D^l1)\fP ++.fi ++.RE ++.PP ++lists all files having a link count of one whose names contain a dot ++(but not those starting with a dot, since \fBGLOB_DOTS\fP is explicitly ++switched off) except for \fBlex\&.c\fP, \fBlex\&.h\fP, \fBparse\&.c\fP and \fBparse\&.h\fP\&. ++.PP ++.RS ++.nf ++\fBprint b*\&.pro(#q:s/pro/shmo/)(#q\&.:s/builtin/shmiltin/)\fP ++.fi ++.RE ++.PP ++demonstrates how colon modifiers and other qualifiers may be chained ++together\&. The ordinary qualifier `\fB\&.\fP\&' is applied first, then the colon ++modifiers in order from left to right\&. So if \fBEXTENDED_GLOB\fP is set and ++the base pattern matches the regular file \fBbuiltin\&.pro\fP, the shell will ++print `\fBshmiltin\&.shmo\fP\&'\&. +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/zshzle.1 +@@ -0,0 +1,2338 @@ ++.TH "ZSHZLE" "1" "June 20, 2011" "zsh 4\&.3\&.12-dev-1" ++.SH "NAME" ++zshzle \- zsh command line editor ++.\" Yodl file: Zsh/zle.yo ++.SH "DESCRIPTION" ++If the \fBZLE\fP option is set (which it is by default in interactive shells) ++and the shell input is attached to the terminal, the user ++is able to edit command lines\&. ++.PP ++There are two display modes\&. The first, multiline mode, is the ++default\&. It only works if the \fBTERM\fP parameter is set to a valid ++terminal type that can move the cursor up\&. The second, single line ++mode, is used if \fBTERM\fP is invalid or incapable of moving the ++cursor up, or if the \fBSINGLE_LINE_ZLE\fP option is set\&. ++This mode ++is similar to \fBksh\fP, and uses no termcap sequences\&. If \fBTERM\fP is ++"emacs", the \fBZLE\fP option will be unset by default\&. ++.PP ++The parameters \fBBAUD\fP, \fBCOLUMNS\fP, and \fBLINES\fP are also used by the ++line editor\&. ++See \fIParameters Used By The Shell\fP in \fIzshparam\fP(1)\&. ++.PP ++The parameter \fBzle_highlight\fP is also used by the line editor; ++see \fICharacter Highlighting\fP below\&. Highlighting ++of special characters and the region between the cursor and the ++mark (as set with \fBset\-mark\-command\fP in Emacs mode) is enabled ++by default; consult this reference for more information\&. Irascible ++conservatives will wish to know that all highlighting may be disabled by ++the following setting: ++.PP ++.RS ++.nf ++\fBzle_highlight=(none)\fP ++.fi ++.RE ++.PP ++.PP ++.SH "KEYMAPS" ++A keymap in ZLE contains a set of bindings between key sequences ++and ZLE commands\&. The empty key sequence cannot be bound\&. ++.PP ++There can be any number of keymaps at any time, and each keymap has one ++or more names\&. If all of a keymap\&'s names are deleted, it disappears\&. ++\fBbindkey\fP can be used to manipulate keymap names\&. ++.PP ++Initially, there are six keymaps: ++.PP ++.PD 0 ++.TP ++\fBemacs\fP ++EMACS emulation ++.TP ++\fBviins\fP ++vi emulation \- insert mode ++.TP ++\fBvicmd\fP ++vi emulation \- command mode ++.TP ++\fBisearch\fP ++incremental search mode ++.TP ++\fBcommand\fP ++read a command name ++.TP ++\fB\&.safe\fP ++fallback keymap ++.PD ++.PP ++The `\fB\&.safe\fP\&' keymap is special\&. It can never be altered, and the name ++can never be removed\&. However, it can be linked to other names, which can ++be removed\&. In the future other special keymaps may be added; users should ++avoid using names beginning with `\fB\&.\fP\&' for their own keymaps\&. ++.PP ++In addition to these names, either `\fBemacs\fP\&' or `\fBviins\fP' is ++also linked to the name `\fBmain\fP\&'\&. If one of the \fBVISUAL\fP or ++\fBEDITOR\fP environment variables contain the string `\fBvi\fP\&' when the shell ++starts up then it will be `\fBviins\fP\&', otherwise it will be `\fBemacs\fP'\&. ++\fBbindkey\fP\&'s \fB\-e\fP and \fB\-v\fP ++options provide a convenient way to override this default choice\&. ++.PP ++When the editor starts up, it will select the `\fBmain\fP\&' keymap\&. ++If that keymap doesn\&'t exist, it will use `\fB\&.safe\fP' instead\&. ++.PP ++In the `\fB\&.safe\fP\&' keymap, each single key is bound to \fBself\-insert\fP, ++except for ^J (line feed) and ^M (return) which are bound to \fBaccept\-line\fP\&. ++This is deliberately not pleasant to use; if you are using it, it ++means you deleted the main keymap, and you should put it back\&. ++.SS "Reading Commands" ++When ZLE is reading a command from the terminal, it may read a sequence ++that is bound to some command and is also a prefix of a longer bound string\&. ++In this case ZLE will wait a certain time to see if more characters ++are typed, and if not (or they don\&'t match any longer string) it will ++execute the binding\&. This timeout is defined by the \fBKEYTIMEOUT\fP parameter; ++its default is 0\&.4 sec\&. There is no timeout if the prefix string is not ++itself bound to a command\&. ++.PP ++The key timeout is also applied when ZLE is reading the bytes from a ++multibyte character string when it is in the appropriate mode\&. (This ++requires that the shell was compiled with multibyte mode enabled; typically ++also the locale has characters with the UTF\-8 encoding, although any ++multibyte encoding known to the operating system is supported\&.) If the ++second or a subsequent byte is not read within the timeout period, the ++shell acts as if \fB?\fP were typed and resets the input state\&. ++.PP ++As well as ZLE commands, key sequences can be bound to other strings, by using ++`\fBbindkey \-s\fP\&'\&. ++When such a sequence is read, the replacement string is pushed back as input, ++and the command reading process starts again using these fake keystrokes\&. ++This input can itself invoke further replacement strings, but in order to ++detect loops the process will be stopped if there are twenty such replacements ++without a real command being read\&. ++.PP ++A key sequence typed by the user can be turned into a command name for use ++in user\-defined widgets with the \fBread\-command\fP widget, described ++below\&. ++.PP ++.SH "ZLE BUILTINS" ++The ZLE module contains three related builtin commands\&. The \fBbindkey\fP ++command manipulates keymaps and key bindings; the \fBvared\fP command invokes ++ZLE on the value of a shell parameter; and the \fBzle\fP command manipulates ++editing widgets and allows command line access to ZLE commands from within ++shell functions\&. ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-l\fP [ \fB\-L\fP ] [ \fIkeymap\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-d\fP ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-D\fP \fIkeymap\fP \&.\&.\&. ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-A\fP \fIold\-keymap new\-keymap\fP ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ] ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-m\fP ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-r\fP \fIin\-string\fP \&.\&.\&. ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&. ++.TP ++.PD 0 ++\fBbindkey\fP [ \fIoptions\fP ] \fIin\-string command\fP \&.\&.\&. ++.TP ++.PD ++\fBbindkey\fP [ \fIoptions\fP ] [ \fIin\-string\fP ] ++\fBbindkey\fP\&'s options can be divided into three categories: keymap ++selection for the current command, operation selection, and others\&. The ++keymap selection options are: ++.RS ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-e\fP ++Selects keymap `\fBemacs\fP\&' for any operations by the current command, ++and also links `\fBemacs\fP\&' to `\fBmain\fP' so that it is selected by ++default the next time the editor starts\&. ++.TP ++\fB\-v\fP ++Selects keymap `\fBviins\fP\&' for any operations by the current command, ++and also links `\fBviins\fP\&' to `\fBmain\fP' so that it is selected by default ++the next time the editor starts\&. ++.TP ++\fB\-a\fP ++Selects keymap `\fBvicmd\fP\&' for any operations by the current command\&. ++.TP ++\fB\-M\fP \fIkeymap\fP ++The \fIkeymap\fP specifies a keymap name that is selected for any ++operations by the current command\&. ++.PP ++If a keymap selection is required and none of the options above are used, the ++`\fBmain\fP\&' keymap is used\&. Some operations do not permit a keymap to be ++selected, namely: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-l\fP ++List all existing keymap names; if any arguments are given, list just ++those keymaps\&. ++.RS ++.PP ++If the \fB\-L\fP option is also used, list in the form of \fBbindkey\fP ++commands to create or link the keymaps\&. `\fBbindkey \-lL ++main\fP\&' shows which keymap is linked to `\fBmain\fP', if any, and hence if ++the standard emacs or vi emulation is in effect\&. This option does ++not show the \fB\&.safe\fP keymap because it cannot be created in that ++fashion; however, neither is `\fBbindkey \-lL \&.safe\fP\&' reported as an ++error, it simply outputs nothing\&. ++.RE ++.TP ++\fB\-d\fP ++Delete all existing keymaps and reset to the default state\&. ++.TP ++\fB\-D\fP \fIkeymap\fP \&.\&.\&. ++Delete the named \fIkeymap\fPs\&. ++.TP ++\fB\-A\fP \fIold\-keymap new\-keymap\fP ++Make the \fInew\-keymap\fP name an alias for \fIold\-keymap\fP, so that ++both names refer to the same keymap\&. The names have equal standing; ++if either is deleted, the other remains\&. If there is already a keymap ++with the \fInew\-keymap\fP name, it is deleted\&. ++.TP ++\fB\-N\fP \fInew\-keymap\fP [ \fIold\-keymap\fP ] ++Create a new keymap, named \fInew\-keymap\fP\&. If a keymap already has that ++name, it is deleted\&. If an \fIold\-keymap\fP name is given, the new keymap ++is initialized to be a duplicate of it, otherwise the new keymap will ++be empty\&. ++.PP ++To use a newly created keymap, it should be linked to \fBmain\fP\&. Hence ++the sequence of commands to create and use a new keymap `\fBmymap\fP\&' ++initialized from the \fBemacs\fP keymap (which remains unchanged) is: ++.PP ++.RS ++.nf ++\fBbindkey \-N mymap emacs ++bindkey \-A mymap main\fP ++.fi ++.RE ++.PP ++Note that while `\fBbindkey \-A\fP \fInewmap\fP \fBmain\fP\&' will work when ++\fInewmap\fP is \fBemacs\fP or \fBviins\fP, it will not work for \fBvicmd\fP, as ++switching from vi insert to command mode becomes impossible\&. ++.PP ++The following operations act on the `\fBmain\fP\&' keymap if no keymap ++selection option was given: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-m\fP ++Add the built\-in set of meta\-key bindings to the selected keymap\&. ++Only keys that are unbound or bound to \fBself\-insert\fP are affected\&. ++.TP ++\fB\-r\fP \fIin\-string\fP \&.\&.\&. ++Unbind the specified \fIin\-string\fPs in the selected keymap\&. ++This is exactly equivalent to binding the strings to \fBundefined\-key\fP\&. ++.RS ++.PP ++When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&. ++.PP ++When \fB\-p\fP is also used, the \fIin\-string\fPs specify prefixes\&. Any ++binding that has the given \fIin\-string\fP as a prefix, not including the ++binding for the \fIin\-string\fP itself, if any, will be removed\&. For ++example, ++.PP ++.RS ++.nf ++\fBbindkey \-rpM viins \&'^['\fP ++.fi ++.RE ++.PP ++will remove all bindings in the vi\-insert keymap beginning with an escape ++character (probably cursor keys), but leave the binding for the escape ++character itself (probably \fBvi\-cmd\-mode\fP)\&. This is incompatible with the ++option \fB\-R\fP\&. ++.RE ++.TP ++\fB\-s\fP \fIin\-string out\-string\fP \&.\&.\&. ++Bind each \fIin\-string\fP to each \fIout\-string\fP\&. ++When \fIin\-string\fP is typed, \fIout\-string\fP will be ++pushed back and treated as input to the line editor\&. ++When \fB\-R\fP is also used, interpret the \fIin\-string\fPs as ranges\&. ++.TP ++\fIin\-string command\fP \&.\&.\&. ++Bind each \fIin\-string\fP to each \fIcommand\fP\&. ++When \fB\-R\fP is used, interpret the \fIin\-string\fPs as ranges\&. ++.TP ++[ \fIin\-string\fP ] ++List key bindings\&. If an \fIin\-string\fP is specified, the binding of ++that string in the selected keymap is displayed\&. Otherwise, all key ++bindings in the selected keymap are displayed\&. (As a special case, ++if the \fB\-e\fP or \fB\-v\fP option is used alone, the keymap is \fInot\fP ++displayed \- the implicit linking of keymaps is the only thing that ++happens\&.) ++.RS ++.PP ++When the option \fB\-p\fP is used, the \fIin\-string\fP must be present\&. ++The listing shows all bindings which have the given key sequence as a ++prefix, not including any bindings for the key sequence itself\&. ++.PP ++When the \fB\-L\fP option is used, the list is in the form of \fBbindkey\fP ++commands to create the key bindings\&. ++.RE ++.RE ++.PP ++When the \fB\-R\fP option is used as noted above, a valid range consists of ++two characters, with an optional `\fB\-\fP\&' between them\&. All characters ++between the two specified, inclusive, are bound as specified\&. ++.PP ++For either \fIin\-string\fP or \fIout\-string\fP, the following ++escape sequences are recognised: ++.PP ++.PD 0 ++.TP ++\fB\ea\fP ++bell character ++.TP ++\fB\eb\fP ++backspace ++.TP ++\fB\ee\fP, \fB\eE\fP ++escape ++.TP ++\fB\ef\fP ++form feed ++.TP ++\fB\en\fP ++linefeed (newline) ++.TP ++\fB\er\fP ++carriage return ++.TP ++\fB\et\fP ++horizontal tab ++.TP ++\fB\ev\fP ++vertical tab ++.TP ++\fB\e\fP\fINNN\fP ++character code in octal ++.TP ++\fB\ex\fP\fINN\fP ++character code in hexadecimal ++.TP ++\fB\eM\fP[\fB\-\fP]\fIX\fP ++character with meta bit set ++.TP ++\fB\eC\fP[\fB\-\fP]\fIX\fP ++control character ++.TP ++\fB^\fP\fIX\fP ++control character ++.PD ++.PP ++In all other cases, `\fB\e\fP\&' escapes the following character\&. Delete is ++written as `\fB^?\fP\&'\&. Note that `\fB\eM^?\fP' and `\fB^\eM?\fP' are not the same, ++and that (unlike emacs), the bindings `\fB\eM\-\fP\fIX\fP\&' and `\fB\ee\fP\fIX\fP' ++are entirely distinct, although they are initialized to the same bindings ++by `\fBbindkey \-m\fP\&'\&. ++.RE ++.TP ++.PD 0 ++\fBvared\fP [ \fB\-Aache\fP ] [ \fB\-p\fP \fIprompt\fP ] [ \fB\-r\fP \fIrprompt\fP ] ++.TP ++.PD 0 ++ [ \fB\-M\fP \fImain\-keymap\fP ] [ \fB\-m\fP \fIvicmd\-keymap\fP ] ++.TP ++.PD ++ [ \fB\-t\fP \fItty\fP ] \fIname\fP ++The value of the parameter \fIname\fP is loaded into the edit ++buffer, and the line editor is invoked\&. When the editor exits, ++\fIname\fP is set to the string value returned by the editor\&. ++When the \fB\-c\fP flag is given, the parameter is created if it doesn\&'t ++already exist\&. The \fB\-a\fP flag may be given with \fB\-c\fP to create ++an array parameter, or the \fB\-A\fP flag to create an associative array\&. ++If the type of an existing parameter does not match the type to be ++created, the parameter is unset and recreated\&. ++.RS ++.PP ++If an array or array slice is being edited, separator characters as defined ++in \fB$IFS\fP will be shown quoted with a backslash, as will backslashes ++themselves\&. Conversely, when the edited text is split into an array, a ++backslash quotes an immediately following separator character or backslash; ++no other special handling of backslashes, or any handling of quotes, is ++performed\&. ++.PP ++Individual elements of existing array or associative array parameters ++may be edited by using subscript syntax on \fIname\fP\&. New elements are ++created automatically, even without \fB\-c\fP\&. ++.PP ++If the \fB\-p\fP flag is given, the following string will be taken as ++the prompt to display at the left\&. If the \fB\-r\fP flag is given, ++the following string gives the prompt to display at the right\&. If the ++\fB\-h\fP flag is specified, the history can be accessed from ZLE\&. If the ++\fB\-e\fP flag is given, typing \fB^D\fP (Control\-D) on an empty line ++causes \fBvared\fP to exit immediately with a non\-zero return value\&. ++.PP ++The \fB\-M\fP option gives a keymap to link to the \fBmain\fP keymap during ++editing, and the \fB\-m\fP option gives a keymap to link to the \fBvicmd\fP ++keymap during editing\&. For vi\-style editing, this allows a pair of keymaps ++to override \fBviins\fP and \fBvicmd\fP\&. For emacs\-style editing, only \fB\-M\fP ++is normally needed but the \fB\-m\fP option may still be used\&. On exit, the ++previous keymaps will be restored\&. ++.PP ++If `\fB\-t\fP \fItty\fP\&' is given, \fItty\fP is the name of a terminal device ++to be used instead of the default \fB/dev/tty\fP\&. If \fItty\fP does not ++refer to a terminal an error is reported\&. ++.RE ++.TP ++.PD 0 ++\fBzle\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ] [ \fIstring\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fBzle\fP \fB\-D\fP \fIwidget\fP \&.\&.\&. ++.TP ++.PD 0 ++\fBzle\fP \fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-N\fP \fIwidget\fP [ \fIfunction\fP ] ++.TP ++.PD 0 ++\fBzle\fP \fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ] ++.TP ++.PD 0 ++\fBzle\fP \fB\-M\fP \fIstring\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-U\fP \fIstring\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-K\fP \fIkeymap\fP ++.TP ++.PD 0 ++\fBzle\fP \fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ] ++.TP ++.PD 0 ++\fBzle\fP \fB\-I\fP ++.TP ++.PD ++\fBzle\fP \fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-Nw ] [ \-K\fP \fIkeymap\fP \fB]\fP \fIargs\fP \&.\&.\&. ++The \fBzle\fP builtin performs a number of different actions concerning ++ZLE\&. ++.RS ++.PP ++With no options and no arguments, only the return status will be ++set\&. It is zero if ZLE is currently active and widgets could be ++invoked using this builtin command and non\-zero otherwise\&. ++Note that even if non\-zero status is returned, zle may still be active as ++part of the completion system; this does not allow direct calls to ZLE ++widgets\&. ++.PP ++Otherwise, which operation it performs depends on its options: ++.PP ++.PD 0 ++.TP ++.PD ++\fB\-l\fP [ \fB\-L\fP | \fB\-a\fP ] ++List all existing user\-defined widgets\&. If the \fB\-L\fP ++option is used, list in the form of \fBzle\fP ++commands to create the widgets\&. ++.RS ++.PP ++When combined with the \fB\-a\fP option, all widget names are listed, ++including the builtin ones\&. In this case the \fB\-L\fP option is ignored\&. ++.PP ++If at least one \fIstring\fP is given, nothing will be printed but the ++return status will be zero if all \fIstring\fPs are names of existing ++widgets (or of user\-defined widgets if the \fB\-a\fP flag is not given) ++and non\-zero if at least one \fIstring\fP is not a name of an defined ++widget\&. ++.RE ++.TP ++\fB\-D\fP \fIwidget\fP \&.\&.\&. ++Delete the named \fIwidget\fPs\&. ++.TP ++\fB\-A\fP \fIold\-widget\fP \fInew\-widget\fP ++Make the \fInew\-widget\fP name an alias for \fIold\-widget\fP, so that ++both names refer to the same widget\&. The names have equal standing; ++if either is deleted, the other remains\&. If there is already a widget ++with the \fInew\-widget\fP name, it is deleted\&. ++.TP ++\fB\-N\fP \fIwidget\fP [ \fIfunction\fP ] ++Create a user\-defined widget\&. If there is already a widget with the ++specified name, it is overwritten\&. When the new ++widget is invoked from within the editor, the specified shell \fIfunction\fP ++is called\&. If no function name is specified, it defaults to ++the same name as the widget\&. For further information, see the section ++\fIWidgets\fP in ++\fIzshzle\fP(1)\&. ++.TP ++\fB\-C\fP \fIwidget\fP \fIcompletion\-widget\fP \fIfunction\fP ++Create a user\-defined completion widget named \fIwidget\fP\&. The ++completion widget will behave like the built\-in completion\-widget ++whose name is given as \fIcompletion\-widget\fP\&. To generate the ++completions, the shell function \fIfunction\fP will be called\&. ++For further information, see ++\fIzshcompwid\fP(1)\&. ++.TP ++\fB\-R\fP [ \fB\-c\fP ] [ \fIdisplay\-string\fP ] [ \fIstring\fP \&.\&.\&. ] ++Redisplay the command line; this is to be called from within a user\-defined ++widget to allow changes to become visible\&. If a \fIdisplay\-string\fP is ++given and not empty, this is shown in the status line (immediately ++below the line being edited)\&. ++.RS ++.PP ++If the optional \fIstring\fPs are given they are listed below the ++prompt in the same way as completion lists are printed\&. If no ++\fIstring\fPs are given but the \fB\-c\fP option is used such a list is ++cleared\&. ++.PP ++Note that this option is only useful for widgets that do not exit ++immediately after using it because the strings displayed will be erased ++immediately after return from the widget\&. ++.PP ++This command can safely be called outside user defined widgets; if zle is ++active, the display will be refreshed, while if zle is not active, the ++command has no effect\&. In this case there will usually be no other ++arguments\&. ++.PP ++The status is zero if zle was active, else one\&. ++.RE ++.TP ++\fB\-M\fP \fIstring\fP ++As with the \fB\-R\fP option, the \fIstring\fP will be displayed below the ++command line; unlike the \fB\-R\fP option, the string will not be put into ++the status line but will instead be printed normally below the ++prompt\&. This means that the \fIstring\fP will still be displayed after ++the widget returns (until it is overwritten by subsequent commands)\&. ++.TP ++\fB\-U\fP \fIstring\fP ++This pushes the characters in the \fIstring\fP onto the input stack of ++ZLE\&. After the widget currently executed finishes ZLE will behave as ++if the characters in the \fIstring\fP were typed by the user\&. ++.RS ++.PP ++As ZLE uses a stack, if this option is used repeatedly ++the last string pushed onto the stack will be processed first\&. However, ++the characters in each \fIstring\fP will be processed in the order in which ++they appear in the string\&. ++.RE ++.TP ++\fB\-K\fP \fIkeymap\fP ++Selects the keymap named \fIkeymap\fP\&. An error message will be displayed if ++there is no such keymap\&. ++.RS ++.PP ++This keymap selection affects the interpretation of following keystrokes ++within this invocation of ZLE\&. Any following invocation (e\&.g\&., the next ++command line) will start as usual with the `\fBmain\fP\&' keymap selected\&. ++.RE ++.TP ++\fB\-F\fP [ \fB\-L\fP ] [ \fIfd\fP [ \fIhandler\fP ] ] ++Only available if your system supports one of the `poll\&' or `select' system ++calls; most modern systems do\&. ++.RS ++.PP ++Installs \fIhandler\fP (the name of a shell function) to handle input from ++file descriptor \fIfd\fP\&. When zle is attempting to read data, it will ++examine both the terminal and the list of handled \fIfd\fP\&'s\&. If data ++becomes available on a handled \fIfd\fP, zle will call \fIhandler\fP with ++the fd which is ready for reading as the only argument\&. If the handler ++produces output to the terminal, it should call `\fBzle \-I\fP\&' before doing ++so (see below)\&. The handler should not attempt to read from the terminal\&. ++Note that zle makes no attempt to check whether this fd is actually ++readable when installing the handler\&. The user must make their own ++arrangements for handling the file descriptor when zle is not active\&. ++.PP ++Any number of handlers for any number of readable file descriptors may be ++installed\&. Installing a handler for an \fIfd\fP which is already handled ++causes the existing handler to be replaced\&. ++.PP ++If no \fIhandler\fP is given, but an \fIfd\fP is present, any handler for ++that \fIfd\fP is removed\&. If there is none, an error message is printed ++and status 1 is returned\&. ++.PP ++If no arguments are given, or the \fB\-L\fP option is supplied, a list of ++handlers is printed in a form which can be stored for later execution\&. ++.PP ++An \fIfd\fP (but not a \fIhandler\fP) may optionally be given with the \fB\-L\fP ++option; in this case, the function will list the handler if any, else ++silently return status 1\&. ++.PP ++Note that this feature should be used with care\&. Activity on one of the ++\fIfd\fP\&'s which is not properly handled can cause the terminal to become ++unusable\&. ++.PP ++Here is a simple example of using this feature\&. A connection to a remote ++TCP port is created using the ztcp command; see ++the description of the \fBzsh/net/tcp\fP module in \fIzshmodules\fP(1)\&. Then a handler is installed ++which simply prints out any data which arrives on this connection\&. Note ++that `select\&' will indicate that the file descriptor needs handling ++if the remote side has closed the connection; we handle that by testing ++for a failed read\&. ++.RS ++.nf ++\fBif ztcp pwspc 2811; then ++ tcpfd=$REPLY ++ handler() { ++ zle \-I ++ local line ++ if ! read \-r line <&$1; then ++ # select marks this fd if we reach EOF, ++ # so handle this specially\&. ++ print "[Read on fd $1 failed, removing\&.]" >&2 ++ zle \-F $1 ++ return 1 ++ fi ++ print \-r \- $line ++ } ++ zle \-F $tcpfd handler ++fi\fP ++.fi ++.RE ++.RE ++.TP ++\fB\-I\fP ++Unusually, this option is most useful outside ordinary widget functions, ++though it may be used within if normal output to the terminal is required\&. ++It invalidates the current zle display in preparation for output; typically ++this will be from a trap function\&. It has no effect if zle is not ++active\&. When a trap exits, the shell checks to see if the display needs ++restoring, hence the following will print output in such a way as not to ++disturb the line being edited: ++.RS ++.PP ++.RS ++.nf ++\fBTRAPUSR1() { ++ # Invalidate zle display ++ [[ \-o zle ]] && zle \-I ++ # Show output ++ print Hello ++}\fP ++.fi ++.RE ++.PP ++In general, the trap function may need to test whether zle is active before ++using this method (as shown in the example), since the \fBzsh/zle\fP module ++may not even be loaded; if it is not, the command can be skipped\&. ++.PP ++It is possible to call `\fBzle \-I\fP\&' several times before control is ++returned to the editor; the display will only be invalidated the first time ++to minimise disruption\&. ++.PP ++Note that there are normally better ways of manipulating the display from ++within zle widgets; see, for example, `\fBzle \-R\fP\&' above\&. ++.PP ++The returned status is zero if zle was invalidated, even though ++this may have been by a previous call to `\fBzle \-I\fP\&' or by a system ++notification\&. To test if a zle widget may be called at this point, execute ++\fBzle\fP with no arguments and examine the return status\&. ++.RE ++.TP ++\fIwidget\fP \fB[ \-n\fP \fInum\fP \fB]\fP \fB[ \-Nw ] [ \-K\fP \fIkeymap\fP \fB]\fP \fIargs\fP \&.\&.\&. ++Invoke the specified widget\&. This can only be done when ZLE is ++active; normally this will be within a user\-defined widget\&. ++.RS ++.PP ++With the options \fB\-n\fP and \fB\-N\fP, the current numerical argument will be ++saved and then restored after the call to \fBwidget\fP; `\fB\-n\fP \fInum\fP\&' ++sets the numerical argument temporarily to \fInum\fP, while `\fB\-N\fP\&' sets it ++to the default, i\&.e\&. as if there were none\&. ++.PP ++With the option \fB\-K\fP, \fIkeymap\fP will be used as the current keymap ++during the execution of the widget\&. The previous keymap will be ++restored when the widget exits\&. ++.PP ++Normally, calling a widget in this way does not set the special ++parameter \fBWIDGET\fP and related parameters, so that the environment ++appears as if the top\-level widget called by the user were still ++active\&. With the option \fB\-w\fP, \fBWIDGET\fP and related parameters are set ++to reflect the widget being executed by the \fBzle\fP call\&. ++.PP ++Any further arguments will be passed to the widget; note that as ++standard argument handling is performed, any general argument list ++should be preceded by \fB\-\fP\fB\-\fP\&. If it is a shell ++function, these are passed down as positional parameters; for builtin ++widgets it is up to the widget in question what it does with them\&. ++Currently arguments are only handled by the incremental\-search commands, ++the \fBhistory\-search\-forward\fP and \fB\-backward\fP and the corresponding ++functions prefixed by \fBvi\-\fP, and by \fBuniversal\-argument\fP\&. No error is ++flagged if the command does not use the arguments, or only uses some of ++them\&. ++.PP ++The return status reflects the success or failure of the operation carried ++out by the widget, or if it is a user\-defined widget the return status of ++the shell function\&. ++.PP ++A non\-zero return status causes the shell to beep when the widget exits, ++unless the \fBBEEP\fP options was unset or the widget was called via the ++\fBzle\fP command\&. Thus if a user defined widget requires an immediate beep, ++it should call the \fBbeep\fP widget directly\&. ++.RE ++.RE ++.RE ++.RE ++.PP ++.SH "WIDGETS" ++All actions in the editor are performed by `widgets\&'\&. A widget's job is ++simply to perform some small action\&. The ZLE commands that key sequences ++in keymaps are bound to are in fact widgets\&. Widgets can be user\-defined ++or built in\&. ++.PP ++The standard widgets built into ZLE are listed in Standard Widgets below\&. ++Other built\-in widgets can be defined by other modules (see ++\fIzshmodules\fP(1))\&. Each built\-in widget has two names: its normal canonical name, and the ++same name preceded by a `\fB\&.\fP\&'\&. The `\fB\&.\fP' name is special: it can't be ++rebound to a different widget\&. This makes the widget available even when ++its usual name has been redefined\&. ++.PP ++User\-defined widgets are defined using `\fBzle \-N\fP\&', and implemented ++as shell functions\&. When the widget is executed, the corresponding ++shell function is executed, and can perform editing (or other) actions\&. ++It is recommended that user\-defined widgets should not have names ++starting with `\fB\&.\fP\&'\&. ++.SH "USER\e\-DEFINED WIDGETS" ++User\-defined widgets, being implemented as shell functions, ++can execute any normal shell command\&. They can also run other widgets ++(whether built\-in or user\-defined) using the \fBzle\fP builtin command\&. ++The standard input of the function is closed to prevent external commands ++from unintentionally blocking ZLE by reading from the terminal, but ++\fBread \-k\fP or \fBread \-q\fP can be used to read characters\&. Finally, ++they can examine and edit the ZLE buffer being edited by ++reading and setting the special parameters described below\&. ++.PP ++These special parameters are always available in widget functions, but ++are not in any way special outside ZLE\&. If they have some normal value ++outside ZLE, that value is temporarily inaccessible, but will return ++when the widget function exits\&. These special parameters in fact have ++local scope, like parameters created in a function using \fBlocal\fP\&. ++.PP ++Inside completion widgets and traps called while ZLE is active, these ++parameters are available read\-only\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBBUFFER\fP (scalar) ++The entire contents of the edit buffer\&. If it is written to, the ++cursor remains at the same offset, unless that would put it outside the ++buffer\&. ++.TP ++\fBBUFFERLINES\fP (integer) ++The number of screen lines needed for the edit buffer currently ++displayed on screen (i\&.e\&. without any changes to the preceding ++parameters done after the last redisplay); read\-only\&. ++.TP ++\fBCONTEXT\fP (scalar) ++The context in which zle was called to read a line; read\-only\&. One of ++the values: ++.PD 0 ++.TP ++.PD ++start ++The start of a command line (at prompt \fBPS1\fP)\&. ++.TP ++cont ++A continuation to a command line (at prompt \fBPS2\fP)\&. ++.TP ++select ++In a \fBselect\fP loop\&. ++.TP ++vared ++Editing a variable in \fBvared\fP\&. ++.RE ++.TP ++\fBCURSOR\fP (integer) ++The offset of the cursor, within the edit buffer\&. This is in the range ++0 to \fB$#BUFFER\fP, and is by definition equal to \fB$#LBUFFER\fP\&. ++Attempts to move the cursor outside the buffer will result in the ++cursor being moved to the appropriate end of the buffer\&. ++.TP ++\fBCUTBUFFER\fP (scalar) ++The last item cut using one of the `\fBkill\-\fP\&' commands; the string ++which the next yank would insert in the line\&. Later entries in ++the kill ring are in the array \fBkillring\fP\&. Note that the ++command `\fBzle copy\-region\-as\-kill\fP \fIstring\fP\&' can be used to ++set the text of the cut buffer from a shell function and cycle the kill ++ring in the same way as interactively killing text\&. ++.TP ++\fBHISTNO\fP (integer) ++The current history number\&. Setting this has the same effect as ++moving up or down in the history to the corresponding history line\&. ++An attempt to set it is ignored if the line is not stored in the ++history\&. Note this is not the same as the parameter \fBHISTCMD\fP, ++which always gives the number of the history line being added to the main ++shell\&'s history\&. \fBHISTNO\fP refers to the line being retrieved within ++zle\&. ++.TP ++\fBKEYMAP\fP (scalar) ++The name of the currently selected keymap; read\-only\&. ++.TP ++\fBKEYS\fP (scalar) ++The keys typed to invoke this widget, as a literal string; read\-only\&. ++.TP ++\fBkillring\fP (array) ++The array of previously killed items, with the most recently killed first\&. ++This gives the items that would be retrieved by a \fByank\-pop\fP in the ++same order\&. Note, however, that the most recently killed item is in ++\fB$CUTBUFFER\fP; \fB$killring\fP shows the array of previous entries\&. ++.RS ++.PP ++The default size for the kill ring is eight, however the length may be ++changed by normal array operations\&. Any empty string in the kill ring is ++ignored by the \fByank\-pop\fP command, hence the size of the array ++effectively sets the maximum length of the kill ring, while the number of ++non\-zero strings gives the current length, both as seen by the user at the ++command line\&. ++.RE ++.TP ++\fBLASTABORTEDSEARCH\fP (scalar) ++The last search string used by an interactive search that was ++aborted by the user (status 3 returned by the search widget)\&. ++.TP ++\fBLASTSEARCH\fP (scalar) ++The last search string used by an interactive search; read\-only\&. ++This is set even if the search failed (status 0, 1 or 2 returned ++by the search widget), but not if it was aborted by the user\&. ++.TP ++\fBLASTWIDGET\fP (scalar) ++The name of the last widget that was executed; read\-only\&. ++.TP ++\fBLBUFFER\fP (scalar) ++The part of the buffer that lies to the left of the cursor position\&. ++If it is assigned to, only that part of the buffer is replaced, and the ++cursor remains between the new \fB$LBUFFER\fP and the old \fB$RBUFFER\fP\&. ++.TP ++\fBMARK\fP (integer) ++Like \fBCURSOR\fP, but for the mark\&. ++.TP ++\fBNUMERIC\fP (integer) ++The numeric argument\&. If no numeric argument was given, this parameter ++is unset\&. When this is set inside a widget function, builtin widgets ++called with the \fBzle\fP builtin command will use the value ++assigned\&. If it is unset inside a widget function, builtin widgets ++called behave as if no numeric argument was given\&. ++.TP ++\fBPENDING\fP (integer) ++The number of bytes pending for input, i\&.e\&. the number of bytes which have ++already been typed and can immediately be read\&. On systems where the shell ++is not able to get this information, this parameter will always have a ++value of zero\&. Read\-only\&. ++.TP ++\fBPREBUFFER\fP (scalar) ++In a multi\-line input at the secondary prompt, this read\-only parameter ++contains the contents of the lines before the one the cursor is ++currently in\&. ++.TP ++\fBPREDISPLAY\fP (scalar) ++Text to be displayed before the start of the editable text buffer\&. This ++does not have to be a complete line; to display a complete line, a newline ++must be appended explicitly\&. The text is reset on each new invocation ++(but not recursive invocation) of zle\&. ++.TP ++\fBPOSTDISPLAY\fP (scalar) ++Text to be displayed after the end of the editable text buffer\&. This ++does not have to be a complete line; to display a complete line, a newline ++must be prepended explicitly\&. The text is reset on each new invocation ++(but not recursive invocation) of zle\&. ++.TP ++\fBRBUFFER\fP (scalar) ++The part of the buffer that lies to the right of the cursor position\&. ++If it is assigned to, only that part of the buffer is replaced, and the ++cursor remains between the old \fB$LBUFFER\fP and the new \fB$RBUFFER\fP\&. ++.TP ++\fBREGION_ACTIVE\fP (integer) ++Indicates if the region is currently active\&. It can be assigned 0 or 1 ++to deactivate and activate the region respectively; ++see \fICharacter Highlighting\fP below\&. ++.TP ++\fBregion_highlight\fP (array) ++Each element of this array may be set to a string that describes ++highlighting for an arbitrary region of the command line that will ++take effect the next time the command line is redisplayed\&. Highlighting ++of the non\-editable parts of the command line in \fBPREDISPLAY\fP ++and \fBPOSTDISPLAY\fP are possible, but note that the \fBP\fP flag ++is needed for character indexing to include \fBPREDISPLAY\fP\&. ++.RS ++.PP ++Each string consists of the following parts: ++.PP ++.PD 0 ++.TP ++Optionally, a `\fBP\fP\&' to signify that the start and end offset that ++follow include any string set by the \fBPREDISPLAY\fP special parameter; ++this is needed if the predisplay string itself is to be highlighted\&. ++Whitespace may follow the `\fBP\fP\&'\&. ++.TP ++A start offset in the same units as \fBCURSOR\fP, terminated by ++whitespace\&. ++.TP ++An end offset in the same units as \fBCURSOR\fP, terminated by ++whitespace\&. ++.TP ++A highlight specification in the same format as ++used for contexts in the parameter \fBzle_highlight\fP, ++see Character Highlighting below; ++for example, \fBstandout\fP or \fBfg=red,bold\fP\&. ++.PD ++.PP ++For example, ++.PP ++.RS ++.nf ++\fBregion_highlight=("P0 20 bold")\fP ++.fi ++.RE ++.PP ++specifies that the first twenty characters of the text including ++any predisplay string should be highlighted in bold\&. ++.PP ++Note that the effect of \fBregion_highlight\fP is not saved and disappears ++as soon as the line is accepted\&. ++.RE ++.TP ++\fBWIDGET\fP (scalar) ++The name of the widget currently being executed; read\-only\&. ++.TP ++\fBWIDGETFUNC\fP (scalar) ++The name of the shell function that implements a widget defined with ++either \fBzle \-N\fP or \fBzle \-C\fP\&. In the former case, this is the second ++argument to the \fBzle \-N\fP command that defined the widget, or ++the first argument if there was no second argument\&. In the latter case ++this is the third argument to the \fBzle \-C\fP command that defined the ++widget\&. Read\-only\&. ++.TP ++\fBWIDGETSTYLE\fP (scalar) ++Describes the implementation behind the completion widget currently being ++executed; the second argument that followed \fBzle \-C\fP when the widget was ++defined\&. This is the name of a builtin completion widget\&. For widgets ++defined with \fBzle \-N\fP this is set to the empty string\&. Read\-only\&. ++.TP ++\fBZLE_STATE\fP (scalar) ++Contains a set of space\-separated words that describe the current \fBzle\fP ++state\&. ++.RS ++.PP ++Currently, the only state shown is the insert mode as set by the ++\fBoverwrite\-mode\fP or \fBvi\-replace\fP widgets\&. The string contains ++`\fBinsert\fP\&' if characters to be inserted on the command line move existing ++characters to the right, `\fBoverwrite\fP\&' if characters to be inserted ++overwrite existing characters\&. ++.RE ++.RE ++.PP ++.SS "Special Widgets" ++.PP ++There are a few user\-defined widgets which are special to the shell\&. ++If they do not exist, no special action is taken\&. The environment ++provided is identical to that for any other editing widget\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBzle\-isearch\-exit\fP ++Executed at the end of incremental search at the point where the isearch ++prompt is removed from the display\&. See \fBzle\-isearch\-update\fP for ++an example\&. ++.TP ++\fBzle\-isearch\-update\fP ++Executed within incremental search when the display is about to be ++redrawn\&. Additional output below the incremental search prompt can be ++generated by using `\fBzle \-M\fP\&' within the widget\&. For example, ++.RS ++.PP ++.RS ++.nf ++\fBzle\-isearch\-update() { zle \-M "Line $HISTNO"; } ++zle \-N zle\-isearch\-update\fP ++.fi ++.RE ++.PP ++Note the line output by `\fBzle \-M\fP\&' is not deleted on exit from ++incremental search\&. This can be done from a \fBzle\-isearch\-exit\fP ++widget: ++.PP ++.RS ++.nf ++\fBzle\-isearch\-exit() { zle \-M ""; } ++zle \-N zle\-isearch\-exit\fP ++.fi ++.RE ++.RE ++.TP ++\fBzle\-line\-init\fP ++Executed every time the line editor is started to read a new line ++of input\&. The following example puts the line editor into vi command ++mode when it starts up\&. ++.RS ++.PP ++.RS ++.nf ++\fBzle\-line\-init() { zle \-K vicmd; } ++zle \-N zle\-line\-init\fP ++.fi ++.RE ++.PP ++(The command inside the function sets the keymap directly; it is ++equivalent to \fBzle vi\-cmd\-mode\fP\&.) ++.RE ++.TP ++\fBzle\-line\-finish\fP ++This is similar to \fBzle\-line\-init\fP but is executed every time the ++line editor has finished reading a line of input\&. ++.TP ++\fBzle\-history\-line\-set\fP ++Executed when the history line changes\&. ++.TP ++\fBzle\-keymap\-select\fP ++Executed every time the keymap changes, i\&.e\&. the special parameter ++\fBKEYMAP\fP is set to a different value, while the line editor is active\&. ++Initialising the keymap when the line editor starts does not cause the ++widget to be called\&. ++.RS ++.PP ++The value \fB$KEYMAP\fP within the function reflects the new keymap\&. The ++old keymap is passed as the sole argument\&. ++.PP ++This can be used for detecting switches between the vi command ++(\fBvicmd\fP) and insert (usually \fBmain\fP) keymaps\&. ++.RE ++.RE ++.PP ++.SH "STANDARD WIDGETS" ++The following is a list of all the standard widgets, ++and their default bindings in emacs mode, ++vi command mode and vi insert mode ++(the `\fBemacs\fP\&', `\fBvicmd\fP' and `\fBviins\fP' keymaps, respectively)\&. ++.PP ++Note that cursor keys are bound to movement keys in all three keymaps; ++the shell assumes that the cursor keys send the key sequences reported ++by the terminal\-handling library (termcap or terminfo)\&. The key sequences ++shown in the list are those based on the VT100, common on many modern ++terminals, but in fact these are not necessarily bound\&. In the case of the ++\fBviins\fP keymap, the initial escape character of the sequences serves also ++to return to the \fBvicmd\fP keymap: whether this happens is determined by ++the \fBKEYTIMEOUT\fP parameter, see \fIzshparam\fP(1)\&. ++.SS "Movement" ++.PD 0 ++.TP ++.PD ++\fBvi\-backward\-blank\-word\fP (unbound) (B) (unbound) ++Move backward one word, where a word is defined as a series of ++non\-blank characters\&. ++.TP ++\fBbackward\-char\fP (^B ESC\-[D) (unbound) (unbound) ++Move backward one character\&. ++.TP ++\fBvi\-backward\-char\fP (unbound) (^H h ^?) (ESC\-[D) ++Move backward one character, without changing lines\&. ++.TP ++\fBbackward\-word\fP (ESC\-B ESC\-b) (unbound) (unbound) ++Move to the beginning of the previous word\&. ++.TP ++\fBemacs\-backward\-word\fP ++Move to the beginning of the previous word\&. ++.TP ++\fBvi\-backward\-word\fP (unbound) (b) (unbound) ++Move to the beginning of the previous word, vi\-style\&. ++.TP ++\fBbeginning\-of\-line\fP (^A) (unbound) (unbound) ++Move to the beginning of the line\&. If already at the beginning ++of the line, move to the beginning of the previous line, if any\&. ++.TP ++\fBvi\-beginning\-of\-line\fP ++Move to the beginning of the line, without changing lines\&. ++.TP ++\fBend\-of\-line\fP (^E) (unbound) (unbound) ++Move to the end of the line\&. If already at the end ++of the line, move to the end of the next line, if any\&. ++.TP ++\fBvi\-end\-of\-line\fP (unbound) ($) (unbound) ++Move to the end of the line\&. ++If an argument is given to this command, the cursor will be moved to ++the end of the line (argument \- 1) lines down\&. ++.TP ++\fBvi\-forward\-blank\-word\fP (unbound) (W) (unbound) ++Move forward one word, where a word is defined as a series of ++non\-blank characters\&. ++.TP ++\fBvi\-forward\-blank\-word\-end\fP (unbound) (E) (unbound) ++Move to the end of the current word, or, if at the end of the current word, ++to the end of the next word, ++where a word is defined as a series of non\-blank characters\&. ++.TP ++\fBforward\-char\fP (^F ESC\-[C) (unbound) (unbound) ++Move forward one character\&. ++.TP ++\fBvi\-forward\-char\fP (unbound) (space l) (ESC\-[C) ++Move forward one character\&. ++.TP ++\fBvi\-find\-next\-char\fP (^X^F) (f) (unbound) ++Read a character from the keyboard, and move to ++the next occurrence of it in the line\&. ++.TP ++\fBvi\-find\-next\-char\-skip\fP (unbound) (t) (unbound) ++Read a character from the keyboard, and move to ++the position just before the next occurrence of it in the line\&. ++.TP ++\fBvi\-find\-prev\-char\fP (unbound) (F) (unbound) ++Read a character from the keyboard, and move to ++the previous occurrence of it in the line\&. ++.TP ++\fBvi\-find\-prev\-char\-skip\fP (unbound) (T) (unbound) ++Read a character from the keyboard, and move to ++the position just after the previous occurrence of it in the line\&. ++.TP ++\fBvi\-first\-non\-blank\fP (unbound) (^) (unbound) ++Move to the first non\-blank character in the line\&. ++.TP ++\fBvi\-forward\-word\fP (unbound) (w) (unbound) ++Move forward one word, vi\-style\&. ++.TP ++\fBforward\-word\fP (ESC\-F ESC\-f) (unbound) (unbound) ++Move to the beginning of the next word\&. ++The editor\&'s idea of a word is specified with the \fBWORDCHARS\fP ++parameter\&. ++.TP ++\fBemacs\-forward\-word\fP ++Move to the end of the next word\&. ++.TP ++\fBvi\-forward\-word\-end\fP (unbound) (e) (unbound) ++Move to the end of the next word\&. ++.TP ++\fBvi\-goto\-column\fP (ESC\-|) (|) (unbound) ++Move to the column specified by the numeric argument\&. ++.TP ++\fBvi\-goto\-mark\fP (unbound) (`) (unbound) ++Move to the specified mark\&. ++.TP ++\fBvi\-goto\-mark\-line\fP (unbound) (\&') (unbound) ++Move to beginning of the line containing the specified mark\&. ++.TP ++\fBvi\-repeat\-find\fP (unbound) (;) (unbound) ++Repeat the last \fBvi\-find\fP command\&. ++.TP ++\fBvi\-rev\-repeat\-find\fP (unbound) (,) (unbound) ++Repeat the last \fBvi\-find\fP command in the opposite direction\&. ++.SS "History Control" ++.PD 0 ++.TP ++.PD ++\fBbeginning\-of\-buffer\-or\-history\fP (ESC\-<) (unbound) (unbound) ++Move to the beginning of the buffer, or if already there, ++move to the first event in the history list\&. ++.TP ++\fBbeginning\-of\-line\-hist\fP ++Move to the beginning of the line\&. If already at the ++beginning of the buffer, move to the previous history line\&. ++.TP ++\fBbeginning\-of\-history\fP ++Move to the first event in the history list\&. ++.TP ++\fBdown\-line\-or\-history\fP (^N ESC\-[B) (j) (ESC\-[B) ++Move down a line in the buffer, or if already at the bottom line, ++move to the next event in the history list\&. ++.TP ++\fBvi\-down\-line\-or\-history\fP (unbound) (+) (unbound) ++Move down a line in the buffer, or if already at the bottom line, ++move to the next event in the history list\&. ++Then move to the first non\-blank character on the line\&. ++.TP ++\fBdown\-line\-or\-search\fP ++Move down a line in the buffer, or if already at the bottom line, ++search forward in the history for a line beginning with the first ++word in the buffer\&. ++.RS ++.PP ++If called from a function by the \fBzle\fP command with arguments, the first ++argument is taken as the string for which to search, rather than the ++first word in the buffer\&. ++.RE ++.TP ++\fBdown\-history\fP (unbound) (^N) (unbound) ++Move to the next event in the history list\&. ++.TP ++\fBhistory\-beginning\-search\-backward\fP ++Search backward in the history for a line beginning with the current ++line up to the cursor\&. ++This leaves the cursor in its original position\&. ++.TP ++\fBend\-of\-buffer\-or\-history\fP (ESC\->) (unbound) (unbound) ++Move to the end of the buffer, or if already there, ++move to the last event in the history list\&. ++.TP ++\fBend\-of\-line\-hist\fP ++Move to the end of the line\&. If already at the end of ++the buffer, move to the next history line\&. ++.TP ++\fBend\-of\-history\fP ++Move to the last event in the history list\&. ++.TP ++\fBvi\-fetch\-history\fP (unbound) (G) (unbound) ++Fetch the history line specified by the numeric argument\&. ++This defaults to the current history line ++(i\&.e\&. the one that isn\&'t history yet)\&. ++.TP ++\fBhistory\-incremental\-search\-backward\fP (^R ^Xr) (unbound) (unbound) ++Search backward incrementally for a specified string\&. The search is ++case\-insensitive if the search string does not have uppercase letters and no ++numeric argument was given\&. The string may begin with `\fB^\fP\&' to anchor the ++search to the beginning of the line\&. When called from a user\-defined ++function returns the following statuses: 0, if the search succeeded; ++1, if the search failed; 2, if the search term was a bad pattern; ++3, if the search was aborted by the \fBsend\-break\fP command\&. ++.RS ++.PP ++A restricted set of editing functions ++is available in the mini\-buffer\&. Keys are looked up in the special ++\fBisearch\fP keymap, and if not found there in the main keymap (note ++that by default the \fBisearch\fP keymap is empty)\&. ++An interrupt signal, as defined by the stty ++setting, will stop the search and go back to the original line\&. An undefined ++key will have the same effect\&. Note that the following always ++perform the same task within incremental searches and cannot be ++replaced by user defined widgets, nor can the set of functions ++be extended\&. The supported functions are: ++.PP ++.PD 0 ++.TP ++.PD 0 ++\fBaccept\-and\-hold\fP ++.TP ++.PD 0 ++\fBaccept\-and\-infer\-next\-history\fP ++.TP ++.PD 0 ++\fBaccept\-line\fP ++.TP ++.PD ++\fBaccept\-line\-and\-down\-history\fP ++Perform the usual function after exiting incremental search\&. ++The command line displayed is executed\&. ++.TP ++.PD 0 ++\fBbackward\-delete\-char\fP ++.TP ++.PD ++\fBvi\-backward\-delete\-char\fP ++Back up one place in the search history\&. If the search has been ++repeated this does not immediately erase a character in the ++minibuffer\&. ++.TP ++\fBaccept\-search\fP ++Exit incremental search, retaining the command line but performing no ++further action\&. Note that this function is not bound by default ++and has no effect outside incremental search\&. ++.TP ++.PD 0 ++\fBbackward\-delete\-word\fP ++.TP ++.PD 0 ++\fBbackward\-kill\-word\fP ++.TP ++.PD ++\fBvi\-backward\-kill\-word\fP ++Back up one character in the minibuffer; if multiple searches ++have been performed since the character was inserted the search ++history is rewound to the point just before the character was ++entered\&. Hence this has the effect of repeating ++\fBbackward\-delete\-char\fP\&. ++.TP ++\fBclear\-screen\fP ++Clear the screen, remaining in incremental search mode\&. ++.TP ++\fBhistory\-incremental\-search\-backward\fP ++Find the next occurrence of the contents of the mini\-buffer\&. ++.TP ++\fBhistory\-incremental\-search\-forward\fP ++Invert the sense of the search\&. ++.TP ++\fBmagic\-space\fP ++Inserts a non\-magical space\&. ++.TP ++.PD 0 ++\fBquoted\-insert\fP ++.TP ++.PD ++\fBvi\-quoted\-insert\fP ++Quote the character to insert into the minibuffer\&. ++.TP ++\fBredisplay\fP ++Redisplay the command line, remaining in incremental search mode\&. ++.TP ++\fBvi\-cmd\-mode\fP ++Toggle between the `\fBmain\fP\&' and `\fBvicmd\fP' keymaps; ++the `\fBmain\fP\&' keymap (insert mode) will be selected initially\&. ++.TP ++.PD 0 ++\fBvi\-repeat\-search\fP ++.TP ++.PD ++\fBvi\-rev\-repeat\-search\fP ++Repeat the search\&. The direction of the search is indicated in the ++mini\-buffer\&. ++.PP ++Any character that is not bound to one of the above functions, or ++\fBself\-insert\fP or \fBself\-insert\-unmeta\fP, will cause the mode to be ++exited\&. The character is then looked up and executed in the keymap in ++effect at that point\&. ++.PP ++When called from a widget function by the \fBzle\fP command, the incremental ++search commands can take a string argument\&. This will be treated as a ++string of keys, as for arguments to the \fBbindkey\fP command, and used as ++initial input for the command\&. Any characters in the string which are ++unused by the incremental search will be silently ignored\&. For example, ++.PP ++.RS ++.nf ++\fBzle history\-incremental\-search\-backward forceps\fP ++.fi ++.RE ++.PP ++will search backwards for \fBforceps\fP, leaving the minibuffer containing ++the string `\fBforceps\fP\&'\&. ++.RE ++.TP ++\fBhistory\-incremental\-search\-forward\fP (^S ^Xs) (unbound) (unbound) ++Search forward incrementally for a specified string\&. The search is ++case\-insensitive if the search string does not have uppercase letters and no ++numeric argument was given\&. The string may begin with `\fB^\fP\&' to anchor the ++search to the beginning of the line\&. The functions available in the ++mini\-buffer are the same as for \fBhistory\-incremental\-search\-backward\fP\&. ++.TP ++.PD 0 ++\fBhistory\-incremental\-pattern\-search\-backward\fP ++.TP ++.PD ++\fBhistory\-incremental\-pattern\-search\-forward\fP ++These widgets behave similarly to the corresponding widgets with ++no \fB\-pattern\fP, but the search string typed by the user is treated ++as a pattern, respecting the current settings of the various options ++affecting pattern matching\&. See ++FILENAME GENERATION in \fIzshexpn\fP(1) for a description of patterns\&. ++If no numeric argument was given lowercase letters in the search ++string may match uppercase letters in the history\&. The string may begin ++with `\fB^\fP\&' to anchor the search to the beginning of the line\&. ++.RS ++.PP ++The prompt changes to indicate an invalid pattern; this may simply ++indicate the pattern is not yet complete\&. ++.PP ++Note that only non\-overlapping matches are reported, so an expression ++with wildcards may return fewer matches on a line than are visible ++by inspection\&. ++.RE ++.TP ++\fBhistory\-search\-backward\fP (ESC\-P ESC\-p) (unbound) (unbound) ++Search backward in the history for a line beginning with the first ++word in the buffer\&. ++.RS ++.PP ++If called from a function by the \fBzle\fP command with arguments, the first ++argument is taken as the string for which to search, rather than the ++first word in the buffer\&. ++.RE ++.TP ++\fBvi\-history\-search\-backward\fP (unbound) (/) (unbound) ++Search backward in the history for a specified string\&. ++The string may begin with `\fB^\fP\&' to anchor the search to the ++beginning of the line\&. ++.RS ++.PP ++A restricted set of editing functions is available in ++the mini\-buffer\&. An interrupt signal, as defined by the stty setting, will ++stop the search\&. ++The functions available in the mini\-buffer are: ++\fBaccept\-line\fP, ++\fBbackward\-delete\-char\fP, ++\fBvi\-backward\-delete\-char\fP, ++\fBbackward\-kill\-word\fP, ++\fBvi\-backward\-kill\-word\fP, ++\fBclear\-screen\fP, ++\fBredisplay\fP, ++\fBquoted\-insert\fP ++and ++\fBvi\-quoted\-insert\fP\&. ++.PP ++\fBvi\-cmd\-mode\fP is treated the same as accept\-line, and ++\fBmagic\-space\fP is treated as a space\&. ++Any other character that is not bound to self\-insert or ++self\-insert\-unmeta will beep and be ignored\&. If the function is called from vi ++command mode, the bindings of the current insert mode will be used\&. ++.PP ++If called from a function by the \fBzle\fP command with arguments, the first ++argument is taken as the string for which to search, rather than the ++first word in the buffer\&. ++.RE ++.TP ++\fBhistory\-search\-forward\fP (ESC\-N ESC\-n) (unbound) (unbound) ++Search forward in the history for a line beginning with the first ++word in the buffer\&. ++.RS ++.PP ++If called from a function by the \fBzle\fP command with arguments, the first ++argument is taken as the string for which to search, rather than the ++first word in the buffer\&. ++.RE ++.TP ++\fBvi\-history\-search\-forward\fP (unbound) (?) (unbound) ++Search forward in the history for a specified string\&. ++The string may begin with `\fB^\fP\&' to anchor the search to the ++beginning of the line\&. The functions available in the mini\-buffer are the same ++as for \fBvi\-history\-search\-backward\fP\&. Argument handling is also the same ++as for that command\&. ++.TP ++\fBinfer\-next\-history\fP (^X^N) (unbound) (unbound) ++Search in the history list for a line matching the current one and ++fetch the event following it\&. ++.TP ++\fBinsert\-last\-word\fP (ESC\-_ ESC\-\&.) (unbound) (unbound) ++Insert the last word from the previous history event at the ++cursor position\&. If a positive numeric argument is given, ++insert that word from the end of the previous history event\&. ++If the argument is zero or negative insert that word from the ++left (zero inserts the previous command word)\&. Repeating this command ++replaces the word just inserted with the last word from the ++history event prior to the one just used; numeric arguments can be used in ++the same way to pick a word from that event\&. ++.RS ++.PP ++When called from a shell function invoked from a user\-defined widget, the ++command can take one to three arguments\&. The first argument specifies a ++history offset which applies to successive calls to this widget: if it is \-1, ++the default behaviour is used, while if it is 1, successive calls will move ++forwards through the history\&. The value 0 can be used to indicate that the ++history line examined by the previous execution of the command will be ++reexamined\&. Note that negative numbers should be preceded by a ++`\fB\-\fP\fB\-\fP\&' argument to avoid confusing them with options\&. ++.PP ++If two arguments are given, the second specifies the word on the command ++line in normal array index notation (as a more natural alternative to the ++prefix argument)\&. Hence 1 is the first word, and \-1 (the default) is the ++last word\&. ++.PP ++If a third argument is given, its value is ignored, but it is used to ++signify that the history offset is relative to the current history line, ++rather than the one remembered after the previous invocations of ++\fBinsert\-last\-word\fP\&. ++.PP ++For example, the default behaviour of the command corresponds to ++.PP ++.RS ++.nf ++\fBzle insert\-last\-word \-\- \-1 \-1\fP ++.fi ++.RE ++.PP ++while the command ++.PP ++.RS ++.nf ++\fBzle insert\-last\-word \-\- \-1 1 \-\fP ++.fi ++.RE ++.PP ++always copies the first word of the line in the history immediately before ++the line being edited\&. This has the side effect that later invocations of ++the widget will be relative to that line\&. ++.RE ++.TP ++\fBvi\-repeat\-search\fP (unbound) (n) (unbound) ++Repeat the last vi history search\&. ++.TP ++\fBvi\-rev\-repeat\-search\fP (unbound) (N) (unbound) ++Repeat the last vi history search, but in reverse\&. ++.TP ++\fBup\-line\-or\-history\fP (^P ESC\-[A) (k) (ESC\-[A) ++Move up a line in the buffer, or if already at the top line, ++move to the previous event in the history list\&. ++.TP ++\fBvi\-up\-line\-or\-history\fP (unbound) (\-) (unbound) ++Move up a line in the buffer, or if already at the top line, ++move to the previous event in the history list\&. ++Then move to the first non\-blank character on the line\&. ++.TP ++\fBup\-line\-or\-search\fP ++Move up a line in the buffer, or if already at the top line, ++search backward in the history for a line beginning with the ++first word in the buffer\&. ++.RS ++.PP ++If called from a function by the \fBzle\fP command with arguments, the first ++argument is taken as the string for which to search, rather than the ++first word in the buffer\&. ++.RE ++.TP ++\fBup\-history\fP (unbound) (^P) (unbound) ++Move to the previous event in the history list\&. ++.TP ++\fBhistory\-beginning\-search\-forward\fP ++Search forward in the history for a line beginning with the current ++line up to the cursor\&. ++This leaves the cursor in its original position\&. ++.SS "Modifying Text" ++.PD 0 ++.TP ++.PD ++\fBvi\-add\-eol\fP (unbound) (A) (unbound) ++Move to the end of the line and enter insert mode\&. ++.TP ++\fBvi\-add\-next\fP (unbound) (a) (unbound) ++Enter insert mode after the current cursor position, without changing lines\&. ++.TP ++\fBbackward\-delete\-char\fP (^H ^?) (unbound) (unbound) ++Delete the character behind the cursor\&. ++.TP ++\fBvi\-backward\-delete\-char\fP (unbound) (X) (^H) ++Delete the character behind the cursor, without changing lines\&. ++If in insert mode, this won\&'t delete past the point where insert mode was ++last entered\&. ++.TP ++\fBbackward\-delete\-word\fP ++Delete the word behind the cursor\&. ++.TP ++\fBbackward\-kill\-line\fP ++Kill from the beginning of the line to the cursor position\&. ++.TP ++\fBbackward\-kill\-word\fP (^W ESC\-^H ESC\-^?) (unbound) (unbound) ++Kill the word behind the cursor\&. ++.TP ++\fBvi\-backward\-kill\-word\fP (unbound) (unbound) (^W) ++Kill the word behind the cursor, without going past the point where insert ++mode was last entered\&. ++.TP ++\fBcapitalize\-word\fP (ESC\-C ESC\-c) (unbound) (unbound) ++Capitalize the current word and move past it\&. ++.TP ++\fBvi\-change\fP (unbound) (c) (unbound) ++Read a movement command from the keyboard, and kill ++from the cursor position to the endpoint of the movement\&. ++Then enter insert mode\&. ++If the command is \fBvi\-change\fP, change the current line\&. ++.TP ++\fBvi\-change\-eol\fP (unbound) (C) (unbound) ++Kill to the end of the line and enter insert mode\&. ++.TP ++\fBvi\-change\-whole\-line\fP (unbound) (S) (unbound) ++Kill the current line and enter insert mode\&. ++.TP ++\fBcopy\-region\-as\-kill\fP (ESC\-W ESC\-w) (unbound) (unbound) ++Copy the area from the cursor to the mark to the kill buffer\&. ++.RS ++.PP ++If called from a ZLE widget function in the form `\fBzle ++copy\-region\-as\-kill\fP \fIstring\fP\&' then \fIstring\fP will be taken as the ++text to copy to the kill buffer\&. The cursor, the mark and the text on the ++command line are not used in this case\&. ++.RE ++.TP ++\fBcopy\-prev\-word\fP (ESC\-^_) (unbound) (unbound) ++Duplicate the word to the left of the cursor\&. ++.TP ++\fBcopy\-prev\-shell\-word\fP ++Like \fBcopy\-prev\-word\fP, but the word is found by using shell parsing, ++whereas \fBcopy\-prev\-word\fP looks for blanks\&. This makes a difference ++when the word is quoted and contains spaces\&. ++.TP ++\fBvi\-delete\fP (unbound) (d) (unbound) ++Read a movement command from the keyboard, and kill ++from the cursor position to the endpoint of the movement\&. ++If the command is \fBvi\-delete\fP, kill the current line\&. ++.TP ++\fBdelete\-char\fP ++Delete the character under the cursor\&. ++.TP ++\fBvi\-delete\-char\fP (unbound) (x) (unbound) ++Delete the character under the cursor, ++without going past the end of the line\&. ++.TP ++\fBdelete\-word\fP ++Delete the current word\&. ++.TP ++\fBdown\-case\-word\fP (ESC\-L ESC\-l) (unbound) (unbound) ++Convert the current word to all lowercase and move past it\&. ++.TP ++\fBkill\-word\fP (ESC\-D ESC\-d) (unbound) (unbound) ++Kill the current word\&. ++.TP ++\fBgosmacs\-transpose\-chars\fP ++Exchange the two characters behind the cursor\&. ++.TP ++\fBvi\-indent\fP (unbound) (>) (unbound) ++Indent a number of lines\&. ++.TP ++\fBvi\-insert\fP (unbound) (i) (unbound) ++Enter insert mode\&. ++.TP ++\fBvi\-insert\-bol\fP (unbound) (I) (unbound) ++Move to the first non\-blank character on the line and enter insert mode\&. ++.TP ++\fBvi\-join\fP (^X^J) (J) (unbound) ++Join the current line with the next one\&. ++.TP ++\fBkill\-line\fP (^K) (unbound) (unbound) ++Kill from the cursor to the end of the line\&. ++If already on the end of the line, kill the newline character\&. ++.TP ++\fBvi\-kill\-line\fP (unbound) (unbound) (^U) ++Kill from the cursor back to wherever insert mode was last entered\&. ++.TP ++\fBvi\-kill\-eol\fP (unbound) (D) (unbound) ++Kill from the cursor to the end of the line\&. ++.TP ++\fBkill\-region\fP ++Kill from the cursor to the mark\&. ++.TP ++\fBkill\-buffer\fP (^X^K) (unbound) (unbound) ++Kill the entire buffer\&. ++.TP ++\fBkill\-whole\-line\fP (^U) (unbound) (unbound) ++Kill the current line\&. ++.TP ++\fBvi\-match\-bracket\fP (^X^B) (%) (unbound) ++Move to the bracket character (one of \fB{}\fP, \fB()\fP or \fB[]\fP) that ++matches the one under the cursor\&. ++If the cursor is not on a bracket character, move forward without going ++past the end of the line to find one, and then go to the matching bracket\&. ++.TP ++\fBvi\-open\-line\-above\fP (unbound) (O) (unbound) ++Open a line above the cursor and enter insert mode\&. ++.TP ++\fBvi\-open\-line\-below\fP (unbound) (o) (unbound) ++Open a line below the cursor and enter insert mode\&. ++.TP ++\fBvi\-oper\-swap\-case\fP ++Read a movement command from the keyboard, and swap ++the case of all characters ++from the cursor position to the endpoint of the movement\&. ++If the movement command is \fBvi\-oper\-swap\-case\fP, ++swap the case of all characters on the current line\&. ++.TP ++\fBoverwrite\-mode\fP (^X^O) (unbound) (unbound) ++Toggle between overwrite mode and insert mode\&. ++.TP ++\fBvi\-put\-before\fP (unbound) (P) (unbound) ++Insert the contents of the kill buffer before the cursor\&. ++If the kill buffer contains a sequence of lines (as opposed to characters), ++paste it above the current line\&. ++.TP ++\fBvi\-put\-after\fP (unbound) (p) (unbound) ++Insert the contents of the kill buffer after the cursor\&. ++If the kill buffer contains a sequence of lines (as opposed to characters), ++paste it below the current line\&. ++.TP ++\fBquoted\-insert\fP (^V) (unbound) (unbound) ++Insert the next character typed into the buffer literally\&. ++An interrupt character will not be inserted\&. ++.TP ++\fBvi\-quoted\-insert\fP (unbound) (unbound) (^Q ^V) ++Display a `\fB^\fP\&' at the cursor position, and ++insert the next character typed into the buffer literally\&. ++An interrupt character will not be inserted\&. ++.TP ++\fBquote\-line\fP (ESC\-\&') (unbound) (unbound) ++Quote the current line; that is, put a `\fB\&'\fP' character at the ++beginning and the end, and convert all `\fB\&'\fP' characters ++to `\fB\&'\e''\fP'\&. ++.TP ++\fBquote\-region\fP (ESC\-") (unbound) (unbound) ++Quote the region from the cursor to the mark\&. ++.TP ++\fBvi\-replace\fP (unbound) (R) (unbound) ++Enter overwrite mode\&. ++.TP ++\fBvi\-repeat\-change\fP (unbound) (\&.) (unbound) ++Repeat the last vi mode text modification\&. ++If a count was used with the modification, it is remembered\&. ++If a count is given to this command, it overrides the remembered count, ++and is remembered for future uses of this command\&. ++The cut buffer specification is similarly remembered\&. ++.TP ++\fBvi\-replace\-chars\fP (unbound) (r) (unbound) ++Replace the character under the cursor with a character ++read from the keyboard\&. ++.TP ++\fBself\-insert\fP (printable characters) (unbound) (printable characters and some control characters) ++Insert a character into the buffer at the cursor position\&. ++.TP ++\fBself\-insert\-unmeta\fP (ESC\-^I ESC\-^J ESC\-^M) (unbound) (unbound) ++Insert a character into the buffer after stripping the meta bit ++and converting ^M to ^J\&. ++.TP ++\fBvi\-substitute\fP (unbound) (s) (unbound) ++Substitute the next character(s)\&. ++.TP ++\fBvi\-swap\-case\fP (unbound) (~) (unbound) ++Swap the case of the character under the cursor and move past it\&. ++.TP ++\fBtranspose\-chars\fP (^T) (unbound) (unbound) ++Exchange the two characters to the left of the ++cursor if at end of line, else exchange the ++character under the cursor with the character ++to the left\&. ++.TP ++\fBtranspose\-words\fP (ESC\-T ESC\-t) (unbound) (unbound) ++Exchange the current word with the one before it\&. ++.TP ++\fBvi\-unindent\fP (unbound) (<) (unbound) ++Unindent a number of lines\&. ++.TP ++\fBup\-case\-word\fP (ESC\-U ESC\-u) (unbound) (unbound) ++Convert the current word to all caps and move past it\&. ++.TP ++\fByank\fP (^Y) (unbound) (unbound) ++Insert the contents of the kill buffer at the cursor position\&. ++.TP ++\fByank\-pop\fP (ESC\-y) (unbound) (unbound) ++Remove the text just yanked, rotate the kill\-ring (the history of ++previously killed text) and yank the new top\&. Only works following ++\fByank\fP or \fByank\-pop\fP\&. ++.TP ++\fBvi\-yank\fP (unbound) (y) (unbound) ++Read a movement command from the keyboard, and copy the region ++from the cursor position to the endpoint of the movement ++into the kill buffer\&. ++If the command is \fBvi\-yank\fP, copy the current line\&. ++.TP ++\fBvi\-yank\-whole\-line\fP (unbound) (Y) (unbound) ++Copy the current line into the kill buffer\&. ++.TP ++\fBvi\-yank\-eol\fP ++Copy the region from the cursor position to the end of the line ++into the kill buffer\&. ++Arguably, this is what Y should do in vi, but it isn\&'t what it actually does\&. ++.SS "Arguments" ++.PD 0 ++.TP ++.PD ++\fBdigit\-argument\fP (ESC\-0\&.\&.ESC\-9) (1\-9) (unbound) ++Start a new numeric argument, or add to the current one\&. ++See also \fBvi\-digit\-or\-beginning\-of\-line\fP\&. This only works if bound to a ++key sequence ending in a decimal digit\&. ++.RS ++.PP ++Inside a widget function, a call to this function treats the last key of ++the key sequence which called the widget as the digit\&. ++.RE ++.TP ++\fBneg\-argument\fP (ESC\-\-) (unbound) (unbound) ++Changes the sign of the following argument\&. ++.TP ++\fBuniversal\-argument\fP ++Multiply the argument of the next command by 4\&. Alternatively, if ++this command is followed by an integer (positive or negative), use ++that as the argument for the next command\&. Thus digits cannot be ++repeated using this command\&. For example, if this command occurs ++twice, followed immediately by \fBforward\-char\fP, move forward sixteen ++spaces; if instead it is followed by \fB\-2\fP, then \fBforward\-char\fP, ++move backward two spaces\&. ++.RS ++.PP ++Inside a widget function, if passed an argument, i\&.e\&. `\fBzle ++universal\-argument\fP \fInum\fP\&', the numerical argument will be set to ++\fInum\fP; this is equivalent to `\fBNUMERIC=\fP\fInum\fP\&'\&. ++.RE ++.TP ++\fBargument\-base\fP ++Use the existing numeric argument as a numeric base, which must be in the ++range 2 to 36 inclusive\&. Subsequent use of \fBdigit\-argument\fP and ++\fBuniversal\-argument\fP will input a new prefix in the given base\&. ++The usual hexadecimal convention is used: the letter \fBa\fP or \fBA\fP ++corresponds to 10, and so on\&. Arguments in bases requiring digits from 10 ++upwards are more conveniently input with \fBuniversal\-argument\fP, since ++\fBESC\-a\fP etc\&. are not usually bound to \fBdigit\-argument\fP\&. ++.RS ++.PP ++The function can be used with a command argument inside a user\-defined ++widget\&. The following code sets the base to 16 and lets the user input a ++hexadecimal argument until a key out of the digit range is typed: ++.PP ++.RS ++.nf ++\fBzle argument\-base 16 ++zle universal\-argument\fP ++.fi ++.RE ++.RE ++.RE ++.SS "Completion" ++.PD 0 ++.TP ++.PD ++\fBaccept\-and\-menu\-complete\fP ++In a menu completion, insert the current completion into the buffer, ++and advance to the next possible completion\&. ++.TP ++\fBcomplete\-word\fP ++Attempt completion on the current word\&. ++.TP ++\fBdelete\-char\-or\-list\fP (^D) (unbound) (unbound) ++Delete the character under the cursor\&. If the cursor ++is at the end of the line, list possible completions for the ++current word\&. ++.TP ++\fBexpand\-cmd\-path\fP ++Expand the current command to its full pathname\&. ++.TP ++\fBexpand\-or\-complete\fP (TAB) (unbound) (TAB) ++Attempt shell expansion on the current word\&. ++If that fails, ++attempt completion\&. ++.TP ++\fBexpand\-or\-complete\-prefix\fP ++Attempt shell expansion on the current word up to cursor\&. ++.TP ++\fBexpand\-history\fP (ESC\-space ESC\-!) (unbound) (unbound) ++Perform history expansion on the edit buffer\&. ++.TP ++\fBexpand\-word\fP (^X*) (unbound) (unbound) ++Attempt shell expansion on the current word\&. ++.TP ++\fBlist\-choices\fP (ESC\-^D) (^D =) (^D) ++List possible completions for the current word\&. ++.TP ++\fBlist\-expand\fP (^Xg ^XG) (^G) (^G) ++List the expansion of the current word\&. ++.TP ++\fBmagic\-space\fP ++Perform history expansion and insert a space into the ++buffer\&. This is intended to be bound to space\&. ++.TP ++\fBmenu\-complete\fP ++Like \fBcomplete\-word\fP, except that menu completion is used\&. ++See the \fBMENU_COMPLETE\fP option\&. ++.TP ++\fBmenu\-expand\-or\-complete\fP ++Like \fBexpand\-or\-complete\fP, except that menu completion is used\&. ++.TP ++\fBreverse\-menu\-complete\fP ++Perform menu completion, like \fBmenu\-complete\fP, except that if ++a menu completion is already in progress, move to the \fIprevious\fP ++completion rather than the next\&. ++.TP ++\fBend\-of\-list\fP ++When a previous completion displayed a list below the prompt, this ++widget can be used to move the prompt below the list\&. ++.SS "Miscellaneous" ++.PD 0 ++.TP ++.PD ++\fBaccept\-and\-hold\fP (ESC\-A ESC\-a) (unbound) (unbound) ++Push the contents of the buffer on the buffer stack ++and execute it\&. ++.TP ++\fBaccept\-and\-infer\-next\-history\fP ++Execute the contents of the buffer\&. ++Then search the history list for a line matching the current one ++and push the event following onto the buffer stack\&. ++.TP ++\fBaccept\-line\fP (^J ^M) (^J ^M) (^J ^M) ++Finish editing the buffer\&. Normally this causes the buffer to be ++executed as a shell command\&. ++.TP ++\fBaccept\-line\-and\-down\-history\fP (^O) (unbound) (unbound) ++Execute the current line, and push the next history ++event on the buffer stack\&. ++.TP ++\fBauto\-suffix\-remove\fP ++If the previous action added a suffix (space, slash, etc\&.) to the word on ++the command line, remove it\&. Otherwise do nothing\&. Removing the suffix ++ends any active menu completion or menu selection\&. ++.RS ++.PP ++This widget is intended to be called from user\-defined widgets to enforce ++a desired suffix\-removal behavior\&. ++.RE ++.TP ++\fBauto\-suffix\-retain\fP ++If the previous action added a suffix (space, slash, etc\&.) to the word on ++the command line, force it to be preserved\&. Otherwise do nothing\&. ++Retaining the suffix ends any active menu completion or menu selection\&. ++.RS ++.PP ++This widget is intended to be called from user\-defined widgets to enforce ++a desired suffix\-preservation behavior\&. ++.RE ++.TP ++\fBbeep\fP ++Beep, unless the \fBBEEP\fP option is unset\&. ++.TP ++\fBvi\-cmd\-mode\fP (^X^V) (unbound) (^[) ++Enter command mode; that is, select the `\fBvicmd\fP\&' keymap\&. ++Yes, this is bound by default in emacs mode\&. ++.TP ++\fBvi\-caps\-lock\-panic\fP ++Hang until any lowercase key is pressed\&. ++This is for vi users without the mental capacity to keep ++track of their caps lock key (like the author)\&. ++.TP ++\fBclear\-screen\fP (^L ESC\-^L) (^L) (^L) ++Clear the screen and redraw the prompt\&. ++.TP ++\fBdescribe\-key\-briefly\fP ++Reads a key sequence, then prints the function bound to that sequence\&. ++.TP ++\fBexchange\-point\-and\-mark\fP (^X^X) (unbound) (unbound) ++Exchange the cursor position (point) with the position of the mark\&. ++Unless a negative prefix argument is given, the region between ++point and mark is activated so that it can be highlighted\&. ++If a zero prefix argument is given, the region is activated but ++point and mark are not swapped\&. ++.TP ++\fBexecute\-named\-cmd\fP (ESC\-x) (:) (unbound) ++Read the name of an editor command and ++execute it\&. A restricted set of editing functions is available in the ++mini\-buffer\&. Keys are looked up in the special ++\fBcommand\fP keymap, and if not found there in the main keymap\&. ++An interrupt signal, as defined by the stty setting, will ++abort the function\&. Note that the following always ++perform the same task within the \fBexecuted\-named\-cmd\fP environment and ++cannot be replaced by user defined widgets, nor can the set of functions ++be extended\&. The allowed functions are: ++\fBbackward\-delete\-char\fP, ++\fBvi\-backward\-delete\-char\fP, ++\fBclear\-screen\fP, ++\fBredisplay\fP, ++\fBquoted\-insert\fP, ++\fBvi\-quoted\-insert\fP, ++\fBbackward\-kill\-word\fP, ++\fBvi\-backward\-kill\-word\fP, ++\fBkill\-whole\-line\fP, ++\fBvi\-kill\-line\fP, ++\fBbackward\-kill\-line\fP, ++\fBlist\-choices\fP, ++\fBdelete\-char\-or\-list\fP, ++\fBcomplete\-word\fP, ++\fBaccept\-line\fP, ++\fBexpand\-or\-complete\fP and ++\fBexpand\-or\-complete\-prefix\fP\&. ++.RS ++.PP ++\fBkill\-region\fP kills the last word, ++and vi\-cmd\-mode is treated the same as accept\-line\&. ++The space and tab characters, if not bound to one of ++these functions, will complete the name and then list the ++possibilities if the \fBAUTO_LIST\fP option is set\&. ++Any other character that is not bound to \fBself\-insert\fP or ++\fBself\-insert\-unmeta\fP will beep and be ignored\&. ++The bindings of the current insert mode will be used\&. ++.PP ++Currently this command may not be redefined or called by name\&. ++.RE ++.TP ++\fBexecute\-last\-named\-cmd\fP (ESC\-z) (unbound) (unbound) ++Redo the last function executed with \fBexecute\-named\-cmd\fP\&. ++.RS ++.PP ++Currently this command may not be redefined or called by name\&. ++.RE ++.TP ++\fBget\-line\fP (ESC\-G ESC\-g) (unbound) (unbound) ++Pop the top line off the buffer stack and insert it at the ++cursor position\&. ++.TP ++\fBpound\-insert\fP (unbound) (#) (unbound) ++If there is no # character at the beginning of the buffer, ++add one to the beginning of each line\&. ++If there is one, remove a # from each line that has one\&. ++In either case, accept the current line\&. ++The \fBINTERACTIVE_COMMENTS\fP option must be set ++for this to have any usefulness\&. ++.TP ++\fBvi\-pound\-insert\fP ++If there is no # character at the beginning of the current line, ++add one\&. If there is one, remove it\&. ++The \fBINTERACTIVE_COMMENTS\fP option must be set ++for this to have any usefulness\&. ++.TP ++\fBpush\-input\fP ++Push the entire current multiline construct onto the buffer stack and ++return to the top\-level (\fBPS1\fP) prompt\&. ++If the current parser construct is only a single line, this is exactly ++like \fBpush\-line\fP\&. ++Next time the editor starts up or is popped with \fBget\-line\fP, the ++construct will be popped off the top of the buffer stack and loaded ++into the editing buffer\&. ++.TP ++\fBpush\-line\fP (^Q ESC\-Q ESC\-q) (unbound) (unbound) ++Push the current buffer onto the buffer stack and clear ++the buffer\&. ++Next time the editor starts up, the buffer will be popped ++off the top of the buffer stack and loaded into the editing ++buffer\&. ++.TP ++\fBpush\-line\-or\-edit\fP ++At the top\-level (\fBPS1\fP) prompt, equivalent to \fBpush\-line\fP\&. ++At a secondary (\fBPS2\fP) prompt, move the entire current multiline ++construct into the editor buffer\&. ++The latter is equivalent to \fBpush\-input\fP followed by \fBget\-line\fP\&. ++.TP ++\fBread\-command\fP ++Only useful from a user\-defined widget\&. A keystroke is read just as in ++normal operation, but instead of the command being executed the name ++of the command that would be executed is stored in the shell parameter ++\fBREPLY\fP\&. This can be used as the argument of a future \fBzle\fP ++command\&. If the key sequence is not bound, status 1 is returned; ++typically, however, \fBREPLY\fP is set to \fBundefined\-key\fP to indicate ++a useless key sequence\&. ++.TP ++\fBrecursive\-edit\fP ++Only useful from a user\-defined widget\&. At this point in the function, ++the editor regains control until one of the standard widgets which would ++normally cause zle to exit (typically an \fBaccept\-line\fP caused by ++hitting the return key) is executed\&. Instead, control returns to the ++user\-defined widget\&. The status returned is non\-zero if the return was ++caused by an error, but the function still continues executing and hence ++may tidy up\&. This makes it safe for the user\-defined widget to alter ++the command line or key bindings temporarily\&. ++.RS ++.PP ++The following widget, \fBcaps\-lock\fP, serves as an example\&. ++.RS ++.nf ++\fBself\-insert\-ucase() { ++ LBUFFER+=${(U)KEYS[\-1]} ++} ++.PP ++integer stat ++.PP ++zle \-N self\-insert self\-insert\-ucase ++zle \-A caps\-lock save\-caps\-lock ++zle \-A accept\-line caps\-lock ++.PP ++zle recursive\-edit ++stat=$? ++.PP ++zle \-A \&.self\-insert self\-insert ++zle \-A save\-caps\-lock caps\-lock ++zle \-D save\-caps\-lock ++.PP ++(( stat )) && zle send\-break ++.PP ++return $stat ++\fP ++.fi ++.RE ++This causes typed letters to be inserted capitalised until either ++\fBaccept\-line\fP (i\&.e\&. typically the return key) is typed or the ++\fBcaps\-lock\fP widget is invoked again; the later is handled by saving ++the old definition of \fBcaps\-lock\fP as \fBsave\-caps\-lock\fP and then ++rebinding it to invoke \fBaccept\-line\fP\&. Note that an error from the ++recursive edit is detected as a non\-zero return status and propagated by ++using the \fBsend\-break\fP widget\&. ++.RE ++.TP ++\fBredisplay\fP (unbound) (^R) (^R) ++Redisplays the edit buffer\&. ++.TP ++\fBreset\-prompt\fP (unbound) (unbound) (unbound) ++Force the prompts on both the left and right of the screen to be ++re\-expanded, then redisplay the edit buffer\&. This ++reflects changes both to the prompt variables themselves and changes ++in the expansion of the values (for example, changes in time or ++directory, or changes to the value of variables referred to by the ++prompt)\&. ++.RS ++.PP ++Otherwise, the prompt is only expanded each time zle starts, and ++when the display as been interrupted by output from another part of the ++shell (such as a job notification) which causes the command line to be ++reprinted\&. ++.RE ++.TP ++\fBsend\-break\fP (^G ESC\-^G) (unbound) (unbound) ++Abort the current editor function, e\&.g\&. \fBexecute\-named\-command\fP, or the ++editor itself, e\&.g\&. if you are in \fBvared\fP\&. Otherwise abort the parsing of ++the current line; in this case the aborted line is available in the shell ++variable \fBZLE_LINE_ABORTED\fP\&. ++.TP ++\fBrun\-help\fP (ESC\-H ESC\-h) (unbound) (unbound) ++Push the buffer onto the buffer stack, and execute the ++command `\fBrun\-help\fP \fIcmd\fP\&', where \fIcmd\fP is the current ++command\&. \fBrun\-help\fP is normally aliased to \fBman\fP\&. ++.TP ++\fBvi\-set\-buffer\fP (unbound) (") (unbound) ++Specify a buffer to be used in the following command\&. ++There are 35 buffers that can be specified: ++the 26 `named\&' buffers \fB"a\fP to \fB"z\fP ++and the nine `queued\&' buffers \fB"1\fP to \fB"9\fP\&. The named buffers can also ++be specified as \fB"A\fP to \fB"Z\fP\&. ++.RS ++.PP ++When a buffer is specified for a cut command, the text being cut replaces ++the previous contents of the specified buffer\&. If a named buffer ++is specified using a capital, the newly cut text is appended to the buffer ++instead of overwriting it\&. ++.PP ++If no buffer is specified for a cut command, \fB"1\fP is used, and the ++contents of \fB"1\fP to \fB"8\fP are each shifted along one buffer; the contents of ++\fB"9\fP is lost\&. ++.RE ++.TP ++\fBvi\-set\-mark\fP (unbound) (m) (unbound) ++Set the specified mark at the cursor position\&. ++.TP ++\fBset\-mark\-command\fP (^@) (unbound) (unbound) ++Set the mark at the cursor position\&. If called with a negative ++prefix argument, do not set the mark but deactivate the region so that ++it is no longer highlighted (it is still usable for other purposes)\&. ++Otherwise the region is marked as active\&. ++.TP ++\fBspell\-word\fP (ESC\-$ ESC\-S ESC\-s) (unbound) (unbound) ++Attempt spelling correction on the current word\&. ++.TP ++\fBundefined\-key\fP ++This command is executed when a key sequence that is not bound to any ++command is typed\&. By default it beeps\&. ++.TP ++\fBundo\fP (^_ ^Xu ^X^U) (unbound) (unbound) ++Incrementally undo the last text modification\&. ++.TP ++\fBredo\fP ++Incrementally redo undone text modifications\&. ++.TP ++\fBvi\-undo\-change\fP (unbound) (u) (unbound) ++Undo the last text modification\&. ++If repeated, redo the modification\&. ++.TP ++\fBwhat\-cursor\-position\fP (^X=) (unbound) (unbound) ++Print the character under the cursor, its code as an octal, decimal and ++hexadecimal number, the current cursor position within the buffer and the ++column of the cursor in the current line\&. ++.TP ++\fBwhere\-is\fP ++Read the name of an editor command and print the listing of key ++sequences that invoke the specified command\&. ++A restricted set of editing functions is available in the ++mini\-buffer\&. Keys are looked up in the special ++\fBcommand\fP keymap, and if not found there in the main keymap\&. ++.TP ++\fBwhich\-command\fP (ESC\-?) (unbound) (unbound) ++Push the buffer onto the buffer stack, and execute the ++command `\fBwhich\-command\fP \fIcmd\fP\&'\&. where \fIcmd\fP is the current ++command\&. \fBwhich\-command\fP is normally aliased to \fIwhence\fP\&. ++.TP ++\fBvi\-digit\-or\-beginning\-of\-line\fP (unbound) (0) (unbound) ++If the last command executed was a digit as part of an argument, ++continue the argument\&. Otherwise, execute vi\-beginning\-of\-line\&. ++.PP ++.SH "CHARACTER HIGHLIGHTING" ++.PP ++The line editor has the ability to highlight characters or regions ++of the line that have a particular significance\&. This is controlled ++by the array parameter \fBzle_highlight\fP, if it has been set by the user\&. ++.PP ++If the parameter contains the single entry \fBnone\fP all highlighting ++is turned off\&. Note the parameter is still expected to be an array\&. ++.PP ++Otherwise each entry of the array should consist of a word indicating a ++context for highlighting, then a colon, then a comma\-separated list of ++the types of highlighting to apply in that context\&. ++.PP ++The contexts available for highlighting are the following: ++.PP ++.PD 0 ++.TP ++.PD ++\fBdefault\fP ++Any text within the command line not affected by any other highlighting\&. ++Text outside the editable area of the command line is not affected\&. ++.TP ++\fBisearch\fP ++When one of the incremental history search widgets is active, the ++area of the command line matched by the search string or pattern\&. ++.TP ++\fBregion\fP ++The region between the cursor (point) and the mark as set with ++\fBset\-mark\-command\fP\&. The region is only highlighted if it is active, ++which is the case if \fBset\-mark\-command\fP or \fBexchange\-point\-and\-mark\fP ++has been called and the line has not been subsequently modified\&. The ++region can be deactivated by calling \fBset\-mark\-command\fP with a ++negative prefix argument, or reactivated by calling ++\fBexchange\-point\-and\-mark\fP with a zero prefix argument\&. Note ++that whether or not the region is active has no effect on its ++use within widgets, it simply determines whether it is highlighted\&. ++.TP ++\fBspecial\fP ++Individual characters that have no direct printable ++representation but are shown in a special manner by the line editor\&. ++These characters are described below\&. ++.TP ++\fBsuffix\fP ++This context is used in completion for characters that are ++marked as suffixes that will be removed if the completion ends ++at that point, the most obvious example being a slash (\fB/\fP) after ++a directory name\&. Note that suffix removal is configurable; the ++circumstances under which the suffix will be removed may differ ++for different completions\&. ++.PP ++\fBzle_highlight\fP may contain additional fields for controlling how ++terminal sequences to change colours are output\&. Each of the following is ++followed by a colon and a string in the same form as for key bindings\&. ++This will not be necessary for the vast majority of terminals as the ++defaults shown in parentheses are widely used\&. ++.PP ++.PD 0 ++.TP ++.PD ++\fBfg_start_code\fP (\fB\ee[3\fP) ++The start of the escape sequence for the foreground colour\&. ++This is followed by an ASCII digit representing the colour\&. ++.TP ++\fBfg_default_code\fP (\fB9\fP) ++The number to use instead of the colour to reset the default foreground ++colour\&. ++.TP ++\fBfg_end_code\fP (\fBm\fP) ++The end of the escape sequence for the foreground colour\&. ++.TP ++\fBbg_start_code\fP (\fB\ee[4\fP) ++The start of the escape sequence for the background colour\&. ++This is followed by an ASCII digit representing the colour\&. ++.TP ++\fBbg_default_code\fP (\fB9\fP) ++The number to use instead of the colour to reset the default ++background colour\&. ++.TP ++\fBbg_end_code\fP (\fBm\fP) ++The end of the escape sequence for the background colour\&. ++.PP ++The available types of highlighting are the following\&. Note that ++not all types of highlighting are available on all terminals: ++.PP ++.PD 0 ++.TP ++.PD ++\fBnone\fP ++No highlighting is applied to the given context\&. It is not useful for ++this to appear with other types of highlighting; it is used to override ++a default\&. ++.TP ++\fBfg=\fP\fIcolour\fP ++The foreground colour should be set to \fIcolour\fP, a decimal integer ++or the name of one of the eight most widely\-supported colours\&. ++.RS ++.PP ++Not all terminals support this and, of those that do, not all provide ++facilities to test the support, hence the user should decide based on the ++terminal type\&. Most terminals support the colours \fBblack\fP, \fBred\fP, ++\fBgreen\fP, \fByellow\fP, \fBblue\fP, \fBmagenta\fP, \fBcyan\fP and \fBwhite\fP, ++which can be set by name\&. In addition\&. \fBdefault\fP may be used to ++set the terminal\&'s default foreground colour\&. Abbreviations are allowed; ++\fBb\fP or \fBbl\fP selects black\&. Some terminals may generate additional ++colours if the \fBbold\fP attribute is also present\&. ++.PP ++On recent terminals and on systems with an up\-to\-date terminal database the ++number of colours supported may be tested by the command `\fBechotc ++Co\fP\&'; if this succeeds, it indicates a limit on the number of colours which ++will be enforced by the line editor\&. The number of colours is in any case ++limited to 256 (i\&.e\&. the range 0 to 255)\&. ++.PP ++Colour is also known as color\&. ++.RE ++.TP ++\fBbg=\fP\fIcolour\fP ++The background colour should be set to \fIcolour\fP\&. ++This works similarly to the foreground colour, except the background is ++not usually affected by the bold attribute\&. ++.TP ++\fBbold\fP ++The characters in the given context are shown in a bold font\&. ++Not all terminals distinguish bold fonts\&. ++.TP ++\fBstandout\fP ++The characters in the given context are shown in the terminal\&'s standout ++mode\&. The actual effect is specific to the terminal; on many terminals it ++is inverse video\&. On some such terminals, where the cursor does not blink ++it appears with standout mode negated, making it less than clear where ++the cursor actually is\&. On such terminals one of the other effects ++may be preferable for highlighting the region and matched search string\&. ++.TP ++\fBunderline\fP ++The characters in the given context are shown underlined\&. Some ++terminals show the foreground in a different colour instead; in this ++case whitespace will not be highlighted\&. ++.PP ++The characters described above as `special\&' are as follows\&. The ++formatting described here is used irrespective of whether the characters ++are highlighted: ++.PP ++.PD 0 ++.TP ++.PD ++ASCII control characters ++Control characters in the ASCII range are shown as ++`\fB^\fP\&' followed by the base character\&. ++.TP ++Unprintable multibyte characters ++This item applies to control characters not in the ASCII range, ++plus other characters as follows\&. If the \fBMULTIBYTE\fP option is in ++effect, multibyte characters not in the ASCII character set that are ++reported as having zero width are treated as combining characters when the ++option \fBCOMBINING_CHARS\fP is on\&. If the option is off, or if a character ++appears where a combining character is not valid, the character ++is treated as unprintable\&. ++.RS ++.PP ++Unprintable multibyte characters are shown as a hexadecimal number between ++angle brackets\&. The number is the code point of the character in the wide ++character set; this may or may not be Unicode, depending on the operating ++system\&. ++.RE ++.TP ++Invalid multibyte characters ++If the \fBMULTIBYTE\fP option is in effect, any sequence of one or more ++bytes that does not form a valid character in the current character ++set is treated as a series of bytes each shown as a special character\&. ++This case can be distinguished from other unprintable characters ++as the bytes are represented as two hexadecimal digits between angle ++brackets, as distinct from the four or eight digits that are used for ++unprintable characters that are nonetheless valid in the current ++character set\&. ++.RS ++.PP ++Not all systems support this: for it to work, the system\&'s representation of ++wide characters must be code values from the Universal Character Set, ++as defined by IS0 10646 (also known as Unicode)\&. ++.RE ++.TP ++Wrapped double\-width characters ++When a double\-width character appears in the final column of a line, it ++is instead shown on the next line\&. The empty space left in the original ++position is highlighted as a special character\&. ++.PP ++If \fBzle_highlight\fP is not set or no value applies to a particular ++context, the defaults applied are equivalent to ++.PP ++.RS ++.nf ++\fBzle_highlight=(region:standout special:standout ++suffix:bold isearch:underline)\fP ++.fi ++.RE ++.PP ++i\&.e\&. both the region and special characters are shown in standout mode\&. ++.PP ++Within widgets, arbitrary regions may be highlighted by setting the ++special array parameter \fBregion_highlight\fP; see ++above\&. ++.PP +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/modlist.yo +@@ -0,0 +1,197 @@ ++startitem() ++item(tt(zsh/attr))( ++Builtins for manipulating extended attributes (xattr). ++) ++item(tt(zsh/cap))( ++Builtins for manipulating POSIX.1e (POSIX.6) capability (privilege) sets. ++) ++item(tt(zsh/clone))( ++A builtin that can clone a running shell onto another terminal. ++) ++item(tt(zsh/compctl))( ++The tt(compctl) builtin for controlling completion. ++) ++item(tt(zsh/complete))( ++The basic completion code. ++) ++item(tt(zsh/complist))( ++Completion listing extensions. ++) ++item(tt(zsh/computil))( ++A module with utility builtins needed for the shell function based ++completion system. ++) ++item(tt(zsh/curses))( ++curses windowing commands ++) ++item(tt(zsh/datetime))( ++Some date/time commands and parameters. ++) ++item(tt(zsh/deltochar))( ++A ZLE function duplicating EMACS' tt(zap-to-char). ++) ++item(tt(zsh/example))( ++An example of how to write a module. ++) ++item(tt(zsh/files))( ++Some basic file manipulation commands as builtins. ++) ++item(tt(zsh/mapfile))( ++Access to external files via a special associative array. ++) ++item(tt(zsh/mathfunc))( ++Standard scientific functions for use in mathematical evaluations. ++) ++item(tt(zsh/newuser))( ++Arrange for files for new users to be installed. ++) ++item(tt(zsh/parameter))( ++Access to internal hash tables via special associative arrays. ++) ++item(tt(zsh/pcre))( ++Interface to the PCRE library. ++) ++item(tt(zsh/regex))( ++Interface to the POSIX regex library. ++) ++item(tt(zsh/sched))( ++A builtin that provides a timed execution facility within the shell. ++) ++item(tt(zsh/net/socket))( ++Manipulation of Unix domain sockets ++) ++item(tt(zsh/stat))( ++A builtin command interface to the tt(stat) system call. ++) ++item(tt(zsh/system))( ++A builtin interface to various low-level system features. ++) ++item(tt(zsh/net/tcp))( ++Manipulation of TCP sockets ++) ++item(tt(zsh/termcap))( ++Interface to the termcap database. ++) ++item(tt(zsh/terminfo))( ++Interface to the terminfo database. ++) ++item(tt(zsh/zftp))( ++A builtin FTP client. ++) ++item(tt(zsh/zle))( ++The Zsh Line Editor, including the tt(bindkey) and tt(vared) builtins. ++) ++item(tt(zsh/zleparameter))( ++Access to internals of the Zsh Line Editor via parameters. ++) ++item(tt(zsh/zprof))( ++A module allowing profiling for shell functions. ++) ++item(tt(zsh/zpty))( ++A builtin for starting a command in a pseudo-terminal. ++) ++item(tt(zsh/zselect))( ++Block and return when file descriptors are ready. ++) ++item(tt(zsh/zutil))( ++Some utility builtins, e.g. the one for supporting configuration via ++styles. ++) ++enditem() ++includefile(Zsh/modmenu.yo) ++texinode(The zsh/attr Module)(The zsh/cap Module)()(Zsh Modules) ++sect(The zsh/attr Module) ++includefile(Zsh/mod_attr.yo) ++texinode(The zsh/cap Module)(The zsh/clone Module)(The zsh/attr Module)(Zsh Modules) ++sect(The zsh/cap Module) ++includefile(Zsh/mod_cap.yo) ++texinode(The zsh/clone Module)(The zsh/compctl Module)(The zsh/cap Module)(Zsh Modules) ++sect(The zsh/clone Module) ++includefile(Zsh/mod_clone.yo) ++texinode(The zsh/compctl Module)(The zsh/complete Module)(The zsh/clone Module)(Zsh Modules) ++sect(The zsh/compctl Module) ++includefile(Zsh/mod_compctl.yo) ++texinode(The zsh/complete Module)(The zsh/complist Module)(The zsh/compctl Module)(Zsh Modules) ++sect(The zsh/complete Module) ++includefile(Zsh/mod_complete.yo) ++texinode(The zsh/complist Module)(The zsh/computil Module)(The zsh/complete Module)(Zsh Modules) ++sect(The zsh/complist Module) ++includefile(Zsh/mod_complist.yo) ++texinode(The zsh/computil Module)(The zsh/curses Module)(The zsh/complist Module)(Zsh Modules) ++sect(The zsh/computil Module) ++includefile(Zsh/mod_computil.yo) ++texinode(The zsh/curses Module)(The zsh/datetime Module)(The zsh/computil Module)(Zsh Modules) ++sect(The zsh/curses Module) ++includefile(Zsh/mod_curses.yo) ++texinode(The zsh/datetime Module)(The zsh/deltochar Module)(The zsh/curses Module)(Zsh Modules) ++sect(The zsh/datetime Module) ++includefile(Zsh/mod_datetime.yo) ++texinode(The zsh/deltochar Module)(The zsh/example Module)(The zsh/datetime Module)(Zsh Modules) ++sect(The zsh/deltochar Module) ++includefile(Zsh/mod_deltochar.yo) ++texinode(The zsh/example Module)(The zsh/files Module)(The zsh/deltochar Module)(Zsh Modules) ++sect(The zsh/example Module) ++includefile(Zsh/mod_example.yo) ++texinode(The zsh/files Module)(The zsh/mapfile Module)(The zsh/example Module)(Zsh Modules) ++sect(The zsh/files Module) ++includefile(Zsh/mod_files.yo) ++texinode(The zsh/mapfile Module)(The zsh/mathfunc Module)(The zsh/files Module)(Zsh Modules) ++sect(The zsh/mapfile Module) ++includefile(Zsh/mod_mapfile.yo) ++texinode(The zsh/mathfunc Module)(The zsh/newuser Module)(The zsh/mapfile Module)(Zsh Modules) ++sect(The zsh/mathfunc Module) ++includefile(Zsh/mod_mathfunc.yo) ++texinode(The zsh/newuser Module)(The zsh/parameter Module)(The zsh/mathfunc Module)(Zsh Modules) ++sect(The zsh/newuser Module) ++includefile(Zsh/mod_newuser.yo) ++texinode(The zsh/parameter Module)(The zsh/pcre Module)(The zsh/newuser Module)(Zsh Modules) ++sect(The zsh/parameter Module) ++includefile(Zsh/mod_parameter.yo) ++texinode(The zsh/pcre Module)(The zsh/regex Module)(The zsh/parameter Module)(Zsh Modules) ++sect(The zsh/pcre Module) ++includefile(Zsh/mod_pcre.yo) ++texinode(The zsh/regex Module)(The zsh/sched Module)(The zsh/pcre Module)(Zsh Modules) ++sect(The zsh/regex Module) ++includefile(Zsh/mod_regex.yo) ++texinode(The zsh/sched Module)(The zsh/net/socket Module)(The zsh/regex Module)(Zsh Modules) ++sect(The zsh/sched Module) ++includefile(Zsh/mod_sched.yo) ++texinode(The zsh/net/socket Module)(The zsh/stat Module)(The zsh/sched Module)(Zsh Modules) ++sect(The zsh/net/socket Module) ++includefile(Zsh/mod_socket.yo) ++texinode(The zsh/stat Module)(The zsh/system Module)(The zsh/net/socket Module)(Zsh Modules) ++sect(The zsh/stat Module) ++includefile(Zsh/mod_stat.yo) ++texinode(The zsh/system Module)(The zsh/net/tcp Module)(The zsh/stat Module)(Zsh Modules) ++sect(The zsh/system Module) ++includefile(Zsh/mod_system.yo) ++texinode(The zsh/net/tcp Module)(The zsh/termcap Module)(The zsh/system Module)(Zsh Modules) ++sect(The zsh/net/tcp Module) ++includefile(Zsh/mod_tcp.yo) ++texinode(The zsh/termcap Module)(The zsh/terminfo Module)(The zsh/net/tcp Module)(Zsh Modules) ++sect(The zsh/termcap Module) ++includefile(Zsh/mod_termcap.yo) ++texinode(The zsh/terminfo Module)(The zsh/zftp Module)(The zsh/termcap Module)(Zsh Modules) ++sect(The zsh/terminfo Module) ++includefile(Zsh/mod_terminfo.yo) ++texinode(The zsh/zftp Module)(The zsh/zle Module)(The zsh/terminfo Module)(Zsh Modules) ++sect(The zsh/zftp Module) ++includefile(Zsh/mod_zftp.yo) ++texinode(The zsh/zle Module)(The zsh/zleparameter Module)(The zsh/zftp Module)(Zsh Modules) ++sect(The zsh/zle Module) ++includefile(Zsh/mod_zle.yo) ++texinode(The zsh/zleparameter Module)(The zsh/zprof Module)(The zsh/zle Module)(Zsh Modules) ++sect(The zsh/zleparameter Module) ++includefile(Zsh/mod_zleparameter.yo) ++texinode(The zsh/zprof Module)(The zsh/zpty Module)(The zsh/zleparameter Module)(Zsh Modules) ++sect(The zsh/zprof Module) ++includefile(Zsh/mod_zprof.yo) ++texinode(The zsh/zpty Module)(The zsh/zselect Module)(The zsh/zprof Module)(Zsh Modules) ++sect(The zsh/zpty Module) ++includefile(Zsh/mod_zpty.yo) ++texinode(The zsh/zselect Module)(The zsh/zutil Module)(The zsh/zpty Module)(Zsh Modules) ++sect(The zsh/zselect Module) ++includefile(Zsh/mod_zselect.yo) ++texinode(The zsh/zutil Module)()(The zsh/zselect Module)(Zsh Modules) ++sect(The zsh/zutil Module) ++includefile(Zsh/mod_zutil.yo) +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/modmenu.yo +@@ -0,0 +1,34 @@ ++startmenu() ++menu(The zsh/attr Module) ++menu(The zsh/cap Module) ++menu(The zsh/clone Module) ++menu(The zsh/compctl Module) ++menu(The zsh/complete Module) ++menu(The zsh/complist Module) ++menu(The zsh/computil Module) ++menu(The zsh/curses Module) ++menu(The zsh/datetime Module) ++menu(The zsh/deltochar Module) ++menu(The zsh/example Module) ++menu(The zsh/files Module) ++menu(The zsh/mapfile Module) ++menu(The zsh/mathfunc Module) ++menu(The zsh/newuser Module) ++menu(The zsh/parameter Module) ++menu(The zsh/pcre Module) ++menu(The zsh/regex Module) ++menu(The zsh/sched Module) ++menu(The zsh/net/socket Module) ++menu(The zsh/stat Module) ++menu(The zsh/system Module) ++menu(The zsh/net/tcp Module) ++menu(The zsh/termcap Module) ++menu(The zsh/terminfo Module) ++menu(The zsh/zftp Module) ++menu(The zsh/zle Module) ++menu(The zsh/zleparameter Module) ++menu(The zsh/zprof Module) ++menu(The zsh/zpty Module) ++menu(The zsh/zselect Module) ++menu(The zsh/zutil Module) ++endmenu() +--- /dev/null ++++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/manmodmenu.yo +@@ -0,0 +1,32 @@ ++menu(The zsh/attr Module) ++menu(The zsh/cap Module) ++menu(The zsh/clone Module) ++menu(The zsh/compctl Module) ++menu(The zsh/complete Module) ++menu(The zsh/complist Module) ++menu(The zsh/computil Module) ++menu(The zsh/curses Module) ++menu(The zsh/datetime Module) ++menu(The zsh/deltochar Module) ++menu(The zsh/example Module) ++menu(The zsh/files Module) ++menu(The zsh/mapfile Module) ++menu(The zsh/mathfunc Module) ++menu(The zsh/newuser Module) ++menu(The zsh/parameter Module) ++menu(The zsh/pcre Module) ++menu(The zsh/regex Module) ++menu(The zsh/sched Module) ++menu(The zsh/net/socket Module) ++menu(The zsh/stat Module) ++menu(The zsh/system Module) ++menu(The zsh/net/tcp Module) ++menu(The zsh/termcap Module) ++menu(The zsh/terminfo Module) ++menu(The zsh/zftp Module) ++menu(The zsh/zle Module) ++menu(The zsh/zleparameter Module) ++menu(The zsh/zprof Module) ++menu(The zsh/zpty Module) ++menu(The zsh/zselect Module) ++menu(The zsh/zutil Module) diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/patches/series zsh-beta-4.3.12-dev-1+20110925/debian/patches/series --- zsh-beta-4.3.11-dev-1+20110504/debian/patches/series 2011-05-05 23:37:49.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/patches/series 2011-10-11 02:53:48.000000000 +0000 @@ -1 +1 @@ -debian-changes-4.3.11-dev-1+20110504-1 +ergh diff -Nru zsh-beta-4.3.11-dev-1+20110504/debian/rules zsh-beta-4.3.12-dev-1+20110925/debian/rules --- zsh-beta-4.3.11-dev-1+20110504/debian/rules 2011-05-05 23:36:27.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/debian/rules 2011-10-11 03:42:25.000000000 +0000 @@ -10,7 +10,10 @@ snapshot_date := $(shell dpkg-parsechangelog | sed -n '/^Version: [0-9.][0-9.]*.*+20[0-9][0-9]\([0-9][0-9][0-9][0-9]\)-[0-9][0-9]*$$/ {s//\1/;p}') endif -CFLAGS = -Wall -g +CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) +LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) + ifeq (zsh-beta,$(package)) CFLAGS += -W endif @@ -39,18 +42,15 @@ CONFIGFLAGS += --enable-zsh-debug --enable-zsh-mem-debug --enable-zsh-mem-warning --enable-zsh-secure-free --enable-zsh-hash-debug endif -ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) -CFLAGS += -O0 -else -CFLAGS += -O2 -endif - ifeq (zsh-beta,$(package)) ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif endif +build-arch: build +build-indep: build + build: stamp-configure $(checkdir) ifeq (zsh-beta,$(package)) @@ -370,4 +370,4 @@ $(checkdir) test root = "`whoami`" -.PHONY: binary binary-arch binary-indep clean checkroot binary-arch-dynamic binary-arch-static prebuild binary-arch-dev +.PHONY: build-arch build-indep binary binary-arch binary-indep clean checkroot binary-arch-dynamic binary-arch-static prebuild binary-arch-dev diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/builtins.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/builtins.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/builtins.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/builtins.yo 2011-10-02 01:10:11.000000000 +0000 @@ -621,7 +621,7 @@ . By default var(mathfn) may take any number of comma-separated arguments. If var(min) is given, it must have exactly var(min) args; if var(min) and var(max) are -both given, it must have at least var(min) and and at most var(max) +both given, it must have at least var(min) and at most var(max) args. var(max) may be -1 to indicate that there is no upper limit. By default the function is implemented by a shell function of the same @@ -914,7 +914,7 @@ tt(popd) that do not change the environment seen by an interactive user. ) findex(print) -xitem(tt(print) [ tt(-abcDilmnNoOpPrsz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ]) +xitem(tt(print) [ tt(-abcDilmnNoOpPrsSz) ] [ tt(-u) var(n) ] [ tt(-f) var(format) ] [ tt(-C) var(cols) ]) item( [ tt(-R) [ tt(-en) ]] [ var(arg) ... ])( With the `tt(-f)' option the arguments are printed as described by tt(printf). With no flags or with the flag `tt(-)', the arguments are printed on @@ -994,6 +994,15 @@ ) item(tt(-s))( Place the results in the history list instead of on the standard output. +Each argument to the tt(print) command is treated as a single word in the +history, regardless of its content. +) +item(tt(-S))( +Place the results in the history list instead of on the standard output. +In this case only a single argument is allowed; it will be split into +words as if it were a full shell command line. The effect is +similar to reading the line from a history file with the +tt(HIST_LEX_WORDS) option active. ) item(tt(-u) var(n))( Print the arguments to file descriptor var(n). diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/calsys.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/calsys.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/calsys.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/calsys.yo 2011-10-02 01:10:11.000000000 +0000 @@ -363,7 +363,7 @@ ) item(tt(-C) var(calfile))( Explicitly specify a calendar file instead of the value of -the tt(calendar-file) style or the the default tt(~/calendar). +the tt(calendar-file) style or the default tt(~/calendar). ) item(tt(-d))( Move any events that have passed from the calendar file to the diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compctl.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compctl.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compctl.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compctl.yo 2011-10-02 01:10:11.000000000 +0000 @@ -69,7 +69,7 @@ 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 +used for filename generation. These should 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 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compsys.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compsys.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compsys.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compsys.yo 2011-10-02 01:10:11.000000000 +0000 @@ -462,7 +462,7 @@ The var(function) argument may alternatively be a string containing almost any shell code. If the string contains an equal sign, the above -will take precedence. The option -e may be used to specify the first +will take precedence. The option tt(-e) may be used to specify the first argument is to be evaluated as shell code even if it contains an equal sign. The string will be executed using the tt(eval) builtin command to generate completions. This provides a way of avoiding having to define @@ -786,7 +786,9 @@ ) kindex(directories, completion tag) item(tt(directories))( -for names of directories +for names of directories DASH()- tt(local-directories) is used instead +when completing arguments of tt(cd) and related builtin commands when +the tt(cdpath) array is set ) kindex(directory-stack, completion tag) item(tt(directory-stack))( @@ -879,7 +881,8 @@ item(tt(local-directories))( for names of directories that are subdirectories of the current working directory when completing arguments of tt(cd) and related builtin -commands (compare tt(path-directories)) +commands (compare tt(path-directories)) DASH()- when the tt(cdpath) +array is unset, tt(directories) is used instead ) kindex(manuals, completion tag) item(tt(manuals))( @@ -1082,7 +1085,7 @@ corresponding to a type of match, and if no style was found, for the tt(default) tag. The most notable styles of this type are tt(menu), tt(list-colors) and styles controlling completion listing such as -tt(list-packed) and tt(last-prompt)). When tested for the tt(default) +tt(list-packed) and tt(last-prompt). When tested for the tt(default) tag, only the var(function) field of the context will be set so that a style using the default tag will normally be defined along the lines of: @@ -1681,8 +1684,8 @@ `tt(current)', the word the cursor is on will not be considered as a possible completion. The value `tt(current-shown)' is similar but only applies if the list of completions is currently shown on the screen. -Finally, if the style is set to `tt(other)', no word apart from the -current one will be considered as a possible completion. +Finally, if the style is set to `tt(other)', all words on the line except +for the current one will be excluded from the possible completions. The values `tt(current)' and `tt(current-shown)' are a bit like the opposite of the tt(accept-exact) style: only strings with @@ -1934,7 +1937,7 @@ (or, with a numeric argument, some other) width. After deleting this prompt the variable tt(LISTPROMPT) should be unset for -the the removal to take effect. +the removal to take effect. ) kindex(list-rows-first, completion style) item(tt(list-rows-first))( @@ -2665,7 +2668,7 @@ ) kindex(urls, completion style) item(tt(urls))( -This is used together with the the tt(urls) tag by +This is used together with the tt(urls) tag by functions completing URLs. If the value consists of more than one string, or if the only string @@ -2736,17 +2739,6 @@ the cache of host names is generated (typically the first completion attempt). ) -kindex(use-perl, completion style) -item(tt(use-perl))( -Various parts of the function system use awk to extract words from -files or command output as it is universally available. However, many -versions of awk have arbitrary limits on the size of input. If this -style is set, perl will be used instead. This is almost always -preferable if perl is available on your system. - -Currently this is only used in completions for `make', but it may be -extended depending on authorial frustration. -) kindex(users, completion style) item(tt(users))( This may be set to a list of usernames to be completed. @@ -3419,7 +3411,7 @@ those generated by tt(_all_labels). ) findex(_alternative) -item(tt(_alternative) [ tt(-C) var(name) ] var(spec) ...)( +item(tt(_alternative) [ tt(-O) var(name) ] [ tt(-C) var(name) ] var(spec) ...)( This function is useful in simple cases where multiple tags are available. Essentially it implements a loop like the one described for the tt(_tags) function below. @@ -3446,6 +3438,10 @@ only required if there is an additional valid tag, for example inside a function called from tt(_alternative). +The option `tt(-O) var(name)' is used in the same way as by the +tt(_arguments) function. In other words, the elements of the var(name) +array will be passed to tt(compadd) when executing an action. + Like tt(_tags) this function supports the tt(-C) option to give a different name for the argument context field. ) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compwid.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compwid.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/compwid.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/compwid.yo 2011-10-02 01:10:11.000000000 +0000 @@ -162,7 +162,10 @@ ) item(tt(brace_parameter))( when completing the name of a parameter in a parameter expansion beginning -with tt(${). +with tt(${). This context will also be set when completing parameter +flags following tt(${LPAR()); the full command line argument is presented +and the handler must test the value to be completed to ascertain that +this is the case. ) item(tt(assign_parameter))( when completing the name of a parameter in a parameter assignment. @@ -239,7 +242,7 @@ key ends in a space, the match is inserted as in a menu completion, i.e. without automatically appending a space. -Both tt(menu) and tt(automenu) may also specify the the number of the +Both tt(menu) and tt(automenu) may also specify the number of the match to insert, given after a colon. For example, `tt(menu:2)' says to start menu completion, beginning with the second match. diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/contrib.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/contrib.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/contrib.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/contrib.yo 2011-10-02 01:10:11.000000000 +0000 @@ -614,7 +614,7 @@ (http://savannah.nongnu.org/projects/quilt). See tt(Quilt Support) below for details. -To load var(vcs_info): +To load tt(vcs_info): example(autoload -Uz vcs_info) @@ -624,21 +624,21 @@ subsect(Quickstart) To get this feature working quickly (including colors), you can do the -following (assuming, you loaded var(vcs_info) properly - see above): +following (assuming, you loaded tt(vcs_info) properly - see above): -example(zstyle ':vcs_info:*' actionformats \ +example(zstyle ':vcs_info:*' actionformats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{3}|%F{1}%a%F{5}]%f ' -zstyle ':vcs_info:*' formats \ +zstyle ':vcs_info:*' formats \ '%F{5}(%f%s%F{5})%F{3}-%F{5}[%F{2}%b%F{5}]%f ' zstyle ':vcs_info:(sv[nk]|bzr):*' branchformat '%b%F{1}:%F{3}%r' precmd () { vcs_info } PS1='%F{5}[%F{2}%n%F{5}] %F{3}%3~ ${vcs_info_msg_0_}%f%# ') Obviously, the last two lines are there for demonstration. You need to -call var(vcs_info) from your var(precmd) function. Once that is done you need -a tt(single quoted) var('${vcs_info_msg_0_}') in your prompt. +call tt(vcs_info) from your tt(precmd) function. Once that is done you need +a tt(single quoted) tt('${vcs_info_msg_0_}') in your prompt. -To be able to use var('${vcs_info_msg_0_}') directly in your prompt like +To be able to use tt('${vcs_info_msg_0_}') directly in your prompt like this, you will need to have the tt(PROMPT_SUBST) option enabled. Now call the tt(vcs_info_printsys) utility from the command line: @@ -678,54 +678,55 @@ example(zstyle ':vcs_info:*' enable git cvs svn) If you rerun tt(vcs_info_printsys) after one of these commands, you will -see the backends listed in the var(disable) style (or backends not in the -var(enable) style - if you used that) marked as disabled by a hash sign. -That means the detection of these systems is skipped tt(completely). No +see the backends listed in the tt(disable) style (or backends not in the +tt(enable) style - if you used that) marked as disabled by a hash sign. +That means the detection of these systems is skipped em(completely). No wasted time there. subsect(Configuration) -The var(vcs_info) feature can be configured via var(zstyle). +The tt(vcs_info) feature can be configured via tt(zstyle). First, the context in which we are working: -example(:vcs_info:::) +example(:vcs_info:var(vcs-string):var(user-context):var(repo-root-name)) startitem() -item(tt())( -is one of: git, git-svn, git-p4, hg, hg-git, hg-hgsubversion, hg-hgsvn, -darcs, bzr, cdv, mtn, svn, cvs, svk, tla, p4 or fossil. When hooks are -active the hooks name is added after a `+'. (See tt(Hooks in vcs_info) +item(var(vcs-string))( +is one of: bf(git), bf(git-svn), bf(git-p4), bf(hg), bf(hg-git), +bf(hg-hgsubversion), bf(hg-hgsvn), bf(darcs), bf(bzr), bf(cdv), bf(mtn), +bf(svn), bf(cvs), bf(svk), bf(tla), bf(p4) or bf(fossil). When hooks are +active the hooks name is added after a `+'. (See bf(Hooks in vcs_info) below.) ) -item(tt())( +item(var(user-context))( is a freely configurable string, assignable by -the user as the first argument to var(vcs_info) (see its description +the user as the first argument to tt(vcs_info) (see its description below). ) -item(tt())( +item(var(repo-root-name))( is the name of a repository in which you want a -style to match. So, if you want a setting specific to var(/usr/src/zsh), -with that being a CVS checkout, you can set tt() to -var(zsh) to make it so. +style to match. So, if you want a setting specific to tt(/usr/src/zsh), +with that being a CVS checkout, you can set var(repo-root-name) to +tt(zsh) to make it so. ) enditem() -There are three special values for tt(): The first is named -var(-init-), that is in effect as long as there was no decision what VCS -backend to use. The second is var(-preinit-); it is used tt(before) -var(vcs_info) is run, when initializing the data exporting variables. The -third special value is var(formats) and is used by the tt(vcs_info_lastmsg) +There are three special values for var(vcs-string): The first is named +tt(-init-), that is in effect as long as there was no decision what VCS +backend to use. The second is tt(-preinit-); it is used em(before) +tt(vcs_info) is run, when initializing the data exporting variables. The +third special value is tt(formats) and is used by the tt(vcs_info_lastmsg) for looking up its styles. -The initial value of tt() is var(-all-) and it is replaced +The initial value of var(repo-root-name) is tt(-all-) and it is replaced with the actual name, as soon as it is known. Only use this part of the -context for defining the var(formats), var(actionformats) or -var(branchformat) styles, as it is guaranteed that tt() is +context for defining the tt(formats), tt(actionformats) or +tt(branchformat) styles, as it is guaranteed that var(repo-root-name) is set up correctly for these only. For all other styles, just use tt('*') instead. -There are two pre-defined values for tt(): +There are two pre-defined values for var(user-context): startsitem() sitem(tt(default))(the one used if none is specified) sitem(tt(command))(used by vcs_info_lastmsg to lookup its styles) @@ -750,15 +751,15 @@ ) kindex(branchformat) item(tt(branchformat))( -Some backends replace var(%b) in the formats and +Some backends replace tt(%b) in the formats and actionformats styles above, not only by a branch name but also by a revision number. This style lets you modify how that string should look. ) kindex(nvcsformats) item(tt(nvcsformats))( These "formats" are exported when we didn't detect a version control system -for the current directory or var(vcs_info) was disabled. This is useful if -you want var(vcs_info) to completely take over the generation of your +for the current directory or tt(vcs_info) was disabled. This is useful if +you want tt(vcs_info) to completely take over the generation of your prompt. You would do something like tt(PS1='${vcs_info_msg_0_}') to accomplish that. ) @@ -766,36 +767,36 @@ item(tt(hgrevformat))( tt(hg) uses both a hash and a revision number to reference a specific changeset in a repository. With this style you can format the revision -string (see var(branchformat)) to include either or both. It's only -useful when var(get-revision) is true. +string (see tt(branchformat)) to include either or both. It's only +useful when tt(get-revision) is true. ) kindex(max-exports) item(tt(max-exports))( Defines the maximum number of -var(vcs_info_msg_*_) variables var(vcs_info) will export. +tt(vcs_info_msg_*_) variables tt(vcs_info) will export. ) kindex(enable) item(tt(enable))( -A list of backends you want to use. Checked in the var(-init-) context. If +A list of backends you want to use. Checked in the tt(-init-) context. If this list contains an item called tt(NONE) no backend is used at all and -var(vcs_info) will do nothing. If this list contains tt(ALL) var(vcs_info) +tt(vcs_info) will do nothing. If this list contains tt(ALL), tt(vcs_info) will use all known backends. Only with tt(ALL) in tt(enable) will the tt(disable) style have any effect. tt(ALL) and tt(NONE) are case insensitive. ) kindex(disable) item(tt(disable))( -A list of VCSs you don't want var(vcs_info) to test for -repositories (checked in the var(-init-) context, too). Only used if +A list of VCSs you don't want tt(vcs_info) to test for +repositories (checked in the tt(-init-) context, too). Only used if tt(enable) contains tt(ALL). ) kindex(disable-patterns) item(tt(disable-patterns))( A list of patterns that are checked against tt($PWD). If a pattern -matches, var(vcs_info) will be disabled. This style is checked in the -var(:vcs_info:-init-:*:-all-) context. +matches, tt(vcs_info) will be disabled. This style is checked in the +tt(:vcs_info:-init-:*:-all-) context. Say, tt(~/.zsh) is a directory under version control, in which you do -not want var(vcs_info) to be active, do: +not want tt(vcs_info) to be active, do: example(zstyle ':vcs_info:*' disable-patterns "$HOME/.zsh+LPAR()|/*+RPAR()") ) kindex(use-quilt) @@ -810,7 +811,7 @@ ) kindex(quilt-patch-dir) item(tt(quilt-patch-dir))( -Overwrite the value of the var($QUILT_PATCHES) environment variable. See +Overwrite the value of the tt($QUILT_PATCHES) environment variable. See tt(Quilt Support) for details. ) kindex(quiltcommand) @@ -822,10 +823,14 @@ item(tt(check-for-changes))( If enabled, this style causes the tt(%c) and tt(%u) format escapes to show when the working directory has uncommitted changes. The strings displayed by -these escapes can be controlled via the var(stagedstr) and var(unstagedstr) +these escapes can be controlled via the tt(stagedstr) and tt(unstagedstr) styles. The only backends that currently support this option are tt(git) and tt(hg) (tt(hg) only supports unstaged). +For this style to be evaluated with the tt(hg) backend, the tt(get-revision) +style needs to be set and the tt(use-simple) style needs to be unset. The +latter is the default; the former is not. + Note, the actions taken if this style is enabled are potentially expensive (read: they may be slow, depending on how big the current repository is). Therefore, it is disabled by default. @@ -842,19 +847,19 @@ ) kindex(command) item(tt(command))( -This style causes var(vcs_info) to use the supplied string as the command +This style causes tt(vcs_info) to use the supplied string as the command to use as the VCS's binary. Note, that setting this in ':vcs_info:*' is not a good idea. If the value of this style is empty (which is the default), the used binary -name is the name of the backend in use (e.g. var(svn) is used in an var(svn) +name is the name of the backend in use (e.g. tt(svn) is used in an tt(svn) repository). -The var(repo-root-name) part in the context is always the default tt(-all-) +The tt(repo-root-name) part in the context is always the default tt(-all-) when this style is looked up. For example, this style can be used to use binaries from non-default -installation directories. Assume, var(git) is installed in /usr/bin but +installation directories. Assume, tt(git) is installed in /usr/bin but your sysadmin installed a newer version in /usr/bin/local. Instead of changing the order of your tt($PATH) parameter, you can do this: example(zstyle ':vcs_info:git:*:-all-' command /usr/local/bin/git) @@ -865,7 +870,7 @@ contact the Perforce server to find out if a directory is managed by Perforce. This is the only reliable way of doing this, but runs the risk of a delay if the server name cannot be found. If the -server (more specifically, the var(host)tt(:)var(port) pair describing the +server (more specifically, the tt(host)tt(:)tt(port) pair describing the server) cannot be contacted, its name is put into the associative array tt(vcs_info_p4_dead_servers) and is not contacted again during the session until it is removed by hand. If you do not set this style, the tt(p4) @@ -906,17 +911,17 @@ kindex(use-prompt-escapes) item(tt(use-prompt-escapes))( Determines if we assume that the assembled -string from var(vcs_info) includes prompt escapes. (Used by +string from tt(vcs_info) includes prompt escapes. (Used by tt(vcs_info_lastmsg).) ) kindex(debug) item(tt(debug))( Enable debugging output to track possible problems. Currently this style -is only used by var(vcs_info)'s hooks system. +is only used by tt(vcs_info)'s hooks system. ) kindex(hooks) item(tt(hooks))( -A list style that defines hook-function names. See tt(Hooks in vcs_info) +A list style that defines hook-function names. See bf(Hooks in vcs_info) below for details. ) enditem() @@ -947,7 +952,7 @@ sitem(tt(hooks))((empty list)) sitem(tt(use-quilt))(false) sitem(tt(quilt-standalone))(false) -sitem(tt(quilt-patch-dir))(empty - use var($QUILT_PATCHES)) +sitem(tt(quilt-patch-dir))(empty - use tt($QUILT_PATCHES)) sitem(tt(quiltcommand))(quilt) endsitem() @@ -958,18 +963,18 @@ sitem(tt(%s))(The VCS in use (git, hg, svn, etc.).) sitem(tt(%b))(Information about the current branch.) sitem(tt(%a))(An identifier that describes the action. Only makes sense in -var(actionformats).) +tt(actionformats).) sitem(tt(%i))(The current revision number or identifier. For tt(hg) -the var(hgrevformat) style may be used to customize the output.) -sitem(tt(%c))(The string from the var(stagedstr) style if there are staged +the tt(hgrevformat) style may be used to customize the output.) +sitem(tt(%c))(The string from the tt(stagedstr) style if there are staged changes in the repository.) -sitem(tt(%u))(The string from the var(unstagedstr) style if there are +sitem(tt(%u))(The string from the tt(unstagedstr) style if there are unstaged changes in the repository.) sitem(tt(%R))(The base directory of the repository.) -sitem(tt(%r))(The repository name. If tt(%R) is var(/foo/bar/repoXY), tt(%r) -is var(repoXY).) +sitem(tt(%r))(The repository name. If tt(%R) is tt(/foo/bar/repoXY), tt(%r) +is tt(repoXY).) sitem(tt(%S))(A subdirectory within a repository. If tt($PWD) is -var(/foo/bar/repoXY/beer/tasty), tt(%S) is var(beer/tasty).) +tt(/foo/bar/repoXY/beer/tasty), tt(%S) is tt(beer/tasty).) sitem(tt(%m))(A "misc" replacement. It is at the discretion of the backend to decide what this replacement expands to. It is currently used by the tt(hg) and tt(git) backends to display patch information from the tt(mq) and @@ -980,7 +985,7 @@ startsitem() sitem(tt(%b))(The branch name.) -sitem(tt(%r))(The current revision number or the var(hgrevformat) style for +sitem(tt(%r))(The current revision number or the tt(hgrevformat) style for tt(hg).) endsitem() @@ -1007,18 +1012,18 @@ subsect(Oddities) -If you want to use the tt(%b) (bold off) prompt expansion in var(formats), -which expands tt(%b) itself, use tt(%%b). That will cause the var(vcs_info) +If you want to use the tt(%b) (bold off) prompt expansion in tt(formats), +which expands tt(%b) itself, use tt(%%b). That will cause the tt(vcs_info) expansion to replace tt(%%b) with tt(%b), so that zsh's prompt expansion mechanism can handle it. Similarly, to hand down tt(%b) from -var(branchformat), use tt(%%%%b). Sorry for this inconvenience, but it +tt(branchformat), use tt(%%%%b). Sorry for this inconvenience, but it cannot be easily avoided. Luckily we do not clash with a lot of prompt expansions and this only needs to be done for those. subsect(Quilt Support) -tt(Quilt) is not a version control system, therefore this is not implemented +bf(Quilt) is not a version control system, therefore this is not implemented as a backend. It can help keeping track of a series of patches. People use it to keep a set of changes they want to use on top of software packages (which is tightly integrated into the package build process - the Debian project @@ -1026,63 +1031,63 @@ developers keep track of their own patches on top of real version control systems. -The var(vcs_info) integration tries to support both ways of using quilt by +The tt(vcs_info) integration tries to support both ways of using quilt by having two slightly different modes of operation: `addon' mode and `standalone' mode). -For `addon' mode to become active var(vcs_info) must have already detected a +For `addon' mode to become active tt(vcs_info) must have already detected a real version control system controlling the directory. If that is the case, a directory that holds quilt's patches needs to be found. That directory is -configurable via the var(`QUILT_PATCHES') environment variable. If that -variable exists its value is used, otherwise the value tt(`patches') is -assumed. The value from var($QUILT_PATCHES) can be overwritten using the -tt(`quilt-patches') style. (Note: you can use var(vcs_info) to keep the value -of var($QUILT_PATCHES) correct all the time via the tt(post-quilt) hook). +configurable via the `tt(QUILT_PATCHES)' environment variable. If that +variable exists its value is used, otherwise the value `tt(patches)' is +assumed. The value from tt($QUILT_PATCHES) can be overwritten using the +tt(`quilt-patches') style. (Note: you can use tt(vcs_info) to keep the value +of tt($QUILT_PATCHES) correct all the time via the tt(post-quilt) hook). When the directory in question is found, quilt is assumed to be active. To -gather more information, var(vcs_info) looks for a directory called `.pc'; +gather more information, tt(vcs_info) looks for a directory called `.pc'; Quilt uses that directory to track its current state. If this directory does not exist we know that quilt has not done anything to the working directory (read: no patches have been applied yet). -If patches are applied, var(vcs_info) will try to find out which. If you want +If patches are applied, tt(vcs_info) will try to find out which. If you want to know which patches of a series are not yet applied, you need to activate the tt(get-unapplied) style in the appropriate context. -var(vcs_info) allows for very detailed control over how the gathered -information is presented (see the below sections, tt(Styles) and tt(Hooks in +tt(vcs_info) allows for very detailed control over how the gathered +information is presented (see the below sections, bf(Styles) and bf(Hooks in vcs_info)), all of which are documented below. Note there are a number of other patch tracking systems that work on top of a certain version control -system (like tt(stgit) for tt(git), or tt(mq) for tt(hg)); the configuration -for systems like that are generally configured the same way as the tt(quilt) +system (like tt(stgit) for bf(git), or tt(mq) for bf(hg)); the configuration +for systems like that are generally configured the same way as the bf(quilt) support. -If the tt(quilt) support is working in `addon' mode, the produced string is -available as a simple format replacement (var(%Q) to be precise), which can +If the bf(quilt) support is working in `addon' mode, the produced string is +available as a simple format replacement (tt(%Q) to be precise), which can be used in tt(formats) and tt(actionformats); see below for details). If, on the other hand, the support code is working in `standalone' mode, -var(vcs_info) will pretend as if tt(quilt) were an actual version control +tt(vcs_info) will pretend as if tt(quilt) were an actual version control system. That means that the version control system identifier (which otherwise would be something like `svn' or `cvs') will be set to `tt(-quilt-)'. This has implications on the used style context where this -identifier is the second element. var(vcs_info) will have filled in a proper +identifier is the second element. tt(vcs_info) will have filled in a proper value for the "repository's" root directory and the string containing the information about quilt's state will be available as the `misc' replacement -(and var(%Q) for compatibility with `addon' mode. +(and tt(%Q) for compatibility with `addon' mode. What is left to discuss is how `standalone' mode is detected. The detection itself is a series of searches for directories. You can have this detection enabled all the time in every directory that is not otherwise under version control. If you know there is only a limited set of trees where you would -like var(vcs_info) to try and look for Quilt in `standalone' mode to minimise -the amount of searching on every call to var(vcs_info), there are a number of +like tt(vcs_info) to try and look for Quilt in `standalone' mode to minimise +the amount of searching on every call to tt(vcs_info), there are a number of ways to do that: Essentially, `standalone' mode detection is controlled by a style called `tt(quilt-standalone)'. It is a string style and its value can have different effects. The simplest values are: `tt(always)' to run detection every time -var(vcs_info) is run, and `tt(never)' to turn the detection off entirely. +tt(vcs_info) is run, and `tt(never)' to turn the detection off entirely. If the value of tt(quilt-standalone) is something else, it is interpreted differently. If the value is the name of a scalar variable the value of that @@ -1111,10 +1116,10 @@ findex(vcs_info) item(tt(vcs_info) [var(user-context)])( The main function, that runs all backends and assembles all data into -var(${vcs_info_msg_*_}). This is the function you want to call from +tt(${vcs_info_msg_*_}). This is the function you want to call from tt(precmd) if you want to include up-to-date information in your prompt (see tt(Variable description) below). If an argument is given, that string will be -used instead of tt(default) in the tt(user-context) field of the style +used instead of tt(default) in the var(user-context) field of the style context. ) findex(vcs_info_hookadd) @@ -1122,7 +1127,7 @@ Statically registers a number of functions to a given hook. The hook needs to be given as the first argument; what follows is a list of hook-function names to register to the hook. The `tt(+vi-)' prefix needs to be left out -here. See tt(Hooks in vcs_info) below for details. +here. See bf(Hooks in vcs_info) below for details. ) findex(vcs_info_hookdel) item(tt(vcs_info_hookdel))( @@ -1132,24 +1137,24 @@ argument, tt(all) occurances of the functions are unregistered. Otherwise only the last occurance is removed (if a function was registered to a hook more than once) . The `tt(+vi-)' prefix needs to be left out here. See -tt(Hooks in vcs_info) below for details. +bf(Hooks in vcs_info) below for details. ) findex(vcs_info_lastmsg) item(tt(vcs_info_lastmsg))( -Outputs the last var(${vcs_info_msg_*_}) value. +Outputs the last tt(${vcs_info_msg_*_}) value. Takes into account the value of the tt(use-prompt-escapes) style in -var(':vcs_info:formats:command:-all-'). It also only prints tt(max-exports) +tt(':vcs_info:formats:command:-all-'). It also only prints tt(max-exports) values. ) findex(vcs_info_printsys) item(tt(vcs_info_printsys) [var(user-context)])( Prints a list of all supported version control systems. Useful to find out possible contexts -(and which of them are enabled) or values for the var(disable) style. +(and which of them are enabled) or values for the tt(disable) style. ) findex(vcs_info_setsys) item(tt(vcs_info_setsys))( -Initializes var(vcs_info)'s internal list of +Initializes tt(vcs_info)'s internal list of available backends. With this function, you can add support for new VCSs without restarting the shell. ) @@ -1160,15 +1165,15 @@ subsect(Variable Description) startitem() -item(tt(${vcs_info_msg_N_}) (Note the trailing underscore)) +item(tt(${vcs_info_msg_)var(N)tt(_}) (Note the trailing underscore)) ( -Where var(N) is an integer, e.g., var(vcs_info_msg_0_). These variables -are the storage for the informational message the last var(vcs_info) call +Where var(N) is an integer, e.g., tt(vcs_info_msg_0_). These variables +are the storage for the informational message the last tt(vcs_info) call has assembled. These are strongly connected to the tt(formats), tt(actionformats) and tt(nvcsformats) styles described above. Those styles are lists. The first member of that list gets expanded into -var(${vcs_info_msg_0_}), the second into var(${vcs_info_msg_1_}) -and the Nth into var(${vcs_info_msg_N-1_}). These parameters are +tt(${vcs_info_msg_0_}), the second into tt(${vcs_info_msg_1_}) +and the Nth into tt(${vcs_info_msg_N-1_}). These parameters are exported into the environment. (See the tt(max-exports) style above.) ) enditem() @@ -1177,12 +1182,12 @@ subsect(Hooks in vcs_info) -Hooks are places in var(vcs_info) where you can run your own code. That +Hooks are places in tt(vcs_info) where you can run your own code. That code can communicate with the code that called it and through that, change the system's behaviour. For configuration, hooks change the style context: -example(:vcs_info:+::) +example(:vcs_info:var(vcs-string)PLUS()var(hook-name):var(user-context):var(repo-root-name)) To register functions to a hook, you need to list them in the tt(hooks) style in the appropriate context. @@ -1196,8 +1201,8 @@ `tt(+vi-bar)' and `tt(+vi-baz)'. If you would like to register a function to a hook regardless of the -current context, you may use the var(vcs_info_hookadd) function. To remove -a function that was added like that, the var(vcs_info_hookdel) function +current context, you may use the tt(vcs_info_hookadd) function. To remove +a function that was added like that, the tt(vcs_info_hookdel) function can be used. If something seems weird, you can enable the `debug' boolean style in @@ -1208,7 +1213,7 @@ executed one after another until one function returns non-zero or until all functions have been called. Context-sensitive hook functions are executed tt(before) statically registered ones (the ones added by -var(vcs_info_hookadd)). +tt(vcs_info_hookadd)). You may pass data between functions via an associative array, tt(user_data). For example: @@ -1247,10 +1252,10 @@ startitem() item(tt(start-up))( -Called after starting var(vcs_info) but before the VCS in this directory is -determined. It can be used to deactivate var(vcs_info) temporarily if -necessary. When tt(ret) is set to var(1), var(vcs_info) aborts and does -nothing; when set to var(2), var(vcs_info) sets up everything as if no +Called after starting tt(vcs_info) but before the VCS in this directory is +determined. It can be used to deactivate tt(vcs_info) temporarily if +necessary. When tt(ret) is set to tt(1), tt(vcs_info) aborts and does +nothing; when set to tt(2), tt(vcs_info) sets up everything as if no version control were active and exits. ) item(tt(pre-get-data))( @@ -1261,40 +1266,40 @@ tt(get-revision) and tt(get-bookmarks) styles must be true. This hook gets the names of the Mercurial bookmarks that -var(vcs_info) collected from `hg'. +tt(vcs_info) collected from `hg'. When setting tt(ret) to non-zero, the string in -tt(${hook_com[hg-bookmark-string]}) will be used in the var(%m) escape in +tt(${hook_com[hg-bookmark-string]}) will be used in the tt(%m) escape in tt(formats) and tt(actionformats) and will be availabe in the global -var(backend_misc) array as tt(${backend_misc[bookmarks]}). +tt(backend_misc) array as tt(${backend_misc[bookmarks]}). ) item(tt(gen-applied-string))( Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backends -and in tt(quilt) support when the var(applied-string) is generated; the +and in tt(quilt) support when the tt(applied-string) is generated; the tt(use-quilt) zstyle must be true for tt(quilt) (the tt(mq) and tt(stgit) backends are active by default). -This hook gets the names of all applied patches which var(vcs_info) collected +This hook gets the names of all applied patches which tt(vcs_info) collected so far in the opposite order, which means that the first argument is the top-most patch and so forth. When setting tt(ret) to non-zero, the string in -tt(${hook_com[applied-string]}) will be used in the var(%m) escape in +tt(${hook_com[applied-string]}) will be used in the tt(%m) escape in tt(formats) and tt(actionformats); it will be available in the global -var(backend_misc) array as tt($backend_misc[patches]}); and it will be -available as var(%p) in the tt(patch-format) and tt(nopatch-format) styles. +tt(backend_misc) array as tt($backend_misc[patches]}); and it will be +available as tt(%p) in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(gen-unapplied-string))( Called in the tt(git) (with tt(stgit)), and tt(hg) (with tt(mq)) backend -and in tt(quilt) support when the var(unapplied-string) is generated; the +and in tt(quilt) support when the tt(unapplied-string) is generated; the tt(get-unapplied) style must be true. -This hook gets the names of all unapplied patches which var(vcs_info) +This hook gets the names of all unapplied patches which tt(vcs_info) collected so far in the opposite order, which mean that the first argument is the patch next-in-line to be applied and so forth. When setting tt(ret) to non-zero, the string in -tt(${hook_com[unapplied-string]}) will be available as var(%u) in the +tt(${hook_com[unapplied-string]}) will be available as tt(%u) in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(gen-mqguards-string))( @@ -1304,7 +1309,7 @@ This hook gets the names of any active tt(mq) guards. When setting tt(ret) to non-zero, the string in -tt(${hook_com[guards-string]}) will be used in the var(%g) escape in the +tt(${hook_com[guards-string]}) will be used in the tt(%g) escape in the tt(patch-format) and tt(nopatch-format) styles. ) item(tt(no-vcs))( @@ -1326,24 +1331,24 @@ hook is the format that is configured at this point. The `tt(hook_com)' keys considered are `tt(branch)' and `tt(revision)'. -They are set to the values figured out so far by var(vcs_info) and any +They are set to the values figured out so far by tt(vcs_info) and any change will be used directly when the actual replacement is done. -If tt(ret) is set to to non-zero, the string in +If tt(ret) is set to non-zero, the string in tt(${hook_com[branch-replace]}) will be used unchanged as the -`tt(%b)' replacement in the variables set by var(vcs_info). +`tt(%b)' replacement in the variables set by tt(vcs_info). ) item(tt(set-hgrev-format))( Called before a `tt(hgrevformat)' is set. The only argument to the hook is the format that is configured at this point. The `tt(hook_com)' keys considered are `tt(hash)' and `tt(localrev)'. -They are set to the values figured out so far by var(vcs_info) and any +They are set to the values figured out so far by tt(vcs_info) and any change will be used directly when the actual replacement is done. -If tt(ret) is set to to non-zero, the string in +If tt(ret) is set to non-zero, the string in tt(${hook_com[rev-replace]}) will be used unchanged as the -`tt(%i)' replacement in the variables set by var(vcs_info). +`tt(%i)' replacement in the variables set by tt(vcs_info). ) item(tt(set-message))( Called each time before a `tt(vcs_info_msg_N_)' message is set. @@ -1356,7 +1361,7 @@ `tt(staged)', `tt(unstaged)', `tt(revision)', `tt(misc)', `tt(vcs)' and one `tt(miscN)' entry for each backend-specific data field (tt(N) starting at zero). They are set to the values figured out so far by -var(vcs_info) and any change will be used directly when the actual +tt(vcs_info) and any change will be used directly when the actual replacement is done. Since this hook is triggered multiple times (once for each configured @@ -1366,9 +1371,9 @@ original value in the next run. Changing the `tt(_orig)' values is probably not a good idea. -If tt(ret) is set to to non-zero, the string in +If tt(ret) is set to non-zero, the string in tt(${hook_com[message]}) will be used unchanged as the message by -var(vcs_info). +tt(vcs_info). ) enditem() @@ -1378,7 +1383,7 @@ subsect(Examples) -Don't use var(vcs_info) at all (even though it's in your prompt): +Don't use tt(vcs_info) at all (even though it's in your prompt): example(zstyle ':vcs_info:*' enable NONE) Disable the backends for tt(bzr) and tt(svk): @@ -1411,7 +1416,7 @@ example(zstyle ':vcs_info:(svn|bzr):*' branchformat '%b%{'${fg[yellow]}'%}:%r') If you want colors, make sure you enclose the color codes in tt(%{...%}) -if you want to use the string provided by var(vcs_info) in prompts. +if you want to use the string provided by tt(vcs_info) in prompts. Here is how to print the VCS information as a command (not in a prompt): example(alias vcsi='vcs_info command; vcs_info_lastmsg') @@ -1421,9 +1426,9 @@ Now as promised, some code that uses hooks: say, you'd like to replace the string `svn' by `subversion' in -var(vcs_info)'s tt(%s) tt(formats) replacement. +tt(vcs_info)'s tt(%s) tt(formats) replacement. -First, we will tell var(vcs_info) to call a function when populating +First, we will tell tt(vcs_info) to call a function when populating the message variables with the gathered information: example(zstyle ':vcs_info:*+set-message:*' hooks svn2subversion) @@ -1499,7 +1504,7 @@ the examples file located at Misc/vcs_info-examples in the Zsh source directory. -This concludes our guided tour through zsh's var(vcs_info). +This concludes our guided tour through zsh's tt(vcs_info). texinode(Prompt Themes)(ZLE Functions)(Version Control Information)(User Contributions) @@ -1984,7 +1989,7 @@ characters using their hexadecimal character number. The set of accented characters is reasonably complete up to Unicode -character U+0180, the set of special characters less so. However, it it +character U+0180, the set of special characters less so. However, it is very sporadic from that point. Adding new characters is easy, however; see the function tt(define-composed-chars). Please send any additions to tt(zsh-workers@zsh.org). @@ -2351,7 +2356,7 @@ function from a widget or as a widget of its own, and interactively reads input from the keyboard. However, the input being typed is concealed and a string of asterisks (`tt(*)') is shown instead. The value is saved in -the paramter tt($INVISIBLE) to which a reference is inserted into the +the parameter tt($INVISIBLE) to which a reference is inserted into the editing buffer at the restored cursor position. If the read was aborted by a keyboard break (typically tt(^G)) or another escape from editing such as tt(push-line), tt($INVISIBLE) is set to empty and the original buffer @@ -3039,7 +3044,7 @@ ) item(tt(tty-browsers))( An array similar to tt(x-browsers), except that it gives browsers to -use use when no X Window display is available. The default is +use when no X Window display is available. The default is tt(elinks links lynx). ) item(tt(command))( diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/expn.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/expn.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/expn.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/expn.yo 2011-10-02 01:10:11.000000000 +0000 @@ -236,7 +236,10 @@ current directory. ) item(tt(e))( -Remove all but the extension. +Remove all but the part of the filename extension following the `tt(.)'; +see the definition of the filename extension in the description of the +tt(r) modifier below. Note that according to that definition the result +will be empty if the string ends with a `tt(.)'. ) item(tt(h))( Remove a trailing pathname component, leaving the head. This works @@ -259,8 +262,12 @@ Remove one level of quotes from the substituted words. ) item(tt(r))( -Remove a filename extension of the form `tt(.)var(xxx)', leaving -the root name. +Remove a filename extension leaving the root name. Strings with no +filename extension are not altered. A filename +extension is a `tt(.)' followed by any number of characters (including +zero) that are neither `tt(.)' nor `tt(/)' and that continue to the end +of the string. For example, the extension of +`tt(foo.orig.c)' is `tt(.c)', and `tt(dir.c/foo)' has no extension. ) item(tt(s/)var(l)tt(/)var(r)[tt(/)])( Substitute var(r) for var(l) as described below. @@ -464,6 +471,18 @@ The extra processes here are spawned from the parent shell which will wait for their completion. +Another problem arises any time a job with a substitution that requires +a temporary file is disowned by the shell, including the case where +`tt(&!)' or `tt(&|)' appears at the end of a command containing a +subsitution. In that case the temporary file will not be cleaned up as +the shell no longer has any memory of the job. A workaround is to use +a subshell, for example, + +example(LPAR()mycmd =(myoutput)RPAR() &!) + +as the forked subshell will wait for the command to finish then remove +the temporary file. + texinode(Parameter Expansion)(Command Substitution)(Process Substitution)(Expansion) sect(Parameter Expansion) cindex(parameter expansion) @@ -588,7 +607,7 @@ xitem(tt(${)var(name)tt(:)var(offset)tt(})) item(tt(${)var(name)tt(:)var(offset)tt(:)var(length)tt(}))( This syntax gives effects similar to parameter subscripting -in the form tt($)var(name)tt({)var(start)tt(,)var(end)tt(}), but is +in the form tt($)var(name)tt([)var(start)tt(,)var(end)tt(]), but is compatible with other shells; note that both var(offset) and var(length) are interpreted differently from the components of a subscript. @@ -608,8 +627,12 @@ A negative offset counts backwards from the end of the scalar or array, so that -1 corresponds to the last character or element, and so on. -var(length) is always treated directly as a length and hence may not be -negative. The option tt(MULTIBYTE) is obeyed, i.e. the offset and length +When positive, var(length) counts from the var(offset) position +toward the end of the scalar or array. When negative, var(length) +counts back from the end. If this results in a position smaller +than var(offset), a diagnostic is printed and nothing is substituted. + +The option tt(MULTIBYTE) is obeyed, i.e. the offset and length count multibyte characters where appropriate. var(offset) and var(length) undergo the same set of shell substitutions @@ -635,7 +658,7 @@ may be inserted before the tt(-). Furthermore, neither var(offset) nor var(length) may begin with an alphabetic character or tt(&) as these are used to indicate history-style modifiers. To substitute a value from a -variable, the recommended approach is to proceed it with a tt($) as this +variable, the recommended approach is to precede it with a tt($) as this signifies the intention (parameter substitution can easily be rendered unreadable); however, as arithmetic substitution is performed, the expression tt(${var: offs}) does work, retrieving the offset from @@ -809,7 +832,7 @@ In double quotes, array elements are put into separate words. E.g., `tt("${(@)foo}")' is equivalent to `tt("${foo[@]}")' and `tt("${(@)foo[1,2]}")' is the same as `tt("$foo[1]" "$foo[2]")'. -This is distinct from em(field splitting) by the the tt(f), tt(s) +This is distinct from em(field splitting) by the tt(f), tt(s) or tt(z) flags, which still applies within each array element. ) item(tt(A))( @@ -859,6 +882,14 @@ Join the words of arrays together using newline as a separator. This is a shorthand for `tt(pj:\n:)'. ) +item(tt(g:opts:))( +Process escape sequences like the echo builtin when no options are given +(tt(g::)). With the tt(o) option, octal escapes don't take a leading +zero. With the tt(c) option, sequences like `tt(^X)' are also processed. +With the tt(e) option, processes `tt(\M-t)' and similar sequences like the +print builtin. With both of the tt(o) and tt(e) options, behaves like the +print builtin except that in none of these modes is `tt(\c)' interpreted. +) item(tt(i))( Sort case-insensitively. May be combined with `tt(n)' or `tt(O)'. ) @@ -1104,7 +1135,9 @@ separator var(string). Note that a var(string) of two or more characters means that all of them must match in sequence; this differs from the treatment of two or more characters in the tt(IFS) parameter. -See also the tt(=) flag and the tt(SH_WORD_SPLIT) option. +See also the tt(=) flag and the tt(SH_WORD_SPLIT) option. An empty +string may also be given in which case every character will be a separate +element. For historical reasons, the usual behaviour that empty array elements are retained inside double quotes is disabled for arrays generated @@ -1288,8 +1321,9 @@ Any case modification from one of the flags tt((L)), tt((U)) or tt((C)) is applied. ) -item(tt(12.) em(Prompt evaluation))( -Any prompt-style formatting from the tt((%)) family of flags is applied. +item(tt(12.) em(Escape sequence replacement))( +First any replacements from the tt((g)) flag are performed, then any +prompt-style formatting from the tt((%)) family of flags is applied. ) item(tt(13.) em(Quote application))( Any quoting or unquoting using tt((q)) and tt((Q)) and related flags @@ -1977,15 +2011,16 @@ ) item(tt(c)var(N)tt(,)var(M))( The flag tt(LPAR()#c)var(N)tt(,)var(M)tt(RPAR()) can be used anywhere -that the tt(#) or tt(##) operators can be used; it cannot be combined -with other globbing flags and a bad pattern error occurs if it is -misplaced. It is equivalent to the form tt({)var(N)tt(,)var(M)tt(}) in -regular expressions. The previous character or group is required to -match between var(N) and var(M) times, inclusive. The form -tt(LPAR()#c)var(N)tt(RPAR()) requires exactly tt(N) matches; -tt(LPAR()#c,)var(M)tt(RPAR()) is equivalent to specifying var(N) as 0; -tt(LPAR()#c)var(N)tt(,RPAR()) specifies that there is no maximum limit -on the number of matches. +that the tt(#) or tt(##) operators can be used except in the expressions +`tt((*/)#)' and `tt((*/)##)' in filename generation, where `tt(/)' +has special meaning; it cannot be combined with other globbing flags and +a bad pattern error occurs if it is misplaced. It is equivalent to the +form tt({)var(N)tt(,)var(M)tt(}) in regular expressions. The previous +character or group is required to match between var(N) and var(M) times, +inclusive. The form tt(LPAR()#c)var(N)tt(RPAR()) requires exactly tt(N) +matches; tt(LPAR()#c,)var(M)tt(RPAR()) is equivalent to specifying var(N) +as 0; tt(LPAR()#c)var(N)tt(,RPAR()) specifies that there is no maximum +limit on the number of matches. ) item(tt(m))( Set references to the match data for the entire string matched; this is @@ -2345,8 +2380,8 @@ For example, suppose a directory contains a single file `tt(lonely)'. Then the expression `tt(*(e:'reply=(${REPLY}{1,2})':))' will cause the words -`tt(lonely1 lonely2)' to be inserted into the command line. Note the -quotation marks. +`tt(lonely1)' and `tt(lonely2)' to be inserted into the command line. Note +the quoting of var(string). The form tt(PLUS())var(cmd) has the same effect, but no delimiters appear around var(cmd). Instead, var(cmd) is taken as the longest sequence of diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/func.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/func.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/func.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/func.yo 2011-10-02 01:10:11.000000000 +0000 @@ -158,9 +158,20 @@ specially. Either form of function definition may be used: a `tt(())' with no preceding name, or a `tt(function)' with an immediately following open brace. The function is executed immediately at the point of definition and -is not stored for future use. The function name is set to `tt((anon))' and -the parameter list passed to the function is empty. Note that this means -the argument list of any enclosing script or function is hidden. +is not stored for future use. The function name is set to `tt((anon))'. + +Arguments to the function may be specified as words following the +closing brace defining the function, hence if there are none no +arguments (other than tt($0)) are set. This is a difference from the +way other functions are parsed: normal function definitions may be +followed by certain keywords such as `tt(else)' or `tt(fi)', which will +be treated as arguments to anonymous functions, so that a newline or +semicolon is needed to force keyword interpretation. + +Note also that the argument list of any enclosing script or function is +hidden (as would be the case for any other function called at this +point). + Redirections may be applied to the anonymous function in the same manner as to a current-shell structure enclosed in braces. The main use of anonymous functions is to provide a scope for local variables. This is particularly @@ -172,13 +183,13 @@ example(variable=outside function { local variable=inside - print "I am $variable" -} + print "I am $variable with arguments $*" +} this and that print "I am $variable") outputs the following: -example(I am inside +example(I am inside with arguments this and that I am outside) Note that function definitions with arguments that expand to nothing, diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_complist.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_complist.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_complist.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_complist.yo 2011-10-02 01:10:11.000000000 +0000 @@ -383,8 +383,8 @@ and tt(undo) and tt(backward-delete-char) go back to the previous set of matches ) -item(tt(history-incremental-search-forward), -tt(history-incremental-search-backward))( +xitem(tt(history-incremental-search-forward)) +item(tt(history-incremental-search-backward))( this starts incremental searches in the list of completions displayed; in this mode, tt(accept-line) only leaves incremental search, going back to the normal menu selection mode diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_datetime.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_datetime.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_datetime.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_datetime.yo 2011-10-02 01:10:11.000000000 +0000 @@ -30,12 +30,35 @@ ) enditem() -The tt(zsh/datetime) module makes available one parameter: +The tt(zsh/datetime) module makes available several parameters; +all are readonly: startitem() +vindex(EPOCHREALTIME) +item(tt(EPOCHREALTIME))( +A floating point value representing the number of seconds since +the epoch. The notional accuracy is to nanoseconds if the +tt(clock_gettime) call is available and to microseconds otherwise, +but in practice the range of double precision floating point and +shell scheduling latencies may be significant effects. +) vindex(EPOCHSECONDS) item(tt(EPOCHSECONDS))( An integer value representing the number of seconds since the epoch. ) +vindex(epochtime) +item(tt(epochtime))( +An array value containing the number of seconds since the epoch +in the first element and the remainder of the time since the epoch +in nanoseconds in the second element. To ensure the two elements +are consistent the array should be copied or otherwise referenced +as a single substitution before the values are used. The following +idiom may be used: + +example(for secs nsecs in $epochtime; do + ... +done) + +) enditem() diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/modules.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/modules.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/modules.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/modules.yo 2011-10-02 01:10:11.000000000 +0000 @@ -6,7 +6,11 @@ of the shell. Each of these modules may be linked in to the shell at build time, or can be dynamically linked while the shell is running -if the installation supports this feature. The modules that -are bundled with the zsh distribution are: +if the installation supports this feature. +Modules are linked at runtime with the tt(zmodload) command, +see ifzman(zmanref(zshbuiltins))\ +ifnzman(noderef(Shell Builtin Commands)). + +The modules that are bundled with the zsh distribution are: includefile(Zsh/modlist.yo) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_zutil.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_zutil.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/mod_zutil.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/mod_zutil.yo 2011-10-02 01:10:11.000000000 +0000 @@ -101,7 +101,8 @@ its value, and that is equal to one of `tt(true)', `tt(yes)', `tt(on)' or `tt(1)'. If any var(strings) are given the status is zero if and only if at least one of the var(strings) is equal to at least one of the strings -in the value. If the style is not defined, the status is tt(2). +in the value. If the style is defined but doesn't match, the return status +is tt(1). If the style is not defined, the status is tt(2). The tt(-T) option tests the values of the style like tt(-t), but it returns status zero (rather than tt(2)) if the style is not defined for any @@ -178,7 +179,7 @@ This implements some internals of the tt(_regex_arguments) function. ) findex(zparseopts) -item(tt(zparseopts) [ tt(-D) ] [ tt(-K) ] [ tt(-E) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] var(specs))( +item(tt(zparseopts) [ tt(-D) ] [ tt(-K) ] [ tt(-M) ] [ tt(-E) ] [ tt(-a) var(array) ] [ tt(-A) var(assoc) ] var(specs))( This builtin simplifies the parsing of options in positional parameters, i.e. the set of arguments given by tt($*). Each var(spec) describes one option and must be of the form `var(opt)[tt(=)var(array)]'. If an option @@ -255,6 +256,15 @@ of the var(specs) for them is used. This allows assignment of default values to them before calling tt(zparseopts). ) +item(tt(-M))( +This changes the assignment rules to implement a map among equivalent +option names. If any var(spec) uses the `tt(=)var(array)' form, the +string var(array) is interpreted as the name of another var(spec), +which is used to choose where to store the values. If no other var(spec) +is found, the values are stored as usual. This changes only the way the +values are stored, not the way tt($*) is parsed, so results may be +unpredicable if the `var(name)tt(+)' specifier is used inconsistently. +) item(tt(-E))( This changes the parsing rules to em(not) stop at the first string that isn't described by one of the var(spec)s. It can be used to test @@ -288,5 +298,15 @@ I.e., the option tt(-b) and its arguments are taken from the positional parameters and put into the array tt(bar). + +The tt(-M) option can be used like this: + +example(set -- -a -bx -c y -cz baz -cend +zparseopts -A bar -M a=foo b+: c:=b) + +to have the effect of + +example(foo=(-a) +bar=(-a '' -b xyz)) ) enditem() diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/options.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/options.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/options.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/options.yo 2011-10-02 01:10:11.000000000 +0000 @@ -2024,7 +2024,7 @@ pindex(NOLOGIN) item(tt(LOGIN) (tt(-l), ksh: tt(-l)))( This is a login shell. -If this option is not explicitly set, the shell is a login shell if +If this option is not explicitly set, the shell becomes a login shell if the first character of the tt(argv[0]) passed to the shell is a `tt(-)'. ) pindex(PRIVILEGED) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/params.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/params.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/params.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/params.yo 2011-10-02 01:10:11.000000000 +0000 @@ -907,7 +907,7 @@ ) vindex(DIRSTACKSIZE) item(tt(DIRSTACKSIZE))( -The maximum size of the directory stack. If the +The maximum size of the directory stack, by default there is no limit. If the stack gets larger than this, it will be truncated automatically. This is useful with the tt(AUTO_PUSHD) option. pindex(AUTO_PUSHD, use of) @@ -1158,8 +1158,8 @@ When the tt(PROMPT_CR) and tt(PROMPT_SP) options are set, the tt(PROMPT_EOL_MARK) parameter can be used to customize how the end of partial lines are shown. This parameter undergoes prompt expansion, with -the tt(PROMPT_PERCENT) option set. If not set or empty, the default -behavior is equivalent to the value `tt(%B%S%#%s%b)'. +the tt(PROMPT_PERCENT) option set. If not set, the default behavior is +equivalent to the value `tt(%B%S%#%s%b)'. ) vindex(PS1) item(tt(PS1) )( @@ -1226,7 +1226,7 @@ item(tt(RPS1) )( This prompt is displayed on the right-hand side of the screen when the primary prompt is being displayed on the left. -This does not work if the tt(SINGLELINEZLE) option is set. +This does not work if the tt(SINGLE_LINE_ZLE) option is set. It is expanded in the same way as tt(PS1). ) vindex(RPROMPT2) @@ -1235,7 +1235,7 @@ item(tt(RPS2) )( This prompt is displayed on the right-hand side of the screen when the secondary prompt is being displayed on the left. -This does not work if the tt(SINGLELINEZLE) option is set. +This does not work if the tt(SINGLE_LINE_ZLE) option is set. It is expanded in the same way as tt(PS2). ) vindex(SAVEHIST) @@ -1273,6 +1273,13 @@ definition database or terminal type in order for the new settings to take effect. ) +vindex(TERMINFO) +item(tt(TERMINFO) )( +A reference to a compiled description of the terminal, used by the +`terminfo' library when the system has it; see manref(terminfo)(5). +If set, this causes the shell to reinitialise the terminal, making +the workaround `tt(TERM=$TERM)' unnecessary. +) vindex(TIMEFMT) item(tt(TIMEFMT))( The format of process time reports with the tt(time) keyword. diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/redirect.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/redirect.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/redirect.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/redirect.yo 2011-10-02 01:10:11.000000000 +0000 @@ -149,13 +149,32 @@ with the terminal (assuming file descriptor 1 had been) and then file descriptor 1 would be associated with file var(fname). -If instead of a digit one of the operators above is preceded by -a valid identifier enclosed in braces, the shell will open a new -file descriptor that is guaranteed to be at least 10 and set the -parameter named by the identifier to the file descriptor opened. -No whitespace is allowed between the closing brace and the redirection -character. The option tt(IGNORE_BRACES) must not be set. -For example: +The `tt(|&)' command separator described in +ifzman(em(Simple Commands & Pipelines) in zmanref(zshmisc))\ +ifnzman(noderef(Simple Commands & Pipelines)) +is a shorthand for `tt(2>&1 |)'. + +The various forms of process substitution, `tt(LPAR())var(list)tt(RPAR())' for output, are often used together with +redirection. For example, if var(word) in an output redirection is of the +form `tt(>LPAR())var(list)tt(RPAR())' then the output is piped to the +command represented by var(list). See +ifzman(\ +em(Process Substitution) in zmanref(zshexpn))\ +ifnzman(\ +noderef(Process Substitution)). +sect(Opening file descriptors using parameters) +cindex(file descriptors, use with parameters) +cindex(parameters, for using file descriptors) + +When the shell is parsing arguments to a command, and the shell option +tt(IGNORE_BRACES) is not set, a different form of redirection is allowed: +instead of a digit before the operator there is a valid shell identifier +enclosed in braces. The shell will open a new file descriptor that +is guaranteed to be at least 10 and set the parameter named by the +identifier to the file descriptor opened. No whitespace is allowed +between the closing brace and the redirection character. For example: indent(... {myfd}>&1) @@ -181,8 +200,12 @@ Note that this mechanism merely allocates or closes a file descriptor; it does not perform any redirections from or to it. It is usually convenient -to allocate a file descriptor prior to use as an argument to tt(exec). The -following shows a typical sequence of allocation, use, and closing of a +to allocate a file descriptor prior to use as an argument to tt(exec). +The syntax does not in any case work when used around complex commands +such as parenthesised subshells or loops, where the opening brace is +interpreted as part of a command list to be executed in the current shell. + +The following shows a typical sequence of allocation, use, and closing of a file descriptor: example(integer myfd @@ -194,22 +217,6 @@ occurs at the point the redirection is opened. This is after the expansion of command arguments and after any redirections to the left on the command line have been processed. - -The `tt(|&)' command separator described in -ifzman(em(Simple Commands & Pipelines) in zmanref(zshmisc))\ -ifnzman(noderef(Simple Commands & Pipelines)) -is a shorthand for `tt(2>&1 |)'. - -The various forms of process substitution, `tt(LPAR())var(list)tt(RPAR())' for output, are often used together with -redirection. For example, if var(word) in an output redirection is of the -form `tt(>LPAR())var(list)tt(RPAR())' then the output is piped to the -command represented by var(list). See -ifzman(\ -em(Process Substitution) in zmanref(zshexpn))\ -ifnzman(\ -noderef(Process Substitution)). sect(Multios) cindex(multios) pindex(MULTIOS, use of) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/zle.yo zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/zle.yo --- zsh-beta-4.3.11-dev-1+20110504/Doc/Zsh/zle.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Doc/Zsh/zle.yo 2011-10-02 01:10:11.000000000 +0000 @@ -854,7 +854,7 @@ either tt(zle -N) or tt(zle -C). In the former case, this is the second argument to the tt(zle -N) command that defined the widget, or the first argument if there was no second argument. In the latter case -this is the the third argument to the tt(zle -C) command that defined the +this is the third argument to the tt(zle -C) command that defined the widget. Read-only. ) vindex(WIDGETSTYLE) @@ -1866,7 +1866,7 @@ tindex(accept-line-and-down-history) item(tt(accept-line-and-down-history) (^O) (unbound) (unbound))( Execute the current line, and push the next history -event on the the buffer stack. +event on the buffer stack. ) tindex(auto-suffix-remove) item(tt(auto-suffix-remove))( @@ -2150,7 +2150,7 @@ ) tindex(where-is) item(tt(where-is))( -Read the name of an editor command and and print the listing of key +Read the name of an editor command and print the listing of key sequences that invoke the specified command. A restricted set of editing functions is available in the mini-buffer. Keys are looked up in the special @@ -2351,6 +2351,11 @@ wide characters must be code values from the Universal Character Set, as defined by IS0 10646 (also known as Unicode). ) +item(Wrapped double-width characters)( +When a double-width character appears in the final column of a line, it +is instead shown on the next line. The empty space left in the original +position is highlighted as a special character. +) enditem() If tt(zle_highlight) is not set or no value applies to a particular diff -Nru zsh-beta-4.3.11-dev-1+20110504/Etc/ChangeLog-3.0 zsh-beta-4.3.12-dev-1+20110925/Etc/ChangeLog-3.0 --- zsh-beta-4.3.11-dev-1+20110504/Etc/ChangeLog-3.0 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Etc/ChangeLog-3.0 2011-10-02 01:10:11.000000000 +0000 @@ -2557,7 +2557,7 @@ noshortloops. If CSHJUNKIELOOPS is set accept repeat word list end. - * Doc/zshmisc.man: more precise definition the the syntax of + * Doc/zshmisc.man: more precise definition the syntax of complex commands * Src/parse.c: the repeat word sublist syntax does not work if diff -Nru zsh-beta-4.3.11-dev-1+20110504/Etc/CONTRIBUTORS zsh-beta-4.3.12-dev-1+20110925/Etc/CONTRIBUTORS --- zsh-beta-4.3.11-dev-1+20110504/Etc/CONTRIBUTORS 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Etc/CONTRIBUTORS 2011-10-02 01:10:11.000000000 +0000 @@ -43,9 +43,9 @@ Carlos Phillips, Daniel Qarras, Jean-Baptiste Quenot, David Riebenbauer, Haakon Riiser, Ingo Rohlfs, Felix Rosencrantz, Simon Ruderich, Stephen Rüger, William Scott, Kris Shannon, Jörg Sommer, Travis Spencer, Vincent -Steman, Mårten Svantesson, Evgenii Terechkov, Magnus Therning, Ingmar -Vanhassel, Markus Waldeck, Motoi Washida, Nikolai Weibull, Jesse -Weinstein. +Steman, Mårten Svantesson, Evgenii Terechkov, Magnus Therning, Bernhard +Tittelbach, Ingmar Vanhassel, Markus Waldeck, Motoi Washida, Nikolai +Weibull, Jesse Weinstein. Version 4.2 ----------- @@ -271,7 +271,7 @@ including further texinfo documentation updates and maintained the zsh web pages during their tenure at www.mal.com. -* Wayne Davison improved the the zle search functions +* Wayne Davison improved the zle search functions and made them 8-bit clean. Some other little bugfixes. * Bart Schaefer submitted several bugfixes, reported diff -Nru zsh-beta-4.3.11-dev-1+20110504/Etc/FAQ.yo zsh-beta-4.3.12-dev-1+20110925/Etc/FAQ.yo --- zsh-beta-4.3.11-dev-1+20110504/Etc/FAQ.yo 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Etc/FAQ.yo 2011-10-02 01:10:11.000000000 +0000 @@ -302,7 +302,7 @@ sect(What's the latest version?) Zsh 4.2.7 is the latest production version. The latest development - version is 4.3.11; this contains support for multibyte character strings + version is 4.3.12; this contains support for multibyte character strings (such as UTF-8 locales). All the main features for multibyte support are now in place and this is likely soon to become the stable series 4.4. diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Calendar/calendar_parse zsh-beta-4.3.12-dev-1+20110925/Functions/Calendar/calendar_parse --- zsh-beta-4.3.11-dev-1+20110504/Functions/Calendar/calendar_parse 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Calendar/calendar_parse 2011-10-02 01:10:11.000000000 +0000 @@ -1,7 +1,7 @@ # Parse the line passed down in the first argument as a calendar entry. # Sets the values parsed into the associative array reply, consisting of: # time The time as an integer (as per EPOCHSECONDS) of the (next) event. -# text1 The text from the the line not including the date/time, but +# text1 The text from the line not including the date/time, but # including any WARN or RPT text. This is useful for rescheduling # events, since the keywords need to be retained in this case. # warntime Any warning time (WARN keyword) as an integer, else an empty diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Chpwd/zsh_directory_name_cdr zsh-beta-4.3.12-dev-1+20110925/Functions/Chpwd/zsh_directory_name_cdr --- zsh-beta-4.3.11-dev-1+20110504/Functions/Chpwd/zsh_directory_name_cdr 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Chpwd/zsh_directory_name_cdr 2011-10-02 01:10:11.000000000 +0000 @@ -18,7 +18,7 @@ values=(${${(f)"$(cdr -l)"}/ ##/:}) keys=(${values%%:*}) _describe -t dir-index 'recent directory index' \ - values keys -V unsorted -S']' + values -V unsorted -S']' return fi fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Misc/sticky-note zsh-beta-4.3.12-dev-1+20110925/Functions/Misc/sticky-note --- zsh-beta-4.3.11-dev-1+20110504/Functions/Misc/sticky-note 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Misc/sticky-note 2011-10-02 01:10:11.000000000 +0000 @@ -19,7 +19,7 @@ # # Otherwise, invoke the line editor with the previous notes available # as an editor history. Two quick taps on the return/enter key finish -# the note, or you can use use ^X^W as usual (ZZ in vicmd mode). +# the note, or you can use ^X^W as usual (ZZ in vicmd mode). # The application is configured by three zstyles, all using the context # ":sticky-note". The first two styles are "notefile" and "maxnotes" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Misc/zargs zsh-beta-4.3.12-dev-1+20110925/Functions/Misc/zargs --- zsh-beta-4.3.11-dev-1+20110504/Functions/Misc/zargs 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Misc/zargs 2011-10-02 01:10:11.000000000 +0000 @@ -207,7 +207,7 @@ else call=($command) # Use "repeat" here so "continue" won't complain. - repeat 1 eval "$execute ; $analyze" + repeat 1; do eval "$execute ; $analyze"; done return $ret fi fi @@ -273,7 +273,7 @@ repeat $P do ((ARGC)) || break - for (( end=l; end && ${(c)#argv[1,end]} > s; end/=2 )) : + for (( end=l; end && ${(c)#argv[1,end]} > s; end/=2 )) { } (( end > n && ( end = n ) )) args=( $argv[1,end] ) shift $((end > ARGC ? ARGC : end)) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Prompts/prompt_bart_setup zsh-beta-4.3.12-dev-1+20110925/Functions/Prompts/prompt_bart_setup --- zsh-beta-4.3.11-dev-1+20110504/Functions/Prompts/prompt_bart_setup 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Prompts/prompt_bart_setup 2011-10-02 01:10:11.000000000 +0000 @@ -67,15 +67,39 @@ } integer PSCOL=1 +typeset PSCMD= + +prompt_bart_preexec () { + setopt localoptions noxtrace noshwordsplit noksharrays unset + local -a cmd; cmd=( ${(z)3} ) + if [[ $cmd[1] = fg ]] + then + shift cmd + cmd[1]=${cmd[1]:-%+} + fi + if [[ $#cmd -eq 1 && $cmd[1] = %* ]] + then + PSCMD=$jobtexts[$cmd[1]] + elif [[ -o autoresume && -n $jobtexts[%?$2] ]] + then + PSCMD=$jobtexts[%?$2] + else + # Use history text to avoid alias expansion + PSCMD=$history[$HISTCMD] + fi + return 0 +} prompt_bart_precmd () { setopt localoptions noxtrace noksharrays unset local zero='%([BSUbfksu]|[FB]{*})' escape colno lineno + : "${PSCMD:=$history[$[HISTCMD-1]]}" # Default to history text + # Using psvar here protects against unwanted promptsubst expansions. - psvar[7]="$history[$[HISTCMD-1]]" # Use history text, not just number - psvar[8]='' # No padding until we compute it + psvar[7]="$PSCMD" + psvar[8]='' # No padding until we compute it psvar[9]=() typeset -g PSCOL @@ -153,6 +177,7 @@ repeat 1 case "$1:l" in (off|disable) add-zsh-hook -D precmd "prompt_*_precmd" + add-zsh-hook -D preexec "prompt_*_preexec" functions[TRAPWINCH]="${functions[TRAPWINCH]//prompt_bart_winch}" [[ $prompt_theme[1] = bart ]] && PS1=${${(f)PS1}[-1]} return 1 @@ -182,6 +207,7 @@ # Paste our special commands into precmd and TRAPWINCH add-zsh-hook precmd prompt_bart_precmd + add-zsh-hook preexec prompt_bart_preexec functions[TRAPWINCH]="${functions[TRAPWINCH]//prompt_bart_winch} prompt_bart_winch" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/TCP/tcp_read zsh-beta-4.3.12-dev-1+20110925/Functions/TCP/tcp_read --- zsh-beta-4.3.11-dev-1+20110504/Functions/TCP/tcp_read 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/TCP/tcp_read 2011-10-02 01:10:11.000000000 +0000 @@ -1,7 +1,7 @@ # Helper function for reading input from a TCP connection. # Actually, the input doesn't need to be a TCP connection at all, it # is simply an input file descriptor. However, it must be contained -# in ${tcp_by_fd[$TCP_SESS]}. This is set set by tcp_open, but may be +# in ${tcp_by_fd[$TCP_SESS]}. This is set by tcp_open, but may be # set by hand. (Note, however, the blocking/timeout behaviour is usually # not implemented for reading from regular files.) # diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr zsh-beta-4.3.12-dev-1+20110925/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr --- zsh-beta-4.3.11-dev-1+20110504/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/VCS_Info/Backends/VCS_INFO_get_data_bzr 2011-10-02 01:10:11.000000000 +0000 @@ -1,13 +1,52 @@ -## vim:ft=zsh +## vim:ft=zsh et ## bazaar support by: Frank Terbeck +## mostly rewritten by: Jan Pobrislo ## Distributed under the same BSD-ish license as zsh itself. setopt localoptions noksharrays extendedglob NO_shwordsplit -local bzrbase bzrbr +local bzrbase bzrbr bzr_changes bzr_type local -a bzrinfo -local -xA hook_com +local -xA hook_com bzr_info + +VCS_INFO_bzr_get_info() { + bzrinfo=( ${(s.:.)$( ${vcs_comm[cmd]} version-info --custom \ + --template="{revno}:{branch_nick}:{clean}")} ) + if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" + then + VCS_INFO_bzr_get_changes + elif [[ ${bzrinfo[2]} == 1 ]] + then + bzr_changes = '1' + fi +} + +VCS_INFO_bzr_get_info_restricted() { + # we are forbidden from fetching info on bound branch from remote repository + bzrinfo=( $(${vcs_comm[cmd]} revno) ${bzrbase:t} ) + if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "check-for-changes" && \ + [[ ! $bzr_type == lightweigth ]] + then + VCS_INFO_bzr_get_changes + fi +} + +VCS_INFO_bzr_get_changes() { + local -A counts + local line flag + bzr_changes=$( + ${vcs_comm[cmd]} stat -SV | while read flag line + do + counts[${flag}]=$(( ${counts[${flag}]:-0} + 1 )) + done + for flag in ${(k)counts} + do + printf "%s:%d " $flag ${counts[${flag}]} + done + ) +} if zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "use-simple" ; then + # simple parsing will fail to fetch information from lightweigth checkouts bzrbase=${vcs_comm[basedir]} bzrinfo[2]=${bzrbase:t} if [[ -f ${bzrbase}/.bzr/branch/last-revision ]] ; then @@ -15,9 +54,46 @@ bzrinfo[1]=${${bzrinfo[1]}%% *} fi else - bzrbase=${${(M)${(f)"$( ${vcs_comm[cmd]} info )"}:# ##branch\ root:*}/*: ##/} - bzrinfo=( ${${${(M)${(f)"$( ${vcs_comm[cmd]} version-info )"}:#(#s)(revno|branch-nick)*}/*: /}/*\//} ) + # Parse the output of 'bzr info' into associative array bzr_info + ${vcs_comm[cmd]} info | { + local line key value dirtype + read dirtype + grep '^[ a-zA-Z0-9]\+: ' | while read line + do + value=${line#*': '} + key=${${line%%: *}// /_} + bzr_info[$key]=$value + done + } + + case "$dirtype" in + ('Checkout'*) + bzr_type=checkout + bzrbase=${bzr_info[checkout_root]} ;; + ('Repository checkout'*) + bzr_type=checkout + bzrbase=${bzr_info[repository_checkout_root]} ;; + ('Lightweight checkout'*) + bzr_type=lightweigth + bzrbase=${bzr_info[light_checkout_root]} ;; + (*) + bzr_type=standalone + bzrbase=${bzr_info[branch_root]} ;; + esac + bzrbase="$(VCS_INFO_realpath ${bzrbase})" + + if [ -n "${bzr_info[checkout_of_branch]}" ] && \ + zstyle -t ":vcs_info:${vcs}:${usercontext}:${rrn}" "use-server" + then + VCS_INFO_bzr_get_info + else + case ${bzr_info[checkout_of_branch]} in + (file://*) VCS_INFO_bzr_get_info ;; + (*://*) VCS_INFO_bzr_get_info_restricted ;; + (*) VCS_INFO_bzr_get_info ;; + esac + fi fi rrn=${bzrbase:t} @@ -29,5 +105,6 @@ bzrbr=${hook_com[branch-replace]} fi hook_com=() -VCS_INFO_formats '' "${bzrbr}" "${bzrbase}" '' '' "${bzrinfo[1]}" '' + +VCS_INFO_formats '' "${bzrbr}" "${bzrbase}" '' "${bzr_changes}" "${bzrinfo[1]}" "${bzr_changes}" return 0 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/VCS_Info/vcs_info zsh-beta-4.3.12-dev-1+20110925/Functions/VCS_Info/vcs_info --- zsh-beta-4.3.11-dev-1+20110504/Functions/VCS_Info/vcs_info 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/VCS_Info/vcs_info 2011-10-02 01:10:11.000000000 +0000 @@ -70,6 +70,9 @@ if (( retval == 1 )); then return 0 elif (( retval == 2 )); then + # This needs `max-exports' set. We're still setting it again later + # for more specific contexts. + VCS_INFO_maxexports VCS_INFO_set --nvcs return 0 fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Zftp/zfcput zsh-beta-4.3.12-dev-1+20110925/Functions/Zftp/zfcput --- zsh-beta-4.3.11-dev-1+20110504/Functions/Zftp/zfcput 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Zftp/zfcput 2011-10-02 01:10:11.000000000 +0000 @@ -23,7 +23,7 @@ elif [[ $(echo abcd | tail --bytes=+2) = bcd ]]; then tailtype=b else - print "I can't get your \`tail' to start from from arbitrary characters.\n" \ + print "I can't get your \`tail' to start from arbitrary characters.\n" \ "If you know how to do this, let me know." 2>&1 return 1 fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/define-composed-chars zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/define-composed-chars --- zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/define-composed-chars 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/define-composed-chars 2011-10-02 01:10:11.000000000 +0000 @@ -135,6 +135,26 @@ z[$a]="\ i 133 \ " +# ligature with f +a=f +z[$a]="\ +f FB00 \ +" +# ligature with i +a=i +z[$a]="\ +f FB01 \ +" +# ligature with l +a=l +z[$a]="\ +f FB02 \ +" +# ligature with t +a=t +z[$a]="\ +f FB05 s FB06 \ +" # eszett a=s z[$a]="\ @@ -252,6 +272,19 @@ a=h z[$a]+=" S 5e9" +# Superscripts +a=S +z[$a]+=" \ +0 2070 1 B9 2 B2 3 B3 4 2074 5 2075 6 2076 7 2077 8 2078 9 2079 \ ++ 207a - 207b = 207C ( 207D ) 207E n 207f \ +" +# Subscripts +a=s +z[$a]+=" \ +0 2080 1 2081 2 2082 3 2083 4 2084 5 2085 6 2086 7 2087 8 2088 9 2089 \ ++ 208a - 208b = 208C ( 208D ) 208E \ +" + typeset -i 16 -Z 4 ia typeset -i 16 -Z 6 iuni # Extended width characters ^A, ^B, ... (not RFC1345) @@ -327,10 +360,14 @@ z[m]+=" ' AF" # degree z[G]+=" D B0" +# degree centigrade +z[C]+=" o 2103" +# degree fahrenheit +z[F]+=" o 2109" +# numero +z[0]+=" N 2116" # +/- z[-]+=" + B1" -# superscripts -z[S]+=" 2 B2 3 B3" # lonely acute a=\' z[$a]+=" ' B4" @@ -342,8 +379,6 @@ z[M]+=" . B7" # Lonely cedilla z[,]+=" ' B8" -# Superscript one -z[S]+=" 1 B9" # spanish masculine ordinal z[o]+=" - BA" # right guillemet @@ -415,5 +450,20 @@ # Female and male z[m]+=" F 2640" z[l]+=" M 2642" +# Commercial AT +z[t]+=" A 40" +# Prime, double prime, triple prime +a=\' +z[$a]+=" 1 2032 2 2033 3 2034" +# Arrows +z[-]+=" < 2190" +a=\! +z[$a]+=" - 2191" +a=\> +z[$a]+=" - 2192 < 2194 = 21D2" +z[v]+=" - 2193" +z[D]+=" U 2195" +a=\= +z[$a]+=" < 21D0 = 21D4" zsh_accented_chars=("${(kv)z[@]}") diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/.distfiles zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/.distfiles --- zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/.distfiles 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/.distfiles 2011-10-02 01:10:11.000000000 +0000 @@ -25,6 +25,7 @@ match-word-context match-words-by-style modify-current-argument +move-line-in-buffer narrow-to-region narrow-to-region-invisible predict-on diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/match-words-by-style zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/match-words-by-style --- zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/match-words-by-style 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/match-words-by-style 2011-10-02 01:10:11.000000000 +0000 @@ -220,8 +220,7 @@ fi match=() -charskip= -repeat $skip charskip+=\? +charskip=${(l:skip::?:)} eval pat2='${RBUFFER##(#b)('${charskip}${spacepat}')('\ ${wordpat2}')('${spacepat}')}' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/move-line-in-buffer zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/move-line-in-buffer --- zsh-beta-4.3.11-dev-1+20110504/Functions/Zle/move-line-in-buffer 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Functions/Zle/move-line-in-buffer 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,16 @@ +#autoload + +# Line motions that do not leave the current history entry, +# for editing in multi-line buffers. + +# To use: +# autoload -Uz move-line-in-buffer +# zle -N up-line-in-buffer move-line-in-buffer +# zle -N down-line-in-buffer move-line-in-buffer +# +# then bindkey as you prefer + +local hno=$HISTNO curs=$CURSOR +zle .${WIDGET:s/in-buffer/or-history} "$@" && + (( HISTNO != hno && (HISTNO=hno, CURSOR=curs) )) +return 0 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Misc/vcs_info-examples zsh-beta-4.3.12-dev-1+20110925/Misc/vcs_info-examples --- zsh-beta-4.3.11-dev-1+20110504/Misc/vcs_info-examples 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Misc/vcs_info-examples 2011-10-02 01:10:11.000000000 +0000 @@ -155,6 +155,23 @@ ret=1 } +### Display the existence of files not yet known to VCS + +### git: Show marker (T) if there are untracked files in repository +# Make sure you have added staged to your 'formats': %c +zstyle ':vcs_info:git*+set-message:*' hooks git-untracked + ++vi-git-untracked(){ + if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' ]] && \ + git status --porcelain | grep '??' &> /dev/null ; then + # This will show the marker if there are any untracked files in repo. + # If instead you want to show the marker only if there are untracked + # files in $PWD, use: + #[[ -n $(git ls-files --others --exclude-standard) ]] ; then + hook_com[staged]+='T' + fi +} + ### Compare local changes to remote changes diff -Nru zsh-beta-4.3.11-dev-1+20110504/NEWS zsh-beta-4.3.12-dev-1+20110925/NEWS --- zsh-beta-4.3.11-dev-1+20110504/NEWS 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/NEWS 2011-10-02 01:10:11.000000000 +0000 @@ -19,6 +19,16 @@ In POSIX emulation ("emulate sh") the shell is more accurate about when it should or should not exit on errors. +The ${NAME:OFFSET:LENGTH} syntax now supports negative LENGTH, which +counts back from the end of the string. + +The (g:opts:) flag in parameter expansion processes escape sequences like +the echo and print builtins. opts can be any combination of o, e and c. +With e, acts like print rather than echo except for octal escapes which +are controlled separately by the o option. With c, interpret control +sequences like "^X" as bindkey does. Regardless of the opts, \c is not +interpreted. + Changes between versions 4.3.10 and 4.3.11 ------------------------------------------ diff -Nru zsh-beta-4.3.11-dev-1+20110504/README zsh-beta-4.3.12-dev-1+20110925/README --- zsh-beta-4.3.11-dev-1+20110504/README 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/README 2011-10-02 01:10:11.000000000 +0000 @@ -5,11 +5,11 @@ Version ------- -This is version 4.3.11 of the shell. This is a development release, +This is version 4.3.12 of the shell. This is a development release, but is believed to be reasonably stable. Sites where the users need to edit command lines with multibyte characters (in particular UTF-8) will probably want to upgrade. The previous widely released version -of the shell was 4.3.10. +of the shell was 4.3.11. Installing Zsh -------------- diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/builtin.c zsh-beta-4.3.12-dev-1+20110925/Src/builtin.c --- zsh-beta-4.3.11-dev-1+20110504/Src/builtin.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/builtin.c 2011-10-02 01:10:11.000000000 +0000 @@ -99,7 +99,7 @@ #endif BUILTIN("popd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 1, BIN_POPD, "q", NULL), - BUILTIN("print", BINF_PRINTOPTS, bin_print, 0, -1, BIN_PRINT, "abcC:Df:ilmnNoOpPrRsu:z-", NULL), + BUILTIN("print", BINF_PRINTOPTS, bin_print, 0, -1, BIN_PRINT, "abcC:Df:ilmnNoOpPrRsSu:z-", NULL), BUILTIN("printf", 0, bin_print, 1, -1, BIN_PRINTF, NULL, NULL), BUILTIN("pushd", BINF_SKIPINVALID | BINF_SKIPDASH | BINF_DASHDASHVALID, bin_cd, 0, 2, BIN_PUSHD, "qsPL", NULL), BUILTIN("pushln", 0, bin_print, 0, -1, BIN_PRINT, NULL, "-nz"), @@ -3903,7 +3903,7 @@ * nc: number of columns (at least one) */ sc = l + 2; - nc = (columns + 1) / sc; + nc = (zterm_columns + 1) / sc; if (!nc) nc = 1; nr = (n + nc - 1) / nc; @@ -3965,25 +3965,45 @@ return 0; } /* -s option -- add the arguments to the history list */ - if (OPT_ISSET(ops,'s')) { + if (OPT_ISSET(ops,'s') || OPT_ISSET(ops,'S')) { int nwords = 0, nlen, iwords; char **pargs = args; queue_signals(); - ent = prepnexthistent(); while (*pargs++) nwords++; - if ((ent->nwords = nwords)) { - ent->words = (short *)zalloc(nwords*2*sizeof(short)); - nlen = iwords = 0; - for (pargs = args; *pargs; pargs++) { - ent->words[iwords++] = nlen; - nlen += strlen(*pargs); - ent->words[iwords++] = nlen; - nlen++; + if (nwords) { + if (OPT_ISSET(ops,'S')) { + int wordsize; + short *words; + if (nwords > 1) { + zwarnnam(name, "option -S takes a single argument"); + return 1; + } + words = NULL; + wordsize = 0; + histsplitwords(*args, &words, &wordsize, &nwords, 1); + ent = prepnexthistent(); + ent->words = (short *)zalloc(nwords*sizeof(short)); + memcpy(ent->words, words, nwords*sizeof(short)); + free(words); + ent->nwords = nwords/2; + } else { + ent = prepnexthistent(); + ent->words = (short *)zalloc(nwords*2*sizeof(short)); + ent->nwords = nwords; + nlen = iwords = 0; + for (pargs = args; *pargs; pargs++) { + ent->words[iwords++] = nlen; + nlen += strlen(*pargs); + ent->words[iwords++] = nlen; + nlen++; + } } - } else + } else { + ent = prepnexthistent(); ent->words = (short *)NULL; + } ent->node.nam = zjoin(args, ' ', 0); ent->stim = ent->ftim = time(NULL); ent->node.flags = 0; @@ -5529,7 +5549,14 @@ *bptr = '\0'; #endif /* dispose of word appropriately */ - if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E')) { + if (OPT_ISSET(ops,'e') || + /* + * When we're doing an array assignment, we'll + * handle echoing at that point. In all other + * cases (including -A with no assignment) + * we'll do it here. + */ + (OPT_ISSET(ops,'E') && !OPT_ISSET(ops,'A'))) { zputs(buf, stdout); putchar('\n'); } @@ -5561,7 +5588,7 @@ : (char **)zalloc((al + 1) * sizeof(char *))); for (pp = p, n = firstnode(readll); n; incnode(n)) { - if (OPT_ISSET(ops,'e') || OPT_ISSET(ops,'E')) { + if (OPT_ISSET(ops,'E')) { zputs((char *) getdata(n), stdout); putchar('\n'); } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.awk zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.awk --- zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.awk 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.awk 2011-10-02 01:10:11.000000000 +0000 @@ -53,6 +53,7 @@ if (limnam == "MSGQUEUE") { msg[limnum] = "Nmsgqueue" } if (limnam == "NICE") { msg[limnum] = "Nnice" } if (limnam == "RTPRIO") { msg[limnum] = "Nrt_priority" } + if (limnam == "RTTIME") { msg[limnum] = "Urt_time" } } } } @@ -99,6 +100,7 @@ if(limtype == "M") { limtype = "MEMORY" } if(limtype == "N") { limtype = "NUMBER" } if(limtype == "T") { limtype = "TIME" } + if(limtype == "U") { limtype = "MICROSECONDS" } } printf("\tZLIMTYPE_%s,\n", limtype) } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.c zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.c 2011-10-02 01:10:11.000000000 +0000 @@ -36,6 +36,7 @@ ZLIMTYPE_MEMORY, ZLIMTYPE_NUMBER, ZLIMTYPE_TIME, + ZLIMTYPE_MICROSECONDS, ZLIMTYPE_UNKNOWN }; @@ -113,10 +114,37 @@ seconds. */ printf("%d:%02d:%02d\n", (int)(val / 3600), (int)(val / 60) % 60, (int)(val % 60)); + } else if (limtype[lim] == ZLIMTYPE_MICROSECONDS) { + /* microseconds */ +# ifdef RLIM_T_IS_QUAD_T + printf("%qdus\n", val); +# else +# ifdef RLIM_T_IS_LONG_LONG + printf("%lldus\n", val); +# else +# ifdef RLIM_T_IS_UNSIGNED + printf("%luus\n", val); +# else + printf("%ldus\n", val); +# endif /* RLIM_T_IS_UNSIGNED */ +# endif /* RLIM_T_IS_LONG_LONG */ +# endif /* RLIM_T_IS_QUAD_T */ } else if (limtype[lim] == ZLIMTYPE_NUMBER || limtype[lim] == ZLIMTYPE_UNKNOWN) { /* pure numeric resource */ - printf("%d\n", (int)val); +# ifdef RLIM_T_IS_QUAD_T + printf("%qd\n", val); +# else +# ifdef RLIM_T_IS_LONG_LONG + printf("%lld\n", val); +# else +# ifdef RLIM_T_IS_UNSIGNED + printf("%lu\n", val); +# else + printf("%ld\n", val); +# endif /* RLIM_T_IS_UNSIGNED */ +# endif /* RLIM_T_IS_LONG_LONG */ +# endif /* RLIM_T_IS_QUAD_T */ } else if (val >= 1024L * 1024L) /* memory resource -- display with `K' or `M' modifier */ # ifdef RLIM_T_IS_QUAD_T @@ -125,7 +153,7 @@ printf("%qdkB\n", val / 1024L); # else # ifdef RLIM_T_IS_LONG_LONG - printf("%lldMB\n", val / (1024L * 1024L)); + printf("%lldMB\n", val / (1024L * 1024L)); else printf("%lldkB\n", val / 1024L); # else @@ -539,7 +567,9 @@ return 1; } } - } else if (limtype[lim] == ZLIMTYPE_NUMBER || limtype[lim] == ZLIMTYPE_UNKNOWN) { + } else if (limtype[lim] == ZLIMTYPE_NUMBER || + limtype[lim] == ZLIMTYPE_UNKNOWN || + limtype[lim] == ZLIMTYPE_MICROSECONDS) { /* pure numeric resource -- only a straight decimal number is permitted. */ char *t = s; @@ -954,7 +984,6 @@ cleanup_(Module m) { return setfeatureenables(m, &module_features, NULL); - return 0; } /**/ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.mdd zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.mdd --- zsh-beta-4.3.11-dev-1+20110504/Src/Builtins/rlimits.mdd 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Builtins/rlimits.mdd 2011-10-02 01:10:11.000000000 +0000 @@ -14,7 +14,7 @@ rlimits.h: rlimits.awk @RLIMITS_INC_H@ $(AWK) -f $(sdir)/rlimits.awk @RLIMITS_INC_H@ /dev/null > rlimits.h @if grep ZLIMTYPE_UNKNOWN rlimits.h >/dev/null; then \ - echo >&2 WARNING: unknown limits: mail rlimits.h to developers; \ + echo >&2 WARNING: unknown limits: mail Src/Builtins/rlimits.h to developers; \ else :; fi clean-here: clean.rlimits diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/cond.c zsh-beta-4.3.12-dev-1+20110925/Src/cond.c --- zsh-beta-4.3.11-dev-1+20110504/Src/cond.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/cond.c 2011-10-02 01:10:11.000000000 +0000 @@ -403,7 +403,6 @@ zwarnnam(fromtest, "bad cond code"); return 2; } - return 1; } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/.distfiles zsh-beta-4.3.12-dev-1+20110925/Src/.distfiles --- zsh-beta-4.3.11-dev-1+20110504/Src/.distfiles 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/.distfiles 2011-10-02 01:10:11.000000000 +0000 @@ -1,13 +1,53 @@ DISTFILES_SRC=' - .cvsignore .distfiles .exrc .indent.pro - Makefile.in Makemod.in.in - signames1.awk signames2.awk - modentry.c - builtin.c compat.c cond.c exec.c glob.c hashtable.c hashtable.h - hist.c init.c input.c jobs.c lex.c linklist.c loop.c main.c makepro.awk - math.c mem.c mkbltnmlst.sh mkmakemod.sh - module.c options.c params.c parse.c pattern.c prompt.c prototypes.h - signals.c signals.h sort.c string.c subst.c system.h text.c utils.c - watch.c zsh.h zsh.mdd ztype.h - zsh.rc zsh.ico +.cvsignore +.distfiles +.exrc +.indent.pro +Makefile.in +Makemod.in.in +signames1.awk +signames2.awk +modentry.c +builtin.c +compat.c +cond.c +exec.c +glob.c +hashtable.c +hashtable.h +hashnameddir.c +hist.c +init.c +input.c +jobs.c +lex.c +linklist.c +loop.c +main.c +makepro.awk +math.c +mem.c +mkbltnmlst.sh +mkmakemod.sh +module.c +options.c +params.c +parse.c +pattern.c +prompt.c +prototypes.h +signals.c +signals.h +sort.c +string.c +subst.c +text.c +utils.c +watch.c +zsh.h +zsh.mdd +zsh_system.h +ztype.h +zsh.rc +zsh.ico ' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/exec.c zsh-beta-4.3.12-dev-1+20110925/Src/exec.c --- zsh-beta-4.3.11-dev-1+20110504/Src/exec.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/exec.c 2011-10-02 01:10:11.000000000 +0000 @@ -50,20 +50,20 @@ * noerrs = 1: suppress error messages * noerrs = 2: don't set errflag on parse error, either */ - + /**/ mod_export int noerrs; - + /* do not save history on exec and exit */ /**/ int nohistsave; - + /* error/break flag */ - + /**/ mod_export int errflag; - + /* * State of trap return value. Value is from enum trap_state. */ @@ -88,23 +88,23 @@ * - non-negative in a trap once it was triggered. It should remain * non-negative until restored after execution of the trap. */ - + /**/ int trap_return; - + /* != 0 if this is a subshell */ - + /**/ int subsh; - + /* != 0 if we have a return pending */ - + /**/ mod_export int retflag; /**/ long lastval2; - + /* The table of file descriptors. A table element is zero if the * * corresponding fd is not used by the shell. It is greater than * * 1 if the fd is used by a <(...) or >(...) substitution and 1 if * @@ -148,12 +148,12 @@ mod_export int zleactive; /* pid of process undergoing 'process substitution' */ - + /**/ pid_t cmdoutpid; - + /* exit status of process undergoing 'process substitution' */ - + /**/ int cmdoutval; @@ -166,7 +166,7 @@ /**/ int use_cmdoutval; -/* The context in which a shell function is called, see SFC_* in zsh.h. */ +/* The context in which a shell function is called, see SFC_* in zsh.h. */ /**/ mod_export int sfcontext; @@ -239,7 +239,7 @@ /**/ mod_export struct rlimit current_limits[RLIM_NLIMITS], limits[RLIM_NLIMITS]; - + /**/ mod_export int zsetlimit(int limnum, char *nam) @@ -340,7 +340,7 @@ * * (when waiting for the grep, ignoring execpline2 for now). At this time, * zsh has built two job-table entries for it: one for the cat and one for - * the grep. If the user hits ^Z at this point (and jobbing is used), the + * the grep. If the user hits ^Z at this point (and jobbing is used), the * shell is notified that the grep was suspended. The list_pipe flag is * used to tell the execpline where it was waiting that it was in a pipeline * with a shell construct at the end (which may also be a shell function or @@ -351,7 +351,7 @@ * shell (its pid and the text for it) in the job entry of the cat. The pid * is passed down in the list_pipe_pid variable. * But there is a problem: the suspended grep is a child of the parent shell - * and can't be adopted by the sub-shell. So the parent shell also has to + * and can't be adopted by the sub-shell. So the parent shell also has to * keep the information about this process (more precisely: this pipeline) * by keeping the job table entry it created for it. The fact that there * are two jobs which have to be treated together is remembered by setting @@ -405,7 +405,7 @@ state->pc++; if (!list_pipe && thisjob != list_pipe_job && !hasprocs(thisjob)) - deletejob(jobtab + thisjob); + deletejob(jobtab + thisjob, 0); cmdpush(CS_CURSH); execlist(state, 1, do_exec); cmdpop(); @@ -528,10 +528,10 @@ { /* * Maybe the directory was unreadable, or maybe it wasn't - * even a directory. + * even a directory. */ return ((e != EACCES || !access(dir, X_OK)) && - e != ENOENT && e != ENOTDIR); + e != ENOENT && e != ENOTDIR); } /* @@ -639,7 +639,7 @@ break; } - /* for command -p, search the default path */ + /* for command -p, search the default path */ if (defpath) { char *s, pbuf[PATH_MAX]; char *dptr, *pe, *ps = DEFAULT_PATH; @@ -676,7 +676,7 @@ eno = ee; } else { - + if ((cn = (Cmdnam) cmdnamtab->getnode(cmdnamtab, arg0))) { char nn[PATH_MAX], *dptr; @@ -1312,9 +1312,9 @@ donetrap = 1; } if (lastval) { - int errreturn = isset(ERRRETURN) && + int errreturn = isset(ERRRETURN) && (isset(INTERACTIVE) || locallevel || sourcelevel); - int errexit = isset(ERREXIT) || + int errexit = isset(ERREXIT) || (isset(ERRRETURN) && !errreturn); if (errexit) { if (sigtrapped[SIGEXIT]) @@ -1434,7 +1434,7 @@ zclose(opipe[0]); } if (how & Z_DISOWN) { - deletejob(jobtab + thisjob); + deletejob(jobtab + thisjob, 1); thisjob = -1; } else @@ -1484,7 +1484,7 @@ printjob(jn, !!isset(LONGLISTJOBS), 1); } else if (newjob != list_pipe_job) - deletejob(jn); + deletejob(jn, 0); else lastwj = -1; } @@ -1536,7 +1536,7 @@ else if (pid) { char dummy; - lpforked = + lpforked = (killpg(jobtab[list_pipe_job].gleader, 0) == -1 ? 2 : 1); list_pipe_pid = pid; list_pipe_start = bgtime; @@ -1588,7 +1588,7 @@ if (list_pipe && (lastval & 0200) && pj >= 0 && (!(jn->stat & STAT_INUSE) || (jn->stat & STAT_DONE))) { - deletejob(jn); + deletejob(jn, 0); jn = jobtab + pj; if (jn->gleader) killjb(jn, lastval & ~0200); @@ -1596,7 +1596,7 @@ if (list_pipe_child || ((jn->stat & STAT_DONE) && (list_pipe || (pline_level && !(jn->stat & STAT_SUBJOB))))) - deletejob(jn); + deletejob(jn, 0); thisjob = pj; } @@ -2757,7 +2757,7 @@ * A `fake exec' is possible if we have all the following conditions: * * 1) last1 flag is 1. This indicates that the current shell will not * * be needed after the current command. This is typically the case * - * when when the command is the last stage in a subshell, or is the * + * when the command is the last stage in a subshell, or is the * * last command after the option `-c'. * * 2) We don't have any traps set. * * 3) We don't have any files to delete. * @@ -2845,7 +2845,11 @@ /* This is a current shell procedure that didn't need to fork. * * This includes current shell procedures that are being exec'ed, * * as well as null execs. */ - jobtab[thisjob].stat |= STAT_CURSH|STAT_NOPRINT; + jobtab[thisjob].stat |= STAT_CURSH; + if (!jobtab[thisjob].procs) + jobtab[thisjob].stat |= STAT_NOPRINT; + if (is_builtin) + jobtab[thisjob].stat |= STAT_BUILTIN; } else { /* This is an exec (real or fake) for an external command. * * Note that any form of exec means that the subshell is fake * @@ -2975,17 +2979,16 @@ fn->fd1 = (int)getintvalue(v); if (errflag) bad = 1; - else if (fn->fd1 > max_zsh_fd) - bad = 3; - else if (fn->fd1 >= 10 && + else if (fn->fd1 <= max_zsh_fd) { + if (fn->fd1 >= 10 && fdtable[fn->fd1] == FDT_INTERNAL) - bad = 4; + bad = 3; + } } if (bad) { const char *bad_msg[] = { "parameter %s does not contain a file descriptor", "can't close file descriptor from readonly parameter %s", - "file descriptor %d out of range, not closed", "file descriptor %d used by shell, not closed" }; if (bad > 2) @@ -2995,11 +2998,18 @@ execerr(); } } + /* + * Note we may attempt to close an fd beyond max_zsh_fd: + * OK as long as we never look in fdtable for it. + */ if (!forked && fn->fd1 < 10 && save[fn->fd1] == -2) save[fn->fd1] = movefd(fn->fd1); if (fn->fd1 < 10) closemn(mfds, fn->fd1); - zclose(fn->fd1); + if (zclose(fn->fd1) < 0) { + zwarn("failed to close file descriptor %d: %e", + fn->fd1, errno); + } break; case REDIR_MERGEIN: case REDIR_MERGEOUT: @@ -3008,11 +3018,17 @@ if (!checkclobberparam(fn)) fil = -1; else if (fn->fd2 > 9 && - (fn->fd2 > max_zsh_fd || - (fdtable[fn->fd2] != FDT_UNUSED && - fdtable[fn->fd2] != FDT_EXTERNAL) || - fn->fd2 == coprocin || - fn->fd2 == coprocout)) { + /* + * If the requested fd is > max_zsh_fd, + * the shell doesn't know about it. + * Just assume the user knows what they're + * doing. + */ + (fn->fd2 <= max_zsh_fd && + ((fdtable[fn->fd2] != FDT_UNUSED && + fdtable[fn->fd2] != FDT_EXTERNAL) || + fn->fd2 == coprocin || + fn->fd2 == coprocout))) { fil = -1; errno = EBADF; } else { @@ -3079,7 +3095,6 @@ if (mfds[i] && mfds[i]->ct >= 2) closemn(mfds, i); - xtrerr = stderr; if (nullexec) { if (nullexec == 1) { /* @@ -3113,7 +3128,7 @@ ESUB_PGRP | ESUB_FAKE; if (type != WC_SUBSH) flags |= ESUB_KEEPTRAP; - if ((do_exec || (type >= WC_CURSH && last1 == 1)) + if ((do_exec || (type >= WC_CURSH && last1 == 1)) && !forked) flags |= ESUB_REVERTPGRP; entersubsh(flags); @@ -3740,7 +3755,15 @@ for (str = cmd + 2; *str && *str != Outpar; str++); if (!*str || cmd[1] != Inpar) { - zerr("oops."); + /* + * This can happen if the expression is being parsed + * inside another construct, e.g. as a value within ${..:..} etc. + * So print a proper error message instead of the not very + * useful but traditional "oops". + */ + char *errstr = dupstrpfx(cmd, 2); + untokenize(errstr); + zerr("unterminated `%s...)'", errstr); return NULL; } *str = '\0'; @@ -4185,10 +4208,19 @@ * Anonymous function, execute immediately. * Function name is "(anon)", parameter list is empty. */ - LinkList args = newlinklist(); + LinkList args; + + state->pc = end; + end += *state->pc++; + args = ecgetlist(state, *state->pc++, EC_DUPTOK, &htok); + if (htok && args) + execsubst(args); + + if (!args) + args = newlinklist(); shf->node.nam = "(anon)"; - addlinknode(args, shf->node.nam); + pushnode(args, shf->node.nam); execshfunc(shf, args); ret = lastval; @@ -4239,7 +4271,7 @@ * would be filled by a recursive function. */ last_file_list = jobtab[thisjob].filelist; jobtab[thisjob].filelist = NULL; - deletejob(jobtab + thisjob); + deletejob(jobtab + thisjob, 0); } if (isset(XTRACE)) { @@ -4260,6 +4292,7 @@ cmdsp = 0; if ((osfc = sfcontext) == SFC_NONE) sfcontext = SFC_DIRECT; + xtrerr = stderr; doshfunc(shf, args, 0); sfcontext = osfc; free(cmdstack); @@ -4267,7 +4300,7 @@ cmdsp = ocsp; if (!list_pipe) - deletefilelist(last_file_list); + deletefilelist(last_file_list, 0); } /* Function to execute the special type of command that represents an * @@ -4334,6 +4367,7 @@ } if (!prog) { zsfree(fname); + popheap(); return NULL; } if (ksh == 2 || (ksh == 1 && isset(KSHAUTOLOAD))) { @@ -4398,7 +4432,7 @@ mod_export int doshfunc(Shfunc shfunc, LinkList doshargs, int noreturnval) { - char **tab, **x, *oargv0; + char **pptab, **x, *oargv0; int oldzoptind, oldlastval, oldoptcind, oldnumpipestats, ret; int *oldpipestats = NULL; char saveopts[OPT_SIZE], *oldscriptname = scriptname; @@ -4432,7 +4466,7 @@ starttrapscope(); - tab = pparams; + pptab = pparams; if (!(flags & PM_UNDEFINED)) scriptname = dupstring(name); oldzoptind = zoptind; @@ -4548,7 +4582,7 @@ zsfree(argzero); argzero = oargv0; } - pparams = tab; + pparams = pptab; optcind = oldoptcind; zoptind = oldzoptind; scriptname = oldscriptname; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/glob.c zsh-beta-4.3.12-dev-1+20110925/Src/glob.c --- zsh-beta-4.3.11-dev-1+20110504/Src/glob.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/glob.c 2011-10-02 01:10:11.000000000 +0000 @@ -1801,7 +1801,7 @@ Eprog prog; if ((prog = parse_string(sortp->exec, 0))) { - int ef = errflag, lv = lastval, ret; + int ef = errflag, lv = lastval; /* Parsed OK, execute for each name */ for (tmpptr = matchbuf; tmpptr < matchptr; tmpptr++) { @@ -1814,7 +1814,6 @@ tmpptr->sortstrs[iexec] = tmpptr->name; } - ret = lastval; errflag = ef; lastval = lv; } else { @@ -2000,7 +1999,7 @@ /**/ int -xpandredir(struct redir *fn, LinkList tab) +xpandredir(struct redir *fn, LinkList redirtab) { char *nam; struct redir *ff; @@ -2048,7 +2047,7 @@ ff = (struct redir *) zhalloc(sizeof *ff); *ff = *fn; ff->name = nam; - addlinknode(tab, ff); + addlinknode(redirtab, ff); ret = 1; } } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/hashnameddir.c zsh-beta-4.3.12-dev-1+20110925/Src/hashnameddir.c --- zsh-beta-4.3.11-dev-1+20110504/Src/hashnameddir.c 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/hashnameddir.c 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,307 @@ +/* + * hashtable.c - hash tables + * + * This file is part of zsh, the Z shell. + * + * Copyright (c) 1992-1997 Paul Falstad + * All rights reserved. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and to distribute modified versions of this software for any + * purpose, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * In no event shall Paul Falstad or the Zsh Development Group be liable + * to any party for direct, indirect, special, incidental, or consequential + * damages arising out of the use of this software and its documentation, + * even if Paul Falstad and the Zsh Development Group have been advised of + * the possibility of such damage. + * + * Paul Falstad and the Zsh Development Group specifically disclaim any + * warranties, including, but not limited to, the implied warranties of + * merchantability and fitness for a particular purpose. The software + * provided hereunder is on an "as is" basis, and Paul Falstad and the + * Zsh Development Group have no obligation to provide maintenance, + * support, updates, enhancements, or modifications. + * + */ + +#include "../config.h" + +/* + * On Solaris 8 there's a clash between "bool" in curses and RPC. + * We don't need curses here, so ensure it doesn't get included. + */ +#define ZSH_NO_TERM_HANDLING + +#include "zsh.mdh" +#include "hashnameddir.pro" + +/****************************************/ +/* Named Directory Hash Table Functions */ +/****************************************/ + +#ifdef HAVE_NIS_PLUS +# include +#else +# ifdef HAVE_NIS +# include +# include +# include +# include +# endif +#endif + +/* hash table containing named directories */ + +/**/ +mod_export HashTable nameddirtab; + +/* != 0 if all the usernames have already been * + * added to the named directory hash table. */ + +static int allusersadded; + +/* Create new hash table for named directories */ + +/**/ +void +createnameddirtable(void) +{ + nameddirtab = newhashtable(201, "nameddirtab", NULL); + + nameddirtab->hash = hasher; + nameddirtab->emptytable = emptynameddirtable; + nameddirtab->filltable = fillnameddirtable; + nameddirtab->cmpnodes = strcmp; + nameddirtab->addnode = addnameddirnode; + nameddirtab->getnode = gethashnode; + nameddirtab->getnode2 = gethashnode2; + nameddirtab->removenode = removenameddirnode; + nameddirtab->disablenode = NULL; + nameddirtab->enablenode = NULL; + nameddirtab->freenode = freenameddirnode; + nameddirtab->printnode = printnameddirnode; + + allusersadded = 0; + finddir(NULL); /* clear the finddir cache */ +} + +/* Empty the named directories table */ + +/**/ +static void +emptynameddirtable(HashTable ht) +{ + emptyhashtable(ht); + allusersadded = 0; + finddir(NULL); /* clear the finddir cache */ +} + +/* Add all the usernames in the password file/database * + * to the named directories table. */ + +#ifdef HAVE_NIS_PLUS +static int +add_userdir(nis_name table, nis_object *object, void *userdata) +{ + if (object->zo_data.objdata_u.en_data.en_cols.en_cols_len >= 6) { + static char name[40], dir[PATH_MAX + 1]; + register entry_col *ec = + object->zo_data.objdata_u.en_data.en_cols.en_cols_val; + register int nl = minimum(ec[0].ec_value.ec_value_len, 39); + register int dl = minimum(ec[5].ec_value.ec_value_len, PATH_MAX); + + memcpy(name, ec[0].ec_value.ec_value_val, nl); + name[nl] = '\0'; + memcpy(dir, ec[5].ec_value.ec_value_val, dl); + dir[dl] = '\0'; + + adduserdir(name, dir, ND_USERNAME, 1); + } + return 0; +} +#else +# ifdef HAVE_NIS +static int +add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dummy) +{ + char *p, *d, *de; + + if (status != YP_TRUE) + return 1; + + if (vallen > keylen && *(p = val + keylen) == ':') { + *p++ = '\0'; + for (de = val + vallen - 1; *de != ':' && de > val; de--); + if (de > val) { + *de = '\0'; + if ((d = strrchr(p, ':'))) { + if (*++d && val[0]) + adduserdir(val, d, ND_USERNAME, 1); + } + } + } + return 0; +} +# endif /* HAVE_NIS */ +#endif /* HAVE_NIS_PLUS */ + +/**/ +static void +fillnameddirtable(UNUSED(HashTable ht)) +{ + if (!allusersadded) { +#if defined(HAVE_NIS) || defined(HAVE_NIS_PLUS) + FILE *pwf; + char buf[BUFSIZ], *p, *d, *de; + int skipping, oldct = nameddirtab->ct, usepwf = 1; + +# ifndef HAVE_NIS_PLUS + char domain[YPMAXDOMAIN]; + struct ypall_callback cb; + + /* Get potential matches from NIS and cull those without local accounts */ + if (getdomainname(domain, YPMAXDOMAIN) == 0) { + cb.foreach = (int (*)()) add_userdir; + cb.data = NULL; + yp_all(domain, PASSWD_MAP, &cb); + } +# else /* HAVE_NIS_PLUS */ + /* Maybe we should turn this string into a #define'd constant...? */ + + nis_list("passwd.org_dir", EXPAND_NAME|ALL_RESULTS|FOLLOW_LINKS|FOLLOW_PATH, + add_userdir, 0); +# endif + if (nameddirtab->ct == oldct) { + /* Using NIS or NIS+ didn't add any user directories. This seems + * fishy, so we fall back to using getpwent(). If we don't have + * that, we only use the passwd file. */ +#ifdef HAVE_GETPWENT + struct passwd *pw; + + setpwent(); + + /* loop through the password file/database * + * and add all entries returned. */ + while ((pw = getpwent()) && !errflag) + adduserdir(pw->pw_name, pw->pw_dir, ND_USERNAME, 1); + + endpwent(); + usepwf = 0; +#endif /* HAVE_GETPWENT */ + } + if (usepwf) { + /* Don't forget the non-NIS matches from the flat passwd file */ + if ((pwf = fopen(PASSWD_FILE, "r")) != NULL) { + skipping = 0; + while (fgets(buf, BUFSIZ, pwf) != NULL) { + if (strchr(buf, '\n') != NULL) { + if (!skipping) { + if ((p = strchr(buf, ':')) != NULL) { + *p++ = '\0'; + if ((de = strrchr(p, ':'))) { + *de = '\0'; + if ((d = strrchr(p, ':'))) { + if (*++d && buf[0]) + adduserdir(buf, d, ND_USERNAME, 1); + } + } + } + } else + skipping = 0; + } else + skipping = 1; + } + fclose(pwf); + } + } +#else /* no NIS or NIS_PLUS */ +#ifdef USE_GETPWENT + struct passwd *pw; + + setpwent(); + + /* loop through the password file/database * + * and add all entries returned. */ + while ((pw = getpwent()) && !errflag) + adduserdir(pw->pw_name, pw->pw_dir, ND_USERNAME, 1); + + endpwent(); +#endif /* HAVE_GETPWENT */ +#endif + allusersadded = 1; + } +} + +/* Add an entry to the named directory hash * + * table, clearing the finddir() cache and * + * initialising the `diff' member. */ + +/**/ +static void +addnameddirnode(HashTable ht, char *nam, void *nodeptr) +{ + Nameddir nd = (Nameddir) nodeptr; + + nd->diff = strlen(nd->dir) - strlen(nam); + finddir(NULL); /* clear the finddir cache */ + addhashnode(ht, nam, nodeptr); +} + +/* Remove an entry from the named directory * + * hash table, clearing the finddir() cache. */ + +/**/ +static HashNode +removenameddirnode(HashTable ht, const char *nam) +{ + HashNode hn = removehashnode(ht, nam); + + if(hn) + finddir(NULL); /* clear the finddir cache */ + return hn; +} + +/* Free up the memory used by a named directory hash node. */ + +/**/ +static void +freenameddirnode(HashNode hn) +{ + Nameddir nd = (Nameddir) hn; + + zsfree(nd->node.nam); + zsfree(nd->dir); + zfree(nd, sizeof(struct nameddir)); +} + +/* Print a named directory */ + +/**/ +static void +printnameddirnode(HashNode hn, int printflags) +{ + Nameddir nd = (Nameddir) hn; + + if (printflags & PRINT_NAMEONLY) { + zputs(nd->node.nam, stdout); + putchar('\n'); + return; + } + + if (printflags & PRINT_LIST) { + printf("hash -d "); + + if(nd->node.nam[0] == '-') + printf("-- "); + } + + quotedzputs(nd->node.nam, stdout); + putchar('='); + quotedzputs(nd->dir, stdout); + putchar('\n'); +} + +#include "../config.h" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/hashtable.c zsh-beta-4.3.12-dev-1+20110925/Src/hashtable.c --- zsh-beta-4.3.11-dev-1+20110504/Src/hashtable.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/hashtable.c 2011-10-02 01:10:11.000000000 +0000 @@ -59,7 +59,7 @@ int sorted; union { struct { - HashNode *tab; + HashNode *hashtab; int ct; } s; HashNode u; @@ -187,11 +187,11 @@ hn->next = hp->next; if(ht->scan) { if(ht->scan->sorted) { - HashNode *tab = ht->scan->u.s.tab; + HashNode *hashtab = ht->scan->u.s.hashtab; int i; for(i = ht->scan->u.s.ct; i--; ) - if(tab[i] == hp) - tab[i] = hn; + if(hashtab[i] == hp) + hashtab[i] = hn; } else if(ht->scan->u.u == hp) ht->scan->u.u = hn; } @@ -286,11 +286,11 @@ ht->ct--; if(ht->scan) { if(ht->scan->sorted) { - HashNode *tab = ht->scan->u.s.tab; + HashNode *hashtab = ht->scan->u.s.hashtab; int i; for(i = ht->scan->u.s.ct; i--; ) - if(tab[i] == hp) - tab[i] = NULL; + if(hashtab[i] == hp) + hashtab[i] = NULL; } else if(ht->scan->u.u == hp) ht->scan->u.u = hp->next; } @@ -397,7 +397,7 @@ qsort((void *)hnsorttab, ct, sizeof(HashNode), hnamcmp); st.sorted = 1; - st.u.s.tab = hnsorttab; + st.u.s.hashtab = hnsorttab; st.u.s.ct = ct; ht->scan = &st; @@ -1196,272 +1196,6 @@ putchar('\n'); } -/****************************************/ -/* Named Directory Hash Table Functions */ -/****************************************/ - -#ifdef HAVE_NIS_PLUS -# include -#else -# ifdef HAVE_NIS -# include -# include -# include -# include -# endif -#endif - -/* hash table containing named directories */ - -/**/ -mod_export HashTable nameddirtab; - -/* != 0 if all the usernames have already been * - * added to the named directory hash table. */ - -static int allusersadded; - -/* Create new hash table for named directories */ - -/**/ -void -createnameddirtable(void) -{ - nameddirtab = newhashtable(201, "nameddirtab", NULL); - - nameddirtab->hash = hasher; - nameddirtab->emptytable = emptynameddirtable; - nameddirtab->filltable = fillnameddirtable; - nameddirtab->cmpnodes = strcmp; - nameddirtab->addnode = addnameddirnode; - nameddirtab->getnode = gethashnode; - nameddirtab->getnode2 = gethashnode2; - nameddirtab->removenode = removenameddirnode; - nameddirtab->disablenode = NULL; - nameddirtab->enablenode = NULL; - nameddirtab->freenode = freenameddirnode; - nameddirtab->printnode = printnameddirnode; - - allusersadded = 0; - finddir(NULL); /* clear the finddir cache */ -} - -/* Empty the named directories table */ - -/**/ -static void -emptynameddirtable(HashTable ht) -{ - emptyhashtable(ht); - allusersadded = 0; - finddir(NULL); /* clear the finddir cache */ -} - -/* Add all the usernames in the password file/database * - * to the named directories table. */ - -#ifdef HAVE_NIS_PLUS -static int -add_userdir(nis_name table, nis_object *object, void *userdata) -{ - if (object->zo_data.objdata_u.en_data.en_cols.en_cols_len >= 6) { - static char name[40], dir[PATH_MAX + 1]; - register entry_col *ec = - object->zo_data.objdata_u.en_data.en_cols.en_cols_val; - register int nl = minimum(ec[0].ec_value.ec_value_len, 39); - register int dl = minimum(ec[5].ec_value.ec_value_len, PATH_MAX); - - memcpy(name, ec[0].ec_value.ec_value_val, nl); - name[nl] = '\0'; - memcpy(dir, ec[5].ec_value.ec_value_val, dl); - dir[dl] = '\0'; - - adduserdir(name, dir, ND_USERNAME, 1); - } - return 0; -} -#else -# ifdef HAVE_NIS -static int -add_userdir(int status, char *key, int keylen, char *val, int vallen, char *dummy) -{ - char *p, *d, *de; - - if (status != YP_TRUE) - return 1; - - if (vallen > keylen && *(p = val + keylen) == ':') { - *p++ = '\0'; - for (de = val + vallen - 1; *de != ':' && de > val; de--); - if (de > val) { - *de = '\0'; - if ((d = strrchr(p, ':'))) { - if (*++d && val[0]) - adduserdir(val, d, ND_USERNAME, 1); - } - } - } - return 0; -} -# endif /* HAVE_NIS */ -#endif /* HAVE_NIS_PLUS */ - -/**/ -static void -fillnameddirtable(UNUSED(HashTable ht)) -{ - if (!allusersadded) { -#if defined(HAVE_NIS) || defined(HAVE_NIS_PLUS) - FILE *pwf; - char buf[BUFSIZ], *p, *d, *de; - int skipping, oldct = nameddirtab->ct, usepwf = 1; - -# ifndef HAVE_NIS_PLUS - char domain[YPMAXDOMAIN]; - struct ypall_callback cb; - - /* Get potential matches from NIS and cull those without local accounts */ - if (getdomainname(domain, YPMAXDOMAIN) == 0) { - cb.foreach = (int (*)()) add_userdir; - cb.data = NULL; - yp_all(domain, PASSWD_MAP, &cb); - } -# else /* HAVE_NIS_PLUS */ - /* Maybe we should turn this string into a #define'd constant...? */ - - nis_list("passwd.org_dir", EXPAND_NAME|ALL_RESULTS|FOLLOW_LINKS|FOLLOW_PATH, - add_userdir, 0); -# endif - if (nameddirtab->ct == oldct) { - /* Using NIS or NIS+ didn't add any user directories. This seems - * fishy, so we fall back to using getpwent(). If we don't have - * that, we only use the passwd file. */ -#ifdef HAVE_GETPWENT - struct passwd *pw; - - setpwent(); - - /* loop through the password file/database * - * and add all entries returned. */ - while ((pw = getpwent()) && !errflag) - adduserdir(pw->pw_name, pw->pw_dir, ND_USERNAME, 1); - - endpwent(); - usepwf = 0; -#endif /* HAVE_GETPWENT */ - } - if (usepwf) { - /* Don't forget the non-NIS matches from the flat passwd file */ - if ((pwf = fopen(PASSWD_FILE, "r")) != NULL) { - skipping = 0; - while (fgets(buf, BUFSIZ, pwf) != NULL) { - if (strchr(buf, '\n') != NULL) { - if (!skipping) { - if ((p = strchr(buf, ':')) != NULL) { - *p++ = '\0'; - if ((de = strrchr(p, ':'))) { - *de = '\0'; - if ((d = strrchr(p, ':'))) { - if (*++d && buf[0]) - adduserdir(buf, d, ND_USERNAME, 1); - } - } - } - } else - skipping = 0; - } else - skipping = 1; - } - fclose(pwf); - } - } -#else /* no NIS or NIS_PLUS */ -#ifdef USE_GETPWENT - struct passwd *pw; - - setpwent(); - - /* loop through the password file/database * - * and add all entries returned. */ - while ((pw = getpwent()) && !errflag) - adduserdir(pw->pw_name, pw->pw_dir, ND_USERNAME, 1); - - endpwent(); -#endif /* HAVE_GETPWENT */ -#endif - allusersadded = 1; - } -} - -/* Add an entry to the named directory hash * - * table, clearing the finddir() cache and * - * initialising the `diff' member. */ - -/**/ -static void -addnameddirnode(HashTable ht, char *nam, void *nodeptr) -{ - Nameddir nd = (Nameddir) nodeptr; - - nd->diff = strlen(nd->dir) - strlen(nam); - finddir(NULL); /* clear the finddir cache */ - addhashnode(ht, nam, nodeptr); -} - -/* Remove an entry from the named directory * - * hash table, clearing the finddir() cache. */ - -/**/ -static HashNode -removenameddirnode(HashTable ht, const char *nam) -{ - HashNode hn = removehashnode(ht, nam); - - if(hn) - finddir(NULL); /* clear the finddir cache */ - return hn; -} - -/* Free up the memory used by a named directory hash node. */ - -/**/ -static void -freenameddirnode(HashNode hn) -{ - Nameddir nd = (Nameddir) hn; - - zsfree(nd->node.nam); - zsfree(nd->dir); - zfree(nd, sizeof(struct nameddir)); -} - -/* Print a named directory */ - -/**/ -static void -printnameddirnode(HashNode hn, int printflags) -{ - Nameddir nd = (Nameddir) hn; - - if (printflags & PRINT_NAMEONLY) { - zputs(nd->node.nam, stdout); - putchar('\n'); - return; - } - - if (printflags & PRINT_LIST) { - printf("hash -d "); - - if(nd->node.nam[0] == '-') - printf("-- "); - } - - quotedzputs(nd->node.nam, stdout); - putchar('='); - quotedzputs(nd->dir, stdout); - putchar('\n'); -} - /*************************************/ /* History Line Hash Table Functions */ /*************************************/ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/hist.c zsh-beta-4.3.12-dev-1+20110925/Src/hist.c --- zsh-beta-4.3.11-dev-1+20110504/Src/hist.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/hist.c 2011-10-02 01:10:11.000000000 +0000 @@ -229,7 +229,7 @@ /* Quote un-expanded bangs in the history line. */ if (c == bangchar && stophist < 2 && qbang) /* If qbang is not set, we do not escape this bangchar as it's * - * not mecessary (e.g. it's a bang in !=, or it is followed * + * not necessary (e.g. it's a bang in !=, or it is followed * * by a space). Roughly speaking, qbang is zero only if the * * history interpreter has already digested this bang and * * found that it is not necessary to escape it. */ @@ -303,7 +303,7 @@ /* If the result is a bangchar which came from history or alias * * expansion, we treat it as an escaped bangchar, unless history * * is disabled. If stophist == 1 it only means that history is * - * temporarily disabled by a !" which won't appear in in the * + * temporarily disabled by a !" which won't appear in the * * history, so we still have an escaped bang. stophist > 1 if * * history is disabled with NOBANGHIST or by someone else (e.g. * * when the lexer scans single quoted text). */ @@ -876,7 +876,18 @@ stophist = (!interact || unset(SHINSTDIN)) ? 2 : 0; else stophist = 0; - if (stophist == 2 || (inbufflags & INP_ALIAS)) { + /* + * pws: We used to test for "|| (inbufflags & INP_ALIAS)" + * in this test, but at this point we don't have input + * set up up so this can trigger unnecessarily. + * I don't see how the test at this point could ever be + * useful, since we only get here when we're initialising + * the history mechanism, before we've done any input. + * + * (I also don't see any point where this function is called with + * dohist=0.) + */ + if (stophist == 2) { chline = hptr = NULL; hlinesz = 0; chwords = NULL; @@ -1344,7 +1355,8 @@ (chwordlen += 32) * sizeof(short)); } - if (hwgetword > -1) { + if (hwgetword > -1 && + (inbufflags & INP_ALIAS) && !(inbufflags & INP_HIST)) { /* We want to reuse the current word position */ chwordpos = hwgetword; /* Start from where previous word ended, if possible */ @@ -2235,10 +2247,12 @@ if (!fn && !(fn = getsparam("HISTFILE"))) return; + if (stat(unmeta(fn), &sb) < 0 || + sb.st_size == 0) + return; if (readflags & HFILE_FAST) { - if (stat(unmeta(fn), &sb) < 0 - || (lasthist.fsiz == sb.st_size && lasthist.mtim == sb.st_mtime) - || lockhistfile(fn, 0)) + if ((lasthist.fsiz == sb.st_size && lasthist.mtim == sb.st_mtime) + || lockhistfile(fn, 0)) return; lasthist.fsiz = sb.st_size; lasthist.mtim = sb.st_mtime; @@ -2338,103 +2352,11 @@ /* * Divide up the words. */ - nwordpos = 0; start = pt; uselex = isset(HISTLEXWORDS) && !(readflags & HFILE_FAST); - if (uselex) { - /* - * Attempt to do this using the lexer. - */ - LinkList wordlist = bufferwords(NULL, pt, NULL, - LEXFLAGS_COMMENTS_KEEP); - LinkNode wordnode; - int nwords_max; - nwords_max = 2 * countlinknodes(wordlist); - if (nwords_max > nwords) { - nwords = nwords_max; - words = (short *)realloc(words, nwords*sizeof(short)); - } - for (wordnode = firstnode(wordlist); - wordnode; - incnode(wordnode)) { - char *word = getdata(wordnode); - - for (;;) { - /* - * Not really an oddity: "\\\n" is - * removed from input as if whitespace. - */ - if (inblank(*pt)) - pt++; - else if (pt[0] == '\\' && pt[1] == '\n') - pt += 2; - else - break; - } - if (!strpfx(word, pt)) { - int bad = 0; - /* - * Oddity 1: newlines turn into semicolons. - */ - if (!strcmp(word, ";")) - continue; - while (*pt) { - if (!*word) { - bad = 1; - break; - } - /* - * Oddity 2: !'s turn into |'s. - */ - if (*pt == *word || - (*pt == '!' && *word == '|')) { - pt++; - word++; - } else { - bad = 1; - break; - } - } - if (bad) { -#ifdef DEBUG - dputs(ERRMSG("bad wordsplit reading history: " - "%s\nat: %s\nword: %s"), - start, pt, word); -#endif - pt = start; - nwordpos = 0; - uselex = 0; - break; - } - } - words[nwordpos++] = pt - start; - pt += strlen(word); - words[nwordpos++] = pt - start; - } + histsplitwords(pt, &words, &nwords, &nwordpos, uselex); + if (uselex) freeheap(); - } - if (!uselex) { - do { - for (;;) { - if (inblank(*pt)) - pt++; - else if (pt[0] == '\\' && pt[1] == '\n') - pt += 2; - else - break; - } - if (*pt) { - if (nwordpos >= nwords) - words = (short *) - realloc(words, (nwords += 64)*sizeof(short)); - words[nwordpos++] = pt - start; - while (*pt && !inblank(*pt)) - pt++; - words[nwordpos++] = pt - start; - } - } while (*pt); - - } he->nwords = nwordpos/2; if (he->nwords) { @@ -3134,6 +3056,207 @@ return list; } +/* + * Split up a line into words for use in a history file. + * + * lineptr is the line to be split. + * + * *wordsp and *nwordsp are an array already allocated to hold words + * and its length. The array holds both start and end positions, + * so *nwordsp actually counts twice the number of words in the + * original string. *nwordsp may be zero in which case the array + * will be allocated. + * + * *nwordposp returns the used length of *wordsp in the same units as + * *nwordsp, i.e. twice the number of words in the input line. + * + * If uselex is 1, attempt to do this using the lexical analyser. + * This is more accurate, but slower; for reading history files it's + * controlled by the option HISTLEXWORDS. If this failed (which + * indicates a bug in the shell) it falls back to whitespace-separated + * strings, printing a message if in debug mode. + * + * If uselex is 0, just look for whitespace-separated words; the only + * special handling is for a backslash-newline combination as used + * by the history file format to save multiline buffers. + */ +/**/ +mod_export void +histsplitwords(char *lineptr, short **wordsp, int *nwordsp, int *nwordposp, + int uselex) +{ + int nwords = *nwordsp, nwordpos = 0; + short *words = *wordsp; + char *start = lineptr; + + if (uselex) { + LinkList wordlist = bufferwords(NULL, lineptr, NULL, + LEXFLAGS_COMMENTS_KEEP); + LinkNode wordnode; + int nwords_max; + + nwords_max = 2 * countlinknodes(wordlist); + if (nwords_max > nwords) { + *nwordsp = nwords = nwords_max; + *wordsp = words = (short *)zrealloc(words, nwords*sizeof(short)); + } + for (wordnode = firstnode(wordlist); + wordnode; + incnode(wordnode)) { + char *word = getdata(wordnode); + char *lptr, *wptr = word; + int loop_next = 0, skipping; + + /* Skip stuff at the start of the word */ + for (;;) { + /* + * Not really an oddity: "\\\n" is + * removed from input as if whitespace. + */ + if (inblank(*lineptr)) + lineptr++; + else if (lineptr[0] == '\\' && lineptr[1] == '\n') { + /* + * Optimisation: we handle this in the loop below, + * too. + */ + lineptr += 2; + } else + break; + } + lptr = lineptr; + /* + * Skip chunks of word with possible intervening + * backslash-newline. + * + * To get round C's annoying lack of ability to + * reference the outer loop, we'll break from this + * one with + * loop_next = 0: carry on as normal + * loop_next = 1: break from outer loop + * loop_next = 2: continue round outer loop. + */ + do { + skipping = 0; + if (strpfx(wptr, lptr)) { + /* + * Normal case: word from lexer matches start of + * string from line. Just advance over it. + */ + int len; + if (!strcmp(wptr, ";") && strpfx(";;", lptr)) { + /* + * Don't get confused between a semicolon that's + * probably really a newline and a double + * semicolon that's terminating a case. + */ + loop_next = 2; + break; + } + len = strlen(wptr); + lptr += len; + wptr += len; + } else { + /* + * Didn't get to the end of the word. + * See what's amiss. + */ + int bad = 0; + /* + * Oddity 1: newlines turn into semicolons. + */ + if (!strcmp(wptr, ";")) + { + loop_next = 2; + break; + } + while (*lptr) { + if (!*wptr) { + /* + * End of the word before the end of the + * line: not good. + */ + bad = 1; + loop_next = 1; + break; + } + /* + * Oddity 2: !'s turn into |'s. + */ + if (*lptr == *wptr || + (*lptr == '!' && *wptr == '|')) { + lptr++; + wptr++; + } else if (lptr[0] == '\\' && + lptr[1] == '\n') { + /* + * \\\n can occur in the middle of a word; + * wptr is already pointing at this, we + * just need to skip over the break + * in lptr and look at the next chunk. + */ + lptr += 2; + skipping = 1; + break; + } else { + bad = 1; + loop_next = 1; + break; + } + } + if (bad) { +#ifdef DEBUG + dputs(ERRMSG("bad wordsplit reading history: " + "%s\nat: %s\nword: %s"), + start, lineptr, word); +#endif + lineptr = start; + nwordpos = 0; + uselex = 0; + loop_next = 1; + } + } + } while (skipping); + if (loop_next) { + if (loop_next == 1) + break; + continue; + } + /* Record position of current word... */ + words[nwordpos++] = lineptr - start; + words[nwordpos++] = lptr - start; + + /* ready for start of next word. */ + lineptr = lptr; + } + } + if (!uselex) { + do { + for (;;) { + if (inblank(*lineptr)) + lineptr++; + else if (lineptr[0] == '\\' && lineptr[1] == '\n') + lineptr += 2; + else + break; + } + if (*lineptr) { + if (nwordpos >= nwords) { + *nwordsp = nwords = nwords + 64; + *wordsp = words = (short *) + zrealloc(words, nwords*sizeof(*words)); + } + words[nwordpos++] = lineptr - start; + while (*lineptr && !inblank(*lineptr)) + lineptr++; + words[nwordpos++] = lineptr - start; + } + } while (*lineptr); + } + + *nwordposp = nwordpos; +} + /* Move the current history list out of the way and prepare a fresh history * list using hf for HISTFILE, hs for HISTSIZE, and shs for SAVEHIST. If * the hf value is an empty string, HISTFILE will be unset from the new diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/init.c zsh-beta-4.3.12-dev-1+20110925/Src/init.c --- zsh-beta-4.3.11-dev-1+20110504/Src/init.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/init.c 2011-10-02 01:10:11.000000000 +0000 @@ -908,8 +908,8 @@ /* columns and lines are normally zero, unless something different * * was inhereted from the environment. If either of them are zero * * the setiparam calls below set them to the defaults from termcap */ - setiparam("COLUMNS", columns); - setiparam("LINES", lines); + setiparam("COLUMNS", zterm_columns); + setiparam("LINES", zterm_lines); #endif #ifdef HAVE_GETRLIMIT diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/jobs.c zsh-beta-4.3.12-dev-1+20110925/Src/jobs.c --- zsh-beta-4.3.11-dev-1+20110504/Src/jobs.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/jobs.c 2011-10-02 01:10:11.000000000 +0000 @@ -160,6 +160,8 @@ Process pn; int i; + *jptr = NULL; + *pptr = NULL; for (i = 1; i <= maxjob; i++) { /* @@ -189,15 +191,16 @@ * the termination of the process which pid we were supposed * to return in a different job. */ - if (pn->pid == pid && pn->status == SP_RUNNING) { + if (pn->pid == pid) { *pptr = pn; *jptr = jobtab + i; - return 1; + if (pn->status == SP_RUNNING) + return 1; } } } - return 0; + return (*pptr && *jptr); } /* Does the given job number have any processes? */ @@ -266,7 +269,7 @@ sleep, the rest will be executed by a sub-shell, but the parent shell gets notified for the sleep. - deletejob(sj); */ + deletejob(sj, 0); */ /* If this super-job contains only the sub-shell, we have to attach the tty to its process group now. */ @@ -531,7 +534,7 @@ /* When MONITOR is set, the foreground process runs in a different * * process group from the shell, so the shell will not receive * - * terminal signals, therefore we we pretend that the shell got * + * terminal signals, therefore we pretend that the shell got * * the signal too. */ if (inforeground == 2 && isset(MONITOR) && WIFSIGNALED(status)) { int sig = WTERMSIG(status); @@ -893,7 +896,7 @@ { Process pn; int job, len = 9, sig, sflag = 0, llen; - int conted = 0, lineleng = columns, skip = 0, doputnl = 0; + int conted = 0, lineleng = zterm_columns, skip = 0, doputnl = 0; int doneprint = 0, skip_print = 0; FILE *fout = (synch == 2 || !shout) ? stdout : shout; @@ -950,7 +953,9 @@ if (skip_print) { if (jn->stat & STAT_DONE) { - deletejob(jn); + if (should_report_time(jn)) + dumptime(jn); + deletejob(jn, 0); if (job == curjob) { curjob = prevjob; prevjob = job; @@ -1080,7 +1085,7 @@ if (jn->stat & STAT_DONE) { if (should_report_time(jn)) dumptime(jn); - deletejob(jn); + deletejob(jn, 0); if (job == curjob) { curjob = prevjob; prevjob = job; @@ -1095,12 +1100,13 @@ /**/ void -deletefilelist(LinkList file_list) +deletefilelist(LinkList file_list, int disowning) { char *s; if (file_list) { while ((s = (char *)getlinknode(file_list))) { - unlink(s); + if (!disowning) + unlink(s); zsfree(s); } zfree(file_list, sizeof(struct linklist)); @@ -1136,7 +1142,7 @@ /* careful in case we shrink and move the job table */ int job = jn - jobtab; if (deleting) - deletejob(jobtab + jn->other); + deletejob(jobtab + jn->other, 0); else freejob(jobtab + jn->other, 0); jn = jobtab + job; @@ -1156,13 +1162,17 @@ /* * We are actually finished with this job, rather * than freeing it to make space. + * + * If "disowning" is set, files associated with the job are not + * actually deleted --- and won't be as there is nothing left + * to clear up. */ /**/ void -deletejob(Job jn) +deletejob(Job jn, int disowning) { - deletefilelist(jn->filelist); + deletefilelist(jn->filelist, disowning); if (jn->stat & STAT_ATTACH) { attachtty(mypgrp); adjustwinsize(0); @@ -1338,7 +1348,7 @@ child_block(); } } else { - deletejob(jn); + deletejob(jn, 0); pipestats[0] = lastval; numpipestats = 1; } @@ -1361,7 +1371,7 @@ if (jn->procs || jn->auxprocs) zwaitjob(thisjob, 0); else { - deletejob(jn); + deletejob(jn, 0); pipestats[0] = lastval; numpipestats = 1; } @@ -1489,7 +1499,7 @@ } } if (!hasprocs(thisjob)) - deletejob(jobtab + thisjob); + deletejob(jobtab + thisjob, 0); else jobtab[thisjob].stat |= STAT_LOCKED; thisjob = -1; @@ -1930,12 +1940,19 @@ Process p; if (findproc(pid, &j, &p, 0)) { - /* - * returns 0 for normal exit, else signal+128 - * in which case we should return that status. - */ - retval = waitforpid(pid, 1); - if (!retval) + if (j->stat & STAT_STOPPED) { + retval = (killjb(j, SIGCONT) != 0); + if (retval == 0) + makerunning(j); + } + if (retval == 0) { + /* + * returns 0 for normal exit, else signal+128 + * in which case we should return that status. + */ + retval = waitforpid(pid, 1); + } + if (retval == 0) retval = lastval2; } else if (isset(POSIXJOBS) && pid == lastpid && lastpid_status >= 0L) { @@ -2058,7 +2075,7 @@ waitjobs(); retval = lastval2; } else if (ofunc == BIN_DISOWN) - deletejob(jobtab + job); + deletejob(jobtab + job, 1); break; case BIN_JOBS: printjob(job + (oldjobtab ? oldjobtab : jobtab), lng, 2); @@ -2094,7 +2111,7 @@ #endif pids); } - deletejob(jobtab + job); + deletejob(jobtab + job, 1); break; } thisjob = ocj; @@ -2245,7 +2262,7 @@ } if (sig > SIGCOUNT) { zwarnnam(nam, "unknown signal: SIG%s", signame); - zwarnnam(nam, "type kill -l for a List of signals"); + zwarnnam(nam, "type kill -l for a list of signals"); return 1; } } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/lex.c zsh-beta-4.3.12-dev-1+20110925/Src/lex.c --- zsh-beta-4.3.11-dev-1+20110504/Src/lex.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/lex.c 2011-10-02 01:10:11.000000000 +0000 @@ -1567,7 +1567,7 @@ err = (!brct-- && math); break; case '"': - if (intick || ((endchar == ']' || !endchar) && !bct)) + if (intick || (endchar != '"' && !bct)) break; if (bct) { add(Dnull); @@ -1698,7 +1698,7 @@ mod_export int parse_subst_string(char *s) { - int c, l = strlen(s), err, olen, lexstop_ret; + int c, l = strlen(s), err; char *ptr; if (!*s || !strcmp(s, nulstring)) @@ -1711,13 +1711,11 @@ bptr = tokstr = s; bsiz = l + 1; c = hgetc(); - lexstop_ret = lexstop; c = gettokstr(c, 1); err = errflag; strinend(); inpop(); DPUTS(cmdsp, "BUG: parse_subst_string: cmdstack not empty."); - olen = len; lexrestore(); errflag = err; if (c == LEXERR) { @@ -1726,8 +1724,9 @@ } #ifdef DEBUG /* - * Historical note: we used to check here for olen == l, but - * that's not necessarily the case if we stripped an RCQUOTE. + * Historical note: we used to check here for olen (the value of len + * before lexrestore()) == l, but that's not necessarily the case if + * we stripped an RCQUOTE. */ if (c != STRING || (errflag && !noerrs)) { fprintf(stderr, "Oops. Bug in parse_subst_string: %s\n", @@ -1755,7 +1754,7 @@ * additional memory should come off the heap or * otherwise. So we cheat by copying the unquoted string * into place, unless it's too long. That's not the - * normal case, but I'm worried there are are pathological + * normal case, but I'm worried there are pathological * cases with converting metafied multibyte strings. * If someone can prove there aren't I will be very happy. */ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/loop.c zsh-beta-4.3.12-dev-1+20110925/Src/loop.c --- zsh-beta-4.3.11-dev-1+20110504/Src/loop.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/loop.c 2011-10-02 01:10:11.000000000 +0000 @@ -324,13 +324,13 @@ while (t0) t0 /= 10, longest++; /* to compensate for added ')' */ - fct = (columns - 1) / (longest + 3); + fct = (zterm_columns - 1) / (longest + 3); if (fct == 0) fct = 1; else - fw = (columns - 1) / fct; + fw = (zterm_columns - 1) / fct; colsz = (ct + fct - 1) / fct; - for (t1 = start; t1 != colsz && t1 - start < lines - 2; t1++) { + for (t1 = start; t1 != colsz && t1 - start < zterm_lines - 2; t1++) { ap = arr + t1; do { size_t t2 = strlen(*ap) + 2; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Makemod.in.in zsh-beta-4.3.12-dev-1+20110925/Src/Makemod.in.in --- zsh-beta-4.3.11-dev-1+20110504/Src/Makemod.in.in 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Makemod.in.in 2011-10-02 01:10:11.000000000 +0000 @@ -47,8 +47,8 @@ DNCFLAGS = -COMPILE = $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS) -DLCOMPILE = $(CC) -c -I. $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS) +COMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(D@L@CFLAGS) +DLCOMPILE = $(CC) -c -I. -I$(dir_top)/Src -I$(sdir_top)/Src -I$(sdir_top)/Src/Zle -I$(sdir) $(CPPFLAGS) $(DEFS) -DMODULE $(CFLAGS) $(DLCFLAGS) LINK = $(CC) $(LDFLAGS) $(EXELDFLAGS) $(EXTRA_LDFLAGS) -o $@ DLLINK = $(DLLD) $(LDFLAGS) $(LIBLDFLAGS) $(DLLDFLAGS) -o $@ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/math.c zsh-beta-4.3.12-dev-1+20110925/Src/math.c --- zsh-beta-4.3.11-dev-1+20110504/Src/math.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/math.c 2011-10-02 01:10:11.000000000 +0000 @@ -46,7 +46,7 @@ /* * The last value we computed: note this isn't cleared - * until the next computation, unlike unlike yyval. + * until the next computation, unlike yyval. * Everything else is saved and returned to allow recursive calls. */ /**/ @@ -969,7 +969,6 @@ op(int what) { mnumber a, b, c, *spval; - char *lv; int tp = type[what]; if (errflag) @@ -1155,8 +1154,8 @@ } if (tp & (OP_E2|OP_E2IO)) { struct mathvalue *mvp = stack + sp + 1; - lv = stack[sp+1].lval; - push(setmathvar(mvp,c), mvp->lval, 0); + c = setmathvar(mvp, c); + push(c, mvp->lval, 0); } else push(c,NULL, 0); return; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/mem.c zsh-beta-4.3.12-dev-1+20110925/Src/mem.c --- zsh-beta-4.3.11-dev-1+20110504/Src/mem.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/mem.c 2011-10-02 01:10:11.000000000 +0000 @@ -123,6 +123,60 @@ static Heap fheap; +/**/ +#ifdef ZSH_HEAP_DEBUG +/* + * The heap ID we'll allocate next. + * + * We'll avoid using 0 as that means zero-initialised memory + * containing a heap ID is (correctly) marked as invalid. + */ +static Heapid next_heap_id = (Heapid)1; + +/* + * The ID of the heap from which we last allocated heap memory. + * In theory, since we carefully avoid allocating heap memory during + * interrupts, after any call to zhalloc() or wrappers this should + * be the ID of the heap containing the memory just returned. + */ +/**/ +mod_export Heapid last_heap_id; + +/* + * Stack of heaps saved by new_heaps(). + * Assumes old_heaps() will come along and restore it later + * (outputs an error if old_heaps() is called out of sequence). + */ +LinkList heaps_saved; + +/* + * Debugging verbosity. This must be set from a debugger. + * An 'or' of bits from the enum heap_debug_verbosity. + */ +volatile int heap_debug_verbosity; + +/* + * Generate a heap identifier that's unique up to unsigned integer wrap. + * + * For the purposes of debugging we won't bother trying to make a + * heap_id globally unique, which would require checking all existing + * heaps every time we create an ID and still wouldn't do what we + * ideally want, which is to make sure the IDs of valid heaps are + * different from the IDs of no-longer-valid heaps. Given that, + * we'll just assume that if we haven't tracked the problem when the + * ID wraps we're out of luck. We could change the type to a long long + * if we wanted more room + */ + +static Heapid +new_heap_id(void) +{ + return next_heap_id++; +} + +/**/ +#endif + /* Use new heaps from now on. This returns the old heap-list. */ /**/ @@ -137,6 +191,15 @@ fheap = heaps = NULL; unqueue_signals(); +#ifdef ZSH_HEAP_DEBUG + if (heap_debug_verbosity & HDV_NEW) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT + " saved, new heaps created.\n", h->heap_id); + } + if (!heaps_saved) + heaps_saved = znewlinklist(); + zpushnode(heaps_saved, h); +#endif return h; } @@ -152,6 +215,12 @@ for (h = heaps; h; h = n) { n = h->next; DPUTS(h->sp, "BUG: old_heaps() with pushed heaps"); +#ifdef ZSH_HEAP_DEBUG + if (heap_debug_verbosity & HDV_FREE) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT + "freed in old_heaps().\n", h->heap_id); + } +#endif #ifdef USE_MMAP munmap((void *) h, h->size); #else @@ -159,6 +228,21 @@ #endif } heaps = old; +#ifdef ZSH_HEAP_DEBUG + if (heap_debug_verbosity & HDV_OLD) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT + "restored.\n", heaps->heap_id); + } + { + Heap myold = heaps_saved ? getlinknode(heaps_saved) : NULL; + if (old != myold) + { + fprintf(stderr, "HEAP DEBUG: invalid old heap " HEAPID_FMT + ", expecting " HEAPID_FMT ".\n", old->heap_id, + myold->heap_id); + } + } +#endif fheap = NULL; unqueue_signals(); } @@ -174,6 +258,12 @@ queue_signals(); h = heaps; +#ifdef ZSH_HEAP_DEBUG + if (heap_debug_verbosity & HDV_SWITCH) { + fprintf(stderr, "HEAP DEBUG: heap temporarily switched from " + HEAPID_FMT " to " HEAPID_FMT ".\n", h->heap_id, new->heap_id); + } +#endif heaps = new; fheap = NULL; unqueue_signals(); @@ -202,6 +292,15 @@ hs->next = h->sp; h->sp = hs; hs->used = h->used; +#ifdef ZSH_HEAP_DEBUG + hs->heap_id = h->heap_id; + h->heap_id = new_heap_id(); + if (heap_debug_verbosity & HDV_PUSH) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT " pushed, new id is " + HEAPID_FMT ".\n", + hs->heap_id, h->heap_id); + } +#endif } unqueue_signals(); } @@ -220,8 +319,28 @@ h_free++; #endif + /* At this point we used to do: fheap = NULL; - for (h = heaps; h; h = hn) { + * + * When pushheap() is called, it sweeps over the entire heaps list of + * arenas and marks every one of them with the amount of free space in + * that arena at that moment. zhalloc() is then allowed to grab bits + * out of any of those arenas that have free space. + * + * With the above reset of fheap, the loop below sweeps back over the + * entire heap list again, resetting the free space in every arena to + * the amount stashed by pushheap() and finding the first arena with + * free space to optimize zhalloc()'s next search. When there's a lot + * of stuff already on the heap, this is an enormous amount of work, + * and performance goes to hell. + * + * However, there doesn't seem to be any reason to reset fheap before + * beginning this loop. Either it's already correct, or it has never + * been set and this loop will do it, or it'll be reset from scratch + * on the next popheap(). So all that's needed here is to pick up + * the scan wherever the last pass [or the last popheap()] left off. + */ + for (h = (fheap ? fheap : heaps); h; h = hn) { hn = h->next; if (h->sp) { #ifdef ZSH_MEM_DEBUG @@ -231,6 +350,22 @@ if (!fheap && h->used < ARENA_SIZEOF(h)) fheap = h; hl = h; +#ifdef ZSH_HEAP_DEBUG + /* + * As the free makes the heap invalid, give it a new + * identifier. We're not popping it, so don't use + * the one in the heap stack. + */ + { + Heapid new_id = new_heap_id(); + if (heap_debug_verbosity & HDV_FREE) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT + " freed, new id is " HEAPID_FMT ".\n", + h->heap_id, new_id); + } + h->heap_id = new_id; + } +#endif } else { #ifdef USE_MMAP munmap((void *) h, h->size); @@ -242,7 +377,7 @@ if (hl) hl->next = NULL; else - heaps = NULL; + heaps = fheap = NULL; unqueue_signals(); } @@ -271,6 +406,14 @@ memset(arena(h) + hs->used, 0xff, h->used - hs->used); #endif h->used = hs->used; +#ifdef ZSH_HEAP_DEBUG + if (heap_debug_verbosity & HDV_POP) { + fprintf(stderr, "HEAP DEBUG: heap " HEAPID_FMT + " popped, old heap was " HEAPID_FMT ".\n", + h->heap_id, hs->heap_id); + } + h->heap_id = hs->heap_id; +#endif if (!fheap && h->used < ARENA_SIZEOF(h)) fheap = h; zfree(hs, sizeof(*hs)); @@ -373,6 +516,13 @@ h->used = n; ret = arena(h) + n - size; unqueue_signals(); +#ifdef ZSH_HEAP_DEBUG + last_heap_id = h->heap_id; + if (heap_debug_verbosity & HDV_ALLOC) { + fprintf(stderr, "HEAP DEBUG: allocated memory from heap " + HEAPID_FMT ".\n", h->heap_id); + } +#endif return ret; } } @@ -404,6 +554,13 @@ h->used = size; h->next = NULL; h->sp = NULL; +#ifdef ZSH_HEAP_DEBUG + h->heap_id = new_heap_id(); + if (heap_debug_verbosity & HDV_CREATE) { + fprintf(stderr, "HEAP DEBUG: create new heap " HEAPID_FMT ".\n", + h->heap_id); + } +#endif if (hp) hp->next = h; @@ -412,6 +569,13 @@ fheap = h; unqueue_signals(); +#ifdef ZSH_HEAP_DEBUG + last_heap_id = h->heap_id; + if (heap_debug_verbosity & HDV_ALLOC) { + fprintf(stderr, "HEAP DEBUG: allocated memory from heap " + HEAPID_FMT ".\n", h->heap_id); + } +#endif return arena(h); } } @@ -475,6 +639,9 @@ * don't use the heap for anything else.) */ if (p == arena(h)) { +#ifdef ZSH_HEAP_DEBUG + Heapid heap_id = h->heap_id; +#endif /* * Zero new seems to be a special case saying we've finished * with the specially reallocated memory, see scanner() in glob.c. @@ -534,6 +701,9 @@ heaps = h; } h->used = new; +#ifdef ZSH_HEAP_DEBUG + h->heap_id = heap_id; +#endif unqueue_signals(); return arena(h); } @@ -556,6 +726,55 @@ } } +/**/ +#ifdef ZSH_HEAP_DEBUG +/* + * Check if heap_id is the identifier of a currently valid heap, + * including any heap buried on the stack, or of permanent memory. + * Return 0 if so, else 1. + * + * This gets confused by use of switch_heaps(). That's because so do I. + */ + +/**/ +mod_export int +memory_validate(Heapid heap_id) +{ + Heap h; + Heapstack hs; + LinkNode node; + + if (heap_id == HEAPID_PERMANENT) + return 0; + + queue_signals(); + for (h = heaps; h; h = h->next) { + if (h->heap_id == heap_id) + return 0; + for (hs = heaps->sp; hs; hs = hs->next) { + if (hs->heap_id == heap_id) + return 0; + } + } + + if (heaps_saved) { + for (node = firstnode(heaps_saved); node; incnode(node)) { + for (h = (Heap)getdata(node); h; h = h->next) { + if (h->heap_id == heap_id) + return 0; + for (hs = heaps->sp; hs; hs = hs->next) { + if (hs->heap_id == heap_id) + return 0; + } + } + } + } + + return 1; +} +/**/ +#endif + /* allocate memory from the current memory pool and clear it */ /**/ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/mkmakemod.sh zsh-beta-4.3.12-dev-1+20110925/Src/mkmakemod.sh --- zsh-beta-4.3.11-dev-1+20110504/Src/mkmakemod.sh 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/mkmakemod.sh 2011-10-02 01:10:11.000000000 +0000 @@ -383,11 +383,7 @@ if test -n "$headers"; then echo " echo '/* Extra headers for this module */'; \\" echo " for hdr in $headers; do \\" - echo " if test -f \$\$hdr; then \\" - echo " echo '# include \"'\$\$hdr'\"'; \\" - echo " else \\" - echo " echo '# include \"\$(sdir)/'\$\$hdr'\"'; \\" - echo " fi; \\" + echo " echo '# include \"'\$\$hdr'\"'; \\" echo " done; \\" echo " echo; \\" fi diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/module.c zsh-beta-4.3.12-dev-1+20110925/Src/module.c --- zsh-beta-4.3.11-dev-1+20110504/Src/module.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/module.c 2011-10-02 01:10:11.000000000 +0000 @@ -1081,6 +1081,11 @@ pm->gsu.i = d->gsu ? (GsuInteger)d->gsu : &varinteger_gsu; break; + case PM_FFLOAT: + case PM_EFLOAT: + pm->gsu.f = d->gsu; + break; + case PM_ARRAY: pm->gsu.a = d->gsu ? (GsuArray)d->gsu : &vararray_gsu; break; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/curses.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/curses.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/curses.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/curses.c 2011-10-02 01:10:11.000000000 +0000 @@ -1069,8 +1069,47 @@ } #endif + /* + * Some documentation for wgetch() says: + + The behavior of getch and friends in the presence of handled signals + is unspecified in the SVr4 and XSI Curses documentation. Under his- + torical curses implementations, it varied depending on whether the + operating system's implementation of handled signal receipt interrupts + a read(2) call in progress or not, and also (in some implementations) + depending on whether an input timeout or non-blocking mode has been + set. + + Programmers concerned about portability should be prepared for either + of two cases: (a) signal receipt does not interrupt getch; (b) signal + receipt interrupts getch and causes it to return ERR with errno set to + EINTR. Under the ncurses implementation, handled signals never inter- + rupt getch. + + * The observed behavior, however, is different: wgetch() consistently + * returns ERR with EINTR when a signal is handled by the shell "trap" + * command mechanism. Further, it consistently returns ERR twice, the + * second time without even attempting to repeat the interrupted read, + * which has the side-effect of NOT updating errno. A third call will + * then begin reading again. + * + * Therefore, to properly implement signal trapping, we must (1) call + * wgetch() in a loop as long as errno remains EINTR, and (2) clear + * errno only before beginning the loop, not on every pass. + * + * There remains a potential bug here in that, if the caller has set + * a timeout for the read [see zccmd_timeout()] the countdown is very + * likely restarted on every call to wgetch(), so an interrupted call + * might wait much longer than desired. + */ + errno = 0; + #ifdef HAVE_WGET_WCH - switch (wget_wch(w->win, &wi)) { + while ((ret = wget_wch(w->win, &wi)) == ERR) { + if (errno != EINTR || errflag || retflag || breaks || exit_pending) + break; + } + switch (ret) { case OK: ret = wctomb(instr, (wchar_t)wi); if (ret == 0) { @@ -1092,9 +1131,10 @@ return 1; } #else - ci = wgetch(w->win); - if (ci == ERR) - return 1; + while ((ci = wgetch(w->win)) == ERR) { + if (errno != EINTR || errflag || retflag || breaks || exit_pending) + return 1; + } if (ci >= 256) { keypadnum = ci; *instr = '\0'; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/datetime.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/datetime.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/datetime.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/datetime.c 2011-10-02 01:10:11.000000000 +0000 @@ -146,11 +146,74 @@ } static zlong -getcurrentsecs() +getcurrentsecs(UNUSED(Param pm)) { return (zlong) time(NULL); } +static double +getcurrentrealtime(Param pm) +{ +#ifdef HAVE_CLOCK_GETTIME + struct timespec now; + + if (clock_gettime(CLOCK_REALTIME, &now) < 0) { + zwarn("%s: unable to retrieve time: %e", pm->node.nam, errno); + return (double)0.0; + } + + return (double)now.tv_sec + (double)now.tv_nsec * 1e-9; +#else + struct timeval now; + struct timezone dummy_tz; + + (void)pm; + gettimeofday(&now, &dummy_tz); + + return (double)now.tv_sec + (double)now.tv_usec * 1e-6; +#endif +} + +static char ** +getcurrenttime(Param pm) +{ + char **arr; + char buf[DIGBUFSIZE]; + +#ifdef HAVE_CLOCK_GETTIME + struct timespec now; + + if (clock_gettime(CLOCK_REALTIME, &now) < 0) { + zwarn("%s: unable to retrieve time: %e", pm->node.nam, errno); + return NULL; + } + + arr = (char **)zhalloc(3 * sizeof(*arr)); + sprintf(buf, "%ld", (long)now.tv_sec); + arr[0] = dupstring(buf); + sprintf(buf, "%ld", now.tv_nsec); + arr[1] = dupstring(buf); + arr[2] = NULL; + + return arr; +#else + struct timeval now; + struct timezone dummy_tz; + + (void)pm; + gettimeofday(&now, &dummy_tz); + + arr = (char **)zhalloc(3 * sizeof(*arr)); + sprintf(buf, "%ld", (long)now.tv_sec); + arr[0] = dupstring(buf); + sprintf(buf, "%ld", (long)now.tv_usec * 1000); + arr[1] = dupstring(buf); + arr[2] = NULL; + + return arr; +#endif +} + static struct builtin bintab[] = { BUILTIN("strftime", 0, bin_strftime, 2, 2, 0, "qrs:", NULL), }; @@ -158,9 +221,19 @@ static const struct gsu_integer epochseconds_gsu = { getcurrentsecs, NULL, stdunsetfn }; +static const struct gsu_float epochrealtime_gsu = +{ getcurrentrealtime, NULL, stdunsetfn }; + +static const struct gsu_array epochtime_gsu = +{ getcurrenttime, NULL, stdunsetfn }; + static struct paramdef patab[] = { SPECIALPMDEF("EPOCHSECONDS", PM_INTEGER|PM_READONLY, &epochseconds_gsu, NULL, NULL), + SPECIALPMDEF("EPOCHREALTIME", PM_FFLOAT|PM_READONLY, + &epochrealtime_gsu, NULL, NULL), + SPECIALPMDEF("epochtime", PM_ARRAY|PM_READONLY, + &epochtime_gsu, NULL, NULL) }; static struct features module_features = { diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/datetime.mdd zsh-beta-4.3.12-dev-1+20110925/Src/Modules/datetime.mdd --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/datetime.mdd 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/datetime.mdd 2011-10-02 01:10:11.000000000 +0000 @@ -4,6 +4,6 @@ load=no functions='Functions/Calendar/*' -autofeatures="b:strftime p:EPOCHSECONDS" +autofeatures="b:strftime p:EPOCHSECONDS p:EPOCHREALTIME p:epochtime" objects="datetime.o" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/db_gdbm.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/db_gdbm.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/db_gdbm.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/db_gdbm.c 2011-10-02 01:10:11.000000000 +0000 @@ -39,7 +39,9 @@ #include +#if 0 /* what is this for? */ static char *backtype = "db/gdbm"; +#endif static const struct gsu_scalar gdbm_gsu = { gdbmgetfn, gdbmsetfn, gdbmunsetfn }; @@ -138,7 +140,6 @@ gdbmsetfn(Param pm, char *val) { datum key, content; - int ret; GDBM_FILE dbf; key.dptr = pm->node.nam; @@ -147,7 +148,7 @@ content.dsize = strlen(content.dptr) + 1; dbf = (GDBM_FILE)(pm->u.hash->tmpdata); - ret = gdbm_store(dbf, key, content, GDBM_REPLACE); + (void)gdbm_store(dbf, key, content, GDBM_REPLACE); } /**/ @@ -155,14 +156,13 @@ gdbmunsetfn(Param pm, int um) { datum key; - int ret; GDBM_FILE dbf; key.dptr = pm->node.nam; key.dsize = strlen(key.dptr) + 1; dbf = (GDBM_FILE)(pm->u.hash->tmpdata); - ret = gdbm_delete(dbf, key); + (void)gdbm_delete(dbf, key); } /**/ @@ -171,12 +171,10 @@ { int len; char *nameu; - datum key; Param pm = NULL; nameu = dupstring(name); unmetafy(nameu, &len); - key.dptr = nameu; pm = (Param) hcalloc(sizeof(struct param)); pm->node.nam = nameu; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/files.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/files.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/files.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/files.c 2011-10-02 01:10:11.000000000 +0000 @@ -195,7 +195,7 @@ static int bin_ln(char *nam, char **args, Options ops, int func) { - MoveFunc move; + MoveFunc movefn; int flags, have_dir, err = 0; char **a, *ptr, *rp, *buf; struct stat st; @@ -203,7 +203,7 @@ if(func == BIN_MV) { - move = (MoveFunc) rename; + movefn = (MoveFunc) rename; flags = OPT_ISSET(ops,'f') ? 0 : MV_ASKNW; flags |= MV_ATOMIC; } else { @@ -212,11 +212,11 @@ if(OPT_ISSET(ops,'h') || OPT_ISSET(ops,'n')) flags |= MV_NOCHASETARGET; if(OPT_ISSET(ops,'s')) - move = (MoveFunc) symlink; + movefn = (MoveFunc) symlink; else #endif { - move = (MoveFunc) link; + movefn = (MoveFunc) link; if(!OPT_ISSET(ops,'d')) flags |= MV_NODIRS; } @@ -267,7 +267,7 @@ else args[1] = args[0]; } - return domove(nam, move, args[0], args[1], flags); + return domove(nam, movefn, args[0], args[1], flags); havedir: buf = ztrdup(*a); *a = NULL; @@ -283,7 +283,7 @@ buf[blen] = 0; buf = appstr(buf, ptr); - err |= domove(nam, move, *args, buf, flags); + err |= domove(nam, movefn, *args, buf, flags); } zsfree(buf); return err; @@ -291,7 +291,7 @@ /**/ static int -domove(char *nam, MoveFunc move, char *p, char *q, int flags) +domove(char *nam, MoveFunc movefn, char *p, char *q, int flags) { struct stat st; char *pbuf, *qbuf; @@ -341,7 +341,7 @@ if(doit && !(flags & MV_ATOMIC)) unlink(qbuf); } - if(move(pbuf, qbuf)) { + if(movefn(pbuf, qbuf)) { zwarnnam(nam, "%s: %e", p, errno); zsfree(pbuf); return 1; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/termcap.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/termcap.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/termcap.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/termcap.c 2011-10-02 01:10:11.000000000 +0000 @@ -35,34 +35,11 @@ */ #include "../../config.h" -#ifdef HAVE_TGETENT -# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H) -# define USES_TERM_H 1 -# else -# ifdef HAVE_TERMCAP_H -# define USES_TERMCAP_H 1 -# endif -# endif -#endif - #include "termcap.mdh" #include "termcap.pro" /**/ #ifdef HAVE_TGETENT -# ifdef USES_TERM_H -# ifdef HAVE_TERMIO_H -# include -# endif -# ifdef ZSH_HAVE_CURSES_H -# include "../zshcurses.h" -# endif -# include "../zshterm.h" -# else -# ifdef USES_TERMCAP_H -# include -# endif -# endif #ifndef HAVE_BOOLCODES static char *boolcodes[] = { diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zftp.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zftp.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zftp.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zftp.c 2011-10-02 01:10:11.000000000 +0000 @@ -50,6 +50,7 @@ typedef struct zftp_session *Zftp_session; #include "tcp.h" +#include "tcp.mdh" #include "zftp.mdh" #include "zftp.pro" diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zpty.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zpty.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zpty.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zpty.c 2011-10-02 01:10:11.000000000 +0000 @@ -351,8 +351,8 @@ struct ttyinfo info; if (ioctl(slave, TIOCGWINSZ, (char *) &info.winsize) == 0) { - info.winsize.ws_row = lines; - info.winsize.ws_col = columns; + info.winsize.ws_row = zterm_lines; + info.winsize.ws_col = zterm_columns; ioctl(slave, TIOCSWINSZ, (char *) &info.winsize); } } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zutil.c zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zutil.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Modules/zutil.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Modules/zutil.c 2011-10-02 01:10:11.000000000 +0000 @@ -1405,6 +1405,8 @@ #define ZOF_OPT 2 #define ZOF_MULT 4 #define ZOF_SAME 8 +#define ZOF_MAP 16 +#define ZOF_CYC 32 struct zoptarr { Zoptarr next; @@ -1459,6 +1461,34 @@ return NULL; } +static Zoptdesc +map_opt_desc(Zoptdesc start) +{ + Zoptdesc map = NULL; + + if (!start || !(start->flags & ZOF_MAP)) + return start; + + map = get_opt_desc(start->arr->name); + + if (!map) + return start; + + if (map == start) { + start->flags &= ~ZOF_MAP; /* optimize */ + return start; + } + + if (map->flags & ZOF_CYC) + return NULL; + + start->flags |= ZOF_CYC; + map = map_opt_desc(map); + start->flags &= ~ZOF_CYC; + + return map; +} + static void add_opt_val(Zoptdesc d, char *arg) { @@ -1466,6 +1496,10 @@ char *n = dyncat("-", d->name); int new = 0; + Zoptdesc map = map_opt_desc(d); + if (map) + d = map; + if (!(d->flags & ZOF_MULT)) v = d->vals; if (!v) { @@ -1513,7 +1547,7 @@ bin_zparseopts(char *nam, char **args, UNUSED(Options ops), UNUSED(int func)) { char *o, *p, *n, **pp, **aval, **ap, *assoc = NULL, **cp, **np; - int del = 0, f, extract = 0, keep = 0; + int del = 0, flags = 0, extract = 0, keep = 0; Zoptdesc sopts[256], d; Zoptarr a, defarr = NULL; Zoptval v; @@ -1531,6 +1565,7 @@ case '-': if (o[2]) args--; + /* else unreachable, default parsing removes "--" */ o = NULL; break; case 'D': @@ -1557,6 +1592,14 @@ } keep = 1; break; + case 'M': + if (o[2]) { + args--; + o = NULL; + break; + } + flags |= ZOF_MAP; + break; case 'a': if (defarr) { zwarnnam(nam, "default array given more than once"); @@ -1578,6 +1621,10 @@ opt_arrs = defarr; break; case 'A': + if (assoc) { + zwarnnam(nam, "associative array given more than once"); + return 1; + } if (o[2]) assoc = o + 2; else if (*args) @@ -1587,6 +1634,11 @@ return 1; } break; + default: + /* Anything else is an option description */ + args--; + o = NULL; + break; } if (!o) { o = ""; @@ -1602,11 +1654,11 @@ return 1; } while ((o = dupstring(*args++))) { + int f = 0; if (!*o) { zwarnnam(nam, "invalid option description: %s", o); return 1; } - f = 0; for (p = o; *p; p++) { if (*p == '\\' && p[1]) p++; @@ -1633,6 +1685,7 @@ a = NULL; if (*p == '=') { *p++ = '\0'; + f |= flags; if (!(a = get_opt_arr(p))) { a = (Zoptarr) zhalloc(sizeof(*a)); a->name = p; @@ -1666,6 +1719,10 @@ opt_descs = d; if (!o[1]) sopts[STOUC(*o)] = d; + if ((flags & ZOF_MAP) && !map_opt_desc(d)) { + zwarnnam(nam, "cyclic option mapping: %s", args[-1]); + return 1; + } } np = cp = pp = ((extract && del) ? arrdup(pparams) : pparams); for (; (o = *pp); pp++) { @@ -1732,12 +1789,20 @@ add_opt_val(d, NULL); } } + + if (flags & ZOF_MAP) { + for (d = opt_descs; d; d = d->next) + if (d->arr && !d->vals && (d->flags & ZOF_MAP)) { + if (d->arr->num == 0 && get_opt_desc(d->arr->name)) + d->arr->num = -1; /* this is not a real array */ + } + } if (extract && del) while (*pp) *cp++ = *pp++; for (a = opt_arrs; a; a = a->next) { - if (!keep || a->num) { + if (a->num >= 0 && (!keep || a->num)) { aval = (char **) zalloc((a->num + 1) * sizeof(char *)); for (ap = aval, v = a->vals; v; ap++, v = v->next) { if (v->str) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/params.c zsh-beta-4.3.12-dev-1+20110925/Src/params.c --- zsh-beta-4.3.11-dev-1+20110504/Src/params.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/params.c 2011-10-02 01:10:11.000000000 +0000 @@ -86,6 +86,7 @@ char *ifs, /* $IFS */ *postedit, /* $POSTEDIT */ *term, /* $TERM */ + *zsh_terminfo, /* $TERMINFO */ *ttystrname, /* $TTY */ *pwd; /* $PWD */ @@ -94,8 +95,8 @@ zlong lastval, /* $? */ mypid, /* $$ */ lastpid, /* $! */ - columns, /* $COLUMNS */ - lines, /* $LINES */ + zterm_columns, /* $COLUMNS */ + zterm_lines, /* $LINES */ ppid, /* $PPID */ zsh_subshell; /* $ZSH_SUBSHELL */ /**/ @@ -202,6 +203,8 @@ { homegetfn, homesetfn, stdunsetfn }; static const struct gsu_scalar term_gsu = { termgetfn, termsetfn, stdunsetfn }; +static const struct gsu_scalar terminfo_gsu = +{ terminfogetfn, terminfosetfn, stdunsetfn }; static const struct gsu_scalar wordchars_gsu = { wordcharsgetfn, wordcharssetfn, stdunsetfn }; static const struct gsu_scalar ifs_gsu = @@ -276,6 +279,7 @@ IPDEF2("histchars", histchars_gsu, PM_DONTIMPORT), IPDEF2("HOME", home_gsu, PM_UNSET), IPDEF2("TERM", term_gsu, 0), +IPDEF2("TERMINFO", terminfo_gsu, PM_UNSET), IPDEF2("WORDCHARS", wordchars_gsu, 0), IPDEF2("IFS", ifs_gsu, PM_DONTIMPORT), IPDEF2("_", underscore_gsu, PM_READONLY), @@ -312,8 +316,8 @@ IPDEF4("ZSH_SUBSHELL", &zsh_subshell), #define IPDEF5(A,B,F) {{NULL,A,PM_INTEGER|PM_SPECIAL},BR((void *)B),GSU(varinteger_gsu),10,0,NULL,NULL,NULL,0} -IPDEF5("COLUMNS", &columns, zlevar_gsu), -IPDEF5("LINES", &lines, zlevar_gsu), +IPDEF5("COLUMNS", &zterm_columns, zlevar_gsu), +IPDEF5("LINES", &zterm_lines, zlevar_gsu), IPDEF5("OPTIND", &zoptind, varinteger_gsu), IPDEF5("SHLVL", &shlvl, varinteger_gsu), IPDEF5("TRY_BLOCK_ERROR", &try_errflag, varinteger_gsu), @@ -651,7 +655,10 @@ char **new_environ; int envsize; #endif - char **envp, **envp2, **sigptr, **t; +#ifndef USE_SET_UNSET_ENV + char **envp; +#endif + char **envp2, **sigptr, **t; char buf[50], *str, *iname, *ivalue, *hostnam; int oae = opts[ALLEXPORT]; #ifdef HAVE_UNAME @@ -717,7 +724,11 @@ /* Now incorporate environment variables we are inheriting * * into the parameter hash table. Copy them into dynamic * * memory so that we can free them if needed */ - for (envp = envp2 = environ; *envp2; envp2++) { + for ( +#ifndef USE_SET_UNSET_ENV + envp = +#endif + envp2 = environ; *envp2; envp2++) { if (split_env_string(*envp2, &iname, &ivalue)) { if (!idigit(*iname) && isident(iname) && !strchr(iname, '[')) { if ((!(pm = (Param) paramtab->getnode(paramtab, iname)) || @@ -974,7 +985,7 @@ * called from inside an associative array), we need the gets and sets * functions to be useful. * - * In this case we assume the the saved parameter is not itself special, + * In this case we assume the saved parameter is not itself special, * so we just use the standard functions. This is also why we switch off * PM_SPECIAL. */ @@ -989,9 +1000,7 @@ isident(char *s) { char *ss; - int ne; - ne = noeval; /* save the current value of noeval */ if (!*s) /* empty string is definitely not valid */ return 0; @@ -3037,9 +3046,21 @@ stdunsetfn(Param pm, UNUSED(int exp)) { switch (PM_TYPE(pm->node.flags)) { - case PM_SCALAR: pm->gsu.s->setfn(pm, NULL); break; - case PM_ARRAY: pm->gsu.a->setfn(pm, NULL); break; - case PM_HASHED: pm->gsu.h->setfn(pm, NULL); break; + case PM_SCALAR: + if (pm->gsu.s->setfn) + pm->gsu.s->setfn(pm, NULL); + break; + + case PM_ARRAY: + if (pm->gsu.a->setfn) + pm->gsu.a->setfn(pm, NULL); + break; + + case PM_HASHED: + if (pm->gsu.h->setfn) + pm->gsu.h->setfn(pm, NULL); + break; + default: if (!(pm->node.flags & PM_SPECIAL)) pm->u.str = NULL; @@ -3269,8 +3290,8 @@ zlong *p = pm->u.valptr; *p = x; - if (p == &lines || p == &columns) - adjustwinsize(2 + (p == &columns)); + if (p == &zterm_lines || p == &zterm_columns) + adjustwinsize(2 + (p == &zterm_columns)); } /* Function to set value of generic special scalar * @@ -4045,6 +4066,18 @@ return u; } +/* Function used when we need to reinitialise the terminal */ + +static void +term_reinit_from_pm(void) +{ + /* If non-interactive, delay setting up term till we need it. */ + if (unset(INTERACTIVE) || !*term) + termflags |= TERM_UNKNOWN; + else + init_term(); +} + /* Function to get value for special parameter `TERM' */ /**/ @@ -4062,12 +4095,35 @@ { zsfree(term); term = x ? x : ztrdup(""); + term_reinit_from_pm(); +} - /* If non-interactive, delay setting up term till we need it. */ - if (unset(INTERACTIVE) || !*term) - termflags |= TERM_UNKNOWN; - else - init_term(); +/* Function to get value of special parameter `TERMINFO' */ + +/**/ +char * +terminfogetfn(UNUSED(Param pm)) +{ + return zsh_terminfo ? zsh_terminfo : dupstring(""); +} + +/* Function to set value of special parameter `TERMINFO' */ + +/**/ +void +terminfosetfn(Param pm, char *x) +{ + zsfree(zsh_terminfo); + zsh_terminfo = x; + + /* + * terminfo relies on the value being exported before + * we reinitialise the terminal. This is a bit inefficient. + */ + if ((pm->node.flags & PM_EXPORTED) && x) + addenv(pm, x); + + term_reinit_from_pm(); } /* Function to get value for special parameter `pipestatus' */ @@ -4149,6 +4205,7 @@ int zputenv(char *str) { + DPUTS(!str, "Attempt to put null string into environment."); #ifdef USE_SET_UNSET_ENV /* * If we are using unsetenv() to remove values from the diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/parse.c zsh-beta-4.3.12-dev-1+20110925/Src/parse.c --- zsh-beta-4.3.11-dev-1+20110504/Src/parse.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/parse.c 2011-10-02 01:10:11.000000000 +0000 @@ -1465,6 +1465,10 @@ ecssub = oecssub; YYERRORV(oecused); } + if (num == 0) { + /* Anonymous function, possibly with arguments */ + incmdpos = 0; + } zshlex(); } else if (unset(SHORTLOOPS)) { lineno += oldlineno; @@ -1480,12 +1484,25 @@ ecbuf[p + num + 4] = ecnpats; ecbuf[p + 1] = num; - lineno += oldlineno; ecnpats = onp; ecssub = oecssub; ecnfunc++; ecbuf[p] = WCB_FUNCDEF(ecused - 1 - p); + + if (num == 0) { + /* Unnamed function */ + int parg = ecadd(0); + ecadd(0); + while (tok == STRING) { + ecstr(tokstr); + num++; + zshlex(); + } + ecbuf[parg] = ecused - parg; /*?*/ + ecbuf[parg+1] = num; + } + lineno += oldlineno; } /* @@ -1707,13 +1724,17 @@ ecssub = oecssub; YYERROR(oecused); } + if (argc == 0) { + /* Anonymous function, possibly with arguments */ + incmdpos = 0; + } zshlex(); } else { - int ll, sl, pl, c = 0; + int ll, sl, c = 0; ll = ecadd(0); sl = ecadd(0); - pl = ecadd(WCB_PIPE(WC_PIPE_END, 0)); + (void)ecadd(WCB_PIPE(WC_PIPE_END, 0)); if (!par_cmd(&c)) { cmdpop(); @@ -1730,13 +1751,26 @@ ecbuf[p + argc + 3] = ecsoffs - so; ecbuf[p + argc + 4] = ecnpats; - lineno += oldlineno; ecnpats = onp; ecssub = oecssub; ecnfunc++; ecbuf[p] = WCB_FUNCDEF(ecused - 1 - p); + if (argc == 0) { + /* Unnamed function */ + int parg = ecadd(0); + ecadd(0); + while (tok == STRING) { + ecstr(tokstr); + argc++; + zshlex(); + } + ecbuf[parg] = ecused - parg; /*?*/ + ecbuf[parg+1] = argc; + } + lineno += oldlineno; + isfunc = 1; isnull = 0; break; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/prompt.c zsh-beta-4.3.12-dev-1+20110925/Src/prompt.c --- zsh-beta-4.3.11-dev-1+20110504/Src/prompt.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/prompt.c 2011-10-02 01:10:11.000000000 +0000 @@ -1008,7 +1008,7 @@ #endif for (; *str; str++) { - if (w >= columns && overf >= 0) { + if (w >= zterm_columns && overf >= 0) { w = 0; h++; } @@ -1092,8 +1092,8 @@ * This isn't easy to handle generally; just assume there's no * output. */ - if(w >= columns && overf >= 0) { - if (!overf || w > columns) { + if(w >= zterm_columns && overf >= 0) { + if (!overf || w > zterm_columns) { w = 0; h++; } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/signals.c zsh-beta-4.3.12-dev-1+20110925/Src/signals.c --- zsh-beta-4.3.11-dev-1+20110504/Src/signals.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/signals.c 2011-10-02 01:10:11.000000000 +0000 @@ -489,16 +489,24 @@ * Find the process and job containing this pid and * update it. */ - pn = NULL; if (findproc(pid, &jn, &pn, 0)) { + if (((jn->stat & STAT_BUILTIN) || + (list_pipe && + (thisjob == -1 || + (jobtab[thisjob].stat & STAT_BUILTIN)))) && + WIFSTOPPED(status) && WSTOPSIG(status) == SIGTSTP) { + killjb(jn, SIGCONT); + zwarn("job can't be suspended"); + } else { #if defined(HAVE_WAIT3) && defined(HAVE_GETRUSAGE) - struct timezone dummy_tz; - gettimeofday(&pn->endtime, &dummy_tz); - pn->status = status; - pn->ti = ru; + struct timezone dummy_tz; + gettimeofday(&pn->endtime, &dummy_tz); + pn->status = status; + pn->ti = ru; #else - update_process(pn, status); + update_process(pn, status); #endif + } update_job(jn); } else if (findproc(pid, &jn, &pn, 1)) { pn->status = status; @@ -1185,7 +1193,7 @@ traplocallevel = locallevel; runhookdef(BEFORETRAPHOOK, NULL); if (*sigtr & ZSIG_FUNC) { - int osc = sfcontext; + int osc = sfcontext, old_incompfunc = incompfunc; HashNode hn = gettrapnode(sig, 0); args = znewlinklist(); @@ -1211,8 +1219,10 @@ trapisfunc = isfunc = 1; sfcontext = SFC_SIGNAL; + incompfunc = 0; doshfunc((Shfunc)sigfn, args, 1); sfcontext = osc; + incompfunc= old_incompfunc; freelinklist(args, (FreeFunc) NULL); zsfree(name); } else { diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/subst.c zsh-beta-4.3.12-dev-1+20110925/Src/subst.c --- zsh-beta-4.3.11-dev-1+20110504/Src/subst.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/subst.c 2011-10-02 01:10:11.000000000 +0000 @@ -162,6 +162,8 @@ subst = getproc(str, &rest); /* <(...) or >(...) */ else subst = getoutputfile(str, &rest); /* =(...) */ + if (errflag) + return NULL; if (!subst) subst = ""; @@ -1594,7 +1596,7 @@ int arrasg = 0; /* * The (e) flag. As we need to do extra work not quite - * at the end, the effect of this is kludged in in several places. + * at the end, the effect of this is kludged in several places. */ int eval = 0; /* @@ -1607,11 +1609,15 @@ */ int presc = 0; /* + * The (g) flag. Process escape sequences with various GETKEY_ flags. + */ + int getkeys = -1; + /* * The (@) flag; interacts obscurely with qt and isarr. * This is one of the things that decides whether multsub * will produce an array, but in an extremely indirect fashion. */ - int nojoin = 0; + int nojoin = isset(SHWORDSPLIT) ? !(ifs && *ifs) : 0; /* * != 0 means ${...}, otherwise $... What works without braces * is largely a historical artefact (everything works with braces, @@ -1717,7 +1723,7 @@ ++arrasg; break; case '@': - nojoin = 1; + nojoin = 2; /* nojoin = 2 means force */ break; case 'M': flags |= SUB_MATCH; @@ -1932,6 +1938,36 @@ presc++; break; + case 'g': + t = get_strarg(++s, &arglen); + if (getkeys < 0) + getkeys = 0; + if (*t) { + sav = *t; + *t = 0; + while (*++s) { + switch (*s) { + case 'e': + getkeys |= GETKEY_EMACS; + break; + case 'o': + getkeys |= GETKEY_OCTAL_ESC; + break; + case 'c': + getkeys |= GETKEY_CTRL; + break; + + default: + *t = sav; + goto flagerr; + } + } + *t = sav; + s = t + arglen - 1; + } else + goto flagerr; + break; + case 'z': shsplit = LEXFLAGS_ACTIVE; break; @@ -2033,15 +2069,29 @@ /* SH_WORD_SPLIT on or off (doubled). spbreak = 2 means force */ if ((c = *++s) == '=' || c == Equals) { spbreak = 0; + if (nojoin < 2) + nojoin = 0; s++; - } else + } else { spbreak = 2; + if (nojoin < 2) + nojoin = !(ifs && *ifs); + } } else if ((c == '#' || c == Pound) && (itype_end(s+1, IIDENT, 0) != s + 1 || (cc = s[1]) == '*' || cc == Star || cc == '@' || cc == '?' || cc == Quest || cc == '$' || cc == String || cc == Qstring - || cc == '#' || cc == Pound + /* + * Me And My Squiggle: + * ${##} is the length of $#, but ${##foo} + * is $# with a "foo" removed from the start. + * If someone had defined the *@!@! language + * properly in the first place we wouldn't + * have this nonsense. + */ + || ((cc == '#' || cc == Pound) && + s[2] == Outbrace) || cc == '-' || (cc == ':' && s[2] == '-') || (isstring(cc) && (s[2] == Inbrace || s[2] == Inpar)))) { getlen = 1 + whichlen, s++; @@ -2653,33 +2703,35 @@ *idend = sav; copied = 1; if (isarr) { - if (nojoin) - isarr = -1; - if (qt && !getlen && isarr > 0 && !spsep && spbreak < 2) { - val = sepjoin(aval, sep, 1); - isarr = 0; - } - sep = spsep = NULL; - spbreak = 0; + if (nojoin) + isarr = -1; + if (qt && !getlen && isarr > 0 && !spsep && spbreak < 2) { + val = sepjoin(aval, sep, 1); + isarr = 0; + } + sep = spsep = NULL; + spbreak = 0; } } break; case '?': case Quest: if (vunset) { - *idend = '\0'; - zerr("%s: %s", idbeg, *s ? s : "parameter not set"); - if (!interact) { - if (mypid == getpid()) { - /* - * paranoia: don't check for jobs, but there shouldn't - * be any if not interactive. - */ - stopmsg = 1; - zexit(1, 0); - } else - _exit(1); - } + if (isset(EXECOPT)) { + *idend = '\0'; + zerr("%s: %s", idbeg, *s ? s : "parameter not set"); + if (!interact) { + if (mypid == getpid()) { + /* + * paranoia: don't check for jobs, but there + * shouldn't be any if not interactive. + */ + stopmsg = 1; + zexit(1, 0); + } else + _exit(1); + } + } return NULL; } break; @@ -2800,7 +2852,8 @@ char *check_offset = check_colon_subscript(s, &check_offset2); if (check_offset) { zlong offset = mathevali(check_offset); - zlong length = (zlong)-1; + zlong length = 0; + int length_set = 0; int offset_hack_argzero = 0; if (errflag) return NULL; @@ -2815,14 +2868,11 @@ zerr("invalid length: %s", check_offset); return NULL; } - if (check_offset) { + if (check_offset) { length = mathevali(check_offset); + length_set = 1; if (errflag) return NULL; - if (length < (zlong)0) { - zerr("invalid length: %s", check_offset); - return NULL; - } } } if (horrible_offset_hack) { @@ -2850,8 +2900,16 @@ } if (offset_hack_argzero) alen++; - if (length < 0) - length = alen; + if (length_set) { + if (length < 0) + length += alen - offset; + if (length < 0) { + zerr("substring expression: %d < %d", + (int)(length + offset), (int)offset); + return NULL; + } + } else + length = alen; if (offset > alen) offset = alen; if (offset + length > alen) @@ -2870,6 +2928,7 @@ aval = newarr; } else { char *sptr, *eptr; + int given_offset; if (offset < 0) { MB_METACHARINIT(); for (sptr = val; *sptr; ) { @@ -2879,12 +2938,28 @@ if (offset < 0) offset = 0; } + given_offset = offset; MB_METACHARINIT(); + if (length_set && length < 0) + length -= offset; for (sptr = val; *sptr && offset; ) { sptr += MB_METACHARLEN(sptr); offset--; } - if (length >= 0) { + if (length_set) { + if (length < 0) { + MB_METACHARINIT(); + for (eptr = val; *eptr; ) { + eptr += MB_METACHARLEN(eptr); + length++; + } + if (length < 0) { + zerr("substring expression: %d < %d", + (int)(length + given_offset), + (int)given_offset); + return NULL; + } + } for (eptr = sptr; *eptr && length; ) { eptr += MB_METACHARLEN(eptr); length--; @@ -2982,7 +3057,7 @@ * TODO: again. one might naively have thought this had the * same sort of effect as the ${(t)...} flag and the ${+...} * test, although in this case we do need the value rather - * the the parameter, so maybe it's a bit different. + * the parameter, so maybe it's a bit different. */ if (getlen) { long len = 0; @@ -3018,7 +3093,7 @@ /* At this point we make sure that our arrayness has affected the * arrayness of the linked list. Then, we can turn our value into * a scalar for convenience sake without affecting the arrayness - * of the resulting value. */ + * of the resulting value. ## This is the YUK chunk. ## */ if (isarr) l->list.flags |= LF_ARRAY; else @@ -3040,7 +3115,7 @@ * done any requested splitting of the word value with quoting preserved. * "ssub" is true when we are called from singsub (via prefork): * it means that we must join arrays and should not split words. */ - if (ssub || spbreak || spsep || sep) { + if (ssub || (spbreak && isarr >= 0) || spsep || sep) { if (isarr) { val = sepjoin(aval, sep, 1); isarr = 0; @@ -3078,6 +3153,28 @@ } } /* + * Process echo- and print-style escape sequences. + */ + if (getkeys >= 0) { + int len; + + copied = 1; /* string is always copied */ + if (isarr) { + char **ap, **ap2; + + ap = aval; + aval = (char **) zhalloc(sizeof(char *) * (arrlen(aval)+1)); + for (ap2 = aval; *ap; ap++, ap2++) { + *ap2 = getkeystring(*ap, &len, getkeys, NULL); + *ap2 = metafy(*ap2, len, META_USEHEAP); + } + *ap2++ = NULL; + } else { + val = getkeystring(val, &len, getkeys, NULL); + val = metafy(val, len, META_USEHEAP); + } + } + /* * Perform prompt-style modifications. */ if (presc) { diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/system.h zsh-beta-4.3.12-dev-1+20110925/Src/system.h --- zsh-beta-4.3.11-dev-1+20110504/Src/system.h 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/system.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,852 +0,0 @@ -/* - * system.h - system configuration header file - * - * This file is part of zsh, the Z shell. - * - * Copyright (c) 1992-1997 Paul Falstad - * All rights reserved. - * - * Permission is hereby granted, without written agreement and without - * license or royalty fees, to use, copy, modify, and distribute this - * software and to distribute modified versions of this software for any - * purpose, provided that the above copyright notice and the following - * two paragraphs appear in all copies of this software. - * - * In no event shall Paul Falstad or the Zsh Development Group be liable - * to any party for direct, indirect, special, incidental, or consequential - * damages arising out of the use of this software and its documentation, - * even if Paul Falstad and the Zsh Development Group have been advised of - * the possibility of such damage. - * - * Paul Falstad and the Zsh Development Group specifically disclaim any - * warranties, including, but not limited to, the implied warranties of - * merchantability and fitness for a particular purpose. The software - * provided hereunder is on an "as is" basis, and Paul Falstad and the - * Zsh Development Group have no obligation to provide maintenance, - * support, updates, enhancements, or modifications. - * - */ - -#if 0 -/* - * Setting _XPG_IV here is actually wrong and is not needed - * with currently supported versions (5.43C20 and above) - */ -#ifdef sinix -# define _XPG_IV 1 -#endif -#endif - -#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL) -/* - * Turn on numerous extensions. - * This is in order to get the functions for manipulating /dev/ptmx. - */ -#define _GNU_SOURCE 1 -#endif -#ifdef LIBC_MUSL -#define _POSIX_C_SOURCE 200809L -#endif - -/* NeXT has half-implemented POSIX support * - * which currently fools configure */ -#ifdef __NeXT__ -# undef HAVE_TERMIOS_H -# undef HAVE_SYS_UTSNAME_H -#endif - -#ifndef ZSH_NO_XOPEN -# ifdef ZSH_CURSES_SOURCE -# define _XOPEN_SOURCE_EXTENDED 1 -# else -# ifdef MULTIBYTE_SUPPORT -/* - * Needed for wcwidth() which is part of XSI. - * Various other uses of the interface mean we can't get away with just - * _XOPEN_SOURCE. - */ -# define _XOPEN_SOURCE_EXTENDED 1 -# endif /* MULTIBYTE_SUPPORT */ -# endif /* ZSH_CURSES_SOURCE */ -#endif /* ZSH_NO_XOPEN */ - -/* - * Solaris by default zeroes all elements of the tm structure in - * strptime(). Unfortunately that gives us no way of telling whether - * the tm_isdst element has been set from the input pattern. If it - * hasn't we want it to be -1 (undetermined) on input to mktime(). So - * we stop strptime() zeroing the struct tm and instead set all the - * elements ourselves. - * - * This is likely to be harmless everywhere else. - */ -#define _STRPTIME_DONTZERO - -#ifdef PROTOTYPES -# define _(Args) Args -#else -# define _(Args) () -#endif - -#ifndef HAVE_ALLOCA -# define alloca zhalloc -#else -# ifdef __GNUC__ -# define alloca __builtin_alloca -# else -# if HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - # pragma alloca -# else -# ifndef alloca -char *alloca _((size_t)); -# endif -# endif -# endif -# endif -#endif - -/* - * libc.h in an optional package for Debian Linux is broken (it - * defines dup() as a synonym for dup2(), which has a different - * number of arguments), so just include it for next. - */ -#ifdef __NeXT__ -# ifdef HAVE_LIBC_H -# include -# endif -#endif - -#ifdef HAVE_SYS_TYPES_H -# include -#endif - -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_STDDEF_H -/* - * Seen on Solaris 8 with gcc: stddef defines offsetof, which clashes - * with system.h's definition of the symbol unless we include this - * first. Otherwise, this will be hooked in by wchar.h, too late - * for comfort. - */ -#include -#endif - -#include -#include -#include -#include -#include - -#ifdef HAVE_PWD_H -# include -#endif - -#ifdef HAVE_GRP_H -# include -#endif - -#ifdef HAVE_DIRENT_H -# include -#else /* !HAVE_DIRENT_H */ -# ifdef HAVE_SYS_NDIR_H -# include -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# endif -# define dirent direct -# undef HAVE_STRUCT_DIRENT_D_INO -# undef HAVE_STRUCT_DIRENT_D_STAT -# ifdef HAVE_STRUCT_DIRECT_D_INO -# define HAVE_STRUCT_DIRENT_D_INO HAVE_STRUCT_DIRECT_D_INO -# endif -# ifdef HAVE_STRUCT_DIRECT_D_STAT -# define HAVE_STRUCT_DIRENT_D_STAT HAVE_STRUCT_DIRECT_D_STAT -# endif -#endif /* !HAVE_DIRENT_H */ - -#ifdef HAVE_STDLIB_H -# ifdef ZSH_MEM - /* malloc and calloc are macros in GNU's stdlib.h unless the - * the __MALLOC_0_RETURNS_NULL macro is defined */ -# define __MALLOC_0_RETURNS_NULL -# endif -# include -#endif - -/* - * Stuff with variable arguments. We use definitions to make the - * same code work with varargs (the original K&R-style, just to - * be maximally compatible) and stdarg (which all modern systems - * should have). - * - * Ideally this should somehow be merged with the tricks performed - * with "_" in makepro.awk, but I don't understand makepro.awk. - * Currently we simply rely on the fact that makepro.awk has been - * hacked to leave alone argument lists that already contains VA_ALIST - * except for removing the VA_DCL and turning VA_ALIST into VA_ALIST_PROTO. - */ -#ifdef HAVE_STDARG_H -# include -# define VA_ALIST1(x) x, ... -# define VA_ALIST2(x,y) x, y, ... -# define VA_ALIST_PROTO1(x) VA_ALIST1(x) -# define VA_ALIST_PROTO2(x,y) VA_ALIST2(x,y) -# define VA_DCL -# define VA_DEF_ARG(x) -# define VA_START(ap,x) va_start(ap, x) -# define VA_GET_ARG(ap,x,t) -#else -# if HAVE_VARARGS_H -# include -# define VA_ALIST1(x) va_alist -# define VA_ALIST2(x,y) va_alist -/* - * In prototypes, assume K&R form and remove the variable list. - * This is about the best we can do without second-guessing the way - * varargs works on this system. The _ trick should be able to - * do this for us but we've turned it off here. - */ -# define VA_ALIST_PROTO1(x) -# define VA_ALIST_PROTO2(x,y) -# define VA_DCL va_dcl -# define VA_DEF_ARG(x) x -# define VA_START(ap,x) va_start(ap); -# define VA_GET_ARG(ap,x,t) (x = va_arg(ap, t)) -# else -# error "Your system has neither stdarg.h or varargs.h." -# endif -#endif - -#ifdef HAVE_ERRNO_H -# include -#endif - -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# endif -#endif - -/* This is needed by some old SCO unices */ -#if !defined(HAVE_STRUCT_TIMEZONE) && !defined(ZSH_OOT_MODULE) -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; -#endif - -/* There's more than one non-standard way to get at this data */ -#if !defined(HAVE_STRUCT_DIRENT_D_INO) && defined(HAVE_STRUCT_DIRENT_D_STAT) -# define d_ino d_stat.st_ino -# define HAVE_STRUCT_DIRENT_D_INO HAVE_STRUCT_DIRENT_D_STAT -#endif /* !HAVE_STRUCT_DIRENT_D_INO && HAVE_STRUCT_DIRENT_D_STAT */ - -/* Sco needs the following include for struct utimbuf * - * which is strange considering we do not use that * - * anywhere in the code */ -#ifdef __sco -# include -#endif - -#ifdef HAVE_SYS_TIMES_H -# include -#endif - -#if STDC_HEADERS || HAVE_STRING_H -# include -/* An ANSI string.h and pre-ANSI memory.h might conflict. */ -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ -#else /* not STDC_HEADERS and not HAVE_STRING_H */ -# include -/* memory.h and strings.h conflict on some systems. */ -#endif /* not STDC_HEADERS and not HAVE_STRING_H */ - -#ifdef HAVE_LOCALE_H -# include -#endif - -#ifdef HAVE_LIMITS_H -# include -#endif - -#ifdef HAVE_VARIABLE_LENGTH_ARRAYS -# define VARARR(X,Y,Z) X (Y)[Z] -#else -# define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) -#endif - -/* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ -/* but this is too much trouble */ -#ifndef PATH_MAX -# ifdef MAXPATHLEN -# define PATH_MAX MAXPATHLEN -# else -# ifdef _POSIX_PATH_MAX -# define PATH_MAX _POSIX_PATH_MAX -# else - /* so we will just pick something */ -# define PATH_MAX 1024 -# endif -# endif -#endif - -/* - * The number of file descriptors we'll allocate initially. - * We will reallocate later if necessary. - */ -#define ZSH_INITIAL_OPEN_MAX 64 -#ifndef OPEN_MAX -# ifdef NOFILE -# define OPEN_MAX NOFILE -# else - /* so we will just pick something */ -# define OPEN_MAX ZSH_INITIAL_OPEN_MAX -# endif -#endif -#ifndef HAVE_SYSCONF -# define zopenmax() ((long) (OPEN_MAX > ZSH_INITIAL_OPEN_MAX ? \ - ZSH_INITIAL_OPEN_MAX : OPEN_MAX)) -#endif - -#ifdef HAVE_FCNTL_H -# include -#else -# include -#endif - -/* The following will only be defined if is POSIX. * - * So we don't have to worry about union wait. But some machines * - * (NeXT) include from other include files, so we * - * need to undef and then redefine the wait macros if * - * is not POSIX. */ - -#ifdef HAVE_SYS_WAIT_H -# include -#else -# undef WIFEXITED -# undef WEXITSTATUS -# undef WIFSIGNALED -# undef WTERMSIG -# undef WCOREDUMP -# undef WIFSTOPPED -# undef WSTOPSIG -#endif - -/* missing macros for wait/waitpid/wait3 */ -#ifndef WIFEXITED -# define WIFEXITED(X) (((X)&0377)==0) -#endif -#ifndef WEXITSTATUS -# define WEXITSTATUS(X) (((X)>>8)&0377) -#endif -#ifndef WIFSIGNALED -# define WIFSIGNALED(X) (((X)&0377)!=0&&((X)&0377)!=0177) -#endif -#ifndef WTERMSIG -# define WTERMSIG(X) ((X)&0177) -#endif -#ifndef WCOREDUMP -# define WCOREDUMP(X) ((X)&0200) -#endif -#ifndef WIFSTOPPED -# define WIFSTOPPED(X) (((X)&0377)==0177) -#endif -#ifndef WSTOPSIG -# define WSTOPSIG(X) (((X)>>8)&0377) -#endif - -#ifdef HAVE_SYS_SELECT_H -# ifndef TIME_H_SELECT_H_CONFLICTS -# include -# endif -#elif defined(SELECT_IN_SYS_SOCKET_H) -# include -#endif - -#if defined(__APPLE__) && defined(HAVE_SELECT) -/* - * Prefer select() to poll() on MacOS X since poll() is known - * to be problematic in 10.4 - */ -#undef HAVE_POLL -#undef HAVE_POLL_H -#endif - -#ifdef HAVE_SYS_FILIO_H -# include -#endif - -#ifdef HAVE_TERMIOS_H -# ifdef __sco - /* termios.h includes sys/termio.h instead of sys/termios.h; * - * hence the declaration for struct termios is missing */ -# include -# else -# include -# endif -# ifdef _POSIX_VDISABLE -# define VDISABLEVAL _POSIX_VDISABLE -# else -# define VDISABLEVAL 0 -# endif -# define HAS_TIO 1 -#else /* not TERMIOS */ -# ifdef HAVE_TERMIO_H -# include -# define VDISABLEVAL -1 -# define HAS_TIO 1 -# else /* not TERMIOS and TERMIO */ -# include -# endif /* HAVE_TERMIO_H */ -#endif /* HAVE_TERMIOS_H */ - -#if defined(GWINSZ_IN_SYS_IOCTL) || defined(IOCTL_IN_SYS_IOCTL) -# include -#endif -#ifdef WINSIZE_IN_PTEM -# include -# include -#endif - -#ifdef HAVE_SYS_PARAM_H -# include -#endif - -#ifdef HAVE_SYS_UTSNAME_H -# include -#endif - -#define DEFAULT_WORDCHARS "*?_-.[]~=/&;!#$%^(){}<>" -#define DEFAULT_TIMEFMT "%J %U user %S system %P cpu %*E total" - -/* Posix getpgrp takes no argument, while the BSD version * - * takes the process ID as an argument */ -#ifdef GETPGRP_VOID -# define GETPGRP() getpgrp() -#else -# define GETPGRP() getpgrp(0) -#endif - -#ifndef HAVE_GETLOGIN -# define getlogin() cuserid(NULL) -#endif - -#ifdef HAVE_SETPGID -# define setpgrp setpgid -#endif - -/* can we set the user/group id of a process */ - -#ifndef HAVE_SETUID -# ifdef HAVE_SETREUID -# define setuid(X) setreuid(X,X) -# define setgid(X) setregid(X,X) -# define HAVE_SETUID -# endif -#endif - -/* can we set the effective user/group id of a process */ - -#ifndef HAVE_SETEUID -# ifdef HAVE_SETREUID -# define seteuid(X) setreuid(-1,X) -# define setegid(X) setregid(-1,X) -# define HAVE_SETEUID -# else -# ifdef HAVE_SETRESUID -# define seteuid(X) setresuid(-1,X,-1) -# define setegid(X) setresgid(-1,X,-1) -# define HAVE_SETEUID -# endif -# endif -#endif - -#ifdef HAVE_SYS_RESOURCE_H -# include -# if defined(__hpux) && !defined(RLIMIT_CPU) -/* HPUX does have the BSD rlimits in the kernel. Officially they are * - * unsupported but quite a few of them like RLIMIT_CORE seem to work. * - * All the following are in the but made visible * - * only for the kernel. */ -# define RLIMIT_CPU 0 -# define RLIMIT_FSIZE 1 -# define RLIMIT_DATA 2 -# define RLIMIT_STACK 3 -# define RLIMIT_CORE 4 -# define RLIMIT_RSS 5 -# define RLIMIT_NOFILE 6 -# define RLIMIT_OPEN_MAX RLIMIT_NOFILE -# define RLIM_NLIMITS 7 -# define RLIM_INFINITY 0x7fffffff -# endif -#endif - -/* we use the SVR4 constant instead of the BSD one */ -#if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE) -# define RLIMIT_NOFILE RLIMIT_OFILE -#endif -#if !defined(RLIMIT_VMEM) && defined(RLIMIT_AS) -# define RLIMIT_VMEM RLIMIT_AS -#endif - -#ifdef HAVE_SYS_CAPABILITY_H -# include -#endif - -/* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 * - * (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) * - * converted to printable decimal form including the sign and the * - * terminating null character. Below 0.30103 > lg 2. * - * BDIGBUFSIZE is for a number converted to printable binary form. */ -#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 30103/100000) + 3) -#define BDIGBUFSIZE ((int)((sizeof(zlong) * 8) + 4)) - -/* If your stat macros are broken, we will * - * just undefine them. */ - -#ifdef STAT_MACROS_BROKEN -# undef S_ISBLK -# undef S_ISCHR -# undef S_ISDIR -# undef S_ISDOOR -# undef S_ISFIFO -# undef S_ISLNK -# undef S_ISMPB -# undef S_ISMPC -# undef S_ISNWK -# undef S_ISOFD -# undef S_ISOFL -# undef S_ISREG -# undef S_ISSOCK -#endif /* STAT_MACROS_BROKEN. */ - -/* If you are missing the stat macros, we * - * define our own */ - -#ifndef S_IFMT -# define S_IFMT 0170000 -#endif - -#if !defined(S_ISBLK) && defined(S_IFBLK) -# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) -#endif -#if !defined(S_ISCHR) && defined(S_IFCHR) -# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) -#endif -#if !defined(S_ISDIR) && defined(S_IFDIR) -# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) -#endif -#if !defined(S_ISDOOR) && defined(S_IFDOOR) /* Solaris */ -# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR) -#endif -#if !defined(S_ISFIFO) && defined(S_IFIFO) -# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) -#endif -#if !defined(S_ISLNK) && defined(S_IFLNK) -# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) -#endif -#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ -# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) -#endif -#if !defined(S_ISMPC) && defined(S_IFMPC) /* V7 */ -# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) -#endif -#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ -# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) -#endif -#if !defined(S_ISOFD) && defined(S_IFOFD) /* Cray */ -# define S_ISOFD(m) (((m) & S_IFMT) == S_IFOFD) -#endif -#if !defined(S_ISOFL) && defined(S_IFOFL) /* Cray */ -# define S_ISOFL(m) (((m) & S_IFMT) == S_IFOFL) -#endif -#if !defined(S_ISREG) && defined(S_IFREG) -# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) -#endif -#if !defined(S_ISSOCK) && defined(S_IFSOCK) -# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) -#endif - -/* We will pretend to have all file types on any system. */ - -#ifndef S_ISBLK -# define S_ISBLK(m) ((void)(m), 0) -#endif -#ifndef S_ISCHR -# define S_ISCHR(m) ((void)(m), 0) -#endif -#ifndef S_ISDIR -# define S_ISDIR(m) ((void)(m), 0) -#endif -#ifndef S_ISDOOR -# define S_ISDOOR(m) ((void)(m), 0) -#endif -#ifndef S_ISFIFO -# define S_ISFIFO(m) ((void)(m), 0) -#endif -#ifndef S_ISLNK -# define S_ISLNK(m) ((void)(m), 0) -#endif -#ifndef S_ISMPB -# define S_ISMPB(m) ((void)(m), 0) -#endif -#ifndef S_ISMPC -# define S_ISMPC(m) ((void)(m), 0) -#endif -#ifndef S_ISNWK -# define S_ISNWK(m) ((void)(m), 0) -#endif -#ifndef S_ISOFD -# define S_ISOFD(m) ((void)(m), 0) -#endif -#ifndef S_ISOFL -# define S_ISOFL(m) ((void)(m), 0) -#endif -#ifndef S_ISREG -# define S_ISREG(m) ((void)(m), 0) -#endif -#ifndef S_ISSOCK -# define S_ISSOCK(m) ((void)(m), 0) -#endif - -/* file mode permission bits */ - -#ifndef S_ISUID -# define S_ISUID 04000 -#endif -#ifndef S_ISGID -# define S_ISGID 02000 -#endif -#ifndef S_ISVTX -# define S_ISVTX 01000 -#endif -#ifndef S_IRUSR -# define S_IRUSR 00400 -#endif -#ifndef S_IWUSR -# define S_IWUSR 00200 -#endif -#ifndef S_IXUSR -# define S_IXUSR 00100 -#endif -#ifndef S_IRGRP -# define S_IRGRP 00040 -#endif -#ifndef S_IWGRP -# define S_IWGRP 00020 -#endif -#ifndef S_IXGRP -# define S_IXGRP 00010 -#endif -#ifndef S_IROTH -# define S_IROTH 00004 -#endif -#ifndef S_IWOTH -# define S_IWOTH 00002 -#endif -#ifndef S_IXOTH -# define S_IXOTH 00001 -#endif -#ifndef S_IRWXU -# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) -#endif -#ifndef S_IRWXG -# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) -#endif -#ifndef S_IRWXO -# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) -#endif -#ifndef S_IRUGO -# define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) -#endif -#ifndef S_IWUGO -# define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) -#endif -#ifndef S_IXUGO -# define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) -#endif - -#ifndef HAVE_LSTAT -# define lstat stat -#endif - -#ifndef HAVE_READLINK -# define readlink(PATH, BUF, BUFSZ) \ - ((void)(PATH), (void)(BUF), (void)(BUFSZ), errno = ENOSYS, -1) -#endif - -#ifndef F_OK /* missing macros for access() */ -# define F_OK 0 -# define X_OK 1 -# define W_OK 2 -# define R_OK 4 -#endif - -#ifndef HAVE_LCHOWN -# define lchown chown -#endif - -#ifndef HAVE_MEMCPY -# define memcpy memmove -#endif - -#ifndef HAVE_MEMMOVE -# define memmove(dest, src, len) bcopy((src), (dest), (len)) -#endif - -#ifndef offsetof -# define offsetof(TYPE, MEM) ((char *)&((TYPE *)0)->MEM - (char *)(TYPE *)0) -#endif - -extern char **environ; - -/* - * We always need setenv and unsetenv in pairs, because - * we don't know how to do memory management on the values set. - */ -#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) -# define USE_SET_UNSET_ENV -#endif - - -/* These variables are sometimes defined in, * - * and needed by, the termcap library. */ -#if MUST_DEFINE_OSPEED -extern char PC, *BC, *UP; -extern short ospeed; -#endif - -#ifndef O_NOCTTY -# define O_NOCTTY 0 -#endif - -#ifdef _LARGEFILE_SOURCE -#ifdef HAVE_FSEEKO -#define fseek fseeko -#endif -#ifdef HAVE_FTELLO -#define ftell ftello -#endif -#endif - -/* Can't support job control without working tcsetgrp() */ -#ifdef BROKEN_TCSETPGRP -#undef JOB_CONTROL -#endif /* BROKEN_TCSETPGRP */ - -#ifdef BROKEN_KILL_ESRCH -#undef ESRCH -#define ESRCH EINVAL -#endif /* BROKEN_KILL_ESRCH */ - -/* Can we do locale stuff? */ -#undef USE_LOCALE -#if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL) -# define USE_LOCALE 1 -#endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */ - -#ifndef MAILDIR_SUPPORT -#define mailstat(X,Y) stat(X,Y) -#endif - -#ifdef __CYGWIN__ -# include -# define IS_DIRSEP(c) ((c) == '/' || (c) == '\\') -#else -# define IS_DIRSEP(c) ((c) == '/') -#endif - -#if defined(__GNUC__) && !defined(__APPLE__) -/* Does the OS X port of gcc still gag on __attribute__? */ -#define UNUSED(x) x __attribute__((__unused__)) -#else -#define UNUSED(x) x -#endif - -/* - * The MULTIBYTE_SUPPORT configure-define specifies that we want to enable - * complete Unicode conversion between wide characters and multibyte strings. - */ -#if defined MULTIBYTE_SUPPORT \ - || (defined HAVE_WCHAR_H && defined HAVE_WCTOMB && defined __STDC_ISO_10646__) -/* - * If MULTIBYTE_SUPPORT is not defined, these includes provide a subset of - * Unicode support that makes the \u and \U printf escape sequences work. - */ - -#if defined(__hpux) && !defined(_INCLUDE__STDC_A1_SOURCE) -#define _INCLUDE__STDC_A1_SOURCE -#endif - -# include -# include -#endif -#ifdef HAVE_LANGINFO_H -# include -# ifdef HAVE_ICONV -# include -# endif -#endif - -#if defined(HAVE_INITGROUPS) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_INITGROUPS -#endif - -#if defined(HAVE_GETGRGID) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_GETGRGID -#endif - -#if defined(HAVE_GETGRNAM) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_GETGRNAM -#endif - -#if defined(HAVE_GETPWENT) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_GETPWENT -#endif - -#if defined(HAVE_GETPWNAM) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_GETPWNAM -#endif - -#if defined(HAVE_GETPWUID) && !defined(DISABLE_DYNAMIC_NSS) -# define USE_GETPWUID -#endif - -#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC -# define GET_ST_ATIME_NSEC(st) (st).st_atim.tv_nsec -#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC -# define GET_ST_ATIME_NSEC(st) (st).st_atimespec.tv_nsec -#elif HAVE_STRUCT_STAT_ST_ATIMENSEC -# define GET_ST_ATIME_NSEC(st) (st).st_atimensec -#endif -#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC -# define GET_ST_MTIME_NSEC(st) (st).st_mtim.tv_nsec -#elif HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC -# define GET_ST_MTIME_NSEC(st) (st).st_mtimespec.tv_nsec -#elif HAVE_STRUCT_STAT_ST_MTIMENSEC -# define GET_ST_MTIME_NSEC(st) (st).st_mtimensec -#endif -#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC -# define GET_ST_CTIME_NSEC(st) (st).st_ctim.tv_nsec -#elif HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC -# define GET_ST_CTIME_NSEC(st) (st).st_ctimespec.tv_nsec -#elif HAVE_STRUCT_STAT_ST_CTIMENSEC -# define GET_ST_CTIME_NSEC(st) (st).st_ctimensec -#endif diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/text.c zsh-beta-4.3.12-dev-1+20110925/Src/text.c --- zsh-beta-4.3.11-dev-1+20110504/Src/text.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/text.c 2011-10-02 01:10:11.000000000 +0000 @@ -253,6 +253,7 @@ struct { char *strs; Wordcode end; + int nargs; } _funcdef; struct { Wordcode end; @@ -456,19 +457,31 @@ if (!s) { Wordcode p = state->pc; Wordcode end = p + WC_FUNCDEF_SKIP(code); + int nargs = *state->pc++; - taddlist(state, *state->pc++); + taddlist(state, nargs); + if (nargs) + taddstr(" "); if (tjob) { - taddstr(" () { ... }"); + taddstr("() { ... }"); state->pc = end; + if (!nargs) { + /* + * Unnamed fucntion. + * We're not going to pull any arguments off + * later, so skip them now... + */ + state->pc += *end; + } stack = 1; } else { - taddstr(" () {"); + taddstr("() {"); tindent++; taddnl(1); n = tpush(code, 1); n->u._funcdef.strs = state->strs; n->u._funcdef.end = end; + n->u._funcdef.nargs = nargs; state->strs += *state->pc; state->pc += 3; } @@ -478,6 +491,17 @@ dec_tindent(); taddnl(0); taddstr("}"); + if (s->u._funcdef.nargs == 0) { + /* Unnamed function with post-arguments */ + int nargs; + s->u._funcdef.end += *state->pc++; + nargs = *state->pc++; + if (nargs) { + taddstr(" "); + taddlist(state, nargs); + } + state->pc = s->u._funcdef.end; + } stack = 1; } break; @@ -893,13 +917,13 @@ taddstr(f->here_terminator); taddpending(f->name, f->munged_here_terminator); } else { + int fnamelen, sav; taddstr(fstr[REDIR_HERESTR]); /* * Just a quick and dirty representation. * Remove a terminating newline, if any. */ - int fnamelen = strlen(f->name); - int sav; + fnamelen = strlen(f->name); if (fnamelen > 0 && f->name[fnamelen-1] == '\n') { sav = 1; f->name[fnamelen-1] = '\0'; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/utils.c zsh-beta-4.3.12-dev-1+20110925/Src/utils.c --- zsh-beta-4.3.11-dev-1+20110504/Src/utils.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/utils.c 2011-10-02 01:10:11.000000000 +0000 @@ -40,6 +40,11 @@ /**/ mod_export char *scriptfilename; +/* != 0 if we are in a new style completion function */ + +/**/ +mod_export int incompfunc; + #ifdef MULTIBYTE_SUPPORT struct widechar_array { wchar_t *chars; @@ -1232,8 +1237,10 @@ * to a list of jobs generated in a hook. */ int osc = sfcontext, osm = stopmsg, stat = 1, ret = 0; + int old_incompfunc = incompfunc; sfcontext = SFC_HOOK; + incompfunc = 0; if ((shfunc = getshfunc(name))) { ret = doshfunc(shfunc, lnklst, 1); @@ -1262,6 +1269,7 @@ sfcontext = osc; stopmsg = osm; + incompfunc = old_incompfunc; if (retval) *retval = ret; @@ -1296,7 +1304,8 @@ countprompt(str, &w, 0, -1); opts[PROMPTPERCENT] = percents; zputs(str, shout); - fprintf(shout, "%*s\r%*s\r", (int)columns - w - !hasxn, "", w, ""); + fprintf(shout, "%*s\r%*s\r", (int)zterm_columns - w - !hasxn, + "", w, ""); fflush(shout); free(str); } @@ -1558,49 +1567,49 @@ static int adjustlines(int signalled) { - int oldlines = lines; + int oldlines = zterm_lines; #ifdef TIOCGWINSZ - if (signalled || lines <= 0) - lines = shttyinfo.winsize.ws_row; + if (signalled || zterm_lines <= 0) + zterm_lines = shttyinfo.winsize.ws_row; else - shttyinfo.winsize.ws_row = lines; + shttyinfo.winsize.ws_row = zterm_lines; #endif /* TIOCGWINSZ */ - if (lines <= 0) { + if (zterm_lines <= 0) { DPUTS(signalled, "BUG: Impossible TIOCGWINSZ rows"); - lines = tclines > 0 ? tclines : 24; + zterm_lines = tclines > 0 ? tclines : 24; } - if (lines > 2) + if (zterm_lines > 2) termflags &= ~TERM_SHORT; else termflags |= TERM_SHORT; - return (lines != oldlines); + return (zterm_lines != oldlines); } static int adjustcolumns(int signalled) { - int oldcolumns = columns; + int oldcolumns = zterm_columns; #ifdef TIOCGWINSZ - if (signalled || columns <= 0) - columns = shttyinfo.winsize.ws_col; + if (signalled || zterm_columns <= 0) + zterm_columns = shttyinfo.winsize.ws_col; else - shttyinfo.winsize.ws_col = columns; + shttyinfo.winsize.ws_col = zterm_columns; #endif /* TIOCGWINSZ */ - if (columns <= 0) { + if (zterm_columns <= 0) { DPUTS(signalled, "BUG: Impossible TIOCGWINSZ cols"); - columns = tccolumns > 0 ? tccolumns : 80; + zterm_columns = tccolumns > 0 ? tccolumns : 80; } - if (columns > 2) + if (zterm_columns > 2) termflags &= ~TERM_NARROW; else termflags |= TERM_NARROW; - return (columns != oldcolumns); + return (zterm_columns != oldcolumns); } /* check the size of the window and adjust if necessary. * @@ -1634,8 +1643,8 @@ ttycols = shttyinfo.winsize.ws_col; } else { /* Set to value from environment on failure */ - shttyinfo.winsize.ws_row = lines; - shttyinfo.winsize.ws_col = columns; + shttyinfo.winsize.ws_row = zterm_lines; + shttyinfo.winsize.ws_col = zterm_columns; resetzle = (from == 1); } #else @@ -1655,9 +1664,9 @@ * but I'm concerned about what happens on race conditions; e.g., * * suppose the user resizes his xterm during `eval $(resize)'? */ if (adjustlines(from) && zgetenv("LINES")) - setiparam("LINES", lines); + setiparam("LINES", zterm_lines); if (adjustcolumns(from) && zgetenv("COLUMNS")) - setiparam("COLUMNS", columns); + setiparam("COLUMNS", zterm_columns); getwinsz = 1; break; case 2: @@ -1682,8 +1691,8 @@ winchanged = #endif /* TIOCGWINSZ */ resetneeded = 1; - zleentry(ZLE_CMD_REFRESH); zleentry(ZLE_CMD_RESET_PROMPT); + zleentry(ZLE_CMD_REFRESH); } } @@ -1801,22 +1810,20 @@ { if (fd >= 0) { /* - * We sometimes zclose() an fd twice where the second - * time is a catch-all in case there was a failure using - * the fd. This is harmless but we need to trap it - * for the error check here. + * Careful: we allow closing of arbitrary fd's, beyond + * max_zsh_fd. In that case we don't try anything clever. */ - DPUTS2(fd > max_zsh_fd && fdtable[fd] != FDT_UNUSED, - "BUG: fd is %d, max_zsh_fd is %d", fd, max_zsh_fd); - if (fdtable[fd] == FDT_FLOCK) - fdtable_flocks--; - fdtable[fd] = FDT_UNUSED; - while (max_zsh_fd > 0 && fdtable[max_zsh_fd] == FDT_UNUSED) - max_zsh_fd--; - if (fd == coprocin) - coprocin = -1; - if (fd == coprocout) - coprocout = -1; + if (fd <= max_zsh_fd) { + if (fdtable[fd] == FDT_FLOCK) + fdtable_flocks--; + fdtable[fd] = FDT_UNUSED; + while (max_zsh_fd > 0 && fdtable[max_zsh_fd] == FDT_UNUSED) + max_zsh_fd--; + if (fd == coprocin) + coprocin = -1; + if (fd == coprocout) + coprocout = -1; + } return close(fd); } return -1; @@ -3169,6 +3176,10 @@ int n, sl; char *t, *tt, **r, **p; + /* Null string? Treat as empty string. */ + if (s[0] == Nularg && !s[1]) + s++; + if (!sep) return spacesplit(s, allownull, heap, 0); @@ -3217,7 +3228,7 @@ char ** subst_string_by_func(Shfunc func, char *arg1, char *orig) { - int osc = sfcontext, osm = stopmsg; + int osc = sfcontext, osm = stopmsg, old_incompfunc = incompfunc; LinkList l = newlinklist(); char **ret; @@ -3226,6 +3237,7 @@ addlinknode(l, arg1); addlinknode(l, orig); sfcontext = SFC_SUBST; + incompfunc = 0; if (doshfunc(func, l, 1)) ret = NULL; @@ -3234,6 +3246,7 @@ sfcontext = osc; stopmsg = osm; + incompfunc = old_incompfunc; return ret; } @@ -4688,7 +4701,7 @@ mod_export char * quotestring(const char *s, char **e, int instring) { - const char *u, *tt; + const char *u; char *v; int alloclen; char *buf; @@ -4739,7 +4752,7 @@ break; } - tt = quotestart = v = buf = zshcalloc(alloclen); + quotestart = v = buf = zshcalloc(alloclen); DPUTS(instring < QT_BACKSLASH || instring == QT_BACKTICK || instring > QT_SINGLE_OPTIONAL, diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compcore.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compcore.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compcore.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compcore.c 2011-10-02 01:10:11.000000000 +0000 @@ -405,6 +405,11 @@ } else if (nmatches == 1 || (nmatches > 1 && !diffmatches)) { /* Only one match. */ Cmgroup m = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(m->heap_id)) { + HEAP_ERROR(m->heap_id); + } +#endif while (!m->mcount) m = m->next; @@ -509,6 +514,11 @@ int ret; cdat.matches = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(cdat.matches->heap_id)) { + HEAP_ERROR(cdat.matches->heap_id); + } +#endif cdat.num = nmatches; cdat.nmesg = nmessages; cdat.cur = NULL; @@ -597,7 +607,7 @@ if (rdstr) compredirect = rdstr; kset |= CP_REDIRECT; - } else + } else { switch (linwhat) { case IN_ENV: compcontext = (linarr ? "array_value" : "value"); @@ -627,6 +637,7 @@ aadd = 1; } } + } compcontext = ztrdup(compcontext); if (compwords) freearray(compwords); @@ -987,6 +998,11 @@ diffmatches = odm; validlist = 1; amatches = lastmatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(amatches->heap_id)) { + HEAP_ERROR(amatches->heap_id); + } +#endif lmatches = lastlmatches; if (pmatches) { freematches(pmatches, 1); @@ -1084,7 +1100,7 @@ check_param(char *s, int set, int test) { char *p; - int found = 0; + int found = 0, qstring = 0; zsfree(parpre); parpre = NULL; @@ -1111,6 +1127,7 @@ !(*p == String && p[1] == Snull) && !(*p == Qstring && p[1] == '\'')) { found = 1; + qstring = (*p == Qstring); break; } } @@ -1135,7 +1152,7 @@ p[1] != Inpar && p[1] != Inbrack && p[1] != Snull) { /* This is a parameter expression, not $(...), $[...], $'...'. */ char *b = p + 1, *e = b, *ie; - int n = 0, br = 1, nest = 0; + int br = 1, nest = 0; if (*b == Inbrace) { char *tb = b; @@ -1146,7 +1163,18 @@ /* Ignore the possible (...) flags. */ b++, br++; - n = skipparens(Inpar, Outpar, &b); + if ((qstring ? skipparens('(', ')', &b) : + skipparens(Inpar, Outpar, &b)) > 0) { + /* + * We are still within the parameter flags. There's no + * point trying to do anything clever here with + * parameter names. Instead, just report that we are in + * a brace parameter but let the completion function + * decide what to do about it. + */ + ispar = 2; + return NULL; + } for (tb = p - 1; tb > s && *tb != Outbrace && *tb != Inbrace; tb--); if (tb > s && *tb == Inbrace && (tb[-1] == String || *tb == Qstring)) @@ -1189,7 +1217,7 @@ } /* Now make sure that the cursor is inside the name. */ - if (offs <= e - s && offs >= b - s && n <= 0) { + if (offs <= e - s && offs >= b - s) { char sav; if (br) { @@ -1450,7 +1478,7 @@ * when stripping single quotes: 1 for RCQUOTES, 3 otherwise * (because we leave a "'" in the final string). */ - int dq = 0, odq, sq = 0, osq, qttype, sqq = 0, lsq = 0, qa = 0; + int dq = 0, odq, sq = 0, qttype, sqq = 0, lsq = 0, qa = 0; /* dolq: like sq and dq but for dollars quoting. */ int dolq = 0; /* remember some global variable values (except lp is local) */ @@ -1555,7 +1583,6 @@ } odq = dq; - osq = sq; inpush(dupstrspace(tmp), 0, NULL); zlemetaline = tmp; /* @@ -2329,7 +2356,7 @@ dat->pre = dupstring(dat->pre); if (dat->suf) dat->suf = dupstring(dat->suf); - if (!dat->prpre && (dat->prpre = oppre)) { + if (!dat->prpre && (dat->prpre = dupstring(oppre))) { singsub(&(dat->prpre)); untokenize(dat->prpre); } else @@ -2959,6 +2986,11 @@ Cmgroup p = amatches; while (p) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(p->heap_id)) { + HEAP_ERROR(p->heap_id); + } +#endif if (p->name && flags == (p->flags & (CGF_NOSORT|CGF_UNIQALL|CGF_UNIQCON)) && !strcmp(n, p->name)) { @@ -2975,6 +3007,9 @@ } } mgroup = (Cmgroup) zhalloc(sizeof(struct cmgroup)); +#ifdef ZSH_HEAP_DEBUG + mgroup->heap_id = last_heap_id; +#endif mgroup->name = dupstring(n); mgroup->lcount = mgroup->llcount = mgroup->mcount = mgroup->ecount = mgroup->ccount = 0; @@ -3271,7 +3306,7 @@ mod_export int permmatches(int last) { - Cmgroup g = amatches, n, opm; + Cmgroup g = amatches, n; Cmatch *p, *q; Cexpl *ep, *eq, e, o; LinkList mlist; @@ -3285,7 +3320,6 @@ } newmatches = fi = 0; - opm = pmatches; pmatches = lmatches = NULL; nmatches = smatches = diffmatches = 0; @@ -3295,6 +3329,11 @@ fi = 1; } while (g) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif if (fi != ofi || !g->perm || g->new) { if (fi) /* We have no matches, try ignoring fignore. */ @@ -3323,6 +3362,9 @@ diffmatches = 1; n = (Cmgroup) zshcalloc(sizeof(struct cmgroup)); +#ifdef ZSH_HEAP_DEBUG + n->heap_id = HEAPID_PERMANENT; +#endif if (g->perm) { g->perm->next = NULL; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compctl.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compctl.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compctl.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compctl.c 2011-10-02 01:10:11.000000000 +0000 @@ -1838,6 +1838,11 @@ diffmatches = odm; validlist = 1; amatches = lastmatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(amatches->heap_id)) { + HEAP_ERROR(amatches->heap_id); + } +#endif lmatches = lastlmatches; if (pmatches) { freematches(pmatches, 1); @@ -1891,7 +1896,7 @@ /* This adds a match to the list of matches. The string to add is given * * in s, the type of match is given in the global variable addwhat and * - * the parameter t (if not NULL) is a pointer to a hash node node which * + * the parameter t (if not NULL) is a pointer to a hash node which * * may be used to give other information to this function. * * * * addwhat contains either one of the special values (negative, see below) * diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/comp.h zsh-beta-4.3.12-dev-1+20110925/Src/Zle/comp.h --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/comp.h 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/comp.h 2011-10-02 01:10:11.000000000 +0000 @@ -76,6 +76,9 @@ int totl; /* total length */ int shortest; /* length of shortest match */ Cmgroup perm; /* perm. alloced version of this group */ +#ifdef ZSH_HEAP_DEBUG + Heapid heap_id; +#endif }; @@ -323,8 +326,8 @@ typedef struct cldata *Cldata; struct cldata { - int columns; /* screen width */ - int lines; /* screen height */ + int zterm_columns; /* screen width */ + int zterm_lines; /* screen height */ int menuacc; /* value of global menuacc */ int valid; /* no need to calculate anew */ int nlist; /* number of matches to list */ diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/complist.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/complist.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/complist.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/complist.c 2011-10-02 01:10:11.000000000 +0000 @@ -656,7 +656,7 @@ tcout(TCCLEAREOL); cc = 0; } - if (ml == mlend - 1 && (cc % columns) == columns - 1) + if (ml == mlend - 1 && (cc % zterm_columns) == zterm_columns - 1) return 0; if (*p == Meta) { @@ -664,9 +664,9 @@ putc(*p ^ 32, shout); } else putc(*p, shout); - if ((beg = !(cc % columns))) + if ((beg = !(cc % zterm_columns))) ml++; - if (mscroll && !(cc % columns) && + if (mscroll && !(cc % zterm_columns) && !--mrestlines && (ask = asklistscroll(ml))) return ask; } @@ -765,7 +765,7 @@ /* Input is metafied... */ int nc = (*t == Meta) ? STOUC(*++t ^ 32) : STOUC(*t); /* Is the screen full? */ - if (ml == mlend - 1 && col == columns - 1) { + if (ml == mlend - 1 && col == zterm_columns - 1) { mlprinted = ml - oml; return 0; } @@ -787,13 +787,13 @@ * There might be problems with characters of printing width * greater than one here. */ - if (col > columns) { + if (col > zterm_columns) { ml++; if (mscroll && !--mrestlines && (ask = asklistscroll(ml))) { mlprinted = ml - oml; return ask; } - col -= columns; + col -= zterm_columns; if (do_colors) fputs(" \010", shout); } @@ -820,12 +820,12 @@ for (t = nicechar(cc); *t; t++) { int nc = (*t == Meta) ? STOUC(*++t ^ 32) : STOUC(*t); - if (ml == mlend - 1 && col == columns - 1) { + if (ml == mlend - 1 && col == zterm_columns - 1) { mlprinted = ml - oml; return 0; } putc(nc, shout); - if (++col > columns) { + if (++col > zterm_columns) { ml++; if (mscroll && !--mrestlines && (ask = asklistscroll(ml))) { mlprinted = ml - oml; @@ -849,9 +849,9 @@ { Patcol pc; - nrefs = MAX_POS - 1; + for (pc = mcolors.pats; pc; pc = pc->next) { + nrefs = MAX_POS - 1; - for (pc = mcolors.pats; pc; pc = pc->next) if ((!pc->prog || !group || pattry(pc->prog, group)) && pattryrefs(pc->pat, n, -1, -1, 0, &nrefs, begpos, endpos)) { if (pc->cols[1]) { @@ -863,6 +863,7 @@ return 0; } + } zcputs(group, COL_NO); @@ -880,9 +881,9 @@ Patcol pc; int len; - nrefs = MAX_POS - 1; + for (pc = mcolors.pats; pc; pc = pc->next) { + nrefs = MAX_POS - 1; - for (pc = mcolors.pats; pc; pc = pc->next) if ((!pc->prog || !group || pattry(pc->prog, group)) && pattryrefs(pc->pat, filename, -1, -1, 0, &nrefs, begpos, endpos)) { if (pc->cols[1]) { @@ -894,6 +895,7 @@ return 0; } + } if (special != -1) { colour = special; @@ -991,7 +993,7 @@ !strcmp(cmd->nam, "expand-or-complete-prefix") || !strcmp(cmd->nam, "menu-complete") || !strcmp(cmd->nam, "menu-expand-or-complete")) - mrestlines = lines - 1; + mrestlines = zterm_lines - 1; else if (cmd == Th(z_acceptsearch)) ret = 1; else { @@ -1001,7 +1003,7 @@ selectlocalmap(NULL); settyinfo(&shttyinfo); putc('\r', shout); - for (i = columns - 1; i-- > 0; ) + for (i = zterm_columns - 1; i-- > 0; ) putc(' ', shout); putc('\r', shout); @@ -1213,8 +1215,8 @@ /* nc only contains ASCII text */ int l = strlen(nc); - if (l + cc > columns - 2) - nc[l -= l + cc - (columns - 2)] = '\0'; + if (l + cc > zterm_columns - 2) + nc[l -= l + cc - (zterm_columns - 2)] = '\0'; fputs(nc, shout); cc += l; } else if (dopr && m == 1) { @@ -1230,16 +1232,17 @@ } else { cc += width; - if ((cc >= columns - 2 || cchar == ZWC('\n')) && stat) + if ((cc >= zterm_columns - 2 || cchar == ZWC('\n')) && stat) dopr = 2; if (cchar == ZWC('\n')) { if (dopr == 1 && mlbeg >= 0 && tccan(TCCLEAREOL)) tcout(TCCLEAREOL); - l += 1 + ((cc - 1) / columns); + l += 1 + ((cc - 1) / zterm_columns); cc = 0; } if (dopr == 1) { - if (ml == mlend - 1 && (cc % columns) == columns - 1) { + if (ml == mlend - 1 && (cc % zterm_columns) == + zterm_columns - 1) { dopr = 0; p += len; continue; @@ -1256,7 +1259,7 @@ * TODO: the following doesn't allow for * character widths greater than 1. */ - if ((beg = !(cc % columns)) && !stat) { + if ((beg = !(cc % zterm_columns)) && !stat) { ml++; fputs(" \010", shout); } @@ -1264,7 +1267,7 @@ *stop = 1; if (stat && n) mfirstl = -1; - mlprinted = l + (cc ? ((cc-1) / columns) : 0); + mlprinted = l + (cc ? ((cc-1) / zterm_columns) : 0); return mlprinted; } } @@ -1273,7 +1276,7 @@ } } if (dopr) { - if (!(cc % columns)) + if (!(cc % zterm_columns)) fputs(" \010", shout); if (mlbeg >= 0 && tccan(TCCLEAREOL)) tcout(TCCLEAREOL); @@ -1285,7 +1288,7 @@ * *Not* subtracting 1 from cc at this point appears to be * correct. C.f. printfmt in zle_tricky.c. */ - mlprinted = l + (cc / columns); + mlprinted = l + (cc / zterm_columns); return mlprinted; } @@ -1309,7 +1312,7 @@ putc(c, shout); if (c == '\n' && mlbeg >= 0 && tccan(TCCLEAREOL)) tcout(TCCLEAREOL); - if (mscroll && (++col == columns || c == '\n')) { + if (mscroll && (++col == zterm_columns || c == '\n')) { ml++; if (!--mrestlines && (ask = asklistscroll(ml))) return ask; @@ -1344,10 +1347,11 @@ lastml = 0; lastnlnct = -1; } - cl = (listdat.nlines > lines - nlnct - mhasstat ? - lines - nlnct - mhasstat : listdat.nlines) - (lastnlnct > nlnct); + cl = (listdat.nlines > zterm_lines - nlnct - mhasstat ? + zterm_lines - nlnct - mhasstat : + listdat.nlines) - (lastnlnct > nlnct); lastnlnct = nlnct; - mrestlines = lines - 1; + mrestlines = zterm_lines - 1; lastinvcount = invcount; if (cl < 2) { @@ -1361,9 +1365,12 @@ while (g) { char **pp = g->ylist; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif if ((e = g->expls)) { - int l; - if (!lastused && lasttype == 1) { e = lastexpl; ml = lastml; @@ -1386,9 +1393,9 @@ } if (mlbeg < 0 && mfirstl < 0) mfirstl = ml; - l = compprintfmt((*e)->str, - ((*e)->always ? -1 : (*e)->count), - dolist(ml), 1, ml, &stop); + (void)compprintfmt((*e)->str, + ((*e)->always ? -1 : (*e)->count), + dolist(ml), 1, ml, &stop); if (mselect >= 0) { int mm = (mcols * ml), i; @@ -1643,20 +1650,20 @@ /* Move the cursor up to the prompt, if always_last_prompt * * is set and all that... */ if (mlbeg >= 0) { - if ((nl = listdat.nlines + nlnct) >= lines) { + if ((nl = listdat.nlines + nlnct) >= zterm_lines) { if (mhasstat) { putc('\n', shout); compprintfmt(NULL, 0, 1, 1, mline, NULL); mstatprinted = 1; } - nl = lines - 1; + nl = zterm_lines - 1; } else nl--; tcmultout(TCUP, TCMULTUP, nl); showinglist = -1; lastlistlen = listdat.nlines; - } else if ((nl = listdat.nlines + nlnct - 1) < lines) { + } else if ((nl = listdat.nlines + nlnct - 1) < zterm_lines) { if (mlbeg >= 0 && tccan(TCCLEAREOL)) tcout(TCCLEAREOL); tcmultout(TCUP, TCMULTUP, nl); @@ -1666,12 +1673,12 @@ } else { clearflag = 0; if (!asked) { - mrestlines = (ml + nlnct > lines); + mrestlines = (ml + nlnct > zterm_lines); compprintnl(ml); } } } else if (!asked) { - mrestlines = (ml + nlnct > lines); + mrestlines = (ml + nlnct > zterm_lines); compprintnl(ml); } listshown = (clearflag ? 1 : -1); @@ -1789,7 +1796,7 @@ if (!dolist(ml)) { int nc = ZMB_nicewidth(m->disp ? m->disp : m->str); if (nc) - mlprinted = (nc-1) / columns; + mlprinted = (nc-1) / zterm_columns; else mlprinted = 0; return 0; @@ -1831,7 +1838,7 @@ return 1; } len = ZMB_nicewidth(m->disp ? m->disp : m->str); - mlprinted = len ? (len-1) / columns : 0; + mlprinted = len ? (len-1) / zterm_columns : 0; modec = (mcolors.flags & LC_FOLLOW_SYMLINKS) ? m->fmodec : m->modec; if ((g->flags & CGF_FILES) && modec) { @@ -1864,9 +1871,11 @@ singlecalc(int *cp, int l, int *lcp) { int c = *cp, n, j, first = 1; - Cmatch **p, *op, *mp = mtab[l * columns + c]; + Cmatch **p, *op, *mp = mtab[l * zterm_columns + c]; - for (n = 0, j = c, p = mtab + l * columns + c, op = NULL; j >= 0; j--, p--) { + for (n = 0, j = c, p = mtab + l * zterm_columns + c, op = NULL; + j >= 0; + j--, p--) { if (*p == mp) c = j; if (!first && *p != op) @@ -1876,7 +1885,7 @@ } *cp = c; *lcp = 1; - for (p = mtab + l * columns + c; c < columns; c++, p++) + for (p = mtab + l * zterm_columns + c; c < zterm_columns; c++, p++) if (*p && mp != *p) *lcp = 0; @@ -1906,9 +1915,9 @@ tc_downcurs(md1); if (mc1) tcmultout(TCRIGHT, TCMULTRIGHT, mc1); - DPUTS(ml1 * columns + mc1 >= mgtabsize, "BUG: invalid position"); - g = mgtab[ml1 * columns + mc1]; - clprintm(g, mtab[ml1 * columns + mc1], mcc1, ml1, lc1, + DPUTS(ml1 * zterm_columns + mc1 >= mgtabsize, "BUG: invalid position"); + g = mgtab[ml1 * zterm_columns + mc1]; + clprintm(g, mtab[ml1 * zterm_columns + mc1], mcc1, ml1, lc1, (g->widths ? g->widths[mcc1] : g->width)); if (mlprinted) (void) tcmultout(TCUP, TCMULTUP, mlprinted); @@ -1918,20 +1927,20 @@ tc_downcurs(md2 - md1); if (mc2) tcmultout(TCRIGHT, TCMULTRIGHT, mc2); - DPUTS(ml2 * columns + mc2 >= mgtabsize, "BUG: invalid position"); - g = mgtab[ml2 * columns + mc2]; - clprintm(g, mtab[ml2 * columns + mc2], mcc2, ml2, lc2, + DPUTS(ml2 * zterm_columns + mc2 >= mgtabsize, "BUG: invalid position"); + g = mgtab[ml2 * zterm_columns + mc2]; + clprintm(g, mtab[ml2 * zterm_columns + mc2], mcc2, ml2, lc2, (g->widths ? g->widths[mcc2] : g->width)); if (mlprinted) (void) tcmultout(TCUP, TCMULTUP, mlprinted); putc('\r', shout); if (mstatprinted) { - int i = lines - md2 - nlnct; + int i = zterm_lines - md2 - nlnct; tc_downcurs(i - 1); compprintfmt(NULL, 0, 1, 1, mline, NULL); - tcmultout(TCUP, TCMULTUP, lines - 1); + tcmultout(TCUP, TCMULTUP, zterm_lines - 1); } else tcmultout(TCUP, TCMULTUP, md2 + nlnct); @@ -1948,10 +1957,15 @@ Cmgroup oamatches = amatches; amatches = dat->matches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(amatches->heap_id)) { + HEAP_ERROR(amatches->heap_id); + } +#endif noselect = 0; - if ((minfo.asked == 2 && mselect < 0) || nlnct >= lines) { + if ((minfo.asked == 2 && mselect < 0) || nlnct >= zterm_lines) { showinglist = 0; amatches = oamatches; return (noselect = 1); @@ -1971,7 +1985,7 @@ getcols(); - mnew = ((calclist(mselect >= 0) || mlastcols != columns || + mnew = ((calclist(mselect >= 0) || mlastcols != zterm_columns || mlastlines != listdat.nlines) && mselect >= 0); if (!listdat.nlines || (mselect >= 0 && @@ -2006,7 +2020,7 @@ mscroll = 1; } else { clearflag = 1; - minfo.asked = (listdat.nlines + nlnct <= lines); + minfo.asked = (listdat.nlines + nlnct <= zterm_lines); } } else { unqueue_signals(); @@ -2019,7 +2033,7 @@ } } if (mlbeg >= 0) { - mlend = mlbeg + lines - nlnct - mhasstat; + mlend = mlbeg + zterm_lines - nlnct - mhasstat; while (mline >= mlend) mlbeg++, mlend++; } else @@ -2030,7 +2044,7 @@ mtab_been_reallocated = 1; - i = columns * listdat.nlines; + i = zterm_columns * listdat.nlines; free(mtab); mtab = (Cmatch **) zalloc(i * sizeof(Cmatch **)); memset(mtab, 0, i * sizeof(Cmatch **)); @@ -2040,7 +2054,7 @@ mgtabsize = i; #endif memset(mgtab, 0, i * sizeof(Cmgroup)); - mlastcols = mcols = columns; + mlastcols = mcols = zterm_columns; mlastlines = mlines = listdat.nlines; } last_cap = (char *) zhalloc(max_caplen + 1); @@ -2067,13 +2081,13 @@ static int adjust_mcol(int wish, Cmatch ***tabp, Cmgroup **grp) { - Cmatch **tab = *tabp; + Cmatch **matchtab = *tabp; int p, n, c; - tab -= mcol; + matchtab -= mcol; - for (p = wish; p >= 0 && (!tab[p] || mmarked(tab[p])); p--); - for (n = wish; n < mcols && (!tab[n] || mmarked(tab[n])); n++); + for (p = wish; p >= 0 && (!matchtab[p] || mmarked(matchtab[p])); p--); + for (n = wish; n < mcols && (!matchtab[n] || mmarked(matchtab[n])); n++); if (n == mcols) n = -1; @@ -2086,7 +2100,7 @@ else c = ((mcol - p) < (n - mcol) ? p : n); - *tabp = tab + c; + *tabp = matchtab + c; if (grp) *grp = *grp + c - mcol; @@ -2177,7 +2191,7 @@ } pl = strlen(p); sl = strlen(s); - max = (columns < MAX_STATUS ? columns : MAX_STATUS) - 14; + max = (zterm_columns < MAX_STATUS ? zterm_columns : MAX_STATUS) - 14; if (max > 12) { int h = (max - 2) >> 1; @@ -2394,9 +2408,9 @@ if ((s = getsparam("MENUSCROLL"))) { if (!(step = mathevali(s))) - step = (lines - nlnct) >> 1; + step = (zterm_lines - nlnct) >> 1; else if (step < 0) - if ((step += lines - nlnct) < 0) + if ((step += zterm_lines - nlnct) < 0) step = 1; } if ((s = getsparam("MENUMODE"))) { @@ -2473,34 +2487,34 @@ } if (mlbeg && lbeg != mlbeg) { - Cmatch **p = mtab + ((mlbeg - 1) * columns), **q; + Cmatch **p = mtab + ((mlbeg - 1) * zterm_columns), **q; int c; while (mlbeg) { - for (q = p, c = columns; c > 0; q++, c--) + for (q = p, c = zterm_columns; c > 0; q++, c--) if (*q && !mmarked(*q)) break; if (c) break; - p -= columns; + p -= zterm_columns; mlbeg--; } } - if ((space = lines - pl - mhasstat)) + if ((space = zterm_lines - pl - mhasstat)) while (mline >= mlbeg + space) if ((mlbeg += step) + space > mlines) mlbeg = mlines - space; if (lbeg != mlbeg) { - Cmatch **p = mtab + (mlbeg * columns), **q; + Cmatch **p = mtab + (mlbeg * zterm_columns), **q; int c; while (mlbeg < mlines) { - for (q = p, c = columns; c > 0; q++, c--) + for (q = p, c = zterm_columns; c > 0; q++, c--) if (*q) break; if (c) break; - p += columns; + p += zterm_columns; mlbeg++; } } @@ -2636,6 +2650,11 @@ s->mlbeg = mlbeg; memcpy(&(s->info), &minfo, sizeof(struct menuinfo)); s->amatches = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(amatches->heap_id)) { + HEAP_ERROR(amatches->heap_id); + } +#endif s->pmatches = pmatches; s->lastmatches = lastmatches; s->lastlmatches = lastlmatches; @@ -2831,6 +2850,11 @@ if (lastmatches) freematches(lastmatches, 0); amatches = u->amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(amatches->heap_id)) { + HEAP_ERROR(amatches->heap_id); + } +#endif pmatches = u->pmatches; lastmatches = u->lastmatches; lastlmatches = u->lastlmatches; @@ -2955,7 +2979,7 @@ cmd == Th(z_viforwardword) || cmd == Th(z_viforwardwordend) || cmd == Th(z_forwardword)) { - int i = lines - pl - 1, oi = i, ll = 0; + int i = zterm_lines - pl - 1, oi = i, ll = 0; Cmatch **lp = NULL; mode = 0; @@ -2983,7 +3007,7 @@ } else if (cmd == Th(z_emacsbackwardword) || cmd == Th(z_vibackwardword) || cmd == Th(z_backwardword)) { - int i = lines - pl - 1, oi = i, ll = 0; + int i = zterm_lines - pl - 1, oi = i, ll = 0; Cmatch **lp = NULL; mode = 0; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compmatch.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compmatch.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compmatch.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compmatch.c 2011-10-02 01:10:11.000000000 +0000 @@ -1268,7 +1268,7 @@ /**/ static int pattern_match_restrict(Cpattern p, Cpattern wp, convchar_t *wsc, int wsclen, - Cpattern prestrict, ZLE_STRING_T newline) + Cpattern prestrict, ZLE_STRING_T new_line) { convchar_t c; convchar_t ind, wind; @@ -1356,7 +1356,7 @@ } /* We need to assemble the line */ - *newline++ = (ZLE_CHAR_T)c; + *new_line++ = (ZLE_CHAR_T)c; prestrict = prestrict->next; wsc++; wsclen--; @@ -1393,7 +1393,7 @@ if (!pattern_match1(p, c, &mt)) return 0; p = p->next; - *newline++ = (ZLE_CHAR_T)c; + *new_line++ = (ZLE_CHAR_T)c; prestrict = prestrict->next; } diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compresult.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compresult.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/compresult.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/compresult.c 2011-10-02 01:10:11.000000000 +0000 @@ -906,7 +906,14 @@ for (minfo.group = amatches; minfo.group && !(minfo.group)->mcount; - minfo.group = (minfo.group)->next); + minfo.group = (minfo.group)->next) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(minfo.group->heap_id)) { + HEAP_ERROR(minfo.group->heap_id); + } +#endif + } + mc = (minfo.group)->matches; @@ -1172,6 +1179,11 @@ struct chdata dat; dat.matches = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(dat.matches->heap_id)) { + HEAP_ERROR(dat.matches->heap_id); + } +#endif dat.num = nmatches; dat.cur = m; @@ -1210,8 +1222,14 @@ do { if (!*++(minfo.cur)) { do { - if (!(minfo.group = (minfo.group)->next)) + if (!(minfo.group = (minfo.group)->next)) { minfo.group = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(minfo.group->heap_id)) { + HEAP_ERROR(minfo.group->heap_id); + } +#endif + } } while (!(minfo.group)->mcount); minfo.cur = minfo.group->matches; } @@ -1291,12 +1309,18 @@ Cmgroup g; Cmatch *m; - for (g = amatches, m = NULL; g && (!m || !*m); g = g->next) + for (g = amatches, m = NULL; g && (!m || !*m); g = g->next) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif for (m = g->matches; *m; m++) if (!hasbrpsfx(*m, minfo.prebr, minfo.postbr)) { showinglist = -2; break; } + } } } menuacc++; @@ -1381,7 +1405,13 @@ insgnum = comp_mod(insgnum, lastpermgnum); for (minfo.group = amatches; minfo.group && (minfo.group)->num != insgnum + 1; - minfo.group = (minfo.group)->next); + minfo.group = (minfo.group)->next) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(minfo.group->heap_id)) { + HEAP_ERROR(minfo.group->heap_id); + } +#endif + } if (!minfo.group || !(minfo.group)->mcount) { minfo.cur = NULL; minfo.asked = 0; @@ -1393,8 +1423,14 @@ insmnum = comp_mod(insmnum, lastpermmnum); for (minfo.group = amatches; minfo.group && (minfo.group)->mcount <= insmnum; - minfo.group = (minfo.group)->next) + minfo.group = (minfo.group)->next) { insmnum -= (minfo.group)->mcount; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(minfo.group->heap_id)) { + HEAP_ERROR(minfo.group->heap_id); + } +#endif + } if (!minfo.group) { minfo.cur = NULL; minfo.asked = 0; @@ -1473,15 +1509,21 @@ if (lastinvcount == invcount && listdat.valid && onlyexpl == listdat.onlyexpl && menuacc == listdat.menuacc && showall == listdat.showall && - lines == listdat.lines && columns == listdat.columns) + zterm_lines == listdat.zterm_lines && + zterm_columns == listdat.zterm_columns) return 0; lastinvcount = invcount; for (g = amatches; g; g = g->next) { char **pp = g->ylist; - int nl = 0, l, glong = 1, gshort = columns, ndisp = 0, totl = 0; + int nl = 0, l, glong = 1, gshort = zterm_columns, ndisp = 0, totl = 0; int hasf = 0; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif g->flags |= CGF_PACKED | CGF_ROWS; if (!onlyexpl && pp) { @@ -1495,7 +1537,7 @@ /* We have an ylist, lets see, if it contains newlines. */ hidden = 1; while (!nl && *pp) { - if (MB_METASTRWIDTH(*pp) >= columns) + if (MB_METASTRWIDTH(*pp) >= zterm_columns) nl = 1; else nl = !!strchr(*pp++, '\n'); @@ -1511,11 +1553,12 @@ while (*sptr) { if ((nlptr = strchr(sptr, '\n'))) { *nlptr = '\0'; - nlines += 1 + (MB_METASTRWIDTH(sptr)-1) / columns; + nlines += 1 + (MB_METASTRWIDTH(sptr)-1) / + zterm_columns; *nlptr = '\n'; sptr = nlptr + 1; } else { - nlines += (MB_METASTRWIDTH(sptr)-1) / columns; + nlines += (MB_METASTRWIDTH(sptr)-1) / zterm_columns; break; } } @@ -1607,7 +1650,7 @@ g->dcount = ndisp; g->width = glong + CM_SPACE; g->shortest = gshort + CM_SPACE; - if ((g->cols = columns / g->width) > g->dcount) + if ((g->cols = zterm_columns / g->width) > g->dcount) g->cols = g->dcount; if (g->cols) { i = g->cols * g->width - CM_SPACE; @@ -1622,6 +1665,11 @@ for (g = amatches; g; g = g->next) { glines = 0; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif zfree(g->widths, 0); g->widths = NULL; @@ -1636,9 +1684,10 @@ } else { g->cols = 1; g->width = 1; - + while (*pp) - glines += 1 + (MB_METASTRWIDTH(*pp++) / columns); + glines += 1 + (MB_METASTRWIDTH(*pp++) / + zterm_columns); } } } else { @@ -1650,15 +1699,17 @@ } else if (!(g->flags & CGF_LINES)) { g->cols = 1; g->width = 0; - + for (p = g->matches; (m = *p); p++) if (!(m->flags & CMF_HIDE)) { if (m->disp) { if (!(m->flags & CMF_DISPLINE)) - glines += 1 + ((mlens[m->gnum] - 1) / columns); + glines += 1 + ((mlens[m->gnum] - 1) / + zterm_columns); } else if (showall || !(m->flags & (CMF_NOLIST | CMF_MULT))) - glines += 1 + (((mlens[m->gnum]) - 1) / columns); + glines += 1 + (((mlens[m->gnum]) - 1) / + zterm_columns); } } } @@ -1669,8 +1720,8 @@ if (!(g->flags & CGF_PACKED)) continue; - ws = g->widths = (int *) zalloc(columns * sizeof(int)); - memset(ws, 0, columns * sizeof(int)); + ws = g->widths = (int *) zalloc(zterm_columns * sizeof(int)); + memset(ws, 0, zterm_columns * sizeof(int)); tlines = g->lins; tcols = g->cols; width = 0; @@ -1686,14 +1737,14 @@ if (g->flags & CGF_ROWS) { int nth, tcol, len; - for (tcols = columns / (g->shortest + CM_SPACE); + for (tcols = zterm_columns / (g->shortest + CM_SPACE); tcols > g->cols; tcols--) { memset(ws, 0, tcols * sizeof(int)); for (width = nth = tcol = 0, tlines = 1; - width < columns && nth < g->dcount; + width < zterm_columns && nth < g->dcount; nth++, tcol++) { m = *p; @@ -1709,13 +1760,13 @@ ws[tcol] = len; } } - if (width < columns) + if (width < zterm_columns) break; } } else { int nth, tcol, tline, len; - for (tcols = columns / (g->shortest + CM_SPACE); + for (tcols = zterm_columns / (g->shortest + CM_SPACE); tcols > g->cols; tcols--) { @@ -1725,7 +1776,7 @@ memset(ws, 0, tcols * sizeof(int)); for (width = nth = tcol = tline = 0; - width < columns && nth < g->dcount; + width < zterm_columns && nth < g->dcount; nth++, tline++) { m = *p; @@ -1745,7 +1796,7 @@ ws[tcol] = len; } } - if (width < columns) + if (width < zterm_columns) break; } } @@ -1754,7 +1805,7 @@ if (g->flags & CGF_ROWS) { int nth, tcol, len; - for (tcols = columns / (g->shortest + CM_SPACE); + for (tcols = zterm_columns / (g->shortest + CM_SPACE); tcols > g->cols; tcols--) { @@ -1762,7 +1813,7 @@ for (width = nth = tcol = 0, tlines = 1, p = skipnolist(g->matches, showall); - *p && width < columns && nth < g->dcount; + *p && width < zterm_columns && nth < g->dcount; nth++, p = skipnolist(p + 1, showall), tcol++) { m = *p; @@ -1779,13 +1830,13 @@ ws[tcol] = len; } } - if (width < columns) + if (width < zterm_columns) break; } } else { int nth, tcol, tline, len; - for (tcols = columns / (g->shortest + CM_SPACE); + for (tcols = zterm_columns / (g->shortest + CM_SPACE); tcols > g->cols; tcols--) { @@ -1796,7 +1847,7 @@ for (width = nth = tcol = tline = 0, p = skipnolist(g->matches, showall); - *p && width < columns && nth < g->dcount; + *p && width < zterm_columns && nth < g->dcount; nth++, p = skipnolist(p + 1, showall), tline++) { m = *p; @@ -1817,7 +1868,7 @@ ws[tcol] = len; } } - if (width < columns) { + if (width < zterm_columns) { if (++tcol < tcols) tcols = tcol; break; @@ -1828,7 +1879,7 @@ if (tcols <= g->cols) tlines = g->lins; if (tlines == g->lins) { - zfree(ws, columns * sizeof(int)); + zfree(ws, zterm_columns * sizeof(int)); g->widths = NULL; } else { nlines += tlines - g->lins; @@ -1853,6 +1904,11 @@ else for (g = amatches; g; g = g->next) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif zfree(g->widths, 0); g->widths = NULL; } @@ -1862,8 +1918,8 @@ listdat.nlines = nlines; listdat.menuacc = menuacc; listdat.onlyexpl = onlyexpl; - listdat.columns = columns; - listdat.lines = lines; + listdat.zterm_columns = zterm_columns; + listdat.zterm_lines = zterm_lines; listdat.showall = showall; return 1; @@ -1884,7 +1940,7 @@ if ((!minfo.cur || !minfo.asked) && ((complistmax > 0 && listdat.nlist >= complistmax) || (complistmax < 0 && listdat.nlines <= -complistmax) || - (!complistmax && listdat.nlines >= lines))) { + (!complistmax && listdat.nlines >= zterm_lines))) { int qup, l; zsetterm(); @@ -1893,7 +1949,7 @@ listdat.nlist, listdat.nlines) : fprintf(shout, "zsh: do you wish to see all %d lines? ", listdat.nlines)); - qup = ((l + columns - 1) / columns) - 1; + qup = ((l + zterm_columns - 1) / zterm_columns) - 1; fflush(shout); if (!getzlequery()) { if (clearflag) { @@ -1940,6 +1996,11 @@ for (g = amatches; g; g = g->next) { char **pp = g->ylist; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif if ((e = g->expls)) { int l; @@ -1987,7 +2048,7 @@ while ((p = *pp++)) { zputs(p, shout); if (*pp) { - if (MB_METASTRWIDTH(p) % columns) + if (MB_METASTRWIDTH(p) % zterm_columns) putc('\n', shout); else fputs(" \010", shout); @@ -2113,7 +2174,7 @@ if (clearflag) { /* Move the cursor up to the prompt, if always_last_prompt * * is set and all that... */ - if ((ml = listdat.nlines + nlnct - 1) < lines) { + if ((ml = listdat.nlines + nlnct - 1) < zterm_lines) { tcmultout(TCUP, TCMULTUP, ml); showinglist = -1; @@ -2134,12 +2195,18 @@ { Cmgroup g; Cmatch *mp, m; - int len = columns - 5, t, add = 0; - VARARR(char, buf, columns + 1); + int len = zterm_columns - 5, t, add = 0; + VARARR(char, buf, zterm_columns + 1); buf[0] = '\0'; - for (g = amatches; g && !g->mcount; g = g->next); + for (g = amatches; g && !g->mcount; g = g->next) { +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(g->heap_id)) { + HEAP_ERROR(g->heap_id); + } +#endif + } mp = g->matches; while (1) { @@ -2257,6 +2324,11 @@ #endif dat.matches = amatches; +#ifdef ZSH_HEAP_DEBUG + if (memory_validate(dat.matches->heap_id)) { + HEAP_ERROR(dat.matches->heap_id); + } +#endif dat.num = nmatches; dat.cur = NULL; ret = runhookdef(COMPLISTMATCHESHOOK, (void *) &dat); diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/computil.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/computil.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/computil.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/computil.c 2011-10-02 01:10:11.000000000 +0000 @@ -226,8 +226,8 @@ runp = &(cd_state.runs); if (cd_state.groups) { - int lines = cd_state.groups + cd_state.descs; - VARARR(Cdstr, grps, lines); + int preplines = cd_state.groups + cd_state.descs; + VARARR(Cdstr, grps, preplines); VARARR(int, wids, cd_state.maxg); Cdstr gs, gp, gn, *gpp; int i, j, d; @@ -275,7 +275,7 @@ if (cd_state.gprew > cd_state.maxmlen && cd_state.maxglen > 1) return 1; - for (i = 0; i < lines; i++) { + for (i = 0; i < preplines; i++) { Cdstr s = grps[i]; int dummy; @@ -283,9 +283,9 @@ unmetafy(s->sortstr, &dummy); } - qsort(grps, lines, sizeof(Cdstr), cd_sort); + qsort(grps, preplines, sizeof(Cdstr), cd_sort); - for (i = lines, strp = grps; i > 1; i--, strp++) { + for (i = preplines, strp = grps; i > 1; i--, strp++) { strp2 = strp + 1; if (!strcmp((*strp)->desc, (*strp2)->desc)) continue; @@ -303,9 +303,9 @@ expl = (Cdrun) zalloc(sizeof(*run)); expl->type = CRT_EXPL; expl->strs = grps[0]; - expl->count = lines; + expl->count = preplines; - for (i = lines, strp = grps, strp2 = NULL; i; i--, strp++) { + for (i = preplines, strp = grps, strp2 = NULL; i; i--, strp++) { str = *strp; *strp = str->other; if (strp2) @@ -321,7 +321,7 @@ *strp2 = NULL; for (i = cd_state.maxg - 1; i; i--) { - for (d = 0, j = lines, strp = grps; j; j--, strp++) { + for (d = 0, j = preplines, strp = grps; j; j--, strp++) { if ((str = *strp)) { if (d) { *runp = run = (Cdrun) zalloc(sizeof(*run)); @@ -465,7 +465,7 @@ cd_state.showd = disp; cd_state.maxg = cd_state.groups = cd_state.descs = 0; cd_state.maxmlen = atoi(mlen); - itmp = columns - cd_state.swidth - 4; + itmp = zterm_columns - cd_state.swidth - 4; if (cd_state.maxmlen > itmp) cd_state.maxmlen = itmp; if (cd_state.maxmlen < 4) @@ -545,7 +545,7 @@ args++; } if (disp && grp) { - int mg = columns; + int mg = zterm_columns; do { cd_group(mg); @@ -651,7 +651,8 @@ * is available. Leave 1 character at the end of screen * as safety margin */ - remw = columns - cd_state.premaxw - cd_state.swidth - 3; + remw = zterm_columns - cd_state.premaxw - + cd_state.swidth - 3; d = str->desc; w = MB_METASTRWIDTH(d); if (w <= remw) @@ -727,7 +728,8 @@ case CRT_EXPL: { /* add columns as safety margin */ - VARARR(char, dbuf, cd_state.suf + cd_state.slen + columns); + VARARR(char, dbuf, cd_state.suf + cd_state.slen + + zterm_columns); char buf[20], *p, *pp, *d; int i = run->count, remw, w, l; @@ -743,7 +745,8 @@ } strcpy(dbuf, cd_state.sep); - remw = columns - cd_state.gprew - cd_state.swidth - CM_SPACE; + remw = zterm_columns - cd_state.gprew - + cd_state.swidth - CM_SPACE; p = pp = dbuf + cd_state.slen; d = str->desc; w = MB_METASTRWIDTH(d); @@ -3355,7 +3358,6 @@ return 0; } - return 1; case 'D': /* This returns the description and action to use if we are at diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_hist.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_hist.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_hist.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_hist.c 2011-10-02 01:10:11.000000000 +0000 @@ -470,7 +470,7 @@ histpos++; /* ensure we're not on a combining character */ CCRIGHTPOS(histpos); - /* histpos from now on on is an index into the metafied string */ + /* histpos from now on is an index into the metafied string */ srch_str = zlelineasstring(zleline, histpos, 0, NULL, NULL, 0); } free(line); diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_main.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_main.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_main.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_main.c 2011-10-02 01:10:11.000000000 +0000 @@ -53,11 +53,6 @@ /**/ mod_export int incompctlfunc; -/* != 0 if we are in a new style completion function */ - -/**/ -mod_export int incompfunc; - /* != 0 if completion module is loaded */ /**/ @@ -633,7 +628,7 @@ /* * Make sure a user interrupt gets passed on straight away. */ - if (selret < 0 && errflag) + if (selret < 0 && (errflag || retflag || breaks || exit_pending)) break; /* * Try to avoid errors on our special fd's from @@ -875,7 +870,7 @@ icnt = 0; if (errno == EINTR) { die = 0; - if (!errflag && !retflag && !breaks) + if (!errflag && !retflag && !breaks && !exit_pending) continue; errflag = 0; breaks = obreaks; @@ -1233,7 +1228,7 @@ alarm(0); freeundo(); - if (eofsent) { + if (eofsent || errflag) { s = NULL; } else { zleline[zlell++] = ZWC('\n'); diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_move.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_move.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_move.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_move.c 2011-10-02 01:10:11.000000000 +0000 @@ -536,6 +536,9 @@ int ocs = zlecs, dir, ct; unsigned char oth, me; + if ((zlecs == zlell || zleline[zlecs] == '\n') && zlecs > 0) + DECCS(); + otog: if (zlecs == zlell || zleline[zlecs] == '\n') { zlecs = ocs; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_refresh.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_refresh.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_refresh.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_refresh.c 2011-10-02 01:10:11.000000000 +0000 @@ -341,7 +341,7 @@ match_highlight(*atrs + 8, &special_atr_on); special_atr_on_set = 1; } else if (strpfx("region:", *atrs)) { - match_highlight(*atrs + 7, ®ion_highlights->atr); + match_highlight(*atrs + 7, ®ion_highlights[0].atr); region_atr_on_set = 1; } else if (strpfx("isearch:", *atrs)) { match_highlight(*atrs + 8, &(region_highlights[1].atr)); @@ -357,7 +357,7 @@ if (!special_atr_on_set) special_atr_on = TXTSTANDOUT; if (!region_atr_on_set) - region_highlights->atr = TXTSTANDOUT; + region_highlights[0].atr = TXTSTANDOUT; if (!isearch_atr_on_set) region_highlights[1].atr = TXTUNDERLINE; if (!suffix_atr_on_set) @@ -688,12 +688,12 @@ { int ln; - winw = columns; /* terminal width */ + winw = zterm_columns; /* terminal width */ if (termflags & TERM_SHORT) winh = 1; else - winh = (lines < 2) ? 24 : lines; - rwinh = lines; /* keep the real number of lines */ + winh = (zterm_lines < 2) ? 24 : zterm_lines; + rwinh = zterm_lines; /* keep the real number of lines */ vln = vmaxln = winprompt = 0; winpos = -1; if (winw_alloc != winw || winh_alloc != winh) { @@ -1022,14 +1022,14 @@ /* check for region between point ($CURSOR) and mark ($MARK) */ if (region_active) { if (zlecs <= mark) { - region_highlights->start = zlecs; - region_highlights->end = mark; + region_highlights[0].start = zlecs; + region_highlights[0].end = mark; } else { - region_highlights->start = mark; - region_highlights->end = zlecs; + region_highlights[0].start = mark; + region_highlights[0].end = zlecs; } } else { - region_highlights->start = region_highlights->end = -1; + region_highlights[0].start = region_highlights[0].end = -1; } /* check for isearch string to highlight */ if (isearch_active) { @@ -1082,7 +1082,7 @@ cleareol = 0; /* unset */ more_start = more_end = 0; /* unset */ - if (isset(SINGLELINEZLE) || lines < 3 + if (isset(SINGLELINEZLE) || zterm_lines < 3 || (termflags & (TERM_NOUP | TERM_BAD | TERM_UNKNOWN))) termflags |= TERM_SHORT; else @@ -1138,7 +1138,7 @@ } fflush(shout); clearf = clearflag; - } else if (winw != columns || rwinh != lines) + } else if (winw != zterm_columns || rwinh != zterm_lines) resetvideo(); /* now winw equals columns and winh equals lines @@ -2004,7 +2004,7 @@ * last line lest undesired scrolling occurs due to `illegal' * characters on screen */ - if (tccan(TCINS) && (vln != lines - 1)) { + if (tccan(TCINS) && (vln != zterm_lines - 1)) { /* not on last line */ for (i = 1; nl[i].chr; i++) { if (tcinscost(i) < wpfxlen(ol, nl + i)) { @@ -2418,8 +2418,6 @@ all_atr_off = TXT_ATTR_OFF_FROM_ON(all_atr_on); if (tmpline[t0] == ZWC('\t')) { - REFRESH_ELEMENT sp = zr_sp; - sp.atr = base_atr_on; for (*vp++ = zr_sp; (vp - vbuf) & 7; ) *vp++ = zr_sp; vp[-1].atr |= base_atr_off; diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_tricky.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_tricky.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_tricky.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_tricky.c 2011-10-02 01:10:11.000000000 +0000 @@ -398,7 +398,18 @@ /**/ mod_export char *varname; -/* != 0 if we are in a subscript */ +/* + * != 0 if we are in a subscript. + * Of course, this being the completion code, you're expected to guess + * what the different numbers actually mean, but here's a cheat: + * 1: Key of an ordinary array + * 2: Key of a hash + * 3: Ummm.... this appears to be a special case of 2. After a lot + * of uncommented code looking for groups of brackets, we suddenly + * decide to set it to 2. The only upshot seems to be that compctl + * then doesn't add a matching ']' at the end, so I think it means + * there's one there already. + */ /**/ mod_export int insubscr; @@ -529,7 +540,7 @@ * or $'...'). */ char *b = p + 1, *e = b; - int n = 0, br = 1, nest = 0; + int n = 0, br = 1; if (*b == Inbrace) { char *tb = b; @@ -541,10 +552,6 @@ /* Ignore the possible (...) flags. */ b++, br++; n = skipparens(Inpar, Outpar, &b); - - for (tb = p - 1; tb > s && *tb != Outbrace && *tb != Inbrace; tb--); - if (tb > s && *tb == Inbrace && (tb[-1] == String || *tb == Qstring)) - nest = 1; } /* Ignore the stuff before the parameter name. */ @@ -2150,10 +2157,6 @@ ss = quotename(ss, NULL); untokenize(ss); inststr(ss); -#if 0 - if (olst != COMP_EXPAND_COMPLETE || nonempty(vl) || - (zlemetacs && zlemetaline[zlemetacs-1] != '/')) { -#endif if (nonempty(vl) || !first) { spaceinline(1); zlemetaline[zlemetacs++] = ' '; @@ -2419,13 +2422,13 @@ if (tccan(TCCLEAREOL)) tcout(TCCLEAREOL); else { - int s = columns - 1 - (cc % columns); + int s = zterm_columns - 1 - (cc % zterm_columns); while (s-- > 0) putc(' ', shout); } } - l += 1 + ((cc - 1) / columns); + l += 1 + ((cc - 1) / zterm_columns); cc = 0; if (dopr) putc('\n', shout); @@ -2445,18 +2448,18 @@ } else p += clen; cc += WCWIDTH_WINT(cchar); - if (dopr && !(cc % columns)) + if (dopr && !(cc % zterm_columns)) fputs(" \010", shout); } } } if (dopr) { - if (!(cc % columns)) + if (!(cc % zterm_columns)) fputs(" \010", shout); if (tccan(TCCLEAREOL)) tcout(TCCLEAREOL); else { - int s = columns - 1 - (cc % columns); + int s = zterm_columns - 1 - (cc % zterm_columns); while (s-- > 0) putc(' ', shout); @@ -2467,7 +2470,7 @@ * cc is correct, i.e. if just misses wrapping we still add 1. * (Why?) */ - return l + (cc / columns); + return l + (cc / zterm_columns); } /* This is used to print expansions. */ @@ -2481,8 +2484,8 @@ LinkNode node; char **p; VARARR(int, lens, num); - VARARR(int, widths, columns); - int longest = 0, shortest = columns, totl = 0; + VARARR(int, widths, zterm_columns); + int longest = 0, shortest = zterm_columns, totl = 0; int len, ncols, nlines, tolast, col, i, max, pack = 0, *lenp; for (node = firstnode(l), p = data; node; incnode(node), p++) @@ -2500,7 +2503,7 @@ shortest = len; totl += len; } - if ((ncols = ((columns + 2) / longest))) { + if ((ncols = ((zterm_columns + 2) / longest))) { int tlines = 0, tline, tcols = 0, maxlen, nth, width; nlines = (num + ncols - 1) / ncols; @@ -2509,7 +2512,7 @@ if (isset(LISTROWSFIRST)) { int count, tcol, first, maxlines = 0, llines; - for (tcols = columns / shortest; tcols > ncols; + for (tcols = zterm_columns / shortest; tcols > ncols; tcols--) { for (nth = first = maxlen = width = maxlines = llines = tcol = 0, @@ -2522,7 +2525,7 @@ nth += tcols; tlines++; if (nth >= num) { - if ((width += maxlen) >= columns) + if ((width += maxlen) >= zterm_columns) break; widths[tcol++] = maxlen; maxlen = 0; @@ -2536,13 +2539,13 @@ widths[tcol++] = maxlen; width += maxlen; } - if (!count && width < columns) + if (!count && width < zterm_columns) break; } if (tcols > ncols) tlines = maxlines; } else { - for (tlines = ((totl + columns) / columns); + for (tlines = ((totl + zterm_columns) / zterm_columns); tlines < nlines; tlines++) { for (p = data, nth = tline = width = maxlen = tcols = 0; @@ -2550,7 +2553,7 @@ if (lens[nth] > maxlen) maxlen = lens[nth]; if (++tline == tlines) { - if ((width += maxlen) >= columns) + if ((width += maxlen) >= zterm_columns) break; widths[tcols++] = maxlen; maxlen = tline = 0; @@ -2560,7 +2563,7 @@ widths[tcols++] = maxlen; width += maxlen; } - if (nth == num && width < columns) + if (nth == num && width < zterm_columns) break; } } @@ -2572,7 +2575,7 @@ } else { nlines = 0; for (p = data; *p; p++) - nlines += 1 + (strlen(*p) / columns); + nlines += 1 + (strlen(*p) / zterm_columns); } /* Set the cursor below the prompt. */ trashzle(); @@ -2581,7 +2584,7 @@ clearflag = (isset(USEZLE) && !termflags && tolast); max = getiparam("LISTMAX"); - if ((max && num > max) || (!max && nlines > lines)) { + if ((max && num > max) || (!max && nlines > zterm_lines)) { int qup, l; zsetterm(); @@ -2589,7 +2592,7 @@ fprintf(shout, "zsh: do you wish to see all %d possibilities (%d lines)? ", num, nlines) : fprintf(shout, "zsh: do you wish to see all %d lines? ", nlines)); - qup = ((l + columns - 1) / columns) - 1; + qup = ((l + zterm_columns - 1) / zterm_columns) - 1; fflush(shout); if (!getzlequery()) { if (clearflag) { @@ -2656,7 +2659,7 @@ } } if (clearflag) { - if ((nlines += nlnct - 1) < lines) { + if ((nlines += nlnct - 1) < zterm_lines) { tcmultout(TCUP, TCMULTUP, nlines); showinglist = -1; } else diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_utils.c zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_utils.c --- zsh-beta-4.3.11-dev-1+20110504/Src/Zle/zle_utils.c 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/Zle/zle_utils.c 2011-10-02 01:10:11.000000000 +0000 @@ -596,7 +596,7 @@ */ /**/ -void +mod_export void zle_save_positions(void) { struct region_highlight *rhp; @@ -653,7 +653,7 @@ */ /**/ -void +mod_export void zle_restore_positions(void) { struct zle_position *oldpos = zle_positions; @@ -1257,7 +1257,7 @@ p++; putc('\n', shout); - up += 1 + cc / columns; + up += 1 + cc / zterm_columns; cc = 0; } else { /* @@ -1308,7 +1308,7 @@ c = *++p ^ 32; if(c == '\n') { putc('\n', shout); - up += 1 + cc / columns; + up += 1 + cc / zterm_columns; cc = 0; } else { char const *n = nicechar(c); @@ -1317,7 +1317,7 @@ } } #endif - up += cc / columns; + up += cc / zterm_columns; if (clearflag) { putc('\r', shout); diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/zsh.h zsh-beta-4.3.12-dev-1+20110925/Src/zsh.h --- zsh-beta-4.3.11-dev-1+20110504/Src/zsh.h 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/zsh.h 2011-10-02 01:10:11.000000000 +0000 @@ -907,6 +907,8 @@ #define STAT_ATTACH (0x1000) /* delay reattaching shell to tty */ #define STAT_SUBLEADER (0x2000) /* is super-job, but leader is sub-shell */ +#define STAT_BUILTIN (0x4000) /* job at tail of pipeline is a builtin */ + #define SP_RUNNING -1 /* fake status for jobs currently running */ struct timeinfo { @@ -2327,11 +2329,68 @@ * Memory management * *********************/ +/* + * A Heapid is a type for identifying, uniquely up to the point where + * the count of new identifiers wraps. all heaps that are or + * (importantly) have been valid. Each valid heap is given an + * identifier, and every time we push a heap we save the old identifier + * and give the heap a new identifier so that when the heap is popped + * or freed we can spot anything using invalid memory from the popped + * heap. + * + * We could make this unsigned long long if we wanted a big range. + */ +typedef unsigned int Heapid; + +#ifdef ZSH_HEAP_DEBUG + +/* printf format specifier corresponding to Heapid */ +#define HEAPID_FMT "%x" + +/* Marker that memory is permanently allocated */ +#define HEAPID_PERMANENT (UINT_MAX) + +/* + * Heap debug verbosity. + * Bits to be 'or'ed into the variable also called heap_debug_verbosity. + */ +enum heap_debug_verbosity { + /* Report when we push a heap */ + HDV_PUSH = 0x01, + /* Report when we pop a heap */ + HDV_POP = 0x02, + /* Report when we create a new heap from which to allocate */ + HDV_CREATE = 0x04, + /* Report every time we free a complete heap */ + HDV_FREE = 0x08, + /* Report when we temporarily install a new set of heaps */ + HDV_NEW = 0x10, + /* Report when we restore an old set of heaps */ + HDV_OLD = 0x20, + /* Report when we temporarily switch heaps */ + HDV_SWITCH = 0x40, + /* + * Report every time we allocate memory from the heap. + * This is very verbose, and arguably not very useful: we + * would expect to allocate memory from a heap we create. + * For much debugging heap_debug_verbosity = 0x7f should be sufficient. + */ + HDV_ALLOC = 0x80 +}; + +#define HEAP_ERROR(heap_id) \ + fprintf(stderr, "%s:%d: HEAP DEBUG: invalid heap: " HEAPID_FMT ".\n", \ + __FILE__, __LINE__, heap_id) +#endif + /* heappush saves the current heap state using this structure */ struct heapstack { struct heapstack *next; /* next one in list for this heap */ size_t used; +#ifdef ZSH_HEAP_DEBUG + Heapid heap_id; +#endif }; /* A zsh heap. */ @@ -2342,6 +2401,10 @@ size_t used; /* bytes used from the heap */ struct heapstack *sp; /* used by pushheap() to save the value used */ +#ifdef ZSH_HEAP_DEBUG + unsigned int heap_id; +#endif + /* Uncomment the following if the struct needs padding to 64-bit size. */ /* Make sure sizeof(heap) is a multiple of 8 #if defined(PAD_64_BIT) && !defined(__GNUC__) diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/zsh.mdd zsh-beta-4.3.12-dev-1+20110925/Src/zsh.mdd --- zsh-beta-4.3.11-dev-1+20110504/Src/zsh.mdd 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/zsh.mdd 2011-10-02 01:10:11.000000000 +0000 @@ -9,13 +9,14 @@ # autobins not specified because of alwayslink -objects="builtin.o compat.o cond.o exec.o glob.o hashtable.o \ +objects="builtin.o compat.o cond.o exec.o glob.o hashtable.o hashnameddir.o \ hist.o init.o input.o jobs.o lex.o linklist.o loop.o math.o \ mem.o module.o options.o params.o parse.o pattern.o prompt.o signals.o \ signames.o sort.o string.o subst.o text.o utils.o watch.o" -headers="../config.h system.h zsh.h sigcount.h signals.h \ +headers="../config.h zsh_system.h zsh.h sigcount.h signals.h \ prototypes.h hashtable.h ztype.h" +hdrdeps="zshcurses.h zshterm.h" :<<\Make @CONFIG_MK@ @@ -35,9 +36,6 @@ params.o: patchlevel.h -# The main shell doesn't currently need zshcurses.h and zshterm.h, -# but make sure these are built with the headers. -# If it did need need them they would be in headers at the top instead. version.h: $(sdir_top)/Config/version.mk zshcurses.h zshterm.h echo '#define ZSH_VERSION "'$(VERSION)'"' > $@ @@ -127,7 +125,7 @@ # This is not properly part of this module, but it is built as if it were. main.o: main.c zsh.mdh main.epro - $(CC) -c -I. $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c + $(CC) -c -I. -I$(sdir_top)/Src $(CPPFLAGS) $(DEFS) $(CFLAGS) -o $@ $(sdir)/main.c main.syms: $(PROTODEPS) proto.zsh: main.epro diff -Nru zsh-beta-4.3.11-dev-1+20110504/Src/zsh_system.h zsh-beta-4.3.12-dev-1+20110925/Src/zsh_system.h --- zsh-beta-4.3.11-dev-1+20110504/Src/zsh_system.h 1970-01-01 00:00:00.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Src/zsh_system.h 2011-10-02 01:10:11.000000000 +0000 @@ -0,0 +1,876 @@ +/* + * system.h - system configuration header file + * + * This file is part of zsh, the Z shell. + * + * Copyright (c) 1992-1997 Paul Falstad + * All rights reserved. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and to distribute modified versions of this software for any + * purpose, provided that the above copyright notice and the following + * two paragraphs appear in all copies of this software. + * + * In no event shall Paul Falstad or the Zsh Development Group be liable + * to any party for direct, indirect, special, incidental, or consequential + * damages arising out of the use of this software and its documentation, + * even if Paul Falstad and the Zsh Development Group have been advised of + * the possibility of such damage. + * + * Paul Falstad and the Zsh Development Group specifically disclaim any + * warranties, including, but not limited to, the implied warranties of + * merchantability and fitness for a particular purpose. The software + * provided hereunder is on an "as is" basis, and Paul Falstad and the + * Zsh Development Group have no obligation to provide maintenance, + * support, updates, enhancements, or modifications. + * + */ + +#if 0 +/* + * Setting _XPG_IV here is actually wrong and is not needed + * with currently supported versions (5.43C20 and above) + */ +#ifdef sinix +# define _XPG_IV 1 +#endif +#endif + +#if defined(__linux) || defined(__GNU__) || defined(__GLIBC__) || defined(LIBC_MUSL) +/* + * Turn on numerous extensions. + * This is in order to get the functions for manipulating /dev/ptmx. + */ +#define _GNU_SOURCE 1 +#endif +#ifdef LIBC_MUSL +#define _POSIX_C_SOURCE 200809L +#endif + +/* NeXT has half-implemented POSIX support * + * which currently fools configure */ +#ifdef __NeXT__ +# undef HAVE_TERMIOS_H +# undef HAVE_SYS_UTSNAME_H +#endif + +#ifndef ZSH_NO_XOPEN +# ifdef ZSH_CURSES_SOURCE +# define _XOPEN_SOURCE_EXTENDED 1 +# else +# ifdef MULTIBYTE_SUPPORT +/* + * Needed for wcwidth() which is part of XSI. + * Various other uses of the interface mean we can't get away with just + * _XOPEN_SOURCE. + */ +# define _XOPEN_SOURCE_EXTENDED 1 +# endif /* MULTIBYTE_SUPPORT */ +# endif /* ZSH_CURSES_SOURCE */ +#endif /* ZSH_NO_XOPEN */ + +/* + * Solaris by default zeroes all elements of the tm structure in + * strptime(). Unfortunately that gives us no way of telling whether + * the tm_isdst element has been set from the input pattern. If it + * hasn't we want it to be -1 (undetermined) on input to mktime(). So + * we stop strptime() zeroing the struct tm and instead set all the + * elements ourselves. + * + * This is likely to be harmless everywhere else. + */ +#define _STRPTIME_DONTZERO + +#ifdef PROTOTYPES +# define _(Args) Args +#else +# define _(Args) () +#endif + +#ifndef HAVE_ALLOCA +# define alloca zhalloc +#else +# ifdef __GNUC__ +# define alloca __builtin_alloca +# else +# if HAVE_ALLOCA_H +# include +# else +# ifdef _AIX + # pragma alloca +# else +# ifndef alloca +char *alloca _((size_t)); +# endif +# endif +# endif +# endif +#endif + +/* + * libc.h in an optional package for Debian Linux is broken (it + * defines dup() as a synonym for dup2(), which has a different + * number of arguments), so just include it for next. + */ +#ifdef __NeXT__ +# ifdef HAVE_LIBC_H +# include +# endif +#endif + +#ifdef HAVE_SYS_TYPES_H +# include +#endif + +#ifdef HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_STDDEF_H +/* + * Seen on Solaris 8 with gcc: stddef defines offsetof, which clashes + * with system.h's definition of the symbol unless we include this + * first. Otherwise, this will be hooked in by wchar.h, too late + * for comfort. + */ +#include +#endif + +#include +#include +#include +#include +#include + +#ifdef HAVE_PWD_H +# include +#endif + +#ifdef HAVE_GRP_H +# include +#endif + +#ifdef HAVE_DIRENT_H +# include +#else /* !HAVE_DIRENT_H */ +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +# define dirent direct +# undef HAVE_STRUCT_DIRENT_D_INO +# undef HAVE_STRUCT_DIRENT_D_STAT +# ifdef HAVE_STRUCT_DIRECT_D_INO +# define HAVE_STRUCT_DIRENT_D_INO HAVE_STRUCT_DIRECT_D_INO +# endif +# ifdef HAVE_STRUCT_DIRECT_D_STAT +# define HAVE_STRUCT_DIRENT_D_STAT HAVE_STRUCT_DIRECT_D_STAT +# endif +#endif /* !HAVE_DIRENT_H */ + +#ifdef HAVE_STDLIB_H +# ifdef ZSH_MEM + /* malloc and calloc are macros in GNU's stdlib.h unless the + * the __MALLOC_0_RETURNS_NULL macro is defined */ +# define __MALLOC_0_RETURNS_NULL +# endif +# include +#endif + +/* + * Stuff with variable arguments. We use definitions to make the + * same code work with varargs (the original K&R-style, just to + * be maximally compatible) and stdarg (which all modern systems + * should have). + * + * Ideally this should somehow be merged with the tricks performed + * with "_" in makepro.awk, but I don't understand makepro.awk. + * Currently we simply rely on the fact that makepro.awk has been + * hacked to leave alone argument lists that already contains VA_ALIST + * except for removing the VA_DCL and turning VA_ALIST into VA_ALIST_PROTO. + */ +#ifdef HAVE_STDARG_H +# include +# define VA_ALIST1(x) x, ... +# define VA_ALIST2(x,y) x, y, ... +# define VA_ALIST_PROTO1(x) VA_ALIST1(x) +# define VA_ALIST_PROTO2(x,y) VA_ALIST2(x,y) +# define VA_DCL +# define VA_DEF_ARG(x) +# define VA_START(ap,x) va_start(ap, x) +# define VA_GET_ARG(ap,x,t) +#else +# if HAVE_VARARGS_H +# include +# define VA_ALIST1(x) va_alist +# define VA_ALIST2(x,y) va_alist +/* + * In prototypes, assume K&R form and remove the variable list. + * This is about the best we can do without second-guessing the way + * varargs works on this system. The _ trick should be able to + * do this for us but we've turned it off here. + */ +# define VA_ALIST_PROTO1(x) +# define VA_ALIST_PROTO2(x,y) +# define VA_DCL va_dcl +# define VA_DEF_ARG(x) x +# define VA_START(ap,x) va_start(ap); +# define VA_GET_ARG(ap,x,t) (x = va_arg(ap, t)) +# else +# error "Your system has neither stdarg.h or varargs.h." +# endif +#endif + +#ifdef HAVE_ERRNO_H +# include +#endif + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +/* This is needed by some old SCO unices */ +#if !defined(HAVE_STRUCT_TIMEZONE) && !defined(ZSH_OOT_MODULE) +struct timezone { + int tz_minuteswest; + int tz_dsttime; +}; +#endif + +/* There's more than one non-standard way to get at this data */ +#if !defined(HAVE_STRUCT_DIRENT_D_INO) && defined(HAVE_STRUCT_DIRENT_D_STAT) +# define d_ino d_stat.st_ino +# define HAVE_STRUCT_DIRENT_D_INO HAVE_STRUCT_DIRENT_D_STAT +#endif /* !HAVE_STRUCT_DIRENT_D_INO && HAVE_STRUCT_DIRENT_D_STAT */ + +/* Sco needs the following include for struct utimbuf * + * which is strange considering we do not use that * + * anywhere in the code */ +#ifdef __sco +# include +#endif + +#ifdef HAVE_SYS_TIMES_H +# include +#endif + +#if STDC_HEADERS || HAVE_STRING_H +# include +/* An ANSI string.h and pre-ANSI memory.h might conflict. */ +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif /* not STDC_HEADERS and HAVE_MEMORY_H */ +#else /* not STDC_HEADERS and not HAVE_STRING_H */ +# include +/* memory.h and strings.h conflict on some systems. */ +#endif /* not STDC_HEADERS and not HAVE_STRING_H */ + +#ifdef HAVE_LOCALE_H +# include +#endif + +#ifdef HAVE_LIMITS_H +# include +#endif + +#ifdef HAVE_VARIABLE_LENGTH_ARRAYS +# define VARARR(X,Y,Z) X (Y)[Z] +#else +# define VARARR(X,Y,Z) X *(Y) = (X *) alloca(sizeof(X) * (Z)) +#endif + +/* we should handle unlimited sizes from pathconf(_PC_PATH_MAX) */ +/* but this is too much trouble */ +#ifndef PATH_MAX +# ifdef MAXPATHLEN +# define PATH_MAX MAXPATHLEN +# else +# ifdef _POSIX_PATH_MAX +# define PATH_MAX _POSIX_PATH_MAX +# else + /* so we will just pick something */ +# define PATH_MAX 1024 +# endif +# endif +#endif + +/* + * The number of file descriptors we'll allocate initially. + * We will reallocate later if necessary. + */ +#define ZSH_INITIAL_OPEN_MAX 64 +#ifndef OPEN_MAX +# ifdef NOFILE +# define OPEN_MAX NOFILE +# else + /* so we will just pick something */ +# define OPEN_MAX ZSH_INITIAL_OPEN_MAX +# endif +#endif +#ifndef HAVE_SYSCONF +# define zopenmax() ((long) (OPEN_MAX > ZSH_INITIAL_OPEN_MAX ? \ + ZSH_INITIAL_OPEN_MAX : OPEN_MAX)) +#endif + +#ifdef HAVE_FCNTL_H +# include +#else +# include +#endif + +/* The following will only be defined if is POSIX. * + * So we don't have to worry about union wait. But some machines * + * (NeXT) include from other include files, so we * + * need to undef and then redefine the wait macros if * + * is not POSIX. */ + +#ifdef HAVE_SYS_WAIT_H +# include +#else +# undef WIFEXITED +# undef WEXITSTATUS +# undef WIFSIGNALED +# undef WTERMSIG +# undef WCOREDUMP +# undef WIFSTOPPED +# undef WSTOPSIG +#endif + +/* missing macros for wait/waitpid/wait3 */ +#ifndef WIFEXITED +# define WIFEXITED(X) (((X)&0377)==0) +#endif +#ifndef WEXITSTATUS +# define WEXITSTATUS(X) (((X)>>8)&0377) +#endif +#ifndef WIFSIGNALED +# define WIFSIGNALED(X) (((X)&0377)!=0&&((X)&0377)!=0177) +#endif +#ifndef WTERMSIG +# define WTERMSIG(X) ((X)&0177) +#endif +#ifndef WCOREDUMP +# define WCOREDUMP(X) ((X)&0200) +#endif +#ifndef WIFSTOPPED +# define WIFSTOPPED(X) (((X)&0377)==0177) +#endif +#ifndef WSTOPSIG +# define WSTOPSIG(X) (((X)>>8)&0377) +#endif + +#ifdef HAVE_SYS_SELECT_H +# ifndef TIME_H_SELECT_H_CONFLICTS +# include +# endif +#elif defined(SELECT_IN_SYS_SOCKET_H) +# include +#endif + +#if defined(__APPLE__) && defined(HAVE_SELECT) +/* + * Prefer select() to poll() on MacOS X since poll() is known + * to be problematic in 10.4 + */ +#undef HAVE_POLL +#undef HAVE_POLL_H +#endif + +#ifdef HAVE_SYS_FILIO_H +# include +#endif + +#ifdef HAVE_TERMIOS_H +# ifdef __sco + /* termios.h includes sys/termio.h instead of sys/termios.h; * + * hence the declaration for struct termios is missing */ +# include +# else +# include +# endif +# ifdef _POSIX_VDISABLE +# define VDISABLEVAL _POSIX_VDISABLE +# else +# define VDISABLEVAL 0 +# endif +# define HAS_TIO 1 +#else /* not TERMIOS */ +# ifdef HAVE_TERMIO_H +# include +# define VDISABLEVAL -1 +# define HAS_TIO 1 +# else /* not TERMIOS and TERMIO */ +# include +# endif /* HAVE_TERMIO_H */ +#endif /* HAVE_TERMIOS_H */ + +#if defined(GWINSZ_IN_SYS_IOCTL) || defined(IOCTL_IN_SYS_IOCTL) +# include +#endif +#ifdef WINSIZE_IN_PTEM +# include +# include +#endif + +#ifdef HAVE_SYS_PARAM_H +# include +#endif + +#ifdef HAVE_SYS_UTSNAME_H +# include +#endif + +#define DEFAULT_WORDCHARS "*?_-.[]~=/&;!#$%^(){}<>" +#define DEFAULT_TIMEFMT "%J %U user %S system %P cpu %*E total" + +/* Posix getpgrp takes no argument, while the BSD version * + * takes the process ID as an argument */ +#ifdef GETPGRP_VOID +# define GETPGRP() getpgrp() +#else +# define GETPGRP() getpgrp(0) +#endif + +#ifndef HAVE_GETLOGIN +# define getlogin() cuserid(NULL) +#endif + +#ifdef HAVE_SETPGID +# define setpgrp setpgid +#endif + +/* can we set the user/group id of a process */ + +#ifndef HAVE_SETUID +# ifdef HAVE_SETREUID +# define setuid(X) setreuid(X,X) +# define setgid(X) setregid(X,X) +# define HAVE_SETUID +# endif +#endif + +/* can we set the effective user/group id of a process */ + +#ifndef HAVE_SETEUID +# ifdef HAVE_SETREUID +# define seteuid(X) setreuid(-1,X) +# define setegid(X) setregid(-1,X) +# define HAVE_SETEUID +# else +# ifdef HAVE_SETRESUID +# define seteuid(X) setresuid(-1,X,-1) +# define setegid(X) setresgid(-1,X,-1) +# define HAVE_SETEUID +# endif +# endif +#endif + +#ifdef HAVE_SYS_RESOURCE_H +# include +# if defined(__hpux) && !defined(RLIMIT_CPU) +/* HPUX does have the BSD rlimits in the kernel. Officially they are * + * unsupported but quite a few of them like RLIMIT_CORE seem to work. * + * All the following are in the but made visible * + * only for the kernel. */ +# define RLIMIT_CPU 0 +# define RLIMIT_FSIZE 1 +# define RLIMIT_DATA 2 +# define RLIMIT_STACK 3 +# define RLIMIT_CORE 4 +# define RLIMIT_RSS 5 +# define RLIMIT_NOFILE 6 +# define RLIMIT_OPEN_MAX RLIMIT_NOFILE +# define RLIM_NLIMITS 7 +# define RLIM_INFINITY 0x7fffffff +# endif +#endif + +/* we use the SVR4 constant instead of the BSD one */ +#if !defined(RLIMIT_NOFILE) && defined(RLIMIT_OFILE) +# define RLIMIT_NOFILE RLIMIT_OFILE +#endif +#if !defined(RLIMIT_VMEM) && defined(RLIMIT_AS) +# define RLIMIT_VMEM RLIMIT_AS +#endif + +#ifdef HAVE_SYS_CAPABILITY_H +# include +#endif + +/* DIGBUFSIZ is the length of a buffer which can hold the -LONG_MAX-1 * + * (or with ZSH_64_BIT_TYPE maybe -LONG_LONG_MAX-1) * + * converted to printable decimal form including the sign and the * + * terminating null character. Below 0.30103 > lg 2. * + * BDIGBUFSIZE is for a number converted to printable binary form. */ +#define DIGBUFSIZE ((int)(((sizeof(zlong) * 8) - 1) * 30103/100000) + 3) +#define BDIGBUFSIZE ((int)((sizeof(zlong) * 8) + 4)) + +/* If your stat macros are broken, we will * + * just undefine them. */ + +#ifdef STAT_MACROS_BROKEN +# undef S_ISBLK +# undef S_ISCHR +# undef S_ISDIR +# undef S_ISDOOR +# undef S_ISFIFO +# undef S_ISLNK +# undef S_ISMPB +# undef S_ISMPC +# undef S_ISNWK +# undef S_ISOFD +# undef S_ISOFL +# undef S_ISREG +# undef S_ISSOCK +#endif /* STAT_MACROS_BROKEN. */ + +/* If you are missing the stat macros, we * + * define our own */ + +#ifndef S_IFMT +# define S_IFMT 0170000 +#endif + +#if !defined(S_ISBLK) && defined(S_IFBLK) +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +#endif +#if !defined(S_ISCHR) && defined(S_IFCHR) +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +#endif +#if !defined(S_ISDIR) && defined(S_IFDIR) +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif +#if !defined(S_ISDOOR) && defined(S_IFDOOR) /* Solaris */ +# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR) +#endif +#if !defined(S_ISFIFO) && defined(S_IFIFO) +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +#endif +#if !defined(S_ISLNK) && defined(S_IFLNK) +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */ +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +#endif +#if !defined(S_ISMPC) && defined(S_IFMPC) /* V7 */ +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +#endif +#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */ +# define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK) +#endif +#if !defined(S_ISOFD) && defined(S_IFOFD) /* Cray */ +# define S_ISOFD(m) (((m) & S_IFMT) == S_IFOFD) +#endif +#if !defined(S_ISOFL) && defined(S_IFOFL) /* Cray */ +# define S_ISOFL(m) (((m) & S_IFMT) == S_IFOFL) +#endif +#if !defined(S_ISREG) && defined(S_IFREG) +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +#endif +#if !defined(S_ISSOCK) && defined(S_IFSOCK) +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +#endif + +/* We will pretend to have all file types on any system. */ + +#ifndef S_ISBLK +# define S_ISBLK(m) ((void)(m), 0) +#endif +#ifndef S_ISCHR +# define S_ISCHR(m) ((void)(m), 0) +#endif +#ifndef S_ISDIR +# define S_ISDIR(m) ((void)(m), 0) +#endif +#ifndef S_ISDOOR +# define S_ISDOOR(m) ((void)(m), 0) +#endif +#ifndef S_ISFIFO +# define S_ISFIFO(m) ((void)(m), 0) +#endif +#ifndef S_ISLNK +# define S_ISLNK(m) ((void)(m), 0) +#endif +#ifndef S_ISMPB +# define S_ISMPB(m) ((void)(m), 0) +#endif +#ifndef S_ISMPC +# define S_ISMPC(m) ((void)(m), 0) +#endif +#ifndef S_ISNWK +# define S_ISNWK(m) ((void)(m), 0) +#endif +#ifndef S_ISOFD +# define S_ISOFD(m) ((void)(m), 0) +#endif +#ifndef S_ISOFL +# define S_ISOFL(m) ((void)(m), 0) +#endif +#ifndef S_ISREG +# define S_ISREG(m) ((void)(m), 0) +#endif +#ifndef S_ISSOCK +# define S_ISSOCK(m) ((void)(m), 0) +#endif + +/* file mode permission bits */ + +#ifndef S_ISUID +# define S_ISUID 04000 +#endif +#ifndef S_ISGID +# define S_ISGID 02000 +#endif +#ifndef S_ISVTX +# define S_ISVTX 01000 +#endif +#ifndef S_IRUSR +# define S_IRUSR 00400 +#endif +#ifndef S_IWUSR +# define S_IWUSR 00200 +#endif +#ifndef S_IXUSR +# define S_IXUSR 00100 +#endif +#ifndef S_IRGRP +# define S_IRGRP 00040 +#endif +#ifndef S_IWGRP +# define S_IWGRP 00020 +#endif +#ifndef S_IXGRP +# define S_IXGRP 00010 +#endif +#ifndef S_IROTH +# define S_IROTH 00004 +#endif +#ifndef S_IWOTH +# define S_IWOTH 00002 +#endif +#ifndef S_IXOTH +# define S_IXOTH 00001 +#endif +#ifndef S_IRWXU +# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) +#endif +#ifndef S_IRWXG +# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) +#endif +#ifndef S_IRWXO +# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) +#endif +#ifndef S_IRUGO +# define S_IRUGO (S_IRUSR|S_IRGRP|S_IROTH) +#endif +#ifndef S_IWUGO +# define S_IWUGO (S_IWUSR|S_IWGRP|S_IWOTH) +#endif +#ifndef S_IXUGO +# define S_IXUGO (S_IXUSR|S_IXGRP|S_IXOTH) +#endif + +#ifndef HAVE_LSTAT +# define lstat stat +#endif + +#ifndef HAVE_READLINK +# define readlink(PATH, BUF, BUFSZ) \ + ((void)(PATH), (void)(BUF), (void)(BUFSZ), errno = ENOSYS, -1) +#endif + +#ifndef F_OK /* missing macros for access() */ +# define F_OK 0 +# define X_OK 1 +# define W_OK 2 +# define R_OK 4 +#endif + +#ifndef HAVE_LCHOWN +# define lchown chown +#endif + +#ifndef HAVE_MEMCPY +# define memcpy memmove +#endif + +#ifndef HAVE_MEMMOVE +# define memmove(dest, src, len) bcopy((src), (dest), (len)) +#endif + +#ifndef offsetof +# define offsetof(TYPE, MEM) ((char *)&((TYPE *)0)->MEM - (char *)(TYPE *)0) +#endif + +extern char **environ; + +/* + * We always need setenv and unsetenv in pairs, because + * we don't know how to do memory management on the values set. + */ +#if defined(HAVE_SETENV) && defined(HAVE_UNSETENV) +# define USE_SET_UNSET_ENV +#endif + + +/* These variables are sometimes defined in, * + * and needed by, the termcap library. */ +#if MUST_DEFINE_OSPEED +extern char PC, *BC, *UP; +extern short ospeed; +#endif + +#ifndef O_NOCTTY +# define O_NOCTTY 0 +#endif + +#ifdef _LARGEFILE_SOURCE +#ifdef HAVE_FSEEKO +#define fseek fseeko +#endif +#ifdef HAVE_FTELLO +#define ftell ftello +#endif +#endif + +/* Can't support job control without working tcsetgrp() */ +#ifdef BROKEN_TCSETPGRP +#undef JOB_CONTROL +#endif /* BROKEN_TCSETPGRP */ + +#ifdef BROKEN_KILL_ESRCH +#undef ESRCH +#define ESRCH EINVAL +#endif /* BROKEN_KILL_ESRCH */ + +/* Can we do locale stuff? */ +#undef USE_LOCALE +#if defined(CONFIG_LOCALE) && defined(HAVE_SETLOCALE) && defined(LC_ALL) +# define USE_LOCALE 1 +#endif /* CONFIG_LOCALE && HAVE_SETLOCALE && LC_ALL */ + +#ifndef MAILDIR_SUPPORT +#define mailstat(X,Y) stat(X,Y) +#endif + +#ifdef __CYGWIN__ +# include +# define IS_DIRSEP(c) ((c) == '/' || (c) == '\\') +#else +# define IS_DIRSEP(c) ((c) == '/') +#endif + +#if defined(__GNUC__) && !defined(__APPLE__) +/* Does the OS X port of gcc still gag on __attribute__? */ +#define UNUSED(x) x __attribute__((__unused__)) +#else +#define UNUSED(x) x +#endif + +/* + * The MULTIBYTE_SUPPORT configure-define specifies that we want to enable + * complete Unicode conversion between wide characters and multibyte strings. + */ +#if defined MULTIBYTE_SUPPORT \ + || (defined HAVE_WCHAR_H && defined HAVE_WCTOMB && defined __STDC_ISO_10646__) +/* + * If MULTIBYTE_SUPPORT is not defined, these includes provide a subset of + * Unicode support that makes the \u and \U printf escape sequences work. + */ + +#if defined(__hpux) && !defined(_INCLUDE__STDC_A1_SOURCE) +#define _INCLUDE__STDC_A1_SOURCE +#endif + +# include +# include +#endif +#ifdef HAVE_LANGINFO_H +# include +# ifdef HAVE_ICONV +# include +# endif +#endif + +#if defined(HAVE_INITGROUPS) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_INITGROUPS +#endif + +#if defined(HAVE_GETGRGID) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_GETGRGID +#endif + +#if defined(HAVE_GETGRNAM) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_GETGRNAM +#endif + +#if defined(HAVE_GETPWENT) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_GETPWENT +#endif + +#if defined(HAVE_GETPWNAM) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_GETPWNAM +#endif + +#if defined(HAVE_GETPWUID) && !defined(DISABLE_DYNAMIC_NSS) +# define USE_GETPWUID +#endif + +#ifdef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC +# define GET_ST_ATIME_NSEC(st) (st).st_atim.tv_nsec +#elif HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC +# define GET_ST_ATIME_NSEC(st) (st).st_atimespec.tv_nsec +#elif HAVE_STRUCT_STAT_ST_ATIMENSEC +# define GET_ST_ATIME_NSEC(st) (st).st_atimensec +#endif +#ifdef HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC +# define GET_ST_MTIME_NSEC(st) (st).st_mtim.tv_nsec +#elif HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC +# define GET_ST_MTIME_NSEC(st) (st).st_mtimespec.tv_nsec +#elif HAVE_STRUCT_STAT_ST_MTIMENSEC +# define GET_ST_MTIME_NSEC(st) (st).st_mtimensec +#endif +#ifdef HAVE_STRUCT_STAT_ST_CTIM_TV_NSEC +# define GET_ST_CTIME_NSEC(st) (st).st_ctim.tv_nsec +#elif HAVE_STRUCT_STAT_ST_CTIMESPEC_TV_NSEC +# define GET_ST_CTIME_NSEC(st) (st).st_ctimespec.tv_nsec +#elif HAVE_STRUCT_STAT_ST_CTIMENSEC +# define GET_ST_CTIME_NSEC(st) (st).st_ctimensec +#endif + +#if defined(HAVE_TGETENT) && !defined(ZSH_NO_TERM_HANDLING) +# if defined(ZSH_HAVE_CURSES_H) && defined(ZSH_HAVE_TERM_H) +# define USES_TERM_H 1 +# else +# ifdef HAVE_TERMCAP_H +# define USES_TERMCAP_H 1 +# endif +# endif + +# ifdef USES_TERM_H +# ifdef HAVE_TERMIO_H +# include +# endif +# ifdef ZSH_HAVE_CURSES_H +# include "zshcurses.h" +# endif +# include "zshterm.h" +# else +# ifdef USES_TERMCAP_H +# include +# endif +# endif +#endif diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/A04redirect.ztst zsh-beta-4.3.12-dev-1+20110925/Test/A04redirect.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/A04redirect.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/A04redirect.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -155,9 +155,12 @@ (exec 3<&- read foo <&-) 1:'<&-' redirection +?(eval):1: failed to close file descriptor 3: bad file descriptor +?(eval):2: failed to close file descriptor 0: bad file descriptor print foo >&- 0:'>&-' redirection +?(eval):1: failed to close file descriptor 1: bad file descriptor fn() { local foo; read foo; print $foo; } coproc fn diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/B04read.ztst zsh-beta-4.3.12-dev-1+20110925/Test/B04read.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/B04read.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/B04read.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -93,3 +93,20 @@ read foo) <<one +>two +>three +>one:two:three + + array=() + read -Ae array <<<'four five six' + print ${(j.:.)array} +0:Behaviour of -A and -e combination +>four +>five +>six +> diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/C04funcdef.ztst zsh-beta-4.3.12-dev-1+20110925/Test/C04funcdef.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/C04funcdef.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/C04funcdef.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -1,3 +1,8 @@ +%prep + + mkdir funcdef.tmp + cd funcdef.tmp + %test fn1() { return 1; } @@ -26,7 +31,7 @@ print regress expansion of function names } f$$ -0:Regression test: `function f$$ () { ... }' +0:Regression test: 'function f$$ () { ... }' >regress expansion of function names function foo () print bar @@ -109,6 +114,8 @@ >really useful >args +# ' deconfuse emacs + command_not_found_handler() { print "Your command:" >&2 print "$1" >&2 @@ -201,6 +208,49 @@ >Da de da >Do be do + () { print This has arguments $*; } of all sorts; print After the function + function { print More stuff $*; } and why not; print Yet more +0:Anonymous function with arguments +>This has arguments of all sorts +>After the function +>More stuff and why not +>Yet more + + fn() { + (){ print Anonymous function 1 $*; } with args + function { print Anonymous function 2 $*; } with more args + print Following bit + } + functions fn +0:Text representation of anonymous function with arguments +>fn () { +> () { +> print Anonymous function 1 $* +> } with args +> () { +> print Anonymous function 2 $* +> } with more args +> print Following bit +>} + + touch yes no + () { echo $1 } (y|z)* + (echo here) + () { echo $* } some (y|z)* + () { echo empty };(echo here) +0:Anonymous function arguments and command arguments +>yes +>here +>some yes +>empty +>here + + if true; then f() { echo foo1; } else f() { echo bar1; } fi; f + if false; then f() { echo foo2; } else f() { echo bar2; } fi; f +0:Compatibility with other shells when not anonymous functions +>foo1 +>bar2 + %clean rm -f file.in file.out diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/D03procsubst.ztst zsh-beta-4.3.12-dev-1+20110925/Test/D03procsubst.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/D03procsubst.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/D03procsubst.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -84,3 +84,7 @@ ) 0:=(...) preceded by other stuff has no special effect >everything,=(here is left),alone + + print something=${:-=(echo 'C,D),(F,G)'} +1: Graceful handling of bad substitution in enclosed context +?(eval):1: unterminated `=(...)' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/D04parameter.ztst zsh-beta-4.3.12-dev-1+20110925/Test/D04parameter.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/D04parameter.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/D04parameter.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -179,9 +179,17 @@ print ${##} set 1 2 3 4 5 6 7 8 9 10 print ${##} -0:${##} is length of $# + print ${##""} + print ${##1} + print ${##2} + print ${###<->} # oh, for pete's sake... +0:${##} is length of $#, and other tales of hash horror >1 >2 +>10 +>0 +>10 +> array=(once bitten twice shy) print IF${array}THEN @@ -298,6 +306,19 @@ >Howzat >usay + foo='\u65\123' + print -r ${(g:o:)foo} + foo='\u65\0123^X\C-x' + print -r ${(g::)foo} + foo='^X' + bar='\C-\130' + [[ ${(g:c:)foo} == ${(g:oe:)bar} ]] + echo $? +0:${(g)...} +>eS +>eS^X\C-x +>0 + foo='I'\''m nearly out of my mind with tedium' bar=foo print ${(P)bar} @@ -1346,6 +1367,7 @@ print ${foo:$(echo 3 + 3):`echo 4 - 3`} print ${foo: -1} print ${foo: -10} + print ${foo:5:-2} 0:Bash-style offsets, scalar >456789 >56789 @@ -1357,6 +1379,7 @@ >7 >9 >123456789 +>67 foo=(1 2 3 4 5 6 7 8 9) print ${foo:3} @@ -1369,6 +1392,7 @@ print ${foo:$(echo 3 + 3):`echo 4 - 3`} print ${foo: -1} print ${foo: -10} + print ${foo:5:-2} 0:Bash-style offsets, array >4 5 6 7 8 9 >5 6 7 8 9 @@ -1380,6 +1404,7 @@ >7 >9 >1 2 3 4 5 6 7 8 9 +>6 7 testfn() { emulate -L sh @@ -1418,3 +1443,18 @@ print ${str:0:} 1:Regression test for missing length after offset ?(eval):2: unrecognized modifier + + foo="123456789" + print ${foo:5:-6} +1:Regression test for total length < 0 in string +?(eval):2: substring expression: 3 < 5 + + foo=(1 2 3 4 5 6 7 8 9) + print ${foo:5:-6} +1:Regression test for total length < 0 in array +?(eval):2: substring expression: 3 < 5 + + foo=(${(0)"$(print -n)"}) + print ${#foo} +0:Nularg removed from split empty string +>0 diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/D08cmdsubst.ztst zsh-beta-4.3.12-dev-1+20110925/Test/D08cmdsubst.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/D08cmdsubst.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/D08cmdsubst.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -98,3 +98,11 @@ echo `echo $?` 0:Non-empty command substitution inherits status >1 + + echo $(( ##\" )) + echo $(echo \") + echo $((echo \"); echo OK) +0:Handling of backslash double quote in parenthesised substitutions +>34 +>" +>" OK diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/.distfiles zsh-beta-4.3.12-dev-1+20110925/Test/.distfiles --- zsh-beta-4.3.11-dev-1+20110504/Test/.distfiles 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/.distfiles 2011-10-02 01:10:11.000000000 +0000 @@ -1,6 +1,7 @@ DISTFILES_SRC=' .cvsignore .distfiles +compgentest A01grammar.ztst A02alias.ztst A03quoting.ztst diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/E01options.ztst zsh-beta-4.3.12-dev-1+20110925/Test/E01options.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/E01options.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/E01options.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -353,6 +353,10 @@ echo *NonExistentFile*) 0:NO_EXEC option should not do globbing + (setopt noexec + echo ${unset_var?Not an error}) +0:NO_EXEC should not test for unset variables + setopt NO_eval_lineno eval 'print $LINENO' setopt eval_lineno diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/E02xtrace.ztst zsh-beta-4.3.12-dev-1+20110925/Test/E02xtrace.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/E02xtrace.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/E02xtrace.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -7,6 +7,11 @@ local regression_test_dummy_variable print "$*" } + function xtfx { + local regression_test_dummy_variable + print "Tracing: (){ builtin 2>file }" 2>>xtrace.err + { print "Tracing: (){ { builtin } 2>file }" } 2>>xtrace.err + } echo 'print "$*"' > xt.in %test @@ -31,6 +36,7 @@ repeat 1 do cat <<<'Tracing: do external done 2>file'; done 2>>xtrace.err xtf 'Tracing: function' xtf 'Tracing: function 2>file' 2>>xtrace.err + xtfx . ./xt.in 'Tracing: source' . ./xt.in 'Tracing: source 2>file' 2>>xtrace.err set +x @@ -54,23 +60,23 @@ >Tracing: do external done 2>file >Tracing: function >Tracing: function 2>file +>Tracing: (){ builtin 2>file } +>Tracing: (){ { builtin } 2>file } >Tracing: source >Tracing: source 2>file ->+(eval):4> print 'Tracing: builtin 2>file' ->+(eval):6> cat >+(eval):8> print 'Tracing: ( builtin ) 2>file' >+(eval):10> cat >+(eval):12> print 'Tracing: { builtin } 2>file' >+(eval):14> cat >+(eval):16> print 'Tracing: do builtin done 2>file' >+(eval):18> cat ->+(eval):20> xtf 'Tracing: function 2>file' >+xtf:1> local regression_test_dummy_variable >+xtf:2> print 'Tracing: function 2>file' ->+(eval):22> . ./xt.in 'Tracing: source 2>file' ->+./xt.in:1> print 'Tracing: source 2>file' +>+xtfx:3> print 'Tracing: (){ { builtin } 2>file }' ?+(eval):3> print 'Tracing: builtin' +?+(eval):4> print 'Tracing: builtin 2>file' ?+(eval):5> cat +?+(eval):6> cat ?+(eval):7> print 'Tracing: ( builtin )' ?+(eval):9> cat ?+(eval):11> print 'Tracing: { builtin }' @@ -80,9 +86,15 @@ ?+(eval):19> xtf 'Tracing: function' ?+xtf:1> local regression_test_dummy_variable ?+xtf:2> print 'Tracing: function' -?+(eval):21> . ./xt.in 'Tracing: source' +?+(eval):20> xtf 'Tracing: function 2>file' +?+(eval):21> xtfx +?+xtfx:1> local regression_test_dummy_variable +?+xtfx:2> print 'Tracing: (){ builtin 2>file }' +?+(eval):22> . ./xt.in 'Tracing: source' ?+./xt.in:1> print 'Tracing: source' -?+(eval):23> set +x +?+(eval):23> . ./xt.in 'Tracing: source 2>file' +?+./xt.in:1> print 'Tracing: source 2>file' +?+(eval):24> set +x typeset -ft xtf xtf 'Tracing: function' diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/V01zmodload.ztst zsh-beta-4.3.12-dev-1+20110925/Test/V01zmodload.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/V01zmodload.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/V01zmodload.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -125,8 +125,10 @@ fi 0d:Autoload a module via a builtin + if [[ $mods[(r)zsh/example] == zsh/example ]]; then zmodload -u zsh/example builtin example + fi 0d:Autoloads are persistent (zmodload -u zsh/parameter diff -Nru zsh-beta-4.3.11-dev-1+20110504/Test/V04features.ztst zsh-beta-4.3.12-dev-1+20110925/Test/V04features.ztst --- zsh-beta-4.3.11-dev-1+20110504/Test/V04features.ztst 2011-05-04 23:31:39.000000000 +0000 +++ zsh-beta-4.3.12-dev-1+20110925/Test/V04features.ztst 2011-10-02 01:10:11.000000000 +0000 @@ -17,18 +17,24 @@ 0:Loading modules with no features >-b:strftime >-p:EPOCHSECONDS +>-p:EPOCHREALTIME +>-p:epochtime zmodload -F zsh/datetime b:strftime zmodload -lF zsh/datetime 0:Enabling features >+b:strftime >-p:EPOCHSECONDS +>-p:EPOCHREALTIME +>-p:epochtime zmodload -F zsh/datetime +p:EPOCHSECONDS -b:strftime zmodload -lF zsh/datetime 0:Disabling features >-b:strftime >+p:EPOCHSECONDS +>-p:EPOCHREALTIME +>-p:epochtime zmodload -Fe zsh/datetime p:EPOCHSECONDS b:strftime 0:Testing existing features @@ -109,6 +115,8 @@ 0:Feature state with loading after error enabling >+b:strftime >-p:EPOCHSECONDS +>+p:EPOCHREALTIME +>+p:epochtime zmodload -F zsh/datetime p:EPOCHSECONDS zmodload -Fe zsh/datetime +p:EPOCHSECONDS @@ -159,3 +167,5 @@ 0:zmodload with no -F enables all features >+b:strftime >+p:EPOCHSECONDS +>+p:EPOCHREALTIME +>+p:epochtime