From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 1ddb0d77 for ; Fri, 3 Jan 2020 03:36:21 +0000 (UTC) Received: (qmail 10089 invoked by alias); 3 Jan 2020 03:36:13 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24593 Received: (qmail 26057 invoked by uid 1010); 3 Jan 2020 03:36:13 -0000 X-Qmail-Scanner-Diagnostics: from mail-yb1-f181.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25677. spamassassin: 3.4.2. Clear:RC:0(209.85.219.181):SA:0(-1.9/5.0):. Processed in 4.038498 secs); 03 Jan 2020 03:36:13 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.219.181 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=iljPPTIo9omXqgrzqm5A9qaCRHc2IgYCYH4wKAD7yZ8=; b=uIYgOtfFUOhyjOH2dHyLzpxjKm8BsO8e628qtRnPtnj84ipumk0/EIwM2/rVjcSLMx 3boRaqz1zizXjW9vbp2ZzotAl9I35p0PbMVB4lbqdTaJQYq9hqbL8uY7gx5Fp88fhhKy XvP0iwOjSHvZRewQOUgP6HKgh4j3bL7D6AB1fqV9qdeX7Vr9eIqnnB/YwXTUNzF7mba1 b18THL5nyA3d/hahmsOzW0+UFpjElYqfkYmy74oNHvIkJegSvNQTf/XZi9ba5r/6ffPN Agtxcb8be/ZGiCVm1IuVWtOo+Zf6kJptpGqP3gGS+3DLK5AdJHSaBhy6svFXAl6xbIBt 9F/g== X-Gm-Message-State: APjAAAVFs4GqpYeIjXc2FTyhhJbLhjKDPPJAE35jWWny6C7eujC6iYoC jBAydiaPPwALBC/3TG+gMqH5Lmnv0A7mdQ== X-Google-Smtp-Source: APXvYqzr3VEpslMrc6SuVRKKIXdXnL4r8JfqOx+Atol7tXVKFyuzvqmhtQh5bOkipUSzvxPXJPfyVg== X-Received: by 2002:a25:7583:: with SMTP id q125mr23896214ybc.242.1578022536702; Thu, 02 Jan 2020 19:35:36 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: Adding to the history from within a widget From: dana In-Reply-To: Date: Thu, 2 Jan 2020 21:37:45 -0600 Cc: zsh-users@zsh.org Content-Transfer-Encoding: 7bit Message-Id: <3D72D898-A52E-421E-B05E-6119564791F3@dana.is> References: To: Piers Powlesland X-Mailer: Apple Mail (2.3445.104.11) On 2 Jan 2020, at 11:14, Piers Powlesland wrote: > I tried to use "print -s xxxxx" to add entries to the history from within a > widget but it doesn't seem to work, although executing the function not as > a widget does allow me to add entries to the history. Maybe i misunderstand, but it seems to work for me: % zsh -f % foo() { print -s foo test }; zle -N foo; bindkey '^r' foo % # Press Ctrl+R % fc -l 1 foo() { print -s foo test }; zle -N foo; bindkey '^r' foo 2 foo test % What exactly are you doing that's not working? dana