From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27482 invoked from network); 4 Apr 2021 18:36:22 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 4 Apr 2021 18:36:22 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617561382; b=te1XgS7g2Y1JL2+3Mo+1Ie9sWDfPKcFuZYE3lsRN95aK6LCQUX39WdGSIQhuSABFCR+mbKevSP uSrgIUNMZA1bdNYBT3BXi50UwYHKT9n8zkRUkysLwuYpxGVooMDbkz5zDpOrk9JjOCytYFOUjg zGNAsdJxzfaFCJw6pg+25yeOzJV9fyibMMKDu5QLTpVpdeuwv7XguTL/TlTHTjp9FYLeK1UF6L xe0ONNgkkvrQJsq4seYABPLLHIusw5+VYVWrJRzh83eZAawmmYR8+S+r1SBbKi0nzukaFcQrD5 q1f8cSZpyBa2pBmebP31p3WqxsyIZ76MYkvk9lHH5hEuYQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f169.google.com) smtp.remote-ip=209.85.167.169; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617561382; bh=vQMf7O0+H+FxjT+jkd7pDnaKis+5Y6J9d3Alvo0KOi4=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ZpvL5NAuhOInl1qwCxF4LpLsvvTSj9fDPVW6LZgsAA1O0yHv+biXaclUUexVlK2PIusGAXW6CY NXl7BvW2WeTbQxcOHJHI7XmtGAmn3XOPEeHX06hwcoSRbyClUiiMp7ni37RxY6G9qnWbDcKYnp VEdaRJL1/zirYNkpuCbQPErmFmUOCVQfXQ8O3AZ5bNQe6XusaK1l7ZvHdJ3vOsikP/Oq6QhHII qVp0l57v32xeyFJAlFPkRWmMfoeC41NJvdbyqRt8UwAaVfjW5Pm5lp5doY7P7M5z94GmiiYw7G wyoU0AGsKO6QZSWEyUW74zkX2yu1NVCWyofA1lRnhJLvTQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=TH4kKKhKsppBJROEMpuYi05z/bpnZUYCHcdTQnV0bHc=; b=jD8540ZO+h4/Ff4qogwhopYrFN 3xQOHlUCx7aXgTDk8Z2avOJP4n8k7bFWAF8mp61p8UqpbxHxS81sJdDuV9CQu60EjsvFhvoVPx7aJ rp2LQ8oVNbK0ayipIDSjZiDzIQM9Py4qMH46OZQonnGKgF0WCuPsNaKE3VATnbUF/q2s7+gWS/ECc NZsfmJG+F7mWRbeAqzSK0P/gXWSo+Q3bamCWpIaI0PJqo0Qn6JG10tByPv4u4XIbYxrcYMaDKGVgj NcSo5/6YObIH1VsMiNaLFDAwdrr5jQ9kXlngxvphLWVJ5WXtydCdaf8C/+kzsNY8noF/rLtcKHBSy o7CJx3fw==; Received: from authenticated user by zero.zsh.org with local id 1lT7bi-000EW7-1E; Sun, 04 Apr 2021 18:36:22 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f169.google.com) smtp.remote-ip=209.85.167.169; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f169.google.com ([209.85.167.169]:41761) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1lT7bS-000EM3-3s; Sun, 04 Apr 2021 18:36:06 +0000 Received: by mail-oi1-f169.google.com with SMTP id z15so9814766oic.8 for ; Sun, 04 Apr 2021 11:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TH4kKKhKsppBJROEMpuYi05z/bpnZUYCHcdTQnV0bHc=; b=yEpspKkdv9ww+q6+EUvYJ+EaWx9BYzmRT7L37sz/ERNFgGd/seog1UU8RSX4V8IjgK 3FIDu7VghswWYP2u+i/vo3HUVp5qDhL07o3LkJth5UOQ+rDGd1S+2Y3z9rqw8uTvHtfj U4wwn0aCn2SFJBEyxteIy5Mzbi2FKv+STuMIELv16RAijj20f4DFlOmKKdRA/cwzZI7Y IGWjQTVixph07ElUn5YRjGm/Vv2w0H1yTQ7nImls4Ek0aS9t4KU9mbNrNMJHP/FXDWIt C0nv8HE/8RcMqxraRXKyjSvV0o/tshAk+/ZtrLuXnfltF7E1w6ExluMyNwZtBpcAShK7 Rodw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TH4kKKhKsppBJROEMpuYi05z/bpnZUYCHcdTQnV0bHc=; b=Bvm791OukX+WctzaXlb+YJxqc1cauGZpomDGL+No1XKCNrQxo9DP+QJsg2I5mwEEaT qAwfPe2CifLpcCVvxg11rcpx9VpEeBITP61lkzTr+fIrAsBf7Lnsyc3kTCP+gi2ifh2o mZzSoXCGjdLB9mmjQ0uGbDAXZJ1TAIKXY88/aJHo1Zeaw9xabohCDme2GQI8TM+C0i/O mxwcuaOxzPpD9aid8ulMcGiZJ1FPHxd/J+3PCjDKdcr82LJx1O7wNdpHw3MpuPISHnpV FC4PH37ifO1WH+PPh/SHqn2w1dqK+777/RVX/SH5zVh4eWLljzrBacm0qn2BQ3oSlcwJ zQ8w== X-Gm-Message-State: AOAM533XKTshdzyy6tbCVWafj0VoIgqw6WX4oJTFU2FRATlIIpe9II2d v8JEDHY+S+1tm95cUXrzc2B8u078hQyzSTT6unSqBg== X-Google-Smtp-Source: ABdhPJwi2DtuZ+vv+7budyZvyyjKRSaQcgUFJB2eRGFoHpdSVW3dFqM3X6XZInZw4dUK6KUwhMX0AQj7H8SKQQLQB6o= X-Received: by 2002:a05:6808:341:: with SMTP id j1mr16210074oie.173.1617561365074; Sun, 04 Apr 2021 11:36:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 4 Apr 2021 11:35:54 -0700 Message-ID: Subject: Re: Proposal: Let compinit make standard widgets with _generic instead of _main_complete To: Marlon Richert Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 48396 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Mon, Mar 22, 2021 at 12:17 AM Marlon Richert wrote: > > On Sun, Mar 21, 2021 at 1:53 AM Bart Schaefer wrote: > > +if [[ "${curcontext:-:::}" == ::: ]] && > > + zstyle -t ":completion:::::" generic-widgets "$WIDGET" > > +then > > + _generic "$@" > > + return > > +fi > > This feels like a rather roundabout solution. _generic itself already > checks whether $curcontext is set and then calls _main_complete. Why > not just do the straightforward thing, and let the widget call > _generic directly, which in turn will call _main_complete anyway? This is really only the first in a few steps of patch that I didn't want to spend time on if this were rejected out of hand. 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, while still leaving the original semantics of creating a new widget with _generic unchanged.