From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9725 invoked by alias); 31 Aug 2017 17:38:17 -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: X-Seq: 22858 Received: (qmail 17283 invoked by uid 1010); 31 Aug 2017 17:38:16 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr0-f175.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.128.175):SA:0(-4.5/5.0):. Processed in 5.102333 secs); 31 Aug 2017 17:38:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: stephentalley@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=ZNtyub15MKhSPeQkP6H9nBSBTOaOhoYEu7pudWdzVL0=; b=ZzUh/dbjgb8I63rMCB3ACV9kFSsuy6vBNmP0PtmfRHNyqBq6nNTCPUqwbPhRV4baQB ONUw7jkm+a7Zw36tgy0+Zz5D4ICX/avFN/6R25pXYSYw0T+Ud7ZW8BOGU2GoLzmlij43 4Iw6Hdkz8Nhcbf8u3CZTOeANA6NMYnvhhPIUauN8a8erG6nOLzGq7Yajz/Kp9P7LujeV zlns68ZIwj1ONCTMZevTMdEOMydpZs6FzWCAeGEk0ovfmXtUbh09JY4AxtqgDxwChFMD +1yKdcVFEQOlhMUaj4kmh33URkKahag+IsBbagcb55UnXa9i45YqYPtWfsyXZsSg/Z7x 7+1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=ZNtyub15MKhSPeQkP6H9nBSBTOaOhoYEu7pudWdzVL0=; b=WpSPM0GFtuX1bGFTJ3w943ojMZ/VUru/ZHVo5621FqLX0PYM2nDUdPkh3dlqUNs9t2 +gjQf9mc7LHberudKkKFDuB1jQtZgS5RbfKOLtRWXSEmGNKwxYMvtyWtx8Ny+JBZ2sBX sDmADYRY0i7d6JMgxsf85x9oRxU4ggzsLDbi6GXWA6+uOu4c+DjI+vd0onf3yDFjLyJh ckDuxcgCFEKz0mlZaCHQ5qPUA6xOvrbUODgoyP2I2q9cZdr0xwvEyBCFER/mLuF4ZoXW hQFJ8X9bakjU+rVYc9AH/vLR/bQkgJqWqFA036N0tHGMmMHsBcF6KYRuqukz8gEbhr0C Beaw== X-Gm-Message-State: AHYfb5h0Wdv2QfXDw1Rd6M9SwBinia3EGmjt0CfMcJ2BOMWmu3Sdbgs/ EOgUhwS3TKyhiH1zq9ftiG3/Uzuwq/YuBSQ= X-Google-Smtp-Source: ADKCNb4KYcDFkwpc4zqCjDqlr45m4f7jqIGnq4K4ib+ZzXBTgeXT92GYRq0rh60zXkyV8+Wg8hYcTjWb/xIHrWxxhuo= X-Received: by 10.223.185.109 with SMTP id b42mr4005372wrg.16.1504201083284; Thu, 31 Aug 2017 10:38:03 -0700 (PDT) MIME-Version: 1.0 Sender: stephentalley@gmail.com From: Stephen Talley Date: Thu, 31 Aug 2017 13:38:02 -0400 X-Google-Sender-Auth: 6rrDqm65mdSM2vIVjzwoQMDaqlQ Message-ID: Subject: pre-populate zle for next command? To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="f403045fa9263d74d10558101be9" --f403045fa9263d74d10558101be9 Content-Type: text/plain; charset="UTF-8" Is there any way for a command to pre-populate the the zle for the next command? Suppose I have, for example, a zsh function "buildcmd" that produces a command line (based on supplied arguments, say) that the user would then be able to edit in the zle before hitting enter to accept the line and execute it. The flow would be: % buildcmd --my --args % I know I could just do: % `buildcmd --my --args` to achieve the same thing, but it's a bit more tedious than I'd like. Ideally there'd be some hook (precmd? accept-line?) that could check a variable and pre-populate the zle: buildcmd() { zle_prepopulate="some command to edit" } precmd() { if [ -n "$zle_prepopulate" ] then zle -U "$zle_prepopulate" fi } ...but of course this doesn't quite work because the call to zle is not in the context of a widget. Is there a way? Thanks! Steve --f403045fa9263d74d10558101be9--