Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Why does ^X? behave differently than TAB?
- X-seq: zsh-workers 11469
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: Why does ^X? behave differently than TAB?
- Date: Fri, 19 May 2000 15:28:05 +0000
- In-reply-to: <200005191324.PAA08160@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <200005191324.PAA08160@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
On May 19, 3:24pm, Sven Wischnowsky wrote:
} Subject: Re: Why does ^X? behave differently than TAB?
}
} You wrote:
}
} > Here's the actual script. Run it as an autoloaded function. At the
} > "ftpupdate command: " prompt, type ^X? twice.
} >
} > ...
} >
} > trap "$r ; trap - 0 2 3 15 ZERR ; return 1" 0 2 3 15 ZERR
}
} The `compadd -x' in _message returns non-zero and makes this trap be
} called. And of course, the next time round, there is no `compctl -T'
} anymore.
}
} Hm. I don't want to change the return value of compadd and it wouldn't
} solve the problem anyway. Do we have to temporarily unset/default all
} traps in completion? Urgh.
Not all traps, just ZERR. We should handle the errexit option, too.
Index: Completion/Commands/_complete_debug
===================================================================
@@ -3,6 +3,8 @@
setopt localoptions nullglob rcexpandparam extendedglob
unsetopt markdirs globsubst shwordsplit nounset ksharrays
+setopt localtraps noerrexit ; trap - ZERR
+
(( $+_debug_count )) || integer -g _debug_count
local tmp=${TMPPREFIX}${$}${words[1]:t}$[++_debug_count]
local w="${(qq)words}"
Index: Completion/Core/_main_complete
===================================================================
@@ -20,6 +20,9 @@
unsetopt markdirs globsubst shwordsplit nounset ksharrays
exec </dev/null # ZLE closes stdin, which can cause errors
+# Failed returns from this code are not real errors
+setopt localtraps noerrexit ; trap - ZERR
+
local func funcs ret=1 tmp _compskip format nm call \
_completers _completer _completer_num curtag _comp_force_list \
_matchers _matcher _matcher_num _comp_tags _comp_mesg \
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author