Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Interrupts in completion, traps in _main_complete

On Sun, 07 Dec 2014 15:01:40 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Dec 7,  4:21pm, Peter Stephenson wrote:
> }
> } That's probably the way to go --- my gut feel is the behaviour of the
> } other form of trap is too far from what we need to make it a good
> } starting point.
> I took a look through _main_complete and it does quite a bit of saving and
> restoring of global completion settings e.g. in order to implement zstyles.
> None of it is nicely isolated, i.e., we're going to need several always-
> blocks -- and/or possibly some things declared "local", which I'm not sure
> why was never done in the first place -- or else a significant rewrite.

I'm probably missing a lot, but it struck me that if you're aborting out
of completion completely, as it were, then the stuff that doesn't get
executed doesn't typically matter all that much.  The stuff you really
want to get right on exit --- options, IFS, etc. --- is already local.

Beyond that I couldn't offhand say which the most important things to
restore were.  If you aborted completion, did you want to set _lastcomp
or do you actually want to steer clear of setting it?


Messages sorted by: Reverse Date, Date, Thread, Author