From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8850 invoked by alias); 14 Dec 2016 02:08:24 -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: 22217 Received: (qmail 9237 invoked from network); 14 Dec 2016 02:08:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f43.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.213.43):SA:0(0.0/5.0):. Processed in 1.431307 secs); 14 Dec 2016 02:08:24 -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=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_PASS,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com 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.213.43 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=D00lVmLwHaXTf/XKvE7itsyjJT906xnHx99DLERX6zs=; b=y1e7Vj3PWvhHHC9rs856bENx1A7MYM9TUoxMVBVNMvQd2JJjZMElhEkiKIYPcgG3rP ACT/Mi2Ri+LMgnoK4wjgyap7Y5XHKojUraNQJgtyOvLaChzX6hHpatI+d7RUbl3DTC/S G3Y4vyWOTqe58TMGbNc2QX5R/7Z5et1Dd+VAtOpAra1R98p9psorZQH6/+e9EaeEFB50 bIuE+Ntub/X+uvEML456hsebtfBksGYi0r27uFav+4gcbNmvI/yS6AcgR4EsRZiz+m73 1tmZ44RHJh8zuZ07im2TyhjCnn0+F+Z1dpi/YRbr2eOPeYV3roXVkcNant+ndhNDgCUk c6IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=D00lVmLwHaXTf/XKvE7itsyjJT906xnHx99DLERX6zs=; b=inqG5+yqlGxQrN+TVwaM+yCAAJRd4EBzphHEiy0Xja9bb75/TiEV/CcKNnSdqErAVI jSi5ATLB6Gpv/YquKnmX1DjxxV3jyF4L9F6Mk5CEbS3LYJ4qw60XXoK9a+QIjZ0di5Br BpIZGoGbIFt7AvmMnUZYhjRUbgY9B2G2G3ldAPO5bNPgJPTbYlfeQ1c5mxn4uRj0SM/r dxQqsTNzshufwyxo9+/hdQI/jkECFOLUinivl3K6FrCYZ3Zg1agqcDAkyoW5Y/nnFEAY 3/R2Rdq7i17Eysj+MxlYahkLRghHHkDdAwVPMNrz4lREAxvxl23WkcrX4/4a7/AZdMW5 mVHg== X-Gm-Message-State: AKaTC00WMy067Iadud6OnwI4Gfuax9Ku6ZM4sXm9ip4moMY/L6GkTI+0n+imM8wP7VWy4Q== X-Received: by 10.31.69.80 with SMTP id s77mr37769427vka.37.1481677366899; Tue, 13 Dec 2016 17:02:46 -0800 (PST) From: Bart Schaefer Message-Id: <161213170312.ZM23037@torch.brasslantern.com> Date: Tue, 13 Dec 2016 17:03:12 -0800 In-Reply-To: <20161213192941.z3foaju5gslyeqse@spiegl.de> Comments: In reply to Andy Spiegl "Re: Howto to print ENTER to zle-buffer?" (Dec 13, 8:29pm) References: <20161213150101.lgcl6r44gc5b4sia@spiegl.de> <161213081230.ZM21776@torch.brasslantern.com> <20161213164749.5gfrgorfe2ad4edr@spiegl.de> <161213093008.ZM22110@torch.brasslantern.com> <20161213192941.z3foaju5gslyeqse@spiegl.de> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Howto to print ENTER to zle-buffer? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Dec 13, 8:29pm, Andy Spiegl wrote: } Subject: Re: Howto to print ENTER to zle-buffer? } } > Given this -- and assuming you can target zsh-5.3 -- I'd go with: } I'm still stuck with 5.2. Guess I have to wait a while then. :-( No, it can still be done; you'll just have to be sure that your zle-line-init widget doesn't conflict with one the user already has. Actually if you grab Functions/Misc/add-zle-hook-widget from 5.3 and make it part of your session manager, it should work in 5.2. } You define the function "session-startup" Which I typo'd, I left out the () between the function name and the open brace ... } which is then hooked } to zle such that it is run after initialization? How does it show } up in the zle buffer then? No "print -z" anymore? I won't show up in the ZLE buffer, instead it will just execute at the time zle starts up. I don't know why you'd need it to appear in the buffer if it's just going to be accept-line'd immediately, but you can do that like this: session-startup() { zle -U $'command-to-run args\n' add-zle-hook-widget -d line-init $WIDGET } To "backport" that to 5.2 without add-zle-hook-widget: zle-line-init() { if [[ -n $functions[session-startup] ]] then session-startup unfunction session-startup fi # Do whatever the user's zle-line-init did } zle -N zle-line-init session-startup() { zle -U $'command-to-run args\n' }