Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete
- X-seq: zsh-workers 48397
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Marlon Richert <marlon.richert@xxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete
- Date: Sun, 4 Apr 2021 12:31:35 -0700
- Archived-at: <https://zsh.org/workers/48397>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2021-04/CAH%2Bw%3D7YBw90q-r1Zoyn%3DgSFgOtx6%2B13K-kOVXi0kdVG%3DGMV0bw%40mail.gmail.com>
- In-reply-to: <CAH+w=7YAxLGd=cTFkOqHXiUpk1iPp=7u3-qvEKmE6dTSELcoMA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDuxX39Z7-ioZTgrosL-SQW8dhZy9_v694u7w4Mtu+EHSw@mail.gmail.com> <CAH+w=7b4b-FBVbrZ4SWSiqxP4OcuLmzQWjqZ39c6Q-WZzPq60Q@mail.gmail.com> <CAH+w=7ZL+soLWYiKUb1Ej20WHbs7johzVWJ+qEvevLP5tK_Z4w@mail.gmail.com> <CAHLkEDtjqfyXFR7RqXBUVmKc5MwWR2T8zazortvO3ygEphZarA@mail.gmail.com> <CAH+w=7bhfeV0k5y0FtZLTsm_Y5uBU1wLJw7GUVubfxsKopaRDg@mail.gmail.com> <CAHLkEDuo=8MbjYWOmQM5d4uLOzo+BC6XTy=S14-BfeBPMZjysw@mail.gmail.com> <CAH+w=7YAxLGd=cTFkOqHXiUpk1iPp=7u3-qvEKmE6dTSELcoMA@mail.gmail.com>
On Sun, Apr 4, 2021 at 11:35 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> The problem with calling _generic at all (right now) is that it messes
> with $curcontext in a way that may break other functions that rely on
> _main_complete behavior. If we can invert the call sequence so
> _main_complete remains first, then _generic itself can be tweaked so
> that it does NOT mung the context in that circumstance
Sorry, that's also an incomplete explanation, and it might not be only
_generic that needs tweaking.
Suppose I want to invoke _complete_debug. It's supposed to emulate
complete-word, but has a hardwired call to _main_complete. If
complete-word is _generic, then when I try _complete_debug I won't get
a backtrace that actually matches what happens when I complete-word.
If instead _main_complete runs _generic, the backtrace from
_complete_debug is correct, and there's an opportunity to build some
additional intelligence into _complete_debug because it can check
which widgets are _generic. Similar things apply to _complete_help,
etc.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author