Skip to content

Commit

Permalink
Merge branch 'master' of git://git.code.sf.net/p/zsh/code
Browse files Browse the repository at this point in the history
  • Loading branch information
bartschaefer committed Mar 4, 2014
2 parents e6d9975 + 3c25cb2 commit ff6d811
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Doc/intro.a4.ps
Doc/intro.us.pdf
Doc/intro.us.ps
Doc/version.yo
Doc/texi2html.conf
Doc/zsh*.1
Doc/zsh.texi
Doc/zsh.info*
Expand Down
53 changes: 36 additions & 17 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
2014-03-03 Barton E. Schaefer <schaefer@zsh.org>

* users/18550: Doc/Zsh/compsys.yo: matcher-list clarifications
2014-03-03 Simon Ruderich <simon@ruderich.org>

* 32289: Doc: Add zsh version to footer in HTML documentation.

2014-03-03 Oliver Kiddle <opk@zsh.org>

* 32441: Completion/Base/Completer/_extensions, Doc/Zsh/compsys.yo:
add completer for file extensions

* 32450: Src/Zle/zle_hist.c: make get-line set the history
number that was saved with the line

* 32448: Src/Zle/zle_params.c: fix seg fault after recursive-edit

* 32439 (with Yuri D'Elia): Completion/Base/Core/_main_complete:
add new show-ambiguity style

* 32436: Src/Zle/complist.c: allow = to be used in ZLS_COLORS
patterns if it is quoted or inside parentheses

2014-03-01 Peter Stephenson <p.w.stephenson@ntlworld.com>

Expand All @@ -22,7 +41,7 @@
Completion/Unix/Command/_rm: improved quoting for ignore-line
style.

2014-02-24 Oliver Kiddle <opk@zsh.org>
2014-02-24 Oliver Kiddle <opk@zsh.org>

* unposted: Doc/Zsh/compsys.yo: fix typo

Expand Down Expand Up @@ -104,7 +123,7 @@
* 32388: Doc/Zsh/mod_zutil.yo, Src/Modules/zutil.c: zparseopts -K
preserves individual associative array elements

2014-02-14 Oliver Kiddle <opk@zsh.org>
2014-02-14 Oliver Kiddle <opk@zsh.org>

* 32361: Src/Zle/zle_tricky.c: don't reset lastline before completion

Expand All @@ -122,7 +141,7 @@

* Martin Vaeth: 32356: Util/helpfiles: fix a typo.

2014-02-05 Oliver Kiddle <opk@zsh.org>
2014-02-05 Oliver Kiddle <opk@zsh.org>

* 32355: Doc/Zsh/zle.yo Test/X02zlevi.ztst Test/comptest: document
and test vi mode undo changes
Expand Down Expand Up @@ -157,7 +176,7 @@
unset for better compatibility in emulation modes; for the same
reason, remove the readonly flag from $_

2014-01-31 Oliver Kiddle <opk@zsh.org>
2014-01-31 Oliver Kiddle <opk@zsh.org>

* 32314: Src/Zle/zle_main.c, Src/Zle/zle_tricky.c,
Src/Zle/zle_utils.c, Src/Zle/zle_vi.c: merge undo events
Expand Down Expand Up @@ -1564,7 +1583,7 @@
* users/17665: Doc/Zsh/options.yo, Src/math.c, Src/options.c,
Src/zsh.h, Test/C01arith.ztst: add FORCE_FLOAT option.

2013-02-27 Oliver Kiddle <opk@zsh.org>
2013-02-27 Oliver Kiddle <opk@zsh.org>

* 31076: Completion/Linux/Command/_yast,
Completion/Unix/Type/_pids, Completion/Unix/Type/_pdf:
Expand All @@ -1585,7 +1604,7 @@
* 31060: Src/builtin.c: "+" before a flag for "functions" or
"autoload" should suppress display of function body.

2013-02-21 Oliver Kiddle <opk@zsh.org>
2013-02-21 Oliver Kiddle <opk@zsh.org>

* 31058: Completion/Zsh/Command/_fc, Completion/Unix/Command/_cut,
Completion/Unix/Command/_sed, Completion/Unix/Command/_wget,
Expand All @@ -1597,15 +1616,15 @@
* 31055: Completion/compaudit: missing '$' in search of /proc
file system.

2013-02-12 Oliver Kiddle <opk@zsh.org>
2013-02-12 Oliver Kiddle <opk@zsh.org>

* 31041: Test/comptest, Test/X02zlevi.ztst: add support for
testing line editor widgets from the test suite

* unposted: Etc/zsh-development-guide: remove duplication in
git guidelines

2013-02-09 Oliver Kiddle <opk@zsh.org>
2013-02-09 Oliver Kiddle <opk@zsh.org>

* Morita Sho: 31038: Completion/Unix/Type/_terminals:
add location of terminfo entries on Debian
Expand Down Expand Up @@ -1662,7 +1681,7 @@
modifiers :wq operating on an empty string crashed the shell.
The shell isn't supposed to crash.

2013-01-20 Oliver Kiddle <opk@zsh.org>
2013-01-20 Oliver Kiddle <opk@zsh.org>

* 30987: Completion/X/Command/_xrandr: only call xrandr when
necessary and use _call_program
Expand Down Expand Up @@ -1720,7 +1739,7 @@

* unposted: Config/version.mk: zsh 5.0.1.

2012-12-18 Oliver Kiddle <opk@zsh.org>
2012-12-18 Oliver Kiddle <opk@zsh.org>

* 30877: Etc/zsh-development-guide: document git workflow

Expand Down Expand Up @@ -1754,7 +1773,7 @@
* users/17445: Src/math.c, Test/C01arith.ztst: fix handling of
leading zeroes in floating point.

2012-11-20 Oliver Kiddle <opk@zsh.org>
2012-11-20 Oliver Kiddle <opk@zsh.org>

* 30811: Completion/Linux/Command/_btrfs,
Completion/Unix/Command/_mount: new completion for btrfs and
Expand All @@ -1769,7 +1788,7 @@
* users/17042: Src/jobs.c: don't stomp the environment in "jobs -Z"
unless we've first copied it to new memory.

2012-11-16 Oliver Kiddle <opk@zsh.org>
2012-11-16 Oliver Kiddle <opk@zsh.org>

* 30802: Completion/Unix/Command/_find: add new command switches

Expand All @@ -1787,15 +1806,15 @@
* 30800: Michal Halenka: Completion/Unix/Command/_arping: fix
option.

2012-11-12 Oliver Kiddle <opk@zsh.org>
2012-11-12 Oliver Kiddle <opk@zsh.org>

* 30795: Completion/Unix/Command/_xz,
Completion/Unix/Command/_bzip2: new xz completion, new bzip2 options

* 30794: Completion/Unix/Command/_irssi,
Completion/Unix/Command/_mutt: update for new options

2012-11-11 Oliver Kiddle <opk@zsh.org>
2012-11-11 Oliver Kiddle <opk@zsh.org>

* 30793: Completion/Unix/Command/_getent,
Completion/Unix/Command/_iconv, Completion/Unix/Command/_ldd:
Expand All @@ -1815,7 +1834,7 @@
* 30780: Doc/Zsh/builds.yo: document that set -o failures are
hard but setopt failures are soft.

2012-11-07 Oliver Kiddle <opk@zsh.org>
2012-11-07 Oliver Kiddle <opk@zsh.org>

* Benjamin R. Haskell: 30737: Completion/Unix/Command/_git:
make custom completion functions for git aliases easier
Expand Down Expand Up @@ -1884,7 +1903,7 @@
Test/C04funcdef.ztst: emulate command evaluations should apply
sticky emulation to autoloads, too.

2012-10-07 Oliver Kiddle <opk@zsh.org>
2012-10-07 Oliver Kiddle <opk@zsh.org>

* unposted: Completion/Unix/Command/_webbrowser,
Completion/Unix/Type/_pspdf: add evince, zathura, dwb
Expand Down Expand Up @@ -1938,7 +1957,7 @@
Functions/VCS_Info/Backends/VCS_INFO_detect_fossil: Fix fossil
detection on unix

2012-09-28 Oliver Kiddle <opk@zsh.org>
2012-09-28 Oliver Kiddle <opk@zsh.org>

* 30697: Completion/Unix/Command/_dbus: new completion definition

Expand Down
33 changes: 33 additions & 0 deletions Completion/Base/Completer/_extensions
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#autoload

# This completer completes filename extensions when completing
# after *. or ^*. It can be used anywhere in the completer list
# but if used after _expand, patterns that already match a file
# will be expanded before it is called.

compset -P '(#b)([~$][^/]#/|)(*/|)(\^|)\*.' || return 1

local -aU files
local -a expl suf mfiles

files=( ${(e)~match[1]}${match[2]}*.* ) || return 1
eval set -A files '${(MSI:'{1..${#${(O)files//[^.]/}[1]}}':)files%%.[^/]##}'
files=( ${files:#.<->(.*|)} )

if zstyle -t ":completion:${curcontext}:extensions" prefix-hidden; then
files=( ${files#.} )
else
PREFIX=".$PREFIX"
IPREFIX="${IPREFIX%.}"
fi

zstyle -T ":completion:${curcontext}:extensions" add-space ||
suf=( -S '' )

_description extensions expl 'file extension'

# for an exact match, fail so as to give _expand or _match a chance.
compadd -O mfiles "$expl[@]" -a files
[[ $#mfiles -gt 1 || ${mfiles[1]} != $PREFIX ]] &&
compadd "$expl[@]" "$suf[@]" -a files &&
[[ -z $compstate[exact_string] ]]
8 changes: 8 additions & 0 deletions Completion/Base/Core/_main_complete
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,14 @@ elif [[ nm -eq 0 && -z "$_comp_mesg" &&
compadd -x "$mesg"
fi

if zstyle -s ":completion:${curcontext}:" show-ambiguity tmp; then
local prefix=${${compstate[unambiguous]}[1,${compstate[unambiguous_cursor]}-1]}
local toquote='[=\(\)\|~^?*[\]#<>]'
[[ $tmp = (yes|true|on) ]] && tmp=4
[[ -n $prefix ]] &&
_comp_colors+=( "=(#i)${prefix[1,-2]//?/(}${prefix[1,-2]//(#m)?/${MATCH/$~toquote/\\$MATCH}|)}${prefix[-1]//(#m)$~toquote/\\$MATCH}(#b)(?|)*==$tmp" )
fi

[[ "$_comp_force_list" = always ||
( "$_comp_force_list" = ?* && nm -ge _comp_force_list ) ]] &&
compstate[list]="${compstate[list]//messages} force"
Expand Down
10 changes: 8 additions & 2 deletions Doc/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ LN_S = @LN_S@
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
DVIPS = dvips
TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files
TEXI2HTML = @TEXI2HTML@ --output . --ifinfo --split=chapter --node-files \
--init-file $(sdir)/texi2html.conf

.SUFFIXES: .yo .1

Expand Down Expand Up @@ -159,7 +160,7 @@ zsh_a4.ps: zsh.dvi
html: zsh_toc.html
.PHONY: html

zsh_toc.html: $(sdir)/zsh.texi
zsh_toc.html: $(sdir)/zsh.texi $(sdir)/texi2html.conf
$(TEXI2HTML) $(sdir)/zsh.texi

zshall.1: zsh.yo
Expand Down Expand Up @@ -248,6 +249,10 @@ version.yo: $(sdir_top)/Config/version.mk
echo 'IFDEF(DECWSLEVEL)(DECWSLEVEL())(ENDDEF())#' | tr '#' '\\'; \
) > $(sdir)/version.yo

texi2html.conf: $(sdir_top)/Config/version.mk
echo '$$PRE_BODY_CLOSE = "<font size=\"-1\">Zsh version $(VERSION), released on $(VERSION_DATE).</font>";' \
> $(sdir)/$@

Zsh/modlist.yo: $(MODDOCSRC)
( \
echo "startitem()"; \
Expand Down Expand Up @@ -388,6 +393,7 @@ clean-here:
rm -f *.aux *.cp *.cps *.fn *.fns *.ky *.log
rm -f *.pg *.pgs *.toc *.tp *.tps *.vr *.vrs
rm -rf infodir
rm -f texi2html.conf
.PHONY: clean-here

distclean-here: clean-here
Expand Down
18 changes: 18 additions & 0 deletions Doc/Zsh/compsys.yo
Original file line number Diff line number Diff line change
Expand Up @@ -2442,6 +2442,15 @@ completing words for the dict command. It allows words from different
dictionary databases to be added separately.
The default for this style is `false'.
)
kindex(show-ambiguity, completion style)
item(tt(show-ambiguity))(
If the tt(zsh/complist) module is loaded, this style can be used to
highlight the first ambiguous character in completion lists. The
value is either a color indication such as those supported by the
tt(list-colors) style or, with a value of tt(true), a default of
underlining is selected. The highlighting is only applied if the
completion display strings correspond to the actual matches.
)
kindex(show-completer, completion style)
item(tt(show-completer))(
Tested whenever a new completer is tried. If it is true, the completion
Expand Down Expand Up @@ -3040,6 +3049,15 @@ This function is also a bindable command, see
ifzman(the section `Bindable Commands' below)\
ifnzman(noderef(Bindable Commands)).
)
findex(_extensions)
item(tt(_extensions))(
If the cursor follows the string `tt(*.)', filename extensions are
completed. The extensions are taken from files in current directory or a
directory specified at the beginning of the current word. For exact matches,
completion continues to allow other completers such as tt(_expand) to
expand the pattern. The standard tt(add-space) and tt(prefix-hidden)
styles are observed.
)
findex(_history)
item(tt(_history))(
Complete words from the shell's command history. This completer
Expand Down
17 changes: 15 additions & 2 deletions Src/Zle/complist.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,25 @@ getcoldef(char *s)
} else if (*s == '=') {
char *p = ++s, *t, *cols[MAX_POS];
int ncols = 0;
int nesting = 0;
Patprog prog;

/* This is for a pattern. */

while (*s && *s != '=')
s++;
while (*s && (nesting || *s != '=')) {
switch (*s++) {
case '\\':
if (*s)
s++;
break;
case '(':
nesting++;
break;
case ')':
nesting--;
break;
}
}
if (!*s)
return s;
*s++ = '\0';
Expand Down
4 changes: 4 additions & 0 deletions Src/Zle/zle_hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -890,6 +890,10 @@ zgetline(UNUSED(char **args))
free(s);
free(lineadd);
clearlist = 1;
if (stackhist != -1) {
histline = stackhist;
stackhist = -1;
}
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion Src/Zle/zle_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ get_prebuffer(UNUSED(Param pm))
static char *
get_widget(UNUSED(Param pm))
{
return bindk->nam;
return bindk ? bindk->nam : "";
}

/**/
Expand Down

0 comments on commit ff6d811

Please sign in to comment.