From 61e68d70da5af5afe943f92cd94a8c96e78348d9 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 1 Aug 1999 14:48:28 +0000 Subject: zsh-3.1.6 --- ChangeLog | 97 +++++++++ Completion/Base/_complete_opts | 4 +- Completion/Core/_path_files | 9 +- Completion/Core/compdump | 6 +- Completion/User/.distfiles | 4 +- Completion/User/_cvs | 466 +++++++++++++++++++++++++++++------------ Config/version.mk | 4 +- Doc/.distfiles | 2 +- Doc/Zsh/compsys.yo | 42 +++- Doc/Zsh/metafaq.yo | 25 ++- Doc/Zsh/params.yo | 2 +- Doc/Zsh/zftpsys.yo | 14 +- Doc/intro.ms | 8 +- Etc/BUGS | 15 ++ Etc/CONTRIBUTORS | 32 +-- Etc/MACHINES | 38 +++- Etc/NEWS | 86 ++++++-- Functions/Zftp/zfanon | 16 +- Functions/Zftp/zfget | 25 ++- Functions/Zftp/zfopen | 16 +- Functions/Zftp/zftp_chpwd | 17 +- Misc/compctl-examples | 2 +- Src/Zle/comp1.export | 3 - Src/Zle/zle.export | 2 - Src/Zle/zle_tricky.c | 17 +- Src/glob.c | 2 +- Src/hist.c | 4 +- Src/zsh.export | 4 - configure.in | 2 +- 29 files changed, 717 insertions(+), 247 deletions(-) diff --git a/ChangeLog b/ChangeLog index 18e38b19b..8db427571 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,100 @@ +1999-08-01 Peter Stephenson + + * pws: Config/version.mk: zsh 3.1.6 released. + +1999-07-30 Peter Stephenson + + * pws, Bart: 7321, 7325: Src/hist.c: NO_BANG_HIST wasn't working + at all, but be careful not to disable too much when it's + in effect. + + * Tanaka Akira: 7318: Completion/User/_cvs: more improvements + +1999-07-29 Peter Stephenson + + * pws: 7316: Doc/Zsh/compsys.yo: mention that compctl -M control + is available and fix some typos. + + * pws: unposted: Doc/Zsh/metafaq.yo: sites in Italy and Poland + (the one in Italy is not `official', but is actively mirroring + ftp.zsh.org anyway). + + * Felix Rosencrantz: 7311: Src/Zle/zle_tricky.c: matching control + left dangling pointers. + + * Tanaka Akira: 7312: Completion/User/_cvs: don't quote ignore + patterns. + +1999-07-28 Peter Stephenson + + * pws: 7308, 7309: Src/Zle/zle_tricky.c: glob patterns were + limited to PATH_MAX and length wasn't tested. + + * Tanaka Akira: 7307: Completion/User/_cvs: remove parentheses, + complete argument options. + + * pws: 7305: Doc/Zsh/zftpsys.yo, Functions/Zftp/zfanon, + Functions/Zftp/zfget, Functions/Zftp/zfopen, + Functions/Zftp/zftp_chpwd: use URL-style paths in opening; + zfget -c sends output to stdout; don't delete current directory + information if we haven't really changed directory. + + * Bart: 7301: Completion/User/_cvs: restored .file completion + +1999-07-27 Peter Stephenson + + * pws: 7300: Completion/Core/compdump: wasn't ignoring . in fpath, + although compinit was. + + * pws: 7299: configure.in: don't use gcc -pedantic any more, since + there are too many messages about `long long' and variable-sized + arrays not being available in ISO C. + + * pws: 7298: Src/Zle/zle_tricky.c: missing dupstring() in + comp_match. + + * pws: 7297: Completion/Core/_path_files, Doc/Zsh/compsys.yo: + path_keepdir config key required for 7141 to come into effect + due to significant side effects. + + * Tanaka Akira: 7290, 7292: Completion/User/_cvs: condensed + version of all _cvs completion stuff; completes files if not + under CVS control; use compgen -p to work around problem with + quoted characters. + + * Andrej: 7827: Etc/Machines: Siemens info + + * Bart: 7285, applied by hand: Completion/User/_cvs: parameter + fixes, commit bug. + + * Tanaka Akira: 7284: Completion/Core/compdump: careful when + two shells start at once. + + * Tanaka Akira: 7282: Completion/User/_cvs, + Completion/User/_cvsaddp, Completion/User/_cvsentries_modified, + Completion/User/_cvsprefix, Completion/User/_cvsremovep, + Completion/User/_cvstargets, Completion/User/_cvstargets_modified: + handle modified files using stat module. + +1999-07-26 Peter Stephenson + + * Tanaka Akira: 7278: Completion/Base/_complete_opts: + less verbosity + +1999-07-25 Peter Stephenson + + * Tanaka Akira: 7276, 7277, 7279: Completion/User/{_cvs, _cvsaddp, + _cvsentries, _cvsprefix, _cvsremovep, _cvsrepositories, + _cvsrevisions, _cvstargets, _cvstest}, Misc/compctl-examples: + more modular cvs new completion support including CVS/Entries; + bug fix for old CVS completion. + + * Bart: 7275: Doc/intro.ms: now works with groff. + + * Bart: 7274: Src/Zle/zle_tricky.c: don't go beyond end of line + + * pws: from Bart: Etc/CONTRIBUTORS, Etc/NEWS: updates for 3.0.6 + 1999-07-24 Peter Stephenson * pws: version 3.1.6-test-3 diff --git a/Completion/Base/_complete_opts b/Completion/Base/_complete_opts index 689e13e22..c27a8869f 100644 --- a/Completion/Base/_complete_opts +++ b/Completion/Base/_complete_opts @@ -81,7 +81,9 @@ case "${#no_arg}-${#with_arg}" in esac if [[ -z "$done" ]]; then - compadd - -${(k)^option_pairs:gs/://} + if (( $+complete_opts_verbose )); then + compadd - -${(k)^option_pairs:gs/://} + fi false else true diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 019e3abcf..04f4f1db3 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -260,7 +260,14 @@ for prepath in "$prepaths[@]"; do # original string in such a case so that the command line doesn't # change but other completers still think there are matches. - if [[ -z "$tpre$tsuf" && "$pre" = */ && -z "$suf" ]]; then + # Problem: this seems to stop _files from finding directory + # completions if there were no file completions, for + # example `_files *(*)' no longer completes subdirectories after + # a /. For now, make this a configuration option, but + # probably it needs to be done better. + + if [[ -n "$compconfig[path_keepdir]" && -z "$tpre$tsuf" && + "$pre" = */ && -z "$suf" ]]; then compadd -nQS '' - "$linepath$donepath$orig" tmp4=- fi diff --git a/Completion/Core/compdump b/Completion/Core/compdump index f2729acc5..8f8a3ee77 100644 --- a/Completion/Core/compdump +++ b/Completion/Core/compdump @@ -17,10 +17,10 @@ emulate -L zsh typeset _d_file _d_f _d_bks _d_line _d_als -_d_file=${compconfig[dumpfile]-${0:h}/compinit.dump} +_d_file=${compconfig[dumpfile]-${0:h}/compinit.dump}.$HOST.$$ typeset -U _d_files -_d_files=( ${^~fpath}/_(|*[^~])(N:t) ) +_d_files=( ${^~fpath:/.}/_(|*[^~])(N:t) ) print "#files: $#_d_files" > $_d_file @@ -88,5 +88,7 @@ done >> $_d_file print >> $_d_file +mv $_d_file ${_d_file%.$HOST.$$} + unfunction compdump autoload -U compdump diff --git a/Completion/User/.distfiles b/Completion/User/.distfiles index 1491ba653..713be74dc 100644 --- a/Completion/User/.distfiles +++ b/Completion/User/.distfiles @@ -1,7 +1,7 @@ DISTFILES_SRC=' .distfiles - _a2ps _bzip2 _bunzip2 _chown _compress _configure _cvs _dd _dvi _find - _gdb _groups _gunzip _gzip + _a2ps _bzip2 _bunzip2 _chown _compress _configure + _cvs _dd _dvi _find _gdb _groups _gunzip _gzip _hosts _use_lo _make _man _mh _pdf _ps _rcs _rlogin _sh _strip _stty _su _tar _tar_archive _tex _uncompress _x_options _xfig diff --git a/Completion/User/_cvs b/Completion/User/_cvs index 4e191cecb..811d1c232 100644 --- a/Completion/User/_cvs +++ b/Completion/User/_cvs @@ -1,141 +1,333 @@ #compdef cvs -setopt localoptions extendedglob - -typeset -A commands -commands=(add "ad new" admin "adm rcs" annotate ann - checkout "co get" commit "ci com" diff "di dif" - edit "" editors "" export "exp ex" - history "hi his" import "im imp" init "" - log "lo rlog" login "logon lgn" logout "" - rdiff patch release "re rel" remove "rm delete" - status "st stat" rtag "rt rfreeze" tag "ta freeze" - unedit "" update "up upd" watch "" - watchers "") - -local com="${words[(i)(${(j:|:)${(kv)=commands}})]}" - -local showlist='compstate[list]=list; compstate[force_list]=yes' -local showhint="$showlist ; compstate[insert]=''" -local complete_D="compadd yesterday week\\ ago month\\ ago" -local complete_k="compadd kv kvl k o b v" -local complete_r="compadd -UX 'Enter tag name or rev number' ''; $showhint" -local complete_m="compadd -UX 'Enter log message' -n ''; $showhint" - - -if (( com < CURRENT )); then - case "$words[$com]" in - add|ad|new) # "+k:m:" - _complete_opts k: "$complete_k" m: "$complete_m" || _files - ;; - admin|adm|rcs) # "+ib::c:a:A:e:l::u::LUn:N:m:o:s:t::IqxV:k:" - _complete_opts i '' b:: '' c: '' a: '' A: '' e: '' l:: '' u:: '' L '' U '' n: '' N: '' m: "$complete_m" o: '' s: '' t:: '' I '' q '' x '' V: '' k: "$complete_k" || _files - ;; - annotate|ann) # "+lr:D:fR" - _complete_opts l '' r: '' D: '' f '' R '' || _files - ;; - checkout|co|get) # "+ANnk:d:flRpQqcsr:D:j:P" - _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || compadd MODULE - ;; - commit|ci|com) # "+nlRm:fF:r:" - _complete_opts n '' l '' R '' m: "$complete_m" f '' F: '' r: "$complete_r" || _files - ;; - diff|di|dif) # "+abcdefhilnpstuw0123456789BHNRC:D:F:I:L:U:V:W:k:r:" - _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || _files - ;; - edit) # "+lRa:" - _complete_opts l '' R '' a: '' || _files - ;; - editors) # "+lR" - _complete_opts l '' R '' || _files - ;; - export|exp|ex) # "+ANnk:d:flRpQqcsr:D:j:P" - _complete_opts A '' N '' n '' k: "$complete_k" d: '' f '' l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" j: '' P '' || compadd MODULE - ;; - history|hi|his) # "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:" - _complete_opts T '' a '' c '' e '' l '' o '' w '' \? '' D: "$complete_D" b: '' f: '' m: "$complete_m" n: '' p: '' r: '' t: '' u: '' x: '' X: '' z: '' || _files - ;; - import|im|imp) # "+Qqdb:m:I:k:W:" - _complete_opts Q '' q '' d '' b: '' m: "$complete_m" I: '' k: "$complete_k" W: '' || case $[CURRENT-com] in - 1) if [[ "${+CVSROOT}" == 1 && "$CVSROOT" != :* ]]; then - compgen -X "Enter repository name" -W "$CVSROOT" -g '*~*CVSROOT(/)' -s '' - else - compadd -UX "Enter repository name" -n '' && eval "$showhint" - fi - ;; - 2) compadd -UX "Enter vendor tag name" -n '' && eval "$showhint";; - 3) compadd -UX "Enter release tag name" -n '' && eval "$showhint";; - *) compadd -UX "No futher arguments used" -n '' && eval "$showhint";; - esac - ;; - init) - break - ;; - login|logon|lgn|logout) - _complete_opts || _files - ;; - rdiff|patch|pa) # "+V:k:cuftsQqlRD:r:" - _complete_opts V: '' k: "$complete_k" c '' u '' f '' t '' s '' Q '' q '' l '' R '' D: "$complete_D" r: "$complete_r" || _files - ;; - release|re|rel) # "+Qdq" - _complete_opts Q '' d '' q '' || _files -/ - ;; - remove|rm|delete) # "+flR" - _complete_opts f '' l '' R '' || _files - ;; - status|st|stat) # "+vlR" - _complete_opts v '' l '' R '' || _files - ;; - tag|ta|freeze) # "+FQqlRcdr:D:bf" - _complete_opts F '' Q '' q '' l '' R '' c '' d '' r: "$complete_r" D: "$complete_D" b '' f '' || _files - ;; - unedit) # "+lR" - _complete_opts l '' R '' || _files - ;; - update|up|upd) # "+ApPflRQqduk:r:D:j:I:W:" - _complete_opts A '' p '' P '' f '' l '' R '' Q '' q '' d '' u '' k: "$complete_k" r: "$complete_r" D: "$complete_D" j: '' I: '' W: '' || _files - ;; - watch) - if (( CURRENT == com + 1 )); then - compadd on off add remove - else - case "$words[com+1]" in - on|off) # "+lR" - _complete_opts l '' R '' || _files - ;; - add|remove) # "+lRa:" - _complete_opts l '' R '' a: '' || _files - ;; - esac - fi - ;; - watchers) # "+lR" - _complete_opts l '' R '' || _files - ;; - *) _files;; - esac - return -fi +_cvs () { + setopt localoptions extendedglob + + typeset -A commands + commands=(add "ad new" admin "adm rcs" annotate ann + checkout "co get" commit "ci com" diff "di dif" + edit "" editors "" export "exp ex" + history "hi his" import "im imp" init "" + log "lo rlog" login "logon lgn" logout "" + rdiff patch release "re rel" remove "rm delete" + status "st stat" rtag "rt rfreeze" tag "ta freeze" + unedit "" update "up upd" watch "" + watchers "") + + local com="${words[(i)(${(j:|:)${(kv)=commands}})]}" + + local showlist='compstate[list]=list; compstate[force_list]=yes' + local showhint="$showlist ; compstate[insert]=''" + local complete_D="compadd today yesterday week\\ ago month\\ ago" + local complete_k="compadd kv kvl k o b v" + local complete_r="_cvsrevisions" + local complete_m="compadd -UX 'Enter log message' -n ''; $showhint" + + if (( com < CURRENT )); then + case "$words[$com]" in + add|ad|new) # "+k:m:" + _complete_opts k: "$complete_k" m: "$complete_m" || _cvsaddp + ;; + admin|adm|rcs) # "+ib::c:a:A:e:l::u::LUn:N:m:o:s:t::IqxV:k:" + _complete_opts i '' b:: '' c: '' a: '' A: '' e: '' l:: '' u:: '' L '' \ + U '' n: '' N: '' m: "$complete_m" o: '' s: '' t:: '' I '' q '' x '' \ + V: '' k: "$complete_k" || + _cvstargets + ;; + annotate|ann) # "+lr:D:fR" + _complete_opts l '' r: "$complete_r" D: "$complete_D" f '' R '' || + _cvstargets + ;; + checkout|co|get) # "+ANnk:d:flRpQqcsr:D:j:P" + _complete_opts A '' N '' n '' k: "$complete_k" d: '_files -/' f '' \ + l '' R '' p '' Q '' q '' c '' s '' r: "$complete_r" D: "$complete_D" \ + j: "$complete_r" P '' || + _cvsrepositories + ;; + commit|ci|com) # "+nlRm:fF:r:" + _complete_opts n '' l '' R '' m: "$complete_m" f '' F: _files \ + r: "$complete_r" || + _cvstargets_modified + ;; + diff|di|dif) # "+abcdefhilnpstuw0123456789BHNRC:D:F:I:L:U:V:W:k:r:" + _complete_opts a '' b '' c '' d '' e '' f '' h '' i '' l '' n '' p '' \ + s '' t '' u '' w '' 0 '' 1 '' 2 '' 3 '' 4 '' 5 '' 6 '' 7 '' 8 '' \ + 9 '' B '' H '' N '' R '' C: '' D: "$complete_D" F: '' I: '' L: '' \ + U: '' V: '' W: '' k: "$complete_k" r: "$complete_r" || + _cvstargets_modified || _cvstargets + ;; + edit) # "+lRa:" + _complete_opts l '' R '' a: 'compadd edit unedit commit all none' || + _cvstargets + ;; + editors) # "+lR" + _complete_opts l '' R '' || _cvstargets + ;; + export|exp|ex) # "+Nnk:d:flRQqr:D:" + _complete_opts N '' n '' k: "$complete_k" d: '_files -/' f '' l '' \ + R '' Q '' q '' r: "$complete_r" D: "$complete_D" || + _cvsrepositories + ;; + history|hi|his) # "+Tacelow?D:b:f:m:n:p:r:t:u:x:X:z:" + _complete_opts T '' a '' c '' e '' l '' o '' w '' \? '' \ + D: "$complete_D" b: '' f: '' m: "$complete_m" n: '' p: '' r: '' \ + t: '' u: '' x: '' X: '' z: '' || + _cvstargets + ;; + import|im|imp) # "+Qqdb:m:I:k:W:" + _complete_opts Q '' q '' d '' b: '' m: "$complete_m" I: _files \ + k: "$complete_k" W: '' || + case $[CURRENT-com] in + 1) _cvsrepositories;; + 2) compadd -UX "Enter vendor tag name" -n '' && eval "$showhint";; + 3) compadd -UX "Enter release tag name" -n '' && eval "$showhint";; + *) compadd -UX "No futher arguments used" -n '' && eval "$showhint";; + esac + ;; + init) + break + ;; + login|logon|lgn|logout) + _complete_opts || _files + ;; + rdiff|patch|pa) # "+V:k:cuftsQqlRD:r:" + _complete_opts V: '' k: "$complete_k" c '' u '' f '' t '' s '' Q '' \ + q '' l '' R '' D: "$complete_D" r: "$complete_r" || + _cvstargets + ;; + release|re|rel) # "+Qdq" + _complete_opts Q '' d '' q '' || _files -/ + ;; + remove|rm|delete) # "+flR" + _complete_opts f '' l '' R '' || _cvsremovep + ;; + status|st|stat) # "+vlR" + _complete_opts v '' l '' R '' || _cvstargets + ;; + tag|ta|freeze) # "+FQqlRcdr:D:bf" + _complete_opts F '' Q '' q '' l '' R '' c '' d '' r: "$complete_r" \ + D: "$complete_D" b '' f '' || + _cvstargets + ;; + unedit) # "+lR" + _complete_opts l '' R '' || _cvstargets + ;; + update|up|upd) # "+ApPflRQqduk:r:D:j:I:W:" + _complete_opts A '' p '' P '' f '' l '' R '' Q '' q '' d '' u '' \ + k: "$complete_k" r: "$complete_r" D: "$complete_D" j: "$complete_r" \ + I: '' W: '' || + _cvstargets + ;; + watch) + if (( CURRENT == com + 1 )); then + compadd on off add remove + else + case "$words[com+1]" in + on|off) # "+lR" + _complete_opts l '' R '' || _cvstargets + ;; + add|remove) # "+lRa:" + _complete_opts l '' R '' \ + a: 'compadd edit unedit commit all none' || \ + _cvstargets + ;; + esac + fi + ;; + watchers) # "+lR" + _complete_opts l '' R '' || _cvstargets + ;; + *) _files;; + esac + return + fi + + _complete_opts \ + H '' Q '' q '' r '' w '' l '' n '' t '' v '' f '' a '' \ + b: "compadd /usr/local/bin" \ + T: "compadd $TMPPREFIX:h $TMPDIR /tmp" \ + e: "compadd vi" \ + d: "compadd $_cvs_roots || _files -/" \ + z: "compadd 9'" \ + s: "_cvs_user_variable" \ + || + compadd ${(k)commands} || + compadd ${(kv)=commands} +} + +_cvsrevisions () { + compadd - ${${${(M)${(f)"$(cvs -q status -vl .)"}:# *}##[ ]##}%%[ ]*} +} + +_cvsrepositories () { + local root=$CVSROOT + [[ -f CVS/Root ]] && root=$(33 will not match 633 because the 633 matches the range. Some +backtracking will be necessary. +------------------------------------------------------------------------ +Matching control can leave the wrong thing in the line. For example, + touch Abc-Def-Ghij.txt + touch Abc-def.ghi.jkl_mno.pqr.txt + touch Abc_def_ghi_jkl_mno_pqr.txt + compctl -M 'm:{a-z}={A-Z} r:|[.,_-]=*' + ls a +produces + ls Abcdefghi +which won't complete further. It seems to get confused over the choice of +possible punctuation characters, and the string won't complete further. +------------------------------------------------------------------------ diff --git a/Etc/CONTRIBUTORS b/Etc/CONTRIBUTORS index 171b3f1a0..842199f95 100644 --- a/Etc/CONTRIBUTORS +++ b/Etc/CONTRIBUTORS @@ -25,20 +25,20 @@ Version 3.1.6 additional autoloading code; general code changes for extra efficiency; subscripting and ordering of globbing lists. -* Peter Stephenson : zftp and mapfile modules and - zf* functions; local parameters and typeset changes; changes in autoconf +* Peter Stephenson : zftp and mapfile modules and zf* + functions; local parameters and typeset changes; changes in autoconf system; case-independent and approximate pattern matching; various options; a few completion modules; some zle changes; FAQ. -* Bart Schaefer : associative array - implementation; other parameter changes; keeping track of missing - patches; function autoloading changes. +* Bart Schaefer : associative array implementation; other + parameter changes; keeping track of missing patches; function autoloading + changes. * Wayne Davison : History code novelties and improvements with new options. -* Geoff Wing : Zle display code fixes, mailing - list and patch archive. +* Geoff Wing : Zle display code fixes, mailing list and patch + archive. * Zoltán Hidvégi : AIX dynamic loading code. @@ -48,7 +48,7 @@ Other improvements, bug fixes and design suggestions from all the above plus Andrej Borsenkow, Oliver Kiddle, Tanaka Akira, Naoki Wakamatsu, Tatuso Furukawa, Ville Herva, Will Day, Lehti Rahmi, Larry P. Schrof, Helmut Jarausch, Phil Pennock, Wilfredo Sanchez, Bruce Stephens, Gene Cohler, -Ollivier Robert. +Ollivier Robert, Felix Rosencrantz. Previous versions of zsh 3 were maintained by Zoltán Hidvégi and Andrew Main (Zefram). @@ -69,13 +69,13 @@ Version 3.0 8-bit clean. Made some reorganizations in exec.c. Fixed signal handling bugs. Fixed lots of bugs in various places. -* Peter W. Stephenson the maintainer of the zsh FAQ. +* Peter W. Stephenson the maintainer of the zsh FAQ. Reorganizations in exec.c. Rewrote and reorganized the history code. Rewrote the zshcompctl manual page. Fixed several bugs related to programmable completion. Fixed several signal handling bugs. Rewrote test and read builtins. Lots of other bugfixes. -* Andrew Main (Zefram) reorganized builtin.c. +* Andrew Main (Zefram) reorganized builtin.c. Rewrote large parts of the zle vi mode. Redirection fixes. Reorganized parts of the completion code, added some enhancements and fixed lots of bugs. Made zle fully 8-bit clean. Fixed several zle bugs. Reorganized @@ -85,21 +85,21 @@ Version 3.0 programmable completion code in zsh-2.5.0. Several bugfixes in exec.c and jobs.c. Lots of completion bugfixes and enhancements. -* Geoff Wing rewrote most of zle_refresh.c. Some +* Geoff Wing rewrote most of zle_refresh.c. Some other bugfixes. * Clive Messer brought the texinfo documentation up-to-date. -* Mark Borges maintains the zsh web page - (http://www.mal.com/zsh/). Several documentation fixes. Maintains the - texinfo documentation together with Clive. +* Mark Borges contributed several documentation fixes + 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 and made them 8-bit clean. Some other little bugfixes. -* Bart Schaefer submitted several - bugfixes, reported lots of bugs and gave many very useful suggestions. +* Bart Schaefer submitted several bugfixes, reported + lots of bugs and gave many very useful suggestions. Version 2.5 ----------- diff --git a/Etc/MACHINES b/Etc/MACHINES index 223b4a8f3..6f708acdb 100644 --- a/Etc/MACHINES +++ b/Etc/MACHINES @@ -56,9 +56,15 @@ HP: HP-UX 9, 10.20, 11.0 (rather than the 10.20 shl_load() function set). More details of any difficulties would be appreciated. -IBM: AIX - Should build `out-of-the-box'. On AIX 3.x (at least), - --enable-zsh-mem will not work. +IBM: AIX 3.2, 4.1 + Should build `out-of-the-box', but --enable-zsh-mem will not work. + + On 3.2, for 64-bit integer support you need to compile with gcc, as + the native compiler does not support ANSI simulataneously with + `long long'. On 4.1, there appear to be problems using + --enable-dynamic (the default) with gcc (version was 2.7.2.3) in + 4.1, though native cc works. More information about this problem + would be appreciated. Linux: Linux (i386) [3.1.4] Should build `out-of-the-box'. @@ -81,14 +87,24 @@ Next: NextStep 3.* Should build `out-of-the-box', but the zsh malloc routines are not recommended. -Reliant: Reliant UNIX - Should build `out-of-the-box'. - -Reliant: SINIX - Should build `out-of-the-box'. There is a bad combination of - static and shared libraries that prevents the use of dynamic - linking; configure now detects this and will disable dynamic - linking even if you requested it. +SIEMENS: Reliant UNIX + Builds `out-of-the-box'. Dynamic loading is supported. + Large Files and 64-bit integers are supported as of version 5.44 + and CDS/CDS++ compiler. + +SIEMENS: SINIX + MX (Intel) plattform: SINIX-L/M 5.41 + Builds out-of-the-box with EGCS. Neither dynamic loading nor + 64-bit integers are suported. Native compiler was not tried + mostly because GCC/EGCS builds out-of-the-box as well. If you + succeed with native compiler, send a patch for this file + to zsh-workers. + + RM (MIPS) plattform: SINIX-N/Y 5.42 + Should build out-of-the-box but it was not tested. Neither + dynamic loading nor 64-bit integers are suported. + Note, that this version is obsolete and users are expected to + update to Reliant UNIX. SGI: IRIX 5.1.1.1, 5.2, 5.3, 6.2, 6.3, 6.5 Should build `out-of-the-box'. diff --git a/Etc/NEWS b/Etc/NEWS index bba3283e6..e65503a23 100644 --- a/Etc/NEWS +++ b/Etc/NEWS @@ -1,9 +1,11 @@ ------------------------------------- CHANGES FROM PREVIOUS VERSIONS OF ZSH ------------------------------------- - + New features in zsh version 3.1.6 (beta version) ------------------------------------------------ +Note also the changes for 3.0.6, which include changes between 3.1.5. and +3.1.6. New completion system via shell functions; massive degree of programmability and configurability: @@ -27,7 +29,8 @@ Other editing changes: History changes: new options HIST_NO_FUNCTIONS, HIST_EXPIRE_DUPS_FIRST, HIST_FIND_NO_DUPS, HIST_IGNORE_ALL_DUPS, INC_APPEND_HISTORY, HIST_SAVE_NO_DUPS, SHARE_HISTORY, allow better control of when history is -read and written and how duplicates are handled. +read and written and how duplicates are handled. New format for history +saves. Associative arrays plus enhanced parameter substitutions to retrieve keys and values. @@ -47,10 +50,9 @@ New loadable modules: array interface. Debugging and prompt enhancements: - - LINENO is now very much more useful in scripts and functions and has - corresponding prompt escape %i - - $PS4 can contain %i as well as %N for script or function names - (default PS4 changed), also %_ for current shell structure executing; + - $PS4 can contain %i for $LINENO as well as %N for script or function + names (default PS4 changed), also %_ for current shell structure + executing; - Prompt truncation %<...< is now more flexible: it applies to a whole section of the prompt, not just one escape. You need to put %<< after the truncated escape to get the old behaviour. @@ -58,8 +60,8 @@ Debugging and prompt enhancements: been output, else no (e.g. for outputting extra newlines). Parameter and expansion changes - - typeset -t MYPATH mypath creates tied path/PATH-like variables - - typeset -g allows operations on parameters without making them local + - `typeset -t MYPATH mypath' creates tied path/PATH-like variables + - `typeset -g' allows operations on parameters without making them local - New expansions - ${(t)param} prints type information for $param - ${(P)param} treats value of $param as the name of a param to @@ -68,27 +70,79 @@ Parameter and expansion changes - ${foo/old/new} substitution, like bash; also (S) flag for shortest match - $foo[(b.2.i)bar] starts searching $foo for bar starting at 2nd match - - more logical behaviour of nested parameters, now properly documented - - quote only nested expansion, e.g. ${(f)"$(&file' is a redirection, not a NULLCMD. + - any single complex command, such as `case ... esac', parses as if + semicolon-terminated (bug fix). + - the shell function `preexec', if defined, is run after parsing each + command line but before executing the command. + +Other changes: + - the option PRINT_EIGHT_BIT causes zsh to emit raw bytes in prompts + and completion lists even if the system ctype(3) package says that + those bytes are not "printable." + +Debugging enhancements: + - LINENO is now very much more useful in scripts and functions and is + reported correctly in most error messages. + - ERREXIT behavior is now consistent with newer Bourne-like shells, + e.g. with respect to `if' tests that fail. Configuration changes: - Large file and 64-bit integers on 32-bit machines supported where provided by OS. - - generation of signal names should be more reliable - - Customizable installation of shell functions from distribution. + - a few more system features, such as getpwnam/getpwuid, are tested for. New features in zsh version 3.1 (beta version) diff --git a/Functions/Zftp/zfanon b/Functions/Zftp/zfanon index d8a9d06a3..9624d48d9 100644 --- a/Functions/Zftp/zfanon +++ b/Functions/Zftp/zfanon @@ -2,7 +2,7 @@ emulate -L zsh -local opt optlist once +local opt optlist once dir while [[ $1 = -* ]]; do if [[ $1 = - || $1 = -- ]]; then @@ -61,10 +61,20 @@ if [[ -z $EMAIL_ADDR ]]; then print "Using $EMAIL_ADDR as anonymous FTP password." fi +if [[ $1 = */* ]]; then + 1=${1##ftp://} + dir=${1#*/} + 1=${1%%/*} +fi + if [[ $once = 1 ]]; then - zftp open $1 anonymous $EMAIL_ADDR + zftp open $1 anonymous $EMAIL_ADDR || return 1 else zftp params $1 anonymous $EMAIL_ADDR - zftp open + zftp open || return 1 +fi + +if [[ -n $dir ]]; then + zfcd $dir fi # } diff --git a/Functions/Zftp/zfget b/Functions/Zftp/zfget index 878a36346..cee0290b3 100644 --- a/Functions/Zftp/zfget +++ b/Functions/Zftp/zfget @@ -1,10 +1,16 @@ # function zfget { # Get files from remote server. Options: +# -c cat: dump files to stdout. +# alias zfcat="zfget -c" +# zfpage() { zfget -c "$@" | eval $PAGER } +# are sensible things to do, but aren't done for you. Note the +# second doesn't work on all OS's. # -G don't to remote globbing, else do # -t update the local file times to the same time as the remote. # Currently this only works if you have the `perl' command, # and that perl is version 5 with the standard library. -# See the function zfrtime for more gory details. +# See the function zfrtime for more gory details. This has +# no effect with the -c option. # # If the connection is not currently open, try to open it with the current # parameters (set by a previous zfopen or zfparams), then close it after @@ -13,7 +19,7 @@ emulate -L zsh -local loc rem optlist opt nglob remlist time +local loc rem optlist opt nglob remlist time cat integer stat do_close while [[ $1 == -* ]]; do @@ -29,6 +35,8 @@ while [[ $1 == -* ]]; do ;; t) time=1 ;; + c) cat=1 + ;; *) print option $opt not recognised >&2 ;; esac @@ -48,11 +56,16 @@ for remlist in $*; do fi if (( $#remlist )); then for rem in $remlist; do - loc=${rem:t} - if zftp get $rem >$loc; then - [[ $time = 1 ]] && zfrtime $rem $loc + if [[ -n $cat ]]; then + zftp get $rem + stat=$? else - stat=1 + loc=${rem:t} + if zftp get $rem >$loc; then + [[ $time = 1 ]] && zfrtime $rem $loc + else + stat=1 + fi fi done fi diff --git a/Functions/Zftp/zfopen b/Functions/Zftp/zfopen index fa9b4f81d..b264aeaba 100644 --- a/Functions/Zftp/zfopen +++ b/Functions/Zftp/zfopen @@ -7,7 +7,7 @@ emulate -L zsh -local optlist opt once +local optlist opt once dir while [[ $1 = -* ]]; do if [[ $1 = - || $1 = -- ]]; then @@ -31,12 +31,22 @@ done # both .netrc and .ncftp/bookmarks . We could even try saving # the info in their for new hosts, like ncftp does. +if [[ $1 = */* ]]; then + 1=${1##ftp://} + dir=${1#*/} + 1=${1%%/*} +fi + if [[ $once = 1 ]]; then - zftp open $* + zftp open $* || return 1 else # set parameters, but only if there was at least a host (( $# > 0 )) && zfparams $* # now call with no parameters - zftp open + zftp open || return 1 +fi + +if [[ -n $dir ]]; then + zfcd $dir fi # } diff --git a/Functions/Zftp/zftp_chpwd b/Functions/Zftp/zftp_chpwd index f1c2d5311..0b5bbd7d5 100644 --- a/Functions/Zftp/zftp_chpwd +++ b/Functions/Zftp/zftp_chpwd @@ -1,13 +1,16 @@ # function zftp_chpwd { # You may want to alter chpwd to call this when $ZFTP_USER is set. -# Cancel the filename cache for the current directory. -zftp_fcache=() -# ...and also empty the stored directory listing cache. -# As this function is called when we close the connection, this -# is the only place we need to do these two things. -[[ -n $zfcurdir && -f $zfcurdir ]] && rm -f $zfcurdir -zfotherargs= +# If the directory really changed... +if [[ $ZFTP_PWD != $zflastdir ]]; then + # Cancel the filename cache for the current directory. + zftp_fcache=() + # ...and also empty the stored directory listing cache. + # As this function is called when we close the connection, this + # is the only place we need to do these two things. + [[ -n $zfcurdir && -f $zfcurdir ]] && rm -f $zfcurdir + zfotherargs= +fi if [[ -z $ZFTP_USER ]]; then # last call, after an FTP logout diff --git a/Misc/compctl-examples b/Misc/compctl-examples index 464660477..1b9fc0ac8 100644 --- a/Misc/compctl-examples +++ b/Misc/compctl-examples @@ -563,7 +563,7 @@ cvsprefix() { cvsentries() { setopt localoptions nullglob unset if [[ -f ${pref}CVS/Entries ]]; then - reply=( "${pref}${^${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" ) + reply=( "${pref}${(@)^${(@)${(@)${(f@)$(<${pref}CVS/Entries)}:#D*}#/}%%/*}" ) fi } diff --git a/Src/Zle/comp1.export b/Src/Zle/comp1.export index 4b6dd92fd..ba2f433b9 100644 --- a/Src/Zle/comp1.export +++ b/Src/Zle/comp1.export @@ -9,7 +9,6 @@ clwords clwpos clwsize cmatcher -compcommand compcontext compctltab compcurrent @@ -33,7 +32,6 @@ compoldins compparameter comppatinsert comppatmatch -comppms compprefix compredirect compqiprefix @@ -55,7 +53,6 @@ freecompctl getcpatptr incompctlfunc incompfunc -instring makecomplistcallptr makecomplistctlptr makecompparamsptr diff --git a/Src/Zle/zle.export b/Src/Zle/zle.export index f63f45eb8..1e71e4bf3 100644 --- a/Src/Zle/zle.export +++ b/Src/Zle/zle.export @@ -27,8 +27,6 @@ lmatches menuacc menucmp menucomplete -menucur -menugrp minfo newkeymap nlnct diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 9c7a19d87..9f4fa0c93 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -568,6 +568,8 @@ acceptlast(void) cs = minfo.pos + minfo.len + minfo.insc - (*(minfo.cur))->qisl; if (cs < l) foredel(l - cs); + else if (cs > ll) + cs = ll; inststrlen(" ", 1, 1); if (parpre) inststr(parpre); @@ -2121,6 +2123,7 @@ abort_match(void) { free_cline(matchparts); free_cline(matchsubs); + matchparts = matchsubs = NULL; } /* This adds a new string in the static char buffer. The arguments are @@ -2615,6 +2618,7 @@ comp_match(char *pfx, char *sfx, char *w, Comp cp, chuck(r); /* We still break it into parts here, trying to build a sensible * cline list for these matches, too. */ + w = dupstring(w); wl = strlen(w); *clp = bld_parts(w, wl, wl, NULL); *exact = 0; @@ -6280,8 +6284,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) gen_matches_files(1, 0, 0); /* The compctl has a glob pattern (compctl -g). */ if (cc->glob) { - int ns, pl = strlen(prpre), o; - char *g = dupstring(cc->glob), pa[PATH_MAX]; + int ns, pl = strlen(prpre), o, paalloc; + char *g = dupstring(cc->glob), *pa; char *p2, *p3; int ne = noerrs, md = opts[MARKDIRS]; @@ -6295,8 +6299,9 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) } noerrs = 1; addwhat = -6; + o = strlen(prpre); + pa = (char *)zalloc(paalloc = o + PATH_MAX); strcpy(pa, prpre); - o = strlen(pa); opts[MARKDIRS] = 0; /* The compctl -g string may contain more than * @@ -6335,6 +6340,10 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) else { /* It's a simple pattern, so append it to * * the path we have on the command line. */ + int minlen = o + strlen(g); + if (minlen >= paalloc) + pa = (char *) + zrealloc(pa, paalloc = minlen+1); strcpy(pa + o, g); addlinknode(l, dupstring(pa)); } @@ -6380,6 +6389,8 @@ makecomplistflags(Compctl cc, char *s, int incmd, int compadd) glob_pre = glob_suf = NULL; noerrs = ne; opts[MARKDIRS] = md; + + zfree(pa, paalloc); } } dirs++; diff --git a/Src/glob.c b/Src/glob.c index cf22ef923..20ca30b2e 100644 --- a/Src/glob.c +++ b/Src/glob.c @@ -3023,7 +3023,7 @@ matchonce(Comp c) if (exclend) { exclsav = *exclend; *exclend = '\0'; - } + } if ((ret = doesmatch(c->left))) { if (exclend) *exclend = exclsav; diff --git a/Src/hist.c b/Src/hist.c index 167ffe171..52e3e1394 100644 --- a/Src/hist.c +++ b/Src/hist.c @@ -700,7 +700,7 @@ hbegin(int dohist) { isfirstln = isfirstch = 1; errflag = histdone = spaceflag = 0; - stophist = (dohist ? ((!interact || unset(SHINSTDIN)) << 1) : 2); + stophist = (!dohist || !interact || unset(SHINSTDIN)) ? 2 : 0; if (stophist == 2 || (inbufflags & INP_ALIAS)) { chline = hptr = NULL; hlinesz = 0; @@ -721,6 +721,8 @@ hbegin(int dohist) hwbegin = ihwbegin; hwend = ihwend; addtoline = iaddtoline; + if (!isset(BANGHIST)) + stophist = 4; } chwordpos = 0; diff --git a/Src/zsh.export b/Src/zsh.export index 5a3a94c70..59d75676f 100644 --- a/Src/zsh.export +++ b/Src/zsh.export @@ -76,7 +76,6 @@ file_type filesub filesubstr findcmd -firsthist freearray freeheap freelinklist @@ -112,8 +111,6 @@ haswilds hcalloc hgetc hgetline -histentarr -histentct hist_ring hist_skip_flags holdintr @@ -196,7 +193,6 @@ promptexpand pushheap putshout pwd -quietgetevent quietgethist quotedzputs readoutput diff --git a/configure.in b/configure.in index 93a03d30d..6f3a1f52e 100644 --- a/configure.in +++ b/configure.in @@ -254,7 +254,7 @@ dnl else use -O if test -n "$auto_cflags"; then if test "${enable_zsh_debug}" = yes; then if test -n "$GCC"; then - CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -pedantic -ggdb" + CFLAGS="$CFLAGS -Wall -Wno-implicit -Wmissing-prototypes -ggdb" else CFLAGS="$CFLAGS -g" fi -- cgit 1.4.1