1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2026-01-02 08:21:09 +01:00

11024: The _complete_debug widget enables and captures xtrace from completion.

This commit is contained in:
Bart Schaefer 2000-04-30 10:04:29 +00:00
parent cb9408982f
commit 5c327339f5
3 changed files with 39 additions and 3 deletions

View file

@ -1,9 +1,12 @@
2000-04-30 Bart Schaefer <schaefer@zsh.org>
* 11024: Completion/Commands/_complete_debug, Doc/Zsh/compsys.yo:
Completion widget that enables and captures xtrace output.
2000-04-29 Adam Spiers <adam@spiers.net>
* 11019: Doc/Zsh/compsys.yo: fix bug in _description example
2000-04-29 Adam Spiers <adam@spiers.net>
* 11017: Completion/Linux/_rpm: fixes for --rmsource and
--recompile options, and for breakage caused by 10772

View file

@ -0,0 +1,26 @@
#compdef -k complete-word \C-x?
setopt localoptions nullglob rcexpandparam extendedglob
unsetopt markdirs globsubst shwordsplit nounset ksharrays
(( $+_debug_count )) || integer -g _debug_count
local tmp=${TMPPREFIX}${$}${words[1]}$[++_debug_count]
local w="${(qqq)words}"
[[ -t 2 ]] && exec 3>&2 2>| $tmp
setopt xtrace
_main_complete
integer ret=$?
unsetopt xtrace
[[ -t 2 ]] || {
## Calling "print -s" during completion is presently broken.
# _message -r "Trace output left in $tmp (up-history to view)"
# print -sR "${VISUAL:-${EDITOR:-${PAGER:-more}}} $tmp ;: $w"
_message -r "Trace output left in $tmp"
print -zR "${VISUAL:-${EDITOR:-${PAGER:-more}}} $tmp ;: $w"
exec 2>&3 3>&-
}
return ret

View file

@ -2308,7 +2308,7 @@ on the command line (which may be blank). If given a numeric argument
var(N), complete the var(N)th most recently modified file. Note the
completion, if any, is always unique.
)
findex(_next_tags)
findex(_next_tags (^Xn))
item(tt(_next_tags) (^Xn))(
This allows to complete types of matches that are not immediately
offered because of the setting of the tt(tag-order) style. After a
@ -2354,6 +2354,13 @@ incomplete. I.e. depending on the settings for some styles other
styles may be used, and, depending on the user's settings, only the
first sort of styles may be detected by tt(_complete_help).
)
findex(_complete_debug (^X?))
item(tt(_complete_debug (^X?)))(
This widget performs ordinary completion, but captures in a temporary file
a trace of the shell commands executed by the completion system. Each
completion attempt gets its own file. A command to view each of these
files is pushed onto the editor buffer stack.
)
enditem()
texinode(Completion Functions)(Completion Directories)(Bindable Commands)(Completion System)