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, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32590 invoked from network); 26 Sep 2020 09:41:12 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 26 Sep 2020 09:41:12 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1601113272; b=fJhA4wKeDwtk7eF9jCXMIp0+nJVKnHJIunPuuhSWejUZ9OVtLggMmQfK2TZZq50iNgiMCzEtwn oqANbYkMmCUTXAp5cF0UYg5+9MmRyilC3U1u5XnMuDil6+dBQL+zhke5mbYrbZBivnch2FMByO ymSYYn2EvPCmo5G8KvD04nrO1eXdz+LcaQ18gOYwQP047jAJA1CVb9TWmdSQ8r4rp5hBBmbqti uoBFk2aiRGGExXWCL0nff7CiGDnWrNXX/eVnTesQjR0W1U737uHuzcy0BSewtes2jbI4iuZIEt 6wiBO2P1MXNHcdP93AeaN/lWzHYqezRLy55Utnf8RmnLQQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f46.google.com) smtp.remote-ip=209.85.166.46; dkim=pass header.d=gmail.com header.s=20161025 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-20200801; t=1601113272; bh=lKvuF07am9IVAk5oQwAMHmkYibPUT8QgEQVZcZ2Y3Lo=; 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=vBJF4pbqc7zYJJJuU3tWGKLhZg2QepauUIRnKia5qhScU5waUNl7EIajRkI9+HSpERZrHtSNzW Xys1ikXhShYwiPoFN67JlzhZFI4s96fYVkEonbdJVWyOFIrBwGoRbjeRlXSfLNJA4e0dGb60Z7 NgDtqpbKyHSLX/z7XaLwQvrXh/0amfT+h1trSBnJue4uiXxbcS+xRwJzuX9j/Rhu6GVQ6KUXj9 nPmWUb2K9NCYvShL3inDnyQgeIBvhUNgLt7yHvfJGNLEs0Axqer/dqnlpN3EW4f/7jAnRKeh2F 14AxVWXAJ3Kjj/ecUcHCdt7jM4U6xLkjlLSRO+fwtZeNvw==; 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=fhPstIbjfPbsZA0xmnPbjQevb95P8CTxcXZNOJk2YRI=; b=rol4lsmMJvGwu34vtT+kwZsGu1 //8TGs9EpEUutr43SDt6DJjQyv6RT5ZV/TVFmLBT3mSt51WJ8k5gR8tjPbgTeurf4w1otgqiR5MjQ k4kpA7JAowhVH1ICiuINbPorlZ36sp0NHSC5480iu9tTMjUt28K2sYnhPKakSB6Lqp9KJrnPflXL5 9AR+kRquGdOJKw+PJJXpC4M1omYSvbYC40d3OttPYo9AU90sMV8LYXOG+UYM5cyag/H+h5nDQiSmW EnC028tJ0v01Bed0r2pqD13fEGOX341jqA56pOCeU7ZqUAALoXVlRCdMVwAxZKfjx5SZFGy82H/vc 4L9SRdgg==; Received: from authenticated user by zero.zsh.org with local id 1kM6hc-0001OI-1K; Sat, 26 Sep 2020 09:41:12 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f46.google.com) smtp.remote-ip=209.85.166.46; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f46.google.com ([209.85.166.46]:36549) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kM6h5-00010S-Ga; Sat, 26 Sep 2020 09:40:40 +0000 Received: by mail-io1-f46.google.com with SMTP id d190so6082641iof.3 for ; Sat, 26 Sep 2020 02:40:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fhPstIbjfPbsZA0xmnPbjQevb95P8CTxcXZNOJk2YRI=; b=cAwQLW62TAgVS96WiTjGsjrHcDEXrZqSjJiAmey55LhnycNJ/6fSgsp/i9DIrHVRpo yMsjwVHuijNxrupEFRHPcGybK+taSMXKGcNbNwy0dB+dRi635SFxQY9hwNGpTPLd5fPw CCoc+EAoESQoZ+SpaH6ZOIadGpcnmUw9lEIBX9TFb/61ids9+ml0QtNyMXVPgUiHyuR+ UUD9zWi+viBtU5yUBsVznxWKygOk0nnsrmMrWNUJiswW5pNCXPuoG1ukw6zOvdepETw0 EIzVRK9EzvkjpLRiX31LxzHQfok9UbjCbxXVG98pZImTHGLBeq3sCsvjgGxnuyWZ/zhu lI/Q== 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=fhPstIbjfPbsZA0xmnPbjQevb95P8CTxcXZNOJk2YRI=; b=i+NhsqP3bqVY6XeaiprQG1x5QJnxDgcR30fgHm9Gqfjd484b8UGqNkiDeO9sNw+0GA z7D0XkLCPpoFhJWbeQPZA/6M72vFenC4LY6Ii0HZiY3hd5HHwsg0hXm5L5FJ8zcvVdwt hagVaLzp7NPVVVyMgYauQIRF5zyTgP/RRdqVw/rdlQ0TVcvS9UOFhdqomvWeoOoa5yh3 bM0WyH7MJo+W+1+/mZqzNqUyM+JrQnNilhLPbVJo1oEznzeMD2tCCL09W4cz9pjNNPRx KTWGOjdjZYupjsH6QaLd1ED8M9ixB7jB20EgPBvKwJ4JAUrG+bYh18Y0/CuYFQVcnu52 xCmw== X-Gm-Message-State: AOAM530nYIzQR9CW66oOFexopOaLZEEOjFnfL/Fw9kFq9iEb5eZExiKI zx+lwGntdfRGCIV5PIfy1o488J6qAp1BriRPxnA= X-Google-Smtp-Source: ABdhPJzJ4c7r/ylMim8qdC5va+xi/cwlCg5uuLgpWpw+GTO+rIa4BVdXPz3MRmUeYdEkwagImCF+dJErz1ypmf7Ivio= X-Received: by 2002:a5e:d606:: with SMTP id w6mr1740611iom.67.1601113238199; Sat, 26 Sep 2020 02:40:38 -0700 (PDT) MIME-Version: 1.0 References: <20200923182558.nfokboenuhdypz45@localhost> <322971271.67362.1601044983375@mail2.virginmedia.com> <20200926092700.01784063@tarpaulin.shahaf.local2> In-Reply-To: <20200926092700.01784063@tarpaulin.shahaf.local2> From: Roman Perepelitsa Date: Sat, 26 Sep 2020 11:40:26 +0200 Message-ID: Subject: Re: How to avoid infinite recursion in ZLE widgets To: Daniel Shahaf Cc: =?UTF-8?B?UGV0ZXIgU2zDrcW+aWs=?= , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26087 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Sat, Sep 26, 2020 at 11:27 AM Daniel Shahaf wrote: > > Redisplay the command line; this is to be called from within a user-defined > -widget to allow changes to become visible. If a var(display-string) is > +widget to allow changes made directly to the terminal (bypassing ZLE) to become > +visible. If a var(display-string) is > given and not empty, this is shown in the status line (immediately > below the line being edited). I think the original documentation was correct. Consider this snippet: function a() { BUFFER+='foo' zle -R sleep 1 BUFFER+='bar' } zle -N a bindkey '^A' a function b() { BUFFER+='foo' sleep 1 BUFFER+='bar' } zle -N b bindkey '^B' b If you press Ctrl+A, "foo" will appear immediately, followed by "bar" after one second. However, if you press Ctrl+B, "foobar" will appear after one second. The only difference between the two widgets is that the first invokes `zle -R` after appending "foo" to BUFFER but the second doesn't. Roman.