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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14729 invoked from network); 12 Dec 2023 02:11:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 12 Dec 2023 02:11:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1702347076; b=I3OEk3ewQtCXuGjtANKRf1ZB3o4CdvWQpQ4+OvX+usANziHbBDlzfda91kJlWHtgrAcYNCWUsd 24rYOtqP6XrdI9vT/BHoU479c4YsUwooPJVWvJAxt7UhnKK8yAMg6zgjA/XVvJumeo+zj7I5HB LZENNtcul25vGhyNsyBiqCGenqebUulENiQO+WyKmUTN3g+g5PCAu3c/GCIMgzSA4GOdf9T9Pd NKyO2kyuk7hjDW4/7aJGWAvZdu5tn0+Lz2RfVVfz+cisqEbcYHSe8dybMgY3EqYICOSFNxk0yB i6h0taincJZ1vYp94aQtjiNavjGD9k2HzyV4SHCJT0Ugxg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 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-20210803; t=1702347076; bh=64pLc6Ur/a69s18ti9C+Desmad65vKw+42W6T6IQ+ng=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:To:Subject:Message-ID: Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature:DKIM-Signature; b=dN+nPXBPc65KFkcVIQcCyHstkGxtXgt9HCFa+Uqjj3bkcTDrwVy1CVqe/D7rJg3T7LCLBCMxbR mFYDGdOln98ZqfO3TcnEXSHx5JksCF1KpKSSXUcDjyMv+6nnrnOpChblHtJog+Rxa1jttLvwuf BRuZkOVSkGswqrJuN+VE9pCaTLfLyiJE37mg8qNlYcNqhsE6HI7MIFimqE+l5B+lDlTGmr18HD 9FHUdHkNoKhwDZfM7aumzV/mS3brDGPdPm+qsgcdIDYhMVd3RM2Jws3BSFMA/Out6HcQWN1mN1 vG+zxO0cSiZfoVUbjkgPE+DtamRdFhjcAWz4LRSFiCCPGw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Cc:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=NNubY1miLhggjl8vIAk6e6dZSvITmx6dUL5s3LGu7Vw=; b=CHMlxC/pohCPR6rYgpBkDPWIqn +YvFsNl+dnmruoD6+z1RfXQRqXPE7Pac9cm8cA6jYGxCPKapy8IWCAGu6dfJp+w1xtG/WqOL04jwm eogD9u8ujCwd1hgPTCkbhxpdYMJY28ykGt7pdGyd5T6vbqF2jf0IM66OGgcXJkt2UHmf2X5oX/FkI xxBIFJJXUVDN3e8uzT2jkWHxGdVsf78R5ZD6y6ESBau8GsXfO4uKQ6NJ3zWcJxoqV5afrzRBgIUSk PgLNBHXwYP8r7gLqvbYMfTrOaXDtyWNqHbzSIWzrTO/ZJJMfOUd6jucHGQTWCJF6qRzPkKmmaO7fb qzSsK2xw==; Received: by zero.zsh.org with local id 1rCsEt-000PMN-NW; Tue, 12 Dec 2023 02:11:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-wm1-f46.google.com) smtp.remote-ip=209.85.128.46; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-wm1-f46.google.com ([209.85.128.46]:59785) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1rCsEI-000P3F-59; Tue, 12 Dec 2023 02:10:39 +0000 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40c2bb872e2so48165205e9.3 for ; Mon, 11 Dec 2023 18:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1702347037; x=1702951837; darn=zsh.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=NNubY1miLhggjl8vIAk6e6dZSvITmx6dUL5s3LGu7Vw=; b=X/QPf2D5t11/lJxvMDTi+VmEh7I4MMoj4vQtAndqUpUWn0DPf6VR5SfC6vRobo9W9K w3y925CAdmDmb4w2jiRzcsg/QkC4QKZJ/ukPMQ1lNWqo7LzFEuOI74zh78YTqw+oWWRP 7ztmTg7mvzpWVdTZZR1BgkOke8rbcFwLlEAZLQh9Zjd4d6eFqv2v7qU8gIKJJfOau3sN /r1TejP8KG6bl4lrrQhep3bb/XxxInQrEfxefZ3ZwtShCQKfB0As5rMjpoc5G9Xc6Sqv tsAnRHtzqljN9W6rPHQQBakRXkOSaMXBCm5yJLLJucf+F0m4PXa2MA6fYEVuRsN/5Fod TibQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702347037; x=1702951837; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NNubY1miLhggjl8vIAk6e6dZSvITmx6dUL5s3LGu7Vw=; b=djHwNdae2rXMQbgENjMb3dBR+cVTmneDNFjpEmgTHI1AsnIHQ6v1+fqdLnRk5kCQ/q 1geYGHxIgnwYQycHt7hsHIuTBxXM2fIzTnjMU5ypvybfnba/5jwrWDV6VIwuMr281OyQ F5ESFlCwHYpeivn6VEJUHSKnoDqJ8jf6NS1cHxUPmVWxRb0suPseNgBeoL37G4c6LmA+ GwjAUscxHVm9yMtC8O1HpOPN6boJyG5BYTE9eBG0hOIZG8YlJIL2WVMWPK/NLIOHguPo aXR8LVpdNockLJ7r4HRIgOBxbG8aHR43uv42rO4PmiWXPQuNLvjylGe9nq/repDnP683 a9BQ== X-Gm-Message-State: AOJu0YwRPSwi+5cvyk6v9fn+vKnsQpQZW4enJAm7TYdTWieXafTOtFBi 5qhWR/wNVsmMtQcK7gLEFGb66rtx5NoBIE1tUoTkEaolGpYk0gtexz4= X-Google-Smtp-Source: AGHT+IE0C3Q1avKkroGmYDFTvYndokBEErXRp8gN0GHOu2TeGqufdI9izyK5P0inz0FjZtfA2mQDBNx+2u9JXg4dDBo= X-Received: by 2002:a05:600c:2255:b0:40b:448b:f711 with SMTP id a21-20020a05600c225500b0040b448bf711mr1270193wmm.18.1702347037511; Mon, 11 Dec 2023 18:10:37 -0800 (PST) MIME-Version: 1.0 References: <36723-1702340891.599700@Cxey.Q8kE.H2LY> In-Reply-To: <36723-1702340891.599700@Cxey.Q8kE.H2LY> From: Bart Schaefer Date: Mon, 11 Dec 2023 18:10:25 -0800 Message-ID: Subject: Re: Completion oddities To: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52409 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: On Mon, Dec 11, 2023 at 4:28=E2=80=AFPM Oliver Kiddle wrote: > > Bart Schaefer wrote: > > Maybe I'm just confused. > > > > #1 > > It appears that setting MENUSELECT globally, overrides the "no-select" > > string in the "menu" zstyle. > > The menu selection was built to work even with compctl completion. > MENUSELECT is the interface _main_complete uses to control it. So the > way it is doesn't surprise me. It's inconsistent, though. If you use no-select by itself, it kills MENUSELECT. And the doc suggests that it should always prevail: Menu selection can be turned off explicitly by defining a value containing the string 'no-select'. > > #2 > > When the "original" style is true for _approximate and _correct, the > > REC_EXACT option seems to be ignored. Is there a way around that? > > While you've since posted a solution, I've not managed to construct an > example to demonstrate the difference. I had an example but it's long since scrolled out of my terminal history. > > #4 > > The way that the function field of a context is computed is a bit > > annoying. For example, if I call > > zle _correct_word > > from _generic, then instead of the widget name in the function slot, > > the function is correct-word. This makes it impossible to specify > > styles for the widget separately from styles for using _correct_word > > directly. It's done this way by a large number of functions. > > > > How are you calling `zle _correct_word` from _generic? Sorry, I mis-"spoke" there. I meant "from a generic widget" not literally "_generic". The initial widget is not a zle -C widget, it's a zle -N that fiddles around with $BUFFER, sets up $curcontext, and then runs "zle _correct_word". But given this: if [[ -z "$curcontext" ]]; then curcontext=3D"correct-word:::" else curcontext=3D"correct-word:${curcontext#*:}" fi I don't see how the function context can ever be anything other than "correct-word", even if it was started from _generic? Unless the style is tested either before _correct_word is called or after it returns.