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.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 24793 invoked from network); 17 Nov 2022 13:06:06 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 17 Nov 2022 13:06:06 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1668690366; b=qxQwKMcw2NDV+pPQBhWl7eJ8BkcJNHs3ZjCGDJ/ZytrDnWeJH698HSPOPE+TeNPn6sQqp2EwMg GcwWGw3UDzbOceegc98E/rRrUyDDMq32EyaTPAPb4s+3zwk/4H3iLAxLlgZepvP24y+fw1bZkd jnMHpuUND6bvBMGW0h/TgLobaNF6BosGa9DuE69twXedMYjVF3LLiyxhHrW8C+j+l2Ja0N/r1t /Z9sf79uls6sR5RcLOGNXSrz5QfZ7SwIA/lDzBeHX5MVM/Xoavn7ZJrpKrManyA793Jg9lIz+g HHpUZNzekcUsvwWAyRNrXSyB/gFff0V5GSj+ybHL0/isCw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oa1-f52.google.com) smtp.remote-ip=209.85.160.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1668690366; bh=ouv0rHSHhC7GD+N4CHMW2juvbmE8Tls1d8tjyxz4rIE=; 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=sb6jJHEMkRoAYyRy/buLtjlFT2YMPTsVzoIU5k7Ib2UKKZ3Bq99OVLe0CT+93nMi6M/pPzV3f4 qVsD/kkur4a6TZOMuVr6cO2LGobYbjbxd0qHCoL7ldsHp19asJIYU2ZHI56XLCkto0CGdxpmjQ BWNTdd490fFdAtmibrunGneg9RLkHnJILAgwpxTuXstUA15/3TJQ2ySLcRljlSsBI5b+P2z5x4 pKj8+QPootSJUvCtp6JIPDINwbIYGBQ9SyNpvdcASUGql8NfKDA4DTf/99Xkl5DTiaGM6eA1bQ o2dcMvuMXLTyAzWgqs97G6cKLBMepYlXmhcm0koZppUbPQ==; 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-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=zQzF1t+eR1IzO8ciSCFOO/E9nN7YrLguKd4n/dIf6do=; b=A+wwMHLjfjJU+996ETO6iBJxoK aBY+zHCEOhVpisuryyUdOwdH9LqGrNt2YjotrETuAoktLhtNwPEzzoHVIgdG8cBG/ibWvdgn8mrK3 6WGilgYMej89ZcfcgE5C9lu+XBCyBSUHIunlA4WwDHRrUtqJ0KTxecirf0d+6T/j4hhVpsAX1dKNn diYnqtkYwXfYt/Tno+WRzyT7EhGGrRkWxeSyhU5oorPE0trARCsgbIwXEl7wENideaWJ3PMYWIGNB fXpgCvMGy9IA86HxQ8np5HR3Q8++4oc8GRFLltGdIo4CE3A8V3eKQ6G2QlW7hDjyuD2IdGrSPAb3C rBA2z0ZA==; Received: by zero.zsh.org with local id 1oveai-000DQZ-HN; Thu, 17 Nov 2022 13:06:04 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oa1-f52.google.com) smtp.remote-ip=209.85.160.52; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-oa1-f52.google.com ([209.85.160.52]:43585) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1ovea8-000D4d-DM; Thu, 17 Nov 2022 13:05:29 +0000 Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-13c2cfd1126so2022320fac.10 for ; Thu, 17 Nov 2022 05:05:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zQzF1t+eR1IzO8ciSCFOO/E9nN7YrLguKd4n/dIf6do=; b=Nfz/VZrE6+ZzY9y6fdJVWs9bcpD1E3Yu0T/9JJp3U2Oqy1lZnK4BPHg8GCCwl+bCht PnNd4UmoW66CqFJgQMH+Q7EnrKKAqu98dbpq1aSvt6Ou8IaRKHD2oskp9eR6aY6aoOyk HTFn7Z0q+2JF/omzRGv8pZobpWJDC0sRBx8DrJPSS3+UBk6bnX+V6+hPSOv+iIklROFC ctOD6uGmJPr08tYbkzCDXpHe1jowoWdozM926zuybbMFDKtrFP4lpoXMN2hhZR0FiBxo /dFHh5Un996oNVcjNomOdqUGRs1NQzJJXCvOkFmPKYFma6FkO04411fglYLAmk1LKRYk 2eUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc: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=zQzF1t+eR1IzO8ciSCFOO/E9nN7YrLguKd4n/dIf6do=; b=jVZfQBkP92Tho43q5mhTPsVBB/CAJh8pU/I5szM8hQlLRvzhvB2/R04zFx6x8nz2vR Ws2EEKKvJayRznh+MAMZMQl1Ste4P7VZcfJST5JODaO1gNKdfDXs3SYLm5LFK4/Kh3uQ 6plmfloyq77MkegkI1u5512P+2JECbWs9ESOuEIC1zp8dZdBbKa4DrSimpRPaMLMpbU7 aG211KeqY6nVeEcPZpp0Ng63yCv+1BLq/jH4/QJrUPjjftapB84H6nOl4v+ogs0qu9Mt TW+LxWrqf8wPXxxw5dM+VNsknGVsyPoTbna/JQKiUl1kGaHUTZTd5Ts7LlL6zfyG0jJT rORw== X-Gm-Message-State: ANoB5pkzQ+SN50Ur8B+6+WAH0CWSwRd2eyPC/lpMWqBgTG+z0CmCi4q4 xfcIfrcCA17NCzP/a+fIUN1p5HLOmCnXwRc8QyiDTp+Yr8w= X-Google-Smtp-Source: AA0mqf76mS1laRo6dCx8hd/Nh5UAR3TOTKEnHPg66j/XiW3LxJm5o0sAqNRwxVUiJXAJih5URdnjLDHus8qitAOgvPs= X-Received: by 2002:a05:6870:2b04:b0:142:7940:c42b with SMTP id ld4-20020a0568702b0400b001427940c42bmr200167oab.55.1668690327024; Thu, 17 Nov 2022 05:05:27 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Marlon Richert Date: Thu, 17 Nov 2022 15:04:50 +0200 Message-ID: Subject: Re: Bug: Callback to widget set with `zle -Fw ` shouldn't change $LASTWIDGET To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 50985 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: The -w in `zle -Fw arg` is not the inverse of the -w in `zle -w arg`. It has a different purpose: * In `zle -F callback`, callback is a function and gets called as such. * In `zle -Fw callback`, callback is a widget and gets called as such. The latter form is necessary if you want to be able to call other ZLE widgets from the callback or access other ZLE functionality. You cannot do that with the first form. It's not the "inverted meaning" here that is the bug. `zle -F` (with or without -w) just shouldn't ever change $LASTWIDGET in the first place. It breaks a lot of existing widget functions and there is no possible workaround. On Wed, Nov 16, 2022 at 8:25 PM Bart Schaefer wrote: > > On Wed, Nov 16, 2022 at 7:08 AM Marlon Richert wrote: > > > > Currently, when the ZLE calls a widget set with `zle -Fw `, > > this changes the value of $LASTWIDGET. > > Hrm, normally (running "zle WIDGET ..." explicitly) this would be > skipped (unless "zle WIDGET -w ..."). Too bad -w was overloaded in > this way. It's not technically overloading because it's used in > different contexts, but mnemonically at least it could be confusing > that "zle -Fw FD WIDGET" and "zle WIDGET -w" would seem to have > inverted meanings of -w if we were to change the default behavior of > -F. > > Of course it's also "-Fw" as a single "option", not "-F -w", so we > can't even do something like "zle -F +w" to indicate the desired > behavior.